1 #include "sorter.sep.0.h"
2 /* method sorter#AbstractSorter#compare for (self: AbstractSorter[nullable Object], nullable Object, nullable Object): Int */
3 long sorter__AbstractSorter__compare(val
* self
, val
* p0
, val
* p1
) {
5 short int var1
/* : Bool */;
8 const struct type
* type_struct
;
10 const char* var_class_name
;
11 short int var2
/* : Bool */;
14 const struct type
* type_struct5
;
15 short int is_nullable6
;
16 const char* var_class_name7
;
17 const char* var_class_name8
;
18 /* Covariant cast for argument 0 (a) <p0:nullable Object> isa AbstractSorter#0 */
19 /* <p0:nullable Object> isa AbstractSorter#0 */
20 type_struct
= self
->type
->resolution_table
->types
[COLOR_sorter__AbstractSorter_FT0
];
21 cltype
= type_struct
->color
;
22 idtype
= type_struct
->id
;
23 is_nullable
= type_struct
->is_nullable
;
27 if(cltype
>= p0
->type
->table_size
) {
30 var1
= p0
->type
->type_table
[cltype
] == idtype
;
34 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
35 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "AbstractSorter#0", var_class_name
);
36 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/sorter.nit", 23);
39 /* Covariant cast for argument 1 (b) <p1:nullable Object> isa AbstractSorter#0 */
40 /* <p1:nullable Object> isa AbstractSorter#0 */
41 type_struct5
= self
->type
->resolution_table
->types
[COLOR_sorter__AbstractSorter_FT0
];
42 cltype3
= type_struct5
->color
;
43 idtype4
= type_struct5
->id
;
44 is_nullable6
= type_struct5
->is_nullable
;
48 if(cltype3
>= p1
->type
->table_size
) {
51 var2
= p1
->type
->type_table
[cltype3
] == idtype4
;
55 var_class_name7
= p1
== NULL ?
"null" : p1
->type
->name
;
56 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "AbstractSorter#0", var_class_name7
);
57 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/sorter.nit", 23);
60 var_class_name8
= self
== NULL ?
"null" : self
->type
->name
;
61 fprintf(stderr
, "Runtime error: Abstract method `%s` called on `%s`", "compare", var_class_name8
);
62 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/sorter.nit", 23);
67 /* method sorter#AbstractSorter#compare for (self: Object, nullable Object, nullable Object): Int */
68 long VIRTUAL_sorter__AbstractSorter__compare(val
* self
, val
* p0
, val
* p1
) {
70 long var1
/* : Int */;
71 var1
= sorter__AbstractSorter__compare(self
, p0
, p1
);
76 /* method sorter#AbstractSorter#sort for (self: AbstractSorter[nullable Object], Array[nullable Object]) */
77 void sorter__AbstractSorter__sort(val
* self
, val
* p0
) {
78 short int var
/* : Bool */;
81 const struct type
* type_struct
;
82 const char* var_class_name
;
83 val
* var_array
/* var array: Array[nullable Object] */;
84 long var1
/* : Int */;
85 long var2
/* : Int */;
86 long var3
/* : Int */;
87 long var4
/* : Int */;
88 long var6
/* : Int */;
89 /* Covariant cast for argument 0 (array) <p0:Array[nullable Object]> isa Array[AbstractSorter#0] */
90 /* <p0:Array[nullable Object]> isa Array[AbstractSorter#0] */
91 type_struct
= self
->type
->resolution_table
->types
[COLOR_array__Arraysorter__AbstractSorter_FT0
];
92 cltype
= type_struct
->color
;
93 idtype
= type_struct
->id
;
94 if(cltype
>= p0
->type
->table_size
) {
97 var
= p0
->type
->type_table
[cltype
] == idtype
;
100 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
101 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Array[AbstractSorter#0]", var_class_name
);
102 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/sorter.nit", 30);
107 var2
= ((long (*)(val
*))(var_array
->class->vft
[COLOR_abstract_collection__Collection__length
]))(var_array
) /* length on <var_array:Array[nullable Object]>*/;
109 { /* Inline kernel#Int#- (var2,var3) */
115 ((void (*)(val
*, val
*, long, long))(self
->class->vft
[COLOR_sorter__AbstractSorter__sub_sort
]))(self
, var_array
, var1
, var4
) /* sub_sort on <self:AbstractSorter[nullable Object]>*/;
118 /* method sorter#AbstractSorter#sort for (self: Object, Array[nullable Object]) */
119 void VIRTUAL_sorter__AbstractSorter__sort(val
* self
, val
* p0
) {
120 sorter__AbstractSorter__sort(self
, p0
);
123 /* method sorter#AbstractSorter#sub_sort for (self: AbstractSorter[nullable Object], Array[nullable Object], Int, Int) */
124 void sorter__AbstractSorter__sub_sort(val
* self
, val
* p0
, long p1
, long p2
) {
125 short int var
/* : Bool */;
128 const struct type
* type_struct
;
129 const char* var_class_name
;
130 val
* var_array
/* var array: Array[nullable Object] */;
131 long var_from
/* var from: Int */;
132 long var_to
/* var to: Int */;
133 short int var1
/* : Bool */;
134 short int var3
/* : Bool */;
137 const char* var_class_name6
;
138 short int var7
/* : Bool */;
139 long var8
/* : Int */;
140 long var9
/* : Int */;
141 long var11
/* : Int */;
142 short int var12
/* : Bool */;
143 short int var14
/* : Bool */;
146 const char* var_class_name17
;
147 short int var18
/* : Bool */;
148 /* Covariant cast for argument 0 (array) <p0:Array[nullable Object]> isa Array[AbstractSorter#0] */
149 /* <p0:Array[nullable Object]> isa Array[AbstractSorter#0] */
150 type_struct
= self
->type
->resolution_table
->types
[COLOR_array__Arraysorter__AbstractSorter_FT0
];
151 cltype
= type_struct
->color
;
152 idtype
= type_struct
->id
;
153 if(cltype
>= p0
->type
->table_size
) {
156 var
= p0
->type
->type_table
[cltype
] == idtype
;
159 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
160 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Array[AbstractSorter#0]", var_class_name
);
161 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/sorter.nit", 33);
167 { /* Inline kernel#Int#>= (var_from,var_to) */
168 /* Covariant cast for argument 0 (i) <var_to:Int> isa OTHER */
169 /* <var_to:Int> isa OTHER */
170 var3
= 1; /* easy <var_to:Int> isa OTHER*/
172 var_class_name6
= type_kernel__Int
.name
;
173 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name6
);
174 fprintf(stderr
, " (%s:%d)\n", "lib/standard/kernel.nit", 262);
177 var7
= var_from
>= var_to
;
186 { /* Inline kernel#Int#+ (var_from,var8) */
187 var11
= var_from
+ var8
;
192 { /* Inline kernel#Int#< (var9,var_to) */
193 /* Covariant cast for argument 0 (i) <var_to:Int> isa OTHER */
194 /* <var_to:Int> isa OTHER */
195 var14
= 1; /* easy <var_to:Int> isa OTHER*/
197 var_class_name17
= type_kernel__Int
.name
;
198 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name17
);
199 fprintf(stderr
, " (%s:%d)\n", "lib/standard/kernel.nit", 261);
202 var18
= var9
< var_to
;
208 ((void (*)(val
*, val
*, long, long))(self
->class->vft
[COLOR_sorter__AbstractSorter__quick_sort
]))(self
, var_array
, var_from
, var_to
) /* quick_sort on <self:AbstractSorter[nullable Object]>*/;
210 ((void (*)(val
*, val
*, long, long))(self
->class->vft
[COLOR_sorter__AbstractSorter__bubble_sort
]))(self
, var_array
, var_from
, var_to
) /* bubble_sort on <self:AbstractSorter[nullable Object]>*/;
215 /* method sorter#AbstractSorter#sub_sort for (self: Object, Array[nullable Object], Int, Int) */
216 void VIRTUAL_sorter__AbstractSorter__sub_sort(val
* self
, val
* p0
, long p1
, long p2
) {
217 sorter__AbstractSorter__sub_sort(self
, p0
, p1
, p2
);
220 /* method sorter#AbstractSorter#quick_sort for (self: AbstractSorter[nullable Object], Array[nullable Object], Int, Int) */
221 void sorter__AbstractSorter__quick_sort(val
* self
, val
* p0
, long p1
, long p2
) {
222 short int var
/* : Bool */;
225 const struct type
* type_struct
;
226 const char* var_class_name
;
227 val
* var_array
/* var array: Array[nullable Object] */;
228 long var_from
/* var from: Int */;
229 long var_to
/* var to: Int */;
230 val
* var1
/* : nullable Object */;
231 val
* var_pivot
/* var pivot: nullable Object */;
232 long var_i
/* var i: Int */;
233 long var_j
/* var j: Int */;
234 short int var2
/* : Bool */;
235 short int var4
/* : Bool */;
238 const char* var_class_name7
;
239 short int var8
/* : Bool */;
240 short int var9
/* : Bool */;
241 short int var10
/* : Bool */;
242 short int var12
/* : Bool */;
245 const char* var_class_name15
;
246 short int var16
/* : Bool */;
247 short int var_
/* var : Bool */;
248 val
* var17
/* : nullable Object */;
249 long var18
/* : Int */;
250 long var19
/* : Int */;
251 short int var20
/* : Bool */;
252 short int var22
/* : Bool */;
255 const char* var_class_name25
;
256 short int var26
/* : Bool */;
257 long var27
/* : Int */;
258 long var28
/* : Int */;
259 long var30
/* : Int */;
260 short int var31
/* : Bool */;
261 short int var32
/* : Bool */;
262 short int var34
/* : Bool */;
265 const char* var_class_name37
;
266 short int var38
/* : Bool */;
267 short int var_39
/* var : Bool */;
268 val
* var40
/* : nullable Object */;
269 long var41
/* : Int */;
270 long var42
/* : Int */;
271 short int var43
/* : Bool */;
272 short int var45
/* : Bool */;
275 const char* var_class_name48
;
276 short int var49
/* : Bool */;
277 long var50
/* : Int */;
278 long var51
/* : Int */;
279 long var53
/* : Int */;
280 short int var55
/* : Bool */;
281 short int var57
/* : Bool */;
284 const char* var_class_name60
;
285 short int var61
/* : Bool */;
286 val
* var62
/* : nullable Object */;
287 val
* var_t
/* var t: nullable Object */;
288 val
* var63
/* : nullable Object */;
289 long var65
/* : Int */;
290 long var66
/* : Int */;
291 long var68
/* : Int */;
292 val
* var69
/* : nullable Object */;
293 long var70
/* : Int */;
294 long var71
/* : Int */;
295 long var73
/* : Int */;
296 long var74
/* : Int */;
297 long var75
/* : Int */;
298 long var77
/* : Int */;
299 /* Covariant cast for argument 0 (array) <p0:Array[nullable Object]> isa Array[AbstractSorter#0] */
300 /* <p0:Array[nullable Object]> isa Array[AbstractSorter#0] */
301 type_struct
= self
->type
->resolution_table
->types
[COLOR_array__Arraysorter__AbstractSorter_FT0
];
302 cltype
= type_struct
->color
;
303 idtype
= type_struct
->id
;
304 if(cltype
>= p0
->type
->table_size
) {
307 var
= p0
->type
->type_table
[cltype
] == idtype
;
310 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
311 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Array[AbstractSorter#0]", var_class_name
);
312 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/sorter.nit", 45);
318 var1
= ((val
* (*)(val
*, long))(var_array
->class->vft
[COLOR_abstract_collection__SequenceRead___91d_93d
]))(var_array
, var_from
) /* [] on <var_array:Array[nullable Object]>*/;
323 { /* Inline kernel#Int#> (var_j,var_i) */
324 /* Covariant cast for argument 0 (i) <var_i:Int> isa OTHER */
325 /* <var_i:Int> isa OTHER */
326 var4
= 1; /* easy <var_i:Int> isa OTHER*/
328 var_class_name7
= type_kernel__Int
.name
;
329 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name7
);
330 fprintf(stderr
, " (%s:%d)\n", "lib/standard/kernel.nit", 263);
333 var8
= var_j
> var_i
;
340 { /* Inline kernel#Int#<= (var_i,var_to) */
341 /* Covariant cast for argument 0 (i) <var_to:Int> isa OTHER */
342 /* <var_to:Int> isa OTHER */
343 var12
= 1; /* easy <var_to:Int> isa OTHER*/
345 var_class_name15
= type_kernel__Int
.name
;
346 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name15
);
347 fprintf(stderr
, " (%s:%d)\n", "lib/standard/kernel.nit", 260);
350 var16
= var_i
<= var_to
;
357 var17
= ((val
* (*)(val
*, long))(var_array
->class->vft
[COLOR_abstract_collection__SequenceRead___91d_93d
]))(var_array
, var_i
) /* [] on <var_array:Array[nullable Object]>*/;
358 var18
= ((long (*)(val
*, val
*, val
*))(self
->class->vft
[COLOR_sorter__AbstractSorter__compare
]))(self
, var17
, var_pivot
) /* compare on <self:AbstractSorter[nullable Object]>*/;
360 { /* Inline kernel#Int#<= (var18,var19) */
361 /* Covariant cast for argument 0 (i) <var19:Int> isa OTHER */
362 /* <var19:Int> isa OTHER */
363 var22
= 1; /* easy <var19:Int> isa OTHER*/
365 var_class_name25
= type_kernel__Int
.name
;
366 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name25
);
367 fprintf(stderr
, " (%s:%d)\n", "lib/standard/kernel.nit", 260);
370 var26
= var18
<= var19
;
381 { /* Inline kernel#Int#+ (var_i,var27) */
382 var30
= var_i
+ var27
;
388 CONTINUE_label
: (void)0;
390 BREAK_label
: (void)0;
392 { /* Inline kernel#Int#> (var_j,var_i) */
393 /* Covariant cast for argument 0 (i) <var_i:Int> isa OTHER */
394 /* <var_i:Int> isa OTHER */
395 var34
= 1; /* easy <var_i:Int> isa OTHER*/
397 var_class_name37
= type_kernel__Int
.name
;
398 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name37
);
399 fprintf(stderr
, " (%s:%d)\n", "lib/standard/kernel.nit", 263);
402 var38
= var_j
> var_i
;
409 var40
= ((val
* (*)(val
*, long))(var_array
->class->vft
[COLOR_abstract_collection__SequenceRead___91d_93d
]))(var_array
, var_j
) /* [] on <var_array:Array[nullable Object]>*/;
410 var41
= ((long (*)(val
*, val
*, val
*))(self
->class->vft
[COLOR_sorter__AbstractSorter__compare
]))(self
, var40
, var_pivot
) /* compare on <self:AbstractSorter[nullable Object]>*/;
412 { /* Inline kernel#Int#>= (var41,var42) */
413 /* Covariant cast for argument 0 (i) <var42:Int> isa OTHER */
414 /* <var42:Int> isa OTHER */
415 var45
= 1; /* easy <var42:Int> isa OTHER*/
417 var_class_name48
= type_kernel__Int
.name
;
418 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name48
);
419 fprintf(stderr
, " (%s:%d)\n", "lib/standard/kernel.nit", 262);
422 var49
= var41
>= var42
;
433 { /* Inline kernel#Int#- (var_j,var50) */
434 var53
= var_j
- var50
;
440 CONTINUE_label54
: (void)0;
442 BREAK_label54
: (void)0;
443 { /* Inline kernel#Int#> (var_j,var_i) */
444 /* Covariant cast for argument 0 (i) <var_i:Int> isa OTHER */
445 /* <var_i:Int> isa OTHER */
446 var57
= 1; /* easy <var_i:Int> isa OTHER*/
448 var_class_name60
= type_kernel__Int
.name
;
449 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name60
);
450 fprintf(stderr
, " (%s:%d)\n", "lib/standard/kernel.nit", 263);
453 var61
= var_j
> var_i
;
459 var62
= ((val
* (*)(val
*, long))(var_array
->class->vft
[COLOR_abstract_collection__SequenceRead___91d_93d
]))(var_array
, var_i
) /* [] on <var_array:Array[nullable Object]>*/;
461 var63
= ((val
* (*)(val
*, long))(var_array
->class->vft
[COLOR_abstract_collection__SequenceRead___91d_93d
]))(var_array
, var_j
) /* [] on <var_array:Array[nullable Object]>*/;
462 ((void (*)(val
*, long, val
*))(var_array
->class->vft
[COLOR_abstract_collection__Sequence___91d_93d_61d
]))(var_array
, var_i
, var63
) /* []= on <var_array:Array[nullable Object]>*/;
463 ((void (*)(val
*, long, val
*))(var_array
->class->vft
[COLOR_abstract_collection__Sequence___91d_93d_61d
]))(var_array
, var_j
, var_t
) /* []= on <var_array:Array[nullable Object]>*/;
466 CONTINUE_label64
: (void)0;
468 BREAK_label64
: (void)0;
470 { /* Inline kernel#Int#- (var_i,var65) */
471 var68
= var_i
- var65
;
476 var69
= ((val
* (*)(val
*, long))(var_array
->class->vft
[COLOR_abstract_collection__SequenceRead___91d_93d
]))(var_array
, var66
) /* [] on <var_array:Array[nullable Object]>*/;
477 ((void (*)(val
*, long, val
*))(var_array
->class->vft
[COLOR_abstract_collection__Sequence___91d_93d_61d
]))(var_array
, var_from
, var69
) /* []= on <var_array:Array[nullable Object]>*/;
479 { /* Inline kernel#Int#- (var_i,var70) */
480 var73
= var_i
- var70
;
485 ((void (*)(val
*, long, val
*))(var_array
->class->vft
[COLOR_abstract_collection__Sequence___91d_93d_61d
]))(var_array
, var71
, var_pivot
) /* []= on <var_array:Array[nullable Object]>*/;
487 { /* Inline kernel#Int#- (var_i,var74) */
488 var77
= var_i
- var74
;
493 ((void (*)(val
*, val
*, long, long))(self
->class->vft
[COLOR_sorter__AbstractSorter__sub_sort
]))(self
, var_array
, var_from
, var75
) /* sub_sort on <self:AbstractSorter[nullable Object]>*/;
494 ((void (*)(val
*, val
*, long, long))(self
->class->vft
[COLOR_sorter__AbstractSorter__sub_sort
]))(self
, var_array
, var_i
, var_to
) /* sub_sort on <self:AbstractSorter[nullable Object]>*/;
497 /* method sorter#AbstractSorter#quick_sort for (self: Object, Array[nullable Object], Int, Int) */
498 void VIRTUAL_sorter__AbstractSorter__quick_sort(val
* self
, val
* p0
, long p1
, long p2
) {
499 sorter__AbstractSorter__quick_sort(self
, p0
, p1
, p2
);
502 /* method sorter#AbstractSorter#bubble_sort for (self: AbstractSorter[nullable Object], Array[nullable Object], Int, Int) */
503 void sorter__AbstractSorter__bubble_sort(val
* self
, val
* p0
, long p1
, long p2
) {
504 short int var
/* : Bool */;
507 const struct type
* type_struct
;
508 const char* var_class_name
;
509 val
* var_array
/* var array: Array[nullable Object] */;
510 long var_from
/* var from: Int */;
511 long var_to
/* var to: Int */;
512 long var_i
/* var i: Int */;
513 short int var1
/* : Bool */;
514 short int var3
/* : Bool */;
517 const char* var_class_name6
;
518 short int var7
/* : Bool */;
519 long var_min
/* var min: Int */;
520 val
* var8
/* : nullable Object */;
521 val
* var_min_v
/* var min_v: nullable Object */;
522 long var_j
/* var j: Int */;
523 short int var9
/* : Bool */;
524 short int var11
/* : Bool */;
527 const char* var_class_name14
;
528 short int var15
/* : Bool */;
529 val
* var16
/* : nullable Object */;
530 long var17
/* : Int */;
531 long var18
/* : Int */;
532 short int var19
/* : Bool */;
533 short int var21
/* : Bool */;
536 const char* var_class_name24
;
537 short int var25
/* : Bool */;
538 val
* var26
/* : nullable Object */;
539 long var27
/* : Int */;
540 long var28
/* : Int */;
541 long var30
/* : Int */;
542 short int var31
/* : Bool */;
543 short int var33
/* : Bool */;
544 short int var34
/* : Bool */;
545 val
* var35
/* : nullable Object */;
546 long var36
/* : Int */;
547 long var37
/* : Int */;
548 long var39
/* : Int */;
549 /* Covariant cast for argument 0 (array) <p0:Array[nullable Object]> isa Array[AbstractSorter#0] */
550 /* <p0:Array[nullable Object]> isa Array[AbstractSorter#0] */
551 type_struct
= self
->type
->resolution_table
->types
[COLOR_array__Arraysorter__AbstractSorter_FT0
];
552 cltype
= type_struct
->color
;
553 idtype
= type_struct
->id
;
554 if(cltype
>= p0
->type
->table_size
) {
557 var
= p0
->type
->type_table
[cltype
] == idtype
;
560 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
561 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Array[AbstractSorter#0]", var_class_name
);
562 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/sorter.nit", 66);
570 { /* Inline kernel#Int#< (var_i,var_to) */
571 /* Covariant cast for argument 0 (i) <var_to:Int> isa OTHER */
572 /* <var_to:Int> isa OTHER */
573 var3
= 1; /* easy <var_to:Int> isa OTHER*/
575 var_class_name6
= type_kernel__Int
.name
;
576 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name6
);
577 fprintf(stderr
, " (%s:%d)\n", "lib/standard/kernel.nit", 261);
580 var7
= var_i
< var_to
;
587 var8
= ((val
* (*)(val
*, long))(var_array
->class->vft
[COLOR_abstract_collection__SequenceRead___91d_93d
]))(var_array
, var_i
) /* [] on <var_array:Array[nullable Object]>*/;
591 { /* Inline kernel#Int#<= (var_j,var_to) */
592 /* Covariant cast for argument 0 (i) <var_to:Int> isa OTHER */
593 /* <var_to:Int> isa OTHER */
594 var11
= 1; /* easy <var_to:Int> isa OTHER*/
596 var_class_name14
= type_kernel__Int
.name
;
597 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name14
);
598 fprintf(stderr
, " (%s:%d)\n", "lib/standard/kernel.nit", 260);
601 var15
= var_j
<= var_to
;
607 var16
= ((val
* (*)(val
*, long))(var_array
->class->vft
[COLOR_abstract_collection__SequenceRead___91d_93d
]))(var_array
, var_j
) /* [] on <var_array:Array[nullable Object]>*/;
608 var17
= ((long (*)(val
*, val
*, val
*))(self
->class->vft
[COLOR_sorter__AbstractSorter__compare
]))(self
, var_min_v
, var16
) /* compare on <self:AbstractSorter[nullable Object]>*/;
610 { /* Inline kernel#Int#> (var17,var18) */
611 /* Covariant cast for argument 0 (i) <var18:Int> isa OTHER */
612 /* <var18:Int> isa OTHER */
613 var21
= 1; /* easy <var18:Int> isa OTHER*/
615 var_class_name24
= type_kernel__Int
.name
;
616 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name24
);
617 fprintf(stderr
, " (%s:%d)\n", "lib/standard/kernel.nit", 263);
620 var25
= var17
> var18
;
627 var26
= ((val
* (*)(val
*, long))(var_array
->class->vft
[COLOR_abstract_collection__SequenceRead___91d_93d
]))(var_array
, var_j
) /* [] on <var_array:Array[nullable Object]>*/;
632 { /* Inline kernel#Int#+ (var_j,var27) */
633 var30
= var_j
+ var27
;
639 CONTINUE_label
: (void)0;
641 BREAK_label
: (void)0;
642 { /* Inline kernel#Int#!= (var_min,var_i) */
643 var33
= var_min
== var_i
;
650 var35
= ((val
* (*)(val
*, long))(var_array
->class->vft
[COLOR_abstract_collection__SequenceRead___91d_93d
]))(var_array
, var_i
) /* [] on <var_array:Array[nullable Object]>*/;
651 ((void (*)(val
*, long, val
*))(var_array
->class->vft
[COLOR_abstract_collection__Sequence___91d_93d_61d
]))(var_array
, var_min
, var35
) /* []= on <var_array:Array[nullable Object]>*/;
652 ((void (*)(val
*, long, val
*))(var_array
->class->vft
[COLOR_abstract_collection__Sequence___91d_93d_61d
]))(var_array
, var_i
, var_min_v
) /* []= on <var_array:Array[nullable Object]>*/;
656 { /* Inline kernel#Int#+ (var_i,var36) */
657 var39
= var_i
+ var36
;
663 CONTINUE_label40
: (void)0;
665 BREAK_label40
: (void)0;
668 /* method sorter#AbstractSorter#bubble_sort for (self: Object, Array[nullable Object], Int, Int) */
669 void VIRTUAL_sorter__AbstractSorter__bubble_sort(val
* self
, val
* p0
, long p1
, long p2
) {
670 sorter__AbstractSorter__bubble_sort(self
, p0
, p1
, p2
);
673 /* method sorter#ComparableSorter#compare for (self: ComparableSorter[Comparable], Comparable, Comparable): Int */
674 long sorter__ComparableSorter__compare(val
* self
, val
* p0
, val
* p1
) {
675 long var
/* : Int */;
676 short int var1
/* : Bool */;
679 const struct type
* type_struct
;
680 const char* var_class_name
;
681 short int var2
/* : Bool */;
684 const struct type
* type_struct5
;
685 const char* var_class_name6
;
686 val
* var_a
/* var a: Comparable */;
687 val
* var_b
/* var b: Comparable */;
688 long var7
/* : Int */;
689 /* Covariant cast for argument 0 (a) <p0:Comparable> isa AbstractSorter#0 */
690 /* <p0:Comparable> isa AbstractSorter#0 */
691 type_struct
= self
->type
->resolution_table
->types
[COLOR_sorter__AbstractSorter_FT0
];
692 cltype
= type_struct
->color
;
693 idtype
= type_struct
->id
;
694 if(cltype
>= p0
->type
->table_size
) {
697 var1
= p0
->type
->type_table
[cltype
] == idtype
;
700 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
701 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "AbstractSorter#0", var_class_name
);
702 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/sorter.nit", 94);
705 /* Covariant cast for argument 1 (b) <p1:Comparable> isa AbstractSorter#0 */
706 /* <p1:Comparable> isa AbstractSorter#0 */
707 type_struct5
= self
->type
->resolution_table
->types
[COLOR_sorter__AbstractSorter_FT0
];
708 cltype3
= type_struct5
->color
;
709 idtype4
= type_struct5
->id
;
710 if(cltype3
>= p1
->type
->table_size
) {
713 var2
= p1
->type
->type_table
[cltype3
] == idtype4
;
716 var_class_name6
= p1
== NULL ?
"null" : p1
->type
->name
;
717 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "AbstractSorter#0", var_class_name6
);
718 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/sorter.nit", 94);
723 var7
= ((long (*)(val
*, val
*))(var_a
->class->vft
[COLOR_kernel__Comparable___60d_61d_62d
]))(var_a
, var_b
) /* <=> on <var_a:Comparable>*/;
729 /* method sorter#ComparableSorter#compare for (self: Object, nullable Object, nullable Object): Int */
730 long VIRTUAL_sorter__ComparableSorter__compare(val
* self
, val
* p0
, val
* p1
) {
731 long var
/* : Int */;
732 long var1
/* : Int */;
733 var1
= sorter__ComparableSorter__compare(self
, p0
, p1
);
738 /* method sorter#ComparableSorter#init for (self: ComparableSorter[Comparable]) */
739 void sorter__ComparableSorter__init(val
* self
) {
742 /* method sorter#ComparableSorter#init for (self: Object) */
743 void VIRTUAL_sorter__ComparableSorter__init(val
* self
) {
744 sorter__ComparableSorter__init(self
);