c_src: regenerate
[nit.git] / c_src / core__hash_collection.sep.1.c
1 #include "core__hash_collection.sep.0.h"
2 /* method hash_collection#HashCollection#index_at for (self: HashCollection[nullable Object], nullable Object): Int */
3 long core__hash_collection___core__hash_collection__HashCollection___index_at(val* self, val* p0) {
4 long var /* : Int */;
5 val* var_k /* var k: nullable Object */;
6 short int var1 /* : Bool */;
7 short int var2 /* : Bool */;
8 long var3 /* : Int */;
9 long var4 /* : Int */;
10 long var5 /* : Int */;
11 long var7 /* : Int */;
12 long var_i /* var i: Int */;
13 short int var8 /* : Bool */;
14 short int var10 /* : Bool */;
15 int cltype;
16 int idtype;
17 const char* var_class_name;
18 short int var11 /* : Bool */;
19 long var12 /* : Int */;
20 long var14 /* : Int */;
21 var_k = p0;
22 if (var_k == NULL) {
23 var1 = 1; /* is null */
24 } else {
25 var1 = 0; /* arg is null but recv is not */
26 }
27 if (0) {
28 var2 = ((short int(*)(val* self, val* p0))((((long)var_k&3)?class_info[((long)var_k&3)]:var_k->class)->vft[COLOR_core__kernel__Object___61d_61d]))(var_k, ((val*)NULL)); /* == on <var_k:nullable Object>*/
29 var1 = var2;
30 }
31 if (var1){
32 var = 0l;
33 goto RET_LABEL;
34 } else {
35 }
36 {
37 var3 = ((long(*)(val* self))((((long)var_k&3)?class_info[((long)var_k&3)]:var_k->class)->vft[COLOR_core__kernel__Object__hash]))(var_k); /* hash on <var_k:nullable Object(Object)>*/
38 }
39 var4 = self->attrs[COLOR_core__hash_collection__HashCollection___capacity].l; /* _capacity on <self:HashCollection[nullable Object]> */
40 {
41 { /* Inline kernel#Int#% (var3,var4) on <var3:Int> */
42 var7 = var3 % var4;
43 var5 = var7;
44 goto RET_LABEL6;
45 RET_LABEL6:(void)0;
46 }
47 }
48 var_i = var5;
49 {
50 { /* Inline kernel#Int#< (var_i,0l) on <var_i:Int> */
51 /* Covariant cast for argument 0 (i) <0l:Int> isa OTHER */
52 /* <0l:Int> isa OTHER */
53 var10 = 1; /* easy <0l:Int> isa OTHER*/
54 if (unlikely(!var10)) {
55 var_class_name = type_core__Int.name;
56 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name);
57 PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 728);
58 fatal_exit(1);
59 }
60 var11 = var_i < 0l;
61 var8 = var11;
62 goto RET_LABEL9;
63 RET_LABEL9:(void)0;
64 }
65 }
66 if (var8){
67 {
68 { /* Inline kernel#Int#unary - (var_i) on <var_i:Int> */
69 var14 = -var_i;
70 var12 = var14;
71 goto RET_LABEL13;
72 RET_LABEL13:(void)0;
73 }
74 }
75 var_i = var12;
76 } else {
77 }
78 var = var_i;
79 goto RET_LABEL;
80 RET_LABEL:;
81 return var;
82 }
83 /* method hash_collection#HashCollection#node_at for (self: HashCollection[nullable Object], nullable Object): nullable HashNode[nullable Object] */
84 val* core__hash_collection___core__hash_collection__HashCollection___node_at(val* self, val* p0) {
85 val* var /* : nullable HashNode[nullable Object] */;
86 val* var_k /* var k: nullable Object */;
87 long var1 /* : Int */;
88 short int var2 /* : Bool */;
89 short int var4 /* : Bool */;
90 val* var5 /* : nullable Object */;
91 short int var6 /* : Bool */;
92 short int var7 /* : Bool */;
93 short int var9 /* : Bool */;
94 val* var10 /* : nullable HashNode[nullable Object] */;
95 long var11 /* : Int */;
96 val* var12 /* : nullable HashNode[nullable Object] */;
97 val* var_res /* var res: nullable HashNode[nullable Object] */;
98 var_k = p0;
99 var1 = self->attrs[COLOR_core__hash_collection__HashCollection___the_length].l; /* _the_length on <self:HashCollection[nullable Object]> */
100 {
101 { /* Inline kernel#Int#== (var1,0l) on <var1:Int> */
102 var4 = var1 == 0l;
103 var2 = var4;
104 goto RET_LABEL3;
105 RET_LABEL3:(void)0;
106 }
107 }
108 if (var2){
109 var = ((val*)NULL);
110 goto RET_LABEL;
111 } else {
112 }
113 var5 = self->attrs[COLOR_core__hash_collection__HashCollection___last_accessed_key].val; /* _last_accessed_key on <self:HashCollection[nullable Object]> */
114 if (var_k == NULL) {
115 var6 = (var5 == NULL);
116 } else {
117 { /* Inline kernel#Object#is_same_instance (var_k,var5) on <var_k:nullable Object> */
118 var9 = var_k == var5 || (var_k != NULL && var5 != NULL && (!((long)var_k&3)) && (!((long)var5&3)) && var_k->class == var5->class && ((var_k->class->box_kind == 3 && ((struct instance_core__Byte*)var_k)->value == ((struct instance_core__Byte*)var5)->value) || (var_k->class->box_kind == 5 && ((struct instance_core__Float*)var_k)->value == ((struct instance_core__Float*)var5)->value) || (var_k->class->box_kind == 6 && ((struct instance_core__NativeString*)var_k)->value == ((struct instance_core__NativeString*)var5)->value) || (var_k->class->box_kind == 7 && ((struct instance_core__Pointer*)var_k)->value == ((struct instance_core__Pointer*)var5)->value) || (var_k->class->box_kind == 8 && ((struct instance_core__Int8*)var_k)->value == ((struct instance_core__Int8*)var5)->value) || (var_k->class->box_kind == 9 && ((struct instance_core__Int16*)var_k)->value == ((struct instance_core__Int16*)var5)->value) || (var_k->class->box_kind == 10 && ((struct instance_core__UInt16*)var_k)->value == ((struct instance_core__UInt16*)var5)->value) || (var_k->class->box_kind == 11 && ((struct instance_core__Int32*)var_k)->value == ((struct instance_core__Int32*)var5)->value) || (var_k->class->box_kind == 12 && ((struct instance_core__UInt32*)var_k)->value == ((struct instance_core__UInt32*)var5)->value)));
119 var7 = var9;
120 goto RET_LABEL8;
121 RET_LABEL8:(void)0;
122 }
123 var6 = var7;
124 }
125 if (var6){
126 var10 = self->attrs[COLOR_core__hash_collection__HashCollection___last_accessed_node].val; /* _last_accessed_node on <self:HashCollection[nullable Object]> */
127 var = var10;
128 goto RET_LABEL;
129 } else {
130 }
131 {
132 var11 = core__hash_collection___core__hash_collection__HashCollection___index_at(self, var_k);
133 }
134 {
135 var12 = core__hash_collection___core__hash_collection__HashCollection___node_at_idx(self, var11, var_k);
136 }
137 var_res = var12;
138 self->attrs[COLOR_core__hash_collection__HashCollection___last_accessed_key].val = var_k; /* _last_accessed_key on <self:HashCollection[nullable Object]> */
139 self->attrs[COLOR_core__hash_collection__HashCollection___last_accessed_node].val = var_res; /* _last_accessed_node on <self:HashCollection[nullable Object]> */
140 var = var_res;
141 goto RET_LABEL;
142 RET_LABEL:;
143 return var;
144 }
145 /* method hash_collection#HashCollection#node_at_idx for (self: HashCollection[nullable Object], Int, nullable Object): nullable HashNode[nullable Object] */
146 val* core__hash_collection___core__hash_collection__HashCollection___node_at_idx(val* self, long p0, val* p1) {
147 val* var /* : nullable HashNode[nullable Object] */;
148 long var_i /* var i: Int */;
149 val* var_k /* var k: nullable Object */;
150 long var1 /* : Int */;
151 short int var2 /* : Bool */;
152 short int var4 /* : Bool */;
153 val* var5 /* : NativeArray[nullable HashNode[nullable Object]] */;
154 val* var6 /* : nullable Object */;
155 val* var8 /* : Object */;
156 val* var_c /* var c: nullable HashNode[nullable Object] */;
157 short int var9 /* : Bool */;
158 short int var10 /* : Bool */;
159 val* var_other /* var other: nullable Object */;
160 short int var12 /* : Bool */;
161 short int var13 /* : Bool */;
162 val* var14 /* : nullable Object */;
163 val* var_ck /* var ck: nullable Object */;
164 short int var15 /* : Bool */;
165 short int var16 /* : Bool */;
166 short int var17 /* : Bool */;
167 short int var19 /* : Bool */;
168 short int var_ /* var : Bool */;
169 short int var20 /* : Bool */;
170 short int var21 /* : Bool */;
171 val* var22 /* : nullable HashNode[nullable Object] */;
172 short int var23 /* : Bool */;
173 int cltype;
174 int idtype;
175 const struct type* type_struct;
176 const char* var_class_name;
177 var_i = p0;
178 var_k = p1;
179 var1 = self->attrs[COLOR_core__hash_collection__HashCollection___the_length].l; /* _the_length on <self:HashCollection[nullable Object]> */
180 {
181 { /* Inline kernel#Int#== (var1,0l) on <var1:Int> */
182 var4 = var1 == 0l;
183 var2 = var4;
184 goto RET_LABEL3;
185 RET_LABEL3:(void)0;
186 }
187 }
188 if (var2){
189 var = ((val*)NULL);
190 goto RET_LABEL;
191 } else {
192 }
193 var5 = self->attrs[COLOR_core__hash_collection__HashCollection___array].val; /* _array on <self:HashCollection[nullable Object]> */
194 if (unlikely(var5 == NULL)) {
195 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _array");
196 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 72);
197 fatal_exit(1);
198 }
199 {
200 { /* Inline array#NativeArray#[] (var5,var_i) on <var5:NativeArray[nullable HashNode[nullable Object]]> */
201 var8 = ((struct instance_core__NativeArray*)var5)->values[var_i];
202 var6 = var8;
203 goto RET_LABEL7;
204 RET_LABEL7:(void)0;
205 }
206 }
207 var_c = var6;
208 for(;;) {
209 if (var_c == NULL) {
210 var9 = 0; /* is null */
211 } else {
212 var9 = 1; /* arg is null and recv is not */
213 }
214 if (0) {
215 { /* Inline kernel#Object#!= (var_c,((val*)NULL)) on <var_c:nullable HashNode[nullable Object]> */
216 var_other = ((val*)NULL);
217 {
218 var12 = ((short int(*)(val* self, val* p0))(var_c->class->vft[COLOR_core__kernel__Object___61d_61d]))(var_c, var_other); /* == on <var_c:nullable HashNode[nullable Object](HashNode[nullable Object])>*/
219 }
220 var13 = !var12;
221 var10 = var13;
222 goto RET_LABEL11;
223 RET_LABEL11:(void)0;
224 }
225 var9 = var10;
226 }
227 if (var9){
228 var14 = var_c->attrs[COLOR_core__hash_collection__HashNode___key].val; /* _key on <var_c:nullable HashNode[nullable Object](HashNode[nullable Object])> */
229 var_ck = var14;
230 if (var_ck == NULL) {
231 var16 = (var_k == NULL);
232 } else {
233 { /* Inline kernel#Object#is_same_instance (var_ck,var_k) on <var_ck:nullable Object> */
234 var19 = var_ck == var_k || (var_ck != NULL && var_k != NULL && (!((long)var_ck&3)) && (!((long)var_k&3)) && var_ck->class == var_k->class && ((var_ck->class->box_kind == 3 && ((struct instance_core__Byte*)var_ck)->value == ((struct instance_core__Byte*)var_k)->value) || (var_ck->class->box_kind == 5 && ((struct instance_core__Float*)var_ck)->value == ((struct instance_core__Float*)var_k)->value) || (var_ck->class->box_kind == 6 && ((struct instance_core__NativeString*)var_ck)->value == ((struct instance_core__NativeString*)var_k)->value) || (var_ck->class->box_kind == 7 && ((struct instance_core__Pointer*)var_ck)->value == ((struct instance_core__Pointer*)var_k)->value) || (var_ck->class->box_kind == 8 && ((struct instance_core__Int8*)var_ck)->value == ((struct instance_core__Int8*)var_k)->value) || (var_ck->class->box_kind == 9 && ((struct instance_core__Int16*)var_ck)->value == ((struct instance_core__Int16*)var_k)->value) || (var_ck->class->box_kind == 10 && ((struct instance_core__UInt16*)var_ck)->value == ((struct instance_core__UInt16*)var_k)->value) || (var_ck->class->box_kind == 11 && ((struct instance_core__Int32*)var_ck)->value == ((struct instance_core__Int32*)var_k)->value) || (var_ck->class->box_kind == 12 && ((struct instance_core__UInt32*)var_ck)->value == ((struct instance_core__UInt32*)var_k)->value)));
235 var17 = var19;
236 goto RET_LABEL18;
237 RET_LABEL18:(void)0;
238 }
239 var16 = var17;
240 }
241 var_ = var16;
242 if (var16){
243 var15 = var_;
244 } else {
245 if (var_ck == NULL) {
246 var20 = (var_k == NULL);
247 } else {
248 var21 = ((short int(*)(val* self, val* p0))((((long)var_ck&3)?class_info[((long)var_ck&3)]:var_ck->class)->vft[COLOR_core__kernel__Object___61d_61d]))(var_ck, var_k); /* == on <var_ck:nullable Object>*/
249 var20 = var21;
250 }
251 var15 = var20;
252 }
253 if (var15){
254 goto BREAK_label;
255 } else {
256 }
257 var22 = var_c->attrs[COLOR_core__hash_collection__HashNode___next_in_bucklet].val; /* _next_in_bucklet on <var_c:nullable HashNode[nullable Object](HashNode[nullable Object])> */
258 /* <var22:nullable HashNode[nullable Object]> isa nullable N */
259 type_struct = self->type->resolution_table->types[COLOR_nullable__core__hash_collection__HashCollection__N];
260 cltype = type_struct->color;
261 idtype = type_struct->id;
262 if(var22 == NULL) {
263 var23 = 1;
264 } else {
265 if(cltype >= var22->type->table_size) {
266 var23 = 0;
267 } else {
268 var23 = var22->type->type_table[cltype] == idtype;
269 }
270 }
271 if (unlikely(!var23)) {
272 var_class_name = var22 == NULL ? "null" : var22->type->name;
273 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "nullable N", var_class_name);
274 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 78);
275 fatal_exit(1);
276 }
277 var_c = var22;
278 } else {
279 goto BREAK_label;
280 }
281 }
282 BREAK_label: (void)0;
283 var = var_c;
284 goto RET_LABEL;
285 RET_LABEL:;
286 return var;
287 }
288 /* method hash_collection#HashCollection#store for (self: HashCollection[nullable Object], Int, HashNode[nullable Object]) */
289 void core__hash_collection___core__hash_collection__HashCollection___store(val* self, long p0, val* p1) {
290 short int var /* : Bool */;
291 int cltype;
292 int idtype;
293 const struct type* type_struct;
294 const char* var_class_name;
295 long var_index /* var index: Int */;
296 val* var_node /* var node: HashNode[nullable Object] */;
297 val* var1 /* : nullable HashNode[nullable Object] */;
298 short int var2 /* : Bool */;
299 short int var3 /* : Bool */;
300 val* var_other /* var other: nullable Object */;
301 short int var5 /* : Bool */;
302 short int var7 /* : Bool */;
303 val* var8 /* : nullable HashNode[nullable Object] */;
304 val* var9 /* : nullable HashNode[nullable Object] */;
305 val* var10 /* : NativeArray[nullable HashNode[nullable Object]] */;
306 val* var11 /* : nullable Object */;
307 val* var13 /* : Object */;
308 val* var_next /* var next: nullable HashNode[nullable Object] */;
309 val* var14 /* : NativeArray[nullable HashNode[nullable Object]] */;
310 short int var16 /* : Bool */;
311 int cltype17;
312 int idtype18;
313 const struct type* type_struct19;
314 const char* var_class_name20;
315 short int var21 /* : Bool */;
316 short int var22 /* : Bool */;
317 val* var_other24 /* var other: nullable Object */;
318 short int var25 /* : Bool */;
319 short int var26 /* : Bool */;
320 val* var27 /* : nullable Object */;
321 long var28 /* : Int */;
322 long var_l /* var l: Int */;
323 long var29 /* : Int */;
324 short int var31 /* : Bool */;
325 int cltype32;
326 int idtype33;
327 const char* var_class_name34;
328 long var35 /* : Int */;
329 long var36 /* : Int */;
330 short int var38 /* : Bool */;
331 int cltype39;
332 int idtype40;
333 const char* var_class_name41;
334 long var42 /* : Int */;
335 long var43 /* : Int */;
336 short int var45 /* : Bool */;
337 int cltype46;
338 int idtype47;
339 const char* var_class_name48;
340 long var49 /* : Int */;
341 long var50 /* : Int */;
342 short int var52 /* : Bool */;
343 int cltype53;
344 int idtype54;
345 const char* var_class_name55;
346 long var56 /* : Int */;
347 long var57 /* : Int */;
348 short int var58 /* : Bool */;
349 short int var60 /* : Bool */;
350 int cltype61;
351 int idtype62;
352 const char* var_class_name63;
353 short int var64 /* : Bool */;
354 long var65 /* : Int */;
355 short int var67 /* : Bool */;
356 int cltype68;
357 int idtype69;
358 const char* var_class_name70;
359 long var71 /* : Int */;
360 long var72 /* : Int */;
361 short int var74 /* : Bool */;
362 int cltype75;
363 int idtype76;
364 const char* var_class_name77;
365 long var78 /* : Int */;
366 long var79 /* : Int */;
367 short int var81 /* : Bool */;
368 int cltype82;
369 int idtype83;
370 const char* var_class_name84;
371 long var85 /* : Int */;
372 /* Covariant cast for argument 1 (node) <p1:HashNode[nullable Object]> isa N */
373 /* <p1:HashNode[nullable Object]> isa N */
374 type_struct = self->type->resolution_table->types[COLOR_core__hash_collection__HashCollection__N];
375 cltype = type_struct->color;
376 idtype = type_struct->id;
377 if(cltype >= p1->type->table_size) {
378 var = 0;
379 } else {
380 var = p1->type->type_table[cltype] == idtype;
381 }
382 if (unlikely(!var)) {
383 var_class_name = p1 == NULL ? "null" : p1->type->name;
384 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "N", var_class_name);
385 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 83);
386 fatal_exit(1);
387 }
388 var_index = p0;
389 var_node = p1;
390 var1 = self->attrs[COLOR_core__hash_collection__HashCollection___first_item].val; /* _first_item on <self:HashCollection[nullable Object]> */
391 if (var1 == NULL) {
392 var2 = 1; /* is null */
393 } else {
394 var2 = 0; /* arg is null but recv is not */
395 }
396 if (0) {
397 { /* Inline kernel#Object#== (var1,((val*)NULL)) on <var1:nullable HashNode[nullable Object]> */
398 var_other = ((val*)NULL);
399 {
400 { /* Inline kernel#Object#is_same_instance (var1,var_other) on <var1:nullable HashNode[nullable Object](HashNode[nullable Object])> */
401 var7 = var1 == var_other;
402 var5 = var7;
403 goto RET_LABEL6;
404 RET_LABEL6:(void)0;
405 }
406 }
407 var3 = var5;
408 goto RET_LABEL4;
409 RET_LABEL4:(void)0;
410 }
411 var2 = var3;
412 }
413 if (var2){
414 self->attrs[COLOR_core__hash_collection__HashCollection___first_item].val = var_node; /* _first_item on <self:HashCollection[nullable Object]> */
415 } else {
416 var8 = self->attrs[COLOR_core__hash_collection__HashCollection___last_item].val; /* _last_item on <self:HashCollection[nullable Object]> */
417 if (unlikely(var8 == NULL)) {
418 PRINT_ERROR("Runtime error: %s", "Receiver is null");
419 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 90);
420 fatal_exit(1);
421 }
422 var8->attrs[COLOR_core__hash_collection__HashNode___next_item].val = var_node; /* _next_item on <var8:nullable HashNode[nullable Object]> */
423 }
424 var9 = self->attrs[COLOR_core__hash_collection__HashCollection___last_item].val; /* _last_item on <self:HashCollection[nullable Object]> */
425 var_node->attrs[COLOR_core__hash_collection__HashNode___prev_item].val = var9; /* _prev_item on <var_node:HashNode[nullable Object]> */
426 var_node->attrs[COLOR_core__hash_collection__HashNode___next_item].val = ((val*)NULL); /* _next_item on <var_node:HashNode[nullable Object]> */
427 self->attrs[COLOR_core__hash_collection__HashCollection___last_item].val = var_node; /* _last_item on <self:HashCollection[nullable Object]> */
428 var10 = self->attrs[COLOR_core__hash_collection__HashCollection___array].val; /* _array on <self:HashCollection[nullable Object]> */
429 if (unlikely(var10 == NULL)) {
430 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _array");
431 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 97);
432 fatal_exit(1);
433 }
434 {
435 { /* Inline array#NativeArray#[] (var10,var_index) on <var10:NativeArray[nullable HashNode[nullable Object]]> */
436 var13 = ((struct instance_core__NativeArray*)var10)->values[var_index];
437 var11 = var13;
438 goto RET_LABEL12;
439 RET_LABEL12:(void)0;
440 }
441 }
442 var_next = var11;
443 var14 = self->attrs[COLOR_core__hash_collection__HashCollection___array].val; /* _array on <self:HashCollection[nullable Object]> */
444 if (unlikely(var14 == NULL)) {
445 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _array");
446 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 98);
447 fatal_exit(1);
448 }
449 {
450 { /* Inline array#NativeArray#[]= (var14,var_index,var_node) on <var14:NativeArray[nullable HashNode[nullable Object]]> */
451 /* Covariant cast for argument 1 (item) <var_node:HashNode[nullable Object]> isa E */
452 /* <var_node:HashNode[nullable Object]> isa E */
453 type_struct19 = var14->type->resolution_table->types[COLOR_core__NativeArray___35dE];
454 cltype17 = type_struct19->color;
455 idtype18 = type_struct19->id;
456 if(cltype17 >= var_node->type->table_size) {
457 var16 = 0;
458 } else {
459 var16 = var_node->type->type_table[cltype17] == idtype18;
460 }
461 if (unlikely(!var16)) {
462 var_class_name20 = var_node == NULL ? "null" : var_node->type->name;
463 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "E", var_class_name20);
464 PRINT_ERROR(" (%s:%d)\n", FILE_core__array, 988);
465 fatal_exit(1);
466 }
467 ((struct instance_core__NativeArray*)var14)->values[var_index]=var_node;
468 RET_LABEL15:(void)0;
469 }
470 }
471 var_node->attrs[COLOR_core__hash_collection__HashNode___next_in_bucklet].val = var_next; /* _next_in_bucklet on <var_node:HashNode[nullable Object]> */
472 if (var_next == NULL) {
473 var21 = 0; /* is null */
474 } else {
475 var21 = 1; /* arg is null and recv is not */
476 }
477 if (0) {
478 { /* Inline kernel#Object#!= (var_next,((val*)NULL)) on <var_next:nullable HashNode[nullable Object]> */
479 var_other24 = ((val*)NULL);
480 {
481 var25 = ((short int(*)(val* self, val* p0))(var_next->class->vft[COLOR_core__kernel__Object___61d_61d]))(var_next, var_other24); /* == on <var_next:nullable HashNode[nullable Object](HashNode[nullable Object])>*/
482 }
483 var26 = !var25;
484 var22 = var26;
485 goto RET_LABEL23;
486 RET_LABEL23:(void)0;
487 }
488 var21 = var22;
489 }
490 if (var21){
491 var_next->attrs[COLOR_core__hash_collection__HashNode___prev_in_bucklet].val = var_node; /* _prev_in_bucklet on <var_next:nullable HashNode[nullable Object](HashNode[nullable Object])> */
492 } else {
493 }
494 var27 = var_node->attrs[COLOR_core__hash_collection__HashNode___key].val; /* _key on <var_node:HashNode[nullable Object]> */
495 self->attrs[COLOR_core__hash_collection__HashCollection___last_accessed_key].val = var27; /* _last_accessed_key on <self:HashCollection[nullable Object]> */
496 self->attrs[COLOR_core__hash_collection__HashCollection___last_accessed_node].val = var_node; /* _last_accessed_node on <self:HashCollection[nullable Object]> */
497 var28 = self->attrs[COLOR_core__hash_collection__HashCollection___the_length].l; /* _the_length on <self:HashCollection[nullable Object]> */
498 var_l = var28;
499 {
500 { /* Inline kernel#Int#+ (var_l,1l) on <var_l:Int> */
501 /* Covariant cast for argument 0 (i) <1l:Int> isa OTHER */
502 /* <1l:Int> isa OTHER */
503 var31 = 1; /* easy <1l:Int> isa OTHER*/
504 if (unlikely(!var31)) {
505 var_class_name34 = type_core__Int.name;
506 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name34);
507 PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 731);
508 fatal_exit(1);
509 }
510 var35 = var_l + 1l;
511 var29 = var35;
512 goto RET_LABEL30;
513 RET_LABEL30:(void)0;
514 }
515 }
516 self->attrs[COLOR_core__hash_collection__HashCollection___the_length].l = var29; /* _the_length on <self:HashCollection[nullable Object]> */
517 {
518 { /* Inline kernel#Int#+ (var_l,5l) on <var_l:Int> */
519 /* Covariant cast for argument 0 (i) <5l:Int> isa OTHER */
520 /* <5l:Int> isa OTHER */
521 var38 = 1; /* easy <5l:Int> isa OTHER*/
522 if (unlikely(!var38)) {
523 var_class_name41 = type_core__Int.name;
524 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name41);
525 PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 731);
526 fatal_exit(1);
527 }
528 var42 = var_l + 5l;
529 var36 = var42;
530 goto RET_LABEL37;
531 RET_LABEL37:(void)0;
532 }
533 }
534 {
535 { /* Inline kernel#Int#* (var36,2l) on <var36:Int> */
536 /* Covariant cast for argument 0 (i) <2l:Int> isa OTHER */
537 /* <2l:Int> isa OTHER */
538 var45 = 1; /* easy <2l:Int> isa OTHER*/
539 if (unlikely(!var45)) {
540 var_class_name48 = type_core__Int.name;
541 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name48);
542 PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 735);
543 fatal_exit(1);
544 }
545 var49 = var36 * 2l;
546 var43 = var49;
547 goto RET_LABEL44;
548 RET_LABEL44:(void)0;
549 }
550 }
551 {
552 { /* Inline kernel#Int#+ (var43,1l) on <var43:Int> */
553 /* Covariant cast for argument 0 (i) <1l:Int> isa OTHER */
554 /* <1l:Int> isa OTHER */
555 var52 = 1; /* easy <1l:Int> isa OTHER*/
556 if (unlikely(!var52)) {
557 var_class_name55 = type_core__Int.name;
558 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name55);
559 PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 731);
560 fatal_exit(1);
561 }
562 var56 = var43 + 1l;
563 var50 = var56;
564 goto RET_LABEL51;
565 RET_LABEL51:(void)0;
566 }
567 }
568 var_l = var50;
569 var57 = self->attrs[COLOR_core__hash_collection__HashCollection___capacity].l; /* _capacity on <self:HashCollection[nullable Object]> */
570 {
571 { /* Inline kernel#Int#>= (var_l,var57) on <var_l:Int> */
572 /* Covariant cast for argument 0 (i) <var57:Int> isa OTHER */
573 /* <var57:Int> isa OTHER */
574 var60 = 1; /* easy <var57:Int> isa OTHER*/
575 if (unlikely(!var60)) {
576 var_class_name63 = type_core__Int.name;
577 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name63);
578 PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 729);
579 fatal_exit(1);
580 }
581 var64 = var_l >= var57;
582 var58 = var64;
583 goto RET_LABEL59;
584 RET_LABEL59:(void)0;
585 }
586 }
587 if (var58){
588 {
589 { /* Inline kernel#Int#* (var_l,3l) on <var_l:Int> */
590 /* Covariant cast for argument 0 (i) <3l:Int> isa OTHER */
591 /* <3l:Int> isa OTHER */
592 var67 = 1; /* easy <3l:Int> isa OTHER*/
593 if (unlikely(!var67)) {
594 var_class_name70 = type_core__Int.name;
595 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name70);
596 PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 735);
597 fatal_exit(1);
598 }
599 var71 = var_l * 3l;
600 var65 = var71;
601 goto RET_LABEL66;
602 RET_LABEL66:(void)0;
603 }
604 }
605 {
606 { /* Inline kernel#Int#/ (var65,2l) on <var65:Int> */
607 /* Covariant cast for argument 0 (i) <2l:Int> isa OTHER */
608 /* <2l:Int> isa OTHER */
609 var74 = 1; /* easy <2l:Int> isa OTHER*/
610 if (unlikely(!var74)) {
611 var_class_name77 = type_core__Int.name;
612 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name77);
613 PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 736);
614 fatal_exit(1);
615 }
616 var78 = var65 / 2l;
617 var72 = var78;
618 goto RET_LABEL73;
619 RET_LABEL73:(void)0;
620 }
621 }
622 {
623 { /* Inline kernel#Int#+ (var72,1l) on <var72:Int> */
624 /* Covariant cast for argument 0 (i) <1l:Int> isa OTHER */
625 /* <1l:Int> isa OTHER */
626 var81 = 1; /* easy <1l:Int> isa OTHER*/
627 if (unlikely(!var81)) {
628 var_class_name84 = type_core__Int.name;
629 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name84);
630 PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 731);
631 fatal_exit(1);
632 }
633 var85 = var72 + 1l;
634 var79 = var85;
635 goto RET_LABEL80;
636 RET_LABEL80:(void)0;
637 }
638 }
639 {
640 core__hash_collection___core__hash_collection__HashCollection___enlarge(self, var79); /* Direct call hash_collection#HashCollection#enlarge on <self:HashCollection[nullable Object]>*/
641 }
642 } else {
643 }
644 RET_LABEL:;
645 }
646 /* method hash_collection#HashCollection#remove_node for (self: HashCollection[nullable Object], nullable Object) */
647 void core__hash_collection___core__hash_collection__HashCollection___remove_node(val* self, val* p0) {
648 val* var_k /* var k: nullable Object */;
649 long var /* : Int */;
650 short int var1 /* : Bool */;
651 short int var3 /* : Bool */;
652 long var4 /* : Int */;
653 long var_i /* var i: Int */;
654 val* var5 /* : nullable HashNode[nullable Object] */;
655 val* var_node /* var node: nullable HashNode[nullable Object] */;
656 short int var6 /* : Bool */;
657 short int var7 /* : Bool */;
658 val* var_other /* var other: nullable Object */;
659 short int var9 /* : Bool */;
660 short int var11 /* : Bool */;
661 val* var12 /* : nullable HashNode[nullable Object] */;
662 val* var_prev /* var prev: nullable HashNode[nullable Object] */;
663 val* var13 /* : nullable HashNode[nullable Object] */;
664 val* var_next /* var next: nullable HashNode[nullable Object] */;
665 short int var14 /* : Bool */;
666 short int var15 /* : Bool */;
667 val* var_other17 /* var other: nullable Object */;
668 short int var18 /* : Bool */;
669 short int var19 /* : Bool */;
670 short int var20 /* : Bool */;
671 int cltype;
672 int idtype;
673 const struct type* type_struct;
674 const char* var_class_name;
675 short int var21 /* : Bool */;
676 short int var22 /* : Bool */;
677 short int var24 /* : Bool */;
678 short int var25 /* : Bool */;
679 short int var26 /* : Bool */;
680 int cltype27;
681 int idtype28;
682 const struct type* type_struct29;
683 const char* var_class_name30;
684 val* var_ /* var : HashCollection[nullable Object] */;
685 long var31 /* : Int */;
686 long var32 /* : Int */;
687 short int var34 /* : Bool */;
688 int cltype35;
689 int idtype36;
690 const char* var_class_name37;
691 long var38 /* : Int */;
692 val* var39 /* : nullable HashNode[nullable Object] */;
693 val* var40 /* : nullable HashNode[nullable Object] */;
694 short int var41 /* : Bool */;
695 short int var42 /* : Bool */;
696 short int var44 /* : Bool */;
697 short int var45 /* : Bool */;
698 val* var46 /* : NativeArray[nullable HashNode[nullable Object]] */;
699 short int var47 /* : Bool */;
700 int cltype48;
701 int idtype49;
702 const struct type* type_struct50;
703 const char* var_class_name51;
704 short int var53 /* : Bool */;
705 int cltype54;
706 int idtype55;
707 const struct type* type_struct56;
708 short int is_nullable;
709 const char* var_class_name57;
710 short int var58 /* : Bool */;
711 short int var59 /* : Bool */;
712 short int var61 /* : Bool */;
713 short int var62 /* : Bool */;
714 var_k = p0;
715 var = self->attrs[COLOR_core__hash_collection__HashCollection___the_length].l; /* _the_length on <self:HashCollection[nullable Object]> */
716 {
717 { /* Inline kernel#Int#== (var,0l) on <var:Int> */
718 var3 = var == 0l;
719 var1 = var3;
720 goto RET_LABEL2;
721 RET_LABEL2:(void)0;
722 }
723 }
724 if (var1){
725 goto RET_LABEL;
726 } else {
727 }
728 {
729 var4 = core__hash_collection___core__hash_collection__HashCollection___index_at(self, var_k);
730 }
731 var_i = var4;
732 {
733 var5 = core__hash_collection___core__hash_collection__HashCollection___node_at_idx(self, var_i, var_k);
734 }
735 var_node = var5;
736 if (var_node == NULL) {
737 var6 = 1; /* is null */
738 } else {
739 var6 = 0; /* arg is null but recv is not */
740 }
741 if (0) {
742 { /* Inline kernel#Object#== (var_node,((val*)NULL)) on <var_node:nullable HashNode[nullable Object]> */
743 var_other = ((val*)NULL);
744 {
745 { /* Inline kernel#Object#is_same_instance (var_node,var_other) on <var_node:nullable HashNode[nullable Object](HashNode[nullable Object])> */
746 var11 = var_node == var_other;
747 var9 = var11;
748 goto RET_LABEL10;
749 RET_LABEL10:(void)0;
750 }
751 }
752 var7 = var9;
753 goto RET_LABEL8;
754 RET_LABEL8:(void)0;
755 }
756 var6 = var7;
757 }
758 if (var6){
759 goto RET_LABEL;
760 } else {
761 }
762 var12 = var_node->attrs[COLOR_core__hash_collection__HashNode___prev_item].val; /* _prev_item on <var_node:nullable HashNode[nullable Object](HashNode[nullable Object])> */
763 var_prev = var12;
764 var13 = var_node->attrs[COLOR_core__hash_collection__HashNode___next_item].val; /* _next_item on <var_node:nullable HashNode[nullable Object](HashNode[nullable Object])> */
765 var_next = var13;
766 if (var_prev == NULL) {
767 var14 = 0; /* is null */
768 } else {
769 var14 = 1; /* arg is null and recv is not */
770 }
771 if (0) {
772 { /* Inline kernel#Object#!= (var_prev,((val*)NULL)) on <var_prev:nullable HashNode[nullable Object]> */
773 var_other17 = ((val*)NULL);
774 {
775 var18 = ((short int(*)(val* self, val* p0))(var_prev->class->vft[COLOR_core__kernel__Object___61d_61d]))(var_prev, var_other17); /* == on <var_prev:nullable HashNode[nullable Object](HashNode[nullable Object])>*/
776 }
777 var19 = !var18;
778 var15 = var19;
779 goto RET_LABEL16;
780 RET_LABEL16:(void)0;
781 }
782 var14 = var15;
783 }
784 if (var14){
785 var_prev->attrs[COLOR_core__hash_collection__HashNode___next_item].val = var_next; /* _next_item on <var_prev:nullable HashNode[nullable Object](HashNode[nullable Object])> */
786 } else {
787 /* <var_next:nullable HashNode[nullable Object]> isa nullable N */
788 type_struct = self->type->resolution_table->types[COLOR_nullable__core__hash_collection__HashCollection__N];
789 cltype = type_struct->color;
790 idtype = type_struct->id;
791 if(var_next == NULL) {
792 var20 = 1;
793 } else {
794 if(cltype >= var_next->type->table_size) {
795 var20 = 0;
796 } else {
797 var20 = var_next->type->type_table[cltype] == idtype;
798 }
799 }
800 if (unlikely(!var20)) {
801 var_class_name = var_next == NULL ? "null" : var_next->type->name;
802 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "nullable N", var_class_name);
803 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 132);
804 fatal_exit(1);
805 }
806 self->attrs[COLOR_core__hash_collection__HashCollection___first_item].val = var_next; /* _first_item on <self:HashCollection[nullable Object]> */
807 }
808 if (var_next == NULL) {
809 var21 = 0; /* is null */
810 } else {
811 var21 = 1; /* arg is null and recv is not */
812 }
813 if (0) {
814 { /* Inline kernel#Object#!= (var_next,((val*)NULL)) on <var_next:nullable HashNode[nullable Object]> */
815 var_other17 = ((val*)NULL);
816 {
817 var24 = ((short int(*)(val* self, val* p0))(var_next->class->vft[COLOR_core__kernel__Object___61d_61d]))(var_next, var_other17); /* == on <var_next:nullable HashNode[nullable Object](HashNode[nullable Object])>*/
818 }
819 var25 = !var24;
820 var22 = var25;
821 goto RET_LABEL23;
822 RET_LABEL23:(void)0;
823 }
824 var21 = var22;
825 }
826 if (var21){
827 var_next->attrs[COLOR_core__hash_collection__HashNode___prev_item].val = var_prev; /* _prev_item on <var_next:nullable HashNode[nullable Object](HashNode[nullable Object])> */
828 } else {
829 /* <var_prev:nullable HashNode[nullable Object]> isa nullable N */
830 type_struct29 = self->type->resolution_table->types[COLOR_nullable__core__hash_collection__HashCollection__N];
831 cltype27 = type_struct29->color;
832 idtype28 = type_struct29->id;
833 if(var_prev == NULL) {
834 var26 = 1;
835 } else {
836 if(cltype27 >= var_prev->type->table_size) {
837 var26 = 0;
838 } else {
839 var26 = var_prev->type->type_table[cltype27] == idtype28;
840 }
841 }
842 if (unlikely(!var26)) {
843 var_class_name30 = var_prev == NULL ? "null" : var_prev->type->name;
844 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "nullable N", var_class_name30);
845 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 137);
846 fatal_exit(1);
847 }
848 self->attrs[COLOR_core__hash_collection__HashCollection___last_item].val = var_prev; /* _last_item on <self:HashCollection[nullable Object]> */
849 }
850 var_ = self;
851 var31 = var_->attrs[COLOR_core__hash_collection__HashCollection___the_length].l; /* _the_length on <var_:HashCollection[nullable Object]> */
852 {
853 { /* Inline kernel#Int#- (var31,1l) on <var31:Int> */
854 /* Covariant cast for argument 0 (i) <1l:Int> isa OTHER */
855 /* <1l:Int> isa OTHER */
856 var34 = 1; /* easy <1l:Int> isa OTHER*/
857 if (unlikely(!var34)) {
858 var_class_name37 = type_core__Int.name;
859 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name37);
860 PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 734);
861 fatal_exit(1);
862 }
863 var38 = var31 - 1l;
864 var32 = var38;
865 goto RET_LABEL33;
866 RET_LABEL33:(void)0;
867 }
868 }
869 var_->attrs[COLOR_core__hash_collection__HashCollection___the_length].l = var32; /* _the_length on <var_:HashCollection[nullable Object]> */
870 var39 = var_node->attrs[COLOR_core__hash_collection__HashNode___prev_in_bucklet].val; /* _prev_in_bucklet on <var_node:nullable HashNode[nullable Object](HashNode[nullable Object])> */
871 var_prev = var39;
872 var40 = var_node->attrs[COLOR_core__hash_collection__HashNode___next_in_bucklet].val; /* _next_in_bucklet on <var_node:nullable HashNode[nullable Object](HashNode[nullable Object])> */
873 var_next = var40;
874 if (var_prev == NULL) {
875 var41 = 0; /* is null */
876 } else {
877 var41 = 1; /* arg is null and recv is not */
878 }
879 if (0) {
880 { /* Inline kernel#Object#!= (var_prev,((val*)NULL)) on <var_prev:nullable HashNode[nullable Object]> */
881 var_other17 = ((val*)NULL);
882 {
883 var44 = ((short int(*)(val* self, val* p0))(var_prev->class->vft[COLOR_core__kernel__Object___61d_61d]))(var_prev, var_other17); /* == on <var_prev:nullable HashNode[nullable Object](HashNode[nullable Object])>*/
884 }
885 var45 = !var44;
886 var42 = var45;
887 goto RET_LABEL43;
888 RET_LABEL43:(void)0;
889 }
890 var41 = var42;
891 }
892 if (var41){
893 var_prev->attrs[COLOR_core__hash_collection__HashNode___next_in_bucklet].val = var_next; /* _next_in_bucklet on <var_prev:nullable HashNode[nullable Object](HashNode[nullable Object])> */
894 } else {
895 var46 = self->attrs[COLOR_core__hash_collection__HashCollection___array].val; /* _array on <self:HashCollection[nullable Object]> */
896 if (unlikely(var46 == NULL)) {
897 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _array");
898 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 147);
899 fatal_exit(1);
900 }
901 /* <var_next:nullable HashNode[nullable Object]> isa nullable N */
902 type_struct50 = self->type->resolution_table->types[COLOR_nullable__core__hash_collection__HashCollection__N];
903 cltype48 = type_struct50->color;
904 idtype49 = type_struct50->id;
905 if(var_next == NULL) {
906 var47 = 1;
907 } else {
908 if(cltype48 >= var_next->type->table_size) {
909 var47 = 0;
910 } else {
911 var47 = var_next->type->type_table[cltype48] == idtype49;
912 }
913 }
914 if (unlikely(!var47)) {
915 var_class_name51 = var_next == NULL ? "null" : var_next->type->name;
916 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "nullable N", var_class_name51);
917 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 147);
918 fatal_exit(1);
919 }
920 {
921 { /* Inline array#NativeArray#[]= (var46,var_i,var_next) on <var46:NativeArray[nullable HashNode[nullable Object]]> */
922 /* Covariant cast for argument 1 (item) <var_next:nullable HashNode[nullable Object]> isa E */
923 /* <var_next:nullable HashNode[nullable Object]> isa E */
924 type_struct56 = var46->type->resolution_table->types[COLOR_core__NativeArray___35dE];
925 cltype54 = type_struct56->color;
926 idtype55 = type_struct56->id;
927 is_nullable = type_struct56->is_nullable;
928 if(var_next == NULL) {
929 var53 = is_nullable;
930 } else {
931 if(cltype54 >= var_next->type->table_size) {
932 var53 = 0;
933 } else {
934 var53 = var_next->type->type_table[cltype54] == idtype55;
935 }
936 }
937 if (unlikely(!var53)) {
938 var_class_name57 = var_next == NULL ? "null" : var_next->type->name;
939 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "E", var_class_name57);
940 PRINT_ERROR(" (%s:%d)\n", FILE_core__array, 988);
941 fatal_exit(1);
942 }
943 ((struct instance_core__NativeArray*)var46)->values[var_i]=var_next;
944 RET_LABEL52:(void)0;
945 }
946 }
947 }
948 if (var_next == NULL) {
949 var58 = 0; /* is null */
950 } else {
951 var58 = 1; /* arg is null and recv is not */
952 }
953 if (0) {
954 { /* Inline kernel#Object#!= (var_next,((val*)NULL)) on <var_next:nullable HashNode[nullable Object]> */
955 var_other17 = ((val*)NULL);
956 {
957 var61 = ((short int(*)(val* self, val* p0))(var_next->class->vft[COLOR_core__kernel__Object___61d_61d]))(var_next, var_other17); /* == on <var_next:nullable HashNode[nullable Object](HashNode[nullable Object])>*/
958 }
959 var62 = !var61;
960 var59 = var62;
961 goto RET_LABEL60;
962 RET_LABEL60:(void)0;
963 }
964 var58 = var59;
965 }
966 if (var58){
967 var_next->attrs[COLOR_core__hash_collection__HashNode___prev_in_bucklet].val = var_prev; /* _prev_in_bucklet on <var_next:nullable HashNode[nullable Object](HashNode[nullable Object])> */
968 } else {
969 }
970 self->attrs[COLOR_core__hash_collection__HashCollection___last_accessed_key].val = ((val*)NULL); /* _last_accessed_key on <self:HashCollection[nullable Object]> */
971 RET_LABEL:;
972 }
973 /* method hash_collection#HashCollection#raz for (self: HashCollection[nullable Object]) */
974 void core__hash_collection___core__hash_collection__HashCollection___raz(val* self) {
975 long var /* : Int */;
976 long var1 /* : Int */;
977 short int var3 /* : Bool */;
978 int cltype;
979 int idtype;
980 const char* var_class_name;
981 long var4 /* : Int */;
982 long var_i /* var i: Int */;
983 short int var5 /* : Bool */;
984 short int var7 /* : Bool */;
985 int cltype8;
986 int idtype9;
987 const char* var_class_name10;
988 short int var11 /* : Bool */;
989 val* var12 /* : NativeArray[nullable HashNode[nullable Object]] */;
990 short int var14 /* : Bool */;
991 int cltype15;
992 int idtype16;
993 const struct type* type_struct;
994 short int is_nullable;
995 const char* var_class_name17;
996 long var18 /* : Int */;
997 short int var20 /* : Bool */;
998 int cltype21;
999 int idtype22;
1000 const char* var_class_name23;
1001 long var24 /* : Int */;
1002 var = self->attrs[COLOR_core__hash_collection__HashCollection___capacity].l; /* _capacity on <self:HashCollection[nullable Object]> */
1003 {
1004 { /* Inline kernel#Int#- (var,1l) on <var:Int> */
1005 /* Covariant cast for argument 0 (i) <1l:Int> isa OTHER */
1006 /* <1l:Int> isa OTHER */
1007 var3 = 1; /* easy <1l:Int> isa OTHER*/
1008 if (unlikely(!var3)) {
1009 var_class_name = type_core__Int.name;
1010 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name);
1011 PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 734);
1012 fatal_exit(1);
1013 }
1014 var4 = var - 1l;
1015 var1 = var4;
1016 goto RET_LABEL2;
1017 RET_LABEL2:(void)0;
1018 }
1019 }
1020 var_i = var1;
1021 for(;;) {
1022 {
1023 { /* Inline kernel#Int#>= (var_i,0l) on <var_i:Int> */
1024 /* Covariant cast for argument 0 (i) <0l:Int> isa OTHER */
1025 /* <0l:Int> isa OTHER */
1026 var7 = 1; /* easy <0l:Int> isa OTHER*/
1027 if (unlikely(!var7)) {
1028 var_class_name10 = type_core__Int.name;
1029 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name10);
1030 PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 729);
1031 fatal_exit(1);
1032 }
1033 var11 = var_i >= 0l;
1034 var5 = var11;
1035 goto RET_LABEL6;
1036 RET_LABEL6:(void)0;
1037 }
1038 }
1039 if (var5){
1040 var12 = self->attrs[COLOR_core__hash_collection__HashCollection___array].val; /* _array on <self:HashCollection[nullable Object]> */
1041 if (unlikely(var12 == NULL)) {
1042 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _array");
1043 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 161);
1044 fatal_exit(1);
1045 }
1046 {
1047 { /* Inline array#NativeArray#[]= (var12,var_i,((val*)NULL)) on <var12:NativeArray[nullable HashNode[nullable Object]]> */
1048 /* Covariant cast for argument 1 (item) <((val*)NULL):null> isa E */
1049 /* <((val*)NULL):null> isa E */
1050 type_struct = var12->type->resolution_table->types[COLOR_core__NativeArray___35dE];
1051 cltype15 = type_struct->color;
1052 idtype16 = type_struct->id;
1053 is_nullable = type_struct->is_nullable;
1054 if(((val*)NULL) == NULL) {
1055 var14 = is_nullable;
1056 } else {
1057 if(cltype15 >= ((val*)NULL)->type->table_size) {
1058 var14 = 0;
1059 } else {
1060 var14 = ((val*)NULL)->type->type_table[cltype15] == idtype16;
1061 }
1062 }
1063 if (unlikely(!var14)) {
1064 var_class_name17 = ((val*)NULL) == NULL ? "null" : ((val*)NULL)->type->name;
1065 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "E", var_class_name17);
1066 PRINT_ERROR(" (%s:%d)\n", FILE_core__array, 988);
1067 fatal_exit(1);
1068 }
1069 ((struct instance_core__NativeArray*)var12)->values[var_i]=((val*)NULL);
1070 RET_LABEL13:(void)0;
1071 }
1072 }
1073 {
1074 { /* Inline kernel#Int#- (var_i,1l) on <var_i:Int> */
1075 /* Covariant cast for argument 0 (i) <1l:Int> isa OTHER */
1076 /* <1l:Int> isa OTHER */
1077 var20 = 1; /* easy <1l:Int> isa OTHER*/
1078 if (unlikely(!var20)) {
1079 var_class_name23 = type_core__Int.name;
1080 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name23);
1081 PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 734);
1082 fatal_exit(1);
1083 }
1084 var24 = var_i - 1l;
1085 var18 = var24;
1086 goto RET_LABEL19;
1087 RET_LABEL19:(void)0;
1088 }
1089 }
1090 var_i = var18;
1091 } else {
1092 goto BREAK_label;
1093 }
1094 }
1095 BREAK_label: (void)0;
1096 self->attrs[COLOR_core__hash_collection__HashCollection___the_length].l = 0l; /* _the_length on <self:HashCollection[nullable Object]> */
1097 self->attrs[COLOR_core__hash_collection__HashCollection___first_item].val = ((val*)NULL); /* _first_item on <self:HashCollection[nullable Object]> */
1098 self->attrs[COLOR_core__hash_collection__HashCollection___last_item].val = ((val*)NULL); /* _last_item on <self:HashCollection[nullable Object]> */
1099 self->attrs[COLOR_core__hash_collection__HashCollection___last_accessed_key].val = ((val*)NULL); /* _last_accessed_key on <self:HashCollection[nullable Object]> */
1100 RET_LABEL:;
1101 }
1102 /* method hash_collection#HashCollection#enlarge for (self: HashCollection[nullable Object], Int) */
1103 void core__hash_collection___core__hash_collection__HashCollection___enlarge(val* self, long p0) {
1104 long var_cap /* var cap: Int */;
1105 long var /* : Int */;
1106 long var1 /* : Int */;
1107 short int var3 /* : Bool */;
1108 int cltype;
1109 int idtype;
1110 const char* var_class_name;
1111 long var4 /* : Int */;
1112 short int var5 /* : Bool */;
1113 short int var7 /* : Bool */;
1114 int cltype8;
1115 int idtype9;
1116 const char* var_class_name10;
1117 short int var11 /* : Bool */;
1118 long var12 /* : Int */;
1119 long var13 /* : Int */;
1120 short int var15 /* : Bool */;
1121 int cltype16;
1122 int idtype17;
1123 const char* var_class_name18;
1124 long var19 /* : Int */;
1125 long var20 /* : Int */;
1126 short int var21 /* : Bool */;
1127 short int var23 /* : Bool */;
1128 int cltype24;
1129 int idtype25;
1130 const char* var_class_name26;
1131 short int var27 /* : Bool */;
1132 val* var28 /* : NativeArray[nullable HashNode[nullable Object]] */;
1133 val* var_new_array /* var new_array: NativeArray[nullable HashNode[nullable Object]] */;
1134 val* var29 /* : nullable HashNode[nullable Object] */;
1135 val* var_node /* var node: nullable HashNode[nullable Object] */;
1136 short int var30 /* : Bool */;
1137 short int var31 /* : Bool */;
1138 val* var_other /* var other: nullable Object */;
1139 short int var33 /* : Bool */;
1140 short int var34 /* : Bool */;
1141 val* var35 /* : nullable Object */;
1142 long var36 /* : Int */;
1143 long var_index /* var index: Int */;
1144 val* var37 /* : nullable Object */;
1145 val* var39 /* : Object */;
1146 val* var_next /* var next: nullable HashNode[nullable Object] */;
1147 short int var41 /* : Bool */;
1148 int cltype42;
1149 int idtype43;
1150 const struct type* type_struct;
1151 const char* var_class_name44;
1152 short int var45 /* : Bool */;
1153 short int var46 /* : Bool */;
1154 short int var48 /* : Bool */;
1155 short int var49 /* : Bool */;
1156 val* var50 /* : nullable HashNode[nullable Object] */;
1157 short int var51 /* : Bool */;
1158 int cltype52;
1159 int idtype53;
1160 const struct type* type_struct54;
1161 const char* var_class_name55;
1162 var_cap = p0;
1163 var = self->attrs[COLOR_core__hash_collection__HashCollection___the_length].l; /* _the_length on <self:HashCollection[nullable Object]> */
1164 {
1165 { /* Inline kernel#Int#+ (var,1l) on <var:Int> */
1166 /* Covariant cast for argument 0 (i) <1l:Int> isa OTHER */
1167 /* <1l:Int> isa OTHER */
1168 var3 = 1; /* easy <1l:Int> isa OTHER*/
1169 if (unlikely(!var3)) {
1170 var_class_name = type_core__Int.name;
1171 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name);
1172 PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 731);
1173 fatal_exit(1);
1174 }
1175 var4 = var + 1l;
1176 var1 = var4;
1177 goto RET_LABEL2;
1178 RET_LABEL2:(void)0;
1179 }
1180 }
1181 {
1182 { /* Inline kernel#Int#< (var_cap,var1) on <var_cap:Int> */
1183 /* Covariant cast for argument 0 (i) <var1:Int> isa OTHER */
1184 /* <var1:Int> isa OTHER */
1185 var7 = 1; /* easy <var1:Int> isa OTHER*/
1186 if (unlikely(!var7)) {
1187 var_class_name10 = type_core__Int.name;
1188 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name10);
1189 PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 728);
1190 fatal_exit(1);
1191 }
1192 var11 = var_cap < var1;
1193 var5 = var11;
1194 goto RET_LABEL6;
1195 RET_LABEL6:(void)0;
1196 }
1197 }
1198 if (var5){
1199 var12 = self->attrs[COLOR_core__hash_collection__HashCollection___the_length].l; /* _the_length on <self:HashCollection[nullable Object]> */
1200 {
1201 { /* Inline kernel#Int#+ (var12,1l) on <var12:Int> */
1202 /* Covariant cast for argument 0 (i) <1l:Int> isa OTHER */
1203 /* <1l:Int> isa OTHER */
1204 var15 = 1; /* easy <1l:Int> isa OTHER*/
1205 if (unlikely(!var15)) {
1206 var_class_name18 = type_core__Int.name;
1207 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name18);
1208 PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 731);
1209 fatal_exit(1);
1210 }
1211 var19 = var12 + 1l;
1212 var13 = var19;
1213 goto RET_LABEL14;
1214 RET_LABEL14:(void)0;
1215 }
1216 }
1217 var_cap = var13;
1218 } else {
1219 }
1220 var20 = self->attrs[COLOR_core__hash_collection__HashCollection___capacity].l; /* _capacity on <self:HashCollection[nullable Object]> */
1221 {
1222 { /* Inline kernel#Int#<= (var_cap,var20) on <var_cap:Int> */
1223 /* Covariant cast for argument 0 (i) <var20:Int> isa OTHER */
1224 /* <var20:Int> isa OTHER */
1225 var23 = 1; /* easy <var20:Int> isa OTHER*/
1226 if (unlikely(!var23)) {
1227 var_class_name26 = type_core__Int.name;
1228 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name26);
1229 PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 727);
1230 fatal_exit(1);
1231 }
1232 var27 = var_cap <= var20;
1233 var21 = var27;
1234 goto RET_LABEL22;
1235 RET_LABEL22:(void)0;
1236 }
1237 }
1238 if (var21){
1239 goto RET_LABEL;
1240 } else {
1241 }
1242 self->attrs[COLOR_core__hash_collection__HashCollection___capacity].l = var_cap; /* _capacity on <self:HashCollection[nullable Object]> */
1243 self->attrs[COLOR_core__hash_collection__HashCollection___last_accessed_key].val = ((val*)NULL); /* _last_accessed_key on <self:HashCollection[nullable Object]> */
1244 var28 = NEW_core__NativeArray(var_cap, self->type->resolution_table->types[COLOR_core__NativeArray__nullable__core__hash_collection__HashCollection__N]);
1245 var_new_array = var28;
1246 self->attrs[COLOR_core__hash_collection__HashCollection___array].val = var_new_array; /* _array on <self:HashCollection[nullable Object]> */
1247 var29 = self->attrs[COLOR_core__hash_collection__HashCollection___first_item].val; /* _first_item on <self:HashCollection[nullable Object]> */
1248 var_node = var29;
1249 for(;;) {
1250 if (var_node == NULL) {
1251 var30 = 0; /* is null */
1252 } else {
1253 var30 = 1; /* arg is null and recv is not */
1254 }
1255 if (0) {
1256 { /* Inline kernel#Object#!= (var_node,((val*)NULL)) on <var_node:nullable HashNode[nullable Object]> */
1257 var_other = ((val*)NULL);
1258 {
1259 var33 = ((short int(*)(val* self, val* p0))(var_node->class->vft[COLOR_core__kernel__Object___61d_61d]))(var_node, var_other); /* == on <var_node:nullable HashNode[nullable Object](HashNode[nullable Object])>*/
1260 }
1261 var34 = !var33;
1262 var31 = var34;
1263 goto RET_LABEL32;
1264 RET_LABEL32:(void)0;
1265 }
1266 var30 = var31;
1267 }
1268 if (var30){
1269 var35 = var_node->attrs[COLOR_core__hash_collection__HashNode___key].val; /* _key on <var_node:nullable HashNode[nullable Object](HashNode[nullable Object])> */
1270 {
1271 var36 = core__hash_collection___core__hash_collection__HashCollection___index_at(self, var35);
1272 }
1273 var_index = var36;
1274 {
1275 { /* Inline array#NativeArray#[] (var_new_array,var_index) on <var_new_array:NativeArray[nullable HashNode[nullable Object]]> */
1276 var39 = ((struct instance_core__NativeArray*)var_new_array)->values[var_index];
1277 var37 = var39;
1278 goto RET_LABEL38;
1279 RET_LABEL38:(void)0;
1280 }
1281 }
1282 var_next = var37;
1283 {
1284 { /* Inline array#NativeArray#[]= (var_new_array,var_index,var_node) on <var_new_array:NativeArray[nullable HashNode[nullable Object]]> */
1285 /* Covariant cast for argument 1 (item) <var_node:nullable HashNode[nullable Object](HashNode[nullable Object])> isa E */
1286 /* <var_node:nullable HashNode[nullable Object](HashNode[nullable Object])> isa E */
1287 type_struct = var_new_array->type->resolution_table->types[COLOR_core__NativeArray___35dE];
1288 cltype42 = type_struct->color;
1289 idtype43 = type_struct->id;
1290 if(cltype42 >= var_node->type->table_size) {
1291 var41 = 0;
1292 } else {
1293 var41 = var_node->type->type_table[cltype42] == idtype43;
1294 }
1295 if (unlikely(!var41)) {
1296 var_class_name44 = var_node == NULL ? "null" : var_node->type->name;
1297 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "E", var_class_name44);
1298 PRINT_ERROR(" (%s:%d)\n", FILE_core__array, 988);
1299 fatal_exit(1);
1300 }
1301 ((struct instance_core__NativeArray*)var_new_array)->values[var_index]=var_node;
1302 RET_LABEL40:(void)0;
1303 }
1304 }
1305 var_node->attrs[COLOR_core__hash_collection__HashNode___prev_in_bucklet].val = ((val*)NULL); /* _prev_in_bucklet on <var_node:nullable HashNode[nullable Object](HashNode[nullable Object])> */
1306 var_node->attrs[COLOR_core__hash_collection__HashNode___next_in_bucklet].val = var_next; /* _next_in_bucklet on <var_node:nullable HashNode[nullable Object](HashNode[nullable Object])> */
1307 if (var_next == NULL) {
1308 var45 = 0; /* is null */
1309 } else {
1310 var45 = 1; /* arg is null and recv is not */
1311 }
1312 if (0) {
1313 { /* Inline kernel#Object#!= (var_next,((val*)NULL)) on <var_next:nullable HashNode[nullable Object]> */
1314 var_other = ((val*)NULL);
1315 {
1316 var48 = ((short int(*)(val* self, val* p0))(var_next->class->vft[COLOR_core__kernel__Object___61d_61d]))(var_next, var_other); /* == on <var_next:nullable HashNode[nullable Object](HashNode[nullable Object])>*/
1317 }
1318 var49 = !var48;
1319 var46 = var49;
1320 goto RET_LABEL47;
1321 RET_LABEL47:(void)0;
1322 }
1323 var45 = var46;
1324 }
1325 if (var45){
1326 var_next->attrs[COLOR_core__hash_collection__HashNode___prev_in_bucklet].val = var_node; /* _prev_in_bucklet on <var_next:nullable HashNode[nullable Object](HashNode[nullable Object])> */
1327 } else {
1328 }
1329 var50 = var_node->attrs[COLOR_core__hash_collection__HashNode___next_item].val; /* _next_item on <var_node:nullable HashNode[nullable Object](HashNode[nullable Object])> */
1330 /* <var50:nullable HashNode[nullable Object]> isa nullable N */
1331 type_struct54 = self->type->resolution_table->types[COLOR_nullable__core__hash_collection__HashCollection__N];
1332 cltype52 = type_struct54->color;
1333 idtype53 = type_struct54->id;
1334 if(var50 == NULL) {
1335 var51 = 1;
1336 } else {
1337 if(cltype52 >= var50->type->table_size) {
1338 var51 = 0;
1339 } else {
1340 var51 = var50->type->type_table[cltype52] == idtype53;
1341 }
1342 }
1343 if (unlikely(!var51)) {
1344 var_class_name55 = var50 == NULL ? "null" : var50->type->name;
1345 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "nullable N", var_class_name55);
1346 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 193);
1347 fatal_exit(1);
1348 }
1349 var_node = var50;
1350 } else {
1351 goto BREAK_label;
1352 }
1353 }
1354 BREAK_label: (void)0;
1355 RET_LABEL:;
1356 }
1357 /* method hash_collection#HashNode#key= for (self: HashNode[nullable Object], nullable Object) */
1358 void core__hash_collection___core__hash_collection__HashNode___key_61d(val* self, val* p0) {
1359 short int var /* : Bool */;
1360 int cltype;
1361 int idtype;
1362 const struct type* type_struct;
1363 short int is_nullable;
1364 const char* var_class_name;
1365 /* Covariant cast for argument 0 (key) <p0:nullable Object> isa K */
1366 /* <p0:nullable Object> isa K */
1367 type_struct = self->type->resolution_table->types[COLOR_core__hash_collection__HashNode___35dK];
1368 cltype = type_struct->color;
1369 idtype = type_struct->id;
1370 is_nullable = type_struct->is_nullable;
1371 if(p0 == NULL) {
1372 var = is_nullable;
1373 } else {
1374 if(cltype >= (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->table_size) {
1375 var = 0;
1376 } else {
1377 var = (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->type_table[cltype] == idtype;
1378 }
1379 }
1380 if (unlikely(!var)) {
1381 var_class_name = p0 == NULL ? "null" : (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->name;
1382 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "K", var_class_name);
1383 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 199);
1384 fatal_exit(1);
1385 }
1386 self->attrs[COLOR_core__hash_collection__HashNode___key].val = p0; /* _key on <self:HashNode[nullable Object]> */
1387 RET_LABEL:;
1388 }
1389 /* method hash_collection#HashNode#init for (self: HashNode[nullable Object]) */
1390 void core__hash_collection___core__hash_collection__HashNode___core__kernel__Object__init(val* self) {
1391 {
1392 ((void(*)(val* self))(self->class->vft[COLOR_core__hash_collection___core__hash_collection__HashNode___core__kernel__Object__init]))(self); /* init on <self:HashNode[nullable Object]>*/
1393 }
1394 RET_LABEL:;
1395 }
1396 /* method hash_collection#HashMap#[] for (self: HashMap[nullable Object, nullable Object], nullable Object): nullable Object */
1397 val* core___core__HashMap___core__abstract_collection__MapRead___91d_93d(val* self, val* p0) {
1398 val* var /* : nullable Object */;
1399 val* var_key /* var key: nullable Object */;
1400 val* var1 /* : nullable HashNode[nullable Object] */;
1401 val* var_c /* var c: nullable HashMapNode[nullable Object, nullable Object] */;
1402 short int var2 /* : Bool */;
1403 short int var3 /* : Bool */;
1404 val* var_other /* var other: nullable Object */;
1405 short int var5 /* : Bool */;
1406 short int var7 /* : Bool */;
1407 val* var8 /* : nullable Object */;
1408 val* var9 /* : nullable Object */;
1409 var_key = p0;
1410 {
1411 var1 = core__hash_collection___core__hash_collection__HashCollection___node_at(self, var_key);
1412 }
1413 var_c = var1;
1414 if (var_c == NULL) {
1415 var2 = 1; /* is null */
1416 } else {
1417 var2 = 0; /* arg is null but recv is not */
1418 }
1419 if (0) {
1420 { /* Inline kernel#Object#== (var_c,((val*)NULL)) on <var_c:nullable HashMapNode[nullable Object, nullable Object]> */
1421 var_other = ((val*)NULL);
1422 {
1423 { /* Inline kernel#Object#is_same_instance (var_c,var_other) on <var_c:nullable HashMapNode[nullable Object, nullable Object](HashMapNode[nullable Object, nullable Object])> */
1424 var7 = var_c == var_other;
1425 var5 = var7;
1426 goto RET_LABEL6;
1427 RET_LABEL6:(void)0;
1428 }
1429 }
1430 var3 = var5;
1431 goto RET_LABEL4;
1432 RET_LABEL4:(void)0;
1433 }
1434 var2 = var3;
1435 }
1436 if (var2){
1437 {
1438 var8 = ((val*(*)(val* self, val* p0))(self->class->vft[COLOR_core__abstract_collection__MapRead__provide_default_value]))(self, var_key); /* provide_default_value on <self:HashMap[nullable Object, nullable Object]>*/
1439 }
1440 var = var8;
1441 goto RET_LABEL;
1442 } else {
1443 var9 = var_c->attrs[COLOR_core__hash_collection__HashMapNode___value].val; /* _value on <var_c:nullable HashMapNode[nullable Object, nullable Object](HashMapNode[nullable Object, nullable Object])> */
1444 var = var9;
1445 goto RET_LABEL;
1446 }
1447 RET_LABEL:;
1448 return var;
1449 }
1450 /* method hash_collection#HashMap#get_or_null for (self: HashMap[nullable Object, nullable Object], nullable Object): nullable Object */
1451 val* core___core__HashMap___core__abstract_collection__MapRead__get_or_null(val* self, val* p0) {
1452 val* var /* : nullable Object */;
1453 val* var_key /* var key: nullable Object */;
1454 val* var1 /* : nullable HashNode[nullable Object] */;
1455 val* var_c /* var c: nullable HashMapNode[nullable Object, nullable Object] */;
1456 short int var2 /* : Bool */;
1457 short int var3 /* : Bool */;
1458 val* var_other /* var other: nullable Object */;
1459 short int var5 /* : Bool */;
1460 short int var7 /* : Bool */;
1461 val* var8 /* : nullable Object */;
1462 var_key = p0;
1463 {
1464 var1 = core__hash_collection___core__hash_collection__HashCollection___node_at(self, var_key);
1465 }
1466 var_c = var1;
1467 if (var_c == NULL) {
1468 var2 = 1; /* is null */
1469 } else {
1470 var2 = 0; /* arg is null but recv is not */
1471 }
1472 if (0) {
1473 { /* Inline kernel#Object#== (var_c,((val*)NULL)) on <var_c:nullable HashMapNode[nullable Object, nullable Object]> */
1474 var_other = ((val*)NULL);
1475 {
1476 { /* Inline kernel#Object#is_same_instance (var_c,var_other) on <var_c:nullable HashMapNode[nullable Object, nullable Object](HashMapNode[nullable Object, nullable Object])> */
1477 var7 = var_c == var_other;
1478 var5 = var7;
1479 goto RET_LABEL6;
1480 RET_LABEL6:(void)0;
1481 }
1482 }
1483 var3 = var5;
1484 goto RET_LABEL4;
1485 RET_LABEL4:(void)0;
1486 }
1487 var2 = var3;
1488 }
1489 if (var2){
1490 var = ((val*)NULL);
1491 goto RET_LABEL;
1492 } else {
1493 var8 = var_c->attrs[COLOR_core__hash_collection__HashMapNode___value].val; /* _value on <var_c:nullable HashMapNode[nullable Object, nullable Object](HashMapNode[nullable Object, nullable Object])> */
1494 var = var8;
1495 goto RET_LABEL;
1496 }
1497 RET_LABEL:;
1498 return var;
1499 }
1500 /* method hash_collection#HashMap#iterator for (self: HashMap[nullable Object, nullable Object]): MapIterator[nullable Object, nullable Object] */
1501 val* core___core__HashMap___core__abstract_collection__MapRead__iterator(val* self) {
1502 val* var /* : MapIterator[nullable Object, nullable Object] */;
1503 val* var1 /* : HashMapIterator[nullable Object, nullable Object] */;
1504 var1 = NEW_core__hash_collection__HashMapIterator(self->type->resolution_table->types[COLOR_core__hash_collection__HashMapIterator__core__HashMap___35dK__core__HashMap___35dV]);
1505 {
1506 ((void(*)(val* self, val* p0))(var1->class->vft[COLOR_core__hash_collection__HashMapIterator__map_61d]))(var1, self); /* map= on <var1:HashMapIterator[nullable Object, nullable Object]>*/
1507 }
1508 {
1509 ((void(*)(val* self))(var1->class->vft[COLOR_core__kernel__Object__init]))(var1); /* init on <var1:HashMapIterator[nullable Object, nullable Object]>*/
1510 }
1511 var = var1;
1512 goto RET_LABEL;
1513 RET_LABEL:;
1514 return var;
1515 }
1516 /* method hash_collection#HashMap#length for (self: HashMap[nullable Object, nullable Object]): Int */
1517 long core___core__HashMap___core__abstract_collection__MapRead__length(val* self) {
1518 long var /* : Int */;
1519 long var1 /* : Int */;
1520 var1 = self->attrs[COLOR_core__hash_collection__HashCollection___the_length].l; /* _the_length on <self:HashMap[nullable Object, nullable Object]> */
1521 var = var1;
1522 goto RET_LABEL;
1523 RET_LABEL:;
1524 return var;
1525 }
1526 /* method hash_collection#HashMap#is_empty for (self: HashMap[nullable Object, nullable Object]): Bool */
1527 short int core___core__HashMap___core__abstract_collection__MapRead__is_empty(val* self) {
1528 short int var /* : Bool */;
1529 long var1 /* : Int */;
1530 short int var2 /* : Bool */;
1531 short int var4 /* : Bool */;
1532 var1 = self->attrs[COLOR_core__hash_collection__HashCollection___the_length].l; /* _the_length on <self:HashMap[nullable Object, nullable Object]> */
1533 {
1534 { /* Inline kernel#Int#== (var1,0l) on <var1:Int> */
1535 var4 = var1 == 0l;
1536 var2 = var4;
1537 goto RET_LABEL3;
1538 RET_LABEL3:(void)0;
1539 }
1540 }
1541 var = var2;
1542 goto RET_LABEL;
1543 RET_LABEL:;
1544 return var;
1545 }
1546 /* method hash_collection#HashMap#[]= for (self: HashMap[nullable Object, nullable Object], nullable Object, nullable Object) */
1547 void core___core__HashMap___core__abstract_collection__Map___91d_93d_61d(val* self, val* p0, val* p1) {
1548 short int var /* : Bool */;
1549 int cltype;
1550 int idtype;
1551 const struct type* type_struct;
1552 short int is_nullable;
1553 const char* var_class_name;
1554 short int var1 /* : Bool */;
1555 int cltype2;
1556 int idtype3;
1557 const struct type* type_struct4;
1558 short int is_nullable5;
1559 const char* var_class_name6;
1560 val* var_key /* var key: nullable Object */;
1561 val* var_v /* var v: nullable Object */;
1562 long var7 /* : Int */;
1563 short int var8 /* : Bool */;
1564 short int var10 /* : Bool */;
1565 long var11 /* : Int */;
1566 long var_i /* var i: Int */;
1567 val* var12 /* : nullable HashNode[nullable Object] */;
1568 val* var_c /* var c: nullable HashMapNode[nullable Object, nullable Object] */;
1569 short int var13 /* : Bool */;
1570 short int var14 /* : Bool */;
1571 val* var_other /* var other: nullable Object */;
1572 short int var16 /* : Bool */;
1573 short int var17 /* : Bool */;
1574 val* var18 /* : HashMapNode[nullable Object, nullable Object] */;
1575 /* Covariant cast for argument 0 (key) <p0:nullable Object> isa K */
1576 /* <p0:nullable Object> isa K */
1577 type_struct = self->type->resolution_table->types[COLOR_core__HashMap___35dK];
1578 cltype = type_struct->color;
1579 idtype = type_struct->id;
1580 is_nullable = type_struct->is_nullable;
1581 if(p0 == NULL) {
1582 var = is_nullable;
1583 } else {
1584 if(cltype >= (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->table_size) {
1585 var = 0;
1586 } else {
1587 var = (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->type_table[cltype] == idtype;
1588 }
1589 }
1590 if (unlikely(!var)) {
1591 var_class_name = p0 == NULL ? "null" : (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->name;
1592 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "K", var_class_name);
1593 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 252);
1594 fatal_exit(1);
1595 }
1596 /* Covariant cast for argument 1 (v) <p1:nullable Object> isa V */
1597 /* <p1:nullable Object> isa V */
1598 type_struct4 = self->type->resolution_table->types[COLOR_core__HashMap___35dV];
1599 cltype2 = type_struct4->color;
1600 idtype3 = type_struct4->id;
1601 is_nullable5 = type_struct4->is_nullable;
1602 if(p1 == NULL) {
1603 var1 = is_nullable5;
1604 } else {
1605 if(cltype2 >= (((long)p1&3)?type_info[((long)p1&3)]:p1->type)->table_size) {
1606 var1 = 0;
1607 } else {
1608 var1 = (((long)p1&3)?type_info[((long)p1&3)]:p1->type)->type_table[cltype2] == idtype3;
1609 }
1610 }
1611 if (unlikely(!var1)) {
1612 var_class_name6 = p1 == NULL ? "null" : (((long)p1&3)?type_info[((long)p1&3)]:p1->type)->name;
1613 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "V", var_class_name6);
1614 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 252);
1615 fatal_exit(1);
1616 }
1617 var_key = p0;
1618 var_v = p1;
1619 var7 = self->attrs[COLOR_core__hash_collection__HashCollection___capacity].l; /* _capacity on <self:HashMap[nullable Object, nullable Object]> */
1620 {
1621 { /* Inline kernel#Int#== (var7,0l) on <var7:Int> */
1622 var10 = var7 == 0l;
1623 var8 = var10;
1624 goto RET_LABEL9;
1625 RET_LABEL9:(void)0;
1626 }
1627 }
1628 if (var8){
1629 {
1630 core__hash_collection___core__hash_collection__HashCollection___enlarge(self, 17l); /* Direct call hash_collection#HashCollection#enlarge on <self:HashMap[nullable Object, nullable Object]>*/
1631 }
1632 } else {
1633 }
1634 {
1635 var11 = core__hash_collection___core__hash_collection__HashCollection___index_at(self, var_key);
1636 }
1637 var_i = var11;
1638 {
1639 var12 = core__hash_collection___core__hash_collection__HashCollection___node_at_idx(self, var_i, var_key);
1640 }
1641 var_c = var12;
1642 if (var_c == NULL) {
1643 var13 = 0; /* is null */
1644 } else {
1645 var13 = 1; /* arg is null and recv is not */
1646 }
1647 if (0) {
1648 { /* Inline kernel#Object#!= (var_c,((val*)NULL)) on <var_c:nullable HashMapNode[nullable Object, nullable Object]> */
1649 var_other = ((val*)NULL);
1650 {
1651 var16 = ((short int(*)(val* self, val* p0))(var_c->class->vft[COLOR_core__kernel__Object___61d_61d]))(var_c, var_other); /* == on <var_c:nullable HashMapNode[nullable Object, nullable Object](HashMapNode[nullable Object, nullable Object])>*/
1652 }
1653 var17 = !var16;
1654 var14 = var17;
1655 goto RET_LABEL15;
1656 RET_LABEL15:(void)0;
1657 }
1658 var13 = var14;
1659 }
1660 if (var13){
1661 var_c->attrs[COLOR_core__hash_collection__HashNode___key].val = var_key; /* _key on <var_c:nullable HashMapNode[nullable Object, nullable Object](HashMapNode[nullable Object, nullable Object])> */
1662 var_c->attrs[COLOR_core__hash_collection__HashMapNode___value].val = var_v; /* _value on <var_c:nullable HashMapNode[nullable Object, nullable Object](HashMapNode[nullable Object, nullable Object])> */
1663 } else {
1664 var18 = NEW_core__hash_collection__HashMapNode(self->type->resolution_table->types[COLOR_core__hash_collection__HashMapNode__core__HashMap___35dK__core__HashMap___35dV]);
1665 {
1666 ((void(*)(val* self, val* p0))(var18->class->vft[COLOR_core__hash_collection__HashNode__key_61d]))(var18, var_key); /* key= on <var18:HashMapNode[nullable Object, nullable Object]>*/
1667 }
1668 {
1669 ((void(*)(val* self, val* p0))(var18->class->vft[COLOR_core__hash_collection__HashMapNode__value_61d]))(var18, var_v); /* value= on <var18:HashMapNode[nullable Object, nullable Object]>*/
1670 }
1671 {
1672 ((void(*)(val* self))(var18->class->vft[COLOR_core__kernel__Object__init]))(var18); /* init on <var18:HashMapNode[nullable Object, nullable Object]>*/
1673 }
1674 {
1675 core__hash_collection___core__hash_collection__HashCollection___store(self, var_i, var18); /* Direct call hash_collection#HashCollection#store on <self:HashMap[nullable Object, nullable Object]>*/
1676 }
1677 }
1678 RET_LABEL:;
1679 }
1680 /* method hash_collection#HashMap#clear for (self: HashMap[nullable Object, nullable Object]) */
1681 void core___core__HashMap___core__abstract_collection__Map__clear(val* self) {
1682 {
1683 core__hash_collection___core__hash_collection__HashCollection___raz(self); /* Direct call hash_collection#HashCollection#raz on <self:HashMap[nullable Object, nullable Object]>*/
1684 }
1685 RET_LABEL:;
1686 }
1687 /* method hash_collection#HashMap#init for (self: HashMap[nullable Object, nullable Object]) */
1688 void core___core__HashMap___core__kernel__Object__init(val* self) {
1689 {
1690 ((void(*)(val* self))(self->class->vft[COLOR_core___core__HashMap___core__kernel__Object__init]))(self); /* init on <self:HashMap[nullable Object, nullable Object]>*/
1691 }
1692 self->attrs[COLOR_core__hash_collection__HashCollection___capacity].l = 0l; /* _capacity on <self:HashMap[nullable Object, nullable Object]> */
1693 self->attrs[COLOR_core__hash_collection__HashCollection___the_length].l = 0l; /* _the_length on <self:HashMap[nullable Object, nullable Object]> */
1694 RET_LABEL:;
1695 }
1696 /* method hash_collection#HashMap#keys for (self: HashMap[nullable Object, nullable Object]): RemovableCollection[nullable Object] */
1697 val* core___core__HashMap___core__abstract_collection__MapRead__keys(val* self) {
1698 val* var /* : RemovableCollection[nullable Object] */;
1699 short int var1 /* : Bool */;
1700 val* var2 /* : RemovableCollection[nullable Object] */;
1701 val* var3 /* : HashMapKeys[nullable Object, nullable Object] */;
1702 var1 = self->attrs[COLOR_core__hash_collection__HashMap___keys].val != NULL; /* _keys on <self:HashMap[nullable Object, nullable Object]> */
1703 if(likely(var1)) {
1704 var2 = self->attrs[COLOR_core__hash_collection__HashMap___keys].val; /* _keys on <self:HashMap[nullable Object, nullable Object]> */
1705 if (unlikely(var2 == NULL)) {
1706 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _keys");
1707 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 279);
1708 fatal_exit(1);
1709 }
1710 } else {
1711 var3 = NEW_core__hash_collection__HashMapKeys(self->type->resolution_table->types[COLOR_core__hash_collection__HashMapKeys__core__HashMap___35dK__core__HashMap___35dV]);
1712 {
1713 ((void(*)(val* self, val* p0))(var3->class->vft[COLOR_core__hash_collection__HashMapKeys__map_61d]))(var3, self); /* map= on <var3:HashMapKeys[nullable Object, nullable Object]>*/
1714 }
1715 {
1716 ((void(*)(val* self))(var3->class->vft[COLOR_core__kernel__Object__init]))(var3); /* init on <var3:HashMapKeys[nullable Object, nullable Object]>*/
1717 }
1718 self->attrs[COLOR_core__hash_collection__HashMap___keys].val = var3; /* _keys on <self:HashMap[nullable Object, nullable Object]> */
1719 var2 = var3;
1720 }
1721 var = var2;
1722 RET_LABEL:;
1723 return var;
1724 }
1725 /* method hash_collection#HashMap#values for (self: HashMap[nullable Object, nullable Object]): RemovableCollection[nullable Object] */
1726 val* core___core__HashMap___core__abstract_collection__MapRead__values(val* self) {
1727 val* var /* : RemovableCollection[nullable Object] */;
1728 short int var1 /* : Bool */;
1729 val* var2 /* : RemovableCollection[nullable Object] */;
1730 val* var3 /* : HashMapValues[nullable Object, nullable Object] */;
1731 var1 = self->attrs[COLOR_core__hash_collection__HashMap___values].val != NULL; /* _values on <self:HashMap[nullable Object, nullable Object]> */
1732 if(likely(var1)) {
1733 var2 = self->attrs[COLOR_core__hash_collection__HashMap___values].val; /* _values on <self:HashMap[nullable Object, nullable Object]> */
1734 if (unlikely(var2 == NULL)) {
1735 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _values");
1736 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 280);
1737 fatal_exit(1);
1738 }
1739 } else {
1740 var3 = NEW_core__hash_collection__HashMapValues(self->type->resolution_table->types[COLOR_core__hash_collection__HashMapValues__core__HashMap___35dK__core__HashMap___35dV]);
1741 {
1742 ((void(*)(val* self, val* p0))(var3->class->vft[COLOR_core__hash_collection__HashMapValues__map_61d]))(var3, self); /* map= on <var3:HashMapValues[nullable Object, nullable Object]>*/
1743 }
1744 {
1745 ((void(*)(val* self))(var3->class->vft[COLOR_core__kernel__Object__init]))(var3); /* init on <var3:HashMapValues[nullable Object, nullable Object]>*/
1746 }
1747 self->attrs[COLOR_core__hash_collection__HashMap___values].val = var3; /* _values on <self:HashMap[nullable Object, nullable Object]> */
1748 var2 = var3;
1749 }
1750 var = var2;
1751 RET_LABEL:;
1752 return var;
1753 }
1754 /* method hash_collection#HashMap#has_key for (self: HashMap[nullable Object, nullable Object], nullable Object): Bool */
1755 short int core___core__HashMap___core__abstract_collection__MapRead__has_key(val* self, val* p0) {
1756 short int var /* : Bool */;
1757 val* var_k /* var k: nullable Object */;
1758 val* var1 /* : nullable HashNode[nullable Object] */;
1759 short int var2 /* : Bool */;
1760 short int var3 /* : Bool */;
1761 val* var_other /* var other: nullable Object */;
1762 short int var5 /* : Bool */;
1763 short int var6 /* : Bool */;
1764 var_k = p0;
1765 {
1766 var1 = core__hash_collection___core__hash_collection__HashCollection___node_at(self, var_k);
1767 }
1768 if (var1 == NULL) {
1769 var2 = 0; /* is null */
1770 } else {
1771 var2 = 1; /* arg is null and recv is not */
1772 }
1773 if (0) {
1774 { /* Inline kernel#Object#!= (var1,((val*)NULL)) on <var1:nullable HashNode[nullable Object](nullable HashMapNode[nullable Object, nullable Object])> */
1775 var_other = ((val*)NULL);
1776 {
1777 var5 = ((short int(*)(val* self, val* p0))(var1->class->vft[COLOR_core__kernel__Object___61d_61d]))(var1, var_other); /* == on <var1:nullable HashMapNode[nullable Object, nullable Object](HashMapNode[nullable Object, nullable Object])>*/
1778 }
1779 var6 = !var5;
1780 var3 = var6;
1781 goto RET_LABEL4;
1782 RET_LABEL4:(void)0;
1783 }
1784 var2 = var3;
1785 }
1786 var = var2;
1787 goto RET_LABEL;
1788 RET_LABEL:;
1789 return var;
1790 }
1791 /* method hash_collection#HashMapKeys#map for (self: HashMapKeys[nullable Object, nullable Object]): HashMap[nullable Object, nullable Object] */
1792 val* core__hash_collection___core__hash_collection__HashMapKeys___map(val* self) {
1793 val* var /* : HashMap[nullable Object, nullable Object] */;
1794 val* var1 /* : HashMap[nullable Object, nullable Object] */;
1795 var1 = self->attrs[COLOR_core__hash_collection__HashMapKeys___map].val; /* _map on <self:HashMapKeys[nullable Object, nullable Object]> */
1796 if (unlikely(var1 == NULL)) {
1797 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _map");
1798 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 287);
1799 fatal_exit(1);
1800 }
1801 var = var1;
1802 RET_LABEL:;
1803 return var;
1804 }
1805 /* method hash_collection#HashMapKeys#map= for (self: HashMapKeys[nullable Object, nullable Object], HashMap[nullable Object, nullable Object]) */
1806 void core__hash_collection___core__hash_collection__HashMapKeys___map_61d(val* self, val* p0) {
1807 short int var /* : Bool */;
1808 int cltype;
1809 int idtype;
1810 const struct type* type_struct;
1811 const char* var_class_name;
1812 /* Covariant cast for argument 0 (map) <p0:HashMap[nullable Object, nullable Object]> isa HashMap[K, V] */
1813 /* <p0:HashMap[nullable Object, nullable Object]> isa HashMap[K, V] */
1814 type_struct = self->type->resolution_table->types[COLOR_core__HashMap__core__hash_collection__HashMapKeys___35dK__core__hash_collection__HashMapKeys___35dV];
1815 cltype = type_struct->color;
1816 idtype = type_struct->id;
1817 if(cltype >= p0->type->table_size) {
1818 var = 0;
1819 } else {
1820 var = p0->type->type_table[cltype] == idtype;
1821 }
1822 if (unlikely(!var)) {
1823 var_class_name = p0 == NULL ? "null" : p0->type->name;
1824 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap[K, V]", var_class_name);
1825 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 287);
1826 fatal_exit(1);
1827 }
1828 self->attrs[COLOR_core__hash_collection__HashMapKeys___map].val = p0; /* _map on <self:HashMapKeys[nullable Object, nullable Object]> */
1829 RET_LABEL:;
1830 }
1831 /* method hash_collection#HashMapKeys#first for (self: HashMapKeys[nullable Object, nullable Object]): nullable Object */
1832 val* core__hash_collection___core__hash_collection__HashMapKeys___core__abstract_collection__Collection__first(val* self) {
1833 val* var /* : nullable Object */;
1834 val* var1 /* : HashMap[nullable Object, nullable Object] */;
1835 val* var3 /* : HashMap[nullable Object, nullable Object] */;
1836 val* var4 /* : nullable HashNode[nullable Object] */;
1837 val* var5 /* : nullable Object */;
1838 {
1839 { /* Inline hash_collection#HashMapKeys#map (self) on <self:HashMapKeys[nullable Object, nullable Object]> */
1840 var3 = self->attrs[COLOR_core__hash_collection__HashMapKeys___map].val; /* _map on <self:HashMapKeys[nullable Object, nullable Object]> */
1841 if (unlikely(var3 == NULL)) {
1842 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _map");
1843 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 287);
1844 fatal_exit(1);
1845 }
1846 var1 = var3;
1847 RET_LABEL2:(void)0;
1848 }
1849 }
1850 var4 = var1->attrs[COLOR_core__hash_collection__HashCollection___first_item].val; /* _first_item on <var1:HashMap[nullable Object, nullable Object]> */
1851 if (unlikely(var4 == NULL)) {
1852 PRINT_ERROR("Runtime error: %s", "Receiver is null");
1853 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 291);
1854 fatal_exit(1);
1855 }
1856 var5 = var4->attrs[COLOR_core__hash_collection__HashNode___key].val; /* _key on <var4:nullable HashNode[nullable Object](nullable HashMapNode[nullable Object, nullable Object])> */
1857 var = var5;
1858 goto RET_LABEL;
1859 RET_LABEL:;
1860 return var;
1861 }
1862 /* method hash_collection#HashMapKeys#has for (self: HashMapKeys[nullable Object, nullable Object], nullable Object): Bool */
1863 short int core__hash_collection___core__hash_collection__HashMapKeys___core__abstract_collection__Collection__has(val* self, val* p0) {
1864 short int var /* : Bool */;
1865 val* var_k /* var k: nullable Object */;
1866 val* var1 /* : HashMap[nullable Object, nullable Object] */;
1867 val* var3 /* : HashMap[nullable Object, nullable Object] */;
1868 val* var4 /* : nullable HashNode[nullable Object] */;
1869 short int var5 /* : Bool */;
1870 short int var6 /* : Bool */;
1871 val* var_other /* var other: nullable Object */;
1872 short int var8 /* : Bool */;
1873 short int var9 /* : Bool */;
1874 var_k = p0;
1875 {
1876 { /* Inline hash_collection#HashMapKeys#map (self) on <self:HashMapKeys[nullable Object, nullable Object]> */
1877 var3 = self->attrs[COLOR_core__hash_collection__HashMapKeys___map].val; /* _map on <self:HashMapKeys[nullable Object, nullable Object]> */
1878 if (unlikely(var3 == NULL)) {
1879 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _map");
1880 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 287);
1881 fatal_exit(1);
1882 }
1883 var1 = var3;
1884 RET_LABEL2:(void)0;
1885 }
1886 }
1887 {
1888 var4 = core__hash_collection___core__hash_collection__HashCollection___node_at(var1, var_k);
1889 }
1890 if (var4 == NULL) {
1891 var5 = 0; /* is null */
1892 } else {
1893 var5 = 1; /* arg is null and recv is not */
1894 }
1895 if (0) {
1896 { /* Inline kernel#Object#!= (var4,((val*)NULL)) on <var4:nullable HashNode[nullable Object](nullable HashMapNode[nullable Object, nullable Object])> */
1897 var_other = ((val*)NULL);
1898 {
1899 var8 = ((short int(*)(val* self, val* p0))(var4->class->vft[COLOR_core__kernel__Object___61d_61d]))(var4, var_other); /* == on <var4:nullable HashMapNode[nullable Object, nullable Object](HashMapNode[nullable Object, nullable Object])>*/
1900 }
1901 var9 = !var8;
1902 var6 = var9;
1903 goto RET_LABEL7;
1904 RET_LABEL7:(void)0;
1905 }
1906 var5 = var6;
1907 }
1908 var = var5;
1909 goto RET_LABEL;
1910 RET_LABEL:;
1911 return var;
1912 }
1913 /* method hash_collection#HashMapKeys#is_empty for (self: HashMapKeys[nullable Object, nullable Object]): Bool */
1914 short int core__hash_collection___core__hash_collection__HashMapKeys___core__abstract_collection__Collection__is_empty(val* self) {
1915 short int var /* : Bool */;
1916 val* var1 /* : HashMap[nullable Object, nullable Object] */;
1917 val* var3 /* : HashMap[nullable Object, nullable Object] */;
1918 short int var4 /* : Bool */;
1919 {
1920 { /* Inline hash_collection#HashMapKeys#map (self) on <self:HashMapKeys[nullable Object, nullable Object]> */
1921 var3 = self->attrs[COLOR_core__hash_collection__HashMapKeys___map].val; /* _map on <self:HashMapKeys[nullable Object, nullable Object]> */
1922 if (unlikely(var3 == NULL)) {
1923 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _map");
1924 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 287);
1925 fatal_exit(1);
1926 }
1927 var1 = var3;
1928 RET_LABEL2:(void)0;
1929 }
1930 }
1931 {
1932 var4 = core___core__HashMap___core__abstract_collection__MapRead__is_empty(var1);
1933 }
1934 var = var4;
1935 goto RET_LABEL;
1936 RET_LABEL:;
1937 return var;
1938 }
1939 /* method hash_collection#HashMapKeys#length for (self: HashMapKeys[nullable Object, nullable Object]): Int */
1940 long core__hash_collection___core__hash_collection__HashMapKeys___core__abstract_collection__Collection__length(val* self) {
1941 long var /* : Int */;
1942 val* var1 /* : HashMap[nullable Object, nullable Object] */;
1943 val* var3 /* : HashMap[nullable Object, nullable Object] */;
1944 long var4 /* : Int */;
1945 {
1946 { /* Inline hash_collection#HashMapKeys#map (self) on <self:HashMapKeys[nullable Object, nullable Object]> */
1947 var3 = self->attrs[COLOR_core__hash_collection__HashMapKeys___map].val; /* _map on <self:HashMapKeys[nullable Object, nullable Object]> */
1948 if (unlikely(var3 == NULL)) {
1949 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _map");
1950 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 287);
1951 fatal_exit(1);
1952 }
1953 var1 = var3;
1954 RET_LABEL2:(void)0;
1955 }
1956 }
1957 {
1958 var4 = core___core__HashMap___core__abstract_collection__MapRead__length(var1);
1959 }
1960 var = var4;
1961 goto RET_LABEL;
1962 RET_LABEL:;
1963 return var;
1964 }
1965 /* method hash_collection#HashMapKeys#iterator for (self: HashMapKeys[nullable Object, nullable Object]): Iterator[nullable Object] */
1966 val* core__hash_collection___core__hash_collection__HashMapKeys___core__abstract_collection__Collection__iterator(val* self) {
1967 val* var /* : Iterator[nullable Object] */;
1968 val* var1 /* : MapKeysIterator[nullable Object, nullable Object] */;
1969 val* var2 /* : HashMap[nullable Object, nullable Object] */;
1970 val* var4 /* : HashMap[nullable Object, nullable Object] */;
1971 val* var5 /* : MapIterator[nullable Object, nullable Object] */;
1972 var1 = NEW_core__MapKeysIterator(self->type->resolution_table->types[COLOR_core__MapKeysIterator__core__hash_collection__HashMapKeys___35dK__core__hash_collection__HashMapKeys___35dV]);
1973 {
1974 { /* Inline hash_collection#HashMapKeys#map (self) on <self:HashMapKeys[nullable Object, nullable Object]> */
1975 var4 = self->attrs[COLOR_core__hash_collection__HashMapKeys___map].val; /* _map on <self:HashMapKeys[nullable Object, nullable Object]> */
1976 if (unlikely(var4 == NULL)) {
1977 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _map");
1978 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 287);
1979 fatal_exit(1);
1980 }
1981 var2 = var4;
1982 RET_LABEL3:(void)0;
1983 }
1984 }
1985 {
1986 var5 = core___core__HashMap___core__abstract_collection__MapRead__iterator(var2);
1987 }
1988 {
1989 ((void(*)(val* self, val* p0))(var1->class->vft[COLOR_core__abstract_collection__MapKeysIterator__original_iterator_61d]))(var1, var5); /* original_iterator= on <var1:MapKeysIterator[nullable Object, nullable Object]>*/
1990 }
1991 {
1992 ((void(*)(val* self))(var1->class->vft[COLOR_core__kernel__Object__init]))(var1); /* init on <var1:MapKeysIterator[nullable Object, nullable Object]>*/
1993 }
1994 var = var1;
1995 goto RET_LABEL;
1996 RET_LABEL:;
1997 return var;
1998 }
1999 /* method hash_collection#HashMapKeys#clear for (self: HashMapKeys[nullable Object, nullable Object]) */
2000 void core__hash_collection___core__hash_collection__HashMapKeys___core__abstract_collection__RemovableCollection__clear(val* self) {
2001 val* var /* : HashMap[nullable Object, nullable Object] */;
2002 val* var2 /* : HashMap[nullable Object, nullable Object] */;
2003 {
2004 { /* Inline hash_collection#HashMapKeys#map (self) on <self:HashMapKeys[nullable Object, nullable Object]> */
2005 var2 = self->attrs[COLOR_core__hash_collection__HashMapKeys___map].val; /* _map on <self:HashMapKeys[nullable Object, nullable Object]> */
2006 if (unlikely(var2 == NULL)) {
2007 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _map");
2008 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 287);
2009 fatal_exit(1);
2010 }
2011 var = var2;
2012 RET_LABEL1:(void)0;
2013 }
2014 }
2015 {
2016 core___core__HashMap___core__abstract_collection__Map__clear(var); /* Direct call hash_collection#HashMap#clear on <var:HashMap[nullable Object, nullable Object]>*/
2017 }
2018 RET_LABEL:;
2019 }
2020 /* method hash_collection#HashMapKeys#remove for (self: HashMapKeys[nullable Object, nullable Object], nullable Object) */
2021 void core__hash_collection___core__hash_collection__HashMapKeys___core__abstract_collection__RemovableCollection__remove(val* self, val* p0) {
2022 val* var_key /* var key: nullable Object */;
2023 val* var /* : HashMap[nullable Object, nullable Object] */;
2024 val* var2 /* : HashMap[nullable Object, nullable Object] */;
2025 var_key = p0;
2026 {
2027 { /* Inline hash_collection#HashMapKeys#map (self) on <self:HashMapKeys[nullable Object, nullable Object]> */
2028 var2 = self->attrs[COLOR_core__hash_collection__HashMapKeys___map].val; /* _map on <self:HashMapKeys[nullable Object, nullable Object]> */
2029 if (unlikely(var2 == NULL)) {
2030 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _map");
2031 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 287);
2032 fatal_exit(1);
2033 }
2034 var = var2;
2035 RET_LABEL1:(void)0;
2036 }
2037 }
2038 {
2039 core__hash_collection___core__hash_collection__HashCollection___remove_node(var, var_key); /* Direct call hash_collection#HashCollection#remove_node on <var:HashMap[nullable Object, nullable Object]>*/
2040 }
2041 RET_LABEL:;
2042 }
2043 /* method hash_collection#HashMapKeys#init for (self: HashMapKeys[nullable Object, nullable Object]) */
2044 void core__hash_collection___core__hash_collection__HashMapKeys___core__kernel__Object__init(val* self) {
2045 {
2046 ((void(*)(val* self))(self->class->vft[COLOR_core__hash_collection___core__hash_collection__HashMapKeys___core__kernel__Object__init]))(self); /* init on <self:HashMapKeys[nullable Object, nullable Object]>*/
2047 }
2048 RET_LABEL:;
2049 }
2050 /* method hash_collection#HashMapValues#map for (self: HashMapValues[nullable Object, nullable Object]): HashMap[nullable Object, nullable Object] */
2051 val* core__hash_collection___core__hash_collection__HashMapValues___map(val* self) {
2052 val* var /* : HashMap[nullable Object, nullable Object] */;
2053 val* var1 /* : HashMap[nullable Object, nullable Object] */;
2054 var1 = self->attrs[COLOR_core__hash_collection__HashMapValues___map].val; /* _map on <self:HashMapValues[nullable Object, nullable Object]> */
2055 if (unlikely(var1 == NULL)) {
2056 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _map");
2057 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 308);
2058 fatal_exit(1);
2059 }
2060 var = var1;
2061 RET_LABEL:;
2062 return var;
2063 }
2064 /* method hash_collection#HashMapValues#map= for (self: HashMapValues[nullable Object, nullable Object], HashMap[nullable Object, nullable Object]) */
2065 void core__hash_collection___core__hash_collection__HashMapValues___map_61d(val* self, val* p0) {
2066 short int var /* : Bool */;
2067 int cltype;
2068 int idtype;
2069 const struct type* type_struct;
2070 const char* var_class_name;
2071 /* Covariant cast for argument 0 (map) <p0:HashMap[nullable Object, nullable Object]> isa HashMap[K, V] */
2072 /* <p0:HashMap[nullable Object, nullable Object]> isa HashMap[K, V] */
2073 type_struct = self->type->resolution_table->types[COLOR_core__HashMap__core__hash_collection__HashMapValues___35dK__core__hash_collection__HashMapValues___35dV];
2074 cltype = type_struct->color;
2075 idtype = type_struct->id;
2076 if(cltype >= p0->type->table_size) {
2077 var = 0;
2078 } else {
2079 var = p0->type->type_table[cltype] == idtype;
2080 }
2081 if (unlikely(!var)) {
2082 var_class_name = p0 == NULL ? "null" : p0->type->name;
2083 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap[K, V]", var_class_name);
2084 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 308);
2085 fatal_exit(1);
2086 }
2087 self->attrs[COLOR_core__hash_collection__HashMapValues___map].val = p0; /* _map on <self:HashMapValues[nullable Object, nullable Object]> */
2088 RET_LABEL:;
2089 }
2090 /* method hash_collection#HashMapValues#first for (self: HashMapValues[nullable Object, nullable Object]): nullable Object */
2091 val* core__hash_collection___core__hash_collection__HashMapValues___core__abstract_collection__Collection__first(val* self) {
2092 val* var /* : nullable Object */;
2093 val* var1 /* : HashMap[nullable Object, nullable Object] */;
2094 val* var3 /* : HashMap[nullable Object, nullable Object] */;
2095 val* var4 /* : nullable HashNode[nullable Object] */;
2096 val* var5 /* : nullable Object */;
2097 {
2098 { /* Inline hash_collection#HashMapValues#map (self) on <self:HashMapValues[nullable Object, nullable Object]> */
2099 var3 = self->attrs[COLOR_core__hash_collection__HashMapValues___map].val; /* _map on <self:HashMapValues[nullable Object, nullable Object]> */
2100 if (unlikely(var3 == NULL)) {
2101 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _map");
2102 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 308);
2103 fatal_exit(1);
2104 }
2105 var1 = var3;
2106 RET_LABEL2:(void)0;
2107 }
2108 }
2109 var4 = var1->attrs[COLOR_core__hash_collection__HashCollection___first_item].val; /* _first_item on <var1:HashMap[nullable Object, nullable Object]> */
2110 if (unlikely(var4 == NULL)) {
2111 PRINT_ERROR("Runtime error: %s", "Receiver is null");
2112 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 321);
2113 fatal_exit(1);
2114 }
2115 var5 = var4->attrs[COLOR_core__hash_collection__HashMapNode___value].val; /* _value on <var4:nullable HashNode[nullable Object](nullable HashMapNode[nullable Object, nullable Object])> */
2116 var = var5;
2117 goto RET_LABEL;
2118 RET_LABEL:;
2119 return var;
2120 }
2121 /* method hash_collection#HashMapValues#has for (self: HashMapValues[nullable Object, nullable Object], nullable Object): Bool */
2122 short int core__hash_collection___core__hash_collection__HashMapValues___core__abstract_collection__Collection__has(val* self, val* p0) {
2123 short int var /* : Bool */;
2124 val* var_item /* var item: nullable Object */;
2125 val* var1 /* : HashMap[nullable Object, nullable Object] */;
2126 val* var3 /* : HashMap[nullable Object, nullable Object] */;
2127 val* var4 /* : nullable HashNode[nullable Object] */;
2128 val* var_c /* var c: nullable HashMapNode[nullable Object, nullable Object] */;
2129 short int var5 /* : Bool */;
2130 short int var6 /* : Bool */;
2131 val* var_other /* var other: nullable Object */;
2132 short int var8 /* : Bool */;
2133 short int var9 /* : Bool */;
2134 val* var10 /* : nullable Object */;
2135 short int var11 /* : Bool */;
2136 short int var12 /* : Bool */;
2137 val* var13 /* : nullable HashNode[nullable Object] */;
2138 var_item = p0;
2139 {
2140 { /* Inline hash_collection#HashMapValues#map (self) on <self:HashMapValues[nullable Object, nullable Object]> */
2141 var3 = self->attrs[COLOR_core__hash_collection__HashMapValues___map].val; /* _map on <self:HashMapValues[nullable Object, nullable Object]> */
2142 if (unlikely(var3 == NULL)) {
2143 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _map");
2144 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 308);
2145 fatal_exit(1);
2146 }
2147 var1 = var3;
2148 RET_LABEL2:(void)0;
2149 }
2150 }
2151 var4 = var1->attrs[COLOR_core__hash_collection__HashCollection___first_item].val; /* _first_item on <var1:HashMap[nullable Object, nullable Object]> */
2152 var_c = var4;
2153 for(;;) {
2154 if (var_c == NULL) {
2155 var5 = 0; /* is null */
2156 } else {
2157 var5 = 1; /* arg is null and recv is not */
2158 }
2159 if (0) {
2160 { /* Inline kernel#Object#!= (var_c,((val*)NULL)) on <var_c:nullable HashMapNode[nullable Object, nullable Object]> */
2161 var_other = ((val*)NULL);
2162 {
2163 var8 = ((short int(*)(val* self, val* p0))(var_c->class->vft[COLOR_core__kernel__Object___61d_61d]))(var_c, var_other); /* == on <var_c:nullable HashMapNode[nullable Object, nullable Object](HashMapNode[nullable Object, nullable Object])>*/
2164 }
2165 var9 = !var8;
2166 var6 = var9;
2167 goto RET_LABEL7;
2168 RET_LABEL7:(void)0;
2169 }
2170 var5 = var6;
2171 }
2172 if (var5){
2173 var10 = var_c->attrs[COLOR_core__hash_collection__HashMapNode___value].val; /* _value on <var_c:nullable HashMapNode[nullable Object, nullable Object](HashMapNode[nullable Object, nullable Object])> */
2174 if (var10 == NULL) {
2175 var11 = (var_item == NULL);
2176 } else {
2177 var12 = ((short int(*)(val* self, val* p0))((((long)var10&3)?class_info[((long)var10&3)]:var10->class)->vft[COLOR_core__kernel__Object___61d_61d]))(var10, var_item); /* == on <var10:nullable Object>*/
2178 var11 = var12;
2179 }
2180 if (var11){
2181 var = 1;
2182 goto RET_LABEL;
2183 } else {
2184 }
2185 var13 = var_c->attrs[COLOR_core__hash_collection__HashNode___next_item].val; /* _next_item on <var_c:nullable HashMapNode[nullable Object, nullable Object](HashMapNode[nullable Object, nullable Object])> */
2186 var_c = var13;
2187 } else {
2188 goto BREAK_label;
2189 }
2190 }
2191 BREAK_label: (void)0;
2192 var = 0;
2193 goto RET_LABEL;
2194 RET_LABEL:;
2195 return var;
2196 }
2197 /* method hash_collection#HashMapValues#is_empty for (self: HashMapValues[nullable Object, nullable Object]): Bool */
2198 short int core__hash_collection___core__hash_collection__HashMapValues___core__abstract_collection__Collection__is_empty(val* self) {
2199 short int var /* : Bool */;
2200 val* var1 /* : HashMap[nullable Object, nullable Object] */;
2201 val* var3 /* : HashMap[nullable Object, nullable Object] */;
2202 short int var4 /* : Bool */;
2203 {
2204 { /* Inline hash_collection#HashMapValues#map (self) on <self:HashMapValues[nullable Object, nullable Object]> */
2205 var3 = self->attrs[COLOR_core__hash_collection__HashMapValues___map].val; /* _map on <self:HashMapValues[nullable Object, nullable Object]> */
2206 if (unlikely(var3 == NULL)) {
2207 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _map");
2208 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 308);
2209 fatal_exit(1);
2210 }
2211 var1 = var3;
2212 RET_LABEL2:(void)0;
2213 }
2214 }
2215 {
2216 var4 = core___core__HashMap___core__abstract_collection__MapRead__is_empty(var1);
2217 }
2218 var = var4;
2219 goto RET_LABEL;
2220 RET_LABEL:;
2221 return var;
2222 }
2223 /* method hash_collection#HashMapValues#length for (self: HashMapValues[nullable Object, nullable Object]): Int */
2224 long core__hash_collection___core__hash_collection__HashMapValues___core__abstract_collection__Collection__length(val* self) {
2225 long var /* : Int */;
2226 val* var1 /* : HashMap[nullable Object, nullable Object] */;
2227 val* var3 /* : HashMap[nullable Object, nullable Object] */;
2228 long var4 /* : Int */;
2229 {
2230 { /* Inline hash_collection#HashMapValues#map (self) on <self:HashMapValues[nullable Object, nullable Object]> */
2231 var3 = self->attrs[COLOR_core__hash_collection__HashMapValues___map].val; /* _map on <self:HashMapValues[nullable Object, nullable Object]> */
2232 if (unlikely(var3 == NULL)) {
2233 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _map");
2234 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 308);
2235 fatal_exit(1);
2236 }
2237 var1 = var3;
2238 RET_LABEL2:(void)0;
2239 }
2240 }
2241 {
2242 var4 = core___core__HashMap___core__abstract_collection__MapRead__length(var1);
2243 }
2244 var = var4;
2245 goto RET_LABEL;
2246 RET_LABEL:;
2247 return var;
2248 }
2249 /* method hash_collection#HashMapValues#iterator for (self: HashMapValues[nullable Object, nullable Object]): Iterator[nullable Object] */
2250 val* core__hash_collection___core__hash_collection__HashMapValues___core__abstract_collection__Collection__iterator(val* self) {
2251 val* var /* : Iterator[nullable Object] */;
2252 val* var1 /* : MapValuesIterator[nullable Object, nullable Object] */;
2253 val* var2 /* : HashMap[nullable Object, nullable Object] */;
2254 val* var4 /* : HashMap[nullable Object, nullable Object] */;
2255 val* var5 /* : MapIterator[nullable Object, nullable Object] */;
2256 var1 = NEW_core__MapValuesIterator(self->type->resolution_table->types[COLOR_core__MapValuesIterator__core__hash_collection__HashMapValues___35dK__core__hash_collection__HashMapValues___35dV]);
2257 {
2258 { /* Inline hash_collection#HashMapValues#map (self) on <self:HashMapValues[nullable Object, nullable Object]> */
2259 var4 = self->attrs[COLOR_core__hash_collection__HashMapValues___map].val; /* _map on <self:HashMapValues[nullable Object, nullable Object]> */
2260 if (unlikely(var4 == NULL)) {
2261 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _map");
2262 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 308);
2263 fatal_exit(1);
2264 }
2265 var2 = var4;
2266 RET_LABEL3:(void)0;
2267 }
2268 }
2269 {
2270 var5 = core___core__HashMap___core__abstract_collection__MapRead__iterator(var2);
2271 }
2272 {
2273 ((void(*)(val* self, val* p0))(var1->class->vft[COLOR_core__abstract_collection__MapValuesIterator__original_iterator_61d]))(var1, var5); /* original_iterator= on <var1:MapValuesIterator[nullable Object, nullable Object]>*/
2274 }
2275 {
2276 ((void(*)(val* self))(var1->class->vft[COLOR_core__kernel__Object__init]))(var1); /* init on <var1:MapValuesIterator[nullable Object, nullable Object]>*/
2277 }
2278 var = var1;
2279 goto RET_LABEL;
2280 RET_LABEL:;
2281 return var;
2282 }
2283 /* method hash_collection#HashMapValues#clear for (self: HashMapValues[nullable Object, nullable Object]) */
2284 void core__hash_collection___core__hash_collection__HashMapValues___core__abstract_collection__RemovableCollection__clear(val* self) {
2285 val* var /* : HashMap[nullable Object, nullable Object] */;
2286 val* var2 /* : HashMap[nullable Object, nullable Object] */;
2287 {
2288 { /* Inline hash_collection#HashMapValues#map (self) on <self:HashMapValues[nullable Object, nullable Object]> */
2289 var2 = self->attrs[COLOR_core__hash_collection__HashMapValues___map].val; /* _map on <self:HashMapValues[nullable Object, nullable Object]> */
2290 if (unlikely(var2 == NULL)) {
2291 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _map");
2292 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 308);
2293 fatal_exit(1);
2294 }
2295 var = var2;
2296 RET_LABEL1:(void)0;
2297 }
2298 }
2299 {
2300 core___core__HashMap___core__abstract_collection__Map__clear(var); /* Direct call hash_collection#HashMap#clear on <var:HashMap[nullable Object, nullable Object]>*/
2301 }
2302 RET_LABEL:;
2303 }
2304 /* method hash_collection#HashMapValues#remove for (self: HashMapValues[nullable Object, nullable Object], nullable Object) */
2305 void core__hash_collection___core__hash_collection__HashMapValues___core__abstract_collection__RemovableCollection__remove(val* self, val* p0) {
2306 val* var_item /* var item: nullable Object */;
2307 val* var /* : HashMap[nullable Object, nullable Object] */;
2308 val* var2 /* : HashMap[nullable Object, nullable Object] */;
2309 val* var_map /* var map: HashMap[nullable Object, nullable Object] */;
2310 val* var3 /* : nullable HashNode[nullable Object] */;
2311 val* var_c /* var c: nullable HashMapNode[nullable Object, nullable Object] */;
2312 short int var4 /* : Bool */;
2313 short int var5 /* : Bool */;
2314 val* var_other /* var other: nullable Object */;
2315 short int var7 /* : Bool */;
2316 short int var8 /* : Bool */;
2317 val* var9 /* : nullable Object */;
2318 short int var10 /* : Bool */;
2319 short int var11 /* : Bool */;
2320 val* var12 /* : nullable Object */;
2321 val* var13 /* : nullable HashNode[nullable Object] */;
2322 var_item = p0;
2323 {
2324 { /* Inline hash_collection#HashMapValues#map (self) on <self:HashMapValues[nullable Object, nullable Object]> */
2325 var2 = self->attrs[COLOR_core__hash_collection__HashMapValues___map].val; /* _map on <self:HashMapValues[nullable Object, nullable Object]> */
2326 if (unlikely(var2 == NULL)) {
2327 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _map");
2328 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 308);
2329 fatal_exit(1);
2330 }
2331 var = var2;
2332 RET_LABEL1:(void)0;
2333 }
2334 }
2335 var_map = var;
2336 var3 = var_map->attrs[COLOR_core__hash_collection__HashCollection___first_item].val; /* _first_item on <var_map:HashMap[nullable Object, nullable Object]> */
2337 var_c = var3;
2338 for(;;) {
2339 if (var_c == NULL) {
2340 var4 = 0; /* is null */
2341 } else {
2342 var4 = 1; /* arg is null and recv is not */
2343 }
2344 if (0) {
2345 { /* Inline kernel#Object#!= (var_c,((val*)NULL)) on <var_c:nullable HashMapNode[nullable Object, nullable Object]> */
2346 var_other = ((val*)NULL);
2347 {
2348 var7 = ((short int(*)(val* self, val* p0))(var_c->class->vft[COLOR_core__kernel__Object___61d_61d]))(var_c, var_other); /* == on <var_c:nullable HashMapNode[nullable Object, nullable Object](HashMapNode[nullable Object, nullable Object])>*/
2349 }
2350 var8 = !var7;
2351 var5 = var8;
2352 goto RET_LABEL6;
2353 RET_LABEL6:(void)0;
2354 }
2355 var4 = var5;
2356 }
2357 if (var4){
2358 var9 = var_c->attrs[COLOR_core__hash_collection__HashMapNode___value].val; /* _value on <var_c:nullable HashMapNode[nullable Object, nullable Object](HashMapNode[nullable Object, nullable Object])> */
2359 if (var9 == NULL) {
2360 var10 = (var_item == NULL);
2361 } else {
2362 var11 = ((short int(*)(val* self, val* p0))((((long)var9&3)?class_info[((long)var9&3)]:var9->class)->vft[COLOR_core__kernel__Object___61d_61d]))(var9, var_item); /* == on <var9:nullable Object>*/
2363 var10 = var11;
2364 }
2365 if (var10){
2366 var12 = var_c->attrs[COLOR_core__hash_collection__HashNode___key].val; /* _key on <var_c:nullable HashMapNode[nullable Object, nullable Object](HashMapNode[nullable Object, nullable Object])> */
2367 {
2368 core__hash_collection___core__hash_collection__HashCollection___remove_node(var_map, var12); /* Direct call hash_collection#HashCollection#remove_node on <var_map:HashMap[nullable Object, nullable Object]>*/
2369 }
2370 goto RET_LABEL;
2371 } else {
2372 }
2373 var13 = var_c->attrs[COLOR_core__hash_collection__HashNode___next_item].val; /* _next_item on <var_c:nullable HashMapNode[nullable Object, nullable Object](HashMapNode[nullable Object, nullable Object])> */
2374 var_c = var13;
2375 } else {
2376 goto BREAK_label;
2377 }
2378 }
2379 BREAK_label: (void)0;
2380 RET_LABEL:;
2381 }
2382 /* method hash_collection#HashMapValues#init for (self: HashMapValues[nullable Object, nullable Object]) */
2383 void core__hash_collection___core__hash_collection__HashMapValues___core__kernel__Object__init(val* self) {
2384 {
2385 ((void(*)(val* self))(self->class->vft[COLOR_core__hash_collection___core__hash_collection__HashMapValues___core__kernel__Object__init]))(self); /* init on <self:HashMapValues[nullable Object, nullable Object]>*/
2386 }
2387 RET_LABEL:;
2388 }
2389 /* method hash_collection#HashMapNode#value= for (self: HashMapNode[nullable Object, nullable Object], nullable Object) */
2390 void core__hash_collection___core__hash_collection__HashMapNode___value_61d(val* self, val* p0) {
2391 short int var /* : Bool */;
2392 int cltype;
2393 int idtype;
2394 const struct type* type_struct;
2395 short int is_nullable;
2396 const char* var_class_name;
2397 /* Covariant cast for argument 0 (value) <p0:nullable Object> isa V */
2398 /* <p0:nullable Object> isa V */
2399 type_struct = self->type->resolution_table->types[COLOR_core__hash_collection__HashMapNode___35dV];
2400 cltype = type_struct->color;
2401 idtype = type_struct->id;
2402 is_nullable = type_struct->is_nullable;
2403 if(p0 == NULL) {
2404 var = is_nullable;
2405 } else {
2406 if(cltype >= (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->table_size) {
2407 var = 0;
2408 } else {
2409 var = (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->type_table[cltype] == idtype;
2410 }
2411 }
2412 if (unlikely(!var)) {
2413 var_class_name = p0 == NULL ? "null" : (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->name;
2414 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "V", var_class_name);
2415 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 379);
2416 fatal_exit(1);
2417 }
2418 self->attrs[COLOR_core__hash_collection__HashMapNode___value].val = p0; /* _value on <self:HashMapNode[nullable Object, nullable Object]> */
2419 RET_LABEL:;
2420 }
2421 /* method hash_collection#HashMapNode#init for (self: HashMapNode[nullable Object, nullable Object]) */
2422 void core__hash_collection___core__hash_collection__HashMapNode___core__kernel__Object__init(val* self) {
2423 {
2424 ((void(*)(val* self))(self->class->vft[COLOR_core__hash_collection___core__hash_collection__HashMapNode___core__kernel__Object__init]))(self); /* init on <self:HashMapNode[nullable Object, nullable Object]>*/
2425 }
2426 RET_LABEL:;
2427 }
2428 /* method hash_collection#HashMapIterator#is_ok for (self: HashMapIterator[nullable Object, nullable Object]): Bool */
2429 short int core__hash_collection___core__hash_collection__HashMapIterator___core__abstract_collection__MapIterator__is_ok(val* self) {
2430 short int var /* : Bool */;
2431 val* var1 /* : nullable HashMapNode[nullable Object, nullable Object] */;
2432 short int var2 /* : Bool */;
2433 short int var3 /* : Bool */;
2434 val* var_other /* var other: nullable Object */;
2435 short int var5 /* : Bool */;
2436 short int var6 /* : Bool */;
2437 var1 = self->attrs[COLOR_core__hash_collection__HashMapIterator___node].val; /* _node on <self:HashMapIterator[nullable Object, nullable Object]> */
2438 if (var1 == NULL) {
2439 var2 = 0; /* is null */
2440 } else {
2441 var2 = 1; /* arg is null and recv is not */
2442 }
2443 if (0) {
2444 { /* Inline kernel#Object#!= (var1,((val*)NULL)) on <var1:nullable HashMapNode[nullable Object, nullable Object]> */
2445 var_other = ((val*)NULL);
2446 {
2447 var5 = ((short int(*)(val* self, val* p0))(var1->class->vft[COLOR_core__kernel__Object___61d_61d]))(var1, var_other); /* == on <var1:nullable HashMapNode[nullable Object, nullable Object](HashMapNode[nullable Object, nullable Object])>*/
2448 }
2449 var6 = !var5;
2450 var3 = var6;
2451 goto RET_LABEL4;
2452 RET_LABEL4:(void)0;
2453 }
2454 var2 = var3;
2455 }
2456 var = var2;
2457 goto RET_LABEL;
2458 RET_LABEL:;
2459 return var;
2460 }
2461 /* method hash_collection#HashMapIterator#item for (self: HashMapIterator[nullable Object, nullable Object]): nullable Object */
2462 val* core__hash_collection___core__hash_collection__HashMapIterator___core__abstract_collection__MapIterator__item(val* self) {
2463 val* var /* : nullable Object */;
2464 short int var1 /* : Bool */;
2465 val* var2 /* : nullable HashMapNode[nullable Object, nullable Object] */;
2466 val* var3 /* : nullable Object */;
2467 {
2468 var1 = core__hash_collection___core__hash_collection__HashMapIterator___core__abstract_collection__MapIterator__is_ok(self);
2469 }
2470 if (unlikely(!var1)) {
2471 PRINT_ERROR("Runtime error: %s", "Assert failed");
2472 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 389);
2473 fatal_exit(1);
2474 }
2475 var2 = self->attrs[COLOR_core__hash_collection__HashMapIterator___node].val; /* _node on <self:HashMapIterator[nullable Object, nullable Object]> */
2476 if (unlikely(var2 == NULL)) {
2477 PRINT_ERROR("Runtime error: %s", "Receiver is null");
2478 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 390);
2479 fatal_exit(1);
2480 }
2481 var3 = var2->attrs[COLOR_core__hash_collection__HashMapNode___value].val; /* _value on <var2:nullable HashMapNode[nullable Object, nullable Object]> */
2482 var = var3;
2483 goto RET_LABEL;
2484 RET_LABEL:;
2485 return var;
2486 }
2487 /* method hash_collection#HashMapIterator#key for (self: HashMapIterator[nullable Object, nullable Object]): nullable Object */
2488 val* core__hash_collection___core__hash_collection__HashMapIterator___core__abstract_collection__MapIterator__key(val* self) {
2489 val* var /* : nullable Object */;
2490 short int var1 /* : Bool */;
2491 val* var2 /* : nullable HashMapNode[nullable Object, nullable Object] */;
2492 val* var3 /* : nullable Object */;
2493 {
2494 var1 = core__hash_collection___core__hash_collection__HashMapIterator___core__abstract_collection__MapIterator__is_ok(self);
2495 }
2496 if (unlikely(!var1)) {
2497 PRINT_ERROR("Runtime error: %s", "Assert failed");
2498 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 401);
2499 fatal_exit(1);
2500 }
2501 var2 = self->attrs[COLOR_core__hash_collection__HashMapIterator___node].val; /* _node on <self:HashMapIterator[nullable Object, nullable Object]> */
2502 if (unlikely(var2 == NULL)) {
2503 PRINT_ERROR("Runtime error: %s", "Receiver is null");
2504 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 402);
2505 fatal_exit(1);
2506 }
2507 var3 = var2->attrs[COLOR_core__hash_collection__HashNode___key].val; /* _key on <var2:nullable HashMapNode[nullable Object, nullable Object]> */
2508 var = var3;
2509 goto RET_LABEL;
2510 RET_LABEL:;
2511 return var;
2512 }
2513 /* method hash_collection#HashMapIterator#next for (self: HashMapIterator[nullable Object, nullable Object]) */
2514 void core__hash_collection___core__hash_collection__HashMapIterator___core__abstract_collection__MapIterator__next(val* self) {
2515 short int var /* : Bool */;
2516 val* var1 /* : nullable HashMapNode[nullable Object, nullable Object] */;
2517 val* var2 /* : nullable HashNode[nullable Object] */;
2518 {
2519 var = core__hash_collection___core__hash_collection__HashMapIterator___core__abstract_collection__MapIterator__is_ok(self);
2520 }
2521 if (unlikely(!var)) {
2522 PRINT_ERROR("Runtime error: %s", "Assert failed");
2523 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 407);
2524 fatal_exit(1);
2525 }
2526 var1 = self->attrs[COLOR_core__hash_collection__HashMapIterator___node].val; /* _node on <self:HashMapIterator[nullable Object, nullable Object]> */
2527 if (unlikely(var1 == NULL)) {
2528 PRINT_ERROR("Runtime error: %s", "Receiver is null");
2529 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 408);
2530 fatal_exit(1);
2531 }
2532 var2 = var1->attrs[COLOR_core__hash_collection__HashNode___next_item].val; /* _next_item on <var1:nullable HashMapNode[nullable Object, nullable Object]> */
2533 self->attrs[COLOR_core__hash_collection__HashMapIterator___node].val = var2; /* _node on <self:HashMapIterator[nullable Object, nullable Object]> */
2534 RET_LABEL:;
2535 }
2536 /* method hash_collection#HashMapIterator#map for (self: HashMapIterator[nullable Object, nullable Object]): HashMap[nullable Object, nullable Object] */
2537 val* core__hash_collection___core__hash_collection__HashMapIterator___map(val* self) {
2538 val* var /* : HashMap[nullable Object, nullable Object] */;
2539 val* var1 /* : HashMap[nullable Object, nullable Object] */;
2540 var1 = self->attrs[COLOR_core__hash_collection__HashMapIterator___map].val; /* _map on <self:HashMapIterator[nullable Object, nullable Object]> */
2541 if (unlikely(var1 == NULL)) {
2542 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _map");
2543 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 411);
2544 fatal_exit(1);
2545 }
2546 var = var1;
2547 RET_LABEL:;
2548 return var;
2549 }
2550 /* method hash_collection#HashMapIterator#map= for (self: HashMapIterator[nullable Object, nullable Object], HashMap[nullable Object, nullable Object]) */
2551 void core__hash_collection___core__hash_collection__HashMapIterator___map_61d(val* self, val* p0) {
2552 short int var /* : Bool */;
2553 int cltype;
2554 int idtype;
2555 const struct type* type_struct;
2556 const char* var_class_name;
2557 /* Covariant cast for argument 0 (map) <p0:HashMap[nullable Object, nullable Object]> isa HashMap[K, V] */
2558 /* <p0:HashMap[nullable Object, nullable Object]> isa HashMap[K, V] */
2559 type_struct = self->type->resolution_table->types[COLOR_core__HashMap__core__hash_collection__HashMapIterator___35dK__core__hash_collection__HashMapIterator___35dV];
2560 cltype = type_struct->color;
2561 idtype = type_struct->id;
2562 if(cltype >= p0->type->table_size) {
2563 var = 0;
2564 } else {
2565 var = p0->type->type_table[cltype] == idtype;
2566 }
2567 if (unlikely(!var)) {
2568 var_class_name = p0 == NULL ? "null" : p0->type->name;
2569 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap[K, V]", var_class_name);
2570 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 411);
2571 fatal_exit(1);
2572 }
2573 self->attrs[COLOR_core__hash_collection__HashMapIterator___map].val = p0; /* _map on <self:HashMapIterator[nullable Object, nullable Object]> */
2574 RET_LABEL:;
2575 }
2576 /* method hash_collection#HashMapIterator#init for (self: HashMapIterator[nullable Object, nullable Object]) */
2577 void core__hash_collection___core__hash_collection__HashMapIterator___core__kernel__Object__init(val* self) {
2578 val* var /* : HashMap[nullable Object, nullable Object] */;
2579 val* var2 /* : HashMap[nullable Object, nullable Object] */;
2580 val* var3 /* : HashMap[nullable Object, nullable Object] */;
2581 val* var4 /* : nullable HashNode[nullable Object] */;
2582 {
2583 ((void(*)(val* self))(self->class->vft[COLOR_core__hash_collection___core__hash_collection__HashMapIterator___core__kernel__Object__init]))(self); /* init on <self:HashMapIterator[nullable Object, nullable Object]>*/
2584 }
2585 {
2586 { /* Inline hash_collection#HashMapIterator#map (self) on <self:HashMapIterator[nullable Object, nullable Object]> */
2587 var2 = self->attrs[COLOR_core__hash_collection__HashMapIterator___map].val; /* _map on <self:HashMapIterator[nullable Object, nullable Object]> */
2588 if (unlikely(var2 == NULL)) {
2589 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _map");
2590 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 411);
2591 fatal_exit(1);
2592 }
2593 var = var2;
2594 RET_LABEL1:(void)0;
2595 }
2596 }
2597 self->attrs[COLOR_core__hash_collection__HashMapIterator___map].val = var; /* _map on <self:HashMapIterator[nullable Object, nullable Object]> */
2598 var3 = self->attrs[COLOR_core__hash_collection__HashMapIterator___map].val; /* _map on <self:HashMapIterator[nullable Object, nullable Object]> */
2599 if (unlikely(var3 == NULL)) {
2600 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _map");
2601 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 420);
2602 fatal_exit(1);
2603 }
2604 var4 = var3->attrs[COLOR_core__hash_collection__HashCollection___first_item].val; /* _first_item on <var3:HashMap[nullable Object, nullable Object]> */
2605 self->attrs[COLOR_core__hash_collection__HashMapIterator___node].val = var4; /* _node on <self:HashMapIterator[nullable Object, nullable Object]> */
2606 RET_LABEL:;
2607 }
2608 /* method hash_collection#HashSet#length for (self: HashSet[nullable Object]): Int */
2609 long core___core__HashSet___core__abstract_collection__Collection__length(val* self) {
2610 long var /* : Int */;
2611 long var1 /* : Int */;
2612 var1 = self->attrs[COLOR_core__hash_collection__HashCollection___the_length].l; /* _the_length on <self:HashSet[nullable Object]> */
2613 var = var1;
2614 goto RET_LABEL;
2615 RET_LABEL:;
2616 return var;
2617 }
2618 /* method hash_collection#HashSet#is_empty for (self: HashSet[nullable Object]): Bool */
2619 short int core___core__HashSet___core__abstract_collection__Collection__is_empty(val* self) {
2620 short int var /* : Bool */;
2621 long var1 /* : Int */;
2622 short int var2 /* : Bool */;
2623 short int var4 /* : Bool */;
2624 var1 = self->attrs[COLOR_core__hash_collection__HashCollection___the_length].l; /* _the_length on <self:HashSet[nullable Object]> */
2625 {
2626 { /* Inline kernel#Int#== (var1,0l) on <var1:Int> */
2627 var4 = var1 == 0l;
2628 var2 = var4;
2629 goto RET_LABEL3;
2630 RET_LABEL3:(void)0;
2631 }
2632 }
2633 var = var2;
2634 goto RET_LABEL;
2635 RET_LABEL:;
2636 return var;
2637 }
2638 /* method hash_collection#HashSet#first for (self: HashSet[nullable Object]): nullable Object */
2639 val* core___core__HashSet___core__abstract_collection__Collection__first(val* self) {
2640 val* var /* : nullable Object */;
2641 long var1 /* : Int */;
2642 short int var2 /* : Bool */;
2643 short int var4 /* : Bool */;
2644 int cltype;
2645 int idtype;
2646 const char* var_class_name;
2647 short int var5 /* : Bool */;
2648 val* var6 /* : nullable HashNode[nullable Object] */;
2649 val* var7 /* : nullable Object */;
2650 var1 = self->attrs[COLOR_core__hash_collection__HashCollection___the_length].l; /* _the_length on <self:HashSet[nullable Object]> */
2651 {
2652 { /* Inline kernel#Int#> (var1,0l) on <var1:Int> */
2653 /* Covariant cast for argument 0 (i) <0l:Int> isa OTHER */
2654 /* <0l:Int> isa OTHER */
2655 var4 = 1; /* easy <0l:Int> isa OTHER*/
2656 if (unlikely(!var4)) {
2657 var_class_name = type_core__Int.name;
2658 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name);
2659 PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 730);
2660 fatal_exit(1);
2661 }
2662 var5 = var1 > 0l;
2663 var2 = var5;
2664 goto RET_LABEL3;
2665 RET_LABEL3:(void)0;
2666 }
2667 }
2668 if (unlikely(!var2)) {
2669 PRINT_ERROR("Runtime error: %s", "Assert failed");
2670 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 438);
2671 fatal_exit(1);
2672 }
2673 var6 = self->attrs[COLOR_core__hash_collection__HashCollection___first_item].val; /* _first_item on <self:HashSet[nullable Object]> */
2674 if (unlikely(var6 == NULL)) {
2675 PRINT_ERROR("Runtime error: %s", "Receiver is null");
2676 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 439);
2677 fatal_exit(1);
2678 }
2679 var7 = var6->attrs[COLOR_core__hash_collection__HashNode___key].val; /* _key on <var6:nullable HashNode[nullable Object](nullable HashSetNode[nullable Object])> */
2680 var = var7;
2681 goto RET_LABEL;
2682 RET_LABEL:;
2683 return var;
2684 }
2685 /* method hash_collection#HashSet#has for (self: HashSet[nullable Object], nullable Object): Bool */
2686 short int core___core__HashSet___core__abstract_collection__Collection__has(val* self, val* p0) {
2687 short int var /* : Bool */;
2688 val* var_item /* var item: nullable Object */;
2689 val* var1 /* : nullable HashNode[nullable Object] */;
2690 short int var2 /* : Bool */;
2691 short int var3 /* : Bool */;
2692 val* var_other /* var other: nullable Object */;
2693 short int var5 /* : Bool */;
2694 short int var6 /* : Bool */;
2695 var_item = p0;
2696 {
2697 var1 = core__hash_collection___core__hash_collection__HashCollection___node_at(self, var_item);
2698 }
2699 if (var1 == NULL) {
2700 var2 = 0; /* is null */
2701 } else {
2702 var2 = 1; /* arg is null and recv is not */
2703 }
2704 if (0) {
2705 { /* Inline kernel#Object#!= (var1,((val*)NULL)) on <var1:nullable HashNode[nullable Object](nullable HashSetNode[nullable Object])> */
2706 var_other = ((val*)NULL);
2707 {
2708 var5 = ((short int(*)(val* self, val* p0))(var1->class->vft[COLOR_core__kernel__Object___61d_61d]))(var1, var_other); /* == on <var1:nullable HashSetNode[nullable Object](HashSetNode[nullable Object])>*/
2709 }
2710 var6 = !var5;
2711 var3 = var6;
2712 goto RET_LABEL4;
2713 RET_LABEL4:(void)0;
2714 }
2715 var2 = var3;
2716 }
2717 var = var2;
2718 goto RET_LABEL;
2719 RET_LABEL:;
2720 return var;
2721 }
2722 /* method hash_collection#HashSet#add for (self: HashSet[nullable Object], nullable Object) */
2723 void core___core__HashSet___core__abstract_collection__SimpleCollection__add(val* self, val* p0) {
2724 short int var /* : Bool */;
2725 int cltype;
2726 int idtype;
2727 const struct type* type_struct;
2728 short int is_nullable;
2729 const char* var_class_name;
2730 val* var_item /* var item: nullable Object */;
2731 long var1 /* : Int */;
2732 short int var2 /* : Bool */;
2733 short int var4 /* : Bool */;
2734 long var5 /* : Int */;
2735 long var_i /* var i: Int */;
2736 val* var6 /* : nullable HashNode[nullable Object] */;
2737 val* var_c /* var c: nullable HashSetNode[nullable Object] */;
2738 short int var7 /* : Bool */;
2739 short int var8 /* : Bool */;
2740 val* var_other /* var other: nullable Object */;
2741 short int var10 /* : Bool */;
2742 short int var11 /* : Bool */;
2743 val* var12 /* : HashSetNode[nullable Object] */;
2744 /* Covariant cast for argument 0 (item) <p0:nullable Object> isa E */
2745 /* <p0:nullable Object> isa E */
2746 type_struct = self->type->resolution_table->types[COLOR_core__HashSet___35dE];
2747 cltype = type_struct->color;
2748 idtype = type_struct->id;
2749 is_nullable = type_struct->is_nullable;
2750 if(p0 == NULL) {
2751 var = is_nullable;
2752 } else {
2753 if(cltype >= (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->table_size) {
2754 var = 0;
2755 } else {
2756 var = (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->type_table[cltype] == idtype;
2757 }
2758 }
2759 if (unlikely(!var)) {
2760 var_class_name = p0 == NULL ? "null" : (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->name;
2761 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "E", var_class_name);
2762 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 447);
2763 fatal_exit(1);
2764 }
2765 var_item = p0;
2766 var1 = self->attrs[COLOR_core__hash_collection__HashCollection___capacity].l; /* _capacity on <self:HashSet[nullable Object]> */
2767 {
2768 { /* Inline kernel#Int#== (var1,0l) on <var1:Int> */
2769 var4 = var1 == 0l;
2770 var2 = var4;
2771 goto RET_LABEL3;
2772 RET_LABEL3:(void)0;
2773 }
2774 }
2775 if (var2){
2776 {
2777 core__hash_collection___core__hash_collection__HashCollection___enlarge(self, 17l); /* Direct call hash_collection#HashCollection#enlarge on <self:HashSet[nullable Object]>*/
2778 }
2779 } else {
2780 }
2781 {
2782 var5 = core__hash_collection___core__hash_collection__HashCollection___index_at(self, var_item);
2783 }
2784 var_i = var5;
2785 {
2786 var6 = core__hash_collection___core__hash_collection__HashCollection___node_at_idx(self, var_i, var_item);
2787 }
2788 var_c = var6;
2789 if (var_c == NULL) {
2790 var7 = 0; /* is null */
2791 } else {
2792 var7 = 1; /* arg is null and recv is not */
2793 }
2794 if (0) {
2795 { /* Inline kernel#Object#!= (var_c,((val*)NULL)) on <var_c:nullable HashSetNode[nullable Object]> */
2796 var_other = ((val*)NULL);
2797 {
2798 var10 = ((short int(*)(val* self, val* p0))(var_c->class->vft[COLOR_core__kernel__Object___61d_61d]))(var_c, var_other); /* == on <var_c:nullable HashSetNode[nullable Object](HashSetNode[nullable Object])>*/
2799 }
2800 var11 = !var10;
2801 var8 = var11;
2802 goto RET_LABEL9;
2803 RET_LABEL9:(void)0;
2804 }
2805 var7 = var8;
2806 }
2807 if (var7){
2808 var_c->attrs[COLOR_core__hash_collection__HashNode___key].val = var_item; /* _key on <var_c:nullable HashSetNode[nullable Object](HashSetNode[nullable Object])> */
2809 } else {
2810 var12 = NEW_core__hash_collection__HashSetNode(self->type->resolution_table->types[COLOR_core__hash_collection__HashSetNode__core__HashSet___35dE]);
2811 {
2812 ((void(*)(val* self, val* p0))(var12->class->vft[COLOR_core__hash_collection__HashNode__key_61d]))(var12, var_item); /* key= on <var12:HashSetNode[nullable Object]>*/
2813 }
2814 {
2815 ((void(*)(val* self))(var12->class->vft[COLOR_core__kernel__Object__init]))(var12); /* init on <var12:HashSetNode[nullable Object]>*/
2816 }
2817 {
2818 core__hash_collection___core__hash_collection__HashCollection___store(self, var_i, var12); /* Direct call hash_collection#HashCollection#store on <self:HashSet[nullable Object]>*/
2819 }
2820 }
2821 RET_LABEL:;
2822 }
2823 /* method hash_collection#HashSet#remove for (self: HashSet[nullable Object], nullable Object) */
2824 void core___core__HashSet___core__abstract_collection__RemovableCollection__remove(val* self, val* p0) {
2825 val* var_item /* var item: nullable Object */;
2826 var_item = p0;
2827 {
2828 core__hash_collection___core__hash_collection__HashCollection___remove_node(self, var_item); /* Direct call hash_collection#HashCollection#remove_node on <self:HashSet[nullable Object]>*/
2829 }
2830 RET_LABEL:;
2831 }
2832 /* method hash_collection#HashSet#clear for (self: HashSet[nullable Object]) */
2833 void core___core__HashSet___core__abstract_collection__RemovableCollection__clear(val* self) {
2834 {
2835 core__hash_collection___core__hash_collection__HashCollection___raz(self); /* Direct call hash_collection#HashCollection#raz on <self:HashSet[nullable Object]>*/
2836 }
2837 RET_LABEL:;
2838 }
2839 /* method hash_collection#HashSet#iterator for (self: HashSet[nullable Object]): Iterator[nullable Object] */
2840 val* core___core__HashSet___core__abstract_collection__Collection__iterator(val* self) {
2841 val* var /* : Iterator[nullable Object] */;
2842 val* var1 /* : HashSetIterator[nullable Object] */;
2843 var1 = NEW_core__hash_collection__HashSetIterator(self->type->resolution_table->types[COLOR_core__hash_collection__HashSetIterator__core__HashSet___35dE]);
2844 {
2845 ((void(*)(val* self, val* p0))(var1->class->vft[COLOR_core__hash_collection__HashSetIterator__set_61d]))(var1, self); /* set= on <var1:HashSetIterator[nullable Object]>*/
2846 }
2847 {
2848 ((void(*)(val* self))(var1->class->vft[COLOR_core__kernel__Object__init]))(var1); /* init on <var1:HashSetIterator[nullable Object]>*/
2849 }
2850 var = var1;
2851 goto RET_LABEL;
2852 RET_LABEL:;
2853 return var;
2854 }
2855 /* method hash_collection#HashSet#init for (self: HashSet[nullable Object]) */
2856 void core___core__HashSet___core__kernel__Object__init(val* self) {
2857 {
2858 ((void(*)(val* self))(self->class->vft[COLOR_core___core__HashSet___core__kernel__Object__init]))(self); /* init on <self:HashSet[nullable Object]>*/
2859 }
2860 self->attrs[COLOR_core__hash_collection__HashCollection___capacity].l = 0l; /* _capacity on <self:HashSet[nullable Object]> */
2861 self->attrs[COLOR_core__hash_collection__HashCollection___the_length].l = 0l; /* _the_length on <self:HashSet[nullable Object]> */
2862 RET_LABEL:;
2863 }
2864 /* method hash_collection#HashSet#from for (self: HashSet[nullable Object], Collection[nullable Object]) */
2865 void core___core__HashSet___from(val* self, val* p0) {
2866 short int var /* : Bool */;
2867 int cltype;
2868 int idtype;
2869 const struct type* type_struct;
2870 const char* var_class_name;
2871 val* var_coll /* var coll: Collection[nullable Object] */;
2872 /* Covariant cast for argument 0 (coll) <p0:Collection[nullable Object]> isa Collection[E] */
2873 /* <p0:Collection[nullable Object]> isa Collection[E] */
2874 type_struct = self->type->resolution_table->types[COLOR_core__Collection__core__HashSet___35dE];
2875 cltype = type_struct->color;
2876 idtype = type_struct->id;
2877 if(cltype >= (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->table_size) {
2878 var = 0;
2879 } else {
2880 var = (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->type_table[cltype] == idtype;
2881 }
2882 if (unlikely(!var)) {
2883 var_class_name = p0 == NULL ? "null" : (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->name;
2884 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "Collection[E]", var_class_name);
2885 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 471);
2886 fatal_exit(1);
2887 }
2888 var_coll = p0;
2889 {
2890 core___core__HashSet___core__kernel__Object__init(self); /* Direct call hash_collection#HashSet#init on <self:HashSet[nullable Object]>*/
2891 }
2892 {
2893 core___core__SimpleCollection___add_all(self, var_coll); /* Direct call abstract_collection#SimpleCollection#add_all on <self:HashSet[nullable Object]>*/
2894 }
2895 RET_LABEL:;
2896 }
2897 /* method hash_collection#HashSetIterator#is_ok for (self: HashSetIterator[nullable Object]): Bool */
2898 short int core__hash_collection___core__hash_collection__HashSetIterator___core__abstract_collection__Iterator__is_ok(val* self) {
2899 short int var /* : Bool */;
2900 val* var1 /* : nullable HashSetNode[nullable Object] */;
2901 short int var2 /* : Bool */;
2902 short int var3 /* : Bool */;
2903 val* var_other /* var other: nullable Object */;
2904 short int var5 /* : Bool */;
2905 short int var6 /* : Bool */;
2906 var1 = self->attrs[COLOR_core__hash_collection__HashSetIterator___node].val; /* _node on <self:HashSetIterator[nullable Object]> */
2907 if (var1 == NULL) {
2908 var2 = 0; /* is null */
2909 } else {
2910 var2 = 1; /* arg is null and recv is not */
2911 }
2912 if (0) {
2913 { /* Inline kernel#Object#!= (var1,((val*)NULL)) on <var1:nullable HashSetNode[nullable Object]> */
2914 var_other = ((val*)NULL);
2915 {
2916 var5 = ((short int(*)(val* self, val* p0))(var1->class->vft[COLOR_core__kernel__Object___61d_61d]))(var1, var_other); /* == on <var1:nullable HashSetNode[nullable Object](HashSetNode[nullable Object])>*/
2917 }
2918 var6 = !var5;
2919 var3 = var6;
2920 goto RET_LABEL4;
2921 RET_LABEL4:(void)0;
2922 }
2923 var2 = var3;
2924 }
2925 var = var2;
2926 goto RET_LABEL;
2927 RET_LABEL:;
2928 return var;
2929 }
2930 /* method hash_collection#HashSetIterator#item for (self: HashSetIterator[nullable Object]): nullable Object */
2931 val* core__hash_collection___core__hash_collection__HashSetIterator___core__abstract_collection__Iterator__item(val* self) {
2932 val* var /* : nullable Object */;
2933 short int var1 /* : Bool */;
2934 val* var2 /* : nullable HashSetNode[nullable Object] */;
2935 val* var3 /* : nullable Object */;
2936 {
2937 var1 = core__hash_collection___core__hash_collection__HashSetIterator___core__abstract_collection__Iterator__is_ok(self);
2938 }
2939 if (unlikely(!var1)) {
2940 PRINT_ERROR("Runtime error: %s", "Assert failed");
2941 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 491);
2942 fatal_exit(1);
2943 }
2944 var2 = self->attrs[COLOR_core__hash_collection__HashSetIterator___node].val; /* _node on <self:HashSetIterator[nullable Object]> */
2945 if (unlikely(var2 == NULL)) {
2946 PRINT_ERROR("Runtime error: %s", "Receiver is null");
2947 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 492);
2948 fatal_exit(1);
2949 }
2950 var3 = var2->attrs[COLOR_core__hash_collection__HashNode___key].val; /* _key on <var2:nullable HashSetNode[nullable Object]> */
2951 var = var3;
2952 goto RET_LABEL;
2953 RET_LABEL:;
2954 return var;
2955 }
2956 /* method hash_collection#HashSetIterator#next for (self: HashSetIterator[nullable Object]) */
2957 void core__hash_collection___core__hash_collection__HashSetIterator___core__abstract_collection__Iterator__next(val* self) {
2958 short int var /* : Bool */;
2959 val* var1 /* : nullable HashSetNode[nullable Object] */;
2960 val* var2 /* : nullable HashNode[nullable Object] */;
2961 {
2962 var = core__hash_collection___core__hash_collection__HashSetIterator___core__abstract_collection__Iterator__is_ok(self);
2963 }
2964 if (unlikely(!var)) {
2965 PRINT_ERROR("Runtime error: %s", "Assert failed");
2966 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 497);
2967 fatal_exit(1);
2968 }
2969 var1 = self->attrs[COLOR_core__hash_collection__HashSetIterator___node].val; /* _node on <self:HashSetIterator[nullable Object]> */
2970 if (unlikely(var1 == NULL)) {
2971 PRINT_ERROR("Runtime error: %s", "Receiver is null");
2972 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 498);
2973 fatal_exit(1);
2974 }
2975 var2 = var1->attrs[COLOR_core__hash_collection__HashNode___next_item].val; /* _next_item on <var1:nullable HashSetNode[nullable Object]> */
2976 self->attrs[COLOR_core__hash_collection__HashSetIterator___node].val = var2; /* _node on <self:HashSetIterator[nullable Object]> */
2977 RET_LABEL:;
2978 }
2979 /* method hash_collection#HashSetIterator#set= for (self: HashSetIterator[nullable Object], HashSet[nullable Object]) */
2980 void core__hash_collection___core__hash_collection__HashSetIterator___set_61d(val* self, val* p0) {
2981 short int var /* : Bool */;
2982 int cltype;
2983 int idtype;
2984 const struct type* type_struct;
2985 const char* var_class_name;
2986 /* Covariant cast for argument 0 (set) <p0:HashSet[nullable Object]> isa HashSet[E] */
2987 /* <p0:HashSet[nullable Object]> isa HashSet[E] */
2988 type_struct = self->type->resolution_table->types[COLOR_core__HashSet__core__hash_collection__HashSetIterator___35dE];
2989 cltype = type_struct->color;
2990 idtype = type_struct->id;
2991 if(cltype >= p0->type->table_size) {
2992 var = 0;
2993 } else {
2994 var = p0->type->type_table[cltype] == idtype;
2995 }
2996 if (unlikely(!var)) {
2997 var_class_name = p0 == NULL ? "null" : p0->type->name;
2998 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "HashSet[E]", var_class_name);
2999 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 501);
3000 fatal_exit(1);
3001 }
3002 self->attrs[COLOR_core__hash_collection__HashSetIterator___set].val = p0; /* _set on <self:HashSetIterator[nullable Object]> */
3003 RET_LABEL:;
3004 }
3005 /* method hash_collection#HashSetIterator#init for (self: HashSetIterator[nullable Object]) */
3006 void core__hash_collection___core__hash_collection__HashSetIterator___core__kernel__Object__init(val* self) {
3007 val* var /* : HashSet[nullable Object] */;
3008 val* var1 /* : nullable HashNode[nullable Object] */;
3009 {
3010 ((void(*)(val* self))(self->class->vft[COLOR_core__hash_collection___core__hash_collection__HashSetIterator___core__kernel__Object__init]))(self); /* init on <self:HashSetIterator[nullable Object]>*/
3011 }
3012 var = self->attrs[COLOR_core__hash_collection__HashSetIterator___set].val; /* _set on <self:HashSetIterator[nullable Object]> */
3013 if (unlikely(var == NULL)) {
3014 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _set");
3015 PRINT_ERROR(" (%s:%d)\n", FILE_core__hash_collection, 509);
3016 fatal_exit(1);
3017 }
3018 var1 = var->attrs[COLOR_core__hash_collection__HashCollection___first_item].val; /* _first_item on <var:HashSet[nullable Object]> */
3019 self->attrs[COLOR_core__hash_collection__HashSetIterator___node].val = var1; /* _node on <self:HashSetIterator[nullable Object]> */
3020 RET_LABEL:;
3021 }