tests: use alterner.pl
[nit.git] / c_src / standard___stream._sep.c
1 /* This C file is generated by NIT to compile module standard___stream. */
2 #include "standard___stream._sep.h"
3 void standard___stream___IOS___close(val_t p0){
4 struct {struct stack_frame_t me;} fra;
5 val_t tmp;
6 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
7 fra.me.file = LOCATE_standard___stream;
8 fra.me.line = 20;
9 fra.me.meth = LOCATE_standard___stream___IOS___close;
10 fra.me.has_broke = 0;
11 fra.me.REG_size = 0;
12 fra.me.nitni_local_ref_head = NULL;
13 /* ../lib/standard/stream.nit:20 */
14 nit_abort("Deferred method called", NULL, LOCATE_standard___stream, 20);
15 stack_frame_head = fra.me.prev;
16 return;
17 }
18 val_t standard___stream___IStream___read_char(val_t p0){
19 struct {struct stack_frame_t me;} fra;
20 val_t tmp;
21 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
22 fra.me.file = LOCATE_standard___stream;
23 fra.me.line = 27;
24 fra.me.meth = LOCATE_standard___stream___IStream___read_char;
25 fra.me.has_broke = 0;
26 fra.me.REG_size = 0;
27 fra.me.nitni_local_ref_head = NULL;
28 /* ../lib/standard/stream.nit:27 */
29 nit_abort("Deferred method called", NULL, LOCATE_standard___stream, 27);
30 stack_frame_head = fra.me.prev;
31 return NIT_NULL;
32 }
33 val_t standard___stream___IStream___read(val_t p0, val_t p1){
34 struct {struct stack_frame_t me; val_t MORE_REG[1];} fra;
35 val_t REGB0;
36 val_t REGB1;
37 val_t REGB2;
38 val_t REGB3;
39 val_t tmp;
40 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
41 fra.me.file = LOCATE_standard___stream;
42 fra.me.line = 30;
43 fra.me.meth = LOCATE_standard___stream___IStream___read;
44 fra.me.has_broke = 0;
45 fra.me.REG_size = 2;
46 fra.me.nitni_local_ref_head = NULL;
47 fra.me.REG[0] = NIT_NULL;
48 fra.me.REG[1] = NIT_NULL;
49 fra.me.REG[0] = p0;
50 REGB0 = p1;
51 /* ../lib/standard/stream.nit:33 */
52 fra.me.REG[1] = NEW_Buffer_standard___string___Buffer___with_capacity(REGB0);
53 /* ../lib/standard/stream.nit:34 */
54 while(1) {
55 REGB1 = TAG_Int(0);
56 REGB2 = TAG_Bool(VAL_ISA(REGB1, VTCOLOR_standard___kernel___Comparable___OTHER(REGB0), VTID_standard___kernel___Comparable___OTHER(REGB0))) /*cast OTHER*/;
57 if (UNTAG_Bool(REGB2)) {
58 } else {
59 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
60 }
61 /* ../lib/standard/kernel.nit:234 */
62 REGB1 = TAG_Bool(UNTAG_Int(REGB0)>UNTAG_Int(REGB1));
63 /* ../lib/standard/stream.nit:34 */
64 if (UNTAG_Bool(REGB1)) {
65 REGB1 = CALL_standard___stream___IStream___eof(fra.me.REG[0])(fra.me.REG[0]);
66 REGB1 = TAG_Bool(!UNTAG_Bool(REGB1));
67 } else {
68 REGB2 = TAG_Bool(false);
69 REGB1 = REGB2;
70 }
71 if (UNTAG_Bool(REGB1)) {
72 /* ../lib/standard/stream.nit:35 */
73 REGB1 = CALL_standard___stream___IStream___read_char(fra.me.REG[0])(fra.me.REG[0]);
74 /* ../lib/standard/stream.nit:36 */
75 REGB2 = TAG_Int(0);
76 REGB3 = TAG_Bool(VAL_ISA(REGB2, VTCOLOR_standard___kernel___Comparable___OTHER(REGB1), VTID_standard___kernel___Comparable___OTHER(REGB1))) /*cast OTHER*/;
77 if (UNTAG_Bool(REGB3)) {
78 } else {
79 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
80 }
81 /* ../lib/standard/kernel.nit:233 */
82 REGB2 = TAG_Bool(UNTAG_Int(REGB1)>=UNTAG_Int(REGB2));
83 /* ../lib/standard/stream.nit:36 */
84 if (UNTAG_Bool(REGB2)) {
85 /* ../lib/standard/kernel.nit:297 */
86 REGB1 = TAG_Char(UNTAG_Int(REGB1));
87 /* ../lib/standard/stream.nit:37 */
88 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], REGB1);
89 /* ../lib/standard/stream.nit:38 */
90 REGB1 = TAG_Int(1);
91 /* ../lib/standard/kernel.nit:237 */
92 REGB1 = TAG_Int(UNTAG_Int(REGB0)-UNTAG_Int(REGB1));
93 /* ../lib/standard/stream.nit:38 */
94 REGB0 = REGB1;
95 }
96 } else {
97 /* ../lib/standard/stream.nit:34 */
98 goto label1;
99 }
100 }
101 label1: while(0);
102 /* ../lib/standard/stream.nit:41 */
103 fra.me.REG[1] = CALL_standard___string___Object___to_s(fra.me.REG[1])(fra.me.REG[1]);
104 goto label2;
105 label2: while(0);
106 stack_frame_head = fra.me.prev;
107 return fra.me.REG[1];
108 }
109 val_t standard___stream___IStream___read_line(val_t p0){
110 struct {struct stack_frame_t me; val_t MORE_REG[1];} fra;
111 val_t REGB0;
112 val_t tmp;
113 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
114 fra.me.file = LOCATE_standard___stream;
115 fra.me.line = 44;
116 fra.me.meth = LOCATE_standard___stream___IStream___read_line;
117 fra.me.has_broke = 0;
118 fra.me.REG_size = 2;
119 fra.me.nitni_local_ref_head = NULL;
120 fra.me.REG[0] = NIT_NULL;
121 fra.me.REG[1] = NIT_NULL;
122 fra.me.REG[0] = p0;
123 /* ../lib/standard/stream.nit:47 */
124 REGB0 = CALL_standard___stream___IStream___eof(fra.me.REG[0])(fra.me.REG[0]);
125 REGB0 = TAG_Bool(!UNTAG_Bool(REGB0));
126 if (UNTAG_Bool(REGB0)) {
127 } else {
128 nit_abort("Assert failed", NULL, LOCATE_standard___stream, 47);
129 }
130 /* ../lib/standard/stream.nit:48 */
131 fra.me.REG[1] = NEW_Buffer_standard___string___Buffer___init();
132 /* ../lib/standard/stream.nit:49 */
133 CALL_standard___stream___IStream___append_line_to(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1]);
134 /* ../lib/standard/stream.nit:50 */
135 fra.me.REG[1] = CALL_standard___string___Object___to_s(fra.me.REG[1])(fra.me.REG[1]);
136 goto label1;
137 label1: while(0);
138 stack_frame_head = fra.me.prev;
139 return fra.me.REG[1];
140 }
141 val_t standard___stream___IStream___read_all(val_t p0){
142 struct {struct stack_frame_t me; val_t MORE_REG[1];} fra;
143 val_t REGB0;
144 val_t REGB1;
145 val_t REGB2;
146 val_t tmp;
147 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
148 fra.me.file = LOCATE_standard___stream;
149 fra.me.line = 53;
150 fra.me.meth = LOCATE_standard___stream___IStream___read_all;
151 fra.me.has_broke = 0;
152 fra.me.REG_size = 2;
153 fra.me.nitni_local_ref_head = NULL;
154 fra.me.REG[0] = NIT_NULL;
155 fra.me.REG[1] = NIT_NULL;
156 fra.me.REG[0] = p0;
157 /* ../lib/standard/stream.nit:56 */
158 fra.me.REG[1] = NEW_Buffer_standard___string___Buffer___init();
159 /* ../lib/standard/stream.nit:57 */
160 while(1) {
161 REGB0 = CALL_standard___stream___IStream___eof(fra.me.REG[0])(fra.me.REG[0]);
162 REGB0 = TAG_Bool(!UNTAG_Bool(REGB0));
163 if (UNTAG_Bool(REGB0)) {
164 /* ../lib/standard/stream.nit:58 */
165 REGB0 = CALL_standard___stream___IStream___read_char(fra.me.REG[0])(fra.me.REG[0]);
166 /* ../lib/standard/stream.nit:59 */
167 REGB1 = TAG_Int(0);
168 REGB2 = TAG_Bool(VAL_ISA(REGB1, VTCOLOR_standard___kernel___Comparable___OTHER(REGB0), VTID_standard___kernel___Comparable___OTHER(REGB0))) /*cast OTHER*/;
169 if (UNTAG_Bool(REGB2)) {
170 } else {
171 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
172 }
173 /* ../lib/standard/kernel.nit:233 */
174 REGB1 = TAG_Bool(UNTAG_Int(REGB0)>=UNTAG_Int(REGB1));
175 /* ../lib/standard/stream.nit:59 */
176 if (UNTAG_Bool(REGB1)) {
177 /* ../lib/standard/kernel.nit:297 */
178 REGB0 = TAG_Char(UNTAG_Int(REGB0));
179 /* ../lib/standard/stream.nit:59 */
180 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], REGB0);
181 }
182 } else {
183 /* ../lib/standard/stream.nit:57 */
184 goto label1;
185 }
186 }
187 label1: while(0);
188 /* ../lib/standard/stream.nit:61 */
189 fra.me.REG[1] = CALL_standard___string___Object___to_s(fra.me.REG[1])(fra.me.REG[1]);
190 goto label2;
191 label2: while(0);
192 stack_frame_head = fra.me.prev;
193 return fra.me.REG[1];
194 }
195 void standard___stream___IStream___append_line_to(val_t p0, val_t p1){
196 struct {struct stack_frame_t me; val_t MORE_REG[1];} fra;
197 val_t REGB0;
198 val_t REGB1;
199 val_t REGB2;
200 val_t tmp;
201 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
202 fra.me.file = LOCATE_standard___stream;
203 fra.me.line = 64;
204 fra.me.meth = LOCATE_standard___stream___IStream___append_line_to;
205 fra.me.has_broke = 0;
206 fra.me.REG_size = 2;
207 fra.me.nitni_local_ref_head = NULL;
208 fra.me.REG[0] = NIT_NULL;
209 fra.me.REG[1] = NIT_NULL;
210 fra.me.REG[0] = p0;
211 fra.me.REG[1] = p1;
212 /* ../lib/standard/stream.nit:67 */
213 while(1) {
214 /* ../lib/standard/stream.nit:68 */
215 REGB0 = CALL_standard___stream___IStream___read_char(fra.me.REG[0])(fra.me.REG[0]);
216 /* ../lib/standard/stream.nit:69 */
217 REGB1 = TAG_Int(1);
218 /* ../lib/standard/kernel.nit:236 */
219 REGB1 = TAG_Int(-UNTAG_Int(REGB1));
220 /* ../lib/standard/stream.nit:69 */
221 REGB2 = TAG_Bool(IS_EQUAL_OO(REGB0,REGB1));
222 if (UNTAG_Bool(REGB2)) {
223 } else {
224 /* ../lib/standard/kernel.nit:227 */
225 REGB1 = TAG_Bool((REGB0)==(REGB1));
226 /* ../lib/standard/stream.nit:69 */
227 REGB2 = REGB1;
228 }
229 if (UNTAG_Bool(REGB2)) {
230 /* ../lib/standard/stream.nit:70 */
231 REGB2 = CALL_standard___stream___IStream___eof(fra.me.REG[0])(fra.me.REG[0]);
232 if (UNTAG_Bool(REGB2)) {
233 goto label1;
234 }
235 } else {
236 /* ../lib/standard/kernel.nit:297 */
237 REGB0 = TAG_Char(UNTAG_Int(REGB0));
238 /* ../lib/standard/stream.nit:73 */
239 CALL_standard___collection___abstract_collection___Sequence___push(fra.me.REG[1])(fra.me.REG[1], REGB0);
240 /* ../lib/standard/stream.nit:74 */
241 REGB2 = TAG_Char('\n');
242 REGB1 = TAG_Bool(IS_EQUAL_OO(REGB0,REGB2));
243 if (UNTAG_Bool(REGB1)) {
244 } else {
245 /* ../lib/standard/kernel.nit:378 */
246 REGB2 = TAG_Bool((REGB0)==(REGB2));
247 /* ../lib/standard/stream.nit:74 */
248 REGB1 = REGB2;
249 }
250 if (UNTAG_Bool(REGB1)) {
251 goto label1;
252 }
253 }
254 }
255 label1: while(0);
256 stack_frame_head = fra.me.prev;
257 return;
258 }
259 val_t standard___stream___IStream___eof(val_t p0){
260 struct {struct stack_frame_t me;} fra;
261 val_t tmp;
262 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
263 fra.me.file = LOCATE_standard___stream;
264 fra.me.line = 79;
265 fra.me.meth = LOCATE_standard___stream___IStream___eof;
266 fra.me.has_broke = 0;
267 fra.me.REG_size = 0;
268 fra.me.nitni_local_ref_head = NULL;
269 /* ../lib/standard/stream.nit:79 */
270 nit_abort("Deferred method called", NULL, LOCATE_standard___stream, 79);
271 stack_frame_head = fra.me.prev;
272 return NIT_NULL;
273 }
274 void standard___stream___OStream___write(val_t p0, val_t p1){
275 struct {struct stack_frame_t me;} fra;
276 val_t tmp;
277 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
278 fra.me.file = LOCATE_standard___stream;
279 fra.me.line = 86;
280 fra.me.meth = LOCATE_standard___stream___OStream___write;
281 fra.me.has_broke = 0;
282 fra.me.REG_size = 0;
283 fra.me.nitni_local_ref_head = NULL;
284 /* ../lib/standard/stream.nit:86 */
285 nit_abort("Deferred method called", NULL, LOCATE_standard___stream, 86);
286 stack_frame_head = fra.me.prev;
287 return;
288 }
289 val_t standard___stream___OStream___is_writable(val_t p0){
290 struct {struct stack_frame_t me;} fra;
291 val_t tmp;
292 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
293 fra.me.file = LOCATE_standard___stream;
294 fra.me.line = 89;
295 fra.me.meth = LOCATE_standard___stream___OStream___is_writable;
296 fra.me.has_broke = 0;
297 fra.me.REG_size = 0;
298 fra.me.nitni_local_ref_head = NULL;
299 /* ../lib/standard/stream.nit:89 */
300 nit_abort("Deferred method called", NULL, LOCATE_standard___stream, 89);
301 stack_frame_head = fra.me.prev;
302 return NIT_NULL;
303 }
304 val_t standard___stream___BufferedIStream___read_char(val_t p0){
305 struct {struct stack_frame_t me; val_t MORE_REG[1];} fra;
306 val_t REGB0;
307 val_t REGB1;
308 val_t REGB2;
309 val_t REGB3;
310 val_t tmp;
311 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
312 fra.me.file = LOCATE_standard___stream;
313 fra.me.line = 96;
314 fra.me.meth = LOCATE_standard___stream___BufferedIStream___read_char;
315 fra.me.has_broke = 0;
316 fra.me.REG_size = 2;
317 fra.me.nitni_local_ref_head = NULL;
318 fra.me.REG[0] = NIT_NULL;
319 fra.me.REG[1] = NIT_NULL;
320 fra.me.REG[0] = p0;
321 /* ../lib/standard/stream.nit:98 */
322 REGB0 = CALL_standard___stream___IStream___eof(fra.me.REG[0])(fra.me.REG[0]);
323 REGB0 = TAG_Bool(!UNTAG_Bool(REGB0));
324 if (UNTAG_Bool(REGB0)) {
325 } else {
326 nit_abort("Assert failed", NULL, LOCATE_standard___stream, 98);
327 }
328 /* ../lib/standard/stream.nit:99 */
329 REGB0 = TAG_Bool(ATTR_standard___stream___BufferedIStream____buffer_pos(fra.me.REG[0])!=NIT_NULL);
330 if (UNTAG_Bool(REGB0)) {
331 } else {
332 nit_abort("Uninitialized attribute %s", "_buffer_pos", LOCATE_standard___stream, 99);
333 }
334 REGB0 = ATTR_standard___stream___BufferedIStream____buffer_pos(fra.me.REG[0]);
335 fra.me.REG[1] = ATTR_standard___stream___BufferedIStream____buffer(fra.me.REG[0]);
336 REGB1 = TAG_Bool(fra.me.REG[1]==NIT_NULL);
337 if (UNTAG_Bool(REGB1)) {
338 nit_abort("Reciever is null", NULL, LOCATE_standard___stream, 99);
339 }
340 /* ../lib/standard/collection/array.nit:24 */
341 REGB1 = TAG_Bool(ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[1])!=NIT_NULL);
342 if (UNTAG_Bool(REGB1)) {
343 } else {
344 nit_abort("Uninitialized attribute %s", "_length", LOCATE_standard___collection___array, 24);
345 }
346 REGB1 = ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[1]);
347 REGB2 = TAG_Bool(VAL_ISA(REGB1, VTCOLOR_standard___kernel___Comparable___OTHER(REGB0), VTID_standard___kernel___Comparable___OTHER(REGB0))) /*cast OTHER*/;
348 if (UNTAG_Bool(REGB2)) {
349 } else {
350 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
351 }
352 /* ../lib/standard/kernel.nit:233 */
353 REGB1 = TAG_Bool(UNTAG_Int(REGB0)>=UNTAG_Int(REGB1));
354 /* ../lib/standard/stream.nit:99 */
355 if (UNTAG_Bool(REGB1)) {
356 /* ../lib/standard/stream.nit:100 */
357 CALL_standard___stream___BufferedIStream___fill_buffer(fra.me.REG[0])(fra.me.REG[0]);
358 }
359 /* ../lib/standard/stream.nit:102 */
360 REGB1 = TAG_Bool(ATTR_standard___stream___BufferedIStream____buffer_pos(fra.me.REG[0])!=NIT_NULL);
361 if (UNTAG_Bool(REGB1)) {
362 } else {
363 nit_abort("Uninitialized attribute %s", "_buffer_pos", LOCATE_standard___stream, 102);
364 }
365 REGB1 = ATTR_standard___stream___BufferedIStream____buffer_pos(fra.me.REG[0]);
366 fra.me.REG[1] = ATTR_standard___stream___BufferedIStream____buffer(fra.me.REG[0]);
367 REGB0 = TAG_Bool(fra.me.REG[1]==NIT_NULL);
368 if (UNTAG_Bool(REGB0)) {
369 nit_abort("Reciever is null", NULL, LOCATE_standard___stream, 102);
370 }
371 /* ../lib/standard/collection/array.nit:24 */
372 REGB0 = TAG_Bool(ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[1])!=NIT_NULL);
373 if (UNTAG_Bool(REGB0)) {
374 } else {
375 nit_abort("Uninitialized attribute %s", "_length", LOCATE_standard___collection___array, 24);
376 }
377 REGB0 = ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[1]);
378 REGB2 = TAG_Bool(VAL_ISA(REGB0, VTCOLOR_standard___kernel___Comparable___OTHER(REGB1), VTID_standard___kernel___Comparable___OTHER(REGB1))) /*cast OTHER*/;
379 if (UNTAG_Bool(REGB2)) {
380 } else {
381 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
382 }
383 /* ../lib/standard/kernel.nit:233 */
384 REGB0 = TAG_Bool(UNTAG_Int(REGB1)>=UNTAG_Int(REGB0));
385 /* ../lib/standard/stream.nit:102 */
386 if (UNTAG_Bool(REGB0)) {
387 /* ../lib/standard/stream.nit:103 */
388 REGB0 = TAG_Int(1);
389 /* ../lib/standard/kernel.nit:236 */
390 REGB0 = TAG_Int(-UNTAG_Int(REGB0));
391 /* ../lib/standard/stream.nit:103 */
392 goto label1;
393 }
394 /* ../lib/standard/stream.nit:105 */
395 fra.me.REG[1] = ATTR_standard___stream___BufferedIStream____buffer(fra.me.REG[0]);
396 REGB1 = TAG_Bool(ATTR_standard___stream___BufferedIStream____buffer_pos(fra.me.REG[0])!=NIT_NULL);
397 if (UNTAG_Bool(REGB1)) {
398 } else {
399 nit_abort("Uninitialized attribute %s", "_buffer_pos", LOCATE_standard___stream, 105);
400 }
401 REGB1 = ATTR_standard___stream___BufferedIStream____buffer_pos(fra.me.REG[0]);
402 REGB2 = TAG_Bool(fra.me.REG[1]==NIT_NULL);
403 if (UNTAG_Bool(REGB2)) {
404 nit_abort("Reciever is null", NULL, LOCATE_standard___stream, 105);
405 }
406 REGB1 = CALL_standard___collection___abstract_collection___SequenceRead_____bra(fra.me.REG[1])(fra.me.REG[1], REGB1);
407 /* ../lib/standard/stream.nit:106 */
408 REGB2 = ATTR_standard___stream___BufferedIStream____buffer_pos(fra.me.REG[0]);
409 REGB3 = TAG_Int(1);
410 /* ../lib/standard/kernel.nit:235 */
411 REGB3 = TAG_Int(UNTAG_Int(REGB2)+UNTAG_Int(REGB3));
412 /* ../lib/standard/stream.nit:106 */
413 ATTR_standard___stream___BufferedIStream____buffer_pos(fra.me.REG[0]) = REGB3;
414 /* ../lib/standard/kernel.nit:413 */
415 REGB1 = TAG_Int((unsigned char)UNTAG_Char(REGB1));
416 /* ../lib/standard/stream.nit:107 */
417 REGB0 = REGB1;
418 goto label1;
419 label1: while(0);
420 stack_frame_head = fra.me.prev;
421 return REGB0;
422 }
423 val_t standard___stream___BufferedIStream___read(val_t p0, val_t p1){
424 struct {struct stack_frame_t me; val_t MORE_REG[3];} fra;
425 val_t REGB0;
426 val_t REGB1;
427 val_t REGB2;
428 val_t REGB3;
429 val_t REGB4;
430 val_t tmp;
431 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
432 fra.me.file = LOCATE_standard___stream;
433 fra.me.line = 110;
434 fra.me.meth = LOCATE_standard___stream___BufferedIStream___read;
435 fra.me.has_broke = 0;
436 fra.me.REG_size = 4;
437 fra.me.nitni_local_ref_head = NULL;
438 fra.me.REG[0] = NIT_NULL;
439 fra.me.REG[1] = NIT_NULL;
440 fra.me.REG[2] = NIT_NULL;
441 fra.me.REG[3] = NIT_NULL;
442 fra.me.REG[0] = p0;
443 REGB0 = p1;
444 /* ../lib/standard/stream.nit:112 */
445 fra.me.REG[1] = NEW_Buffer_standard___string___Buffer___with_capacity(REGB0);
446 /* ../lib/standard/stream.nit:113 */
447 REGB1 = TAG_Bool(ATTR_standard___stream___BufferedIStream____buffer_pos(fra.me.REG[0])!=NIT_NULL);
448 if (UNTAG_Bool(REGB1)) {
449 } else {
450 nit_abort("Uninitialized attribute %s", "_buffer_pos", LOCATE_standard___stream, 113);
451 }
452 REGB1 = ATTR_standard___stream___BufferedIStream____buffer_pos(fra.me.REG[0]);
453 /* ../lib/standard/stream.nit:114 */
454 fra.me.REG[2] = ATTR_standard___stream___BufferedIStream____buffer(fra.me.REG[0]);
455 REGB2 = TAG_Bool(fra.me.REG[2]==NIT_NULL);
456 if (UNTAG_Bool(REGB2)) {
457 nit_abort("Reciever is null", NULL, LOCATE_standard___stream, 114);
458 }
459 /* ../lib/standard/collection/array.nit:24 */
460 REGB2 = TAG_Bool(ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[2])!=NIT_NULL);
461 if (UNTAG_Bool(REGB2)) {
462 } else {
463 nit_abort("Uninitialized attribute %s", "_length", LOCATE_standard___collection___array, 24);
464 }
465 REGB2 = ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[2]);
466 /* ../lib/standard/stream.nit:115 */
467 while(1) {
468 REGB3 = TAG_Int(0);
469 REGB4 = TAG_Bool(VAL_ISA(REGB3, VTCOLOR_standard___kernel___Comparable___OTHER(REGB0), VTID_standard___kernel___Comparable___OTHER(REGB0))) /*cast OTHER*/;
470 if (UNTAG_Bool(REGB4)) {
471 } else {
472 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
473 }
474 /* ../lib/standard/kernel.nit:234 */
475 REGB3 = TAG_Bool(UNTAG_Int(REGB0)>UNTAG_Int(REGB3));
476 /* ../lib/standard/stream.nit:115 */
477 if (UNTAG_Bool(REGB3)) {
478 REGB3 = TAG_Bool(VAL_ISA(REGB2, VTCOLOR_standard___kernel___Comparable___OTHER(REGB1), VTID_standard___kernel___Comparable___OTHER(REGB1))) /*cast OTHER*/;
479 if (UNTAG_Bool(REGB3)) {
480 } else {
481 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
482 }
483 /* ../lib/standard/kernel.nit:233 */
484 REGB3 = TAG_Bool(UNTAG_Int(REGB1)>=UNTAG_Int(REGB2));
485 /* ../lib/standard/stream.nit:116 */
486 if (UNTAG_Bool(REGB3)) {
487 /* ../lib/standard/stream.nit:117 */
488 CALL_standard___stream___BufferedIStream___fill_buffer(fra.me.REG[0])(fra.me.REG[0]);
489 /* ../lib/standard/stream.nit:118 */
490 REGB3 = CALL_standard___stream___IStream___eof(fra.me.REG[0])(fra.me.REG[0]);
491 if (UNTAG_Bool(REGB3)) {
492 fra.me.REG[2] = CALL_standard___string___Object___to_s(fra.me.REG[1])(fra.me.REG[1]);
493 goto label1;
494 }
495 /* ../lib/standard/stream.nit:119 */
496 REGB3 = TAG_Bool(ATTR_standard___stream___BufferedIStream____buffer_pos(fra.me.REG[0])!=NIT_NULL);
497 if (UNTAG_Bool(REGB3)) {
498 } else {
499 nit_abort("Uninitialized attribute %s", "_buffer_pos", LOCATE_standard___stream, 119);
500 }
501 REGB3 = ATTR_standard___stream___BufferedIStream____buffer_pos(fra.me.REG[0]);
502 REGB1 = REGB3;
503 /* ../lib/standard/stream.nit:120 */
504 fra.me.REG[3] = ATTR_standard___stream___BufferedIStream____buffer(fra.me.REG[0]);
505 REGB3 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
506 if (UNTAG_Bool(REGB3)) {
507 nit_abort("Reciever is null", NULL, LOCATE_standard___stream, 120);
508 }
509 /* ../lib/standard/collection/array.nit:24 */
510 REGB3 = TAG_Bool(ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[3])!=NIT_NULL);
511 if (UNTAG_Bool(REGB3)) {
512 } else {
513 nit_abort("Uninitialized attribute %s", "_length", LOCATE_standard___collection___array, 24);
514 }
515 REGB3 = ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[3]);
516 /* ../lib/standard/stream.nit:120 */
517 REGB2 = REGB3;
518 }
519 /* ../lib/standard/stream.nit:122 */
520 while(1) {
521 REGB3 = TAG_Bool(VAL_ISA(REGB2, VTCOLOR_standard___kernel___Comparable___OTHER(REGB1), VTID_standard___kernel___Comparable___OTHER(REGB1))) /*cast OTHER*/;
522 if (UNTAG_Bool(REGB3)) {
523 } else {
524 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
525 }
526 /* ../lib/standard/kernel.nit:232 */
527 REGB3 = TAG_Bool(UNTAG_Int(REGB1)<UNTAG_Int(REGB2));
528 /* ../lib/standard/stream.nit:122 */
529 if (UNTAG_Bool(REGB3)) {
530 REGB3 = TAG_Int(0);
531 REGB4 = TAG_Bool(VAL_ISA(REGB3, VTCOLOR_standard___kernel___Comparable___OTHER(REGB0), VTID_standard___kernel___Comparable___OTHER(REGB0))) /*cast OTHER*/;
532 if (UNTAG_Bool(REGB4)) {
533 } else {
534 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
535 }
536 /* ../lib/standard/kernel.nit:234 */
537 REGB3 = TAG_Bool(UNTAG_Int(REGB0)>UNTAG_Int(REGB3));
538 } else {
539 /* ../lib/standard/stream.nit:122 */
540 REGB4 = TAG_Bool(false);
541 REGB3 = REGB4;
542 }
543 if (UNTAG_Bool(REGB3)) {
544 /* ../lib/standard/stream.nit:123 */
545 fra.me.REG[3] = ATTR_standard___stream___BufferedIStream____buffer(fra.me.REG[0]);
546 REGB3 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
547 if (UNTAG_Bool(REGB3)) {
548 nit_abort("Reciever is null", NULL, LOCATE_standard___stream, 123);
549 }
550 REGB3 = CALL_standard___collection___abstract_collection___SequenceRead_____bra(fra.me.REG[3])(fra.me.REG[3], REGB1);
551 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], REGB3);
552 /* ../lib/standard/stream.nit:124 */
553 REGB3 = TAG_Int(1);
554 /* ../lib/standard/kernel.nit:235 */
555 REGB3 = TAG_Int(UNTAG_Int(REGB1)+UNTAG_Int(REGB3));
556 /* ../lib/standard/stream.nit:124 */
557 REGB1 = REGB3;
558 /* ../lib/standard/stream.nit:125 */
559 REGB3 = TAG_Int(1);
560 /* ../lib/standard/kernel.nit:237 */
561 REGB3 = TAG_Int(UNTAG_Int(REGB0)-UNTAG_Int(REGB3));
562 /* ../lib/standard/stream.nit:125 */
563 REGB0 = REGB3;
564 } else {
565 /* ../lib/standard/stream.nit:122 */
566 goto label2;
567 }
568 }
569 label2: while(0);
570 } else {
571 /* ../lib/standard/stream.nit:115 */
572 goto label3;
573 }
574 }
575 label3: while(0);
576 /* ../lib/standard/stream.nit:128 */
577 ATTR_standard___stream___BufferedIStream____buffer_pos(fra.me.REG[0]) = REGB1;
578 /* ../lib/standard/stream.nit:129 */
579 fra.me.REG[1] = CALL_standard___string___Object___to_s(fra.me.REG[1])(fra.me.REG[1]);
580 fra.me.REG[2] = fra.me.REG[1];
581 goto label1;
582 label1: while(0);
583 stack_frame_head = fra.me.prev;
584 return fra.me.REG[2];
585 }
586 val_t standard___stream___BufferedIStream___read_all(val_t p0){
587 struct {struct stack_frame_t me; val_t MORE_REG[2];} fra;
588 val_t REGB0;
589 val_t REGB1;
590 val_t REGB2;
591 val_t tmp;
592 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
593 fra.me.file = LOCATE_standard___stream;
594 fra.me.line = 132;
595 fra.me.meth = LOCATE_standard___stream___BufferedIStream___read_all;
596 fra.me.has_broke = 0;
597 fra.me.REG_size = 3;
598 fra.me.nitni_local_ref_head = NULL;
599 fra.me.REG[0] = NIT_NULL;
600 fra.me.REG[1] = NIT_NULL;
601 fra.me.REG[2] = NIT_NULL;
602 fra.me.REG[0] = p0;
603 /* ../lib/standard/stream.nit:134 */
604 fra.me.REG[1] = NEW_Buffer_standard___string___Buffer___init();
605 /* ../lib/standard/stream.nit:135 */
606 while(1) {
607 REGB0 = CALL_standard___stream___IStream___eof(fra.me.REG[0])(fra.me.REG[0]);
608 REGB0 = TAG_Bool(!UNTAG_Bool(REGB0));
609 if (UNTAG_Bool(REGB0)) {
610 /* ../lib/standard/stream.nit:136 */
611 REGB0 = TAG_Bool(ATTR_standard___stream___BufferedIStream____buffer_pos(fra.me.REG[0])!=NIT_NULL);
612 if (UNTAG_Bool(REGB0)) {
613 } else {
614 nit_abort("Uninitialized attribute %s", "_buffer_pos", LOCATE_standard___stream, 136);
615 }
616 REGB0 = ATTR_standard___stream___BufferedIStream____buffer_pos(fra.me.REG[0]);
617 /* ../lib/standard/stream.nit:137 */
618 fra.me.REG[2] = ATTR_standard___stream___BufferedIStream____buffer(fra.me.REG[0]);
619 REGB1 = TAG_Bool(fra.me.REG[2]==NIT_NULL);
620 if (UNTAG_Bool(REGB1)) {
621 nit_abort("Reciever is null", NULL, LOCATE_standard___stream, 137);
622 }
623 /* ../lib/standard/collection/array.nit:24 */
624 REGB1 = TAG_Bool(ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[2])!=NIT_NULL);
625 if (UNTAG_Bool(REGB1)) {
626 } else {
627 nit_abort("Uninitialized attribute %s", "_length", LOCATE_standard___collection___array, 24);
628 }
629 REGB1 = ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[2]);
630 /* ../lib/standard/stream.nit:138 */
631 while(1) {
632 REGB2 = TAG_Bool(VAL_ISA(REGB1, VTCOLOR_standard___kernel___Comparable___OTHER(REGB0), VTID_standard___kernel___Comparable___OTHER(REGB0))) /*cast OTHER*/;
633 if (UNTAG_Bool(REGB2)) {
634 } else {
635 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
636 }
637 /* ../lib/standard/kernel.nit:232 */
638 REGB2 = TAG_Bool(UNTAG_Int(REGB0)<UNTAG_Int(REGB1));
639 /* ../lib/standard/stream.nit:138 */
640 if (UNTAG_Bool(REGB2)) {
641 /* ../lib/standard/stream.nit:139 */
642 fra.me.REG[2] = ATTR_standard___stream___BufferedIStream____buffer(fra.me.REG[0]);
643 REGB2 = TAG_Bool(fra.me.REG[2]==NIT_NULL);
644 if (UNTAG_Bool(REGB2)) {
645 nit_abort("Reciever is null", NULL, LOCATE_standard___stream, 139);
646 }
647 REGB2 = CALL_standard___collection___abstract_collection___SequenceRead_____bra(fra.me.REG[2])(fra.me.REG[2], REGB0);
648 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], REGB2);
649 /* ../lib/standard/stream.nit:140 */
650 REGB2 = TAG_Int(1);
651 /* ../lib/standard/kernel.nit:235 */
652 REGB2 = TAG_Int(UNTAG_Int(REGB0)+UNTAG_Int(REGB2));
653 /* ../lib/standard/stream.nit:140 */
654 REGB0 = REGB2;
655 } else {
656 /* ../lib/standard/stream.nit:138 */
657 goto label1;
658 }
659 }
660 label1: while(0);
661 /* ../lib/standard/stream.nit:142 */
662 ATTR_standard___stream___BufferedIStream____buffer_pos(fra.me.REG[0]) = REGB0;
663 /* ../lib/standard/stream.nit:143 */
664 CALL_standard___stream___BufferedIStream___fill_buffer(fra.me.REG[0])(fra.me.REG[0]);
665 } else {
666 /* ../lib/standard/stream.nit:135 */
667 goto label2;
668 }
669 }
670 label2: while(0);
671 /* ../lib/standard/stream.nit:145 */
672 fra.me.REG[1] = CALL_standard___string___Object___to_s(fra.me.REG[1])(fra.me.REG[1]);
673 goto label3;
674 label3: while(0);
675 stack_frame_head = fra.me.prev;
676 return fra.me.REG[1];
677 }
678 void standard___stream___BufferedIStream___append_line_to(val_t p0, val_t p1){
679 struct {struct stack_frame_t me; val_t MORE_REG[2];} fra;
680 val_t REGB0;
681 val_t REGB1;
682 val_t REGB2;
683 val_t REGB3;
684 val_t tmp;
685 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
686 fra.me.file = LOCATE_standard___stream;
687 fra.me.line = 148;
688 fra.me.meth = LOCATE_standard___stream___BufferedIStream___append_line_to;
689 fra.me.has_broke = 0;
690 fra.me.REG_size = 3;
691 fra.me.nitni_local_ref_head = NULL;
692 fra.me.REG[0] = NIT_NULL;
693 fra.me.REG[1] = NIT_NULL;
694 fra.me.REG[2] = NIT_NULL;
695 fra.me.REG[0] = p0;
696 fra.me.REG[1] = p1;
697 /* ../lib/standard/stream.nit:150 */
698 while(1) {
699 /* ../lib/standard/stream.nit:152 */
700 REGB0 = TAG_Bool(ATTR_standard___stream___BufferedIStream____buffer_pos(fra.me.REG[0])!=NIT_NULL);
701 if (UNTAG_Bool(REGB0)) {
702 } else {
703 nit_abort("Uninitialized attribute %s", "_buffer_pos", LOCATE_standard___stream, 152);
704 }
705 REGB0 = ATTR_standard___stream___BufferedIStream____buffer_pos(fra.me.REG[0]);
706 /* ../lib/standard/stream.nit:153 */
707 while(1) {
708 fra.me.REG[2] = ATTR_standard___stream___BufferedIStream____buffer(fra.me.REG[0]);
709 REGB1 = TAG_Bool(fra.me.REG[2]==NIT_NULL);
710 if (UNTAG_Bool(REGB1)) {
711 nit_abort("Reciever is null", NULL, LOCATE_standard___stream, 153);
712 }
713 /* ../lib/standard/collection/array.nit:24 */
714 REGB1 = TAG_Bool(ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[2])!=NIT_NULL);
715 if (UNTAG_Bool(REGB1)) {
716 } else {
717 nit_abort("Uninitialized attribute %s", "_length", LOCATE_standard___collection___array, 24);
718 }
719 REGB1 = ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[2]);
720 REGB2 = TAG_Bool(VAL_ISA(REGB1, VTCOLOR_standard___kernel___Comparable___OTHER(REGB0), VTID_standard___kernel___Comparable___OTHER(REGB0))) /*cast OTHER*/;
721 if (UNTAG_Bool(REGB2)) {
722 } else {
723 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
724 }
725 /* ../lib/standard/kernel.nit:232 */
726 REGB1 = TAG_Bool(UNTAG_Int(REGB0)<UNTAG_Int(REGB1));
727 /* ../lib/standard/stream.nit:153 */
728 if (UNTAG_Bool(REGB1)) {
729 fra.me.REG[2] = ATTR_standard___stream___BufferedIStream____buffer(fra.me.REG[0]);
730 REGB1 = TAG_Bool(fra.me.REG[2]==NIT_NULL);
731 if (UNTAG_Bool(REGB1)) {
732 nit_abort("Reciever is null", NULL, LOCATE_standard___stream, 153);
733 }
734 REGB1 = CALL_standard___collection___abstract_collection___SequenceRead_____bra(fra.me.REG[2])(fra.me.REG[2], REGB0);
735 REGB2 = TAG_Char('\n');
736 REGB3 = TAG_Bool(IS_EQUAL_OO(REGB1,REGB2));
737 if (UNTAG_Bool(REGB3)) {
738 } else {
739 /* ../lib/standard/kernel.nit:378 */
740 REGB2 = TAG_Bool((REGB1)==(REGB2));
741 /* ../lib/standard/stream.nit:153 */
742 REGB3 = REGB2;
743 }
744 REGB3 = TAG_Bool(!UNTAG_Bool(REGB3));
745 } else {
746 REGB2 = TAG_Bool(false);
747 REGB3 = REGB2;
748 }
749 if (UNTAG_Bool(REGB3)) {
750 REGB3 = TAG_Int(1);
751 /* ../lib/standard/kernel.nit:235 */
752 REGB3 = TAG_Int(UNTAG_Int(REGB0)+UNTAG_Int(REGB3));
753 /* ../lib/standard/stream.nit:153 */
754 REGB0 = REGB3;
755 } else {
756 goto label1;
757 }
758 }
759 label1: while(0);
760 /* ../lib/standard/stream.nit:156 */
761 REGB3 = TAG_Bool(ATTR_standard___stream___BufferedIStream____buffer_pos(fra.me.REG[0])!=NIT_NULL);
762 if (UNTAG_Bool(REGB3)) {
763 } else {
764 nit_abort("Uninitialized attribute %s", "_buffer_pos", LOCATE_standard___stream, 156);
765 }
766 REGB3 = ATTR_standard___stream___BufferedIStream____buffer_pos(fra.me.REG[0]);
767 REGB2 = TAG_Bool(VAL_ISA(REGB3, VTCOLOR_standard___kernel___Comparable___OTHER(REGB0), VTID_standard___kernel___Comparable___OTHER(REGB0))) /*cast OTHER*/;
768 if (UNTAG_Bool(REGB2)) {
769 } else {
770 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
771 }
772 /* ../lib/standard/kernel.nit:234 */
773 REGB3 = TAG_Bool(UNTAG_Int(REGB0)>UNTAG_Int(REGB3));
774 /* ../lib/standard/stream.nit:156 */
775 if (UNTAG_Bool(REGB3)) {
776 /* ../lib/standard/collection/array.nit:24 */
777 REGB3 = TAG_Bool(ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[1])!=NIT_NULL);
778 if (UNTAG_Bool(REGB3)) {
779 } else {
780 nit_abort("Uninitialized attribute %s", "_length", LOCATE_standard___collection___array, 24);
781 }
782 REGB3 = ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[1]);
783 /* ../lib/standard/kernel.nit:235 */
784 REGB3 = TAG_Int(UNTAG_Int(REGB3)+UNTAG_Int(REGB0));
785 /* ../lib/standard/stream.nit:158 */
786 REGB2 = TAG_Bool(ATTR_standard___stream___BufferedIStream____buffer_pos(fra.me.REG[0])!=NIT_NULL);
787 if (UNTAG_Bool(REGB2)) {
788 } else {
789 nit_abort("Uninitialized attribute %s", "_buffer_pos", LOCATE_standard___stream, 158);
790 }
791 REGB2 = ATTR_standard___stream___BufferedIStream____buffer_pos(fra.me.REG[0]);
792 /* ../lib/standard/kernel.nit:237 */
793 REGB2 = TAG_Int(UNTAG_Int(REGB3)-UNTAG_Int(REGB2));
794 /* ../lib/standard/stream.nit:158 */
795 CALL_standard___collection___array___AbstractArray___enlarge(fra.me.REG[1])(fra.me.REG[1], REGB2);
796 /* ../lib/standard/stream.nit:161 */
797 REGB2 = TAG_Bool(ATTR_standard___stream___BufferedIStream____buffer_pos(fra.me.REG[0])!=NIT_NULL);
798 if (UNTAG_Bool(REGB2)) {
799 } else {
800 nit_abort("Uninitialized attribute %s", "_buffer_pos", LOCATE_standard___stream, 161);
801 }
802 REGB2 = ATTR_standard___stream___BufferedIStream____buffer_pos(fra.me.REG[0]);
803 /* ../lib/standard/stream.nit:162 */
804 while(1) {
805 REGB3 = TAG_Bool(VAL_ISA(REGB0, VTCOLOR_standard___kernel___Comparable___OTHER(REGB2), VTID_standard___kernel___Comparable___OTHER(REGB2))) /*cast OTHER*/;
806 if (UNTAG_Bool(REGB3)) {
807 } else {
808 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
809 }
810 /* ../lib/standard/kernel.nit:232 */
811 REGB3 = TAG_Bool(UNTAG_Int(REGB2)<UNTAG_Int(REGB0));
812 /* ../lib/standard/stream.nit:162 */
813 if (UNTAG_Bool(REGB3)) {
814 /* ../lib/standard/stream.nit:163 */
815 fra.me.REG[2] = ATTR_standard___stream___BufferedIStream____buffer(fra.me.REG[0]);
816 REGB3 = TAG_Bool(fra.me.REG[2]==NIT_NULL);
817 if (UNTAG_Bool(REGB3)) {
818 nit_abort("Reciever is null", NULL, LOCATE_standard___stream, 163);
819 }
820 REGB3 = CALL_standard___collection___abstract_collection___SequenceRead_____bra(fra.me.REG[2])(fra.me.REG[2], REGB2);
821 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], REGB3);
822 /* ../lib/standard/stream.nit:164 */
823 REGB3 = TAG_Int(1);
824 /* ../lib/standard/kernel.nit:235 */
825 REGB3 = TAG_Int(UNTAG_Int(REGB2)+UNTAG_Int(REGB3));
826 /* ../lib/standard/stream.nit:164 */
827 REGB2 = REGB3;
828 } else {
829 /* ../lib/standard/stream.nit:162 */
830 goto label2;
831 }
832 }
833 label2: while(0);
834 }
835 /* ../lib/standard/stream.nit:168 */
836 fra.me.REG[2] = ATTR_standard___stream___BufferedIStream____buffer(fra.me.REG[0]);
837 REGB2 = TAG_Bool(fra.me.REG[2]==NIT_NULL);
838 if (UNTAG_Bool(REGB2)) {
839 nit_abort("Reciever is null", NULL, LOCATE_standard___stream, 168);
840 }
841 /* ../lib/standard/collection/array.nit:24 */
842 REGB2 = TAG_Bool(ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[2])!=NIT_NULL);
843 if (UNTAG_Bool(REGB2)) {
844 } else {
845 nit_abort("Uninitialized attribute %s", "_length", LOCATE_standard___collection___array, 24);
846 }
847 REGB2 = ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[2]);
848 REGB3 = TAG_Bool(VAL_ISA(REGB2, VTCOLOR_standard___kernel___Comparable___OTHER(REGB0), VTID_standard___kernel___Comparable___OTHER(REGB0))) /*cast OTHER*/;
849 if (UNTAG_Bool(REGB3)) {
850 } else {
851 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
852 }
853 /* ../lib/standard/kernel.nit:232 */
854 REGB2 = TAG_Bool(UNTAG_Int(REGB0)<UNTAG_Int(REGB2));
855 /* ../lib/standard/stream.nit:168 */
856 if (UNTAG_Bool(REGB2)) {
857 /* ../lib/standard/stream.nit:170 */
858 REGB2 = TAG_Int(1);
859 /* ../lib/standard/kernel.nit:235 */
860 REGB2 = TAG_Int(UNTAG_Int(REGB0)+UNTAG_Int(REGB2));
861 /* ../lib/standard/stream.nit:170 */
862 ATTR_standard___stream___BufferedIStream____buffer_pos(fra.me.REG[0]) = REGB2;
863 /* ../lib/standard/stream.nit:171 */
864 goto label3;
865 } else {
866 /* ../lib/standard/stream.nit:174 */
867 ATTR_standard___stream___BufferedIStream____buffer_pos(fra.me.REG[0]) = REGB0;
868 /* ../lib/standard/stream.nit:175 */
869 REGB0 = CALL_standard___stream___BufferedIStream___end_reached(fra.me.REG[0])(fra.me.REG[0]);
870 if (UNTAG_Bool(REGB0)) {
871 /* ../lib/standard/stream.nit:176 */
872 goto label3;
873 } else {
874 /* ../lib/standard/stream.nit:178 */
875 CALL_standard___stream___BufferedIStream___fill_buffer(fra.me.REG[0])(fra.me.REG[0]);
876 }
877 }
878 }
879 label3: while(0);
880 stack_frame_head = fra.me.prev;
881 return;
882 }
883 val_t standard___stream___BufferedIStream___eof(val_t p0){
884 struct {struct stack_frame_t me; val_t MORE_REG[1];} fra;
885 val_t REGB0;
886 val_t REGB1;
887 val_t REGB2;
888 val_t tmp;
889 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
890 fra.me.file = LOCATE_standard___stream;
891 fra.me.line = 184;
892 fra.me.meth = LOCATE_standard___stream___BufferedIStream___eof;
893 fra.me.has_broke = 0;
894 fra.me.REG_size = 2;
895 fra.me.nitni_local_ref_head = NULL;
896 fra.me.REG[0] = NIT_NULL;
897 fra.me.REG[1] = NIT_NULL;
898 fra.me.REG[0] = p0;
899 /* ../lib/standard/stream.nit:184 */
900 REGB0 = TAG_Bool(ATTR_standard___stream___BufferedIStream____buffer_pos(fra.me.REG[0])!=NIT_NULL);
901 if (UNTAG_Bool(REGB0)) {
902 } else {
903 nit_abort("Uninitialized attribute %s", "_buffer_pos", LOCATE_standard___stream, 184);
904 }
905 REGB0 = ATTR_standard___stream___BufferedIStream____buffer_pos(fra.me.REG[0]);
906 fra.me.REG[1] = ATTR_standard___stream___BufferedIStream____buffer(fra.me.REG[0]);
907 REGB1 = TAG_Bool(fra.me.REG[1]==NIT_NULL);
908 if (UNTAG_Bool(REGB1)) {
909 nit_abort("Reciever is null", NULL, LOCATE_standard___stream, 184);
910 }
911 /* ../lib/standard/collection/array.nit:24 */
912 REGB1 = TAG_Bool(ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[1])!=NIT_NULL);
913 if (UNTAG_Bool(REGB1)) {
914 } else {
915 nit_abort("Uninitialized attribute %s", "_length", LOCATE_standard___collection___array, 24);
916 }
917 REGB1 = ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[1]);
918 REGB2 = TAG_Bool(VAL_ISA(REGB1, VTCOLOR_standard___kernel___Comparable___OTHER(REGB0), VTID_standard___kernel___Comparable___OTHER(REGB0))) /*cast OTHER*/;
919 if (UNTAG_Bool(REGB2)) {
920 } else {
921 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
922 }
923 /* ../lib/standard/kernel.nit:233 */
924 REGB1 = TAG_Bool(UNTAG_Int(REGB0)>=UNTAG_Int(REGB1));
925 /* ../lib/standard/stream.nit:184 */
926 if (UNTAG_Bool(REGB1)) {
927 REGB1 = CALL_standard___stream___BufferedIStream___end_reached(fra.me.REG[0])(fra.me.REG[0]);
928 } else {
929 REGB0 = TAG_Bool(false);
930 REGB1 = REGB0;
931 }
932 goto label1;
933 label1: while(0);
934 stack_frame_head = fra.me.prev;
935 return REGB1;
936 }
937 void standard___stream___BufferedIStream___fill_buffer(val_t p0){
938 struct {struct stack_frame_t me;} fra;
939 val_t tmp;
940 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
941 fra.me.file = LOCATE_standard___stream;
942 fra.me.line = 192;
943 fra.me.meth = LOCATE_standard___stream___BufferedIStream___fill_buffer;
944 fra.me.has_broke = 0;
945 fra.me.REG_size = 0;
946 fra.me.nitni_local_ref_head = NULL;
947 /* ../lib/standard/stream.nit:192 */
948 nit_abort("Deferred method called", NULL, LOCATE_standard___stream, 192);
949 stack_frame_head = fra.me.prev;
950 return;
951 }
952 val_t standard___stream___BufferedIStream___end_reached(val_t p0){
953 struct {struct stack_frame_t me;} fra;
954 val_t tmp;
955 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
956 fra.me.file = LOCATE_standard___stream;
957 fra.me.line = 195;
958 fra.me.meth = LOCATE_standard___stream___BufferedIStream___end_reached;
959 fra.me.has_broke = 0;
960 fra.me.REG_size = 0;
961 fra.me.nitni_local_ref_head = NULL;
962 /* ../lib/standard/stream.nit:195 */
963 nit_abort("Deferred method called", NULL, LOCATE_standard___stream, 195);
964 stack_frame_head = fra.me.prev;
965 return NIT_NULL;
966 }
967 void standard___stream___BufferedIStream___prepare_buffer(val_t p0, val_t p1){
968 struct {struct stack_frame_t me; val_t MORE_REG[1];} fra;
969 val_t REGB0;
970 val_t tmp;
971 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
972 fra.me.file = LOCATE_standard___stream;
973 fra.me.line = 198;
974 fra.me.meth = LOCATE_standard___stream___BufferedIStream___prepare_buffer;
975 fra.me.has_broke = 0;
976 fra.me.REG_size = 2;
977 fra.me.nitni_local_ref_head = NULL;
978 fra.me.REG[0] = NIT_NULL;
979 fra.me.REG[1] = NIT_NULL;
980 fra.me.REG[0] = p0;
981 REGB0 = p1;
982 /* ../lib/standard/stream.nit:201 */
983 fra.me.REG[1] = NEW_Buffer_standard___string___Buffer___with_capacity(REGB0);
984 ATTR_standard___stream___BufferedIStream____buffer(fra.me.REG[0]) = fra.me.REG[1];
985 /* ../lib/standard/stream.nit:202 */
986 REGB0 = TAG_Int(0);
987 ATTR_standard___stream___BufferedIStream____buffer_pos(fra.me.REG[0]) = REGB0;
988 stack_frame_head = fra.me.prev;
989 return;
990 }
991 void standard___stream___BufferedIStream___init(val_t p0, int* init_table){
992 int itpos0 = VAL2OBJ(p0)->vft[INIT_TABLE_POS_standard___stream___BufferedIStream].i;
993 struct {struct stack_frame_t me;} fra;
994 val_t tmp;
995 if (init_table[itpos0]) return;
996 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
997 fra.me.file = LOCATE_standard___stream;
998 fra.me.line = 0;
999 fra.me.meth = LOCATE_standard___stream___BufferedIStream___init;
1000 fra.me.has_broke = 0;
1001 fra.me.REG_size = 0;
1002 fra.me.nitni_local_ref_head = NULL;
1003 stack_frame_head = fra.me.prev;
1004 init_table[itpos0] = 1;
1005 return;
1006 }
1007 val_t standard___stream___FDStream___fd(val_t p0){
1008 struct {struct stack_frame_t me;} fra;
1009 val_t REGB0;
1010 val_t tmp;
1011 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1012 fra.me.file = LOCATE_standard___stream;
1013 fra.me.line = 215;
1014 fra.me.meth = LOCATE_standard___stream___FDStream___fd;
1015 fra.me.has_broke = 0;
1016 fra.me.REG_size = 1;
1017 fra.me.nitni_local_ref_head = NULL;
1018 fra.me.REG[0] = NIT_NULL;
1019 fra.me.REG[0] = p0;
1020 /* ../lib/standard/stream.nit:215 */
1021 REGB0 = TAG_Bool(ATTR_standard___stream___FDStream_____atfd(fra.me.REG[0])!=NIT_NULL);
1022 if (UNTAG_Bool(REGB0)) {
1023 } else {
1024 nit_abort("Uninitialized attribute %s", "@fd", LOCATE_standard___stream, 215);
1025 }
1026 REGB0 = ATTR_standard___stream___FDStream_____atfd(fra.me.REG[0]);
1027 stack_frame_head = fra.me.prev;
1028 return REGB0;
1029 }
1030 void standard___stream___FDStream___fd__eq(val_t p0, val_t p1){
1031 struct {struct stack_frame_t me;} fra;
1032 val_t REGB0;
1033 val_t tmp;
1034 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1035 fra.me.file = LOCATE_standard___stream;
1036 fra.me.line = 215;
1037 fra.me.meth = LOCATE_standard___stream___FDStream___fd__eq;
1038 fra.me.has_broke = 0;
1039 fra.me.REG_size = 1;
1040 fra.me.nitni_local_ref_head = NULL;
1041 fra.me.REG[0] = NIT_NULL;
1042 fra.me.REG[0] = p0;
1043 REGB0 = p1;
1044 /* ../lib/standard/stream.nit:215 */
1045 ATTR_standard___stream___FDStream_____atfd(fra.me.REG[0]) = REGB0;
1046 stack_frame_head = fra.me.prev;
1047 return;
1048 }
1049 void standard___stream___FDStream___close(val_t p0){
1050 struct {struct stack_frame_t me;} fra;
1051 val_t REGB0;
1052 val_t tmp;
1053 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1054 fra.me.file = LOCATE_standard___stream;
1055 fra.me.line = 218;
1056 fra.me.meth = LOCATE_standard___stream___FDStream___close;
1057 fra.me.has_broke = 0;
1058 fra.me.REG_size = 1;
1059 fra.me.nitni_local_ref_head = NULL;
1060 fra.me.REG[0] = NIT_NULL;
1061 fra.me.REG[0] = p0;
1062 /* ../lib/standard/stream.nit:218 */
1063 REGB0 = CALL_standard___stream___FDStream___fd(fra.me.REG[0])(fra.me.REG[0]);
1064 CALL_standard___stream___FDStream___native_close(fra.me.REG[0])(fra.me.REG[0], REGB0);
1065 stack_frame_head = fra.me.prev;
1066 return;
1067 }
1068 val_t standard___stream___FDStream___native_close(val_t p0, val_t p1){
1069 struct {struct stack_frame_t me;} fra;
1070 val_t REGB0;
1071 val_t tmp;
1072 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1073 fra.me.file = LOCATE_standard___stream;
1074 fra.me.line = 220;
1075 fra.me.meth = LOCATE_standard___stream___FDStream___native_close;
1076 fra.me.has_broke = 0;
1077 fra.me.REG_size = 1;
1078 fra.me.nitni_local_ref_head = NULL;
1079 fra.me.REG[0] = NIT_NULL;
1080 fra.me.REG[0] = p0;
1081 REGB0 = p1;
1082 /* ../lib/standard/stream.nit:220 */
1083 REGB0 = FDStream_native_close___out(fra.me.REG[0], REGB0);
1084 stack_frame_head = fra.me.prev;
1085 return REGB0;
1086 }
1087 val_t standard___stream___FDStream___native_read_char(val_t p0, val_t p1){
1088 struct {struct stack_frame_t me;} fra;
1089 val_t REGB0;
1090 val_t tmp;
1091 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1092 fra.me.file = LOCATE_standard___stream;
1093 fra.me.line = 221;
1094 fra.me.meth = LOCATE_standard___stream___FDStream___native_read_char;
1095 fra.me.has_broke = 0;
1096 fra.me.REG_size = 1;
1097 fra.me.nitni_local_ref_head = NULL;
1098 fra.me.REG[0] = NIT_NULL;
1099 fra.me.REG[0] = p0;
1100 REGB0 = p1;
1101 /* ../lib/standard/stream.nit:221 */
1102 REGB0 = FDStream_native_read_char___out(fra.me.REG[0], REGB0);
1103 stack_frame_head = fra.me.prev;
1104 return REGB0;
1105 }
1106 val_t standard___stream___FDStream___native_read(val_t p0, val_t p1, val_t p2, val_t p3){
1107 struct {struct stack_frame_t me; val_t MORE_REG[1];} fra;
1108 val_t REGB0;
1109 val_t REGB1;
1110 val_t tmp;
1111 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1112 fra.me.file = LOCATE_standard___stream;
1113 fra.me.line = 222;
1114 fra.me.meth = LOCATE_standard___stream___FDStream___native_read;
1115 fra.me.has_broke = 0;
1116 fra.me.REG_size = 2;
1117 fra.me.nitni_local_ref_head = NULL;
1118 fra.me.REG[0] = NIT_NULL;
1119 fra.me.REG[1] = NIT_NULL;
1120 fra.me.REG[0] = p0;
1121 REGB0 = p1;
1122 fra.me.REG[1] = p2;
1123 REGB1 = p3;
1124 /* ../lib/standard/stream.nit:222 */
1125 REGB1 = FDStream_native_read___out(fra.me.REG[0], REGB0, fra.me.REG[1], REGB1);
1126 stack_frame_head = fra.me.prev;
1127 return REGB1;
1128 }
1129 val_t standard___stream___FDStream___native_write(val_t p0, val_t p1, val_t p2, val_t p3){
1130 struct {struct stack_frame_t me; val_t MORE_REG[1];} fra;
1131 val_t REGB0;
1132 val_t REGB1;
1133 val_t tmp;
1134 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1135 fra.me.file = LOCATE_standard___stream;
1136 fra.me.line = 223;
1137 fra.me.meth = LOCATE_standard___stream___FDStream___native_write;
1138 fra.me.has_broke = 0;
1139 fra.me.REG_size = 2;
1140 fra.me.nitni_local_ref_head = NULL;
1141 fra.me.REG[0] = NIT_NULL;
1142 fra.me.REG[1] = NIT_NULL;
1143 fra.me.REG[0] = p0;
1144 REGB0 = p1;
1145 fra.me.REG[1] = p2;
1146 REGB1 = p3;
1147 /* ../lib/standard/stream.nit:223 */
1148 REGB1 = FDStream_native_write___out(fra.me.REG[0], REGB0, fra.me.REG[1], REGB1);
1149 stack_frame_head = fra.me.prev;
1150 return REGB1;
1151 }
1152 void standard___stream___FDStream___init(val_t p0, val_t p1, int* init_table){
1153 int itpos1 = VAL2OBJ(p0)->vft[INIT_TABLE_POS_standard___stream___FDStream].i;
1154 struct {struct stack_frame_t me;} fra;
1155 val_t REGB0;
1156 val_t tmp;
1157 if (init_table[itpos1]) return;
1158 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1159 fra.me.file = LOCATE_standard___stream;
1160 fra.me.line = 225;
1161 fra.me.meth = LOCATE_standard___stream___FDStream___init;
1162 fra.me.has_broke = 0;
1163 fra.me.REG_size = 1;
1164 fra.me.nitni_local_ref_head = NULL;
1165 fra.me.REG[0] = NIT_NULL;
1166 fra.me.REG[0] = p0;
1167 REGB0 = p1;
1168 /* ../lib/standard/stream.nit:225 */
1169 CALL_standard___stream___FDStream___fd__eq(fra.me.REG[0])(fra.me.REG[0], REGB0);
1170 stack_frame_head = fra.me.prev;
1171 init_table[itpos1] = 1;
1172 return;
1173 }
1174 val_t standard___stream___FDIStream___eof(val_t p0){
1175 struct {struct stack_frame_t me;} fra;
1176 val_t REGB0;
1177 val_t tmp;
1178 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1179 fra.me.file = LOCATE_standard___stream;
1180 fra.me.line = 231;
1181 fra.me.meth = LOCATE_standard___stream___FDIStream___eof;
1182 fra.me.has_broke = 0;
1183 fra.me.REG_size = 1;
1184 fra.me.nitni_local_ref_head = NULL;
1185 fra.me.REG[0] = NIT_NULL;
1186 fra.me.REG[0] = p0;
1187 /* ../lib/standard/stream.nit:231 */
1188 REGB0 = TAG_Bool(ATTR_standard___stream___FDIStream_____ateof(fra.me.REG[0])!=NIT_NULL);
1189 if (UNTAG_Bool(REGB0)) {
1190 } else {
1191 nit_abort("Uninitialized attribute %s", "@eof", LOCATE_standard___stream, 231);
1192 }
1193 REGB0 = ATTR_standard___stream___FDIStream_____ateof(fra.me.REG[0]);
1194 stack_frame_head = fra.me.prev;
1195 return REGB0;
1196 }
1197 void standard___stream___FDIStream___eof__eq(val_t p0, val_t p1){
1198 struct {struct stack_frame_t me;} fra;
1199 val_t REGB0;
1200 val_t tmp;
1201 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1202 fra.me.file = LOCATE_standard___stream;
1203 fra.me.line = 231;
1204 fra.me.meth = LOCATE_standard___stream___FDIStream___eof__eq;
1205 fra.me.has_broke = 0;
1206 fra.me.REG_size = 1;
1207 fra.me.nitni_local_ref_head = NULL;
1208 fra.me.REG[0] = NIT_NULL;
1209 fra.me.REG[0] = p0;
1210 REGB0 = p1;
1211 /* ../lib/standard/stream.nit:231 */
1212 ATTR_standard___stream___FDIStream_____ateof(fra.me.REG[0]) = REGB0;
1213 stack_frame_head = fra.me.prev;
1214 return;
1215 }
1216 val_t standard___stream___FDIStream___read_char(val_t p0){
1217 struct {struct stack_frame_t me;} fra;
1218 val_t REGB0;
1219 val_t REGB1;
1220 val_t REGB2;
1221 val_t tmp;
1222 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1223 fra.me.file = LOCATE_standard___stream;
1224 fra.me.line = 233;
1225 fra.me.meth = LOCATE_standard___stream___FDIStream___read_char;
1226 fra.me.has_broke = 0;
1227 fra.me.REG_size = 1;
1228 fra.me.nitni_local_ref_head = NULL;
1229 fra.me.REG[0] = NIT_NULL;
1230 fra.me.REG[0] = p0;
1231 /* ../lib/standard/stream.nit:235 */
1232 REGB0 = CALL_standard___stream___FDStream___fd(fra.me.REG[0])(fra.me.REG[0]);
1233 REGB0 = CALL_standard___stream___FDStream___native_read_char(fra.me.REG[0])(fra.me.REG[0], REGB0);
1234 /* ../lib/standard/stream.nit:236 */
1235 REGB1 = TAG_Int(1);
1236 /* ../lib/standard/kernel.nit:236 */
1237 REGB1 = TAG_Int(-UNTAG_Int(REGB1));
1238 /* ../lib/standard/stream.nit:236 */
1239 REGB2 = TAG_Bool(IS_EQUAL_OO(REGB0,REGB1));
1240 if (UNTAG_Bool(REGB2)) {
1241 } else {
1242 /* ../lib/standard/kernel.nit:227 */
1243 REGB1 = TAG_Bool((REGB0)==(REGB1));
1244 /* ../lib/standard/stream.nit:236 */
1245 REGB2 = REGB1;
1246 }
1247 if (UNTAG_Bool(REGB2)) {
1248 REGB2 = TAG_Bool(true);
1249 CALL_standard___stream___FDIStream___eof__eq(fra.me.REG[0])(fra.me.REG[0], REGB2);
1250 }
1251 /* ../lib/standard/stream.nit:237 */
1252 goto label1;
1253 label1: while(0);
1254 stack_frame_head = fra.me.prev;
1255 return REGB0;
1256 }
1257 void standard___stream___FDIStream___init(val_t p0, val_t p1, int* init_table){
1258 int itpos2 = VAL2OBJ(p0)->vft[INIT_TABLE_POS_standard___stream___FDIStream].i;
1259 struct {struct stack_frame_t me;} fra;
1260 val_t REGB0;
1261 val_t tmp;
1262 if (init_table[itpos2]) return;
1263 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1264 fra.me.file = LOCATE_standard___stream;
1265 fra.me.line = 240;
1266 fra.me.meth = LOCATE_standard___stream___FDIStream___init;
1267 fra.me.has_broke = 0;
1268 fra.me.REG_size = 1;
1269 fra.me.nitni_local_ref_head = NULL;
1270 fra.me.REG[0] = NIT_NULL;
1271 fra.me.REG[0] = p0;
1272 REGB0 = p1;
1273 /* ../lib/standard/stream.nit:240 */
1274 CALL_standard___stream___FDStream___init(fra.me.REG[0])(fra.me.REG[0], REGB0, init_table);
1275 stack_frame_head = fra.me.prev;
1276 init_table[itpos2] = 1;
1277 return;
1278 }
1279 val_t standard___stream___FDOStream___is_writable(val_t p0){
1280 struct {struct stack_frame_t me;} fra;
1281 val_t REGB0;
1282 val_t tmp;
1283 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1284 fra.me.file = LOCATE_standard___stream;
1285 fra.me.line = 246;
1286 fra.me.meth = LOCATE_standard___stream___FDOStream___is_writable;
1287 fra.me.has_broke = 0;
1288 fra.me.REG_size = 1;
1289 fra.me.nitni_local_ref_head = NULL;
1290 fra.me.REG[0] = NIT_NULL;
1291 fra.me.REG[0] = p0;
1292 /* ../lib/standard/stream.nit:246 */
1293 REGB0 = TAG_Bool(ATTR_standard___stream___FDOStream_____atis_writable(fra.me.REG[0])!=NIT_NULL);
1294 if (UNTAG_Bool(REGB0)) {
1295 } else {
1296 nit_abort("Uninitialized attribute %s", "@is_writable", LOCATE_standard___stream, 246);
1297 }
1298 REGB0 = ATTR_standard___stream___FDOStream_____atis_writable(fra.me.REG[0]);
1299 stack_frame_head = fra.me.prev;
1300 return REGB0;
1301 }
1302 void standard___stream___FDOStream___is_writable__eq(val_t p0, val_t p1){
1303 struct {struct stack_frame_t me;} fra;
1304 val_t REGB0;
1305 val_t tmp;
1306 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1307 fra.me.file = LOCATE_standard___stream;
1308 fra.me.line = 246;
1309 fra.me.meth = LOCATE_standard___stream___FDOStream___is_writable__eq;
1310 fra.me.has_broke = 0;
1311 fra.me.REG_size = 1;
1312 fra.me.nitni_local_ref_head = NULL;
1313 fra.me.REG[0] = NIT_NULL;
1314 fra.me.REG[0] = p0;
1315 REGB0 = p1;
1316 /* ../lib/standard/stream.nit:246 */
1317 ATTR_standard___stream___FDOStream_____atis_writable(fra.me.REG[0]) = REGB0;
1318 stack_frame_head = fra.me.prev;
1319 return;
1320 }
1321 void standard___stream___FDOStream___write(val_t p0, val_t p1){
1322 struct {struct stack_frame_t me; val_t MORE_REG[2];} fra;
1323 val_t REGB0;
1324 val_t REGB1;
1325 val_t REGB2;
1326 val_t tmp;
1327 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1328 fra.me.file = LOCATE_standard___stream;
1329 fra.me.line = 248;
1330 fra.me.meth = LOCATE_standard___stream___FDOStream___write;
1331 fra.me.has_broke = 0;
1332 fra.me.REG_size = 3;
1333 fra.me.nitni_local_ref_head = NULL;
1334 fra.me.REG[0] = NIT_NULL;
1335 fra.me.REG[1] = NIT_NULL;
1336 fra.me.REG[2] = NIT_NULL;
1337 fra.me.REG[0] = p0;
1338 fra.me.REG[1] = p1;
1339 /* ../lib/standard/stream.nit:250 */
1340 REGB0 = CALL_standard___stream___FDStream___fd(fra.me.REG[0])(fra.me.REG[0]);
1341 fra.me.REG[2] = CALL_standard___string___String___to_cstring(fra.me.REG[1])(fra.me.REG[1]);
1342 /* ../lib/standard/collection/array.nit:24 */
1343 REGB1 = TAG_Bool(ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[1])!=NIT_NULL);
1344 if (UNTAG_Bool(REGB1)) {
1345 } else {
1346 nit_abort("Uninitialized attribute %s", "_length", LOCATE_standard___collection___array, 24);
1347 }
1348 REGB1 = ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[1]);
1349 /* ../lib/standard/stream.nit:250 */
1350 REGB1 = CALL_standard___stream___FDStream___native_write(fra.me.REG[0])(fra.me.REG[0], REGB0, fra.me.REG[2], REGB1);
1351 /* ../lib/standard/collection/array.nit:24 */
1352 REGB0 = TAG_Bool(ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[1])!=NIT_NULL);
1353 if (UNTAG_Bool(REGB0)) {
1354 } else {
1355 nit_abort("Uninitialized attribute %s", "_length", LOCATE_standard___collection___array, 24);
1356 }
1357 REGB0 = ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[1]);
1358 REGB2 = TAG_Bool(VAL_ISA(REGB0, VTCOLOR_standard___kernel___Comparable___OTHER(REGB1), VTID_standard___kernel___Comparable___OTHER(REGB1))) /*cast OTHER*/;
1359 if (UNTAG_Bool(REGB2)) {
1360 } else {
1361 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
1362 }
1363 /* ../lib/standard/kernel.nit:232 */
1364 REGB0 = TAG_Bool(UNTAG_Int(REGB1)<UNTAG_Int(REGB0));
1365 /* ../lib/standard/stream.nit:251 */
1366 if (UNTAG_Bool(REGB0)) {
1367 REGB0 = TAG_Bool(false);
1368 CALL_standard___stream___FDOStream___is_writable__eq(fra.me.REG[0])(fra.me.REG[0], REGB0);
1369 }
1370 stack_frame_head = fra.me.prev;
1371 return;
1372 }
1373 void standard___stream___FDOStream___init(val_t p0, val_t p1, int* init_table){
1374 int itpos3 = VAL2OBJ(p0)->vft[INIT_TABLE_POS_standard___stream___FDOStream].i;
1375 struct {struct stack_frame_t me; val_t MORE_REG[1];} fra;
1376 val_t REGB0;
1377 val_t tmp;
1378 if (init_table[itpos3]) return;
1379 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1380 fra.me.file = LOCATE_standard___stream;
1381 fra.me.line = 254;
1382 fra.me.meth = LOCATE_standard___stream___FDOStream___init;
1383 fra.me.has_broke = 0;
1384 fra.me.REG_size = 2;
1385 fra.me.nitni_local_ref_head = NULL;
1386 fra.me.REG[0] = NIT_NULL;
1387 fra.me.REG[1] = NIT_NULL;
1388 fra.me.REG[0] = p0;
1389 REGB0 = p1;
1390 /* ../lib/standard/stream.nit:254 */
1391 fra.me.REG[1] = fra.me.REG[0];
1392 CALL_standard___stream___FDStream___init(fra.me.REG[0])(fra.me.REG[0], REGB0, init_table);
1393 /* ../lib/standard/stream.nit:256 */
1394 REGB0 = TAG_Bool(true);
1395 CALL_standard___stream___FDOStream___is_writable__eq(fra.me.REG[1])(fra.me.REG[1], REGB0);
1396 stack_frame_head = fra.me.prev;
1397 init_table[itpos3] = 1;
1398 return;
1399 }
1400 void standard___stream___FDIOStream___init(val_t p0, val_t p1, int* init_table){
1401 int itpos4 = VAL2OBJ(p0)->vft[INIT_TABLE_POS_standard___stream___FDIOStream].i;
1402 struct {struct stack_frame_t me; val_t MORE_REG[1];} fra;
1403 val_t REGB0;
1404 val_t REGB1;
1405 val_t tmp;
1406 if (init_table[itpos4]) return;
1407 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1408 fra.me.file = LOCATE_standard___stream;
1409 fra.me.line = 264;
1410 fra.me.meth = LOCATE_standard___stream___FDIOStream___init;
1411 fra.me.has_broke = 0;
1412 fra.me.REG_size = 2;
1413 fra.me.nitni_local_ref_head = NULL;
1414 fra.me.REG[0] = NIT_NULL;
1415 fra.me.REG[1] = NIT_NULL;
1416 fra.me.REG[0] = p0;
1417 REGB0 = p1;
1418 /* ../lib/standard/stream.nit:264 */
1419 fra.me.REG[1] = fra.me.REG[0];
1420 REGB1 = REGB0;
1421 CALL_standard___stream___FDIStream___init(fra.me.REG[0])(fra.me.REG[0], REGB0, init_table);
1422 CALL_standard___stream___FDOStream___init(fra.me.REG[0])(fra.me.REG[0], REGB0, init_table);
1423 /* ../lib/standard/stream.nit:266 */
1424 CALL_standard___stream___FDStream___fd__eq(fra.me.REG[1])(fra.me.REG[1], REGB1);
1425 /* ../lib/standard/stream.nit:267 */
1426 REGB1 = TAG_Bool(true);
1427 CALL_standard___stream___FDOStream___is_writable__eq(fra.me.REG[1])(fra.me.REG[1], REGB1);
1428 stack_frame_head = fra.me.prev;
1429 init_table[itpos4] = 1;
1430 return;
1431 }
1432 val_t standard___stream___Object___poll(val_t p0, val_t p1){
1433 struct {struct stack_frame_t me; val_t MORE_REG[4];} fra;
1434 val_t REGB0;
1435 val_t REGB1;
1436 val_t tmp;
1437 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1438 fra.me.file = LOCATE_standard___stream;
1439 fra.me.line = 272;
1440 fra.me.meth = LOCATE_standard___stream___Object___poll;
1441 fra.me.has_broke = 0;
1442 fra.me.REG_size = 5;
1443 fra.me.nitni_local_ref_head = NULL;
1444 fra.me.REG[0] = NIT_NULL;
1445 fra.me.REG[1] = NIT_NULL;
1446 fra.me.REG[2] = NIT_NULL;
1447 fra.me.REG[3] = NIT_NULL;
1448 fra.me.REG[4] = NIT_NULL;
1449 fra.me.REG[0] = p0;
1450 fra.me.REG[1] = p1;
1451 /* ../lib/standard/stream.nit:276 */
1452 fra.me.REG[2] = NEW_Array_standard___collection___array___Array___init();
1453 /* ../lib/standard/stream.nit:277 */
1454 fra.me.REG[3] = NEW_Array_standard___collection___array___Array___init();
1455 /* ../lib/standard/stream.nit:278 */
1456 fra.me.REG[4] = NEW_HashMap_standard___collection___hash_collection___HashMap___init();
1457 CALL_standard___collection___abstract_collection___Collection___iterate(fra.me.REG[1])(fra.me.REG[1], (&(fra.me)), ((fun_t)OC_standard___stream___Object___poll_1));
1458 /* ../lib/standard/stream.nit:287 */
1459 fra.me.REG[3] = CALL_standard___stream___Object___intern_poll(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[2], fra.me.REG[3]);
1460 /* ../lib/standard/stream.nit:289 */
1461 REGB0 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
1462 if (UNTAG_Bool(REGB0)) {
1463 } else {
1464 REGB1 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
1465 if (UNTAG_Bool(REGB1)) {
1466 REGB1 = TAG_Bool(false);
1467 REGB0 = REGB1;
1468 } else {
1469 /* ../lib/standard/kernel.nit:227 */
1470 REGB1 = TAG_Bool((fra.me.REG[3])==(NIT_NULL));
1471 /* ../lib/standard/stream.nit:289 */
1472 REGB0 = REGB1;
1473 }
1474 }
1475 if (UNTAG_Bool(REGB0)) {
1476 /* ../lib/standard/stream.nit:290 */
1477 fra.me.REG[2] = NIT_NULL;
1478 goto label2;
1479 } else {
1480 /* ../lib/standard/stream.nit:292 */
1481 fra.me.REG[3] = CALL_standard___collection___abstract_collection___MapRead_____bra(fra.me.REG[4])(fra.me.REG[4], fra.me.REG[3]);
1482 fra.me.REG[2] = fra.me.REG[3];
1483 goto label2;
1484 }
1485 label2: while(0);
1486 stack_frame_head = fra.me.prev;
1487 return fra.me.REG[2];
1488 }
1489 void OC_standard___stream___Object___poll_1(struct stack_frame_t *closctx, val_t p0, struct stack_frame_t *closctx_param, fun_t clos_fun0){
1490 struct {struct stack_frame_t me;} fra;
1491 val_t REGB0;
1492 val_t REGB1;
1493 fun_t CREG[1];
1494 val_t tmp;
1495 /* ../lib/standard/stream.nit:279 */
1496 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1497 fra.me.file = LOCATE_standard___stream;
1498 fra.me.line = 0;
1499 fra.me.meth = LOCATE_standard___stream___Object___poll;
1500 fra.me.has_broke = 0;
1501 fra.me.REG_size = 1;
1502 fra.me.nitni_local_ref_head = NULL;
1503 fra.me.REG[0] = NIT_NULL;
1504 fra.me.closure_ctx = closctx_param;
1505 fra.me.closure_funs = CREG;
1506 fra.me.REG[0] = p0;
1507 CREG[0] = clos_fun0;
1508 /* ../lib/standard/stream.nit:280 */
1509 REGB0 = CALL_standard___stream___FDStream___fd(fra.me.REG[0])(fra.me.REG[0]);
1510 /* ../lib/standard/stream.nit:281 */
1511 REGB1 = TAG_Bool(VAL_ISA(fra.me.REG[0], COLOR_standard___stream___FDIStream, ID_standard___stream___FDIStream)) /*cast FDIStream*/;
1512 if (UNTAG_Bool(REGB1)) {
1513 CALL_standard___collection___abstract_collection___SimpleCollection___add(closctx->REG[2])(closctx->REG[2], REGB0);
1514 }
1515 /* ../lib/standard/stream.nit:282 */
1516 REGB1 = TAG_Bool(VAL_ISA(fra.me.REG[0], COLOR_standard___stream___FDOStream, ID_standard___stream___FDOStream)) /*cast FDOStream*/;
1517 if (UNTAG_Bool(REGB1)) {
1518 CALL_standard___collection___abstract_collection___SimpleCollection___add(closctx->REG[3])(closctx->REG[3], REGB0);
1519 }
1520 /* ../lib/standard/stream.nit:284 */
1521 CALL_standard___collection___abstract_collection___Map_____braeq(closctx->REG[4])(closctx->REG[4], REGB0, fra.me.REG[0]);
1522 stack_frame_head = fra.me.prev;
1523 return;
1524 }
1525 val_t standard___stream___Object___intern_poll(val_t p0, val_t p1, val_t p2){
1526 struct {struct stack_frame_t me; val_t MORE_REG[2];} fra;
1527 val_t tmp;
1528 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
1529 fra.me.file = LOCATE_standard___stream;
1530 fra.me.line = 296;
1531 fra.me.meth = LOCATE_standard___stream___Object___intern_poll;
1532 fra.me.has_broke = 0;
1533 fra.me.REG_size = 3;
1534 fra.me.nitni_local_ref_head = NULL;
1535 fra.me.REG[0] = NIT_NULL;
1536 fra.me.REG[1] = NIT_NULL;
1537 fra.me.REG[2] = NIT_NULL;
1538 fra.me.REG[0] = p0;
1539 fra.me.REG[1] = p1;
1540 fra.me.REG[2] = p2;
1541 /* ../lib/standard/stream.nit:296 */
1542 fra.me.REG[2] = Object_intern_poll___out(fra.me.REG[0], fra.me.REG[1], fra.me.REG[2]);
1543 ;
1544 ;
1545 stack_frame_head = fra.me.prev;
1546 return fra.me.REG[2];
1547 }