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