0ede6c1ddb97c22f93caa87cf2138ceb97a877a0
[nit.git] / c_src / standard___collection___sorter._sep.c
1 /* This C file is generated by NIT to compile module standard___collection___sorter. */
2 #include "standard___collection___sorter._sep.h"
3 static const char LOCATE_standard___collection___sorter___AbstractSorter___compare[] = "sorter::AbstractSorter::compare";
4 val_t standard___collection___sorter___AbstractSorter___compare(val_t p0, val_t p1, val_t p2){
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___collection___sorter;
9 fra.me.line = 23;
10 fra.me.meth = LOCATE_standard___collection___sorter___AbstractSorter___compare;
11 fra.me.has_broke = 0;
12 fra.me.REG_size = 0;
13 fra.me.nitni_local_ref_head = NULL;
14 /* ../lib/standard/collection/sorter.nit:23 */
15 nit_abort("Deferred method called", NULL, LOCATE_standard___collection___sorter, 23);
16 stack_frame_head = fra.me.prev;
17 return NIT_NULL;
18 }
19 static const char LOCATE_standard___collection___sorter___AbstractSorter___sort[] = "sorter::AbstractSorter::sort";
20 void standard___collection___sorter___AbstractSorter___sort(val_t p0, val_t p1){
21 struct {struct stack_frame_t me; val_t MORE_REG[1];} fra;
22 val_t REGB0;
23 val_t REGB1;
24 val_t REGB2;
25 val_t tmp;
26 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
27 fra.me.file = LOCATE_standard___collection___sorter;
28 fra.me.line = 30;
29 fra.me.meth = LOCATE_standard___collection___sorter___AbstractSorter___sort;
30 fra.me.has_broke = 0;
31 fra.me.REG_size = 2;
32 fra.me.nitni_local_ref_head = NULL;
33 fra.me.REG[0] = NIT_NULL;
34 fra.me.REG[1] = NIT_NULL;
35 fra.me.REG[0] = p0;
36 fra.me.REG[1] = p1;
37 /* ../lib/standard/collection/sorter.nit:31 */
38 REGB0 = TAG_Int(0);
39 /* ../lib/standard/collection/array.nit:24 */
40 REGB1 = TAG_Bool(ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[1])!=NIT_NULL);
41 if (UNTAG_Bool(REGB1)) {
42 } else {
43 nit_abort("Uninitialized attribute %s", "_length", LOCATE_standard___collection___array, 24);
44 }
45 REGB1 = ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[1]);
46 /* ../lib/standard/collection/sorter.nit:31 */
47 REGB2 = TAG_Int(1);
48 /* ../lib/standard/kernel.nit:240 */
49 REGB2 = TAG_Int(UNTAG_Int(REGB1)-UNTAG_Int(REGB2));
50 /* ../lib/standard/collection/sorter.nit:31 */
51 CALL_standard___collection___sorter___AbstractSorter___sub_sort(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1], REGB0, REGB2);
52 stack_frame_head = fra.me.prev;
53 return;
54 }
55 static const char LOCATE_standard___collection___sorter___AbstractSorter___sub_sort[] = "sorter::AbstractSorter::sub_sort";
56 void standard___collection___sorter___AbstractSorter___sub_sort(val_t p0, val_t p1, val_t p2, val_t p3){
57 struct {struct stack_frame_t me; val_t MORE_REG[1];} fra;
58 val_t REGB0;
59 val_t REGB1;
60 val_t REGB2;
61 val_t REGB3;
62 val_t tmp;
63 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
64 fra.me.file = LOCATE_standard___collection___sorter;
65 fra.me.line = 33;
66 fra.me.meth = LOCATE_standard___collection___sorter___AbstractSorter___sub_sort;
67 fra.me.has_broke = 0;
68 fra.me.REG_size = 2;
69 fra.me.nitni_local_ref_head = NULL;
70 fra.me.REG[0] = NIT_NULL;
71 fra.me.REG[1] = NIT_NULL;
72 fra.me.REG[0] = p0;
73 fra.me.REG[1] = p1;
74 REGB0 = p2;
75 REGB1 = p3;
76 REGB2 = TAG_Bool(VAL_ISA(REGB1, VTCOLOR_standard___kernel___Comparable___OTHER(REGB0), VTID_standard___kernel___Comparable___OTHER(REGB0))) /*cast OTHER*/;
77 if (UNTAG_Bool(REGB2)) {
78 } else {
79 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
80 }
81 /* ../lib/standard/kernel.nit:236 */
82 REGB2 = TAG_Bool(UNTAG_Int(REGB0)>=UNTAG_Int(REGB1));
83 /* ../lib/standard/collection/sorter.nit:36 */
84 if (UNTAG_Bool(REGB2)) {
85 /* ../lib/standard/collection/sorter.nit:37 */
86 goto label1;
87 } else {
88 /* ../lib/standard/collection/sorter.nit:38 */
89 REGB2 = TAG_Int(7);
90 /* ../lib/standard/kernel.nit:238 */
91 REGB2 = TAG_Int(UNTAG_Int(REGB0)+UNTAG_Int(REGB2));
92 REGB3 = TAG_Bool(VAL_ISA(REGB1, VTCOLOR_standard___kernel___Comparable___OTHER(REGB2), VTID_standard___kernel___Comparable___OTHER(REGB2))) /*cast OTHER*/;
93 if (UNTAG_Bool(REGB3)) {
94 } else {
95 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
96 }
97 /* ../lib/standard/kernel.nit:235 */
98 REGB2 = TAG_Bool(UNTAG_Int(REGB2)<UNTAG_Int(REGB1));
99 /* ../lib/standard/collection/sorter.nit:38 */
100 if (UNTAG_Bool(REGB2)) {
101 /* ../lib/standard/collection/sorter.nit:39 */
102 CALL_standard___collection___sorter___AbstractSorter___quick_sort(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1], REGB0, REGB1);
103 } else {
104 /* ../lib/standard/collection/sorter.nit:41 */
105 CALL_standard___collection___sorter___AbstractSorter___bubble_sort(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1], REGB0, REGB1);
106 }
107 }
108 label1: while(0);
109 stack_frame_head = fra.me.prev;
110 return;
111 }
112 static const char LOCATE_standard___collection___sorter___AbstractSorter___quick_sort[] = "sorter::AbstractSorter::quick_sort";
113 void standard___collection___sorter___AbstractSorter___quick_sort(val_t p0, val_t p1, val_t p2, val_t p3){
114 struct {struct stack_frame_t me; val_t MORE_REG[4];} fra;
115 val_t REGB0;
116 val_t REGB1;
117 val_t REGB2;
118 val_t REGB3;
119 val_t REGB4;
120 val_t REGB5;
121 val_t REGB6;
122 val_t tmp;
123 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
124 fra.me.file = LOCATE_standard___collection___sorter;
125 fra.me.line = 45;
126 fra.me.meth = LOCATE_standard___collection___sorter___AbstractSorter___quick_sort;
127 fra.me.has_broke = 0;
128 fra.me.REG_size = 5;
129 fra.me.nitni_local_ref_head = NULL;
130 fra.me.REG[0] = NIT_NULL;
131 fra.me.REG[1] = NIT_NULL;
132 fra.me.REG[2] = NIT_NULL;
133 fra.me.REG[3] = NIT_NULL;
134 fra.me.REG[4] = NIT_NULL;
135 fra.me.REG[0] = p0;
136 fra.me.REG[1] = p1;
137 REGB0 = p2;
138 REGB1 = p3;
139 /* ../lib/standard/collection/array.nit:278 */
140 fra.me.REG[2] = fra.me.REG[1];
141 REGB2 = REGB0;
142 /* ../lib/standard/collection/array.nit:280 */
143 REGB3 = TAG_Int(0);
144 REGB4 = TAG_Bool(VAL_ISA(REGB3, VTCOLOR_standard___kernel___Comparable___OTHER(REGB2), VTID_standard___kernel___Comparable___OTHER(REGB2))) /*cast OTHER*/;
145 if (UNTAG_Bool(REGB4)) {
146 } else {
147 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
148 }
149 /* ../lib/standard/kernel.nit:236 */
150 REGB3 = TAG_Bool(UNTAG_Int(REGB2)>=UNTAG_Int(REGB3));
151 /* ../lib/standard/collection/array.nit:280 */
152 if (UNTAG_Bool(REGB3)) {
153 REGB3 = TAG_Bool(ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[2])!=NIT_NULL);
154 if (UNTAG_Bool(REGB3)) {
155 } else {
156 nit_abort("Uninitialized attribute %s", "_length", LOCATE_standard___collection___array, 280);
157 }
158 REGB3 = ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[2]);
159 REGB4 = TAG_Bool(VAL_ISA(REGB3, VTCOLOR_standard___kernel___Comparable___OTHER(REGB2), VTID_standard___kernel___Comparable___OTHER(REGB2))) /*cast OTHER*/;
160 if (UNTAG_Bool(REGB4)) {
161 } else {
162 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
163 }
164 /* ../lib/standard/kernel.nit:235 */
165 REGB3 = TAG_Bool(UNTAG_Int(REGB2)<UNTAG_Int(REGB3));
166 } else {
167 /* ../lib/standard/collection/array.nit:280 */
168 REGB4 = TAG_Bool(0);
169 REGB3 = REGB4;
170 }
171 if (UNTAG_Bool(REGB3)) {
172 } else {
173 nit_abort("Assert '%s' failed", "index", LOCATE_standard___collection___array, 280);
174 }
175 /* ../lib/standard/collection/array.nit:281 */
176 fra.me.REG[2] = ATTR_standard___collection___array___Array____items(fra.me.REG[2]);
177 REGB3 = TAG_Bool(fra.me.REG[2]==NIT_NULL);
178 if (UNTAG_Bool(REGB3)) {
179 nit_abort("Reciever is null", NULL, LOCATE_standard___collection___array, 281);
180 }
181 /* ../lib/standard/collection/array.nit:724 */
182 fra.me.REG[2] = ((Nit_NativeArray)fra.me.REG[2])->val[UNTAG_Int(REGB2)];
183 /* ../lib/standard/collection/array.nit:281 */
184 goto label1;
185 label1: while(0);
186 /* ../lib/standard/collection/sorter.nit:49 */
187 REGB2 = REGB0;
188 /* ../lib/standard/collection/sorter.nit:50 */
189 REGB3 = REGB1;
190 /* ../lib/standard/collection/sorter.nit:51 */
191 while(1) {
192 REGB4 = TAG_Bool(VAL_ISA(REGB2, VTCOLOR_standard___kernel___Comparable___OTHER(REGB3), VTID_standard___kernel___Comparable___OTHER(REGB3))) /*cast OTHER*/;
193 if (UNTAG_Bool(REGB4)) {
194 } else {
195 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
196 }
197 /* ../lib/standard/kernel.nit:237 */
198 REGB4 = TAG_Bool(UNTAG_Int(REGB3)>UNTAG_Int(REGB2));
199 /* ../lib/standard/collection/sorter.nit:51 */
200 if (UNTAG_Bool(REGB4)) {
201 /* ../lib/standard/collection/sorter.nit:52 */
202 while(1) {
203 REGB4 = TAG_Bool(VAL_ISA(REGB1, VTCOLOR_standard___kernel___Comparable___OTHER(REGB2), VTID_standard___kernel___Comparable___OTHER(REGB2))) /*cast OTHER*/;
204 if (UNTAG_Bool(REGB4)) {
205 } else {
206 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
207 }
208 /* ../lib/standard/kernel.nit:234 */
209 REGB4 = TAG_Bool(UNTAG_Int(REGB2)<=UNTAG_Int(REGB1));
210 /* ../lib/standard/collection/sorter.nit:52 */
211 if (UNTAG_Bool(REGB4)) {
212 /* ../lib/standard/collection/array.nit:278 */
213 fra.me.REG[3] = fra.me.REG[1];
214 REGB4 = REGB2;
215 /* ../lib/standard/collection/array.nit:280 */
216 REGB5 = TAG_Int(0);
217 REGB6 = TAG_Bool(VAL_ISA(REGB5, VTCOLOR_standard___kernel___Comparable___OTHER(REGB4), VTID_standard___kernel___Comparable___OTHER(REGB4))) /*cast OTHER*/;
218 if (UNTAG_Bool(REGB6)) {
219 } else {
220 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
221 }
222 /* ../lib/standard/kernel.nit:236 */
223 REGB5 = TAG_Bool(UNTAG_Int(REGB4)>=UNTAG_Int(REGB5));
224 /* ../lib/standard/collection/array.nit:280 */
225 if (UNTAG_Bool(REGB5)) {
226 REGB5 = TAG_Bool(ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[3])!=NIT_NULL);
227 if (UNTAG_Bool(REGB5)) {
228 } else {
229 nit_abort("Uninitialized attribute %s", "_length", LOCATE_standard___collection___array, 280);
230 }
231 REGB5 = ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[3]);
232 REGB6 = TAG_Bool(VAL_ISA(REGB5, VTCOLOR_standard___kernel___Comparable___OTHER(REGB4), VTID_standard___kernel___Comparable___OTHER(REGB4))) /*cast OTHER*/;
233 if (UNTAG_Bool(REGB6)) {
234 } else {
235 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
236 }
237 /* ../lib/standard/kernel.nit:235 */
238 REGB5 = TAG_Bool(UNTAG_Int(REGB4)<UNTAG_Int(REGB5));
239 } else {
240 /* ../lib/standard/collection/array.nit:280 */
241 REGB6 = TAG_Bool(0);
242 REGB5 = REGB6;
243 }
244 if (UNTAG_Bool(REGB5)) {
245 } else {
246 nit_abort("Assert '%s' failed", "index", LOCATE_standard___collection___array, 280);
247 }
248 /* ../lib/standard/collection/array.nit:281 */
249 fra.me.REG[3] = ATTR_standard___collection___array___Array____items(fra.me.REG[3]);
250 REGB5 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
251 if (UNTAG_Bool(REGB5)) {
252 nit_abort("Reciever is null", NULL, LOCATE_standard___collection___array, 281);
253 }
254 /* ../lib/standard/collection/array.nit:724 */
255 fra.me.REG[3] = ((Nit_NativeArray)fra.me.REG[3])->val[UNTAG_Int(REGB4)];
256 /* ../lib/standard/collection/array.nit:281 */
257 goto label2;
258 label2: while(0);
259 /* ../lib/standard/collection/sorter.nit:52 */
260 REGB4 = CALL_standard___collection___sorter___AbstractSorter___compare(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[3], fra.me.REG[2]);
261 REGB5 = TAG_Int(0);
262 REGB6 = TAG_Bool(VAL_ISA(REGB5, VTCOLOR_standard___kernel___Comparable___OTHER(REGB4), VTID_standard___kernel___Comparable___OTHER(REGB4))) /*cast OTHER*/;
263 if (UNTAG_Bool(REGB6)) {
264 } else {
265 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
266 }
267 /* ../lib/standard/kernel.nit:234 */
268 REGB5 = TAG_Bool(UNTAG_Int(REGB4)<=UNTAG_Int(REGB5));
269 } else {
270 /* ../lib/standard/collection/sorter.nit:52 */
271 REGB4 = TAG_Bool(0);
272 REGB5 = REGB4;
273 }
274 if (UNTAG_Bool(REGB5)) {
275 REGB5 = TAG_Int(1);
276 /* ../lib/standard/kernel.nit:238 */
277 REGB5 = TAG_Int(UNTAG_Int(REGB2)+UNTAG_Int(REGB5));
278 /* ../lib/standard/collection/sorter.nit:52 */
279 REGB2 = REGB5;
280 } else {
281 goto label3;
282 }
283 }
284 label3: while(0);
285 /* ../lib/standard/collection/sorter.nit:53 */
286 while(1) {
287 REGB5 = TAG_Bool(VAL_ISA(REGB2, VTCOLOR_standard___kernel___Comparable___OTHER(REGB3), VTID_standard___kernel___Comparable___OTHER(REGB3))) /*cast OTHER*/;
288 if (UNTAG_Bool(REGB5)) {
289 } else {
290 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
291 }
292 /* ../lib/standard/kernel.nit:237 */
293 REGB5 = TAG_Bool(UNTAG_Int(REGB3)>UNTAG_Int(REGB2));
294 /* ../lib/standard/collection/sorter.nit:53 */
295 if (UNTAG_Bool(REGB5)) {
296 /* ../lib/standard/collection/array.nit:278 */
297 fra.me.REG[3] = fra.me.REG[1];
298 REGB5 = REGB3;
299 /* ../lib/standard/collection/array.nit:280 */
300 REGB4 = TAG_Int(0);
301 REGB6 = TAG_Bool(VAL_ISA(REGB4, VTCOLOR_standard___kernel___Comparable___OTHER(REGB5), VTID_standard___kernel___Comparable___OTHER(REGB5))) /*cast OTHER*/;
302 if (UNTAG_Bool(REGB6)) {
303 } else {
304 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
305 }
306 /* ../lib/standard/kernel.nit:236 */
307 REGB4 = TAG_Bool(UNTAG_Int(REGB5)>=UNTAG_Int(REGB4));
308 /* ../lib/standard/collection/array.nit:280 */
309 if (UNTAG_Bool(REGB4)) {
310 REGB4 = TAG_Bool(ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[3])!=NIT_NULL);
311 if (UNTAG_Bool(REGB4)) {
312 } else {
313 nit_abort("Uninitialized attribute %s", "_length", LOCATE_standard___collection___array, 280);
314 }
315 REGB4 = ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[3]);
316 REGB6 = TAG_Bool(VAL_ISA(REGB4, VTCOLOR_standard___kernel___Comparable___OTHER(REGB5), VTID_standard___kernel___Comparable___OTHER(REGB5))) /*cast OTHER*/;
317 if (UNTAG_Bool(REGB6)) {
318 } else {
319 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
320 }
321 /* ../lib/standard/kernel.nit:235 */
322 REGB4 = TAG_Bool(UNTAG_Int(REGB5)<UNTAG_Int(REGB4));
323 } else {
324 /* ../lib/standard/collection/array.nit:280 */
325 REGB6 = TAG_Bool(0);
326 REGB4 = REGB6;
327 }
328 if (UNTAG_Bool(REGB4)) {
329 } else {
330 nit_abort("Assert '%s' failed", "index", LOCATE_standard___collection___array, 280);
331 }
332 /* ../lib/standard/collection/array.nit:281 */
333 fra.me.REG[3] = ATTR_standard___collection___array___Array____items(fra.me.REG[3]);
334 REGB4 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
335 if (UNTAG_Bool(REGB4)) {
336 nit_abort("Reciever is null", NULL, LOCATE_standard___collection___array, 281);
337 }
338 /* ../lib/standard/collection/array.nit:724 */
339 fra.me.REG[3] = ((Nit_NativeArray)fra.me.REG[3])->val[UNTAG_Int(REGB5)];
340 /* ../lib/standard/collection/array.nit:281 */
341 goto label4;
342 label4: while(0);
343 /* ../lib/standard/collection/sorter.nit:53 */
344 REGB5 = CALL_standard___collection___sorter___AbstractSorter___compare(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[3], fra.me.REG[2]);
345 REGB4 = TAG_Int(0);
346 REGB6 = TAG_Bool(VAL_ISA(REGB4, VTCOLOR_standard___kernel___Comparable___OTHER(REGB5), VTID_standard___kernel___Comparable___OTHER(REGB5))) /*cast OTHER*/;
347 if (UNTAG_Bool(REGB6)) {
348 } else {
349 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
350 }
351 /* ../lib/standard/kernel.nit:236 */
352 REGB4 = TAG_Bool(UNTAG_Int(REGB5)>=UNTAG_Int(REGB4));
353 } else {
354 /* ../lib/standard/collection/sorter.nit:53 */
355 REGB5 = TAG_Bool(0);
356 REGB4 = REGB5;
357 }
358 if (UNTAG_Bool(REGB4)) {
359 REGB4 = TAG_Int(1);
360 /* ../lib/standard/kernel.nit:240 */
361 REGB4 = TAG_Int(UNTAG_Int(REGB3)-UNTAG_Int(REGB4));
362 /* ../lib/standard/collection/sorter.nit:53 */
363 REGB3 = REGB4;
364 } else {
365 goto label5;
366 }
367 }
368 label5: while(0);
369 REGB4 = TAG_Bool(VAL_ISA(REGB2, VTCOLOR_standard___kernel___Comparable___OTHER(REGB3), VTID_standard___kernel___Comparable___OTHER(REGB3))) /*cast OTHER*/;
370 if (UNTAG_Bool(REGB4)) {
371 } else {
372 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
373 }
374 /* ../lib/standard/kernel.nit:237 */
375 REGB4 = TAG_Bool(UNTAG_Int(REGB3)>UNTAG_Int(REGB2));
376 /* ../lib/standard/collection/sorter.nit:54 */
377 if (UNTAG_Bool(REGB4)) {
378 /* ../lib/standard/collection/array.nit:278 */
379 fra.me.REG[3] = fra.me.REG[1];
380 REGB4 = REGB2;
381 /* ../lib/standard/collection/array.nit:280 */
382 REGB5 = TAG_Int(0);
383 REGB6 = TAG_Bool(VAL_ISA(REGB5, VTCOLOR_standard___kernel___Comparable___OTHER(REGB4), VTID_standard___kernel___Comparable___OTHER(REGB4))) /*cast OTHER*/;
384 if (UNTAG_Bool(REGB6)) {
385 } else {
386 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
387 }
388 /* ../lib/standard/kernel.nit:236 */
389 REGB5 = TAG_Bool(UNTAG_Int(REGB4)>=UNTAG_Int(REGB5));
390 /* ../lib/standard/collection/array.nit:280 */
391 if (UNTAG_Bool(REGB5)) {
392 REGB5 = TAG_Bool(ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[3])!=NIT_NULL);
393 if (UNTAG_Bool(REGB5)) {
394 } else {
395 nit_abort("Uninitialized attribute %s", "_length", LOCATE_standard___collection___array, 280);
396 }
397 REGB5 = ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[3]);
398 REGB6 = TAG_Bool(VAL_ISA(REGB5, VTCOLOR_standard___kernel___Comparable___OTHER(REGB4), VTID_standard___kernel___Comparable___OTHER(REGB4))) /*cast OTHER*/;
399 if (UNTAG_Bool(REGB6)) {
400 } else {
401 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
402 }
403 /* ../lib/standard/kernel.nit:235 */
404 REGB5 = TAG_Bool(UNTAG_Int(REGB4)<UNTAG_Int(REGB5));
405 } else {
406 /* ../lib/standard/collection/array.nit:280 */
407 REGB6 = TAG_Bool(0);
408 REGB5 = REGB6;
409 }
410 if (UNTAG_Bool(REGB5)) {
411 } else {
412 nit_abort("Assert '%s' failed", "index", LOCATE_standard___collection___array, 280);
413 }
414 /* ../lib/standard/collection/array.nit:281 */
415 fra.me.REG[3] = ATTR_standard___collection___array___Array____items(fra.me.REG[3]);
416 REGB5 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
417 if (UNTAG_Bool(REGB5)) {
418 nit_abort("Reciever is null", NULL, LOCATE_standard___collection___array, 281);
419 }
420 /* ../lib/standard/collection/array.nit:724 */
421 fra.me.REG[3] = ((Nit_NativeArray)fra.me.REG[3])->val[UNTAG_Int(REGB4)];
422 /* ../lib/standard/collection/array.nit:281 */
423 goto label6;
424 label6: while(0);
425 /* ../lib/standard/collection/array.nit:278 */
426 fra.me.REG[4] = fra.me.REG[1];
427 REGB4 = REGB3;
428 /* ../lib/standard/collection/array.nit:280 */
429 REGB5 = TAG_Int(0);
430 REGB6 = TAG_Bool(VAL_ISA(REGB5, VTCOLOR_standard___kernel___Comparable___OTHER(REGB4), VTID_standard___kernel___Comparable___OTHER(REGB4))) /*cast OTHER*/;
431 if (UNTAG_Bool(REGB6)) {
432 } else {
433 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
434 }
435 /* ../lib/standard/kernel.nit:236 */
436 REGB5 = TAG_Bool(UNTAG_Int(REGB4)>=UNTAG_Int(REGB5));
437 /* ../lib/standard/collection/array.nit:280 */
438 if (UNTAG_Bool(REGB5)) {
439 REGB5 = TAG_Bool(ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[4])!=NIT_NULL);
440 if (UNTAG_Bool(REGB5)) {
441 } else {
442 nit_abort("Uninitialized attribute %s", "_length", LOCATE_standard___collection___array, 280);
443 }
444 REGB5 = ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[4]);
445 REGB6 = TAG_Bool(VAL_ISA(REGB5, VTCOLOR_standard___kernel___Comparable___OTHER(REGB4), VTID_standard___kernel___Comparable___OTHER(REGB4))) /*cast OTHER*/;
446 if (UNTAG_Bool(REGB6)) {
447 } else {
448 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
449 }
450 /* ../lib/standard/kernel.nit:235 */
451 REGB5 = TAG_Bool(UNTAG_Int(REGB4)<UNTAG_Int(REGB5));
452 } else {
453 /* ../lib/standard/collection/array.nit:280 */
454 REGB6 = TAG_Bool(0);
455 REGB5 = REGB6;
456 }
457 if (UNTAG_Bool(REGB5)) {
458 } else {
459 nit_abort("Assert '%s' failed", "index", LOCATE_standard___collection___array, 280);
460 }
461 /* ../lib/standard/collection/array.nit:281 */
462 fra.me.REG[4] = ATTR_standard___collection___array___Array____items(fra.me.REG[4]);
463 REGB5 = TAG_Bool(fra.me.REG[4]==NIT_NULL);
464 if (UNTAG_Bool(REGB5)) {
465 nit_abort("Reciever is null", NULL, LOCATE_standard___collection___array, 281);
466 }
467 /* ../lib/standard/collection/array.nit:724 */
468 fra.me.REG[4] = ((Nit_NativeArray)fra.me.REG[4])->val[UNTAG_Int(REGB4)];
469 /* ../lib/standard/collection/array.nit:281 */
470 goto label7;
471 label7: while(0);
472 /* ../lib/standard/collection/sorter.nit:56 */
473 CALL_standard___collection___abstract_collection___Sequence_____braeq(fra.me.REG[1])(fra.me.REG[1], REGB2, fra.me.REG[4]);
474 /* ../lib/standard/collection/sorter.nit:57 */
475 CALL_standard___collection___abstract_collection___Sequence_____braeq(fra.me.REG[1])(fra.me.REG[1], REGB3, fra.me.REG[3]);
476 }
477 } else {
478 /* ../lib/standard/collection/sorter.nit:51 */
479 goto label8;
480 }
481 }
482 label8: while(0);
483 /* ../lib/standard/collection/sorter.nit:60 */
484 REGB3 = TAG_Int(1);
485 /* ../lib/standard/kernel.nit:240 */
486 REGB3 = TAG_Int(UNTAG_Int(REGB2)-UNTAG_Int(REGB3));
487 /* ../lib/standard/collection/array.nit:278 */
488 fra.me.REG[3] = fra.me.REG[1];
489 /* ../lib/standard/collection/array.nit:280 */
490 REGB4 = TAG_Int(0);
491 REGB5 = TAG_Bool(VAL_ISA(REGB4, VTCOLOR_standard___kernel___Comparable___OTHER(REGB3), VTID_standard___kernel___Comparable___OTHER(REGB3))) /*cast OTHER*/;
492 if (UNTAG_Bool(REGB5)) {
493 } else {
494 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
495 }
496 /* ../lib/standard/kernel.nit:236 */
497 REGB4 = TAG_Bool(UNTAG_Int(REGB3)>=UNTAG_Int(REGB4));
498 /* ../lib/standard/collection/array.nit:280 */
499 if (UNTAG_Bool(REGB4)) {
500 REGB4 = TAG_Bool(ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[3])!=NIT_NULL);
501 if (UNTAG_Bool(REGB4)) {
502 } else {
503 nit_abort("Uninitialized attribute %s", "_length", LOCATE_standard___collection___array, 280);
504 }
505 REGB4 = ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[3]);
506 REGB5 = TAG_Bool(VAL_ISA(REGB4, VTCOLOR_standard___kernel___Comparable___OTHER(REGB3), VTID_standard___kernel___Comparable___OTHER(REGB3))) /*cast OTHER*/;
507 if (UNTAG_Bool(REGB5)) {
508 } else {
509 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
510 }
511 /* ../lib/standard/kernel.nit:235 */
512 REGB4 = TAG_Bool(UNTAG_Int(REGB3)<UNTAG_Int(REGB4));
513 } else {
514 /* ../lib/standard/collection/array.nit:280 */
515 REGB5 = TAG_Bool(0);
516 REGB4 = REGB5;
517 }
518 if (UNTAG_Bool(REGB4)) {
519 } else {
520 nit_abort("Assert '%s' failed", "index", LOCATE_standard___collection___array, 280);
521 }
522 /* ../lib/standard/collection/array.nit:281 */
523 fra.me.REG[3] = ATTR_standard___collection___array___Array____items(fra.me.REG[3]);
524 REGB4 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
525 if (UNTAG_Bool(REGB4)) {
526 nit_abort("Reciever is null", NULL, LOCATE_standard___collection___array, 281);
527 }
528 /* ../lib/standard/collection/array.nit:724 */
529 fra.me.REG[3] = ((Nit_NativeArray)fra.me.REG[3])->val[UNTAG_Int(REGB3)];
530 /* ../lib/standard/collection/array.nit:281 */
531 goto label9;
532 label9: while(0);
533 /* ../lib/standard/collection/sorter.nit:60 */
534 CALL_standard___collection___abstract_collection___Sequence_____braeq(fra.me.REG[1])(fra.me.REG[1], REGB0, fra.me.REG[3]);
535 /* ../lib/standard/collection/sorter.nit:61 */
536 REGB3 = TAG_Int(1);
537 /* ../lib/standard/kernel.nit:240 */
538 REGB3 = TAG_Int(UNTAG_Int(REGB2)-UNTAG_Int(REGB3));
539 /* ../lib/standard/collection/sorter.nit:61 */
540 CALL_standard___collection___abstract_collection___Sequence_____braeq(fra.me.REG[1])(fra.me.REG[1], REGB3, fra.me.REG[2]);
541 /* ../lib/standard/collection/sorter.nit:62 */
542 REGB3 = TAG_Int(2);
543 /* ../lib/standard/kernel.nit:240 */
544 REGB3 = TAG_Int(UNTAG_Int(REGB2)-UNTAG_Int(REGB3));
545 /* ../lib/standard/collection/sorter.nit:62 */
546 CALL_standard___collection___sorter___AbstractSorter___sub_sort(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1], REGB0, REGB3);
547 /* ../lib/standard/collection/sorter.nit:63 */
548 CALL_standard___collection___sorter___AbstractSorter___sub_sort(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1], REGB2, REGB1);
549 stack_frame_head = fra.me.prev;
550 return;
551 }
552 static const char LOCATE_standard___collection___sorter___AbstractSorter___bubble_sort[] = "sorter::AbstractSorter::bubble_sort";
553 void standard___collection___sorter___AbstractSorter___bubble_sort(val_t p0, val_t p1, val_t p2, val_t p3){
554 struct {struct stack_frame_t me; val_t MORE_REG[3];} fra;
555 val_t REGB0;
556 val_t REGB1;
557 val_t REGB2;
558 val_t REGB3;
559 val_t REGB4;
560 val_t REGB5;
561 val_t REGB6;
562 val_t tmp;
563 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
564 fra.me.file = LOCATE_standard___collection___sorter;
565 fra.me.line = 66;
566 fra.me.meth = LOCATE_standard___collection___sorter___AbstractSorter___bubble_sort;
567 fra.me.has_broke = 0;
568 fra.me.REG_size = 4;
569 fra.me.nitni_local_ref_head = NULL;
570 fra.me.REG[0] = NIT_NULL;
571 fra.me.REG[1] = NIT_NULL;
572 fra.me.REG[2] = NIT_NULL;
573 fra.me.REG[3] = NIT_NULL;
574 fra.me.REG[0] = p0;
575 fra.me.REG[1] = p1;
576 REGB0 = p2;
577 REGB1 = p3;
578 /* ../lib/standard/collection/sorter.nit:70 */
579 while(1) {
580 REGB2 = TAG_Bool(VAL_ISA(REGB1, VTCOLOR_standard___kernel___Comparable___OTHER(REGB0), VTID_standard___kernel___Comparable___OTHER(REGB0))) /*cast OTHER*/;
581 if (UNTAG_Bool(REGB2)) {
582 } else {
583 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
584 }
585 /* ../lib/standard/kernel.nit:235 */
586 REGB2 = TAG_Bool(UNTAG_Int(REGB0)<UNTAG_Int(REGB1));
587 /* ../lib/standard/collection/sorter.nit:70 */
588 if (UNTAG_Bool(REGB2)) {
589 /* ../lib/standard/collection/sorter.nit:71 */
590 REGB2 = REGB0;
591 /* ../lib/standard/collection/array.nit:278 */
592 fra.me.REG[2] = fra.me.REG[1];
593 REGB3 = REGB0;
594 /* ../lib/standard/collection/array.nit:280 */
595 REGB4 = TAG_Int(0);
596 REGB5 = TAG_Bool(VAL_ISA(REGB4, VTCOLOR_standard___kernel___Comparable___OTHER(REGB3), VTID_standard___kernel___Comparable___OTHER(REGB3))) /*cast OTHER*/;
597 if (UNTAG_Bool(REGB5)) {
598 } else {
599 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
600 }
601 /* ../lib/standard/kernel.nit:236 */
602 REGB4 = TAG_Bool(UNTAG_Int(REGB3)>=UNTAG_Int(REGB4));
603 /* ../lib/standard/collection/array.nit:280 */
604 if (UNTAG_Bool(REGB4)) {
605 REGB4 = TAG_Bool(ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[2])!=NIT_NULL);
606 if (UNTAG_Bool(REGB4)) {
607 } else {
608 nit_abort("Uninitialized attribute %s", "_length", LOCATE_standard___collection___array, 280);
609 }
610 REGB4 = ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[2]);
611 REGB5 = TAG_Bool(VAL_ISA(REGB4, VTCOLOR_standard___kernel___Comparable___OTHER(REGB3), VTID_standard___kernel___Comparable___OTHER(REGB3))) /*cast OTHER*/;
612 if (UNTAG_Bool(REGB5)) {
613 } else {
614 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
615 }
616 /* ../lib/standard/kernel.nit:235 */
617 REGB4 = TAG_Bool(UNTAG_Int(REGB3)<UNTAG_Int(REGB4));
618 } else {
619 /* ../lib/standard/collection/array.nit:280 */
620 REGB5 = TAG_Bool(0);
621 REGB4 = REGB5;
622 }
623 if (UNTAG_Bool(REGB4)) {
624 } else {
625 nit_abort("Assert '%s' failed", "index", LOCATE_standard___collection___array, 280);
626 }
627 /* ../lib/standard/collection/array.nit:281 */
628 fra.me.REG[2] = ATTR_standard___collection___array___Array____items(fra.me.REG[2]);
629 REGB4 = TAG_Bool(fra.me.REG[2]==NIT_NULL);
630 if (UNTAG_Bool(REGB4)) {
631 nit_abort("Reciever is null", NULL, LOCATE_standard___collection___array, 281);
632 }
633 /* ../lib/standard/collection/array.nit:724 */
634 fra.me.REG[2] = ((Nit_NativeArray)fra.me.REG[2])->val[UNTAG_Int(REGB3)];
635 /* ../lib/standard/collection/array.nit:281 */
636 goto label1;
637 label1: while(0);
638 /* ../lib/standard/collection/sorter.nit:73 */
639 REGB3 = REGB0;
640 /* ../lib/standard/collection/sorter.nit:74 */
641 while(1) {
642 REGB4 = TAG_Bool(VAL_ISA(REGB1, VTCOLOR_standard___kernel___Comparable___OTHER(REGB3), VTID_standard___kernel___Comparable___OTHER(REGB3))) /*cast OTHER*/;
643 if (UNTAG_Bool(REGB4)) {
644 } else {
645 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
646 }
647 /* ../lib/standard/kernel.nit:234 */
648 REGB4 = TAG_Bool(UNTAG_Int(REGB3)<=UNTAG_Int(REGB1));
649 /* ../lib/standard/collection/sorter.nit:74 */
650 if (UNTAG_Bool(REGB4)) {
651 /* ../lib/standard/collection/array.nit:278 */
652 fra.me.REG[3] = fra.me.REG[1];
653 REGB4 = REGB3;
654 /* ../lib/standard/collection/array.nit:280 */
655 REGB5 = TAG_Int(0);
656 REGB6 = TAG_Bool(VAL_ISA(REGB5, VTCOLOR_standard___kernel___Comparable___OTHER(REGB4), VTID_standard___kernel___Comparable___OTHER(REGB4))) /*cast OTHER*/;
657 if (UNTAG_Bool(REGB6)) {
658 } else {
659 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
660 }
661 /* ../lib/standard/kernel.nit:236 */
662 REGB5 = TAG_Bool(UNTAG_Int(REGB4)>=UNTAG_Int(REGB5));
663 /* ../lib/standard/collection/array.nit:280 */
664 if (UNTAG_Bool(REGB5)) {
665 REGB5 = TAG_Bool(ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[3])!=NIT_NULL);
666 if (UNTAG_Bool(REGB5)) {
667 } else {
668 nit_abort("Uninitialized attribute %s", "_length", LOCATE_standard___collection___array, 280);
669 }
670 REGB5 = ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[3]);
671 REGB6 = TAG_Bool(VAL_ISA(REGB5, VTCOLOR_standard___kernel___Comparable___OTHER(REGB4), VTID_standard___kernel___Comparable___OTHER(REGB4))) /*cast OTHER*/;
672 if (UNTAG_Bool(REGB6)) {
673 } else {
674 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
675 }
676 /* ../lib/standard/kernel.nit:235 */
677 REGB5 = TAG_Bool(UNTAG_Int(REGB4)<UNTAG_Int(REGB5));
678 } else {
679 /* ../lib/standard/collection/array.nit:280 */
680 REGB6 = TAG_Bool(0);
681 REGB5 = REGB6;
682 }
683 if (UNTAG_Bool(REGB5)) {
684 } else {
685 nit_abort("Assert '%s' failed", "index", LOCATE_standard___collection___array, 280);
686 }
687 /* ../lib/standard/collection/array.nit:281 */
688 fra.me.REG[3] = ATTR_standard___collection___array___Array____items(fra.me.REG[3]);
689 REGB5 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
690 if (UNTAG_Bool(REGB5)) {
691 nit_abort("Reciever is null", NULL, LOCATE_standard___collection___array, 281);
692 }
693 /* ../lib/standard/collection/array.nit:724 */
694 fra.me.REG[3] = ((Nit_NativeArray)fra.me.REG[3])->val[UNTAG_Int(REGB4)];
695 /* ../lib/standard/collection/array.nit:281 */
696 goto label2;
697 label2: while(0);
698 /* ../lib/standard/collection/sorter.nit:75 */
699 REGB4 = CALL_standard___collection___sorter___AbstractSorter___compare(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[2], fra.me.REG[3]);
700 REGB5 = TAG_Int(0);
701 REGB6 = TAG_Bool(VAL_ISA(REGB5, VTCOLOR_standard___kernel___Comparable___OTHER(REGB4), VTID_standard___kernel___Comparable___OTHER(REGB4))) /*cast OTHER*/;
702 if (UNTAG_Bool(REGB6)) {
703 } else {
704 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
705 }
706 /* ../lib/standard/kernel.nit:237 */
707 REGB5 = TAG_Bool(UNTAG_Int(REGB4)>UNTAG_Int(REGB5));
708 /* ../lib/standard/collection/sorter.nit:75 */
709 if (UNTAG_Bool(REGB5)) {
710 /* ../lib/standard/collection/sorter.nit:76 */
711 REGB2 = REGB3;
712 /* ../lib/standard/collection/array.nit:278 */
713 fra.me.REG[3] = fra.me.REG[1];
714 REGB5 = REGB3;
715 /* ../lib/standard/collection/array.nit:280 */
716 REGB4 = TAG_Int(0);
717 REGB6 = TAG_Bool(VAL_ISA(REGB4, VTCOLOR_standard___kernel___Comparable___OTHER(REGB5), VTID_standard___kernel___Comparable___OTHER(REGB5))) /*cast OTHER*/;
718 if (UNTAG_Bool(REGB6)) {
719 } else {
720 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
721 }
722 /* ../lib/standard/kernel.nit:236 */
723 REGB4 = TAG_Bool(UNTAG_Int(REGB5)>=UNTAG_Int(REGB4));
724 /* ../lib/standard/collection/array.nit:280 */
725 if (UNTAG_Bool(REGB4)) {
726 REGB4 = TAG_Bool(ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[3])!=NIT_NULL);
727 if (UNTAG_Bool(REGB4)) {
728 } else {
729 nit_abort("Uninitialized attribute %s", "_length", LOCATE_standard___collection___array, 280);
730 }
731 REGB4 = ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[3]);
732 REGB6 = TAG_Bool(VAL_ISA(REGB4, VTCOLOR_standard___kernel___Comparable___OTHER(REGB5), VTID_standard___kernel___Comparable___OTHER(REGB5))) /*cast OTHER*/;
733 if (UNTAG_Bool(REGB6)) {
734 } else {
735 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
736 }
737 /* ../lib/standard/kernel.nit:235 */
738 REGB4 = TAG_Bool(UNTAG_Int(REGB5)<UNTAG_Int(REGB4));
739 } else {
740 /* ../lib/standard/collection/array.nit:280 */
741 REGB6 = TAG_Bool(0);
742 REGB4 = REGB6;
743 }
744 if (UNTAG_Bool(REGB4)) {
745 } else {
746 nit_abort("Assert '%s' failed", "index", LOCATE_standard___collection___array, 280);
747 }
748 /* ../lib/standard/collection/array.nit:281 */
749 fra.me.REG[3] = ATTR_standard___collection___array___Array____items(fra.me.REG[3]);
750 REGB4 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
751 if (UNTAG_Bool(REGB4)) {
752 nit_abort("Reciever is null", NULL, LOCATE_standard___collection___array, 281);
753 }
754 /* ../lib/standard/collection/array.nit:724 */
755 fra.me.REG[3] = ((Nit_NativeArray)fra.me.REG[3])->val[UNTAG_Int(REGB5)];
756 /* ../lib/standard/collection/array.nit:281 */
757 goto label3;
758 label3: while(0);
759 /* ../lib/standard/collection/sorter.nit:77 */
760 fra.me.REG[2] = fra.me.REG[3];
761 }
762 /* ../lib/standard/collection/sorter.nit:79 */
763 REGB5 = TAG_Int(1);
764 /* ../lib/standard/kernel.nit:238 */
765 REGB5 = TAG_Int(UNTAG_Int(REGB3)+UNTAG_Int(REGB5));
766 /* ../lib/standard/collection/sorter.nit:79 */
767 REGB3 = REGB5;
768 } else {
769 /* ../lib/standard/collection/sorter.nit:74 */
770 goto label4;
771 }
772 }
773 label4: while(0);
774 /* ../lib/standard/collection/sorter.nit:81 */
775 REGB3 = TAG_Bool(IS_EQUAL_OO(REGB2,REGB0));
776 if (UNTAG_Bool(REGB3)) {
777 } else {
778 /* ../lib/standard/kernel.nit:230 */
779 REGB5 = TAG_Bool((REGB2)==(REGB0));
780 /* ../lib/standard/collection/sorter.nit:81 */
781 REGB3 = REGB5;
782 }
783 REGB3 = TAG_Bool(!UNTAG_Bool(REGB3));
784 if (UNTAG_Bool(REGB3)) {
785 /* ../lib/standard/collection/array.nit:278 */
786 fra.me.REG[3] = fra.me.REG[1];
787 REGB3 = REGB0;
788 /* ../lib/standard/collection/array.nit:280 */
789 REGB5 = TAG_Int(0);
790 REGB4 = TAG_Bool(VAL_ISA(REGB5, VTCOLOR_standard___kernel___Comparable___OTHER(REGB3), VTID_standard___kernel___Comparable___OTHER(REGB3))) /*cast OTHER*/;
791 if (UNTAG_Bool(REGB4)) {
792 } else {
793 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
794 }
795 /* ../lib/standard/kernel.nit:236 */
796 REGB5 = TAG_Bool(UNTAG_Int(REGB3)>=UNTAG_Int(REGB5));
797 /* ../lib/standard/collection/array.nit:280 */
798 if (UNTAG_Bool(REGB5)) {
799 REGB5 = TAG_Bool(ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[3])!=NIT_NULL);
800 if (UNTAG_Bool(REGB5)) {
801 } else {
802 nit_abort("Uninitialized attribute %s", "_length", LOCATE_standard___collection___array, 280);
803 }
804 REGB5 = ATTR_standard___collection___array___AbstractArrayRead____length(fra.me.REG[3]);
805 REGB4 = TAG_Bool(VAL_ISA(REGB5, VTCOLOR_standard___kernel___Comparable___OTHER(REGB3), VTID_standard___kernel___Comparable___OTHER(REGB3))) /*cast OTHER*/;
806 if (UNTAG_Bool(REGB4)) {
807 } else {
808 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
809 }
810 /* ../lib/standard/kernel.nit:235 */
811 REGB5 = TAG_Bool(UNTAG_Int(REGB3)<UNTAG_Int(REGB5));
812 } else {
813 /* ../lib/standard/collection/array.nit:280 */
814 REGB4 = TAG_Bool(0);
815 REGB5 = REGB4;
816 }
817 if (UNTAG_Bool(REGB5)) {
818 } else {
819 nit_abort("Assert '%s' failed", "index", LOCATE_standard___collection___array, 280);
820 }
821 /* ../lib/standard/collection/array.nit:281 */
822 fra.me.REG[3] = ATTR_standard___collection___array___Array____items(fra.me.REG[3]);
823 REGB5 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
824 if (UNTAG_Bool(REGB5)) {
825 nit_abort("Reciever is null", NULL, LOCATE_standard___collection___array, 281);
826 }
827 /* ../lib/standard/collection/array.nit:724 */
828 fra.me.REG[3] = ((Nit_NativeArray)fra.me.REG[3])->val[UNTAG_Int(REGB3)];
829 /* ../lib/standard/collection/array.nit:281 */
830 goto label5;
831 label5: while(0);
832 /* ../lib/standard/collection/sorter.nit:82 */
833 CALL_standard___collection___abstract_collection___Sequence_____braeq(fra.me.REG[1])(fra.me.REG[1], REGB2, fra.me.REG[3]);
834 /* ../lib/standard/collection/sorter.nit:83 */
835 CALL_standard___collection___abstract_collection___Sequence_____braeq(fra.me.REG[1])(fra.me.REG[1], REGB0, fra.me.REG[2]);
836 }
837 /* ../lib/standard/collection/sorter.nit:85 */
838 REGB2 = TAG_Int(1);
839 /* ../lib/standard/kernel.nit:238 */
840 REGB2 = TAG_Int(UNTAG_Int(REGB0)+UNTAG_Int(REGB2));
841 /* ../lib/standard/collection/sorter.nit:85 */
842 REGB0 = REGB2;
843 } else {
844 /* ../lib/standard/collection/sorter.nit:70 */
845 goto label6;
846 }
847 }
848 label6: while(0);
849 stack_frame_head = fra.me.prev;
850 return;
851 }
852 static const char LOCATE_standard___collection___sorter___ComparableSorter___compare[] = "sorter::ComparableSorter::(sorter::AbstractSorter::compare)";
853 val_t standard___collection___sorter___ComparableSorter___compare(val_t p0, val_t p1, val_t p2){
854 struct {struct stack_frame_t me; val_t MORE_REG[2];} fra;
855 val_t REGB0;
856 val_t tmp;
857 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
858 fra.me.file = LOCATE_standard___collection___sorter;
859 fra.me.line = 94;
860 fra.me.meth = LOCATE_standard___collection___sorter___ComparableSorter___compare;
861 fra.me.has_broke = 0;
862 fra.me.REG_size = 3;
863 fra.me.nitni_local_ref_head = NULL;
864 fra.me.REG[0] = NIT_NULL;
865 fra.me.REG[1] = NIT_NULL;
866 fra.me.REG[2] = NIT_NULL;
867 fra.me.REG[0] = p0;
868 fra.me.REG[1] = p1;
869 fra.me.REG[2] = p2;
870 /* ../lib/standard/collection/sorter.nit:95 */
871 REGB0 = CALL_standard___kernel___Comparable_____leqg(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]);
872 goto label1;
873 label1: while(0);
874 stack_frame_head = fra.me.prev;
875 return REGB0;
876 }
877 static const char LOCATE_standard___collection___sorter___ComparableSorter___init[] = "sorter::ComparableSorter::init";
878 void standard___collection___sorter___ComparableSorter___init(val_t p0, int* init_table){
879 int itpos0 = VAL2OBJ(p0)->vft[INIT_TABLE_POS_standard___collection___sorter___ComparableSorter].i;
880 struct {struct stack_frame_t me;} fra;
881 val_t tmp;
882 if (init_table[itpos0]) return;
883 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
884 fra.me.file = LOCATE_standard___collection___sorter;
885 fra.me.line = 97;
886 fra.me.meth = LOCATE_standard___collection___sorter___ComparableSorter___init;
887 fra.me.has_broke = 0;
888 fra.me.REG_size = 1;
889 fra.me.nitni_local_ref_head = NULL;
890 fra.me.REG[0] = NIT_NULL;
891 fra.me.REG[0] = p0;
892 stack_frame_head = fra.me.prev;
893 init_table[itpos0] = 1;
894 return;
895 }