update NOTICE and LICENSE
[nit.git] / c_src / sorter._sep.c
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;
5 val_t tmp;
6 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
7 fra.me.file = LOCATE_sorter;
8 fra.me.line = 22;
9 fra.me.meth = LOCATE_sorter___AbstractSorter___compare;
10 fra.me.has_broke = 0;
11 fra.me.REG_size = 0;
12 /* ./../lib/standard//collection//sorter.nit:22 */
13 nit_abort("Deferred method called", NULL, LOCATE_sorter, 22);
14 stack_frame_head = fra.me.prev;
15 return NIT_NULL;
16 }
17 void sorter___AbstractSorter___sort(val_t p0, val_t p1){
18 struct {struct stack_frame_t me; val_t MORE_REG[1];} fra;
19 val_t REGB0;
20 val_t REGB1;
21 val_t REGB2;
22 val_t tmp;
23 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
24 fra.me.file = LOCATE_sorter;
25 fra.me.line = 29;
26 fra.me.meth = LOCATE_sorter___AbstractSorter___sort;
27 fra.me.has_broke = 0;
28 fra.me.REG_size = 2;
29 fra.me.REG[0] = NIT_NULL;
30 fra.me.REG[1] = NIT_NULL;
31 fra.me.REG[0] = p0;
32 fra.me.REG[1] = p1;
33 /* ./../lib/standard//collection//sorter.nit:30 */
34 REGB0 = TAG_Int(0);
35 /* ./../lib/standard//collection//array.nit:23 */
36 REGB1 = TAG_Bool(ATTR_array___AbstractArrayRead____length(fra.me.REG[1])!=NIT_NULL);
37 if (UNTAG_Bool(REGB1)) {
38 } else {
39 nit_abort("Uninitialized attribute %s", "_length", LOCATE_array, 23);
40 }
41 REGB1 = ATTR_array___AbstractArrayRead____length(fra.me.REG[1]);
42 /* ./../lib/standard//collection//sorter.nit:30 */
43 REGB2 = TAG_Int(1);
44 /* ./../lib/standard//kernel.nit:217 */
45 REGB2 = TAG_Int(UNTAG_Int(REGB1)-UNTAG_Int(REGB2));
46 /* ./../lib/standard//collection//sorter.nit:30 */
47 CALL_sorter___AbstractSorter___sub_sort(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1], REGB0, REGB2);
48 stack_frame_head = fra.me.prev;
49 return;
50 }
51 void sorter___AbstractSorter___sub_sort(val_t p0, val_t p1, val_t p2, val_t p3){
52 struct {struct stack_frame_t me; val_t MORE_REG[1];} fra;
53 val_t REGB0;
54 val_t REGB1;
55 val_t REGB2;
56 val_t tmp;
57 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
58 fra.me.file = LOCATE_sorter;
59 fra.me.line = 32;
60 fra.me.meth = LOCATE_sorter___AbstractSorter___sub_sort;
61 fra.me.has_broke = 0;
62 fra.me.REG_size = 2;
63 fra.me.REG[0] = NIT_NULL;
64 fra.me.REG[1] = NIT_NULL;
65 fra.me.REG[0] = p0;
66 fra.me.REG[1] = p1;
67 REGB0 = p2;
68 REGB1 = p3;
69 /* ./../lib/standard//kernel.nit:213 */
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 */
74 goto label1;
75 } else {
76 /* ./../lib/standard//collection//sorter.nit:37 */
77 REGB2 = TAG_Int(7);
78 /* ./../lib/standard//kernel.nit:215 */
79 REGB2 = TAG_Int(UNTAG_Int(REGB0)+UNTAG_Int(REGB2));
80 /* ./../lib/standard//kernel.nit:212 */
81 REGB2 = TAG_Bool(UNTAG_Int(REGB2)<UNTAG_Int(REGB1));
82 /* ./../lib/standard//collection//sorter.nit:37 */
83 if (UNTAG_Bool(REGB2)) {
84 /* ./../lib/standard//collection//sorter.nit:38 */
85 CALL_sorter___AbstractSorter___quick_sort(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1], REGB0, REGB1);
86 } else {
87 /* ./../lib/standard//collection//sorter.nit:40 */
88 CALL_sorter___AbstractSorter___bubble_sort(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1], REGB0, REGB1);
89 }
90 }
91 label1: while(0);
92 stack_frame_head = fra.me.prev;
93 return;
94 }
95 void sorter___AbstractSorter___quick_sort(val_t p0, val_t p1, val_t p2, val_t p3){
96 struct {struct stack_frame_t me; val_t MORE_REG[4];} fra;
97 val_t REGB0;
98 val_t REGB1;
99 val_t REGB2;
100 val_t REGB3;
101 val_t REGB4;
102 val_t REGB5;
103 val_t REGB6;
104 val_t tmp;
105 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
106 fra.me.file = LOCATE_sorter;
107 fra.me.line = 44;
108 fra.me.meth = LOCATE_sorter___AbstractSorter___quick_sort;
109 fra.me.has_broke = 0;
110 fra.me.REG_size = 5;
111 fra.me.REG[0] = NIT_NULL;
112 fra.me.REG[1] = NIT_NULL;
113 fra.me.REG[2] = NIT_NULL;
114 fra.me.REG[3] = NIT_NULL;
115 fra.me.REG[4] = NIT_NULL;
116 fra.me.REG[0] = p0;
117 fra.me.REG[1] = p1;
118 REGB0 = p2;
119 REGB1 = p3;
120 /* ./../lib/standard//collection//array.nit:243 */
121 fra.me.REG[2] = fra.me.REG[1];
122 REGB2 = REGB0;
123 /* ./../lib/standard//collection//array.nit:245 */
124 REGB3 = TAG_Int(0);
125 /* ./../lib/standard//kernel.nit:213 */
126 REGB3 = TAG_Bool(UNTAG_Int(REGB2)>=UNTAG_Int(REGB3));
127 /* ./../lib/standard//collection//array.nit:245 */
128 if (UNTAG_Bool(REGB3)) {
129 REGB3 = TAG_Bool(ATTR_array___AbstractArrayRead____length(fra.me.REG[2])!=NIT_NULL);
130 if (UNTAG_Bool(REGB3)) {
131 } else {
132 nit_abort("Uninitialized attribute %s", "_length", LOCATE_array, 245);
133 }
134 REGB3 = ATTR_array___AbstractArrayRead____length(fra.me.REG[2]);
135 /* ./../lib/standard//kernel.nit:212 */
136 REGB3 = TAG_Bool(UNTAG_Int(REGB2)<UNTAG_Int(REGB3));
137 } else {
138 /* ./../lib/standard//collection//array.nit:245 */
139 REGB4 = TAG_Bool(false);
140 REGB3 = REGB4;
141 }
142 if (UNTAG_Bool(REGB3)) {
143 } else {
144 nit_abort("Assert %s failed", "'index'", LOCATE_array, 245);
145 }
146 /* ./../lib/standard//collection//array.nit:246 */
147 fra.me.REG[2] = ATTR_array___Array____items(fra.me.REG[2]);
148 REGB3 = TAG_Bool(fra.me.REG[2]==NIT_NULL);
149 if (UNTAG_Bool(REGB3)) {
150 nit_abort("Reciever is null", NULL, LOCATE_array, 246);
151 }
152 /* ./../lib/standard//collection//array.nit:654 */
153 fra.me.REG[2] = ((Nit_NativeArray)fra.me.REG[2])->val[UNTAG_Int(REGB2)];
154 /* ./../lib/standard//collection//array.nit:246 */
155 goto label1;
156 label1: while(0);
157 /* ./../lib/standard//collection//sorter.nit:48 */
158 REGB2 = REGB0;
159 /* ./../lib/standard//collection//sorter.nit:49 */
160 REGB3 = REGB1;
161 /* ./../lib/standard//collection//sorter.nit:50 */
162 while(1) {
163 /* ./../lib/standard//kernel.nit:214 */
164 REGB4 = TAG_Bool(UNTAG_Int(REGB3)>UNTAG_Int(REGB2));
165 /* ./../lib/standard//collection//sorter.nit:50 */
166 if (UNTAG_Bool(REGB4)) {
167 /* ./../lib/standard//collection//sorter.nit:51 */
168 while(1) {
169 /* ./../lib/standard//kernel.nit:211 */
170 REGB4 = TAG_Bool(UNTAG_Int(REGB2)<=UNTAG_Int(REGB1));
171 /* ./../lib/standard//collection//sorter.nit:51 */
172 if (UNTAG_Bool(REGB4)) {
173 /* ./../lib/standard//collection//array.nit:243 */
174 fra.me.REG[3] = fra.me.REG[1];
175 REGB4 = REGB2;
176 /* ./../lib/standard//collection//array.nit:245 */
177 REGB5 = TAG_Int(0);
178 /* ./../lib/standard//kernel.nit:213 */
179 REGB5 = TAG_Bool(UNTAG_Int(REGB4)>=UNTAG_Int(REGB5));
180 /* ./../lib/standard//collection//array.nit:245 */
181 if (UNTAG_Bool(REGB5)) {
182 REGB5 = TAG_Bool(ATTR_array___AbstractArrayRead____length(fra.me.REG[3])!=NIT_NULL);
183 if (UNTAG_Bool(REGB5)) {
184 } else {
185 nit_abort("Uninitialized attribute %s", "_length", LOCATE_array, 245);
186 }
187 REGB5 = ATTR_array___AbstractArrayRead____length(fra.me.REG[3]);
188 /* ./../lib/standard//kernel.nit:212 */
189 REGB5 = TAG_Bool(UNTAG_Int(REGB4)<UNTAG_Int(REGB5));
190 } else {
191 /* ./../lib/standard//collection//array.nit:245 */
192 REGB6 = TAG_Bool(false);
193 REGB5 = REGB6;
194 }
195 if (UNTAG_Bool(REGB5)) {
196 } else {
197 nit_abort("Assert %s failed", "'index'", LOCATE_array, 245);
198 }
199 /* ./../lib/standard//collection//array.nit:246 */
200 fra.me.REG[3] = ATTR_array___Array____items(fra.me.REG[3]);
201 REGB5 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
202 if (UNTAG_Bool(REGB5)) {
203 nit_abort("Reciever is null", NULL, LOCATE_array, 246);
204 }
205 /* ./../lib/standard//collection//array.nit:654 */
206 fra.me.REG[3] = ((Nit_NativeArray)fra.me.REG[3])->val[UNTAG_Int(REGB4)];
207 /* ./../lib/standard//collection//array.nit:246 */
208 goto label2;
209 label2: while(0);
210 /* ./../lib/standard//collection//sorter.nit:51 */
211 REGB4 = CALL_sorter___AbstractSorter___compare(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[3], fra.me.REG[2]);
212 REGB5 = TAG_Int(0);
213 /* ./../lib/standard//kernel.nit:211 */
214 REGB5 = TAG_Bool(UNTAG_Int(REGB4)<=UNTAG_Int(REGB5));
215 } else {
216 /* ./../lib/standard//collection//sorter.nit:51 */
217 REGB4 = TAG_Bool(false);
218 REGB5 = REGB4;
219 }
220 if (UNTAG_Bool(REGB5)) {
221 REGB5 = TAG_Int(1);
222 /* ./../lib/standard//kernel.nit:215 */
223 REGB5 = TAG_Int(UNTAG_Int(REGB2)+UNTAG_Int(REGB5));
224 /* ./../lib/standard//collection//sorter.nit:51 */
225 REGB2 = REGB5;
226 } else {
227 goto label3;
228 }
229 }
230 label3: while(0);
231 /* ./../lib/standard//collection//sorter.nit:52 */
232 while(1) {
233 /* ./../lib/standard//kernel.nit:214 */
234 REGB5 = TAG_Bool(UNTAG_Int(REGB3)>UNTAG_Int(REGB2));
235 /* ./../lib/standard//collection//sorter.nit:52 */
236 if (UNTAG_Bool(REGB5)) {
237 /* ./../lib/standard//collection//array.nit:243 */
238 fra.me.REG[3] = fra.me.REG[1];
239 REGB5 = REGB3;
240 /* ./../lib/standard//collection//array.nit:245 */
241 REGB4 = TAG_Int(0);
242 /* ./../lib/standard//kernel.nit:213 */
243 REGB4 = TAG_Bool(UNTAG_Int(REGB5)>=UNTAG_Int(REGB4));
244 /* ./../lib/standard//collection//array.nit:245 */
245 if (UNTAG_Bool(REGB4)) {
246 REGB4 = TAG_Bool(ATTR_array___AbstractArrayRead____length(fra.me.REG[3])!=NIT_NULL);
247 if (UNTAG_Bool(REGB4)) {
248 } else {
249 nit_abort("Uninitialized attribute %s", "_length", LOCATE_array, 245);
250 }
251 REGB4 = ATTR_array___AbstractArrayRead____length(fra.me.REG[3]);
252 /* ./../lib/standard//kernel.nit:212 */
253 REGB4 = TAG_Bool(UNTAG_Int(REGB5)<UNTAG_Int(REGB4));
254 } else {
255 /* ./../lib/standard//collection//array.nit:245 */
256 REGB6 = TAG_Bool(false);
257 REGB4 = REGB6;
258 }
259 if (UNTAG_Bool(REGB4)) {
260 } else {
261 nit_abort("Assert %s failed", "'index'", LOCATE_array, 245);
262 }
263 /* ./../lib/standard//collection//array.nit:246 */
264 fra.me.REG[3] = ATTR_array___Array____items(fra.me.REG[3]);
265 REGB4 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
266 if (UNTAG_Bool(REGB4)) {
267 nit_abort("Reciever is null", NULL, LOCATE_array, 246);
268 }
269 /* ./../lib/standard//collection//array.nit:654 */
270 fra.me.REG[3] = ((Nit_NativeArray)fra.me.REG[3])->val[UNTAG_Int(REGB5)];
271 /* ./../lib/standard//collection//array.nit:246 */
272 goto label4;
273 label4: while(0);
274 /* ./../lib/standard//collection//sorter.nit:52 */
275 REGB5 = CALL_sorter___AbstractSorter___compare(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[3], fra.me.REG[2]);
276 REGB4 = TAG_Int(0);
277 /* ./../lib/standard//kernel.nit:213 */
278 REGB4 = TAG_Bool(UNTAG_Int(REGB5)>=UNTAG_Int(REGB4));
279 } else {
280 /* ./../lib/standard//collection//sorter.nit:52 */
281 REGB5 = TAG_Bool(false);
282 REGB4 = REGB5;
283 }
284 if (UNTAG_Bool(REGB4)) {
285 REGB4 = TAG_Int(1);
286 /* ./../lib/standard//kernel.nit:217 */
287 REGB4 = TAG_Int(UNTAG_Int(REGB3)-UNTAG_Int(REGB4));
288 /* ./../lib/standard//collection//sorter.nit:52 */
289 REGB3 = REGB4;
290 } else {
291 goto label5;
292 }
293 }
294 label5: while(0);
295 /* ./../lib/standard//kernel.nit:214 */
296 REGB4 = TAG_Bool(UNTAG_Int(REGB3)>UNTAG_Int(REGB2));
297 /* ./../lib/standard//collection//sorter.nit:53 */
298 if (UNTAG_Bool(REGB4)) {
299 /* ./../lib/standard//collection//array.nit:243 */
300 fra.me.REG[3] = fra.me.REG[1];
301 REGB4 = REGB2;
302 /* ./../lib/standard//collection//array.nit:245 */
303 REGB5 = TAG_Int(0);
304 /* ./../lib/standard//kernel.nit:213 */
305 REGB5 = TAG_Bool(UNTAG_Int(REGB4)>=UNTAG_Int(REGB5));
306 /* ./../lib/standard//collection//array.nit:245 */
307 if (UNTAG_Bool(REGB5)) {
308 REGB5 = TAG_Bool(ATTR_array___AbstractArrayRead____length(fra.me.REG[3])!=NIT_NULL);
309 if (UNTAG_Bool(REGB5)) {
310 } else {
311 nit_abort("Uninitialized attribute %s", "_length", LOCATE_array, 245);
312 }
313 REGB5 = ATTR_array___AbstractArrayRead____length(fra.me.REG[3]);
314 /* ./../lib/standard//kernel.nit:212 */
315 REGB5 = TAG_Bool(UNTAG_Int(REGB4)<UNTAG_Int(REGB5));
316 } else {
317 /* ./../lib/standard//collection//array.nit:245 */
318 REGB6 = TAG_Bool(false);
319 REGB5 = REGB6;
320 }
321 if (UNTAG_Bool(REGB5)) {
322 } else {
323 nit_abort("Assert %s failed", "'index'", LOCATE_array, 245);
324 }
325 /* ./../lib/standard//collection//array.nit:246 */
326 fra.me.REG[3] = ATTR_array___Array____items(fra.me.REG[3]);
327 REGB5 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
328 if (UNTAG_Bool(REGB5)) {
329 nit_abort("Reciever is null", NULL, LOCATE_array, 246);
330 }
331 /* ./../lib/standard//collection//array.nit:654 */
332 fra.me.REG[3] = ((Nit_NativeArray)fra.me.REG[3])->val[UNTAG_Int(REGB4)];
333 /* ./../lib/standard//collection//array.nit:246 */
334 goto label6;
335 label6: while(0);
336 /* ./../lib/standard//collection//array.nit:243 */
337 fra.me.REG[4] = fra.me.REG[1];
338 REGB4 = REGB3;
339 /* ./../lib/standard//collection//array.nit:245 */
340 REGB5 = TAG_Int(0);
341 /* ./../lib/standard//kernel.nit:213 */
342 REGB5 = TAG_Bool(UNTAG_Int(REGB4)>=UNTAG_Int(REGB5));
343 /* ./../lib/standard//collection//array.nit:245 */
344 if (UNTAG_Bool(REGB5)) {
345 REGB5 = TAG_Bool(ATTR_array___AbstractArrayRead____length(fra.me.REG[4])!=NIT_NULL);
346 if (UNTAG_Bool(REGB5)) {
347 } else {
348 nit_abort("Uninitialized attribute %s", "_length", LOCATE_array, 245);
349 }
350 REGB5 = ATTR_array___AbstractArrayRead____length(fra.me.REG[4]);
351 /* ./../lib/standard//kernel.nit:212 */
352 REGB5 = TAG_Bool(UNTAG_Int(REGB4)<UNTAG_Int(REGB5));
353 } else {
354 /* ./../lib/standard//collection//array.nit:245 */
355 REGB6 = TAG_Bool(false);
356 REGB5 = REGB6;
357 }
358 if (UNTAG_Bool(REGB5)) {
359 } else {
360 nit_abort("Assert %s failed", "'index'", LOCATE_array, 245);
361 }
362 /* ./../lib/standard//collection//array.nit:246 */
363 fra.me.REG[4] = ATTR_array___Array____items(fra.me.REG[4]);
364 REGB5 = TAG_Bool(fra.me.REG[4]==NIT_NULL);
365 if (UNTAG_Bool(REGB5)) {
366 nit_abort("Reciever is null", NULL, LOCATE_array, 246);
367 }
368 /* ./../lib/standard//collection//array.nit:654 */
369 fra.me.REG[4] = ((Nit_NativeArray)fra.me.REG[4])->val[UNTAG_Int(REGB4)];
370 /* ./../lib/standard//collection//array.nit:246 */
371 goto label7;
372 label7: while(0);
373 /* ./../lib/standard//collection//sorter.nit:55 */
374 CALL_abstract_collection___Map_____braeq(fra.me.REG[1])(fra.me.REG[1], REGB2, fra.me.REG[4]);
375 /* ./../lib/standard//collection//sorter.nit:56 */
376 CALL_abstract_collection___Map_____braeq(fra.me.REG[1])(fra.me.REG[1], REGB3, fra.me.REG[3]);
377 }
378 } else {
379 /* ./../lib/standard//collection//sorter.nit:50 */
380 goto label8;
381 }
382 }
383 label8: while(0);
384 /* ./../lib/standard//collection//sorter.nit:59 */
385 REGB3 = TAG_Int(1);
386 /* ./../lib/standard//kernel.nit:217 */
387 REGB3 = TAG_Int(UNTAG_Int(REGB2)-UNTAG_Int(REGB3));
388 /* ./../lib/standard//collection//array.nit:243 */
389 fra.me.REG[3] = fra.me.REG[1];
390 /* ./../lib/standard//collection//array.nit:245 */
391 REGB4 = TAG_Int(0);
392 /* ./../lib/standard//kernel.nit:213 */
393 REGB4 = TAG_Bool(UNTAG_Int(REGB3)>=UNTAG_Int(REGB4));
394 /* ./../lib/standard//collection//array.nit:245 */
395 if (UNTAG_Bool(REGB4)) {
396 REGB4 = TAG_Bool(ATTR_array___AbstractArrayRead____length(fra.me.REG[3])!=NIT_NULL);
397 if (UNTAG_Bool(REGB4)) {
398 } else {
399 nit_abort("Uninitialized attribute %s", "_length", LOCATE_array, 245);
400 }
401 REGB4 = ATTR_array___AbstractArrayRead____length(fra.me.REG[3]);
402 /* ./../lib/standard//kernel.nit:212 */
403 REGB4 = TAG_Bool(UNTAG_Int(REGB3)<UNTAG_Int(REGB4));
404 } else {
405 /* ./../lib/standard//collection//array.nit:245 */
406 REGB5 = TAG_Bool(false);
407 REGB4 = REGB5;
408 }
409 if (UNTAG_Bool(REGB4)) {
410 } else {
411 nit_abort("Assert %s failed", "'index'", LOCATE_array, 245);
412 }
413 /* ./../lib/standard//collection//array.nit:246 */
414 fra.me.REG[3] = ATTR_array___Array____items(fra.me.REG[3]);
415 REGB4 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
416 if (UNTAG_Bool(REGB4)) {
417 nit_abort("Reciever is null", NULL, LOCATE_array, 246);
418 }
419 /* ./../lib/standard//collection//array.nit:654 */
420 fra.me.REG[3] = ((Nit_NativeArray)fra.me.REG[3])->val[UNTAG_Int(REGB3)];
421 /* ./../lib/standard//collection//array.nit:246 */
422 goto label9;
423 label9: while(0);
424 /* ./../lib/standard//collection//sorter.nit:59 */
425 CALL_abstract_collection___Map_____braeq(fra.me.REG[1])(fra.me.REG[1], REGB0, fra.me.REG[3]);
426 /* ./../lib/standard//collection//sorter.nit:60 */
427 REGB3 = TAG_Int(1);
428 /* ./../lib/standard//kernel.nit:217 */
429 REGB3 = TAG_Int(UNTAG_Int(REGB2)-UNTAG_Int(REGB3));
430 /* ./../lib/standard//collection//sorter.nit:60 */
431 CALL_abstract_collection___Map_____braeq(fra.me.REG[1])(fra.me.REG[1], REGB3, fra.me.REG[2]);
432 /* ./../lib/standard//collection//sorter.nit:61 */
433 REGB3 = TAG_Int(2);
434 /* ./../lib/standard//kernel.nit:217 */
435 REGB3 = TAG_Int(UNTAG_Int(REGB2)-UNTAG_Int(REGB3));
436 /* ./../lib/standard//collection//sorter.nit:61 */
437 CALL_sorter___AbstractSorter___sub_sort(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1], REGB0, REGB3);
438 /* ./../lib/standard//collection//sorter.nit:62 */
439 CALL_sorter___AbstractSorter___sub_sort(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1], REGB2, REGB1);
440 stack_frame_head = fra.me.prev;
441 return;
442 }
443 void sorter___AbstractSorter___bubble_sort(val_t p0, val_t p1, val_t p2, val_t p3){
444 struct {struct stack_frame_t me; val_t MORE_REG[3];} fra;
445 val_t REGB0;
446 val_t REGB1;
447 val_t REGB2;
448 val_t REGB3;
449 val_t REGB4;
450 val_t REGB5;
451 val_t REGB6;
452 val_t tmp;
453 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
454 fra.me.file = LOCATE_sorter;
455 fra.me.line = 65;
456 fra.me.meth = LOCATE_sorter___AbstractSorter___bubble_sort;
457 fra.me.has_broke = 0;
458 fra.me.REG_size = 4;
459 fra.me.REG[0] = NIT_NULL;
460 fra.me.REG[1] = NIT_NULL;
461 fra.me.REG[2] = NIT_NULL;
462 fra.me.REG[3] = NIT_NULL;
463 fra.me.REG[0] = p0;
464 fra.me.REG[1] = p1;
465 REGB0 = p2;
466 REGB1 = p3;
467 /* ./../lib/standard//collection//sorter.nit:69 */
468 while(1) {
469 /* ./../lib/standard//kernel.nit:212 */
470 REGB2 = TAG_Bool(UNTAG_Int(REGB0)<UNTAG_Int(REGB1));
471 /* ./../lib/standard//collection//sorter.nit:69 */
472 if (UNTAG_Bool(REGB2)) {
473 /* ./../lib/standard//collection//sorter.nit:70 */
474 REGB2 = REGB0;
475 /* ./../lib/standard//collection//array.nit:243 */
476 fra.me.REG[2] = fra.me.REG[1];
477 REGB3 = REGB0;
478 /* ./../lib/standard//collection//array.nit:245 */
479 REGB4 = TAG_Int(0);
480 /* ./../lib/standard//kernel.nit:213 */
481 REGB4 = TAG_Bool(UNTAG_Int(REGB3)>=UNTAG_Int(REGB4));
482 /* ./../lib/standard//collection//array.nit:245 */
483 if (UNTAG_Bool(REGB4)) {
484 REGB4 = TAG_Bool(ATTR_array___AbstractArrayRead____length(fra.me.REG[2])!=NIT_NULL);
485 if (UNTAG_Bool(REGB4)) {
486 } else {
487 nit_abort("Uninitialized attribute %s", "_length", LOCATE_array, 245);
488 }
489 REGB4 = ATTR_array___AbstractArrayRead____length(fra.me.REG[2]);
490 /* ./../lib/standard//kernel.nit:212 */
491 REGB4 = TAG_Bool(UNTAG_Int(REGB3)<UNTAG_Int(REGB4));
492 } else {
493 /* ./../lib/standard//collection//array.nit:245 */
494 REGB5 = TAG_Bool(false);
495 REGB4 = REGB5;
496 }
497 if (UNTAG_Bool(REGB4)) {
498 } else {
499 nit_abort("Assert %s failed", "'index'", LOCATE_array, 245);
500 }
501 /* ./../lib/standard//collection//array.nit:246 */
502 fra.me.REG[2] = ATTR_array___Array____items(fra.me.REG[2]);
503 REGB4 = TAG_Bool(fra.me.REG[2]==NIT_NULL);
504 if (UNTAG_Bool(REGB4)) {
505 nit_abort("Reciever is null", NULL, LOCATE_array, 246);
506 }
507 /* ./../lib/standard//collection//array.nit:654 */
508 fra.me.REG[2] = ((Nit_NativeArray)fra.me.REG[2])->val[UNTAG_Int(REGB3)];
509 /* ./../lib/standard//collection//array.nit:246 */
510 goto label1;
511 label1: while(0);
512 /* ./../lib/standard//collection//sorter.nit:72 */
513 REGB3 = REGB0;
514 /* ./../lib/standard//collection//sorter.nit:73 */
515 while(1) {
516 /* ./../lib/standard//kernel.nit:211 */
517 REGB4 = TAG_Bool(UNTAG_Int(REGB3)<=UNTAG_Int(REGB1));
518 /* ./../lib/standard//collection//sorter.nit:73 */
519 if (UNTAG_Bool(REGB4)) {
520 /* ./../lib/standard//collection//array.nit:243 */
521 fra.me.REG[3] = fra.me.REG[1];
522 REGB4 = REGB3;
523 /* ./../lib/standard//collection//array.nit:245 */
524 REGB5 = TAG_Int(0);
525 /* ./../lib/standard//kernel.nit:213 */
526 REGB5 = TAG_Bool(UNTAG_Int(REGB4)>=UNTAG_Int(REGB5));
527 /* ./../lib/standard//collection//array.nit:245 */
528 if (UNTAG_Bool(REGB5)) {
529 REGB5 = TAG_Bool(ATTR_array___AbstractArrayRead____length(fra.me.REG[3])!=NIT_NULL);
530 if (UNTAG_Bool(REGB5)) {
531 } else {
532 nit_abort("Uninitialized attribute %s", "_length", LOCATE_array, 245);
533 }
534 REGB5 = ATTR_array___AbstractArrayRead____length(fra.me.REG[3]);
535 /* ./../lib/standard//kernel.nit:212 */
536 REGB5 = TAG_Bool(UNTAG_Int(REGB4)<UNTAG_Int(REGB5));
537 } else {
538 /* ./../lib/standard//collection//array.nit:245 */
539 REGB6 = TAG_Bool(false);
540 REGB5 = REGB6;
541 }
542 if (UNTAG_Bool(REGB5)) {
543 } else {
544 nit_abort("Assert %s failed", "'index'", LOCATE_array, 245);
545 }
546 /* ./../lib/standard//collection//array.nit:246 */
547 fra.me.REG[3] = ATTR_array___Array____items(fra.me.REG[3]);
548 REGB5 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
549 if (UNTAG_Bool(REGB5)) {
550 nit_abort("Reciever is null", NULL, LOCATE_array, 246);
551 }
552 /* ./../lib/standard//collection//array.nit:654 */
553 fra.me.REG[3] = ((Nit_NativeArray)fra.me.REG[3])->val[UNTAG_Int(REGB4)];
554 /* ./../lib/standard//collection//array.nit:246 */
555 goto label2;
556 label2: while(0);
557 /* ./../lib/standard//collection//sorter.nit:74 */
558 REGB4 = CALL_sorter___AbstractSorter___compare(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[2], fra.me.REG[3]);
559 REGB5 = TAG_Int(0);
560 /* ./../lib/standard//kernel.nit:214 */
561 REGB5 = TAG_Bool(UNTAG_Int(REGB4)>UNTAG_Int(REGB5));
562 /* ./../lib/standard//collection//sorter.nit:74 */
563 if (UNTAG_Bool(REGB5)) {
564 /* ./../lib/standard//collection//sorter.nit:75 */
565 REGB2 = REGB3;
566 /* ./../lib/standard//collection//array.nit:243 */
567 fra.me.REG[3] = fra.me.REG[1];
568 REGB5 = REGB3;
569 /* ./../lib/standard//collection//array.nit:245 */
570 REGB4 = TAG_Int(0);
571 /* ./../lib/standard//kernel.nit:213 */
572 REGB4 = TAG_Bool(UNTAG_Int(REGB5)>=UNTAG_Int(REGB4));
573 /* ./../lib/standard//collection//array.nit:245 */
574 if (UNTAG_Bool(REGB4)) {
575 REGB4 = TAG_Bool(ATTR_array___AbstractArrayRead____length(fra.me.REG[3])!=NIT_NULL);
576 if (UNTAG_Bool(REGB4)) {
577 } else {
578 nit_abort("Uninitialized attribute %s", "_length", LOCATE_array, 245);
579 }
580 REGB4 = ATTR_array___AbstractArrayRead____length(fra.me.REG[3]);
581 /* ./../lib/standard//kernel.nit:212 */
582 REGB4 = TAG_Bool(UNTAG_Int(REGB5)<UNTAG_Int(REGB4));
583 } else {
584 /* ./../lib/standard//collection//array.nit:245 */
585 REGB6 = TAG_Bool(false);
586 REGB4 = REGB6;
587 }
588 if (UNTAG_Bool(REGB4)) {
589 } else {
590 nit_abort("Assert %s failed", "'index'", LOCATE_array, 245);
591 }
592 /* ./../lib/standard//collection//array.nit:246 */
593 fra.me.REG[3] = ATTR_array___Array____items(fra.me.REG[3]);
594 REGB4 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
595 if (UNTAG_Bool(REGB4)) {
596 nit_abort("Reciever is null", NULL, LOCATE_array, 246);
597 }
598 /* ./../lib/standard//collection//array.nit:654 */
599 fra.me.REG[3] = ((Nit_NativeArray)fra.me.REG[3])->val[UNTAG_Int(REGB5)];
600 /* ./../lib/standard//collection//array.nit:246 */
601 goto label3;
602 label3: while(0);
603 /* ./../lib/standard//collection//sorter.nit:76 */
604 fra.me.REG[2] = fra.me.REG[3];
605 }
606 /* ./../lib/standard//collection//sorter.nit:78 */
607 REGB5 = TAG_Int(1);
608 /* ./../lib/standard//kernel.nit:215 */
609 REGB5 = TAG_Int(UNTAG_Int(REGB3)+UNTAG_Int(REGB5));
610 /* ./../lib/standard//collection//sorter.nit:78 */
611 REGB3 = REGB5;
612 } else {
613 /* ./../lib/standard//collection//sorter.nit:73 */
614 goto label4;
615 }
616 }
617 label4: while(0);
618 /* ./../lib/standard//collection//sorter.nit:80 */
619 REGB3 = TAG_Bool(IS_EQUAL_OO(REGB2,REGB0));
620 if (UNTAG_Bool(REGB3)) {
621 } else {
622 /* ./../lib/standard//kernel.nit:207 */
623 REGB5 = TAG_Bool((REGB2)==(REGB0));
624 /* ./../lib/standard//collection//sorter.nit:80 */
625 REGB3 = REGB5;
626 }
627 REGB3 = TAG_Bool(!UNTAG_Bool(REGB3));
628 if (UNTAG_Bool(REGB3)) {
629 /* ./../lib/standard//collection//array.nit:243 */
630 fra.me.REG[3] = fra.me.REG[1];
631 REGB3 = REGB0;
632 /* ./../lib/standard//collection//array.nit:245 */
633 REGB5 = TAG_Int(0);
634 /* ./../lib/standard//kernel.nit:213 */
635 REGB5 = TAG_Bool(UNTAG_Int(REGB3)>=UNTAG_Int(REGB5));
636 /* ./../lib/standard//collection//array.nit:245 */
637 if (UNTAG_Bool(REGB5)) {
638 REGB5 = TAG_Bool(ATTR_array___AbstractArrayRead____length(fra.me.REG[3])!=NIT_NULL);
639 if (UNTAG_Bool(REGB5)) {
640 } else {
641 nit_abort("Uninitialized attribute %s", "_length", LOCATE_array, 245);
642 }
643 REGB5 = ATTR_array___AbstractArrayRead____length(fra.me.REG[3]);
644 /* ./../lib/standard//kernel.nit:212 */
645 REGB5 = TAG_Bool(UNTAG_Int(REGB3)<UNTAG_Int(REGB5));
646 } else {
647 /* ./../lib/standard//collection//array.nit:245 */
648 REGB4 = TAG_Bool(false);
649 REGB5 = REGB4;
650 }
651 if (UNTAG_Bool(REGB5)) {
652 } else {
653 nit_abort("Assert %s failed", "'index'", LOCATE_array, 245);
654 }
655 /* ./../lib/standard//collection//array.nit:246 */
656 fra.me.REG[3] = ATTR_array___Array____items(fra.me.REG[3]);
657 REGB5 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
658 if (UNTAG_Bool(REGB5)) {
659 nit_abort("Reciever is null", NULL, LOCATE_array, 246);
660 }
661 /* ./../lib/standard//collection//array.nit:654 */
662 fra.me.REG[3] = ((Nit_NativeArray)fra.me.REG[3])->val[UNTAG_Int(REGB3)];
663 /* ./../lib/standard//collection//array.nit:246 */
664 goto label5;
665 label5: while(0);
666 /* ./../lib/standard//collection//sorter.nit:81 */
667 CALL_abstract_collection___Map_____braeq(fra.me.REG[1])(fra.me.REG[1], REGB2, fra.me.REG[3]);
668 /* ./../lib/standard//collection//sorter.nit:82 */
669 CALL_abstract_collection___Map_____braeq(fra.me.REG[1])(fra.me.REG[1], REGB0, fra.me.REG[2]);
670 }
671 /* ./../lib/standard//collection//sorter.nit:84 */
672 REGB2 = TAG_Int(1);
673 /* ./../lib/standard//kernel.nit:215 */
674 REGB2 = TAG_Int(UNTAG_Int(REGB0)+UNTAG_Int(REGB2));
675 /* ./../lib/standard//collection//sorter.nit:84 */
676 REGB0 = REGB2;
677 } else {
678 /* ./../lib/standard//collection//sorter.nit:69 */
679 goto label6;
680 }
681 }
682 label6: while(0);
683 stack_frame_head = fra.me.prev;
684 return;
685 }
686 void sorter___AbstractSorter___init(val_t p0, int* init_table){
687 int itpos0 = VAL2OBJ(p0)->vft[INIT_TABLE_POS_AbstractSorter].i;
688 struct {struct stack_frame_t me;} fra;
689 val_t tmp;
690 if (init_table[itpos0]) return;
691 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
692 fra.me.file = LOCATE_sorter;
693 fra.me.line = 0;
694 fra.me.meth = LOCATE_sorter___AbstractSorter___init;
695 fra.me.has_broke = 0;
696 fra.me.REG_size = 0;
697 stack_frame_head = fra.me.prev;
698 init_table[itpos0] = 1;
699 return;
700 }
701 val_t sorter___ComparableSorter___compare(val_t p0, val_t p1, val_t p2){
702 struct {struct stack_frame_t me; val_t MORE_REG[2];} fra;
703 val_t REGB0;
704 val_t tmp;
705 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
706 fra.me.file = LOCATE_sorter;
707 fra.me.line = 93;
708 fra.me.meth = LOCATE_sorter___ComparableSorter___compare;
709 fra.me.has_broke = 0;
710 fra.me.REG_size = 3;
711 fra.me.REG[0] = NIT_NULL;
712 fra.me.REG[1] = NIT_NULL;
713 fra.me.REG[2] = NIT_NULL;
714 fra.me.REG[0] = p0;
715 fra.me.REG[1] = p1;
716 fra.me.REG[2] = p2;
717 /* ./../lib/standard//collection//sorter.nit:94 */
718 REGB0 = CALL_kernel___Comparable_____leqg(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]);
719 goto label1;
720 label1: while(0);
721 stack_frame_head = fra.me.prev;
722 return REGB0;
723 }
724 void sorter___ComparableSorter___init(val_t p0, int* init_table){
725 int itpos1 = VAL2OBJ(p0)->vft[INIT_TABLE_POS_ComparableSorter].i;
726 struct {struct stack_frame_t me;} fra;
727 val_t tmp;
728 if (init_table[itpos1]) return;
729 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
730 fra.me.file = LOCATE_sorter;
731 fra.me.line = 96;
732 fra.me.meth = LOCATE_sorter___ComparableSorter___init;
733 fra.me.has_broke = 0;
734 fra.me.REG_size = 1;
735 fra.me.REG[0] = NIT_NULL;
736 fra.me.REG[0] = p0;
737 /* ./../lib/standard//collection//sorter.nit:96 */
738 CALL_sorter___AbstractSorter___init(fra.me.REG[0])(fra.me.REG[0], init_table);
739 stack_frame_head = fra.me.prev;
740 init_table[itpos1] = 1;
741 return;
742 }