1 /* This C file is generated by NIT to compile module sorter. */
2 #include "sorter._sep.h"
3 val_t
sorter___AbstractSorter___compare(val_t p0
, val_t p1
, val_t p2
){
4 struct {struct stack_frame_t me
;} fra
;
6 fra
.me
.prev
= stack_frame_head
; stack_frame_head
= &fra
.me
;
7 fra
.me
.file
= LOCATE_sorter
;
9 fra
.me
.meth
= LOCATE_sorter___AbstractSorter___compare
;
12 /* ./../lib/standard//collection//sorter.nit:22 */
13 fprintf(stderr
, "Deferred method called");
14 fprintf(stderr
, " (%s:%d)\n", LOCATE_sorter
, 22);
16 stack_frame_head
= fra
.me
.prev
;
19 void sorter___AbstractSorter___sort(val_t p0
, val_t p1
){
20 struct {struct stack_frame_t me
; val_t MORE_REG
[1];} fra
;
25 fra
.me
.prev
= stack_frame_head
; stack_frame_head
= &fra
.me
;
26 fra
.me
.file
= LOCATE_sorter
;
28 fra
.me
.meth
= LOCATE_sorter___AbstractSorter___sort
;
31 fra
.me
.REG
[0] = NIT_NULL
;
32 fra
.me
.REG
[1] = NIT_NULL
;
36 REGB1
= TAG_Bool(ATTR_array___AbstractArrayRead____length(fra
.me
.REG
[1])!=NIT_NULL
);
37 /* ./../lib/standard//collection//array.nit:23 */
38 if (UNTAG_Bool(REGB1
)) {
40 fprintf(stderr
, "Uninitialized attribute %s", "_length");
41 fprintf(stderr
, " (%s:%d)\n", LOCATE_array
, 23);
44 REGB1
= ATTR_array___AbstractArrayRead____length(fra
.me
.REG
[1]);
46 REGB2
= TAG_Int(UNTAG_Int(REGB1
)-UNTAG_Int(REGB2
));
47 /* ./../lib/standard//collection//sorter.nit:30 */
48 CALL_sorter___AbstractSorter___sub_sort(fra
.me
.REG
[0])(fra
.me
.REG
[0], fra
.me
.REG
[1], REGB0
, REGB2
);
49 stack_frame_head
= fra
.me
.prev
;
52 void sorter___AbstractSorter___sub_sort(val_t p0
, val_t p1
, val_t p2
, val_t p3
){
53 struct {struct stack_frame_t me
; val_t MORE_REG
[1];} fra
;
58 fra
.me
.prev
= stack_frame_head
; stack_frame_head
= &fra
.me
;
59 fra
.me
.file
= LOCATE_sorter
;
61 fra
.me
.meth
= LOCATE_sorter___AbstractSorter___sub_sort
;
64 fra
.me
.REG
[0] = NIT_NULL
;
65 fra
.me
.REG
[1] = NIT_NULL
;
70 REGB2
= TAG_Bool(UNTAG_Int(REGB0
)>=UNTAG_Int(REGB1
));
71 /* ./../lib/standard//collection//sorter.nit:35 */
72 if (UNTAG_Bool(REGB2
)) {
73 /* ./../lib/standard//collection//sorter.nit:36 */
77 REGB2
= TAG_Int(UNTAG_Int(REGB0
)+UNTAG_Int(REGB2
));
78 REGB2
= TAG_Bool(UNTAG_Int(REGB2
)<UNTAG_Int(REGB1
));
79 /* ./../lib/standard//collection//sorter.nit:37 */
80 if (UNTAG_Bool(REGB2
)) {
81 /* ./../lib/standard//collection//sorter.nit:38 */
82 CALL_sorter___AbstractSorter___quick_sort(fra
.me
.REG
[0])(fra
.me
.REG
[0], fra
.me
.REG
[1], REGB0
, REGB1
);
84 /* ./../lib/standard//collection//sorter.nit:40 */
85 CALL_sorter___AbstractSorter___bubble_sort(fra
.me
.REG
[0])(fra
.me
.REG
[0], fra
.me
.REG
[1], REGB0
, REGB1
);
89 stack_frame_head
= fra
.me
.prev
;
92 void sorter___AbstractSorter___quick_sort(val_t p0
, val_t p1
, val_t p2
, val_t p3
){
93 struct {struct stack_frame_t me
; val_t MORE_REG
[4];} fra
;
102 fra
.me
.prev
= stack_frame_head
; stack_frame_head
= &fra
.me
;
103 fra
.me
.file
= LOCATE_sorter
;
105 fra
.me
.meth
= LOCATE_sorter___AbstractSorter___quick_sort
;
106 fra
.me
.has_broke
= 0;
108 fra
.me
.REG
[0] = NIT_NULL
;
109 fra
.me
.REG
[1] = NIT_NULL
;
110 fra
.me
.REG
[2] = NIT_NULL
;
111 fra
.me
.REG
[3] = NIT_NULL
;
112 fra
.me
.REG
[4] = NIT_NULL
;
117 fra
.me
.REG
[2] = fra
.me
.REG
[1];
120 REGB3
= TAG_Bool(UNTAG_Int(REGB2
)>=UNTAG_Int(REGB3
));
121 /* ./../lib/standard//collection//array.nit:233 */
122 if (UNTAG_Bool(REGB3
)) {
123 REGB3
= TAG_Bool(ATTR_array___AbstractArrayRead____length(fra
.me
.REG
[2])!=NIT_NULL
);
124 if (UNTAG_Bool(REGB3
)) {
126 fprintf(stderr
, "Uninitialized attribute %s", "_length");
127 fprintf(stderr
, " (%s:%d)\n", LOCATE_array
, 233);
130 REGB3
= ATTR_array___AbstractArrayRead____length(fra
.me
.REG
[2]);
131 REGB3
= TAG_Bool(UNTAG_Int(REGB2
)<UNTAG_Int(REGB3
));
132 /* ./../lib/standard//collection//array.nit:233 */
134 REGB4
= TAG_Bool(false);
137 if (UNTAG_Bool(REGB3
)) {
139 fprintf(stderr
, "Assert %s failed", "'index'");
140 fprintf(stderr
, " (%s:%d)\n", LOCATE_array
, 233);
143 fra
.me
.REG
[2] = ATTR_array___Array____items(fra
.me
.REG
[2]);
144 REGB3
= TAG_Bool(fra
.me
.REG
[2]==NIT_NULL
);
145 /* ./../lib/standard//collection//array.nit:234 */
146 if (UNTAG_Bool(REGB3
)) {
147 fprintf(stderr
, "Reciever is null");
148 fprintf(stderr
, " (%s:%d)\n", LOCATE_array
, 234);
151 fra
.me
.REG
[2] = ((Nit_NativeArray
)fra
.me
.REG
[2])->val
[UNTAG_Int(REGB2
)];
152 /* ./../lib/standard//collection//array.nit:234 */
157 /* ./../lib/standard//collection//sorter.nit:50 */
159 REGB4
= TAG_Bool(UNTAG_Int(REGB3
)>UNTAG_Int(REGB2
));
160 /* ./../lib/standard//collection//sorter.nit:50 */
161 if (UNTAG_Bool(REGB4
)) {
162 /* ./../lib/standard//collection//sorter.nit:51 */
164 REGB4
= TAG_Bool(UNTAG_Int(REGB2
)<=UNTAG_Int(REGB1
));
165 /* ./../lib/standard//collection//sorter.nit:51 */
166 if (UNTAG_Bool(REGB4
)) {
167 fra
.me
.REG
[3] = fra
.me
.REG
[1];
170 REGB5
= TAG_Bool(UNTAG_Int(REGB4
)>=UNTAG_Int(REGB5
));
171 /* ./../lib/standard//collection//array.nit:233 */
172 if (UNTAG_Bool(REGB5
)) {
173 REGB5
= TAG_Bool(ATTR_array___AbstractArrayRead____length(fra
.me
.REG
[3])!=NIT_NULL
);
174 if (UNTAG_Bool(REGB5
)) {
176 fprintf(stderr
, "Uninitialized attribute %s", "_length");
177 fprintf(stderr
, " (%s:%d)\n", LOCATE_array
, 233);
180 REGB5
= ATTR_array___AbstractArrayRead____length(fra
.me
.REG
[3]);
181 REGB5
= TAG_Bool(UNTAG_Int(REGB4
)<UNTAG_Int(REGB5
));
182 /* ./../lib/standard//collection//array.nit:233 */
184 REGB6
= TAG_Bool(false);
187 if (UNTAG_Bool(REGB5
)) {
189 fprintf(stderr
, "Assert %s failed", "'index'");
190 fprintf(stderr
, " (%s:%d)\n", LOCATE_array
, 233);
193 fra
.me
.REG
[3] = ATTR_array___Array____items(fra
.me
.REG
[3]);
194 REGB5
= TAG_Bool(fra
.me
.REG
[3]==NIT_NULL
);
195 /* ./../lib/standard//collection//array.nit:234 */
196 if (UNTAG_Bool(REGB5
)) {
197 fprintf(stderr
, "Reciever is null");
198 fprintf(stderr
, " (%s:%d)\n", LOCATE_array
, 234);
201 fra
.me
.REG
[3] = ((Nit_NativeArray
)fra
.me
.REG
[3])->val
[UNTAG_Int(REGB4
)];
202 /* ./../lib/standard//collection//array.nit:234 */
205 REGB4
= CALL_sorter___AbstractSorter___compare(fra
.me
.REG
[0])(fra
.me
.REG
[0], fra
.me
.REG
[3], fra
.me
.REG
[2]);
207 REGB5
= TAG_Bool(UNTAG_Int(REGB4
)<=UNTAG_Int(REGB5
));
208 /* ./../lib/standard//collection//sorter.nit:51 */
210 REGB4
= TAG_Bool(false);
213 if (UNTAG_Bool(REGB5
)) {
215 REGB5
= TAG_Int(UNTAG_Int(REGB2
)+UNTAG_Int(REGB5
));
217 /* ./../lib/standard//collection//sorter.nit:51 */
223 /* ./../lib/standard//collection//sorter.nit:52 */
225 REGB5
= TAG_Bool(UNTAG_Int(REGB3
)>UNTAG_Int(REGB2
));
226 /* ./../lib/standard//collection//sorter.nit:52 */
227 if (UNTAG_Bool(REGB5
)) {
228 fra
.me
.REG
[3] = fra
.me
.REG
[1];
231 REGB4
= TAG_Bool(UNTAG_Int(REGB5
)>=UNTAG_Int(REGB4
));
232 /* ./../lib/standard//collection//array.nit:233 */
233 if (UNTAG_Bool(REGB4
)) {
234 REGB4
= TAG_Bool(ATTR_array___AbstractArrayRead____length(fra
.me
.REG
[3])!=NIT_NULL
);
235 if (UNTAG_Bool(REGB4
)) {
237 fprintf(stderr
, "Uninitialized attribute %s", "_length");
238 fprintf(stderr
, " (%s:%d)\n", LOCATE_array
, 233);
241 REGB4
= ATTR_array___AbstractArrayRead____length(fra
.me
.REG
[3]);
242 REGB4
= TAG_Bool(UNTAG_Int(REGB5
)<UNTAG_Int(REGB4
));
243 /* ./../lib/standard//collection//array.nit:233 */
245 REGB6
= TAG_Bool(false);
248 if (UNTAG_Bool(REGB4
)) {
250 fprintf(stderr
, "Assert %s failed", "'index'");
251 fprintf(stderr
, " (%s:%d)\n", LOCATE_array
, 233);
254 fra
.me
.REG
[3] = ATTR_array___Array____items(fra
.me
.REG
[3]);
255 REGB4
= TAG_Bool(fra
.me
.REG
[3]==NIT_NULL
);
256 /* ./../lib/standard//collection//array.nit:234 */
257 if (UNTAG_Bool(REGB4
)) {
258 fprintf(stderr
, "Reciever is null");
259 fprintf(stderr
, " (%s:%d)\n", LOCATE_array
, 234);
262 fra
.me
.REG
[3] = ((Nit_NativeArray
)fra
.me
.REG
[3])->val
[UNTAG_Int(REGB5
)];
263 /* ./../lib/standard//collection//array.nit:234 */
266 REGB5
= CALL_sorter___AbstractSorter___compare(fra
.me
.REG
[0])(fra
.me
.REG
[0], fra
.me
.REG
[3], fra
.me
.REG
[2]);
268 REGB4
= TAG_Bool(UNTAG_Int(REGB5
)>=UNTAG_Int(REGB4
));
269 /* ./../lib/standard//collection//sorter.nit:52 */
271 REGB5
= TAG_Bool(false);
274 if (UNTAG_Bool(REGB4
)) {
276 REGB4
= TAG_Int(UNTAG_Int(REGB3
)-UNTAG_Int(REGB4
));
278 /* ./../lib/standard//collection//sorter.nit:52 */
284 REGB4
= TAG_Bool(UNTAG_Int(REGB3
)>UNTAG_Int(REGB2
));
285 /* ./../lib/standard//collection//sorter.nit:53 */
286 if (UNTAG_Bool(REGB4
)) {
287 fra
.me
.REG
[3] = fra
.me
.REG
[1];
290 REGB5
= TAG_Bool(UNTAG_Int(REGB4
)>=UNTAG_Int(REGB5
));
291 /* ./../lib/standard//collection//array.nit:233 */
292 if (UNTAG_Bool(REGB5
)) {
293 REGB5
= TAG_Bool(ATTR_array___AbstractArrayRead____length(fra
.me
.REG
[3])!=NIT_NULL
);
294 if (UNTAG_Bool(REGB5
)) {
296 fprintf(stderr
, "Uninitialized attribute %s", "_length");
297 fprintf(stderr
, " (%s:%d)\n", LOCATE_array
, 233);
300 REGB5
= ATTR_array___AbstractArrayRead____length(fra
.me
.REG
[3]);
301 REGB5
= TAG_Bool(UNTAG_Int(REGB4
)<UNTAG_Int(REGB5
));
302 /* ./../lib/standard//collection//array.nit:233 */
304 REGB6
= TAG_Bool(false);
307 if (UNTAG_Bool(REGB5
)) {
309 fprintf(stderr
, "Assert %s failed", "'index'");
310 fprintf(stderr
, " (%s:%d)\n", LOCATE_array
, 233);
313 fra
.me
.REG
[3] = ATTR_array___Array____items(fra
.me
.REG
[3]);
314 REGB5
= TAG_Bool(fra
.me
.REG
[3]==NIT_NULL
);
315 /* ./../lib/standard//collection//array.nit:234 */
316 if (UNTAG_Bool(REGB5
)) {
317 fprintf(stderr
, "Reciever is null");
318 fprintf(stderr
, " (%s:%d)\n", LOCATE_array
, 234);
321 fra
.me
.REG
[3] = ((Nit_NativeArray
)fra
.me
.REG
[3])->val
[UNTAG_Int(REGB4
)];
322 /* ./../lib/standard//collection//array.nit:234 */
325 fra
.me
.REG
[4] = fra
.me
.REG
[1];
328 REGB5
= TAG_Bool(UNTAG_Int(REGB4
)>=UNTAG_Int(REGB5
));
329 /* ./../lib/standard//collection//array.nit:233 */
330 if (UNTAG_Bool(REGB5
)) {
331 REGB5
= TAG_Bool(ATTR_array___AbstractArrayRead____length(fra
.me
.REG
[4])!=NIT_NULL
);
332 if (UNTAG_Bool(REGB5
)) {
334 fprintf(stderr
, "Uninitialized attribute %s", "_length");
335 fprintf(stderr
, " (%s:%d)\n", LOCATE_array
, 233);
338 REGB5
= ATTR_array___AbstractArrayRead____length(fra
.me
.REG
[4]);
339 REGB5
= TAG_Bool(UNTAG_Int(REGB4
)<UNTAG_Int(REGB5
));
340 /* ./../lib/standard//collection//array.nit:233 */
342 REGB6
= TAG_Bool(false);
345 if (UNTAG_Bool(REGB5
)) {
347 fprintf(stderr
, "Assert %s failed", "'index'");
348 fprintf(stderr
, " (%s:%d)\n", LOCATE_array
, 233);
351 fra
.me
.REG
[4] = ATTR_array___Array____items(fra
.me
.REG
[4]);
352 REGB5
= TAG_Bool(fra
.me
.REG
[4]==NIT_NULL
);
353 /* ./../lib/standard//collection//array.nit:234 */
354 if (UNTAG_Bool(REGB5
)) {
355 fprintf(stderr
, "Reciever is null");
356 fprintf(stderr
, " (%s:%d)\n", LOCATE_array
, 234);
359 fra
.me
.REG
[4] = ((Nit_NativeArray
)fra
.me
.REG
[4])->val
[UNTAG_Int(REGB4
)];
360 /* ./../lib/standard//collection//array.nit:234 */
363 /* ./../lib/standard//collection//sorter.nit:55 */
364 CALL_abstract_collection___Map_____braeq(fra
.me
.REG
[1])(fra
.me
.REG
[1], REGB2
, fra
.me
.REG
[4]);
365 /* ./../lib/standard//collection//sorter.nit:56 */
366 CALL_abstract_collection___Map_____braeq(fra
.me
.REG
[1])(fra
.me
.REG
[1], REGB3
, fra
.me
.REG
[3]);
369 /* ./../lib/standard//collection//sorter.nit:50 */
375 REGB3
= TAG_Int(UNTAG_Int(REGB2
)-UNTAG_Int(REGB3
));
376 fra
.me
.REG
[3] = fra
.me
.REG
[1];
378 REGB4
= TAG_Bool(UNTAG_Int(REGB3
)>=UNTAG_Int(REGB4
));
379 /* ./../lib/standard//collection//array.nit:233 */
380 if (UNTAG_Bool(REGB4
)) {
381 REGB4
= TAG_Bool(ATTR_array___AbstractArrayRead____length(fra
.me
.REG
[3])!=NIT_NULL
);
382 if (UNTAG_Bool(REGB4
)) {
384 fprintf(stderr
, "Uninitialized attribute %s", "_length");
385 fprintf(stderr
, " (%s:%d)\n", LOCATE_array
, 233);
388 REGB4
= ATTR_array___AbstractArrayRead____length(fra
.me
.REG
[3]);
389 REGB4
= TAG_Bool(UNTAG_Int(REGB3
)<UNTAG_Int(REGB4
));
390 /* ./../lib/standard//collection//array.nit:233 */
392 REGB5
= TAG_Bool(false);
395 if (UNTAG_Bool(REGB4
)) {
397 fprintf(stderr
, "Assert %s failed", "'index'");
398 fprintf(stderr
, " (%s:%d)\n", LOCATE_array
, 233);
401 fra
.me
.REG
[3] = ATTR_array___Array____items(fra
.me
.REG
[3]);
402 REGB4
= TAG_Bool(fra
.me
.REG
[3]==NIT_NULL
);
403 /* ./../lib/standard//collection//array.nit:234 */
404 if (UNTAG_Bool(REGB4
)) {
405 fprintf(stderr
, "Reciever is null");
406 fprintf(stderr
, " (%s:%d)\n", LOCATE_array
, 234);
409 fra
.me
.REG
[3] = ((Nit_NativeArray
)fra
.me
.REG
[3])->val
[UNTAG_Int(REGB3
)];
410 /* ./../lib/standard//collection//array.nit:234 */
413 /* ./../lib/standard//collection//sorter.nit:59 */
414 CALL_abstract_collection___Map_____braeq(fra
.me
.REG
[1])(fra
.me
.REG
[1], REGB0
, fra
.me
.REG
[3]);
416 REGB3
= TAG_Int(UNTAG_Int(REGB2
)-UNTAG_Int(REGB3
));
417 /* ./../lib/standard//collection//sorter.nit:60 */
418 CALL_abstract_collection___Map_____braeq(fra
.me
.REG
[1])(fra
.me
.REG
[1], REGB3
, fra
.me
.REG
[2]);
420 REGB3
= TAG_Int(UNTAG_Int(REGB2
)-UNTAG_Int(REGB3
));
421 /* ./../lib/standard//collection//sorter.nit:61 */
422 CALL_sorter___AbstractSorter___sub_sort(fra
.me
.REG
[0])(fra
.me
.REG
[0], fra
.me
.REG
[1], REGB0
, REGB3
);
423 /* ./../lib/standard//collection//sorter.nit:62 */
424 CALL_sorter___AbstractSorter___sub_sort(fra
.me
.REG
[0])(fra
.me
.REG
[0], fra
.me
.REG
[1], REGB2
, REGB1
);
425 stack_frame_head
= fra
.me
.prev
;
428 void sorter___AbstractSorter___bubble_sort(val_t p0
, val_t p1
, val_t p2
, val_t p3
){
429 struct {struct stack_frame_t me
; val_t MORE_REG
[3];} fra
;
438 fra
.me
.prev
= stack_frame_head
; stack_frame_head
= &fra
.me
;
439 fra
.me
.file
= LOCATE_sorter
;
441 fra
.me
.meth
= LOCATE_sorter___AbstractSorter___bubble_sort
;
442 fra
.me
.has_broke
= 0;
444 fra
.me
.REG
[0] = NIT_NULL
;
445 fra
.me
.REG
[1] = NIT_NULL
;
446 fra
.me
.REG
[2] = NIT_NULL
;
447 fra
.me
.REG
[3] = NIT_NULL
;
452 /* ./../lib/standard//collection//sorter.nit:69 */
454 REGB2
= TAG_Bool(UNTAG_Int(REGB0
)<UNTAG_Int(REGB1
));
455 /* ./../lib/standard//collection//sorter.nit:69 */
456 if (UNTAG_Bool(REGB2
)) {
458 fra
.me
.REG
[2] = fra
.me
.REG
[1];
461 REGB4
= TAG_Bool(UNTAG_Int(REGB3
)>=UNTAG_Int(REGB4
));
462 /* ./../lib/standard//collection//array.nit:233 */
463 if (UNTAG_Bool(REGB4
)) {
464 REGB4
= TAG_Bool(ATTR_array___AbstractArrayRead____length(fra
.me
.REG
[2])!=NIT_NULL
);
465 if (UNTAG_Bool(REGB4
)) {
467 fprintf(stderr
, "Uninitialized attribute %s", "_length");
468 fprintf(stderr
, " (%s:%d)\n", LOCATE_array
, 233);
471 REGB4
= ATTR_array___AbstractArrayRead____length(fra
.me
.REG
[2]);
472 REGB4
= TAG_Bool(UNTAG_Int(REGB3
)<UNTAG_Int(REGB4
));
473 /* ./../lib/standard//collection//array.nit:233 */
475 REGB5
= TAG_Bool(false);
478 if (UNTAG_Bool(REGB4
)) {
480 fprintf(stderr
, "Assert %s failed", "'index'");
481 fprintf(stderr
, " (%s:%d)\n", LOCATE_array
, 233);
484 fra
.me
.REG
[2] = ATTR_array___Array____items(fra
.me
.REG
[2]);
485 REGB4
= TAG_Bool(fra
.me
.REG
[2]==NIT_NULL
);
486 /* ./../lib/standard//collection//array.nit:234 */
487 if (UNTAG_Bool(REGB4
)) {
488 fprintf(stderr
, "Reciever is null");
489 fprintf(stderr
, " (%s:%d)\n", LOCATE_array
, 234);
492 fra
.me
.REG
[2] = ((Nit_NativeArray
)fra
.me
.REG
[2])->val
[UNTAG_Int(REGB3
)];
493 /* ./../lib/standard//collection//array.nit:234 */
497 /* ./../lib/standard//collection//sorter.nit:73 */
499 REGB4
= TAG_Bool(UNTAG_Int(REGB3
)<=UNTAG_Int(REGB1
));
500 /* ./../lib/standard//collection//sorter.nit:73 */
501 if (UNTAG_Bool(REGB4
)) {
502 fra
.me
.REG
[3] = fra
.me
.REG
[1];
505 REGB5
= TAG_Bool(UNTAG_Int(REGB4
)>=UNTAG_Int(REGB5
));
506 /* ./../lib/standard//collection//array.nit:233 */
507 if (UNTAG_Bool(REGB5
)) {
508 REGB5
= TAG_Bool(ATTR_array___AbstractArrayRead____length(fra
.me
.REG
[3])!=NIT_NULL
);
509 if (UNTAG_Bool(REGB5
)) {
511 fprintf(stderr
, "Uninitialized attribute %s", "_length");
512 fprintf(stderr
, " (%s:%d)\n", LOCATE_array
, 233);
515 REGB5
= ATTR_array___AbstractArrayRead____length(fra
.me
.REG
[3]);
516 REGB5
= TAG_Bool(UNTAG_Int(REGB4
)<UNTAG_Int(REGB5
));
517 /* ./../lib/standard//collection//array.nit:233 */
519 REGB6
= TAG_Bool(false);
522 if (UNTAG_Bool(REGB5
)) {
524 fprintf(stderr
, "Assert %s failed", "'index'");
525 fprintf(stderr
, " (%s:%d)\n", LOCATE_array
, 233);
528 fra
.me
.REG
[3] = ATTR_array___Array____items(fra
.me
.REG
[3]);
529 REGB5
= TAG_Bool(fra
.me
.REG
[3]==NIT_NULL
);
530 /* ./../lib/standard//collection//array.nit:234 */
531 if (UNTAG_Bool(REGB5
)) {
532 fprintf(stderr
, "Reciever is null");
533 fprintf(stderr
, " (%s:%d)\n", LOCATE_array
, 234);
536 fra
.me
.REG
[3] = ((Nit_NativeArray
)fra
.me
.REG
[3])->val
[UNTAG_Int(REGB4
)];
537 /* ./../lib/standard//collection//array.nit:234 */
540 REGB4
= CALL_sorter___AbstractSorter___compare(fra
.me
.REG
[0])(fra
.me
.REG
[0], fra
.me
.REG
[2], fra
.me
.REG
[3]);
542 REGB5
= TAG_Bool(UNTAG_Int(REGB4
)>UNTAG_Int(REGB5
));
543 /* ./../lib/standard//collection//sorter.nit:74 */
544 if (UNTAG_Bool(REGB5
)) {
546 fra
.me
.REG
[3] = fra
.me
.REG
[1];
549 REGB4
= TAG_Bool(UNTAG_Int(REGB5
)>=UNTAG_Int(REGB4
));
550 /* ./../lib/standard//collection//array.nit:233 */
551 if (UNTAG_Bool(REGB4
)) {
552 REGB4
= TAG_Bool(ATTR_array___AbstractArrayRead____length(fra
.me
.REG
[3])!=NIT_NULL
);
553 if (UNTAG_Bool(REGB4
)) {
555 fprintf(stderr
, "Uninitialized attribute %s", "_length");
556 fprintf(stderr
, " (%s:%d)\n", LOCATE_array
, 233);
559 REGB4
= ATTR_array___AbstractArrayRead____length(fra
.me
.REG
[3]);
560 REGB4
= TAG_Bool(UNTAG_Int(REGB5
)<UNTAG_Int(REGB4
));
561 /* ./../lib/standard//collection//array.nit:233 */
563 REGB6
= TAG_Bool(false);
566 if (UNTAG_Bool(REGB4
)) {
568 fprintf(stderr
, "Assert %s failed", "'index'");
569 fprintf(stderr
, " (%s:%d)\n", LOCATE_array
, 233);
572 fra
.me
.REG
[3] = ATTR_array___Array____items(fra
.me
.REG
[3]);
573 REGB4
= TAG_Bool(fra
.me
.REG
[3]==NIT_NULL
);
574 /* ./../lib/standard//collection//array.nit:234 */
575 if (UNTAG_Bool(REGB4
)) {
576 fprintf(stderr
, "Reciever is null");
577 fprintf(stderr
, " (%s:%d)\n", LOCATE_array
, 234);
580 fra
.me
.REG
[3] = ((Nit_NativeArray
)fra
.me
.REG
[3])->val
[UNTAG_Int(REGB5
)];
581 /* ./../lib/standard//collection//array.nit:234 */
584 fra
.me
.REG
[2] = fra
.me
.REG
[3];
585 /* ./../lib/standard//collection//sorter.nit:76 */
588 REGB5
= TAG_Int(UNTAG_Int(REGB3
)+UNTAG_Int(REGB5
));
590 /* ./../lib/standard//collection//sorter.nit:78 */
592 /* ./../lib/standard//collection//sorter.nit:73 */
597 REGB3
= TAG_Bool(IS_EQUAL_OO(REGB2
,REGB0
));
598 /* ./../lib/standard//collection//sorter.nit:80 */
599 if (UNTAG_Bool(REGB3
)) {
601 REGB5
= TAG_Bool((REGB2
)==(REGB0
));
603 /* ./../lib/standard//collection//sorter.nit:80 */
605 REGB3
= TAG_Bool(!UNTAG_Bool(REGB3
));
606 if (UNTAG_Bool(REGB3
)) {
607 fra
.me
.REG
[3] = fra
.me
.REG
[1];
610 REGB5
= TAG_Bool(UNTAG_Int(REGB3
)>=UNTAG_Int(REGB5
));
611 /* ./../lib/standard//collection//array.nit:233 */
612 if (UNTAG_Bool(REGB5
)) {
613 REGB5
= TAG_Bool(ATTR_array___AbstractArrayRead____length(fra
.me
.REG
[3])!=NIT_NULL
);
614 if (UNTAG_Bool(REGB5
)) {
616 fprintf(stderr
, "Uninitialized attribute %s", "_length");
617 fprintf(stderr
, " (%s:%d)\n", LOCATE_array
, 233);
620 REGB5
= ATTR_array___AbstractArrayRead____length(fra
.me
.REG
[3]);
621 REGB5
= TAG_Bool(UNTAG_Int(REGB3
)<UNTAG_Int(REGB5
));
622 /* ./../lib/standard//collection//array.nit:233 */
624 REGB4
= TAG_Bool(false);
627 if (UNTAG_Bool(REGB5
)) {
629 fprintf(stderr
, "Assert %s failed", "'index'");
630 fprintf(stderr
, " (%s:%d)\n", LOCATE_array
, 233);
633 fra
.me
.REG
[3] = ATTR_array___Array____items(fra
.me
.REG
[3]);
634 REGB5
= TAG_Bool(fra
.me
.REG
[3]==NIT_NULL
);
635 /* ./../lib/standard//collection//array.nit:234 */
636 if (UNTAG_Bool(REGB5
)) {
637 fprintf(stderr
, "Reciever is null");
638 fprintf(stderr
, " (%s:%d)\n", LOCATE_array
, 234);
641 fra
.me
.REG
[3] = ((Nit_NativeArray
)fra
.me
.REG
[3])->val
[UNTAG_Int(REGB3
)];
642 /* ./../lib/standard//collection//array.nit:234 */
645 /* ./../lib/standard//collection//sorter.nit:81 */
646 CALL_abstract_collection___Map_____braeq(fra
.me
.REG
[1])(fra
.me
.REG
[1], REGB2
, fra
.me
.REG
[3]);
647 /* ./../lib/standard//collection//sorter.nit:82 */
648 CALL_abstract_collection___Map_____braeq(fra
.me
.REG
[1])(fra
.me
.REG
[1], REGB0
, fra
.me
.REG
[2]);
651 REGB2
= TAG_Int(UNTAG_Int(REGB0
)+UNTAG_Int(REGB2
));
653 /* ./../lib/standard//collection//sorter.nit:84 */
655 /* ./../lib/standard//collection//sorter.nit:69 */
660 stack_frame_head
= fra
.me
.prev
;
663 void sorter___AbstractSorter___init(val_t p0
, int* init_table
){
664 int itpos0
= VAL2OBJ(p0
)->vft
[INIT_TABLE_POS_AbstractSorter
].i
;
665 struct {struct stack_frame_t me
;} fra
;
667 if (init_table
[itpos0
]) return;
668 fra
.me
.prev
= stack_frame_head
; stack_frame_head
= &fra
.me
;
669 fra
.me
.file
= LOCATE_sorter
;
671 fra
.me
.meth
= LOCATE_sorter___AbstractSorter___init
;
672 fra
.me
.has_broke
= 0;
674 stack_frame_head
= fra
.me
.prev
;
675 init_table
[itpos0
] = 1;
678 val_t
sorter___ComparableSorter___compare(val_t p0
, val_t p1
, val_t p2
){
679 struct {struct stack_frame_t me
; val_t MORE_REG
[2];} fra
;
682 fra
.me
.prev
= stack_frame_head
; stack_frame_head
= &fra
.me
;
683 fra
.me
.file
= LOCATE_sorter
;
685 fra
.me
.meth
= LOCATE_sorter___ComparableSorter___compare
;
686 fra
.me
.has_broke
= 0;
688 fra
.me
.REG
[0] = NIT_NULL
;
689 fra
.me
.REG
[1] = NIT_NULL
;
690 fra
.me
.REG
[2] = NIT_NULL
;
694 REGB0
= CALL_kernel___Comparable_____leqg(fra
.me
.REG
[1])(fra
.me
.REG
[1], fra
.me
.REG
[2]);
695 /* ./../lib/standard//collection//sorter.nit:94 */
698 stack_frame_head
= fra
.me
.prev
;
701 void sorter___ComparableSorter___init(val_t p0
, int* init_table
){
702 int itpos1
= VAL2OBJ(p0
)->vft
[INIT_TABLE_POS_ComparableSorter
].i
;
703 struct {struct stack_frame_t me
;} fra
;
705 if (init_table
[itpos1
]) return;
706 fra
.me
.prev
= stack_frame_head
; stack_frame_head
= &fra
.me
;
707 fra
.me
.file
= LOCATE_sorter
;
709 fra
.me
.meth
= LOCATE_sorter___ComparableSorter___init
;
710 fra
.me
.has_broke
= 0;
712 fra
.me
.REG
[0] = NIT_NULL
;
714 /* ./../lib/standard//collection//sorter.nit:96 */
715 CALL_sorter___AbstractSorter___init(fra
.me
.REG
[0])(fra
.me
.REG
[0], init_table
);
716 stack_frame_head
= fra
.me
.prev
;
717 init_table
[itpos1
] = 1;