Merge: Subtyping test with perfect hashing in the Nit vm
[nit.git] / c_src / hash_collection.sep.1.c
1 #include "hash_collection.sep.0.h"
2 /* method hash_collection#HashCollection#first_item for (self: HashCollection[Object, HashNode[Object]]): nullable HashNode[Object] */
3 val* hash_collection__HashCollection__first_item(val* self) {
4 val* var /* : nullable HashNode[Object] */;
5 val* var1 /* : nullable HashNode[Object] */;
6 var1 = self->attrs[COLOR_hash_collection__HashCollection___first_item].val; /* _first_item on <self:HashCollection[Object, HashNode[Object]]> */
7 var = var1;
8 RET_LABEL:;
9 return var;
10 }
11 /* method hash_collection#HashCollection#first_item for (self: Object): nullable HashNode[Object] */
12 val* VIRTUAL_hash_collection__HashCollection__first_item(val* self) {
13 val* var /* : nullable HashNode[Object] */;
14 val* var1 /* : nullable HashNode[Object] */;
15 var1 = hash_collection__HashCollection__first_item(self);
16 var = var1;
17 RET_LABEL:;
18 return var;
19 }
20 /* method hash_collection#HashCollection#index_at for (self: HashCollection[Object, HashNode[Object]], Object): Int */
21 long hash_collection__HashCollection__index_at(val* self, val* p0) {
22 long var /* : Int */;
23 short int var1 /* : Bool */;
24 int cltype;
25 int idtype;
26 const struct type* type_struct;
27 const char* var_class_name;
28 val* var_k /* var k: Object */;
29 long var2 /* : Int */;
30 long var3 /* : Int */;
31 long var4 /* : Int */;
32 long var6 /* : Int */;
33 long var_i /* var i: Int */;
34 long var7 /* : Int */;
35 short int var8 /* : Bool */;
36 short int var10 /* : Bool */;
37 int cltype11;
38 int idtype12;
39 const char* var_class_name13;
40 short int var14 /* : Bool */;
41 long var15 /* : Int */;
42 long var17 /* : Int */;
43 /* Covariant cast for argument 0 (k) <p0:Object> isa HashCollection#0 */
44 /* <p0:Object> isa HashCollection#0 */
45 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashCollection_FT0];
46 cltype = type_struct->color;
47 idtype = type_struct->id;
48 if(cltype >= p0->type->table_size) {
49 var1 = 0;
50 } else {
51 var1 = p0->type->type_table[cltype] == idtype;
52 }
53 if (!var1) {
54 var_class_name = p0 == NULL ? "null" : p0->type->name;
55 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashCollection#0", var_class_name);
56 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 35);
57 show_backtrace(1);
58 }
59 var_k = p0;
60 var2 = ((long (*)(val*))(var_k->class->vft[COLOR_kernel__Object__hash]))(var_k) /* hash on <var_k:Object>*/;
61 var3 = self->attrs[COLOR_hash_collection__HashCollection___capacity].l; /* _capacity on <self:HashCollection[Object, HashNode[Object]]> */
62 { /* Inline kernel#Int#% (var2,var3) */
63 var6 = var2 % var3;
64 var4 = var6;
65 goto RET_LABEL5;
66 RET_LABEL5:(void)0;
67 }
68 var_i = var4;
69 var7 = 0;
70 { /* Inline kernel#Int#< (var_i,var7) */
71 /* Covariant cast for argument 0 (i) <var7:Int> isa OTHER */
72 /* <var7:Int> isa OTHER */
73 var10 = 1; /* easy <var7:Int> isa OTHER*/
74 if (!var10) {
75 var_class_name13 = type_kernel__Int.name;
76 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name13);
77 fprintf(stderr, " (%s:%d)\n", "lib/standard/kernel.nit", 265);
78 show_backtrace(1);
79 }
80 var14 = var_i < var7;
81 var8 = var14;
82 goto RET_LABEL9;
83 RET_LABEL9:(void)0;
84 }
85 if (var8){
86 { /* Inline kernel#Int#unary - (var_i) */
87 var17 = -var_i;
88 var15 = var17;
89 goto RET_LABEL16;
90 RET_LABEL16:(void)0;
91 }
92 var_i = var15;
93 } else {
94 }
95 var = var_i;
96 goto RET_LABEL;
97 RET_LABEL:;
98 return var;
99 }
100 /* method hash_collection#HashCollection#index_at for (self: Object, Object): Int */
101 long VIRTUAL_hash_collection__HashCollection__index_at(val* self, val* p0) {
102 long var /* : Int */;
103 long var1 /* : Int */;
104 var1 = hash_collection__HashCollection__index_at(self, p0);
105 var = var1;
106 RET_LABEL:;
107 return var;
108 }
109 /* method hash_collection#HashCollection#node_at for (self: HashCollection[Object, HashNode[Object]], Object): nullable HashNode[Object] */
110 val* hash_collection__HashCollection__node_at(val* self, val* p0) {
111 val* var /* : nullable HashNode[Object] */;
112 short int var1 /* : Bool */;
113 int cltype;
114 int idtype;
115 const struct type* type_struct;
116 const char* var_class_name;
117 val* var_k /* var k: Object */;
118 val* var2 /* : nullable Object */;
119 short int var3 /* : Bool */;
120 val* var4 /* : nullable HashNode[Object] */;
121 long var5 /* : Int */;
122 val* var6 /* : nullable HashNode[Object] */;
123 val* var_res /* var res: nullable HashNode[Object] */;
124 /* Covariant cast for argument 0 (k) <p0:Object> isa HashCollection#0 */
125 /* <p0:Object> isa HashCollection#0 */
126 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashCollection_FT0];
127 cltype = type_struct->color;
128 idtype = type_struct->id;
129 if(cltype >= p0->type->table_size) {
130 var1 = 0;
131 } else {
132 var1 = p0->type->type_table[cltype] == idtype;
133 }
134 if (!var1) {
135 var_class_name = p0 == NULL ? "null" : p0->type->name;
136 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashCollection#0", var_class_name);
137 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 43);
138 show_backtrace(1);
139 }
140 var_k = p0;
141 var2 = self->attrs[COLOR_hash_collection__HashCollection___last_accessed_key].val; /* _last_accessed_key on <self:HashCollection[Object, HashNode[Object]]> */
142 var3 = ((short int (*)(val*, val*))(var_k->class->vft[COLOR_kernel__Object__is_same_instance]))(var_k, var2) /* is_same_instance on <var_k:Object>*/;
143 if (var3){
144 var4 = self->attrs[COLOR_hash_collection__HashCollection___last_accessed_node].val; /* _last_accessed_node on <self:HashCollection[Object, HashNode[Object]]> */
145 var = var4;
146 goto RET_LABEL;
147 } else {
148 }
149 var5 = ((long (*)(val*, val*))(self->class->vft[COLOR_hash_collection__HashCollection__index_at]))(self, var_k) /* index_at on <self:HashCollection[Object, HashNode[Object]]>*/;
150 var6 = ((val* (*)(val*, long, val*))(self->class->vft[COLOR_hash_collection__HashCollection__node_at_idx]))(self, var5, var_k) /* node_at_idx on <self:HashCollection[Object, HashNode[Object]]>*/;
151 var_res = var6;
152 self->attrs[COLOR_hash_collection__HashCollection___last_accessed_key].val = var_k; /* _last_accessed_key on <self:HashCollection[Object, HashNode[Object]]> */
153 self->attrs[COLOR_hash_collection__HashCollection___last_accessed_node].val = var_res; /* _last_accessed_node on <self:HashCollection[Object, HashNode[Object]]> */
154 var = var_res;
155 goto RET_LABEL;
156 RET_LABEL:;
157 return var;
158 }
159 /* method hash_collection#HashCollection#node_at for (self: Object, Object): nullable HashNode[Object] */
160 val* VIRTUAL_hash_collection__HashCollection__node_at(val* self, val* p0) {
161 val* var /* : nullable HashNode[Object] */;
162 val* var1 /* : nullable HashNode[Object] */;
163 var1 = hash_collection__HashCollection__node_at(self, p0);
164 var = var1;
165 RET_LABEL:;
166 return var;
167 }
168 /* method hash_collection#HashCollection#node_at_idx for (self: HashCollection[Object, HashNode[Object]], Int, Object): nullable HashNode[Object] */
169 val* hash_collection__HashCollection__node_at_idx(val* self, long p0, val* p1) {
170 val* var /* : nullable HashNode[Object] */;
171 short int var1 /* : Bool */;
172 int cltype;
173 int idtype;
174 const struct type* type_struct;
175 const char* var_class_name;
176 long var_i /* var i: Int */;
177 val* var_k /* var k: Object */;
178 val* var2 /* : nullable NativeArray[nullable HashNode[Object]] */;
179 val* var3 /* : nullable Object */;
180 val* var_c /* var c: nullable HashNode[Object] */;
181 val* var4 /* : null */;
182 short int var5 /* : Bool */;
183 val* var6 /* : Object */;
184 val* var_ck /* var ck: Object */;
185 short int var7 /* : Bool */;
186 short int var8 /* : Bool */;
187 short int var_ /* var : Bool */;
188 short int var9 /* : Bool */;
189 val* var10 /* : nullable HashNode[Object] */;
190 short int var11 /* : Bool */;
191 int cltype12;
192 int idtype13;
193 const struct type* type_struct14;
194 const char* var_class_name15;
195 /* Covariant cast for argument 1 (k) <p1:Object> isa HashCollection#0 */
196 /* <p1:Object> isa HashCollection#0 */
197 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashCollection_FT0];
198 cltype = type_struct->color;
199 idtype = type_struct->id;
200 if(cltype >= p1->type->table_size) {
201 var1 = 0;
202 } else {
203 var1 = p1->type->type_table[cltype] == idtype;
204 }
205 if (!var1) {
206 var_class_name = p1 == NULL ? "null" : p1->type->name;
207 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashCollection#0", var_class_name);
208 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 55);
209 show_backtrace(1);
210 }
211 var_i = p0;
212 var_k = p1;
213 var2 = self->attrs[COLOR_hash_collection__HashCollection___array].val; /* _array on <self:HashCollection[Object, HashNode[Object]]> */
214 if (var2 == NULL) {
215 fprintf(stderr, "Runtime error: %s", "Receiver is null");
216 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 58);
217 show_backtrace(1);
218 } else {
219 var3 = ((val* (*)(val*, long))(var2->class->vft[COLOR_array__NativeArray___91d_93d]))(var2, var_i) /* [] on <var2:nullable NativeArray[nullable HashNode[Object]]>*/;
220 }
221 var_c = var3;
222 for(;;) {
223 var4 = NULL;
224 if (var_c == NULL) {
225 var5 = 0; /* is null */
226 } else {
227 var5 = 1; /* arg is null and recv is not */
228 }
229 if (!var5) break;
230 var6 = var_c->attrs[COLOR_hash_collection__HashNode___key].val; /* _key on <var_c:nullable HashNode[Object](HashNode[Object])> */
231 if (var6 == NULL) {
232 fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _key");
233 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 60);
234 show_backtrace(1);
235 }
236 var_ck = var6;
237 var8 = ((short int (*)(val*, val*))(var_ck->class->vft[COLOR_kernel__Object__is_same_instance]))(var_ck, var_k) /* is_same_instance on <var_ck:Object>*/;
238 var_ = var8;
239 if (var8){
240 var7 = var_;
241 } else {
242 var9 = ((short int (*)(val*, val*))(var_ck->class->vft[COLOR_kernel__Object___61d_61d]))(var_ck, var_k) /* == on <var_ck:Object>*/;
243 var7 = var9;
244 }
245 if (var7){
246 goto BREAK_label;
247 } else {
248 }
249 var10 = var_c->attrs[COLOR_hash_collection__HashNode___next_in_bucklet].val; /* _next_in_bucklet on <var_c:nullable HashNode[Object](HashNode[Object])> */
250 /* <var10:nullable HashNode[Object]> isa nullable HashCollection#1 */
251 type_struct14 = self->type->resolution_table->types[COLOR_nullable_hash_collection__HashCollection_FT1];
252 cltype12 = type_struct14->color;
253 idtype13 = type_struct14->id;
254 if(var10 == NULL) {
255 var11 = 1;
256 } else {
257 if(cltype12 >= var10->type->table_size) {
258 var11 = 0;
259 } else {
260 var11 = var10->type->type_table[cltype12] == idtype13;
261 }
262 }
263 if (!var11) {
264 var_class_name15 = var10 == NULL ? "null" : var10->type->name;
265 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "nullable HashCollection#1", var_class_name15);
266 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 64);
267 show_backtrace(1);
268 }
269 var_c = var10;
270 CONTINUE_label: (void)0;
271 }
272 BREAK_label: (void)0;
273 var = var_c;
274 goto RET_LABEL;
275 RET_LABEL:;
276 return var;
277 }
278 /* method hash_collection#HashCollection#node_at_idx for (self: Object, Int, Object): nullable HashNode[Object] */
279 val* VIRTUAL_hash_collection__HashCollection__node_at_idx(val* self, long p0, val* p1) {
280 val* var /* : nullable HashNode[Object] */;
281 val* var1 /* : nullable HashNode[Object] */;
282 var1 = hash_collection__HashCollection__node_at_idx(self, p0, p1);
283 var = var1;
284 RET_LABEL:;
285 return var;
286 }
287 /* method hash_collection#HashCollection#store for (self: HashCollection[Object, HashNode[Object]], Int, HashNode[Object]) */
288 void hash_collection__HashCollection__store(val* self, long p0, val* p1) {
289 short int var /* : Bool */;
290 int cltype;
291 int idtype;
292 const struct type* type_struct;
293 const char* var_class_name;
294 long var_index /* var index: Int */;
295 val* var_node /* var node: HashNode[Object] */;
296 val* var1 /* : nullable HashNode[Object] */;
297 val* var2 /* : null */;
298 short int var3 /* : Bool */;
299 val* var4 /* : nullable HashNode[Object] */;
300 val* var5 /* : nullable HashNode[Object] */;
301 val* var6 /* : null */;
302 val* var7 /* : nullable NativeArray[nullable HashNode[Object]] */;
303 val* var8 /* : nullable Object */;
304 val* var_next /* var next: nullable HashNode[Object] */;
305 val* var9 /* : nullable NativeArray[nullable HashNode[Object]] */;
306 val* var10 /* : null */;
307 short int var11 /* : Bool */;
308 val* var12 /* : Object */;
309 short int var13 /* : Bool */;
310 int cltype14;
311 int idtype15;
312 const struct type* type_struct16;
313 const char* var_class_name17;
314 long var18 /* : Int */;
315 long var_l /* var l: Int */;
316 long var19 /* : Int */;
317 long var20 /* : Int */;
318 long var22 /* : Int */;
319 long var23 /* : Int */;
320 long var24 /* : Int */;
321 long var26 /* : Int */;
322 long var27 /* : Int */;
323 long var28 /* : Int */;
324 long var30 /* : Int */;
325 long var31 /* : Int */;
326 long var32 /* : Int */;
327 long var34 /* : Int */;
328 long var35 /* : Int */;
329 short int var36 /* : Bool */;
330 short int var38 /* : Bool */;
331 int cltype39;
332 int idtype40;
333 const char* var_class_name41;
334 short int var42 /* : Bool */;
335 long var43 /* : Int */;
336 long var44 /* : Int */;
337 long var46 /* : Int */;
338 /* Covariant cast for argument 1 (node) <p1:HashNode[Object]> isa HashCollection#1 */
339 /* <p1:HashNode[Object]> isa HashCollection#1 */
340 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashCollection_FT1];
341 cltype = type_struct->color;
342 idtype = type_struct->id;
343 if(cltype >= p1->type->table_size) {
344 var = 0;
345 } else {
346 var = p1->type->type_table[cltype] == idtype;
347 }
348 if (!var) {
349 var_class_name = p1 == NULL ? "null" : p1->type->name;
350 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashCollection#1", var_class_name);
351 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 69);
352 show_backtrace(1);
353 }
354 var_index = p0;
355 var_node = p1;
356 var1 = self->attrs[COLOR_hash_collection__HashCollection___first_item].val; /* _first_item on <self:HashCollection[Object, HashNode[Object]]> */
357 var2 = NULL;
358 if (var1 == NULL) {
359 var3 = 1; /* is null */
360 } else {
361 var3 = 0; /* arg is null but recv is not */
362 }
363 if (var3){
364 self->attrs[COLOR_hash_collection__HashCollection___first_item].val = var_node; /* _first_item on <self:HashCollection[Object, HashNode[Object]]> */
365 } else {
366 var4 = self->attrs[COLOR_hash_collection__HashCollection___last_item].val; /* _last_item on <self:HashCollection[Object, HashNode[Object]]> */
367 if (var4 == NULL) {
368 fprintf(stderr, "Runtime error: %s", "Receiver is null");
369 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 76);
370 show_backtrace(1);
371 }
372 var4->attrs[COLOR_hash_collection__HashNode___next_item].val = var_node; /* _next_item on <var4:nullable HashNode[Object]> */
373 }
374 var5 = self->attrs[COLOR_hash_collection__HashCollection___last_item].val; /* _last_item on <self:HashCollection[Object, HashNode[Object]]> */
375 var_node->attrs[COLOR_hash_collection__HashNode___prev_item].val = var5; /* _prev_item on <var_node:HashNode[Object]> */
376 var6 = NULL;
377 var_node->attrs[COLOR_hash_collection__HashNode___next_item].val = var6; /* _next_item on <var_node:HashNode[Object]> */
378 self->attrs[COLOR_hash_collection__HashCollection___last_item].val = var_node; /* _last_item on <self:HashCollection[Object, HashNode[Object]]> */
379 var7 = self->attrs[COLOR_hash_collection__HashCollection___array].val; /* _array on <self:HashCollection[Object, HashNode[Object]]> */
380 if (var7 == NULL) {
381 fprintf(stderr, "Runtime error: %s", "Receiver is null");
382 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 83);
383 show_backtrace(1);
384 } else {
385 var8 = ((val* (*)(val*, long))(var7->class->vft[COLOR_array__NativeArray___91d_93d]))(var7, var_index) /* [] on <var7:nullable NativeArray[nullable HashNode[Object]]>*/;
386 }
387 var_next = var8;
388 var9 = self->attrs[COLOR_hash_collection__HashCollection___array].val; /* _array on <self:HashCollection[Object, HashNode[Object]]> */
389 if (var9 == NULL) {
390 fprintf(stderr, "Runtime error: %s", "Receiver is null");
391 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 84);
392 show_backtrace(1);
393 } else {
394 ((void (*)(val*, long, val*))(var9->class->vft[COLOR_array__NativeArray___91d_93d_61d]))(var9, var_index, var_node) /* []= on <var9:nullable NativeArray[nullable HashNode[Object]]>*/;
395 }
396 var_node->attrs[COLOR_hash_collection__HashNode___next_in_bucklet].val = var_next; /* _next_in_bucklet on <var_node:HashNode[Object]> */
397 var10 = NULL;
398 if (var_next == NULL) {
399 var11 = 0; /* is null */
400 } else {
401 var11 = 1; /* arg is null and recv is not */
402 }
403 if (var11){
404 var_next->attrs[COLOR_hash_collection__HashNode___prev_in_bucklet].val = var_node; /* _prev_in_bucklet on <var_next:nullable HashNode[Object](HashNode[Object])> */
405 } else {
406 }
407 var12 = var_node->attrs[COLOR_hash_collection__HashNode___key].val; /* _key on <var_node:HashNode[Object]> */
408 if (var12 == NULL) {
409 fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _key");
410 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 88);
411 show_backtrace(1);
412 }
413 /* <var12:Object> isa nullable HashCollection#0 */
414 type_struct16 = self->type->resolution_table->types[COLOR_nullable_hash_collection__HashCollection_FT0];
415 cltype14 = type_struct16->color;
416 idtype15 = type_struct16->id;
417 if(cltype14 >= var12->type->table_size) {
418 var13 = 0;
419 } else {
420 var13 = var12->type->type_table[cltype14] == idtype15;
421 }
422 if (!var13) {
423 var_class_name17 = var12 == NULL ? "null" : var12->type->name;
424 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "nullable HashCollection#0", var_class_name17);
425 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 88);
426 show_backtrace(1);
427 }
428 self->attrs[COLOR_hash_collection__HashCollection___last_accessed_key].val = var12; /* _last_accessed_key on <self:HashCollection[Object, HashNode[Object]]> */
429 self->attrs[COLOR_hash_collection__HashCollection___last_accessed_node].val = var_node; /* _last_accessed_node on <self:HashCollection[Object, HashNode[Object]]> */
430 var18 = self->attrs[COLOR_hash_collection__HashCollection___length].l; /* _length on <self:HashCollection[Object, HashNode[Object]]> */
431 var_l = var18;
432 var19 = 1;
433 { /* Inline kernel#Int#+ (var_l,var19) */
434 var22 = var_l + var19;
435 var20 = var22;
436 goto RET_LABEL21;
437 RET_LABEL21:(void)0;
438 }
439 self->attrs[COLOR_hash_collection__HashCollection___length].l = var20; /* _length on <self:HashCollection[Object, HashNode[Object]]> */
440 var23 = 5;
441 { /* Inline kernel#Int#+ (var_l,var23) */
442 var26 = var_l + var23;
443 var24 = var26;
444 goto RET_LABEL25;
445 RET_LABEL25:(void)0;
446 }
447 var27 = 3;
448 { /* Inline kernel#Int#* (var24,var27) */
449 var30 = var24 * var27;
450 var28 = var30;
451 goto RET_LABEL29;
452 RET_LABEL29:(void)0;
453 }
454 var31 = 2;
455 { /* Inline kernel#Int#/ (var28,var31) */
456 var34 = var28 / var31;
457 var32 = var34;
458 goto RET_LABEL33;
459 RET_LABEL33:(void)0;
460 }
461 var_l = var32;
462 var35 = self->attrs[COLOR_hash_collection__HashCollection___capacity].l; /* _capacity on <self:HashCollection[Object, HashNode[Object]]> */
463 { /* Inline kernel#Int#>= (var_l,var35) */
464 /* Covariant cast for argument 0 (i) <var35:Int> isa OTHER */
465 /* <var35:Int> isa OTHER */
466 var38 = 1; /* easy <var35:Int> isa OTHER*/
467 if (!var38) {
468 var_class_name41 = type_kernel__Int.name;
469 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name41);
470 fprintf(stderr, " (%s:%d)\n", "lib/standard/kernel.nit", 266);
471 show_backtrace(1);
472 }
473 var42 = var_l >= var35;
474 var36 = var42;
475 goto RET_LABEL37;
476 RET_LABEL37:(void)0;
477 }
478 if (var36){
479 var43 = 2;
480 { /* Inline kernel#Int#* (var_l,var43) */
481 var46 = var_l * var43;
482 var44 = var46;
483 goto RET_LABEL45;
484 RET_LABEL45:(void)0;
485 }
486 ((void (*)(val*, long))(self->class->vft[COLOR_hash_collection__HashCollection__enlarge]))(self, var44) /* enlarge on <self:HashCollection[Object, HashNode[Object]]>*/;
487 } else {
488 }
489 RET_LABEL:;
490 }
491 /* method hash_collection#HashCollection#store for (self: Object, Int, HashNode[Object]) */
492 void VIRTUAL_hash_collection__HashCollection__store(val* self, long p0, val* p1) {
493 hash_collection__HashCollection__store(self, p0, p1);
494 RET_LABEL:;
495 }
496 /* method hash_collection#HashCollection#remove_node for (self: HashCollection[Object, HashNode[Object]], Object) */
497 void hash_collection__HashCollection__remove_node(val* self, val* p0) {
498 short int var /* : Bool */;
499 int cltype;
500 int idtype;
501 const struct type* type_struct;
502 const char* var_class_name;
503 val* var_k /* var k: Object */;
504 long var1 /* : Int */;
505 long var_i /* var i: Int */;
506 val* var2 /* : nullable HashNode[Object] */;
507 val* var_node /* var node: nullable HashNode[Object] */;
508 val* var3 /* : null */;
509 short int var4 /* : Bool */;
510 val* var5 /* : nullable HashNode[Object] */;
511 val* var_prev /* var prev: nullable HashNode[Object] */;
512 val* var6 /* : nullable HashNode[Object] */;
513 val* var_next /* var next: nullable HashNode[Object] */;
514 val* var7 /* : null */;
515 short int var8 /* : Bool */;
516 short int var9 /* : Bool */;
517 int cltype10;
518 int idtype11;
519 const struct type* type_struct12;
520 const char* var_class_name13;
521 val* var14 /* : null */;
522 short int var15 /* : Bool */;
523 short int var16 /* : Bool */;
524 int cltype17;
525 int idtype18;
526 const struct type* type_struct19;
527 const char* var_class_name20;
528 val* var_ /* var : HashCollection[Object, HashNode[Object]] */;
529 long var21 /* : Int */;
530 long var22 /* : Int */;
531 long var23 /* : Int */;
532 long var25 /* : Int */;
533 val* var26 /* : nullable HashNode[Object] */;
534 val* var27 /* : nullable HashNode[Object] */;
535 val* var28 /* : null */;
536 short int var29 /* : Bool */;
537 val* var30 /* : nullable NativeArray[nullable HashNode[Object]] */;
538 short int var31 /* : Bool */;
539 int cltype32;
540 int idtype33;
541 const struct type* type_struct34;
542 const char* var_class_name35;
543 val* var36 /* : null */;
544 short int var37 /* : Bool */;
545 val* var38 /* : null */;
546 /* Covariant cast for argument 0 (k) <p0:Object> isa HashCollection#0 */
547 /* <p0:Object> isa HashCollection#0 */
548 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashCollection_FT0];
549 cltype = type_struct->color;
550 idtype = type_struct->id;
551 if(cltype >= p0->type->table_size) {
552 var = 0;
553 } else {
554 var = p0->type->type_table[cltype] == idtype;
555 }
556 if (!var) {
557 var_class_name = p0 == NULL ? "null" : p0->type->name;
558 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashCollection#0", var_class_name);
559 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 100);
560 show_backtrace(1);
561 }
562 var_k = p0;
563 var1 = ((long (*)(val*, val*))(self->class->vft[COLOR_hash_collection__HashCollection__index_at]))(self, var_k) /* index_at on <self:HashCollection[Object, HashNode[Object]]>*/;
564 var_i = var1;
565 var2 = ((val* (*)(val*, long, val*))(self->class->vft[COLOR_hash_collection__HashCollection__node_at_idx]))(self, var_i, var_k) /* node_at_idx on <self:HashCollection[Object, HashNode[Object]]>*/;
566 var_node = var2;
567 var3 = NULL;
568 if (var_node == NULL) {
569 var4 = 1; /* is null */
570 } else {
571 var4 = 0; /* arg is null but recv is not */
572 }
573 if (var4){
574 goto RET_LABEL;
575 } else {
576 }
577 var5 = var_node->attrs[COLOR_hash_collection__HashNode___prev_item].val; /* _prev_item on <var_node:nullable HashNode[Object](HashNode[Object])> */
578 var_prev = var5;
579 var6 = var_node->attrs[COLOR_hash_collection__HashNode___next_item].val; /* _next_item on <var_node:nullable HashNode[Object](HashNode[Object])> */
580 var_next = var6;
581 var7 = NULL;
582 if (var_prev == NULL) {
583 var8 = 0; /* is null */
584 } else {
585 var8 = 1; /* arg is null and recv is not */
586 }
587 if (var8){
588 var_prev->attrs[COLOR_hash_collection__HashNode___next_item].val = var_next; /* _next_item on <var_prev:nullable HashNode[Object](HashNode[Object])> */
589 } else {
590 /* <var_next:nullable HashNode[Object]> isa nullable HashCollection#1 */
591 type_struct12 = self->type->resolution_table->types[COLOR_nullable_hash_collection__HashCollection_FT1];
592 cltype10 = type_struct12->color;
593 idtype11 = type_struct12->id;
594 if(var_next == NULL) {
595 var9 = 1;
596 } else {
597 if(cltype10 >= var_next->type->table_size) {
598 var9 = 0;
599 } else {
600 var9 = var_next->type->type_table[cltype10] == idtype11;
601 }
602 }
603 if (!var9) {
604 var_class_name13 = var_next == NULL ? "null" : var_next->type->name;
605 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "nullable HashCollection#1", var_class_name13);
606 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 113);
607 show_backtrace(1);
608 }
609 self->attrs[COLOR_hash_collection__HashCollection___first_item].val = var_next; /* _first_item on <self:HashCollection[Object, HashNode[Object]]> */
610 }
611 var14 = NULL;
612 if (var_next == NULL) {
613 var15 = 0; /* is null */
614 } else {
615 var15 = 1; /* arg is null and recv is not */
616 }
617 if (var15){
618 var_next->attrs[COLOR_hash_collection__HashNode___prev_item].val = var_prev; /* _prev_item on <var_next:nullable HashNode[Object](HashNode[Object])> */
619 } else {
620 /* <var_prev:nullable HashNode[Object]> isa nullable HashCollection#1 */
621 type_struct19 = self->type->resolution_table->types[COLOR_nullable_hash_collection__HashCollection_FT1];
622 cltype17 = type_struct19->color;
623 idtype18 = type_struct19->id;
624 if(var_prev == NULL) {
625 var16 = 1;
626 } else {
627 if(cltype17 >= var_prev->type->table_size) {
628 var16 = 0;
629 } else {
630 var16 = var_prev->type->type_table[cltype17] == idtype18;
631 }
632 }
633 if (!var16) {
634 var_class_name20 = var_prev == NULL ? "null" : var_prev->type->name;
635 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "nullable HashCollection#1", var_class_name20);
636 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 118);
637 show_backtrace(1);
638 }
639 self->attrs[COLOR_hash_collection__HashCollection___last_item].val = var_prev; /* _last_item on <self:HashCollection[Object, HashNode[Object]]> */
640 }
641 var_ = self;
642 var21 = var_->attrs[COLOR_hash_collection__HashCollection___length].l; /* _length on <var_:HashCollection[Object, HashNode[Object]]> */
643 var22 = 1;
644 { /* Inline kernel#Int#- (var21,var22) */
645 var25 = var21 - var22;
646 var23 = var25;
647 goto RET_LABEL24;
648 RET_LABEL24:(void)0;
649 }
650 var_->attrs[COLOR_hash_collection__HashCollection___length].l = var23; /* _length on <var_:HashCollection[Object, HashNode[Object]]> */
651 var26 = var_node->attrs[COLOR_hash_collection__HashNode___prev_in_bucklet].val; /* _prev_in_bucklet on <var_node:nullable HashNode[Object](HashNode[Object])> */
652 var_prev = var26;
653 var27 = var_node->attrs[COLOR_hash_collection__HashNode___next_in_bucklet].val; /* _next_in_bucklet on <var_node:nullable HashNode[Object](HashNode[Object])> */
654 var_next = var27;
655 var28 = NULL;
656 if (var_prev == NULL) {
657 var29 = 0; /* is null */
658 } else {
659 var29 = 1; /* arg is null and recv is not */
660 }
661 if (var29){
662 var_prev->attrs[COLOR_hash_collection__HashNode___next_in_bucklet].val = var_next; /* _next_in_bucklet on <var_prev:nullable HashNode[Object](HashNode[Object])> */
663 } else {
664 var30 = self->attrs[COLOR_hash_collection__HashCollection___array].val; /* _array on <self:HashCollection[Object, HashNode[Object]]> */
665 /* <var_next:nullable HashNode[Object]> isa nullable HashCollection#1 */
666 type_struct34 = self->type->resolution_table->types[COLOR_nullable_hash_collection__HashCollection_FT1];
667 cltype32 = type_struct34->color;
668 idtype33 = type_struct34->id;
669 if(var_next == NULL) {
670 var31 = 1;
671 } else {
672 if(cltype32 >= var_next->type->table_size) {
673 var31 = 0;
674 } else {
675 var31 = var_next->type->type_table[cltype32] == idtype33;
676 }
677 }
678 if (!var31) {
679 var_class_name35 = var_next == NULL ? "null" : var_next->type->name;
680 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "nullable HashCollection#1", var_class_name35);
681 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 128);
682 show_backtrace(1);
683 }
684 if (var30 == NULL) {
685 fprintf(stderr, "Runtime error: %s", "Receiver is null");
686 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 128);
687 show_backtrace(1);
688 } else {
689 ((void (*)(val*, long, val*))(var30->class->vft[COLOR_array__NativeArray___91d_93d_61d]))(var30, var_i, var_next) /* []= on <var30:nullable NativeArray[nullable HashNode[Object]]>*/;
690 }
691 }
692 var36 = NULL;
693 if (var_next == NULL) {
694 var37 = 0; /* is null */
695 } else {
696 var37 = 1; /* arg is null and recv is not */
697 }
698 if (var37){
699 var_next->attrs[COLOR_hash_collection__HashNode___prev_in_bucklet].val = var_prev; /* _prev_in_bucklet on <var_next:nullable HashNode[Object](HashNode[Object])> */
700 } else {
701 }
702 var38 = NULL;
703 self->attrs[COLOR_hash_collection__HashCollection___last_accessed_key].val = var38; /* _last_accessed_key on <self:HashCollection[Object, HashNode[Object]]> */
704 RET_LABEL:;
705 }
706 /* method hash_collection#HashCollection#remove_node for (self: Object, Object) */
707 void VIRTUAL_hash_collection__HashCollection__remove_node(val* self, val* p0) {
708 hash_collection__HashCollection__remove_node(self, p0);
709 RET_LABEL:;
710 }
711 /* method hash_collection#HashCollection#raz for (self: HashCollection[Object, HashNode[Object]]) */
712 void hash_collection__HashCollection__raz(val* self) {
713 long var /* : Int */;
714 long var1 /* : Int */;
715 long var2 /* : Int */;
716 long var4 /* : Int */;
717 long var_i /* var i: Int */;
718 long var5 /* : Int */;
719 short int var6 /* : Bool */;
720 short int var8 /* : Bool */;
721 int cltype;
722 int idtype;
723 const char* var_class_name;
724 short int var9 /* : Bool */;
725 val* var10 /* : nullable NativeArray[nullable HashNode[Object]] */;
726 val* var11 /* : null */;
727 long var12 /* : Int */;
728 long var13 /* : Int */;
729 long var15 /* : Int */;
730 long var16 /* : Int */;
731 val* var17 /* : null */;
732 val* var18 /* : null */;
733 val* var19 /* : null */;
734 var = self->attrs[COLOR_hash_collection__HashCollection___capacity].l; /* _capacity on <self:HashCollection[Object, HashNode[Object]]> */
735 var1 = 1;
736 { /* Inline kernel#Int#- (var,var1) */
737 var4 = var - var1;
738 var2 = var4;
739 goto RET_LABEL3;
740 RET_LABEL3:(void)0;
741 }
742 var_i = var2;
743 for(;;) {
744 var5 = 0;
745 { /* Inline kernel#Int#>= (var_i,var5) */
746 /* Covariant cast for argument 0 (i) <var5:Int> isa OTHER */
747 /* <var5:Int> isa OTHER */
748 var8 = 1; /* easy <var5:Int> isa OTHER*/
749 if (!var8) {
750 var_class_name = type_kernel__Int.name;
751 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name);
752 fprintf(stderr, " (%s:%d)\n", "lib/standard/kernel.nit", 266);
753 show_backtrace(1);
754 }
755 var9 = var_i >= var5;
756 var6 = var9;
757 goto RET_LABEL7;
758 RET_LABEL7:(void)0;
759 }
760 if (!var6) break;
761 var10 = self->attrs[COLOR_hash_collection__HashCollection___array].val; /* _array on <self:HashCollection[Object, HashNode[Object]]> */
762 var11 = NULL;
763 if (var10 == NULL) {
764 fprintf(stderr, "Runtime error: %s", "Receiver is null");
765 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 142);
766 show_backtrace(1);
767 } else {
768 ((void (*)(val*, long, val*))(var10->class->vft[COLOR_array__NativeArray___91d_93d_61d]))(var10, var_i, var11) /* []= on <var10:nullable NativeArray[nullable HashNode[Object]]>*/;
769 }
770 var12 = 1;
771 { /* Inline kernel#Int#- (var_i,var12) */
772 var15 = var_i - var12;
773 var13 = var15;
774 goto RET_LABEL14;
775 RET_LABEL14:(void)0;
776 }
777 var_i = var13;
778 CONTINUE_label: (void)0;
779 }
780 BREAK_label: (void)0;
781 var16 = 0;
782 self->attrs[COLOR_hash_collection__HashCollection___length].l = var16; /* _length on <self:HashCollection[Object, HashNode[Object]]> */
783 var17 = NULL;
784 self->attrs[COLOR_hash_collection__HashCollection___first_item].val = var17; /* _first_item on <self:HashCollection[Object, HashNode[Object]]> */
785 var18 = NULL;
786 self->attrs[COLOR_hash_collection__HashCollection___last_item].val = var18; /* _last_item on <self:HashCollection[Object, HashNode[Object]]> */
787 var19 = NULL;
788 self->attrs[COLOR_hash_collection__HashCollection___last_accessed_key].val = var19; /* _last_accessed_key on <self:HashCollection[Object, HashNode[Object]]> */
789 RET_LABEL:;
790 }
791 /* method hash_collection#HashCollection#raz for (self: Object) */
792 void VIRTUAL_hash_collection__HashCollection__raz(val* self) {
793 hash_collection__HashCollection__raz(self);
794 RET_LABEL:;
795 }
796 /* method hash_collection#HashCollection#enlarge for (self: HashCollection[Object, HashNode[Object]], Int) */
797 void hash_collection__HashCollection__enlarge(val* self, long p0) {
798 long var_cap /* var cap: Int */;
799 long var /* : Int */;
800 long var_old_cap /* var old_cap: Int */;
801 long var1 /* : Int */;
802 long var2 /* : Int */;
803 long var3 /* : Int */;
804 long var5 /* : Int */;
805 short int var6 /* : Bool */;
806 short int var8 /* : Bool */;
807 int cltype;
808 int idtype;
809 const char* var_class_name;
810 short int var9 /* : Bool */;
811 long var10 /* : Int */;
812 long var11 /* : Int */;
813 long var12 /* : Int */;
814 long var14 /* : Int */;
815 long var15 /* : Int */;
816 short int var16 /* : Bool */;
817 short int var18 /* : Bool */;
818 int cltype19;
819 int idtype20;
820 const char* var_class_name21;
821 short int var22 /* : Bool */;
822 val* var23 /* : null */;
823 val* var24 /* : NativeArray[nullable Object] */;
824 val* var_new_array /* var new_array: NativeArray[nullable HashNode[Object]] */;
825 long var25 /* : Int */;
826 long var26 /* : Int */;
827 long var28 /* : Int */;
828 long var_i /* var i: Int */;
829 long var29 /* : Int */;
830 short int var30 /* : Bool */;
831 short int var32 /* : Bool */;
832 int cltype33;
833 int idtype34;
834 const char* var_class_name35;
835 short int var36 /* : Bool */;
836 val* var37 /* : null */;
837 long var38 /* : Int */;
838 long var39 /* : Int */;
839 long var41 /* : Int */;
840 long var42 /* : Int */;
841 short int var43 /* : Bool */;
842 short int var45 /* : Bool */;
843 int cltype46;
844 int idtype47;
845 const char* var_class_name48;
846 short int var49 /* : Bool */;
847 val* var50 /* : nullable HashNode[Object] */;
848 val* var_node /* var node: nullable HashNode[Object] */;
849 val* var51 /* : null */;
850 short int var52 /* : Bool */;
851 val* var53 /* : Object */;
852 short int var54 /* : Bool */;
853 int cltype55;
854 int idtype56;
855 const struct type* type_struct;
856 const char* var_class_name57;
857 long var58 /* : Int */;
858 long var_index /* var index: Int */;
859 val* var59 /* : nullable Object */;
860 val* var_next /* var next: nullable HashNode[Object] */;
861 val* var60 /* : null */;
862 val* var61 /* : null */;
863 short int var62 /* : Bool */;
864 val* var63 /* : nullable HashNode[Object] */;
865 short int var64 /* : Bool */;
866 int cltype65;
867 int idtype66;
868 const struct type* type_struct67;
869 const char* var_class_name68;
870 var_cap = p0;
871 var = self->attrs[COLOR_hash_collection__HashCollection___capacity].l; /* _capacity on <self:HashCollection[Object, HashNode[Object]]> */
872 var_old_cap = var;
873 var1 = self->attrs[COLOR_hash_collection__HashCollection___length].l; /* _length on <self:HashCollection[Object, HashNode[Object]]> */
874 var2 = 1;
875 { /* Inline kernel#Int#+ (var1,var2) */
876 var5 = var1 + var2;
877 var3 = var5;
878 goto RET_LABEL4;
879 RET_LABEL4:(void)0;
880 }
881 { /* Inline kernel#Int#< (var_cap,var3) */
882 /* Covariant cast for argument 0 (i) <var3:Int> isa OTHER */
883 /* <var3:Int> isa OTHER */
884 var8 = 1; /* easy <var3:Int> isa OTHER*/
885 if (!var8) {
886 var_class_name = type_kernel__Int.name;
887 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name);
888 fprintf(stderr, " (%s:%d)\n", "lib/standard/kernel.nit", 265);
889 show_backtrace(1);
890 }
891 var9 = var_cap < var3;
892 var6 = var9;
893 goto RET_LABEL7;
894 RET_LABEL7:(void)0;
895 }
896 if (var6){
897 var10 = self->attrs[COLOR_hash_collection__HashCollection___length].l; /* _length on <self:HashCollection[Object, HashNode[Object]]> */
898 var11 = 1;
899 { /* Inline kernel#Int#+ (var10,var11) */
900 var14 = var10 + var11;
901 var12 = var14;
902 goto RET_LABEL13;
903 RET_LABEL13:(void)0;
904 }
905 var_cap = var12;
906 } else {
907 }
908 var15 = self->attrs[COLOR_hash_collection__HashCollection___capacity].l; /* _capacity on <self:HashCollection[Object, HashNode[Object]]> */
909 { /* Inline kernel#Int#<= (var_cap,var15) */
910 /* Covariant cast for argument 0 (i) <var15:Int> isa OTHER */
911 /* <var15:Int> isa OTHER */
912 var18 = 1; /* easy <var15:Int> isa OTHER*/
913 if (!var18) {
914 var_class_name21 = type_kernel__Int.name;
915 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name21);
916 fprintf(stderr, " (%s:%d)\n", "lib/standard/kernel.nit", 264);
917 show_backtrace(1);
918 }
919 var22 = var_cap <= var15;
920 var16 = var22;
921 goto RET_LABEL17;
922 RET_LABEL17:(void)0;
923 }
924 if (var16){
925 goto RET_LABEL;
926 } else {
927 }
928 self->attrs[COLOR_hash_collection__HashCollection___capacity].l = var_cap; /* _capacity on <self:HashCollection[Object, HashNode[Object]]> */
929 var23 = NULL;
930 self->attrs[COLOR_hash_collection__HashCollection___last_accessed_key].val = var23; /* _last_accessed_key on <self:HashCollection[Object, HashNode[Object]]> */
931 var24 = ((val* (*)(val*, long))(self->class->vft[COLOR_array__ArrayCapable__calloc_array]))(self, var_cap) /* calloc_array on <self:HashCollection[Object, HashNode[Object]]>*/;
932 var_new_array = var24;
933 self->attrs[COLOR_hash_collection__HashCollection___array].val = var_new_array; /* _array on <self:HashCollection[Object, HashNode[Object]]> */
934 var25 = 1;
935 { /* Inline kernel#Int#- (var_cap,var25) */
936 var28 = var_cap - var25;
937 var26 = var28;
938 goto RET_LABEL27;
939 RET_LABEL27:(void)0;
940 }
941 var_i = var26;
942 for(;;) {
943 var29 = 0;
944 { /* Inline kernel#Int#>= (var_i,var29) */
945 /* Covariant cast for argument 0 (i) <var29:Int> isa OTHER */
946 /* <var29:Int> isa OTHER */
947 var32 = 1; /* easy <var29:Int> isa OTHER*/
948 if (!var32) {
949 var_class_name35 = type_kernel__Int.name;
950 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name35);
951 fprintf(stderr, " (%s:%d)\n", "lib/standard/kernel.nit", 266);
952 show_backtrace(1);
953 }
954 var36 = var_i >= var29;
955 var30 = var36;
956 goto RET_LABEL31;
957 RET_LABEL31:(void)0;
958 }
959 if (!var30) break;
960 var37 = NULL;
961 ((void (*)(val*, long, val*))(var_new_array->class->vft[COLOR_array__NativeArray___91d_93d_61d]))(var_new_array, var_i, var37) /* []= on <var_new_array:NativeArray[nullable HashNode[Object]]>*/;
962 var38 = 1;
963 { /* Inline kernel#Int#- (var_i,var38) */
964 var41 = var_i - var38;
965 var39 = var41;
966 goto RET_LABEL40;
967 RET_LABEL40:(void)0;
968 }
969 var_i = var39;
970 CONTINUE_label: (void)0;
971 }
972 BREAK_label: (void)0;
973 var42 = self->attrs[COLOR_hash_collection__HashCollection___capacity].l; /* _capacity on <self:HashCollection[Object, HashNode[Object]]> */
974 { /* Inline kernel#Int#<= (var42,var_old_cap) */
975 /* Covariant cast for argument 0 (i) <var_old_cap:Int> isa OTHER */
976 /* <var_old_cap:Int> isa OTHER */
977 var45 = 1; /* easy <var_old_cap:Int> isa OTHER*/
978 if (!var45) {
979 var_class_name48 = type_kernel__Int.name;
980 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name48);
981 fprintf(stderr, " (%s:%d)\n", "lib/standard/kernel.nit", 264);
982 show_backtrace(1);
983 }
984 var49 = var42 <= var_old_cap;
985 var43 = var49;
986 goto RET_LABEL44;
987 RET_LABEL44:(void)0;
988 }
989 if (var43){
990 goto RET_LABEL;
991 } else {
992 }
993 var50 = self->attrs[COLOR_hash_collection__HashCollection___first_item].val; /* _first_item on <self:HashCollection[Object, HashNode[Object]]> */
994 var_node = var50;
995 for(;;) {
996 var51 = NULL;
997 if (var_node == NULL) {
998 var52 = 0; /* is null */
999 } else {
1000 var52 = 1; /* arg is null and recv is not */
1001 }
1002 if (!var52) break;
1003 var53 = var_node->attrs[COLOR_hash_collection__HashNode___key].val; /* _key on <var_node:nullable HashNode[Object](HashNode[Object])> */
1004 if (var53 == NULL) {
1005 fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _key");
1006 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 177);
1007 show_backtrace(1);
1008 }
1009 /* <var53:Object> isa HashCollection#0 */
1010 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashCollection_FT0];
1011 cltype55 = type_struct->color;
1012 idtype56 = type_struct->id;
1013 if(cltype55 >= var53->type->table_size) {
1014 var54 = 0;
1015 } else {
1016 var54 = var53->type->type_table[cltype55] == idtype56;
1017 }
1018 if (!var54) {
1019 var_class_name57 = var53 == NULL ? "null" : var53->type->name;
1020 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashCollection#0", var_class_name57);
1021 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 177);
1022 show_backtrace(1);
1023 }
1024 var58 = ((long (*)(val*, val*))(self->class->vft[COLOR_hash_collection__HashCollection__index_at]))(self, var53) /* index_at on <self:HashCollection[Object, HashNode[Object]]>*/;
1025 var_index = var58;
1026 var59 = ((val* (*)(val*, long))(var_new_array->class->vft[COLOR_array__NativeArray___91d_93d]))(var_new_array, var_index) /* [] on <var_new_array:NativeArray[nullable HashNode[Object]]>*/;
1027 var_next = var59;
1028 ((void (*)(val*, long, val*))(var_new_array->class->vft[COLOR_array__NativeArray___91d_93d_61d]))(var_new_array, var_index, var_node) /* []= on <var_new_array:NativeArray[nullable HashNode[Object]]>*/;
1029 var60 = NULL;
1030 var_node->attrs[COLOR_hash_collection__HashNode___prev_in_bucklet].val = var60; /* _prev_in_bucklet on <var_node:nullable HashNode[Object](HashNode[Object])> */
1031 var_node->attrs[COLOR_hash_collection__HashNode___next_in_bucklet].val = var_next; /* _next_in_bucklet on <var_node:nullable HashNode[Object](HashNode[Object])> */
1032 var61 = NULL;
1033 if (var_next == NULL) {
1034 var62 = 0; /* is null */
1035 } else {
1036 var62 = 1; /* arg is null and recv is not */
1037 }
1038 if (var62){
1039 var_next->attrs[COLOR_hash_collection__HashNode___prev_in_bucklet].val = var_node; /* _prev_in_bucklet on <var_next:nullable HashNode[Object](HashNode[Object])> */
1040 } else {
1041 }
1042 var63 = var_node->attrs[COLOR_hash_collection__HashNode___next_item].val; /* _next_item on <var_node:nullable HashNode[Object](HashNode[Object])> */
1043 /* <var63:nullable HashNode[Object]> isa nullable HashCollection#1 */
1044 type_struct67 = self->type->resolution_table->types[COLOR_nullable_hash_collection__HashCollection_FT1];
1045 cltype65 = type_struct67->color;
1046 idtype66 = type_struct67->id;
1047 if(var63 == NULL) {
1048 var64 = 1;
1049 } else {
1050 if(cltype65 >= var63->type->table_size) {
1051 var64 = 0;
1052 } else {
1053 var64 = var63->type->type_table[cltype65] == idtype66;
1054 }
1055 }
1056 if (!var64) {
1057 var_class_name68 = var63 == NULL ? "null" : var63->type->name;
1058 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "nullable HashCollection#1", var_class_name68);
1059 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 184);
1060 show_backtrace(1);
1061 }
1062 var_node = var63;
1063 CONTINUE_label69: (void)0;
1064 }
1065 BREAK_label69: (void)0;
1066 RET_LABEL:;
1067 }
1068 /* method hash_collection#HashCollection#enlarge for (self: Object, Int) */
1069 void VIRTUAL_hash_collection__HashCollection__enlarge(val* self, long p0) {
1070 hash_collection__HashCollection__enlarge(self, p0);
1071 RET_LABEL:;
1072 }
1073 /* method hash_collection#HashCollection#init for (self: HashCollection[Object, HashNode[Object]]) */
1074 void hash_collection__HashCollection__init(val* self) {
1075 RET_LABEL:;
1076 }
1077 /* method hash_collection#HashCollection#init for (self: Object) */
1078 void VIRTUAL_hash_collection__HashCollection__init(val* self) {
1079 hash_collection__HashCollection__init(self);
1080 RET_LABEL:;
1081 }
1082 /* method hash_collection#HashNode#next_item for (self: HashNode[Object]): nullable HashNode[Object] */
1083 val* hash_collection__HashNode__next_item(val* self) {
1084 val* var /* : nullable HashNode[Object] */;
1085 val* var1 /* : nullable HashNode[Object] */;
1086 var1 = self->attrs[COLOR_hash_collection__HashNode___next_item].val; /* _next_item on <self:HashNode[Object]> */
1087 var = var1;
1088 RET_LABEL:;
1089 return var;
1090 }
1091 /* method hash_collection#HashNode#next_item for (self: Object): nullable HashNode[Object] */
1092 val* VIRTUAL_hash_collection__HashNode__next_item(val* self) {
1093 val* var /* : nullable HashNode[Object] */;
1094 val* var1 /* : nullable HashNode[Object] */;
1095 var1 = hash_collection__HashNode__next_item(self);
1096 var = var1;
1097 RET_LABEL:;
1098 return var;
1099 }
1100 /* method hash_collection#HashNode#next_item= for (self: HashNode[Object], nullable HashNode[Object]) */
1101 void hash_collection__HashNode__next_item_61d(val* self, val* p0) {
1102 short int var /* : Bool */;
1103 int cltype;
1104 int idtype;
1105 const struct type* type_struct;
1106 const char* var_class_name;
1107 /* Covariant cast for argument 0 (next_item) <p0:nullable HashNode[Object]> isa nullable N */
1108 /* <p0:nullable HashNode[Object]> isa nullable N */
1109 type_struct = self->type->resolution_table->types[COLOR_nullable_hash_collection__HashNode_VTN];
1110 cltype = type_struct->color;
1111 idtype = type_struct->id;
1112 if(p0 == NULL) {
1113 var = 1;
1114 } else {
1115 if(cltype >= p0->type->table_size) {
1116 var = 0;
1117 } else {
1118 var = p0->type->type_table[cltype] == idtype;
1119 }
1120 }
1121 if (!var) {
1122 var_class_name = p0 == NULL ? "null" : p0->type->name;
1123 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "nullable N", var_class_name);
1124 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 192);
1125 show_backtrace(1);
1126 }
1127 self->attrs[COLOR_hash_collection__HashNode___next_item].val = p0; /* _next_item on <self:HashNode[Object]> */
1128 RET_LABEL:;
1129 }
1130 /* method hash_collection#HashNode#next_item= for (self: Object, nullable HashNode[Object]) */
1131 void VIRTUAL_hash_collection__HashNode__next_item_61d(val* self, val* p0) {
1132 hash_collection__HashNode__next_item_61d(self, p0);
1133 RET_LABEL:;
1134 }
1135 /* method hash_collection#HashNode#prev_item for (self: HashNode[Object]): nullable HashNode[Object] */
1136 val* hash_collection__HashNode__prev_item(val* self) {
1137 val* var /* : nullable HashNode[Object] */;
1138 val* var1 /* : nullable HashNode[Object] */;
1139 var1 = self->attrs[COLOR_hash_collection__HashNode___prev_item].val; /* _prev_item on <self:HashNode[Object]> */
1140 var = var1;
1141 RET_LABEL:;
1142 return var;
1143 }
1144 /* method hash_collection#HashNode#prev_item for (self: Object): nullable HashNode[Object] */
1145 val* VIRTUAL_hash_collection__HashNode__prev_item(val* self) {
1146 val* var /* : nullable HashNode[Object] */;
1147 val* var1 /* : nullable HashNode[Object] */;
1148 var1 = hash_collection__HashNode__prev_item(self);
1149 var = var1;
1150 RET_LABEL:;
1151 return var;
1152 }
1153 /* method hash_collection#HashNode#prev_item= for (self: HashNode[Object], nullable HashNode[Object]) */
1154 void hash_collection__HashNode__prev_item_61d(val* self, val* p0) {
1155 short int var /* : Bool */;
1156 int cltype;
1157 int idtype;
1158 const struct type* type_struct;
1159 const char* var_class_name;
1160 /* Covariant cast for argument 0 (prev_item) <p0:nullable HashNode[Object]> isa nullable N */
1161 /* <p0:nullable HashNode[Object]> isa nullable N */
1162 type_struct = self->type->resolution_table->types[COLOR_nullable_hash_collection__HashNode_VTN];
1163 cltype = type_struct->color;
1164 idtype = type_struct->id;
1165 if(p0 == NULL) {
1166 var = 1;
1167 } else {
1168 if(cltype >= p0->type->table_size) {
1169 var = 0;
1170 } else {
1171 var = p0->type->type_table[cltype] == idtype;
1172 }
1173 }
1174 if (!var) {
1175 var_class_name = p0 == NULL ? "null" : p0->type->name;
1176 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "nullable N", var_class_name);
1177 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 193);
1178 show_backtrace(1);
1179 }
1180 self->attrs[COLOR_hash_collection__HashNode___prev_item].val = p0; /* _prev_item on <self:HashNode[Object]> */
1181 RET_LABEL:;
1182 }
1183 /* method hash_collection#HashNode#prev_item= for (self: Object, nullable HashNode[Object]) */
1184 void VIRTUAL_hash_collection__HashNode__prev_item_61d(val* self, val* p0) {
1185 hash_collection__HashNode__prev_item_61d(self, p0);
1186 RET_LABEL:;
1187 }
1188 /* method hash_collection#HashNode#init for (self: HashNode[Object], Object) */
1189 void hash_collection__HashNode__init(val* self, val* p0) {
1190 short int var /* : Bool */;
1191 int cltype;
1192 int idtype;
1193 const struct type* type_struct;
1194 const char* var_class_name;
1195 val* var_k /* var k: Object */;
1196 /* Covariant cast for argument 0 (k) <p0:Object> isa HashNode#0 */
1197 /* <p0:Object> isa HashNode#0 */
1198 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashNode_FT0];
1199 cltype = type_struct->color;
1200 idtype = type_struct->id;
1201 if(cltype >= p0->type->table_size) {
1202 var = 0;
1203 } else {
1204 var = p0->type->type_table[cltype] == idtype;
1205 }
1206 if (!var) {
1207 var_class_name = p0 == NULL ? "null" : p0->type->name;
1208 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashNode#0", var_class_name);
1209 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 196);
1210 show_backtrace(1);
1211 }
1212 var_k = p0;
1213 self->attrs[COLOR_hash_collection__HashNode___key].val = var_k; /* _key on <self:HashNode[Object]> */
1214 RET_LABEL:;
1215 }
1216 /* method hash_collection#HashNode#init for (self: Object, Object) */
1217 void VIRTUAL_hash_collection__HashNode__init(val* self, val* p0) {
1218 hash_collection__HashNode__init(self, p0);
1219 RET_LABEL:;
1220 }
1221 /* method hash_collection#HashMap#[] for (self: HashMap[Object, nullable Object], Object): nullable Object */
1222 val* hash_collection__HashMap___91d_93d(val* self, val* p0) {
1223 val* var /* : nullable Object */;
1224 short int var1 /* : Bool */;
1225 int cltype;
1226 int idtype;
1227 const struct type* type_struct;
1228 const char* var_class_name;
1229 val* var_key /* var key: Object */;
1230 val* var2 /* : nullable HashNode[Object] */;
1231 val* var_c /* var c: nullable HashMapNode[Object, nullable Object] */;
1232 val* var3 /* : null */;
1233 short int var4 /* : Bool */;
1234 val* var5 /* : nullable Object */;
1235 val* var6 /* : nullable Object */;
1236 /* Covariant cast for argument 0 (key) <p0:Object> isa MapRead#0 */
1237 /* <p0:Object> isa MapRead#0 */
1238 type_struct = self->type->resolution_table->types[COLOR_abstract_collection__MapRead_FT0];
1239 cltype = type_struct->color;
1240 idtype = type_struct->id;
1241 if(cltype >= p0->type->table_size) {
1242 var1 = 0;
1243 } else {
1244 var1 = p0->type->type_table[cltype] == idtype;
1245 }
1246 if (!var1) {
1247 var_class_name = p0 == NULL ? "null" : p0->type->name;
1248 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "MapRead#0", var_class_name);
1249 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 208);
1250 show_backtrace(1);
1251 }
1252 var_key = p0;
1253 var2 = ((val* (*)(val*, val*))(self->class->vft[COLOR_hash_collection__HashCollection__node_at]))(self, var_key) /* node_at on <self:HashMap[Object, nullable Object]>*/;
1254 var_c = var2;
1255 var3 = NULL;
1256 if (var_c == NULL) {
1257 var4 = 1; /* is null */
1258 } else {
1259 var4 = 0; /* arg is null but recv is not */
1260 }
1261 if (var4){
1262 var5 = ((val* (*)(val*, val*))(self->class->vft[COLOR_abstract_collection__MapRead__provide_default_value]))(self, var_key) /* provide_default_value on <self:HashMap[Object, nullable Object]>*/;
1263 var = var5;
1264 goto RET_LABEL;
1265 } else {
1266 var6 = var_c->attrs[COLOR_hash_collection__HashMapNode___value].val; /* _value on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
1267 var = var6;
1268 goto RET_LABEL;
1269 }
1270 RET_LABEL:;
1271 return var;
1272 }
1273 /* method hash_collection#HashMap#[] for (self: Object, Object): nullable Object */
1274 val* VIRTUAL_hash_collection__HashMap___91d_93d(val* self, val* p0) {
1275 val* var /* : nullable Object */;
1276 val* var1 /* : nullable Object */;
1277 var1 = hash_collection__HashMap___91d_93d(self, p0);
1278 var = var1;
1279 RET_LABEL:;
1280 return var;
1281 }
1282 /* method hash_collection#HashMap#iterator for (self: HashMap[Object, nullable Object]): HashMapIterator[Object, nullable Object] */
1283 val* hash_collection__HashMap__iterator(val* self) {
1284 val* var /* : HashMapIterator[Object, nullable Object] */;
1285 val* var1 /* : HashMapIterator[Object, nullable Object] */;
1286 var1 = NEW_hash_collection__HashMapIterator(self->type->resolution_table->types[COLOR_hash_collection__HashMapIteratorhash_collection__HashMap_FT0hash_collection__HashMap_FT1]);
1287 ((void (*)(val*, val*))(var1->class->vft[COLOR_hash_collection__HashMapIterator__init]))(var1, self) /* init on <var1:HashMapIterator[Object, nullable Object]>*/;
1288 var = var1;
1289 goto RET_LABEL;
1290 RET_LABEL:;
1291 return var;
1292 }
1293 /* method hash_collection#HashMap#iterator for (self: Object): MapIterator[Object, nullable Object] */
1294 val* VIRTUAL_hash_collection__HashMap__iterator(val* self) {
1295 val* var /* : MapIterator[Object, nullable Object] */;
1296 val* var1 /* : HashMapIterator[Object, nullable Object] */;
1297 var1 = hash_collection__HashMap__iterator(self);
1298 var = var1;
1299 RET_LABEL:;
1300 return var;
1301 }
1302 /* method hash_collection#HashMap#length for (self: HashMap[Object, nullable Object]): Int */
1303 long hash_collection__HashMap__length(val* self) {
1304 long var /* : Int */;
1305 long var1 /* : Int */;
1306 var1 = self->attrs[COLOR_hash_collection__HashCollection___length].l; /* _length on <self:HashMap[Object, nullable Object]> */
1307 var = var1;
1308 goto RET_LABEL;
1309 RET_LABEL:;
1310 return var;
1311 }
1312 /* method hash_collection#HashMap#length for (self: Object): Int */
1313 long VIRTUAL_hash_collection__HashMap__length(val* self) {
1314 long var /* : Int */;
1315 long var1 /* : Int */;
1316 var1 = hash_collection__HashMap__length(self);
1317 var = var1;
1318 RET_LABEL:;
1319 return var;
1320 }
1321 /* method hash_collection#HashMap#is_empty for (self: HashMap[Object, nullable Object]): Bool */
1322 short int hash_collection__HashMap__is_empty(val* self) {
1323 short int var /* : Bool */;
1324 long var1 /* : Int */;
1325 long var2 /* : Int */;
1326 short int var3 /* : Bool */;
1327 short int var5 /* : Bool */;
1328 var1 = self->attrs[COLOR_hash_collection__HashCollection___length].l; /* _length on <self:HashMap[Object, nullable Object]> */
1329 var2 = 0;
1330 { /* Inline kernel#Int#== (var1,var2) */
1331 var5 = var1 == var2;
1332 var3 = var5;
1333 goto RET_LABEL4;
1334 RET_LABEL4:(void)0;
1335 }
1336 var = var3;
1337 goto RET_LABEL;
1338 RET_LABEL:;
1339 return var;
1340 }
1341 /* method hash_collection#HashMap#is_empty for (self: Object): Bool */
1342 short int VIRTUAL_hash_collection__HashMap__is_empty(val* self) {
1343 short int var /* : Bool */;
1344 short int var1 /* : Bool */;
1345 var1 = hash_collection__HashMap__is_empty(self);
1346 var = var1;
1347 RET_LABEL:;
1348 return var;
1349 }
1350 /* method hash_collection#HashMap#[]= for (self: HashMap[Object, nullable Object], Object, nullable Object) */
1351 void hash_collection__HashMap___91d_93d_61d(val* self, val* p0, val* p1) {
1352 short int var /* : Bool */;
1353 int cltype;
1354 int idtype;
1355 const struct type* type_struct;
1356 const char* var_class_name;
1357 short int var1 /* : Bool */;
1358 int cltype2;
1359 int idtype3;
1360 const struct type* type_struct4;
1361 short int is_nullable;
1362 const char* var_class_name5;
1363 val* var_key /* var key: Object */;
1364 val* var_v /* var v: nullable Object */;
1365 long var6 /* : Int */;
1366 long var_i /* var i: Int */;
1367 val* var7 /* : nullable HashNode[Object] */;
1368 val* var_c /* var c: nullable HashMapNode[Object, nullable Object] */;
1369 val* var8 /* : null */;
1370 short int var9 /* : Bool */;
1371 val* var10 /* : HashMapNode[Object, nullable Object] */;
1372 /* Covariant cast for argument 0 (key) <p0:Object> isa Map#0 */
1373 /* <p0:Object> isa Map#0 */
1374 type_struct = self->type->resolution_table->types[COLOR_abstract_collection__Map_FT0];
1375 cltype = type_struct->color;
1376 idtype = type_struct->id;
1377 if(cltype >= p0->type->table_size) {
1378 var = 0;
1379 } else {
1380 var = p0->type->type_table[cltype] == idtype;
1381 }
1382 if (!var) {
1383 var_class_name = p0 == NULL ? "null" : p0->type->name;
1384 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Map#0", var_class_name);
1385 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 224);
1386 show_backtrace(1);
1387 }
1388 /* Covariant cast for argument 1 (v) <p1:nullable Object> isa Map#1 */
1389 /* <p1:nullable Object> isa Map#1 */
1390 type_struct4 = self->type->resolution_table->types[COLOR_abstract_collection__Map_FT1];
1391 cltype2 = type_struct4->color;
1392 idtype3 = type_struct4->id;
1393 is_nullable = type_struct4->is_nullable;
1394 if(p1 == NULL) {
1395 var1 = is_nullable;
1396 } else {
1397 if(cltype2 >= p1->type->table_size) {
1398 var1 = 0;
1399 } else {
1400 var1 = p1->type->type_table[cltype2] == idtype3;
1401 }
1402 }
1403 if (!var1) {
1404 var_class_name5 = p1 == NULL ? "null" : p1->type->name;
1405 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Map#1", var_class_name5);
1406 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 224);
1407 show_backtrace(1);
1408 }
1409 var_key = p0;
1410 var_v = p1;
1411 var6 = ((long (*)(val*, val*))(self->class->vft[COLOR_hash_collection__HashCollection__index_at]))(self, var_key) /* index_at on <self:HashMap[Object, nullable Object]>*/;
1412 var_i = var6;
1413 var7 = ((val* (*)(val*, long, val*))(self->class->vft[COLOR_hash_collection__HashCollection__node_at_idx]))(self, var_i, var_key) /* node_at_idx on <self:HashMap[Object, nullable Object]>*/;
1414 var_c = var7;
1415 var8 = NULL;
1416 if (var_c == NULL) {
1417 var9 = 0; /* is null */
1418 } else {
1419 var9 = 1; /* arg is null and recv is not */
1420 }
1421 if (var9){
1422 var_c->attrs[COLOR_hash_collection__HashNode___key].val = var_key; /* _key on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
1423 var_c->attrs[COLOR_hash_collection__HashMapNode___value].val = var_v; /* _value on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
1424 } else {
1425 var10 = NEW_hash_collection__HashMapNode(self->type->resolution_table->types[COLOR_hash_collection__HashMapNodehash_collection__HashMap_FT0hash_collection__HashMap_FT1]);
1426 ((void (*)(val*, val*, val*))(var10->class->vft[COLOR_hash_collection__HashMapNode__init]))(var10, var_key, var_v) /* init on <var10:HashMapNode[Object, nullable Object]>*/;
1427 ((void (*)(val*, long, val*))(self->class->vft[COLOR_hash_collection__HashCollection__store]))(self, var_i, var10) /* store on <self:HashMap[Object, nullable Object]>*/;
1428 }
1429 RET_LABEL:;
1430 }
1431 /* method hash_collection#HashMap#[]= for (self: Object, Object, nullable Object) */
1432 void VIRTUAL_hash_collection__HashMap___91d_93d_61d(val* self, val* p0, val* p1) {
1433 hash_collection__HashMap___91d_93d_61d(self, p0, p1);
1434 RET_LABEL:;
1435 }
1436 /* method hash_collection#HashMap#clear for (self: HashMap[Object, nullable Object]) */
1437 void hash_collection__HashMap__clear(val* self) {
1438 ((void (*)(val*))(self->class->vft[COLOR_hash_collection__HashCollection__raz]))(self) /* raz on <self:HashMap[Object, nullable Object]>*/;
1439 RET_LABEL:;
1440 }
1441 /* method hash_collection#HashMap#clear for (self: Object) */
1442 void VIRTUAL_hash_collection__HashMap__clear(val* self) {
1443 hash_collection__HashMap__clear(self);
1444 RET_LABEL:;
1445 }
1446 /* method hash_collection#HashMap#init for (self: HashMap[Object, nullable Object]) */
1447 void hash_collection__HashMap__init(val* self) {
1448 long var /* : Int */;
1449 long var1 /* : Int */;
1450 long var2 /* : Int */;
1451 ((void (*)(val*))(self->class->vft[COLOR_hash_collection__HashCollection__init]))(self) /* init on <self:HashMap[Object, nullable Object]>*/;
1452 var = 0;
1453 self->attrs[COLOR_hash_collection__HashCollection___capacity].l = var; /* _capacity on <self:HashMap[Object, nullable Object]> */
1454 var1 = 0;
1455 self->attrs[COLOR_hash_collection__HashCollection___length].l = var1; /* _length on <self:HashMap[Object, nullable Object]> */
1456 var2 = 0;
1457 ((void (*)(val*, long))(self->class->vft[COLOR_hash_collection__HashCollection__enlarge]))(self, var2) /* enlarge on <self:HashMap[Object, nullable Object]>*/;
1458 RET_LABEL:;
1459 }
1460 /* method hash_collection#HashMap#init for (self: Object) */
1461 void VIRTUAL_hash_collection__HashMap__init(val* self) {
1462 hash_collection__HashMap__init(self);
1463 RET_LABEL:;
1464 }
1465 /* method hash_collection#HashMap#keys for (self: HashMap[Object, nullable Object]): HashMapKeys[Object, nullable Object] */
1466 val* hash_collection__HashMap__keys(val* self) {
1467 val* var /* : HashMapKeys[Object, nullable Object] */;
1468 val* var1 /* : HashMapKeys[Object, nullable Object] */;
1469 var1 = self->attrs[COLOR_hash_collection__HashMap___64dkeys].val; /* @keys on <self:HashMap[Object, nullable Object]> */
1470 if (var1 == NULL) {
1471 fprintf(stderr, "Runtime error: %s", "Uninitialized attribute @keys");
1472 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 245);
1473 show_backtrace(1);
1474 }
1475 var = var1;
1476 RET_LABEL:;
1477 return var;
1478 }
1479 /* method hash_collection#HashMap#keys for (self: Object): Collection[Object] */
1480 val* VIRTUAL_hash_collection__HashMap__keys(val* self) {
1481 val* var /* : Collection[Object] */;
1482 val* var1 /* : HashMapKeys[Object, nullable Object] */;
1483 var1 = hash_collection__HashMap__keys(self);
1484 var = var1;
1485 RET_LABEL:;
1486 return var;
1487 }
1488 /* method hash_collection#HashMap#keys= for (self: HashMap[Object, nullable Object], HashMapKeys[Object, nullable Object]) */
1489 void hash_collection__HashMap__keys_61d(val* self, val* p0) {
1490 short int var /* : Bool */;
1491 int cltype;
1492 int idtype;
1493 const struct type* type_struct;
1494 const char* var_class_name;
1495 /* Covariant cast for argument 0 (keys) <p0:HashMapKeys[Object, nullable Object]> isa HashMapKeys[HashMap#0, HashMap#1] */
1496 /* <p0:HashMapKeys[Object, nullable Object]> isa HashMapKeys[HashMap#0, HashMap#1] */
1497 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashMapKeyshash_collection__HashMap_FT0hash_collection__HashMap_FT1];
1498 cltype = type_struct->color;
1499 idtype = type_struct->id;
1500 if(cltype >= p0->type->table_size) {
1501 var = 0;
1502 } else {
1503 var = p0->type->type_table[cltype] == idtype;
1504 }
1505 if (!var) {
1506 var_class_name = p0 == NULL ? "null" : p0->type->name;
1507 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMapKeys[HashMap#0, HashMap#1]", var_class_name);
1508 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 245);
1509 show_backtrace(1);
1510 }
1511 self->attrs[COLOR_hash_collection__HashMap___64dkeys].val = p0; /* @keys on <self:HashMap[Object, nullable Object]> */
1512 RET_LABEL:;
1513 }
1514 /* method hash_collection#HashMap#keys= for (self: Object, HashMapKeys[Object, nullable Object]) */
1515 void VIRTUAL_hash_collection__HashMap__keys_61d(val* self, val* p0) {
1516 hash_collection__HashMap__keys_61d(self, p0);
1517 RET_LABEL:;
1518 }
1519 /* method hash_collection#HashMap#values for (self: HashMap[Object, nullable Object]): HashMapValues[Object, nullable Object] */
1520 val* hash_collection__HashMap__values(val* self) {
1521 val* var /* : HashMapValues[Object, nullable Object] */;
1522 val* var1 /* : HashMapValues[Object, nullable Object] */;
1523 var1 = self->attrs[COLOR_hash_collection__HashMap___64dvalues].val; /* @values on <self:HashMap[Object, nullable Object]> */
1524 if (var1 == NULL) {
1525 fprintf(stderr, "Runtime error: %s", "Uninitialized attribute @values");
1526 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 246);
1527 show_backtrace(1);
1528 }
1529 var = var1;
1530 RET_LABEL:;
1531 return var;
1532 }
1533 /* method hash_collection#HashMap#values for (self: Object): Collection[nullable Object] */
1534 val* VIRTUAL_hash_collection__HashMap__values(val* self) {
1535 val* var /* : Collection[nullable Object] */;
1536 val* var1 /* : HashMapValues[Object, nullable Object] */;
1537 var1 = hash_collection__HashMap__values(self);
1538 var = var1;
1539 RET_LABEL:;
1540 return var;
1541 }
1542 /* method hash_collection#HashMap#values= for (self: HashMap[Object, nullable Object], HashMapValues[Object, nullable Object]) */
1543 void hash_collection__HashMap__values_61d(val* self, val* p0) {
1544 short int var /* : Bool */;
1545 int cltype;
1546 int idtype;
1547 const struct type* type_struct;
1548 const char* var_class_name;
1549 /* Covariant cast for argument 0 (values) <p0:HashMapValues[Object, nullable Object]> isa HashMapValues[HashMap#0, HashMap#1] */
1550 /* <p0:HashMapValues[Object, nullable Object]> isa HashMapValues[HashMap#0, HashMap#1] */
1551 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashMapValueshash_collection__HashMap_FT0hash_collection__HashMap_FT1];
1552 cltype = type_struct->color;
1553 idtype = type_struct->id;
1554 if(cltype >= p0->type->table_size) {
1555 var = 0;
1556 } else {
1557 var = p0->type->type_table[cltype] == idtype;
1558 }
1559 if (!var) {
1560 var_class_name = p0 == NULL ? "null" : p0->type->name;
1561 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMapValues[HashMap#0, HashMap#1]", var_class_name);
1562 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 246);
1563 show_backtrace(1);
1564 }
1565 self->attrs[COLOR_hash_collection__HashMap___64dvalues].val = p0; /* @values on <self:HashMap[Object, nullable Object]> */
1566 RET_LABEL:;
1567 }
1568 /* method hash_collection#HashMap#values= for (self: Object, HashMapValues[Object, nullable Object]) */
1569 void VIRTUAL_hash_collection__HashMap__values_61d(val* self, val* p0) {
1570 hash_collection__HashMap__values_61d(self, p0);
1571 RET_LABEL:;
1572 }
1573 /* method hash_collection#HashMapKeys#map for (self: HashMapKeys[Object, nullable Object]): HashMap[Object, nullable Object] */
1574 val* hash_collection__HashMapKeys__map(val* self) {
1575 val* var /* : HashMap[Object, nullable Object] */;
1576 val* var1 /* : HashMap[Object, nullable Object] */;
1577 var1 = self->attrs[COLOR_hash_collection__HashMapKeys___64dmap].val; /* @map on <self:HashMapKeys[Object, nullable Object]> */
1578 if (var1 == NULL) {
1579 fprintf(stderr, "Runtime error: %s", "Uninitialized attribute @map");
1580 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 252);
1581 show_backtrace(1);
1582 }
1583 var = var1;
1584 RET_LABEL:;
1585 return var;
1586 }
1587 /* method hash_collection#HashMapKeys#map for (self: Object): HashMap[Object, nullable Object] */
1588 val* VIRTUAL_hash_collection__HashMapKeys__map(val* self) {
1589 val* var /* : HashMap[Object, nullable Object] */;
1590 val* var1 /* : HashMap[Object, nullable Object] */;
1591 var1 = hash_collection__HashMapKeys__map(self);
1592 var = var1;
1593 RET_LABEL:;
1594 return var;
1595 }
1596 /* method hash_collection#HashMapKeys#map= for (self: HashMapKeys[Object, nullable Object], HashMap[Object, nullable Object]) */
1597 void hash_collection__HashMapKeys__map_61d(val* self, val* p0) {
1598 short int var /* : Bool */;
1599 int cltype;
1600 int idtype;
1601 const struct type* type_struct;
1602 const char* var_class_name;
1603 /* Covariant cast for argument 0 (map) <p0:HashMap[Object, nullable Object]> isa HashMap[HashMapKeys#0, HashMapKeys#1] */
1604 /* <p0:HashMap[Object, nullable Object]> isa HashMap[HashMapKeys#0, HashMapKeys#1] */
1605 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashMaphash_collection__HashMapKeys_FT0hash_collection__HashMapKeys_FT1];
1606 cltype = type_struct->color;
1607 idtype = type_struct->id;
1608 if(cltype >= p0->type->table_size) {
1609 var = 0;
1610 } else {
1611 var = p0->type->type_table[cltype] == idtype;
1612 }
1613 if (!var) {
1614 var_class_name = p0 == NULL ? "null" : p0->type->name;
1615 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap[HashMapKeys#0, HashMapKeys#1]", var_class_name);
1616 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 252);
1617 show_backtrace(1);
1618 }
1619 self->attrs[COLOR_hash_collection__HashMapKeys___64dmap].val = p0; /* @map on <self:HashMapKeys[Object, nullable Object]> */
1620 RET_LABEL:;
1621 }
1622 /* method hash_collection#HashMapKeys#map= for (self: Object, HashMap[Object, nullable Object]) */
1623 void VIRTUAL_hash_collection__HashMapKeys__map_61d(val* self, val* p0) {
1624 hash_collection__HashMapKeys__map_61d(self, p0);
1625 RET_LABEL:;
1626 }
1627 /* method hash_collection#HashMapKeys#count for (self: HashMapKeys[Object, nullable Object], Object): Int */
1628 long hash_collection__HashMapKeys__count(val* self, val* p0) {
1629 long var /* : Int */;
1630 short int var1 /* : Bool */;
1631 int cltype;
1632 int idtype;
1633 const struct type* type_struct;
1634 const char* var_class_name;
1635 val* var_k /* var k: Object */;
1636 short int var2 /* : Bool */;
1637 long var3 /* : Int */;
1638 long var4 /* : Int */;
1639 /* Covariant cast for argument 0 (k) <p0:Object> isa Collection#0 */
1640 /* <p0:Object> isa Collection#0 */
1641 type_struct = self->type->resolution_table->types[COLOR_abstract_collection__Collection_FT0];
1642 cltype = type_struct->color;
1643 idtype = type_struct->id;
1644 if(cltype >= p0->type->table_size) {
1645 var1 = 0;
1646 } else {
1647 var1 = p0->type->type_table[cltype] == idtype;
1648 }
1649 if (!var1) {
1650 var_class_name = p0 == NULL ? "null" : p0->type->name;
1651 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Collection#0", var_class_name);
1652 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 255);
1653 show_backtrace(1);
1654 }
1655 var_k = p0;
1656 var2 = ((short int (*)(val*, val*))(self->class->vft[COLOR_abstract_collection__Collection__has]))(self, var_k) /* has on <self:HashMapKeys[Object, nullable Object]>*/;
1657 if (var2){
1658 var3 = 1;
1659 var = var3;
1660 goto RET_LABEL;
1661 } else {
1662 var4 = 0;
1663 var = var4;
1664 goto RET_LABEL;
1665 }
1666 RET_LABEL:;
1667 return var;
1668 }
1669 /* method hash_collection#HashMapKeys#count for (self: Object, nullable Object): Int */
1670 long VIRTUAL_hash_collection__HashMapKeys__count(val* self, val* p0) {
1671 long var /* : Int */;
1672 long var1 /* : Int */;
1673 var1 = hash_collection__HashMapKeys__count(self, p0);
1674 var = var1;
1675 RET_LABEL:;
1676 return var;
1677 }
1678 /* method hash_collection#HashMapKeys#first for (self: HashMapKeys[Object, nullable Object]): Object */
1679 val* hash_collection__HashMapKeys__first(val* self) {
1680 val* var /* : Object */;
1681 val* var1 /* : HashMap[Object, nullable Object] */;
1682 val* var2 /* : nullable HashNode[Object] */;
1683 val* var3 /* : Object */;
1684 var1 = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapKeys__map]))(self) /* map on <self:HashMapKeys[Object, nullable Object]>*/;
1685 var2 = var1->attrs[COLOR_hash_collection__HashCollection___first_item].val; /* _first_item on <var1:HashMap[Object, nullable Object]> */
1686 if (var2 == NULL) {
1687 fprintf(stderr, "Runtime error: %s", "Receiver is null");
1688 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 256);
1689 show_backtrace(1);
1690 }
1691 var3 = var2->attrs[COLOR_hash_collection__HashNode___key].val; /* _key on <var2:nullable HashNode[Object](nullable HashMapNode[Object, nullable Object])> */
1692 if (var3 == NULL) {
1693 fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _key");
1694 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 256);
1695 show_backtrace(1);
1696 }
1697 var = var3;
1698 goto RET_LABEL;
1699 RET_LABEL:;
1700 return var;
1701 }
1702 /* method hash_collection#HashMapKeys#first for (self: Object): nullable Object */
1703 val* VIRTUAL_hash_collection__HashMapKeys__first(val* self) {
1704 val* var /* : nullable Object */;
1705 val* var1 /* : Object */;
1706 var1 = hash_collection__HashMapKeys__first(self);
1707 var = var1;
1708 RET_LABEL:;
1709 return var;
1710 }
1711 /* method hash_collection#HashMapKeys#has for (self: HashMapKeys[Object, nullable Object], Object): Bool */
1712 short int hash_collection__HashMapKeys__has(val* self, val* p0) {
1713 short int var /* : Bool */;
1714 short int var1 /* : Bool */;
1715 int cltype;
1716 int idtype;
1717 const struct type* type_struct;
1718 const char* var_class_name;
1719 val* var_k /* var k: Object */;
1720 val* var2 /* : HashMap[Object, nullable Object] */;
1721 val* var3 /* : nullable HashNode[Object] */;
1722 val* var4 /* : null */;
1723 short int var5 /* : Bool */;
1724 /* Covariant cast for argument 0 (k) <p0:Object> isa Collection#0 */
1725 /* <p0:Object> isa Collection#0 */
1726 type_struct = self->type->resolution_table->types[COLOR_abstract_collection__Collection_FT0];
1727 cltype = type_struct->color;
1728 idtype = type_struct->id;
1729 if(cltype >= p0->type->table_size) {
1730 var1 = 0;
1731 } else {
1732 var1 = p0->type->type_table[cltype] == idtype;
1733 }
1734 if (!var1) {
1735 var_class_name = p0 == NULL ? "null" : p0->type->name;
1736 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Collection#0", var_class_name);
1737 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 257);
1738 show_backtrace(1);
1739 }
1740 var_k = p0;
1741 var2 = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapKeys__map]))(self) /* map on <self:HashMapKeys[Object, nullable Object]>*/;
1742 var3 = ((val* (*)(val*, val*))(var2->class->vft[COLOR_hash_collection__HashCollection__node_at]))(var2, var_k) /* node_at on <var2:HashMap[Object, nullable Object]>*/;
1743 var4 = NULL;
1744 if (var3 == NULL) {
1745 var5 = 0; /* is null */
1746 } else {
1747 var5 = 1; /* arg is null and recv is not */
1748 }
1749 var = var5;
1750 goto RET_LABEL;
1751 RET_LABEL:;
1752 return var;
1753 }
1754 /* method hash_collection#HashMapKeys#has for (self: Object, nullable Object): Bool */
1755 short int VIRTUAL_hash_collection__HashMapKeys__has(val* self, val* p0) {
1756 short int var /* : Bool */;
1757 short int var1 /* : Bool */;
1758 var1 = hash_collection__HashMapKeys__has(self, p0);
1759 var = var1;
1760 RET_LABEL:;
1761 return var;
1762 }
1763 /* method hash_collection#HashMapKeys#has_only for (self: HashMapKeys[Object, nullable Object], Object): Bool */
1764 short int hash_collection__HashMapKeys__has_only(val* self, val* p0) {
1765 short int var /* : Bool */;
1766 short int var1 /* : Bool */;
1767 int cltype;
1768 int idtype;
1769 const struct type* type_struct;
1770 const char* var_class_name;
1771 val* var_k /* var k: Object */;
1772 short int var2 /* : Bool */;
1773 short int var3 /* : Bool */;
1774 short int var4 /* : Bool */;
1775 short int var_ /* var : Bool */;
1776 long var5 /* : Int */;
1777 long var6 /* : Int */;
1778 short int var7 /* : Bool */;
1779 short int var9 /* : Bool */;
1780 short int var_10 /* var : Bool */;
1781 short int var11 /* : Bool */;
1782 /* Covariant cast for argument 0 (k) <p0:Object> isa Collection#0 */
1783 /* <p0:Object> isa Collection#0 */
1784 type_struct = self->type->resolution_table->types[COLOR_abstract_collection__Collection_FT0];
1785 cltype = type_struct->color;
1786 idtype = type_struct->id;
1787 if(cltype >= p0->type->table_size) {
1788 var1 = 0;
1789 } else {
1790 var1 = p0->type->type_table[cltype] == idtype;
1791 }
1792 if (!var1) {
1793 var_class_name = p0 == NULL ? "null" : p0->type->name;
1794 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Collection#0", var_class_name);
1795 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 258);
1796 show_backtrace(1);
1797 }
1798 var_k = p0;
1799 var4 = ((short int (*)(val*, val*))(self->class->vft[COLOR_abstract_collection__Collection__has]))(self, var_k) /* has on <self:HashMapKeys[Object, nullable Object]>*/;
1800 var_ = var4;
1801 if (var4){
1802 var5 = ((long (*)(val*))(self->class->vft[COLOR_abstract_collection__Collection__length]))(self) /* length on <self:HashMapKeys[Object, nullable Object]>*/;
1803 var6 = 1;
1804 { /* Inline kernel#Int#== (var5,var6) */
1805 var9 = var5 == var6;
1806 var7 = var9;
1807 goto RET_LABEL8;
1808 RET_LABEL8:(void)0;
1809 }
1810 var3 = var7;
1811 } else {
1812 var3 = var_;
1813 }
1814 var_10 = var3;
1815 if (var3){
1816 var2 = var_10;
1817 } else {
1818 var11 = ((short int (*)(val*))(self->class->vft[COLOR_abstract_collection__Collection__is_empty]))(self) /* is_empty on <self:HashMapKeys[Object, nullable Object]>*/;
1819 var2 = var11;
1820 }
1821 var = var2;
1822 goto RET_LABEL;
1823 RET_LABEL:;
1824 return var;
1825 }
1826 /* method hash_collection#HashMapKeys#has_only for (self: Object, nullable Object): Bool */
1827 short int VIRTUAL_hash_collection__HashMapKeys__has_only(val* self, val* p0) {
1828 short int var /* : Bool */;
1829 short int var1 /* : Bool */;
1830 var1 = hash_collection__HashMapKeys__has_only(self, p0);
1831 var = var1;
1832 RET_LABEL:;
1833 return var;
1834 }
1835 /* method hash_collection#HashMapKeys#is_empty for (self: HashMapKeys[Object, nullable Object]): Bool */
1836 short int hash_collection__HashMapKeys__is_empty(val* self) {
1837 short int var /* : Bool */;
1838 val* var1 /* : HashMap[Object, nullable Object] */;
1839 short int var2 /* : Bool */;
1840 var1 = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapKeys__map]))(self) /* map on <self:HashMapKeys[Object, nullable Object]>*/;
1841 var2 = ((short int (*)(val*))(var1->class->vft[COLOR_abstract_collection__MapRead__is_empty]))(var1) /* is_empty on <var1:HashMap[Object, nullable Object]>*/;
1842 var = var2;
1843 goto RET_LABEL;
1844 RET_LABEL:;
1845 return var;
1846 }
1847 /* method hash_collection#HashMapKeys#is_empty for (self: Object): Bool */
1848 short int VIRTUAL_hash_collection__HashMapKeys__is_empty(val* self) {
1849 short int var /* : Bool */;
1850 short int var1 /* : Bool */;
1851 var1 = hash_collection__HashMapKeys__is_empty(self);
1852 var = var1;
1853 RET_LABEL:;
1854 return var;
1855 }
1856 /* method hash_collection#HashMapKeys#length for (self: HashMapKeys[Object, nullable Object]): Int */
1857 long hash_collection__HashMapKeys__length(val* self) {
1858 long var /* : Int */;
1859 val* var1 /* : HashMap[Object, nullable Object] */;
1860 long var2 /* : Int */;
1861 var1 = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapKeys__map]))(self) /* map on <self:HashMapKeys[Object, nullable Object]>*/;
1862 var2 = ((long (*)(val*))(var1->class->vft[COLOR_abstract_collection__MapRead__length]))(var1) /* length on <var1:HashMap[Object, nullable Object]>*/;
1863 var = var2;
1864 goto RET_LABEL;
1865 RET_LABEL:;
1866 return var;
1867 }
1868 /* method hash_collection#HashMapKeys#length for (self: Object): Int */
1869 long VIRTUAL_hash_collection__HashMapKeys__length(val* self) {
1870 long var /* : Int */;
1871 long var1 /* : Int */;
1872 var1 = hash_collection__HashMapKeys__length(self);
1873 var = var1;
1874 RET_LABEL:;
1875 return var;
1876 }
1877 /* method hash_collection#HashMapKeys#iterator for (self: HashMapKeys[Object, nullable Object]): Iterator[Object] */
1878 val* hash_collection__HashMapKeys__iterator(val* self) {
1879 val* var /* : Iterator[Object] */;
1880 val* var1 /* : MapKeysIterator[Object, nullable Object] */;
1881 val* var2 /* : HashMap[Object, nullable Object] */;
1882 val* var3 /* : MapIterator[Object, nullable Object] */;
1883 var1 = NEW_abstract_collection__MapKeysIterator(self->type->resolution_table->types[COLOR_abstract_collection__MapKeysIteratorhash_collection__HashMapKeys_FT0hash_collection__HashMapKeys_FT1]);
1884 var2 = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapKeys__map]))(self) /* map on <self:HashMapKeys[Object, nullable Object]>*/;
1885 var3 = ((val* (*)(val*))(var2->class->vft[COLOR_abstract_collection__MapRead__iterator]))(var2) /* iterator on <var2:HashMap[Object, nullable Object]>*/;
1886 ((void (*)(val*, val*))(var1->class->vft[COLOR_abstract_collection__MapKeysIterator__init]))(var1, var3) /* init on <var1:MapKeysIterator[Object, nullable Object]>*/;
1887 var = var1;
1888 goto RET_LABEL;
1889 RET_LABEL:;
1890 return var;
1891 }
1892 /* method hash_collection#HashMapKeys#iterator for (self: Object): Iterator[nullable Object] */
1893 val* VIRTUAL_hash_collection__HashMapKeys__iterator(val* self) {
1894 val* var /* : Iterator[nullable Object] */;
1895 val* var1 /* : Iterator[Object] */;
1896 var1 = hash_collection__HashMapKeys__iterator(self);
1897 var = var1;
1898 RET_LABEL:;
1899 return var;
1900 }
1901 /* method hash_collection#HashMapKeys#clear for (self: HashMapKeys[Object, nullable Object]) */
1902 void hash_collection__HashMapKeys__clear(val* self) {
1903 val* var /* : HashMap[Object, nullable Object] */;
1904 var = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapKeys__map]))(self) /* map on <self:HashMapKeys[Object, nullable Object]>*/;
1905 ((void (*)(val*))(var->class->vft[COLOR_abstract_collection__Map__clear]))(var) /* clear on <var:HashMap[Object, nullable Object]>*/;
1906 RET_LABEL:;
1907 }
1908 /* method hash_collection#HashMapKeys#clear for (self: Object) */
1909 void VIRTUAL_hash_collection__HashMapKeys__clear(val* self) {
1910 hash_collection__HashMapKeys__clear(self);
1911 RET_LABEL:;
1912 }
1913 /* method hash_collection#HashMapKeys#remove for (self: HashMapKeys[Object, nullable Object], Object) */
1914 void hash_collection__HashMapKeys__remove(val* self, val* p0) {
1915 short int var /* : Bool */;
1916 int cltype;
1917 int idtype;
1918 const struct type* type_struct;
1919 const char* var_class_name;
1920 val* var_key /* var key: Object */;
1921 val* var1 /* : HashMap[Object, nullable Object] */;
1922 /* Covariant cast for argument 0 (key) <p0:Object> isa RemovableCollection#0 */
1923 /* <p0:Object> isa RemovableCollection#0 */
1924 type_struct = self->type->resolution_table->types[COLOR_abstract_collection__RemovableCollection_FT0];
1925 cltype = type_struct->color;
1926 idtype = type_struct->id;
1927 if(cltype >= p0->type->table_size) {
1928 var = 0;
1929 } else {
1930 var = p0->type->type_table[cltype] == idtype;
1931 }
1932 if (!var) {
1933 var_class_name = p0 == NULL ? "null" : p0->type->name;
1934 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "RemovableCollection#0", var_class_name);
1935 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 266);
1936 show_backtrace(1);
1937 }
1938 var_key = p0;
1939 var1 = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapKeys__map]))(self) /* map on <self:HashMapKeys[Object, nullable Object]>*/;
1940 ((void (*)(val*, val*))(var1->class->vft[COLOR_hash_collection__HashCollection__remove_node]))(var1, var_key) /* remove_node on <var1:HashMap[Object, nullable Object]>*/;
1941 RET_LABEL:;
1942 }
1943 /* method hash_collection#HashMapKeys#remove for (self: Object, nullable Object) */
1944 void VIRTUAL_hash_collection__HashMapKeys__remove(val* self, val* p0) {
1945 hash_collection__HashMapKeys__remove(self, p0);
1946 RET_LABEL:;
1947 }
1948 /* method hash_collection#HashMapKeys#remove_all for (self: HashMapKeys[Object, nullable Object], Object) */
1949 void hash_collection__HashMapKeys__remove_all(val* self, val* p0) {
1950 short int var /* : Bool */;
1951 int cltype;
1952 int idtype;
1953 const struct type* type_struct;
1954 const char* var_class_name;
1955 val* var_key /* var key: Object */;
1956 val* var1 /* : HashMap[Object, nullable Object] */;
1957 /* Covariant cast for argument 0 (key) <p0:Object> isa RemovableCollection#0 */
1958 /* <p0:Object> isa RemovableCollection#0 */
1959 type_struct = self->type->resolution_table->types[COLOR_abstract_collection__RemovableCollection_FT0];
1960 cltype = type_struct->color;
1961 idtype = type_struct->id;
1962 if(cltype >= p0->type->table_size) {
1963 var = 0;
1964 } else {
1965 var = p0->type->type_table[cltype] == idtype;
1966 }
1967 if (!var) {
1968 var_class_name = p0 == NULL ? "null" : p0->type->name;
1969 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "RemovableCollection#0", var_class_name);
1970 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 267);
1971 show_backtrace(1);
1972 }
1973 var_key = p0;
1974 var1 = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapKeys__map]))(self) /* map on <self:HashMapKeys[Object, nullable Object]>*/;
1975 ((void (*)(val*, val*))(var1->class->vft[COLOR_hash_collection__HashCollection__remove_node]))(var1, var_key) /* remove_node on <var1:HashMap[Object, nullable Object]>*/;
1976 RET_LABEL:;
1977 }
1978 /* method hash_collection#HashMapKeys#remove_all for (self: Object, nullable Object) */
1979 void VIRTUAL_hash_collection__HashMapKeys__remove_all(val* self, val* p0) {
1980 hash_collection__HashMapKeys__remove_all(self, p0);
1981 RET_LABEL:;
1982 }
1983 /* method hash_collection#HashMapKeys#init for (self: HashMapKeys[Object, nullable Object], HashMap[Object, nullable Object]) */
1984 void hash_collection__HashMapKeys__init(val* self, val* p0) {
1985 short int var /* : Bool */;
1986 int cltype;
1987 int idtype;
1988 const struct type* type_struct;
1989 const char* var_class_name;
1990 /* Covariant cast for argument 0 (map) <p0:HashMap[Object, nullable Object]> isa HashMap[HashMapKeys#0, HashMapKeys#1] */
1991 /* <p0:HashMap[Object, nullable Object]> isa HashMap[HashMapKeys#0, HashMapKeys#1] */
1992 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashMaphash_collection__HashMapKeys_FT0hash_collection__HashMapKeys_FT1];
1993 cltype = type_struct->color;
1994 idtype = type_struct->id;
1995 if(cltype >= p0->type->table_size) {
1996 var = 0;
1997 } else {
1998 var = p0->type->type_table[cltype] == idtype;
1999 }
2000 if (!var) {
2001 var_class_name = p0 == NULL ? "null" : p0->type->name;
2002 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap[HashMapKeys#0, HashMapKeys#1]", var_class_name);
2003 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 249);
2004 show_backtrace(1);
2005 }
2006 self->attrs[COLOR_hash_collection__HashMapKeys___64dmap].val = p0; /* @map on <self:HashMapKeys[Object, nullable Object]> */
2007 RET_LABEL:;
2008 }
2009 /* method hash_collection#HashMapKeys#init for (self: Object, HashMap[Object, nullable Object]) */
2010 void VIRTUAL_hash_collection__HashMapKeys__init(val* self, val* p0) {
2011 hash_collection__HashMapKeys__init(self, p0);
2012 RET_LABEL:;
2013 }
2014 /* method hash_collection#HashMapValues#map for (self: HashMapValues[Object, nullable Object]): HashMap[Object, nullable Object] */
2015 val* hash_collection__HashMapValues__map(val* self) {
2016 val* var /* : HashMap[Object, nullable Object] */;
2017 val* var1 /* : HashMap[Object, nullable Object] */;
2018 var1 = self->attrs[COLOR_hash_collection__HashMapValues___64dmap].val; /* @map on <self:HashMapValues[Object, nullable Object]> */
2019 if (var1 == NULL) {
2020 fprintf(stderr, "Runtime error: %s", "Uninitialized attribute @map");
2021 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 273);
2022 show_backtrace(1);
2023 }
2024 var = var1;
2025 RET_LABEL:;
2026 return var;
2027 }
2028 /* method hash_collection#HashMapValues#map for (self: Object): HashMap[Object, nullable Object] */
2029 val* VIRTUAL_hash_collection__HashMapValues__map(val* self) {
2030 val* var /* : HashMap[Object, nullable Object] */;
2031 val* var1 /* : HashMap[Object, nullable Object] */;
2032 var1 = hash_collection__HashMapValues__map(self);
2033 var = var1;
2034 RET_LABEL:;
2035 return var;
2036 }
2037 /* method hash_collection#HashMapValues#map= for (self: HashMapValues[Object, nullable Object], HashMap[Object, nullable Object]) */
2038 void hash_collection__HashMapValues__map_61d(val* self, val* p0) {
2039 short int var /* : Bool */;
2040 int cltype;
2041 int idtype;
2042 const struct type* type_struct;
2043 const char* var_class_name;
2044 /* Covariant cast for argument 0 (map) <p0:HashMap[Object, nullable Object]> isa HashMap[HashMapValues#0, HashMapValues#1] */
2045 /* <p0:HashMap[Object, nullable Object]> isa HashMap[HashMapValues#0, HashMapValues#1] */
2046 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashMaphash_collection__HashMapValues_FT0hash_collection__HashMapValues_FT1];
2047 cltype = type_struct->color;
2048 idtype = type_struct->id;
2049 if(cltype >= p0->type->table_size) {
2050 var = 0;
2051 } else {
2052 var = p0->type->type_table[cltype] == idtype;
2053 }
2054 if (!var) {
2055 var_class_name = p0 == NULL ? "null" : p0->type->name;
2056 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap[HashMapValues#0, HashMapValues#1]", var_class_name);
2057 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 273);
2058 show_backtrace(1);
2059 }
2060 self->attrs[COLOR_hash_collection__HashMapValues___64dmap].val = p0; /* @map on <self:HashMapValues[Object, nullable Object]> */
2061 RET_LABEL:;
2062 }
2063 /* method hash_collection#HashMapValues#map= for (self: Object, HashMap[Object, nullable Object]) */
2064 void VIRTUAL_hash_collection__HashMapValues__map_61d(val* self, val* p0) {
2065 hash_collection__HashMapValues__map_61d(self, p0);
2066 RET_LABEL:;
2067 }
2068 /* method hash_collection#HashMapValues#count for (self: HashMapValues[Object, nullable Object], nullable Object): Int */
2069 long hash_collection__HashMapValues__count(val* self, val* p0) {
2070 long var /* : Int */;
2071 short int var1 /* : Bool */;
2072 int cltype;
2073 int idtype;
2074 const struct type* type_struct;
2075 short int is_nullable;
2076 const char* var_class_name;
2077 val* var_item /* var item: nullable Object */;
2078 long var2 /* : Int */;
2079 long var_nb /* var nb: Int */;
2080 val* var3 /* : HashMap[Object, nullable Object] */;
2081 val* var4 /* : nullable HashNode[Object] */;
2082 val* var_c /* var c: nullable HashMapNode[Object, nullable Object] */;
2083 val* var5 /* : null */;
2084 short int var6 /* : Bool */;
2085 val* var7 /* : nullable Object */;
2086 short int var8 /* : Bool */;
2087 long var9 /* : Int */;
2088 long var10 /* : Int */;
2089 long var12 /* : Int */;
2090 val* var13 /* : nullable HashNode[Object] */;
2091 /* Covariant cast for argument 0 (item) <p0:nullable Object> isa Collection#0 */
2092 /* <p0:nullable Object> isa Collection#0 */
2093 type_struct = self->type->resolution_table->types[COLOR_abstract_collection__Collection_FT0];
2094 cltype = type_struct->color;
2095 idtype = type_struct->id;
2096 is_nullable = type_struct->is_nullable;
2097 if(p0 == NULL) {
2098 var1 = is_nullable;
2099 } else {
2100 if(cltype >= p0->type->table_size) {
2101 var1 = 0;
2102 } else {
2103 var1 = p0->type->type_table[cltype] == idtype;
2104 }
2105 }
2106 if (!var1) {
2107 var_class_name = p0 == NULL ? "null" : p0->type->name;
2108 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Collection#0", var_class_name);
2109 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 276);
2110 show_backtrace(1);
2111 }
2112 var_item = p0;
2113 var2 = 0;
2114 var_nb = var2;
2115 var3 = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapValues__map]))(self) /* map on <self:HashMapValues[Object, nullable Object]>*/;
2116 var4 = var3->attrs[COLOR_hash_collection__HashCollection___first_item].val; /* _first_item on <var3:HashMap[Object, nullable Object]> */
2117 var_c = var4;
2118 for(;;) {
2119 var5 = NULL;
2120 if (var_c == NULL) {
2121 var6 = 0; /* is null */
2122 } else {
2123 var6 = 1; /* arg is null and recv is not */
2124 }
2125 if (!var6) break;
2126 var7 = var_c->attrs[COLOR_hash_collection__HashMapNode___value].val; /* _value on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
2127 if (var7 == NULL) {
2128 var8 = (var_item == NULL);
2129 } else {
2130 var8 = ((short int (*)(val*, val*))(var7->class->vft[COLOR_kernel__Object___61d_61d]))(var7, var_item) /* == on <var7:nullable Object>*/;
2131 }
2132 if (var8){
2133 var9 = 1;
2134 { /* Inline kernel#Int#+ (var_nb,var9) */
2135 var12 = var_nb + var9;
2136 var10 = var12;
2137 goto RET_LABEL11;
2138 RET_LABEL11:(void)0;
2139 }
2140 var_nb = var10;
2141 } else {
2142 }
2143 var13 = var_c->attrs[COLOR_hash_collection__HashNode___next_item].val; /* _next_item on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
2144 var_c = var13;
2145 CONTINUE_label: (void)0;
2146 }
2147 BREAK_label: (void)0;
2148 var = var_nb;
2149 goto RET_LABEL;
2150 RET_LABEL:;
2151 return var;
2152 }
2153 /* method hash_collection#HashMapValues#count for (self: Object, nullable Object): Int */
2154 long VIRTUAL_hash_collection__HashMapValues__count(val* self, val* p0) {
2155 long var /* : Int */;
2156 long var1 /* : Int */;
2157 var1 = hash_collection__HashMapValues__count(self, p0);
2158 var = var1;
2159 RET_LABEL:;
2160 return var;
2161 }
2162 /* method hash_collection#HashMapValues#first for (self: HashMapValues[Object, nullable Object]): nullable Object */
2163 val* hash_collection__HashMapValues__first(val* self) {
2164 val* var /* : nullable Object */;
2165 val* var1 /* : HashMap[Object, nullable Object] */;
2166 val* var2 /* : nullable HashNode[Object] */;
2167 val* var3 /* : nullable Object */;
2168 var1 = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapValues__map]))(self) /* map on <self:HashMapValues[Object, nullable Object]>*/;
2169 var2 = var1->attrs[COLOR_hash_collection__HashCollection___first_item].val; /* _first_item on <var1:HashMap[Object, nullable Object]> */
2170 if (var2 == NULL) {
2171 fprintf(stderr, "Runtime error: %s", "Receiver is null");
2172 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 286);
2173 show_backtrace(1);
2174 }
2175 var3 = var2->attrs[COLOR_hash_collection__HashMapNode___value].val; /* _value on <var2:nullable HashNode[Object](nullable HashMapNode[Object, nullable Object])> */
2176 var = var3;
2177 goto RET_LABEL;
2178 RET_LABEL:;
2179 return var;
2180 }
2181 /* method hash_collection#HashMapValues#first for (self: Object): nullable Object */
2182 val* VIRTUAL_hash_collection__HashMapValues__first(val* self) {
2183 val* var /* : nullable Object */;
2184 val* var1 /* : nullable Object */;
2185 var1 = hash_collection__HashMapValues__first(self);
2186 var = var1;
2187 RET_LABEL:;
2188 return var;
2189 }
2190 /* method hash_collection#HashMapValues#has for (self: HashMapValues[Object, nullable Object], nullable Object): Bool */
2191 short int hash_collection__HashMapValues__has(val* self, val* p0) {
2192 short int var /* : Bool */;
2193 short int var1 /* : Bool */;
2194 int cltype;
2195 int idtype;
2196 const struct type* type_struct;
2197 short int is_nullable;
2198 const char* var_class_name;
2199 val* var_item /* var item: nullable Object */;
2200 val* var2 /* : HashMap[Object, nullable Object] */;
2201 val* var3 /* : nullable HashNode[Object] */;
2202 val* var_c /* var c: nullable HashMapNode[Object, nullable Object] */;
2203 val* var4 /* : null */;
2204 short int var5 /* : Bool */;
2205 val* var6 /* : nullable Object */;
2206 short int var7 /* : Bool */;
2207 short int var8 /* : Bool */;
2208 val* var9 /* : nullable HashNode[Object] */;
2209 short int var10 /* : Bool */;
2210 /* Covariant cast for argument 0 (item) <p0:nullable Object> isa Collection#0 */
2211 /* <p0:nullable Object> isa Collection#0 */
2212 type_struct = self->type->resolution_table->types[COLOR_abstract_collection__Collection_FT0];
2213 cltype = type_struct->color;
2214 idtype = type_struct->id;
2215 is_nullable = type_struct->is_nullable;
2216 if(p0 == NULL) {
2217 var1 = is_nullable;
2218 } else {
2219 if(cltype >= p0->type->table_size) {
2220 var1 = 0;
2221 } else {
2222 var1 = p0->type->type_table[cltype] == idtype;
2223 }
2224 }
2225 if (!var1) {
2226 var_class_name = p0 == NULL ? "null" : p0->type->name;
2227 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Collection#0", var_class_name);
2228 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 288);
2229 show_backtrace(1);
2230 }
2231 var_item = p0;
2232 var2 = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapValues__map]))(self) /* map on <self:HashMapValues[Object, nullable Object]>*/;
2233 var3 = var2->attrs[COLOR_hash_collection__HashCollection___first_item].val; /* _first_item on <var2:HashMap[Object, nullable Object]> */
2234 var_c = var3;
2235 for(;;) {
2236 var4 = NULL;
2237 if (var_c == NULL) {
2238 var5 = 0; /* is null */
2239 } else {
2240 var5 = 1; /* arg is null and recv is not */
2241 }
2242 if (!var5) break;
2243 var6 = var_c->attrs[COLOR_hash_collection__HashMapNode___value].val; /* _value on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
2244 if (var6 == NULL) {
2245 var7 = (var_item == NULL);
2246 } else {
2247 var7 = ((short int (*)(val*, val*))(var6->class->vft[COLOR_kernel__Object___61d_61d]))(var6, var_item) /* == on <var6:nullable Object>*/;
2248 }
2249 if (var7){
2250 var8 = 1;
2251 var = var8;
2252 goto RET_LABEL;
2253 } else {
2254 }
2255 var9 = var_c->attrs[COLOR_hash_collection__HashNode___next_item].val; /* _next_item on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
2256 var_c = var9;
2257 CONTINUE_label: (void)0;
2258 }
2259 BREAK_label: (void)0;
2260 var10 = 0;
2261 var = var10;
2262 goto RET_LABEL;
2263 RET_LABEL:;
2264 return var;
2265 }
2266 /* method hash_collection#HashMapValues#has for (self: Object, nullable Object): Bool */
2267 short int VIRTUAL_hash_collection__HashMapValues__has(val* self, val* p0) {
2268 short int var /* : Bool */;
2269 short int var1 /* : Bool */;
2270 var1 = hash_collection__HashMapValues__has(self, p0);
2271 var = var1;
2272 RET_LABEL:;
2273 return var;
2274 }
2275 /* method hash_collection#HashMapValues#has_only for (self: HashMapValues[Object, nullable Object], nullable Object): Bool */
2276 short int hash_collection__HashMapValues__has_only(val* self, val* p0) {
2277 short int var /* : Bool */;
2278 short int var1 /* : Bool */;
2279 int cltype;
2280 int idtype;
2281 const struct type* type_struct;
2282 short int is_nullable;
2283 const char* var_class_name;
2284 val* var_item /* var item: nullable Object */;
2285 val* var2 /* : HashMap[Object, nullable Object] */;
2286 val* var3 /* : nullable HashNode[Object] */;
2287 val* var_c /* var c: nullable HashMapNode[Object, nullable Object] */;
2288 val* var4 /* : null */;
2289 short int var5 /* : Bool */;
2290 val* var6 /* : nullable Object */;
2291 short int var7 /* : Bool */;
2292 short int var8 /* : Bool */;
2293 val* var9 /* : nullable HashNode[Object] */;
2294 short int var10 /* : Bool */;
2295 /* Covariant cast for argument 0 (item) <p0:nullable Object> isa Collection#0 */
2296 /* <p0:nullable Object> isa Collection#0 */
2297 type_struct = self->type->resolution_table->types[COLOR_abstract_collection__Collection_FT0];
2298 cltype = type_struct->color;
2299 idtype = type_struct->id;
2300 is_nullable = type_struct->is_nullable;
2301 if(p0 == NULL) {
2302 var1 = is_nullable;
2303 } else {
2304 if(cltype >= p0->type->table_size) {
2305 var1 = 0;
2306 } else {
2307 var1 = p0->type->type_table[cltype] == idtype;
2308 }
2309 }
2310 if (!var1) {
2311 var_class_name = p0 == NULL ? "null" : p0->type->name;
2312 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Collection#0", var_class_name);
2313 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 298);
2314 show_backtrace(1);
2315 }
2316 var_item = p0;
2317 var2 = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapValues__map]))(self) /* map on <self:HashMapValues[Object, nullable Object]>*/;
2318 var3 = var2->attrs[COLOR_hash_collection__HashCollection___first_item].val; /* _first_item on <var2:HashMap[Object, nullable Object]> */
2319 var_c = var3;
2320 for(;;) {
2321 var4 = NULL;
2322 if (var_c == NULL) {
2323 var5 = 0; /* is null */
2324 } else {
2325 var5 = 1; /* arg is null and recv is not */
2326 }
2327 if (!var5) break;
2328 var6 = var_c->attrs[COLOR_hash_collection__HashMapNode___value].val; /* _value on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
2329 if (var6 == NULL) {
2330 var7 = (var_item != NULL);
2331 } else {
2332 var7 = ((short int (*)(val*, val*))(var6->class->vft[COLOR_kernel__Object___33d_61d]))(var6, var_item) /* != on <var6:nullable Object>*/;
2333 }
2334 if (var7){
2335 var8 = 0;
2336 var = var8;
2337 goto RET_LABEL;
2338 } else {
2339 }
2340 var9 = var_c->attrs[COLOR_hash_collection__HashNode___next_item].val; /* _next_item on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
2341 var_c = var9;
2342 CONTINUE_label: (void)0;
2343 }
2344 BREAK_label: (void)0;
2345 var10 = 1;
2346 var = var10;
2347 goto RET_LABEL;
2348 RET_LABEL:;
2349 return var;
2350 }
2351 /* method hash_collection#HashMapValues#has_only for (self: Object, nullable Object): Bool */
2352 short int VIRTUAL_hash_collection__HashMapValues__has_only(val* self, val* p0) {
2353 short int var /* : Bool */;
2354 short int var1 /* : Bool */;
2355 var1 = hash_collection__HashMapValues__has_only(self, p0);
2356 var = var1;
2357 RET_LABEL:;
2358 return var;
2359 }
2360 /* method hash_collection#HashMapValues#is_empty for (self: HashMapValues[Object, nullable Object]): Bool */
2361 short int hash_collection__HashMapValues__is_empty(val* self) {
2362 short int var /* : Bool */;
2363 val* var1 /* : HashMap[Object, nullable Object] */;
2364 short int var2 /* : Bool */;
2365 var1 = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapValues__map]))(self) /* map on <self:HashMapValues[Object, nullable Object]>*/;
2366 var2 = ((short int (*)(val*))(var1->class->vft[COLOR_abstract_collection__MapRead__is_empty]))(var1) /* is_empty on <var1:HashMap[Object, nullable Object]>*/;
2367 var = var2;
2368 goto RET_LABEL;
2369 RET_LABEL:;
2370 return var;
2371 }
2372 /* method hash_collection#HashMapValues#is_empty for (self: Object): Bool */
2373 short int VIRTUAL_hash_collection__HashMapValues__is_empty(val* self) {
2374 short int var /* : Bool */;
2375 short int var1 /* : Bool */;
2376 var1 = hash_collection__HashMapValues__is_empty(self);
2377 var = var1;
2378 RET_LABEL:;
2379 return var;
2380 }
2381 /* method hash_collection#HashMapValues#length for (self: HashMapValues[Object, nullable Object]): Int */
2382 long hash_collection__HashMapValues__length(val* self) {
2383 long var /* : Int */;
2384 val* var1 /* : HashMap[Object, nullable Object] */;
2385 long var2 /* : Int */;
2386 var1 = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapValues__map]))(self) /* map on <self:HashMapValues[Object, nullable Object]>*/;
2387 var2 = ((long (*)(val*))(var1->class->vft[COLOR_abstract_collection__MapRead__length]))(var1) /* length on <var1:HashMap[Object, nullable Object]>*/;
2388 var = var2;
2389 goto RET_LABEL;
2390 RET_LABEL:;
2391 return var;
2392 }
2393 /* method hash_collection#HashMapValues#length for (self: Object): Int */
2394 long VIRTUAL_hash_collection__HashMapValues__length(val* self) {
2395 long var /* : Int */;
2396 long var1 /* : Int */;
2397 var1 = hash_collection__HashMapValues__length(self);
2398 var = var1;
2399 RET_LABEL:;
2400 return var;
2401 }
2402 /* method hash_collection#HashMapValues#iterator for (self: HashMapValues[Object, nullable Object]): Iterator[nullable Object] */
2403 val* hash_collection__HashMapValues__iterator(val* self) {
2404 val* var /* : Iterator[nullable Object] */;
2405 val* var1 /* : MapValuesIterator[Object, nullable Object] */;
2406 val* var2 /* : HashMap[Object, nullable Object] */;
2407 val* var3 /* : MapIterator[Object, nullable Object] */;
2408 var1 = NEW_abstract_collection__MapValuesIterator(self->type->resolution_table->types[COLOR_abstract_collection__MapValuesIteratorhash_collection__HashMapValues_FT0hash_collection__HashMapValues_FT1]);
2409 var2 = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapValues__map]))(self) /* map on <self:HashMapValues[Object, nullable Object]>*/;
2410 var3 = ((val* (*)(val*))(var2->class->vft[COLOR_abstract_collection__MapRead__iterator]))(var2) /* iterator on <var2:HashMap[Object, nullable Object]>*/;
2411 ((void (*)(val*, val*))(var1->class->vft[COLOR_abstract_collection__MapValuesIterator__init]))(var1, var3) /* init on <var1:MapValuesIterator[Object, nullable Object]>*/;
2412 var = var1;
2413 goto RET_LABEL;
2414 RET_LABEL:;
2415 return var;
2416 }
2417 /* method hash_collection#HashMapValues#iterator for (self: Object): Iterator[nullable Object] */
2418 val* VIRTUAL_hash_collection__HashMapValues__iterator(val* self) {
2419 val* var /* : Iterator[nullable Object] */;
2420 val* var1 /* : Iterator[nullable Object] */;
2421 var1 = hash_collection__HashMapValues__iterator(self);
2422 var = var1;
2423 RET_LABEL:;
2424 return var;
2425 }
2426 /* method hash_collection#HashMapValues#clear for (self: HashMapValues[Object, nullable Object]) */
2427 void hash_collection__HashMapValues__clear(val* self) {
2428 val* var /* : HashMap[Object, nullable Object] */;
2429 var = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapValues__map]))(self) /* map on <self:HashMapValues[Object, nullable Object]>*/;
2430 ((void (*)(val*))(var->class->vft[COLOR_abstract_collection__Map__clear]))(var) /* clear on <var:HashMap[Object, nullable Object]>*/;
2431 RET_LABEL:;
2432 }
2433 /* method hash_collection#HashMapValues#clear for (self: Object) */
2434 void VIRTUAL_hash_collection__HashMapValues__clear(val* self) {
2435 hash_collection__HashMapValues__clear(self);
2436 RET_LABEL:;
2437 }
2438 /* method hash_collection#HashMapValues#remove for (self: HashMapValues[Object, nullable Object], nullable Object) */
2439 void hash_collection__HashMapValues__remove(val* self, val* p0) {
2440 short int var /* : Bool */;
2441 int cltype;
2442 int idtype;
2443 const struct type* type_struct;
2444 short int is_nullable;
2445 const char* var_class_name;
2446 val* var_item /* var item: nullable Object */;
2447 val* var1 /* : HashMap[Object, nullable Object] */;
2448 val* var_map /* var map: HashMap[Object, nullable Object] */;
2449 val* var2 /* : nullable HashNode[Object] */;
2450 val* var_c /* var c: nullable HashMapNode[Object, nullable Object] */;
2451 val* var3 /* : null */;
2452 short int var4 /* : Bool */;
2453 val* var5 /* : nullable Object */;
2454 short int var6 /* : Bool */;
2455 val* var7 /* : Object */;
2456 val* var8 /* : nullable HashNode[Object] */;
2457 /* Covariant cast for argument 0 (item) <p0:nullable Object> isa RemovableCollection#0 */
2458 /* <p0:nullable Object> isa RemovableCollection#0 */
2459 type_struct = self->type->resolution_table->types[COLOR_abstract_collection__RemovableCollection_FT0];
2460 cltype = type_struct->color;
2461 idtype = type_struct->id;
2462 is_nullable = type_struct->is_nullable;
2463 if(p0 == NULL) {
2464 var = is_nullable;
2465 } else {
2466 if(cltype >= p0->type->table_size) {
2467 var = 0;
2468 } else {
2469 var = p0->type->type_table[cltype] == idtype;
2470 }
2471 }
2472 if (!var) {
2473 var_class_name = p0 == NULL ? "null" : p0->type->name;
2474 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "RemovableCollection#0", var_class_name);
2475 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 315);
2476 show_backtrace(1);
2477 }
2478 var_item = p0;
2479 var1 = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapValues__map]))(self) /* map on <self:HashMapValues[Object, nullable Object]>*/;
2480 var_map = var1;
2481 var2 = var_map->attrs[COLOR_hash_collection__HashCollection___first_item].val; /* _first_item on <var_map:HashMap[Object, nullable Object]> */
2482 var_c = var2;
2483 for(;;) {
2484 var3 = NULL;
2485 if (var_c == NULL) {
2486 var4 = 0; /* is null */
2487 } else {
2488 var4 = 1; /* arg is null and recv is not */
2489 }
2490 if (!var4) break;
2491 var5 = var_c->attrs[COLOR_hash_collection__HashMapNode___value].val; /* _value on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
2492 if (var5 == NULL) {
2493 var6 = (var_item == NULL);
2494 } else {
2495 var6 = ((short int (*)(val*, val*))(var5->class->vft[COLOR_kernel__Object___61d_61d]))(var5, var_item) /* == on <var5:nullable Object>*/;
2496 }
2497 if (var6){
2498 var7 = var_c->attrs[COLOR_hash_collection__HashNode___key].val; /* _key on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
2499 if (var7 == NULL) {
2500 fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _key");
2501 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 321);
2502 show_backtrace(1);
2503 }
2504 ((void (*)(val*, val*))(var_map->class->vft[COLOR_hash_collection__HashCollection__remove_node]))(var_map, var7) /* remove_node on <var_map:HashMap[Object, nullable Object]>*/;
2505 goto RET_LABEL;
2506 } else {
2507 }
2508 var8 = var_c->attrs[COLOR_hash_collection__HashNode___next_item].val; /* _next_item on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
2509 var_c = var8;
2510 CONTINUE_label: (void)0;
2511 }
2512 BREAK_label: (void)0;
2513 RET_LABEL:;
2514 }
2515 /* method hash_collection#HashMapValues#remove for (self: Object, nullable Object) */
2516 void VIRTUAL_hash_collection__HashMapValues__remove(val* self, val* p0) {
2517 hash_collection__HashMapValues__remove(self, p0);
2518 RET_LABEL:;
2519 }
2520 /* method hash_collection#HashMapValues#remove_all for (self: HashMapValues[Object, nullable Object], nullable Object) */
2521 void hash_collection__HashMapValues__remove_all(val* self, val* p0) {
2522 short int var /* : Bool */;
2523 int cltype;
2524 int idtype;
2525 const struct type* type_struct;
2526 short int is_nullable;
2527 const char* var_class_name;
2528 val* var_item /* var item: nullable Object */;
2529 val* var1 /* : HashMap[Object, nullable Object] */;
2530 val* var_map /* var map: HashMap[Object, nullable Object] */;
2531 val* var2 /* : nullable HashNode[Object] */;
2532 val* var_c /* var c: nullable HashMapNode[Object, nullable Object] */;
2533 val* var3 /* : null */;
2534 short int var4 /* : Bool */;
2535 val* var5 /* : nullable Object */;
2536 short int var6 /* : Bool */;
2537 val* var7 /* : Object */;
2538 val* var8 /* : nullable HashNode[Object] */;
2539 /* Covariant cast for argument 0 (item) <p0:nullable Object> isa RemovableCollection#0 */
2540 /* <p0:nullable Object> isa RemovableCollection#0 */
2541 type_struct = self->type->resolution_table->types[COLOR_abstract_collection__RemovableCollection_FT0];
2542 cltype = type_struct->color;
2543 idtype = type_struct->id;
2544 is_nullable = type_struct->is_nullable;
2545 if(p0 == NULL) {
2546 var = is_nullable;
2547 } else {
2548 if(cltype >= p0->type->table_size) {
2549 var = 0;
2550 } else {
2551 var = p0->type->type_table[cltype] == idtype;
2552 }
2553 }
2554 if (!var) {
2555 var_class_name = p0 == NULL ? "null" : p0->type->name;
2556 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "RemovableCollection#0", var_class_name);
2557 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 328);
2558 show_backtrace(1);
2559 }
2560 var_item = p0;
2561 var1 = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapValues__map]))(self) /* map on <self:HashMapValues[Object, nullable Object]>*/;
2562 var_map = var1;
2563 var2 = var_map->attrs[COLOR_hash_collection__HashCollection___first_item].val; /* _first_item on <var_map:HashMap[Object, nullable Object]> */
2564 var_c = var2;
2565 for(;;) {
2566 var3 = NULL;
2567 if (var_c == NULL) {
2568 var4 = 0; /* is null */
2569 } else {
2570 var4 = 1; /* arg is null and recv is not */
2571 }
2572 if (!var4) break;
2573 var5 = var_c->attrs[COLOR_hash_collection__HashMapNode___value].val; /* _value on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
2574 if (var5 == NULL) {
2575 var6 = (var_item == NULL);
2576 } else {
2577 var6 = ((short int (*)(val*, val*))(var5->class->vft[COLOR_kernel__Object___61d_61d]))(var5, var_item) /* == on <var5:nullable Object>*/;
2578 }
2579 if (var6){
2580 var7 = var_c->attrs[COLOR_hash_collection__HashNode___key].val; /* _key on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
2581 if (var7 == NULL) {
2582 fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _key");
2583 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 334);
2584 show_backtrace(1);
2585 }
2586 ((void (*)(val*, val*))(var_map->class->vft[COLOR_hash_collection__HashCollection__remove_node]))(var_map, var7) /* remove_node on <var_map:HashMap[Object, nullable Object]>*/;
2587 } else {
2588 }
2589 var8 = var_c->attrs[COLOR_hash_collection__HashNode___next_item].val; /* _next_item on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
2590 var_c = var8;
2591 CONTINUE_label: (void)0;
2592 }
2593 BREAK_label: (void)0;
2594 RET_LABEL:;
2595 }
2596 /* method hash_collection#HashMapValues#remove_all for (self: Object, nullable Object) */
2597 void VIRTUAL_hash_collection__HashMapValues__remove_all(val* self, val* p0) {
2598 hash_collection__HashMapValues__remove_all(self, p0);
2599 RET_LABEL:;
2600 }
2601 /* method hash_collection#HashMapValues#init for (self: HashMapValues[Object, nullable Object], HashMap[Object, nullable Object]) */
2602 void hash_collection__HashMapValues__init(val* self, val* p0) {
2603 short int var /* : Bool */;
2604 int cltype;
2605 int idtype;
2606 const struct type* type_struct;
2607 const char* var_class_name;
2608 /* Covariant cast for argument 0 (map) <p0:HashMap[Object, nullable Object]> isa HashMap[HashMapValues#0, HashMapValues#1] */
2609 /* <p0:HashMap[Object, nullable Object]> isa HashMap[HashMapValues#0, HashMapValues#1] */
2610 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashMaphash_collection__HashMapValues_FT0hash_collection__HashMapValues_FT1];
2611 cltype = type_struct->color;
2612 idtype = type_struct->id;
2613 if(cltype >= p0->type->table_size) {
2614 var = 0;
2615 } else {
2616 var = p0->type->type_table[cltype] == idtype;
2617 }
2618 if (!var) {
2619 var_class_name = p0 == NULL ? "null" : p0->type->name;
2620 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap[HashMapValues#0, HashMapValues#1]", var_class_name);
2621 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 270);
2622 show_backtrace(1);
2623 }
2624 self->attrs[COLOR_hash_collection__HashMapValues___64dmap].val = p0; /* @map on <self:HashMapValues[Object, nullable Object]> */
2625 RET_LABEL:;
2626 }
2627 /* method hash_collection#HashMapValues#init for (self: Object, HashMap[Object, nullable Object]) */
2628 void VIRTUAL_hash_collection__HashMapValues__init(val* self, val* p0) {
2629 hash_collection__HashMapValues__init(self, p0);
2630 RET_LABEL:;
2631 }
2632 /* method hash_collection#HashMapNode#init for (self: HashMapNode[Object, nullable Object], Object, nullable Object) */
2633 void hash_collection__HashMapNode__init(val* self, val* p0, val* p1) {
2634 short int var /* : Bool */;
2635 int cltype;
2636 int idtype;
2637 const struct type* type_struct;
2638 const char* var_class_name;
2639 short int var1 /* : Bool */;
2640 int cltype2;
2641 int idtype3;
2642 const struct type* type_struct4;
2643 short int is_nullable;
2644 const char* var_class_name5;
2645 val* var_k /* var k: Object */;
2646 val* var_v /* var v: nullable Object */;
2647 /* Covariant cast for argument 0 (k) <p0:Object> isa HashMapNode#0 */
2648 /* <p0:Object> isa HashMapNode#0 */
2649 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashMapNode_FT0];
2650 cltype = type_struct->color;
2651 idtype = type_struct->id;
2652 if(cltype >= p0->type->table_size) {
2653 var = 0;
2654 } else {
2655 var = p0->type->type_table[cltype] == idtype;
2656 }
2657 if (!var) {
2658 var_class_name = p0 == NULL ? "null" : p0->type->name;
2659 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMapNode#0", var_class_name);
2660 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 346);
2661 show_backtrace(1);
2662 }
2663 /* Covariant cast for argument 1 (v) <p1:nullable Object> isa HashMapNode#1 */
2664 /* <p1:nullable Object> isa HashMapNode#1 */
2665 type_struct4 = self->type->resolution_table->types[COLOR_hash_collection__HashMapNode_FT1];
2666 cltype2 = type_struct4->color;
2667 idtype3 = type_struct4->id;
2668 is_nullable = type_struct4->is_nullable;
2669 if(p1 == NULL) {
2670 var1 = is_nullable;
2671 } else {
2672 if(cltype2 >= p1->type->table_size) {
2673 var1 = 0;
2674 } else {
2675 var1 = p1->type->type_table[cltype2] == idtype3;
2676 }
2677 }
2678 if (!var1) {
2679 var_class_name5 = p1 == NULL ? "null" : p1->type->name;
2680 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMapNode#1", var_class_name5);
2681 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 346);
2682 show_backtrace(1);
2683 }
2684 var_k = p0;
2685 var_v = p1;
2686 ((void (*)(val*, val*))(self->class->vft[COLOR_hash_collection__HashNode__init]))(self, var_k) /* init on <self:HashMapNode[Object, nullable Object]>*/;
2687 self->attrs[COLOR_hash_collection__HashMapNode___value].val = var_v; /* _value on <self:HashMapNode[Object, nullable Object]> */
2688 RET_LABEL:;
2689 }
2690 /* method hash_collection#HashMapNode#init for (self: Object, Object, nullable Object) */
2691 void VIRTUAL_hash_collection__HashMapNode__init(val* self, val* p0, val* p1) {
2692 hash_collection__HashMapNode__init(self, p0, p1);
2693 RET_LABEL:;
2694 }
2695 /* method hash_collection#HashMapIterator#is_ok for (self: HashMapIterator[Object, nullable Object]): Bool */
2696 short int hash_collection__HashMapIterator__is_ok(val* self) {
2697 short int var /* : Bool */;
2698 val* var1 /* : nullable HashMapNode[Object, nullable Object] */;
2699 val* var2 /* : null */;
2700 short int var3 /* : Bool */;
2701 var1 = self->attrs[COLOR_hash_collection__HashMapIterator___node].val; /* _node on <self:HashMapIterator[Object, nullable Object]> */
2702 var2 = NULL;
2703 if (var1 == NULL) {
2704 var3 = 0; /* is null */
2705 } else {
2706 var3 = 1; /* arg is null and recv is not */
2707 }
2708 var = var3;
2709 goto RET_LABEL;
2710 RET_LABEL:;
2711 return var;
2712 }
2713 /* method hash_collection#HashMapIterator#is_ok for (self: Object): Bool */
2714 short int VIRTUAL_hash_collection__HashMapIterator__is_ok(val* self) {
2715 short int var /* : Bool */;
2716 short int var1 /* : Bool */;
2717 var1 = hash_collection__HashMapIterator__is_ok(self);
2718 var = var1;
2719 RET_LABEL:;
2720 return var;
2721 }
2722 /* method hash_collection#HashMapIterator#item for (self: HashMapIterator[Object, nullable Object]): nullable Object */
2723 val* hash_collection__HashMapIterator__item(val* self) {
2724 val* var /* : nullable Object */;
2725 short int var1 /* : Bool */;
2726 val* var2 /* : nullable HashMapNode[Object, nullable Object] */;
2727 val* var3 /* : nullable Object */;
2728 var1 = ((short int (*)(val*))(self->class->vft[COLOR_abstract_collection__MapIterator__is_ok]))(self) /* is_ok on <self:HashMapIterator[Object, nullable Object]>*/;
2729 if (!var1) {
2730 fprintf(stderr, "Runtime error: %s", "Assert failed");
2731 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 359);
2732 show_backtrace(1);
2733 }
2734 var2 = self->attrs[COLOR_hash_collection__HashMapIterator___node].val; /* _node on <self:HashMapIterator[Object, nullable Object]> */
2735 if (var2 == NULL) {
2736 fprintf(stderr, "Runtime error: %s", "Receiver is null");
2737 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 360);
2738 show_backtrace(1);
2739 }
2740 var3 = var2->attrs[COLOR_hash_collection__HashMapNode___value].val; /* _value on <var2:nullable HashMapNode[Object, nullable Object]> */
2741 var = var3;
2742 goto RET_LABEL;
2743 RET_LABEL:;
2744 return var;
2745 }
2746 /* method hash_collection#HashMapIterator#item for (self: Object): nullable Object */
2747 val* VIRTUAL_hash_collection__HashMapIterator__item(val* self) {
2748 val* var /* : nullable Object */;
2749 val* var1 /* : nullable Object */;
2750 var1 = hash_collection__HashMapIterator__item(self);
2751 var = var1;
2752 RET_LABEL:;
2753 return var;
2754 }
2755 /* method hash_collection#HashMapIterator#key for (self: HashMapIterator[Object, nullable Object]): Object */
2756 val* hash_collection__HashMapIterator__key(val* self) {
2757 val* var /* : Object */;
2758 short int var1 /* : Bool */;
2759 val* var2 /* : nullable HashMapNode[Object, nullable Object] */;
2760 val* var3 /* : Object */;
2761 var1 = ((short int (*)(val*))(self->class->vft[COLOR_abstract_collection__MapIterator__is_ok]))(self) /* is_ok on <self:HashMapIterator[Object, nullable Object]>*/;
2762 if (!var1) {
2763 fprintf(stderr, "Runtime error: %s", "Assert failed");
2764 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 371);
2765 show_backtrace(1);
2766 }
2767 var2 = self->attrs[COLOR_hash_collection__HashMapIterator___node].val; /* _node on <self:HashMapIterator[Object, nullable Object]> */
2768 if (var2 == NULL) {
2769 fprintf(stderr, "Runtime error: %s", "Receiver is null");
2770 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 372);
2771 show_backtrace(1);
2772 }
2773 var3 = var2->attrs[COLOR_hash_collection__HashNode___key].val; /* _key on <var2:nullable HashMapNode[Object, nullable Object]> */
2774 if (var3 == NULL) {
2775 fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _key");
2776 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 372);
2777 show_backtrace(1);
2778 }
2779 var = var3;
2780 goto RET_LABEL;
2781 RET_LABEL:;
2782 return var;
2783 }
2784 /* method hash_collection#HashMapIterator#key for (self: Object): Object */
2785 val* VIRTUAL_hash_collection__HashMapIterator__key(val* self) {
2786 val* var /* : Object */;
2787 val* var1 /* : Object */;
2788 var1 = hash_collection__HashMapIterator__key(self);
2789 var = var1;
2790 RET_LABEL:;
2791 return var;
2792 }
2793 /* method hash_collection#HashMapIterator#next for (self: HashMapIterator[Object, nullable Object]) */
2794 void hash_collection__HashMapIterator__next(val* self) {
2795 short int var /* : Bool */;
2796 val* var1 /* : nullable HashMapNode[Object, nullable Object] */;
2797 val* var2 /* : nullable HashNode[Object] */;
2798 var = ((short int (*)(val*))(self->class->vft[COLOR_abstract_collection__MapIterator__is_ok]))(self) /* is_ok on <self:HashMapIterator[Object, nullable Object]>*/;
2799 if (!var) {
2800 fprintf(stderr, "Runtime error: %s", "Assert failed");
2801 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 377);
2802 show_backtrace(1);
2803 }
2804 var1 = self->attrs[COLOR_hash_collection__HashMapIterator___node].val; /* _node on <self:HashMapIterator[Object, nullable Object]> */
2805 if (var1 == NULL) {
2806 fprintf(stderr, "Runtime error: %s", "Receiver is null");
2807 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 378);
2808 show_backtrace(1);
2809 }
2810 var2 = var1->attrs[COLOR_hash_collection__HashNode___next_item].val; /* _next_item on <var1:nullable HashMapNode[Object, nullable Object]> */
2811 self->attrs[COLOR_hash_collection__HashMapIterator___node].val = var2; /* _node on <self:HashMapIterator[Object, nullable Object]> */
2812 RET_LABEL:;
2813 }
2814 /* method hash_collection#HashMapIterator#next for (self: Object) */
2815 void VIRTUAL_hash_collection__HashMapIterator__next(val* self) {
2816 hash_collection__HashMapIterator__next(self);
2817 RET_LABEL:;
2818 }
2819 /* method hash_collection#HashMapIterator#init for (self: HashMapIterator[Object, nullable Object], HashMap[Object, nullable Object]) */
2820 void hash_collection__HashMapIterator__init(val* self, val* p0) {
2821 short int var /* : Bool */;
2822 int cltype;
2823 int idtype;
2824 const struct type* type_struct;
2825 const char* var_class_name;
2826 val* var_map /* var map: HashMap[Object, nullable Object] */;
2827 val* var1 /* : nullable HashNode[Object] */;
2828 /* Covariant cast for argument 0 (map) <p0:HashMap[Object, nullable Object]> isa HashMap[HashMapIterator#0, HashMapIterator#1] */
2829 /* <p0:HashMap[Object, nullable Object]> isa HashMap[HashMapIterator#0, HashMapIterator#1] */
2830 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashMaphash_collection__HashMapIterator_FT0hash_collection__HashMapIterator_FT1];
2831 cltype = type_struct->color;
2832 idtype = type_struct->id;
2833 if(cltype >= p0->type->table_size) {
2834 var = 0;
2835 } else {
2836 var = p0->type->type_table[cltype] == idtype;
2837 }
2838 if (!var) {
2839 var_class_name = p0 == NULL ? "null" : p0->type->name;
2840 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap[HashMapIterator#0, HashMapIterator#1]", var_class_name);
2841 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 387);
2842 show_backtrace(1);
2843 }
2844 var_map = p0;
2845 self->attrs[COLOR_hash_collection__HashMapIterator___map].val = var_map; /* _map on <self:HashMapIterator[Object, nullable Object]> */
2846 var1 = ((val* (*)(val*))(var_map->class->vft[COLOR_hash_collection__HashCollection__first_item]))(var_map) /* first_item on <var_map:HashMap[Object, nullable Object]>*/;
2847 self->attrs[COLOR_hash_collection__HashMapIterator___node].val = var1; /* _node on <self:HashMapIterator[Object, nullable Object]> */
2848 RET_LABEL:;
2849 }
2850 /* method hash_collection#HashMapIterator#init for (self: Object, HashMap[Object, nullable Object]) */
2851 void VIRTUAL_hash_collection__HashMapIterator__init(val* self, val* p0) {
2852 hash_collection__HashMapIterator__init(self, p0);
2853 RET_LABEL:;
2854 }
2855 /* method hash_collection#HashSet#length for (self: HashSet[Object]): Int */
2856 long hash_collection__HashSet__length(val* self) {
2857 long var /* : Int */;
2858 long var1 /* : Int */;
2859 var1 = self->attrs[COLOR_hash_collection__HashCollection___length].l; /* _length on <self:HashSet[Object]> */
2860 var = var1;
2861 goto RET_LABEL;
2862 RET_LABEL:;
2863 return var;
2864 }
2865 /* method hash_collection#HashSet#length for (self: Object): Int */
2866 long VIRTUAL_hash_collection__HashSet__length(val* self) {
2867 long var /* : Int */;
2868 long var1 /* : Int */;
2869 var1 = hash_collection__HashSet__length(self);
2870 var = var1;
2871 RET_LABEL:;
2872 return var;
2873 }
2874 /* method hash_collection#HashSet#is_empty for (self: HashSet[Object]): Bool */
2875 short int hash_collection__HashSet__is_empty(val* self) {
2876 short int var /* : Bool */;
2877 long var1 /* : Int */;
2878 long var2 /* : Int */;
2879 short int var3 /* : Bool */;
2880 short int var5 /* : Bool */;
2881 var1 = self->attrs[COLOR_hash_collection__HashCollection___length].l; /* _length on <self:HashSet[Object]> */
2882 var2 = 0;
2883 { /* Inline kernel#Int#== (var1,var2) */
2884 var5 = var1 == var2;
2885 var3 = var5;
2886 goto RET_LABEL4;
2887 RET_LABEL4:(void)0;
2888 }
2889 var = var3;
2890 goto RET_LABEL;
2891 RET_LABEL:;
2892 return var;
2893 }
2894 /* method hash_collection#HashSet#is_empty for (self: Object): Bool */
2895 short int VIRTUAL_hash_collection__HashSet__is_empty(val* self) {
2896 short int var /* : Bool */;
2897 short int var1 /* : Bool */;
2898 var1 = hash_collection__HashSet__is_empty(self);
2899 var = var1;
2900 RET_LABEL:;
2901 return var;
2902 }
2903 /* method hash_collection#HashSet#first for (self: HashSet[Object]): Object */
2904 val* hash_collection__HashSet__first(val* self) {
2905 val* var /* : Object */;
2906 long var1 /* : Int */;
2907 long var2 /* : Int */;
2908 short int var3 /* : Bool */;
2909 short int var5 /* : Bool */;
2910 int cltype;
2911 int idtype;
2912 const char* var_class_name;
2913 short int var6 /* : Bool */;
2914 val* var7 /* : nullable HashNode[Object] */;
2915 val* var8 /* : Object */;
2916 var1 = self->attrs[COLOR_hash_collection__HashCollection___length].l; /* _length on <self:HashSet[Object]> */
2917 var2 = 0;
2918 { /* Inline kernel#Int#> (var1,var2) */
2919 /* Covariant cast for argument 0 (i) <var2:Int> isa OTHER */
2920 /* <var2:Int> isa OTHER */
2921 var5 = 1; /* easy <var2:Int> isa OTHER*/
2922 if (!var5) {
2923 var_class_name = type_kernel__Int.name;
2924 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name);
2925 fprintf(stderr, " (%s:%d)\n", "lib/standard/kernel.nit", 267);
2926 show_backtrace(1);
2927 }
2928 var6 = var1 > var2;
2929 var3 = var6;
2930 goto RET_LABEL4;
2931 RET_LABEL4:(void)0;
2932 }
2933 if (!var3) {
2934 fprintf(stderr, "Runtime error: %s", "Assert failed");
2935 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 406);
2936 show_backtrace(1);
2937 }
2938 var7 = self->attrs[COLOR_hash_collection__HashCollection___first_item].val; /* _first_item on <self:HashSet[Object]> */
2939 if (var7 == NULL) {
2940 fprintf(stderr, "Runtime error: %s", "Receiver is null");
2941 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 407);
2942 show_backtrace(1);
2943 }
2944 var8 = var7->attrs[COLOR_hash_collection__HashNode___key].val; /* _key on <var7:nullable HashNode[Object](nullable HashSetNode[Object])> */
2945 if (var8 == NULL) {
2946 fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _key");
2947 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 407);
2948 show_backtrace(1);
2949 }
2950 var = var8;
2951 goto RET_LABEL;
2952 RET_LABEL:;
2953 return var;
2954 }
2955 /* method hash_collection#HashSet#first for (self: Object): nullable Object */
2956 val* VIRTUAL_hash_collection__HashSet__first(val* self) {
2957 val* var /* : nullable Object */;
2958 val* var1 /* : Object */;
2959 var1 = hash_collection__HashSet__first(self);
2960 var = var1;
2961 RET_LABEL:;
2962 return var;
2963 }
2964 /* method hash_collection#HashSet#has for (self: HashSet[Object], Object): Bool */
2965 short int hash_collection__HashSet__has(val* self, val* p0) {
2966 short int var /* : Bool */;
2967 short int var1 /* : Bool */;
2968 int cltype;
2969 int idtype;
2970 const struct type* type_struct;
2971 const char* var_class_name;
2972 val* var_item /* var item: Object */;
2973 val* var2 /* : nullable HashNode[Object] */;
2974 val* var3 /* : null */;
2975 short int var4 /* : Bool */;
2976 /* Covariant cast for argument 0 (item) <p0:Object> isa Collection#0 */
2977 /* <p0:Object> isa Collection#0 */
2978 type_struct = self->type->resolution_table->types[COLOR_abstract_collection__Collection_FT0];
2979 cltype = type_struct->color;
2980 idtype = type_struct->id;
2981 if(cltype >= p0->type->table_size) {
2982 var1 = 0;
2983 } else {
2984 var1 = p0->type->type_table[cltype] == idtype;
2985 }
2986 if (!var1) {
2987 var_class_name = p0 == NULL ? "null" : p0->type->name;
2988 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Collection#0", var_class_name);
2989 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 410);
2990 show_backtrace(1);
2991 }
2992 var_item = p0;
2993 var2 = ((val* (*)(val*, val*))(self->class->vft[COLOR_hash_collection__HashCollection__node_at]))(self, var_item) /* node_at on <self:HashSet[Object]>*/;
2994 var3 = NULL;
2995 if (var2 == NULL) {
2996 var4 = 0; /* is null */
2997 } else {
2998 var4 = 1; /* arg is null and recv is not */
2999 }
3000 var = var4;
3001 goto RET_LABEL;
3002 RET_LABEL:;
3003 return var;
3004 }
3005 /* method hash_collection#HashSet#has for (self: Object, nullable Object): Bool */
3006 short int VIRTUAL_hash_collection__HashSet__has(val* self, val* p0) {
3007 short int var /* : Bool */;
3008 short int var1 /* : Bool */;
3009 var1 = hash_collection__HashSet__has(self, p0);
3010 var = var1;
3011 RET_LABEL:;
3012 return var;
3013 }
3014 /* method hash_collection#HashSet#add for (self: HashSet[Object], Object) */
3015 void hash_collection__HashSet__add(val* self, val* p0) {
3016 short int var /* : Bool */;
3017 int cltype;
3018 int idtype;
3019 const struct type* type_struct;
3020 const char* var_class_name;
3021 val* var_item /* var item: Object */;
3022 long var1 /* : Int */;
3023 long var_i /* var i: Int */;
3024 val* var2 /* : nullable HashNode[Object] */;
3025 val* var_c /* var c: nullable HashSetNode[Object] */;
3026 val* var3 /* : null */;
3027 short int var4 /* : Bool */;
3028 val* var5 /* : HashSetNode[Object] */;
3029 /* Covariant cast for argument 0 (item) <p0:Object> isa SimpleCollection#0 */
3030 /* <p0:Object> isa SimpleCollection#0 */
3031 type_struct = self->type->resolution_table->types[COLOR_abstract_collection__SimpleCollection_FT0];
3032 cltype = type_struct->color;
3033 idtype = type_struct->id;
3034 if(cltype >= p0->type->table_size) {
3035 var = 0;
3036 } else {
3037 var = p0->type->type_table[cltype] == idtype;
3038 }
3039 if (!var) {
3040 var_class_name = p0 == NULL ? "null" : p0->type->name;
3041 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "SimpleCollection#0", var_class_name);
3042 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 415);
3043 show_backtrace(1);
3044 }
3045 var_item = p0;
3046 var1 = ((long (*)(val*, val*))(self->class->vft[COLOR_hash_collection__HashCollection__index_at]))(self, var_item) /* index_at on <self:HashSet[Object]>*/;
3047 var_i = var1;
3048 var2 = ((val* (*)(val*, long, val*))(self->class->vft[COLOR_hash_collection__HashCollection__node_at_idx]))(self, var_i, var_item) /* node_at_idx on <self:HashSet[Object]>*/;
3049 var_c = var2;
3050 var3 = NULL;
3051 if (var_c == NULL) {
3052 var4 = 0; /* is null */
3053 } else {
3054 var4 = 1; /* arg is null and recv is not */
3055 }
3056 if (var4){
3057 var_c->attrs[COLOR_hash_collection__HashNode___key].val = var_item; /* _key on <var_c:nullable HashSetNode[Object](HashSetNode[Object])> */
3058 } else {
3059 var5 = NEW_hash_collection__HashSetNode(self->type->resolution_table->types[COLOR_hash_collection__HashSetNodehash_collection__HashSet_FT0]);
3060 ((void (*)(val*, val*))(var5->class->vft[COLOR_hash_collection__HashSetNode__init]))(var5, var_item) /* init on <var5:HashSetNode[Object]>*/;
3061 ((void (*)(val*, long, val*))(self->class->vft[COLOR_hash_collection__HashCollection__store]))(self, var_i, var5) /* store on <self:HashSet[Object]>*/;
3062 }
3063 RET_LABEL:;
3064 }
3065 /* method hash_collection#HashSet#add for (self: Object, nullable Object) */
3066 void VIRTUAL_hash_collection__HashSet__add(val* self, val* p0) {
3067 hash_collection__HashSet__add(self, p0);
3068 RET_LABEL:;
3069 }
3070 /* method hash_collection#HashSet#remove for (self: HashSet[Object], Object) */
3071 void hash_collection__HashSet__remove(val* self, val* p0) {
3072 short int var /* : Bool */;
3073 int cltype;
3074 int idtype;
3075 const struct type* type_struct;
3076 const char* var_class_name;
3077 val* var_item /* var item: Object */;
3078 /* Covariant cast for argument 0 (item) <p0:Object> isa RemovableCollection#0 */
3079 /* <p0:Object> isa RemovableCollection#0 */
3080 type_struct = self->type->resolution_table->types[COLOR_abstract_collection__RemovableCollection_FT0];
3081 cltype = type_struct->color;
3082 idtype = type_struct->id;
3083 if(cltype >= p0->type->table_size) {
3084 var = 0;
3085 } else {
3086 var = p0->type->type_table[cltype] == idtype;
3087 }
3088 if (!var) {
3089 var_class_name = p0 == NULL ? "null" : p0->type->name;
3090 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "RemovableCollection#0", var_class_name);
3091 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 426);
3092 show_backtrace(1);
3093 }
3094 var_item = p0;
3095 ((void (*)(val*, val*))(self->class->vft[COLOR_hash_collection__HashCollection__remove_node]))(self, var_item) /* remove_node on <self:HashSet[Object]>*/;
3096 RET_LABEL:;
3097 }
3098 /* method hash_collection#HashSet#remove for (self: Object, nullable Object) */
3099 void VIRTUAL_hash_collection__HashSet__remove(val* self, val* p0) {
3100 hash_collection__HashSet__remove(self, p0);
3101 RET_LABEL:;
3102 }
3103 /* method hash_collection#HashSet#clear for (self: HashSet[Object]) */
3104 void hash_collection__HashSet__clear(val* self) {
3105 ((void (*)(val*))(self->class->vft[COLOR_hash_collection__HashCollection__raz]))(self) /* raz on <self:HashSet[Object]>*/;
3106 RET_LABEL:;
3107 }
3108 /* method hash_collection#HashSet#clear for (self: Object) */
3109 void VIRTUAL_hash_collection__HashSet__clear(val* self) {
3110 hash_collection__HashSet__clear(self);
3111 RET_LABEL:;
3112 }
3113 /* method hash_collection#HashSet#iterator for (self: HashSet[Object]): Iterator[Object] */
3114 val* hash_collection__HashSet__iterator(val* self) {
3115 val* var /* : Iterator[Object] */;
3116 val* var1 /* : HashSetIterator[Object] */;
3117 var1 = NEW_hash_collection__HashSetIterator(self->type->resolution_table->types[COLOR_hash_collection__HashSetIteratorhash_collection__HashSet_FT0]);
3118 ((void (*)(val*, val*))(var1->class->vft[COLOR_hash_collection__HashSetIterator__init]))(var1, self) /* init on <var1:HashSetIterator[Object]>*/;
3119 var = var1;
3120 goto RET_LABEL;
3121 RET_LABEL:;
3122 return var;
3123 }
3124 /* method hash_collection#HashSet#iterator for (self: Object): Iterator[nullable Object] */
3125 val* VIRTUAL_hash_collection__HashSet__iterator(val* self) {
3126 val* var /* : Iterator[nullable Object] */;
3127 val* var1 /* : Iterator[Object] */;
3128 var1 = hash_collection__HashSet__iterator(self);
3129 var = var1;
3130 RET_LABEL:;
3131 return var;
3132 }
3133 /* method hash_collection#HashSet#init for (self: HashSet[Object]) */
3134 void hash_collection__HashSet__init(val* self) {
3135 long var /* : Int */;
3136 long var1 /* : Int */;
3137 long var2 /* : Int */;
3138 ((void (*)(val*))(self->class->vft[COLOR_hash_collection__HashCollection__init]))(self) /* init on <self:HashSet[Object]>*/;
3139 var = 0;
3140 self->attrs[COLOR_hash_collection__HashCollection___capacity].l = var; /* _capacity on <self:HashSet[Object]> */
3141 var1 = 0;
3142 self->attrs[COLOR_hash_collection__HashCollection___length].l = var1; /* _length on <self:HashSet[Object]> */
3143 var2 = 0;
3144 ((void (*)(val*, long))(self->class->vft[COLOR_hash_collection__HashCollection__enlarge]))(self, var2) /* enlarge on <self:HashSet[Object]>*/;
3145 RET_LABEL:;
3146 }
3147 /* method hash_collection#HashSet#init for (self: Object) */
3148 void VIRTUAL_hash_collection__HashSet__init(val* self) {
3149 hash_collection__HashSet__init(self);
3150 RET_LABEL:;
3151 }
3152 /* method hash_collection#HashSet#from for (self: HashSet[Object], Collection[Object]) */
3153 void hash_collection__HashSet__from(val* self, val* p0) {
3154 short int var /* : Bool */;
3155 int cltype;
3156 int idtype;
3157 const struct type* type_struct;
3158 const char* var_class_name;
3159 val* var_coll /* var coll: Collection[Object] */;
3160 /* Covariant cast for argument 0 (coll) <p0:Collection[Object]> isa Collection[HashSet#0] */
3161 /* <p0:Collection[Object]> isa Collection[HashSet#0] */
3162 type_struct = self->type->resolution_table->types[COLOR_abstract_collection__Collectionhash_collection__HashSet_FT0];
3163 cltype = type_struct->color;
3164 idtype = type_struct->id;
3165 if(cltype >= p0->type->table_size) {
3166 var = 0;
3167 } else {
3168 var = p0->type->type_table[cltype] == idtype;
3169 }
3170 if (!var) {
3171 var_class_name = p0 == NULL ? "null" : p0->type->name;
3172 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Collection[HashSet#0]", var_class_name);
3173 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 439);
3174 show_backtrace(1);
3175 }
3176 var_coll = p0;
3177 ((void (*)(val*))(self->class->vft[COLOR_hash_collection__HashSet__init]))(self) /* init on <self:HashSet[Object]>*/;
3178 ((void (*)(val*, val*))(self->class->vft[COLOR_abstract_collection__SimpleCollection__add_all]))(self, var_coll) /* add_all on <self:HashSet[Object]>*/;
3179 RET_LABEL:;
3180 }
3181 /* method hash_collection#HashSet#from for (self: Object, Collection[Object]) */
3182 void VIRTUAL_hash_collection__HashSet__from(val* self, val* p0) {
3183 hash_collection__HashSet__from(self, p0);
3184 RET_LABEL:;
3185 }
3186 /* method hash_collection#HashSetNode#init for (self: HashSetNode[Object], Object) */
3187 void hash_collection__HashSetNode__init(val* self, val* p0) {
3188 short int var /* : Bool */;
3189 int cltype;
3190 int idtype;
3191 const struct type* type_struct;
3192 const char* var_class_name;
3193 val* var_e /* var e: Object */;
3194 /* Covariant cast for argument 0 (e) <p0:Object> isa HashSetNode#0 */
3195 /* <p0:Object> isa HashSetNode#0 */
3196 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashSetNode_FT0];
3197 cltype = type_struct->color;
3198 idtype = type_struct->id;
3199 if(cltype >= p0->type->table_size) {
3200 var = 0;
3201 } else {
3202 var = p0->type->type_table[cltype] == idtype;
3203 }
3204 if (!var) {
3205 var_class_name = p0 == NULL ? "null" : p0->type->name;
3206 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashSetNode#0", var_class_name);
3207 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 450);
3208 show_backtrace(1);
3209 }
3210 var_e = p0;
3211 ((void (*)(val*, val*))(self->class->vft[COLOR_hash_collection__HashNode__init]))(self, p0) /* init on <self:HashSetNode[Object]>*/;
3212 self->attrs[COLOR_hash_collection__HashNode___key].val = var_e; /* _key on <self:HashSetNode[Object]> */
3213 RET_LABEL:;
3214 }
3215 /* method hash_collection#HashSetNode#init for (self: Object, Object) */
3216 void VIRTUAL_hash_collection__HashSetNode__init(val* self, val* p0) {
3217 hash_collection__HashSetNode__init(self, p0);
3218 RET_LABEL:;
3219 }
3220 /* method hash_collection#HashSetIterator#is_ok for (self: HashSetIterator[Object]): Bool */
3221 short int hash_collection__HashSetIterator__is_ok(val* self) {
3222 short int var /* : Bool */;
3223 val* var1 /* : nullable HashSetNode[Object] */;
3224 val* var2 /* : null */;
3225 short int var3 /* : Bool */;
3226 var1 = self->attrs[COLOR_hash_collection__HashSetIterator___node].val; /* _node on <self:HashSetIterator[Object]> */
3227 var2 = NULL;
3228 if (var1 == NULL) {
3229 var3 = 0; /* is null */
3230 } else {
3231 var3 = 1; /* arg is null and recv is not */
3232 }
3233 var = var3;
3234 goto RET_LABEL;
3235 RET_LABEL:;
3236 return var;
3237 }
3238 /* method hash_collection#HashSetIterator#is_ok for (self: Object): Bool */
3239 short int VIRTUAL_hash_collection__HashSetIterator__is_ok(val* self) {
3240 short int var /* : Bool */;
3241 short int var1 /* : Bool */;
3242 var1 = hash_collection__HashSetIterator__is_ok(self);
3243 var = var1;
3244 RET_LABEL:;
3245 return var;
3246 }
3247 /* method hash_collection#HashSetIterator#item for (self: HashSetIterator[Object]): Object */
3248 val* hash_collection__HashSetIterator__item(val* self) {
3249 val* var /* : Object */;
3250 short int var1 /* : Bool */;
3251 val* var2 /* : nullable HashSetNode[Object] */;
3252 val* var3 /* : Object */;
3253 var1 = ((short int (*)(val*))(self->class->vft[COLOR_abstract_collection__Iterator__is_ok]))(self) /* is_ok on <self:HashSetIterator[Object]>*/;
3254 if (!var1) {
3255 fprintf(stderr, "Runtime error: %s", "Assert failed");
3256 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 462);
3257 show_backtrace(1);
3258 }
3259 var2 = self->attrs[COLOR_hash_collection__HashSetIterator___node].val; /* _node on <self:HashSetIterator[Object]> */
3260 if (var2 == NULL) {
3261 fprintf(stderr, "Runtime error: %s", "Receiver is null");
3262 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 463);
3263 show_backtrace(1);
3264 }
3265 var3 = var2->attrs[COLOR_hash_collection__HashNode___key].val; /* _key on <var2:nullable HashSetNode[Object]> */
3266 if (var3 == NULL) {
3267 fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _key");
3268 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 463);
3269 show_backtrace(1);
3270 }
3271 var = var3;
3272 goto RET_LABEL;
3273 RET_LABEL:;
3274 return var;
3275 }
3276 /* method hash_collection#HashSetIterator#item for (self: Object): nullable Object */
3277 val* VIRTUAL_hash_collection__HashSetIterator__item(val* self) {
3278 val* var /* : nullable Object */;
3279 val* var1 /* : Object */;
3280 var1 = hash_collection__HashSetIterator__item(self);
3281 var = var1;
3282 RET_LABEL:;
3283 return var;
3284 }
3285 /* method hash_collection#HashSetIterator#next for (self: HashSetIterator[Object]) */
3286 void hash_collection__HashSetIterator__next(val* self) {
3287 short int var /* : Bool */;
3288 val* var1 /* : nullable HashSetNode[Object] */;
3289 val* var2 /* : nullable HashNode[Object] */;
3290 var = ((short int (*)(val*))(self->class->vft[COLOR_abstract_collection__Iterator__is_ok]))(self) /* is_ok on <self:HashSetIterator[Object]>*/;
3291 if (!var) {
3292 fprintf(stderr, "Runtime error: %s", "Assert failed");
3293 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 468);
3294 show_backtrace(1);
3295 }
3296 var1 = self->attrs[COLOR_hash_collection__HashSetIterator___node].val; /* _node on <self:HashSetIterator[Object]> */
3297 if (var1 == NULL) {
3298 fprintf(stderr, "Runtime error: %s", "Receiver is null");
3299 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 469);
3300 show_backtrace(1);
3301 }
3302 var2 = var1->attrs[COLOR_hash_collection__HashNode___next_item].val; /* _next_item on <var1:nullable HashSetNode[Object]> */
3303 self->attrs[COLOR_hash_collection__HashSetIterator___node].val = var2; /* _node on <self:HashSetIterator[Object]> */
3304 RET_LABEL:;
3305 }
3306 /* method hash_collection#HashSetIterator#next for (self: Object) */
3307 void VIRTUAL_hash_collection__HashSetIterator__next(val* self) {
3308 hash_collection__HashSetIterator__next(self);
3309 RET_LABEL:;
3310 }
3311 /* method hash_collection#HashSetIterator#init for (self: HashSetIterator[Object], HashSet[Object]) */
3312 void hash_collection__HashSetIterator__init(val* self, val* p0) {
3313 short int var /* : Bool */;
3314 int cltype;
3315 int idtype;
3316 const struct type* type_struct;
3317 const char* var_class_name;
3318 val* var_set /* var set: HashSet[Object] */;
3319 val* var1 /* : nullable HashNode[Object] */;
3320 /* Covariant cast for argument 0 (set) <p0:HashSet[Object]> isa HashSet[HashSetIterator#0] */
3321 /* <p0:HashSet[Object]> isa HashSet[HashSetIterator#0] */
3322 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashSethash_collection__HashSetIterator_FT0];
3323 cltype = type_struct->color;
3324 idtype = type_struct->id;
3325 if(cltype >= p0->type->table_size) {
3326 var = 0;
3327 } else {
3328 var = p0->type->type_table[cltype] == idtype;
3329 }
3330 if (!var) {
3331 var_class_name = p0 == NULL ? "null" : p0->type->name;
3332 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashSet[HashSetIterator#0]", var_class_name);
3333 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 478);
3334 show_backtrace(1);
3335 }
3336 var_set = p0;
3337 self->attrs[COLOR_hash_collection__HashSetIterator___set].val = var_set; /* _set on <self:HashSetIterator[Object]> */
3338 var1 = var_set->attrs[COLOR_hash_collection__HashCollection___first_item].val; /* _first_item on <var_set:HashSet[Object]> */
3339 self->attrs[COLOR_hash_collection__HashSetIterator___node].val = var1; /* _node on <self:HashSetIterator[Object]> */
3340 RET_LABEL:;
3341 }
3342 /* method hash_collection#HashSetIterator#init for (self: Object, HashSet[Object]) */
3343 void VIRTUAL_hash_collection__HashSetIterator__init(val* self, val* p0) {
3344 hash_collection__HashSetIterator__init(self, p0);
3345 RET_LABEL:;
3346 }