c_src: update for new ffi syntax
[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", 261);
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", "Reciever 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_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", "Reciever 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", "Reciever 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", "Reciever 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_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", 262);
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_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_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_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", "Reciever 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", 262);
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", "Reciever 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 short int var61 /* : Bool */;
863 val* var62 /* : nullable HashNode[Object] */;
864 short int var63 /* : Bool */;
865 int cltype64;
866 int idtype65;
867 const struct type* type_struct66;
868 const char* var_class_name67;
869 var_cap = p0;
870 var = self->attrs[COLOR_hash_collection__HashCollection___capacity].l; /* _capacity on <self:HashCollection[Object, HashNode[Object]]> */
871 var_old_cap = var;
872 var1 = self->attrs[COLOR_hash_collection__HashCollection___length].l; /* _length on <self:HashCollection[Object, HashNode[Object]]> */
873 var2 = 1;
874 { /* Inline kernel#Int#+ (var1,var2) */
875 var5 = var1 + var2;
876 var3 = var5;
877 goto RET_LABEL4;
878 RET_LABEL4:(void)0;
879 }
880 { /* Inline kernel#Int#< (var_cap,var3) */
881 /* Covariant cast for argument 0 (i) <var3:Int> isa OTHER */
882 /* <var3:Int> isa OTHER */
883 var8 = 1; /* easy <var3:Int> isa OTHER*/
884 if (!var8) {
885 var_class_name = type_kernel__Int.name;
886 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name);
887 fprintf(stderr, " (%s:%d)\n", "lib/standard/kernel.nit", 261);
888 show_backtrace(1);
889 }
890 var9 = var_cap < var3;
891 var6 = var9;
892 goto RET_LABEL7;
893 RET_LABEL7:(void)0;
894 }
895 if (var6){
896 var10 = self->attrs[COLOR_hash_collection__HashCollection___length].l; /* _length on <self:HashCollection[Object, HashNode[Object]]> */
897 var11 = 1;
898 { /* Inline kernel#Int#+ (var10,var11) */
899 var14 = var10 + var11;
900 var12 = var14;
901 goto RET_LABEL13;
902 RET_LABEL13:(void)0;
903 }
904 var_cap = var12;
905 } else {
906 }
907 var15 = self->attrs[COLOR_hash_collection__HashCollection___capacity].l; /* _capacity on <self:HashCollection[Object, HashNode[Object]]> */
908 { /* Inline kernel#Int#<= (var_cap,var15) */
909 /* Covariant cast for argument 0 (i) <var15:Int> isa OTHER */
910 /* <var15:Int> isa OTHER */
911 var18 = 1; /* easy <var15:Int> isa OTHER*/
912 if (!var18) {
913 var_class_name21 = type_kernel__Int.name;
914 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name21);
915 fprintf(stderr, " (%s:%d)\n", "lib/standard/kernel.nit", 260);
916 show_backtrace(1);
917 }
918 var22 = var_cap <= var15;
919 var16 = var22;
920 goto RET_LABEL17;
921 RET_LABEL17:(void)0;
922 }
923 if (var16){
924 goto RET_LABEL;
925 } else {
926 }
927 self->attrs[COLOR_hash_collection__HashCollection___capacity].l = var_cap; /* _capacity on <self:HashCollection[Object, HashNode[Object]]> */
928 var23 = NULL;
929 self->attrs[COLOR_hash_collection__HashCollection___last_accessed_key].val = var23; /* _last_accessed_key on <self:HashCollection[Object, HashNode[Object]]> */
930 var24 = ((val* (*)(val*, long))(self->class->vft[COLOR_array__ArrayCapable__calloc_array]))(self, var_cap) /* calloc_array on <self:HashCollection[Object, HashNode[Object]]>*/;
931 var_new_array = var24;
932 self->attrs[COLOR_hash_collection__HashCollection___array].val = var_new_array; /* _array on <self:HashCollection[Object, HashNode[Object]]> */
933 var25 = 1;
934 { /* Inline kernel#Int#- (var_cap,var25) */
935 var28 = var_cap - var25;
936 var26 = var28;
937 goto RET_LABEL27;
938 RET_LABEL27:(void)0;
939 }
940 var_i = var26;
941 for(;;) {
942 var29 = 0;
943 { /* Inline kernel#Int#>= (var_i,var29) */
944 /* Covariant cast for argument 0 (i) <var29:Int> isa OTHER */
945 /* <var29:Int> isa OTHER */
946 var32 = 1; /* easy <var29:Int> isa OTHER*/
947 if (!var32) {
948 var_class_name35 = type_kernel__Int.name;
949 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name35);
950 fprintf(stderr, " (%s:%d)\n", "lib/standard/kernel.nit", 262);
951 show_backtrace(1);
952 }
953 var36 = var_i >= var29;
954 var30 = var36;
955 goto RET_LABEL31;
956 RET_LABEL31:(void)0;
957 }
958 if (!var30) break;
959 var37 = NULL;
960 ((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]]>*/;
961 var38 = 1;
962 { /* Inline kernel#Int#- (var_i,var38) */
963 var41 = var_i - var38;
964 var39 = var41;
965 goto RET_LABEL40;
966 RET_LABEL40:(void)0;
967 }
968 var_i = var39;
969 CONTINUE_label: (void)0;
970 }
971 BREAK_label: (void)0;
972 var42 = self->attrs[COLOR_hash_collection__HashCollection___capacity].l; /* _capacity on <self:HashCollection[Object, HashNode[Object]]> */
973 { /* Inline kernel#Int#<= (var42,var_old_cap) */
974 /* Covariant cast for argument 0 (i) <var_old_cap:Int> isa OTHER */
975 /* <var_old_cap:Int> isa OTHER */
976 var45 = 1; /* easy <var_old_cap:Int> isa OTHER*/
977 if (!var45) {
978 var_class_name48 = type_kernel__Int.name;
979 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name48);
980 fprintf(stderr, " (%s:%d)\n", "lib/standard/kernel.nit", 260);
981 show_backtrace(1);
982 }
983 var49 = var42 <= var_old_cap;
984 var43 = var49;
985 goto RET_LABEL44;
986 RET_LABEL44:(void)0;
987 }
988 if (var43){
989 goto RET_LABEL;
990 } else {
991 }
992 var50 = self->attrs[COLOR_hash_collection__HashCollection___first_item].val; /* _first_item on <self:HashCollection[Object, HashNode[Object]]> */
993 var_node = var50;
994 for(;;) {
995 var51 = NULL;
996 if (var_node == NULL) {
997 var52 = 0; /* is null */
998 } else {
999 var52 = 1; /* arg is null and recv is not */
1000 }
1001 if (!var52) break;
1002 var53 = var_node->attrs[COLOR_hash_collection__HashNode___key].val; /* _key on <var_node:nullable HashNode[Object](HashNode[Object])> */
1003 if (var53 == NULL) {
1004 fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _key");
1005 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 177);
1006 show_backtrace(1);
1007 }
1008 /* <var53:Object> isa HashCollection#0 */
1009 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashCollection_FT0];
1010 cltype55 = type_struct->color;
1011 idtype56 = type_struct->id;
1012 if(cltype55 >= var53->type->table_size) {
1013 var54 = 0;
1014 } else {
1015 var54 = var53->type->type_table[cltype55] == idtype56;
1016 }
1017 if (!var54) {
1018 var_class_name57 = var53 == NULL ? "null" : var53->type->name;
1019 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashCollection#0", var_class_name57);
1020 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 177);
1021 show_backtrace(1);
1022 }
1023 var58 = ((long (*)(val*, val*))(self->class->vft[COLOR_hash_collection__HashCollection__index_at]))(self, var53) /* index_at on <self:HashCollection[Object, HashNode[Object]]>*/;
1024 var_index = var58;
1025 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]]>*/;
1026 var_next = var59;
1027 ((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]]>*/;
1028 var_node->attrs[COLOR_hash_collection__HashNode___next_in_bucklet].val = var_next; /* _next_in_bucklet on <var_node:nullable HashNode[Object](HashNode[Object])> */
1029 var60 = NULL;
1030 if (var_next == NULL) {
1031 var61 = 0; /* is null */
1032 } else {
1033 var61 = 1; /* arg is null and recv is not */
1034 }
1035 if (var61){
1036 var_next->attrs[COLOR_hash_collection__HashNode___prev_in_bucklet].val = var_node; /* _prev_in_bucklet on <var_next:nullable HashNode[Object](HashNode[Object])> */
1037 } else {
1038 }
1039 var62 = var_node->attrs[COLOR_hash_collection__HashNode___next_item].val; /* _next_item on <var_node:nullable HashNode[Object](HashNode[Object])> */
1040 /* <var62:nullable HashNode[Object]> isa nullable HashCollection#1 */
1041 type_struct66 = self->type->resolution_table->types[COLOR_hash_collection__HashCollection_FT1];
1042 cltype64 = type_struct66->color;
1043 idtype65 = type_struct66->id;
1044 if(var62 == NULL) {
1045 var63 = 1;
1046 } else {
1047 if(cltype64 >= var62->type->table_size) {
1048 var63 = 0;
1049 } else {
1050 var63 = var62->type->type_table[cltype64] == idtype65;
1051 }
1052 }
1053 if (!var63) {
1054 var_class_name67 = var62 == NULL ? "null" : var62->type->name;
1055 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "nullable HashCollection#1", var_class_name67);
1056 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 183);
1057 show_backtrace(1);
1058 }
1059 var_node = var62;
1060 CONTINUE_label68: (void)0;
1061 }
1062 BREAK_label68: (void)0;
1063 RET_LABEL:;
1064 }
1065 /* method hash_collection#HashCollection#enlarge for (self: Object, Int) */
1066 void VIRTUAL_hash_collection__HashCollection__enlarge(val* self, long p0) {
1067 hash_collection__HashCollection__enlarge(self, p0);
1068 RET_LABEL:;
1069 }
1070 /* method hash_collection#HashCollection#init for (self: HashCollection[Object, HashNode[Object]]) */
1071 void hash_collection__HashCollection__init(val* self) {
1072 RET_LABEL:;
1073 }
1074 /* method hash_collection#HashCollection#init for (self: Object) */
1075 void VIRTUAL_hash_collection__HashCollection__init(val* self) {
1076 hash_collection__HashCollection__init(self);
1077 RET_LABEL:;
1078 }
1079 /* method hash_collection#HashNode#next_item for (self: HashNode[Object]): nullable HashNode[Object] */
1080 val* hash_collection__HashNode__next_item(val* self) {
1081 val* var /* : nullable HashNode[Object] */;
1082 val* var1 /* : nullable HashNode[Object] */;
1083 var1 = self->attrs[COLOR_hash_collection__HashNode___next_item].val; /* _next_item on <self:HashNode[Object]> */
1084 var = var1;
1085 RET_LABEL:;
1086 return var;
1087 }
1088 /* method hash_collection#HashNode#next_item for (self: Object): nullable HashNode[Object] */
1089 val* VIRTUAL_hash_collection__HashNode__next_item(val* self) {
1090 val* var /* : nullable HashNode[Object] */;
1091 val* var1 /* : nullable HashNode[Object] */;
1092 var1 = hash_collection__HashNode__next_item(self);
1093 var = var1;
1094 RET_LABEL:;
1095 return var;
1096 }
1097 /* method hash_collection#HashNode#next_item= for (self: HashNode[Object], nullable HashNode[Object]) */
1098 void hash_collection__HashNode__next_item_61d(val* self, val* p0) {
1099 short int var /* : Bool */;
1100 int cltype;
1101 int idtype;
1102 const struct type* type_struct;
1103 const char* var_class_name;
1104 /* Covariant cast for argument 0 (next_item) <p0:nullable HashNode[Object]> isa nullable N */
1105 /* <p0:nullable HashNode[Object]> isa nullable N */
1106 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashNode_VTN];
1107 cltype = type_struct->color;
1108 idtype = type_struct->id;
1109 if(p0 == NULL) {
1110 var = 1;
1111 } else {
1112 if(cltype >= p0->type->table_size) {
1113 var = 0;
1114 } else {
1115 var = p0->type->type_table[cltype] == idtype;
1116 }
1117 }
1118 if (!var) {
1119 var_class_name = p0 == NULL ? "null" : p0->type->name;
1120 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "nullable N", var_class_name);
1121 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 191);
1122 show_backtrace(1);
1123 }
1124 self->attrs[COLOR_hash_collection__HashNode___next_item].val = p0; /* _next_item on <self:HashNode[Object]> */
1125 RET_LABEL:;
1126 }
1127 /* method hash_collection#HashNode#next_item= for (self: Object, nullable HashNode[Object]) */
1128 void VIRTUAL_hash_collection__HashNode__next_item_61d(val* self, val* p0) {
1129 hash_collection__HashNode__next_item_61d(self, p0);
1130 RET_LABEL:;
1131 }
1132 /* method hash_collection#HashNode#prev_item for (self: HashNode[Object]): nullable HashNode[Object] */
1133 val* hash_collection__HashNode__prev_item(val* self) {
1134 val* var /* : nullable HashNode[Object] */;
1135 val* var1 /* : nullable HashNode[Object] */;
1136 var1 = self->attrs[COLOR_hash_collection__HashNode___prev_item].val; /* _prev_item on <self:HashNode[Object]> */
1137 var = var1;
1138 RET_LABEL:;
1139 return var;
1140 }
1141 /* method hash_collection#HashNode#prev_item for (self: Object): nullable HashNode[Object] */
1142 val* VIRTUAL_hash_collection__HashNode__prev_item(val* self) {
1143 val* var /* : nullable HashNode[Object] */;
1144 val* var1 /* : nullable HashNode[Object] */;
1145 var1 = hash_collection__HashNode__prev_item(self);
1146 var = var1;
1147 RET_LABEL:;
1148 return var;
1149 }
1150 /* method hash_collection#HashNode#prev_item= for (self: HashNode[Object], nullable HashNode[Object]) */
1151 void hash_collection__HashNode__prev_item_61d(val* self, val* p0) {
1152 short int var /* : Bool */;
1153 int cltype;
1154 int idtype;
1155 const struct type* type_struct;
1156 const char* var_class_name;
1157 /* Covariant cast for argument 0 (prev_item) <p0:nullable HashNode[Object]> isa nullable N */
1158 /* <p0:nullable HashNode[Object]> isa nullable N */
1159 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashNode_VTN];
1160 cltype = type_struct->color;
1161 idtype = type_struct->id;
1162 if(p0 == NULL) {
1163 var = 1;
1164 } else {
1165 if(cltype >= p0->type->table_size) {
1166 var = 0;
1167 } else {
1168 var = p0->type->type_table[cltype] == idtype;
1169 }
1170 }
1171 if (!var) {
1172 var_class_name = p0 == NULL ? "null" : p0->type->name;
1173 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "nullable N", var_class_name);
1174 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 192);
1175 show_backtrace(1);
1176 }
1177 self->attrs[COLOR_hash_collection__HashNode___prev_item].val = p0; /* _prev_item on <self:HashNode[Object]> */
1178 RET_LABEL:;
1179 }
1180 /* method hash_collection#HashNode#prev_item= for (self: Object, nullable HashNode[Object]) */
1181 void VIRTUAL_hash_collection__HashNode__prev_item_61d(val* self, val* p0) {
1182 hash_collection__HashNode__prev_item_61d(self, p0);
1183 RET_LABEL:;
1184 }
1185 /* method hash_collection#HashNode#init for (self: HashNode[Object], Object) */
1186 void hash_collection__HashNode__init(val* self, val* p0) {
1187 short int var /* : Bool */;
1188 int cltype;
1189 int idtype;
1190 const struct type* type_struct;
1191 const char* var_class_name;
1192 val* var_k /* var k: Object */;
1193 /* Covariant cast for argument 0 (k) <p0:Object> isa HashNode#0 */
1194 /* <p0:Object> isa HashNode#0 */
1195 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashNode_FT0];
1196 cltype = type_struct->color;
1197 idtype = type_struct->id;
1198 if(cltype >= p0->type->table_size) {
1199 var = 0;
1200 } else {
1201 var = p0->type->type_table[cltype] == idtype;
1202 }
1203 if (!var) {
1204 var_class_name = p0 == NULL ? "null" : p0->type->name;
1205 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashNode#0", var_class_name);
1206 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 195);
1207 show_backtrace(1);
1208 }
1209 var_k = p0;
1210 self->attrs[COLOR_hash_collection__HashNode___key].val = var_k; /* _key on <self:HashNode[Object]> */
1211 RET_LABEL:;
1212 }
1213 /* method hash_collection#HashNode#init for (self: Object, Object) */
1214 void VIRTUAL_hash_collection__HashNode__init(val* self, val* p0) {
1215 hash_collection__HashNode__init(self, p0);
1216 RET_LABEL:;
1217 }
1218 /* method hash_collection#HashMap#[] for (self: HashMap[Object, nullable Object], Object): nullable Object */
1219 val* hash_collection__HashMap___91d_93d(val* self, val* p0) {
1220 val* var /* : nullable Object */;
1221 short int var1 /* : Bool */;
1222 int cltype;
1223 int idtype;
1224 const struct type* type_struct;
1225 const char* var_class_name;
1226 val* var_key /* var key: Object */;
1227 val* var2 /* : nullable HashNode[Object] */;
1228 val* var_c /* var c: nullable HashMapNode[Object, nullable Object] */;
1229 val* var3 /* : null */;
1230 short int var4 /* : Bool */;
1231 val* var5 /* : nullable Object */;
1232 /* Covariant cast for argument 0 (key) <p0:Object> isa MapRead#0 */
1233 /* <p0:Object> isa MapRead#0 */
1234 type_struct = self->type->resolution_table->types[COLOR_abstract_collection__MapRead_FT0];
1235 cltype = type_struct->color;
1236 idtype = type_struct->id;
1237 if(cltype >= p0->type->table_size) {
1238 var1 = 0;
1239 } else {
1240 var1 = p0->type->type_table[cltype] == idtype;
1241 }
1242 if (!var1) {
1243 var_class_name = p0 == NULL ? "null" : p0->type->name;
1244 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "MapRead#0", var_class_name);
1245 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 207);
1246 show_backtrace(1);
1247 }
1248 var_key = p0;
1249 var2 = ((val* (*)(val*, val*))(self->class->vft[COLOR_hash_collection__HashCollection__node_at]))(self, var_key) /* node_at on <self:HashMap[Object, nullable Object]>*/;
1250 var_c = var2;
1251 var3 = NULL;
1252 if (var_c == NULL) {
1253 var4 = 1; /* is null */
1254 } else {
1255 var4 = 0; /* arg is null but recv is not */
1256 }
1257 if (var4){
1258 fprintf(stderr, "Runtime error: %s", "Aborted");
1259 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 211);
1260 show_backtrace(1);
1261 } else {
1262 var5 = var_c->attrs[COLOR_hash_collection__HashMapNode___value].val; /* _value on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
1263 var = var5;
1264 goto RET_LABEL;
1265 }
1266 RET_LABEL:;
1267 return var;
1268 }
1269 /* method hash_collection#HashMap#[] for (self: Object, Object): nullable Object */
1270 val* VIRTUAL_hash_collection__HashMap___91d_93d(val* self, val* p0) {
1271 val* var /* : nullable Object */;
1272 val* var1 /* : nullable Object */;
1273 var1 = hash_collection__HashMap___91d_93d(self, p0);
1274 var = var1;
1275 RET_LABEL:;
1276 return var;
1277 }
1278 /* method hash_collection#HashMap#iterator for (self: HashMap[Object, nullable Object]): HashMapIterator[Object, nullable Object] */
1279 val* hash_collection__HashMap__iterator(val* self) {
1280 val* var /* : HashMapIterator[Object, nullable Object] */;
1281 val* var1 /* : HashMapIterator[Object, nullable Object] */;
1282 var1 = NEW_hash_collection__HashMapIterator(self->type->resolution_table->types[COLOR_hash_collection__HashMapIteratorhash_collection__HashMap_FT0hash_collection__HashMap_FT1]);
1283 ((void (*)(val*, val*))(var1->class->vft[COLOR_hash_collection__HashMapIterator__init]))(var1, self) /* init on <var1:HashMapIterator[Object, nullable Object]>*/;
1284 var = var1;
1285 goto RET_LABEL;
1286 RET_LABEL:;
1287 return var;
1288 }
1289 /* method hash_collection#HashMap#iterator for (self: Object): MapIterator[Object, nullable Object] */
1290 val* VIRTUAL_hash_collection__HashMap__iterator(val* self) {
1291 val* var /* : MapIterator[Object, nullable Object] */;
1292 val* var1 /* : HashMapIterator[Object, nullable Object] */;
1293 var1 = hash_collection__HashMap__iterator(self);
1294 var = var1;
1295 RET_LABEL:;
1296 return var;
1297 }
1298 /* method hash_collection#HashMap#length for (self: HashMap[Object, nullable Object]): Int */
1299 long hash_collection__HashMap__length(val* self) {
1300 long var /* : Int */;
1301 long var1 /* : Int */;
1302 var1 = self->attrs[COLOR_hash_collection__HashCollection___length].l; /* _length on <self:HashMap[Object, nullable Object]> */
1303 var = var1;
1304 goto RET_LABEL;
1305 RET_LABEL:;
1306 return var;
1307 }
1308 /* method hash_collection#HashMap#length for (self: Object): Int */
1309 long VIRTUAL_hash_collection__HashMap__length(val* self) {
1310 long var /* : Int */;
1311 long var1 /* : Int */;
1312 var1 = hash_collection__HashMap__length(self);
1313 var = var1;
1314 RET_LABEL:;
1315 return var;
1316 }
1317 /* method hash_collection#HashMap#is_empty for (self: HashMap[Object, nullable Object]): Bool */
1318 short int hash_collection__HashMap__is_empty(val* self) {
1319 short int var /* : Bool */;
1320 long var1 /* : Int */;
1321 long var2 /* : Int */;
1322 short int var3 /* : Bool */;
1323 short int var5 /* : Bool */;
1324 var1 = self->attrs[COLOR_hash_collection__HashCollection___length].l; /* _length on <self:HashMap[Object, nullable Object]> */
1325 var2 = 0;
1326 { /* Inline kernel#Int#== (var1,var2) */
1327 var5 = var1 == var2;
1328 var3 = var5;
1329 goto RET_LABEL4;
1330 RET_LABEL4:(void)0;
1331 }
1332 var = var3;
1333 goto RET_LABEL;
1334 RET_LABEL:;
1335 return var;
1336 }
1337 /* method hash_collection#HashMap#is_empty for (self: Object): Bool */
1338 short int VIRTUAL_hash_collection__HashMap__is_empty(val* self) {
1339 short int var /* : Bool */;
1340 short int var1 /* : Bool */;
1341 var1 = hash_collection__HashMap__is_empty(self);
1342 var = var1;
1343 RET_LABEL:;
1344 return var;
1345 }
1346 /* method hash_collection#HashMap#[]= for (self: HashMap[Object, nullable Object], Object, nullable Object) */
1347 void hash_collection__HashMap___91d_93d_61d(val* self, val* p0, val* p1) {
1348 short int var /* : Bool */;
1349 int cltype;
1350 int idtype;
1351 const struct type* type_struct;
1352 const char* var_class_name;
1353 short int var1 /* : Bool */;
1354 int cltype2;
1355 int idtype3;
1356 const struct type* type_struct4;
1357 short int is_nullable;
1358 const char* var_class_name5;
1359 val* var_key /* var key: Object */;
1360 val* var_v /* var v: nullable Object */;
1361 long var6 /* : Int */;
1362 long var_i /* var i: Int */;
1363 val* var7 /* : nullable HashNode[Object] */;
1364 val* var_c /* var c: nullable HashMapNode[Object, nullable Object] */;
1365 val* var8 /* : null */;
1366 short int var9 /* : Bool */;
1367 val* var10 /* : HashMapNode[Object, nullable Object] */;
1368 /* Covariant cast for argument 0 (key) <p0:Object> isa Map#0 */
1369 /* <p0:Object> isa Map#0 */
1370 type_struct = self->type->resolution_table->types[COLOR_abstract_collection__Map_FT0];
1371 cltype = type_struct->color;
1372 idtype = type_struct->id;
1373 if(cltype >= p0->type->table_size) {
1374 var = 0;
1375 } else {
1376 var = p0->type->type_table[cltype] == idtype;
1377 }
1378 if (!var) {
1379 var_class_name = p0 == NULL ? "null" : p0->type->name;
1380 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Map#0", var_class_name);
1381 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 223);
1382 show_backtrace(1);
1383 }
1384 /* Covariant cast for argument 1 (v) <p1:nullable Object> isa Map#1 */
1385 /* <p1:nullable Object> isa Map#1 */
1386 type_struct4 = self->type->resolution_table->types[COLOR_abstract_collection__Map_FT1];
1387 cltype2 = type_struct4->color;
1388 idtype3 = type_struct4->id;
1389 is_nullable = type_struct4->is_nullable;
1390 if(p1 == NULL) {
1391 var1 = is_nullable;
1392 } else {
1393 if(cltype2 >= p1->type->table_size) {
1394 var1 = 0;
1395 } else {
1396 var1 = p1->type->type_table[cltype2] == idtype3;
1397 }
1398 }
1399 if (!var1) {
1400 var_class_name5 = p1 == NULL ? "null" : p1->type->name;
1401 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Map#1", var_class_name5);
1402 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 223);
1403 show_backtrace(1);
1404 }
1405 var_key = p0;
1406 var_v = p1;
1407 var6 = ((long (*)(val*, val*))(self->class->vft[COLOR_hash_collection__HashCollection__index_at]))(self, var_key) /* index_at on <self:HashMap[Object, nullable Object]>*/;
1408 var_i = var6;
1409 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]>*/;
1410 var_c = var7;
1411 var8 = NULL;
1412 if (var_c == NULL) {
1413 var9 = 0; /* is null */
1414 } else {
1415 var9 = 1; /* arg is null and recv is not */
1416 }
1417 if (var9){
1418 var_c->attrs[COLOR_hash_collection__HashNode___key].val = var_key; /* _key on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
1419 var_c->attrs[COLOR_hash_collection__HashMapNode___value].val = var_v; /* _value on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
1420 } else {
1421 var10 = NEW_hash_collection__HashMapNode(self->type->resolution_table->types[COLOR_hash_collection__HashMapNodehash_collection__HashMap_FT0hash_collection__HashMap_FT1]);
1422 ((void (*)(val*, val*, val*))(var10->class->vft[COLOR_hash_collection__HashMapNode__init]))(var10, var_key, var_v) /* init on <var10:HashMapNode[Object, nullable Object]>*/;
1423 ((void (*)(val*, long, val*))(self->class->vft[COLOR_hash_collection__HashCollection__store]))(self, var_i, var10) /* store on <self:HashMap[Object, nullable Object]>*/;
1424 }
1425 RET_LABEL:;
1426 }
1427 /* method hash_collection#HashMap#[]= for (self: Object, Object, nullable Object) */
1428 void VIRTUAL_hash_collection__HashMap___91d_93d_61d(val* self, val* p0, val* p1) {
1429 hash_collection__HashMap___91d_93d_61d(self, p0, p1);
1430 RET_LABEL:;
1431 }
1432 /* method hash_collection#HashMap#clear for (self: HashMap[Object, nullable Object]) */
1433 void hash_collection__HashMap__clear(val* self) {
1434 ((void (*)(val*))(self->class->vft[COLOR_hash_collection__HashCollection__raz]))(self) /* raz on <self:HashMap[Object, nullable Object]>*/;
1435 RET_LABEL:;
1436 }
1437 /* method hash_collection#HashMap#clear for (self: Object) */
1438 void VIRTUAL_hash_collection__HashMap__clear(val* self) {
1439 hash_collection__HashMap__clear(self);
1440 RET_LABEL:;
1441 }
1442 /* method hash_collection#HashMap#init for (self: HashMap[Object, nullable Object]) */
1443 void hash_collection__HashMap__init(val* self) {
1444 long var /* : Int */;
1445 long var1 /* : Int */;
1446 long var2 /* : Int */;
1447 ((void (*)(val*))(self->class->vft[COLOR_hash_collection__HashCollection__init]))(self) /* init on <self:HashMap[Object, nullable Object]>*/;
1448 var = 0;
1449 self->attrs[COLOR_hash_collection__HashCollection___capacity].l = var; /* _capacity on <self:HashMap[Object, nullable Object]> */
1450 var1 = 0;
1451 self->attrs[COLOR_hash_collection__HashCollection___length].l = var1; /* _length on <self:HashMap[Object, nullable Object]> */
1452 var2 = 0;
1453 ((void (*)(val*, long))(self->class->vft[COLOR_hash_collection__HashCollection__enlarge]))(self, var2) /* enlarge on <self:HashMap[Object, nullable Object]>*/;
1454 RET_LABEL:;
1455 }
1456 /* method hash_collection#HashMap#init for (self: Object) */
1457 void VIRTUAL_hash_collection__HashMap__init(val* self) {
1458 hash_collection__HashMap__init(self);
1459 RET_LABEL:;
1460 }
1461 /* method hash_collection#HashMap#keys for (self: HashMap[Object, nullable Object]): HashMapKeys[Object, nullable Object] */
1462 val* hash_collection__HashMap__keys(val* self) {
1463 val* var /* : HashMapKeys[Object, nullable Object] */;
1464 val* var1 /* : HashMapKeys[Object, nullable Object] */;
1465 var1 = self->attrs[COLOR_hash_collection__HashMap___64dkeys].val; /* @keys on <self:HashMap[Object, nullable Object]> */
1466 if (var1 == NULL) {
1467 fprintf(stderr, "Runtime error: %s", "Uninitialized attribute @keys");
1468 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 244);
1469 show_backtrace(1);
1470 }
1471 var = var1;
1472 RET_LABEL:;
1473 return var;
1474 }
1475 /* method hash_collection#HashMap#keys for (self: Object): Collection[Object] */
1476 val* VIRTUAL_hash_collection__HashMap__keys(val* self) {
1477 val* var /* : Collection[Object] */;
1478 val* var1 /* : HashMapKeys[Object, nullable Object] */;
1479 var1 = hash_collection__HashMap__keys(self);
1480 var = var1;
1481 RET_LABEL:;
1482 return var;
1483 }
1484 /* method hash_collection#HashMap#keys= for (self: HashMap[Object, nullable Object], HashMapKeys[Object, nullable Object]) */
1485 void hash_collection__HashMap__keys_61d(val* self, val* p0) {
1486 short int var /* : Bool */;
1487 int cltype;
1488 int idtype;
1489 const struct type* type_struct;
1490 const char* var_class_name;
1491 /* Covariant cast for argument 0 (keys) <p0:HashMapKeys[Object, nullable Object]> isa HashMapKeys[HashMap#0, HashMap#1] */
1492 /* <p0:HashMapKeys[Object, nullable Object]> isa HashMapKeys[HashMap#0, HashMap#1] */
1493 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashMapKeyshash_collection__HashMap_FT0hash_collection__HashMap_FT1];
1494 cltype = type_struct->color;
1495 idtype = type_struct->id;
1496 if(cltype >= p0->type->table_size) {
1497 var = 0;
1498 } else {
1499 var = p0->type->type_table[cltype] == idtype;
1500 }
1501 if (!var) {
1502 var_class_name = p0 == NULL ? "null" : p0->type->name;
1503 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMapKeys[HashMap#0, HashMap#1]", var_class_name);
1504 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 244);
1505 show_backtrace(1);
1506 }
1507 self->attrs[COLOR_hash_collection__HashMap___64dkeys].val = p0; /* @keys on <self:HashMap[Object, nullable Object]> */
1508 RET_LABEL:;
1509 }
1510 /* method hash_collection#HashMap#keys= for (self: Object, HashMapKeys[Object, nullable Object]) */
1511 void VIRTUAL_hash_collection__HashMap__keys_61d(val* self, val* p0) {
1512 hash_collection__HashMap__keys_61d(self, p0);
1513 RET_LABEL:;
1514 }
1515 /* method hash_collection#HashMap#values for (self: HashMap[Object, nullable Object]): HashMapValues[Object, nullable Object] */
1516 val* hash_collection__HashMap__values(val* self) {
1517 val* var /* : HashMapValues[Object, nullable Object] */;
1518 val* var1 /* : HashMapValues[Object, nullable Object] */;
1519 var1 = self->attrs[COLOR_hash_collection__HashMap___64dvalues].val; /* @values on <self:HashMap[Object, nullable Object]> */
1520 if (var1 == NULL) {
1521 fprintf(stderr, "Runtime error: %s", "Uninitialized attribute @values");
1522 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 245);
1523 show_backtrace(1);
1524 }
1525 var = var1;
1526 RET_LABEL:;
1527 return var;
1528 }
1529 /* method hash_collection#HashMap#values for (self: Object): Collection[nullable Object] */
1530 val* VIRTUAL_hash_collection__HashMap__values(val* self) {
1531 val* var /* : Collection[nullable Object] */;
1532 val* var1 /* : HashMapValues[Object, nullable Object] */;
1533 var1 = hash_collection__HashMap__values(self);
1534 var = var1;
1535 RET_LABEL:;
1536 return var;
1537 }
1538 /* method hash_collection#HashMap#values= for (self: HashMap[Object, nullable Object], HashMapValues[Object, nullable Object]) */
1539 void hash_collection__HashMap__values_61d(val* self, val* p0) {
1540 short int var /* : Bool */;
1541 int cltype;
1542 int idtype;
1543 const struct type* type_struct;
1544 const char* var_class_name;
1545 /* Covariant cast for argument 0 (values) <p0:HashMapValues[Object, nullable Object]> isa HashMapValues[HashMap#0, HashMap#1] */
1546 /* <p0:HashMapValues[Object, nullable Object]> isa HashMapValues[HashMap#0, HashMap#1] */
1547 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashMapValueshash_collection__HashMap_FT0hash_collection__HashMap_FT1];
1548 cltype = type_struct->color;
1549 idtype = type_struct->id;
1550 if(cltype >= p0->type->table_size) {
1551 var = 0;
1552 } else {
1553 var = p0->type->type_table[cltype] == idtype;
1554 }
1555 if (!var) {
1556 var_class_name = p0 == NULL ? "null" : p0->type->name;
1557 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMapValues[HashMap#0, HashMap#1]", var_class_name);
1558 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 245);
1559 show_backtrace(1);
1560 }
1561 self->attrs[COLOR_hash_collection__HashMap___64dvalues].val = p0; /* @values on <self:HashMap[Object, nullable Object]> */
1562 RET_LABEL:;
1563 }
1564 /* method hash_collection#HashMap#values= for (self: Object, HashMapValues[Object, nullable Object]) */
1565 void VIRTUAL_hash_collection__HashMap__values_61d(val* self, val* p0) {
1566 hash_collection__HashMap__values_61d(self, p0);
1567 RET_LABEL:;
1568 }
1569 /* method hash_collection#HashMapKeys#map for (self: HashMapKeys[Object, nullable Object]): HashMap[Object, nullable Object] */
1570 val* hash_collection__HashMapKeys__map(val* self) {
1571 val* var /* : HashMap[Object, nullable Object] */;
1572 val* var1 /* : HashMap[Object, nullable Object] */;
1573 var1 = self->attrs[COLOR_hash_collection__HashMapKeys___64dmap].val; /* @map on <self:HashMapKeys[Object, nullable Object]> */
1574 if (var1 == NULL) {
1575 fprintf(stderr, "Runtime error: %s", "Uninitialized attribute @map");
1576 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 251);
1577 show_backtrace(1);
1578 }
1579 var = var1;
1580 RET_LABEL:;
1581 return var;
1582 }
1583 /* method hash_collection#HashMapKeys#map for (self: Object): HashMap[Object, nullable Object] */
1584 val* VIRTUAL_hash_collection__HashMapKeys__map(val* self) {
1585 val* var /* : HashMap[Object, nullable Object] */;
1586 val* var1 /* : HashMap[Object, nullable Object] */;
1587 var1 = hash_collection__HashMapKeys__map(self);
1588 var = var1;
1589 RET_LABEL:;
1590 return var;
1591 }
1592 /* method hash_collection#HashMapKeys#map= for (self: HashMapKeys[Object, nullable Object], HashMap[Object, nullable Object]) */
1593 void hash_collection__HashMapKeys__map_61d(val* self, val* p0) {
1594 short int var /* : Bool */;
1595 int cltype;
1596 int idtype;
1597 const struct type* type_struct;
1598 const char* var_class_name;
1599 /* Covariant cast for argument 0 (map) <p0:HashMap[Object, nullable Object]> isa HashMap[HashMapKeys#0, HashMapKeys#1] */
1600 /* <p0:HashMap[Object, nullable Object]> isa HashMap[HashMapKeys#0, HashMapKeys#1] */
1601 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashMaphash_collection__HashMapKeys_FT0hash_collection__HashMapKeys_FT1];
1602 cltype = type_struct->color;
1603 idtype = type_struct->id;
1604 if(cltype >= p0->type->table_size) {
1605 var = 0;
1606 } else {
1607 var = p0->type->type_table[cltype] == idtype;
1608 }
1609 if (!var) {
1610 var_class_name = p0 == NULL ? "null" : p0->type->name;
1611 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap[HashMapKeys#0, HashMapKeys#1]", var_class_name);
1612 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 251);
1613 show_backtrace(1);
1614 }
1615 self->attrs[COLOR_hash_collection__HashMapKeys___64dmap].val = p0; /* @map on <self:HashMapKeys[Object, nullable Object]> */
1616 RET_LABEL:;
1617 }
1618 /* method hash_collection#HashMapKeys#map= for (self: Object, HashMap[Object, nullable Object]) */
1619 void VIRTUAL_hash_collection__HashMapKeys__map_61d(val* self, val* p0) {
1620 hash_collection__HashMapKeys__map_61d(self, p0);
1621 RET_LABEL:;
1622 }
1623 /* method hash_collection#HashMapKeys#count for (self: HashMapKeys[Object, nullable Object], Object): Int */
1624 long hash_collection__HashMapKeys__count(val* self, val* p0) {
1625 long var /* : Int */;
1626 short int var1 /* : Bool */;
1627 int cltype;
1628 int idtype;
1629 const struct type* type_struct;
1630 const char* var_class_name;
1631 val* var_k /* var k: Object */;
1632 short int var2 /* : Bool */;
1633 long var3 /* : Int */;
1634 long var4 /* : Int */;
1635 /* Covariant cast for argument 0 (k) <p0:Object> isa Collection#0 */
1636 /* <p0:Object> isa Collection#0 */
1637 type_struct = self->type->resolution_table->types[COLOR_abstract_collection__Collection_FT0];
1638 cltype = type_struct->color;
1639 idtype = type_struct->id;
1640 if(cltype >= p0->type->table_size) {
1641 var1 = 0;
1642 } else {
1643 var1 = p0->type->type_table[cltype] == idtype;
1644 }
1645 if (!var1) {
1646 var_class_name = p0 == NULL ? "null" : p0->type->name;
1647 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Collection#0", var_class_name);
1648 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 254);
1649 show_backtrace(1);
1650 }
1651 var_k = p0;
1652 var2 = ((short int (*)(val*, val*))(self->class->vft[COLOR_abstract_collection__Collection__has]))(self, var_k) /* has on <self:HashMapKeys[Object, nullable Object]>*/;
1653 if (var2){
1654 var3 = 1;
1655 var = var3;
1656 goto RET_LABEL;
1657 } else {
1658 var4 = 0;
1659 var = var4;
1660 goto RET_LABEL;
1661 }
1662 RET_LABEL:;
1663 return var;
1664 }
1665 /* method hash_collection#HashMapKeys#count for (self: Object, nullable Object): Int */
1666 long VIRTUAL_hash_collection__HashMapKeys__count(val* self, val* p0) {
1667 long var /* : Int */;
1668 long var1 /* : Int */;
1669 var1 = hash_collection__HashMapKeys__count(self, p0);
1670 var = var1;
1671 RET_LABEL:;
1672 return var;
1673 }
1674 /* method hash_collection#HashMapKeys#first for (self: HashMapKeys[Object, nullable Object]): Object */
1675 val* hash_collection__HashMapKeys__first(val* self) {
1676 val* var /* : Object */;
1677 val* var1 /* : HashMap[Object, nullable Object] */;
1678 val* var2 /* : nullable HashNode[Object] */;
1679 val* var3 /* : Object */;
1680 var1 = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapKeys__map]))(self) /* map on <self:HashMapKeys[Object, nullable Object]>*/;
1681 var2 = var1->attrs[COLOR_hash_collection__HashCollection___first_item].val; /* _first_item on <var1:HashMap[Object, nullable Object]> */
1682 if (var2 == NULL) {
1683 fprintf(stderr, "Runtime error: %s", "Reciever is null");
1684 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 255);
1685 show_backtrace(1);
1686 }
1687 var3 = var2->attrs[COLOR_hash_collection__HashNode___key].val; /* _key on <var2:nullable HashNode[Object](nullable HashMapNode[Object, nullable Object])> */
1688 if (var3 == NULL) {
1689 fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _key");
1690 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 255);
1691 show_backtrace(1);
1692 }
1693 var = var3;
1694 goto RET_LABEL;
1695 RET_LABEL:;
1696 return var;
1697 }
1698 /* method hash_collection#HashMapKeys#first for (self: Object): nullable Object */
1699 val* VIRTUAL_hash_collection__HashMapKeys__first(val* self) {
1700 val* var /* : nullable Object */;
1701 val* var1 /* : Object */;
1702 var1 = hash_collection__HashMapKeys__first(self);
1703 var = var1;
1704 RET_LABEL:;
1705 return var;
1706 }
1707 /* method hash_collection#HashMapKeys#has for (self: HashMapKeys[Object, nullable Object], Object): Bool */
1708 short int hash_collection__HashMapKeys__has(val* self, val* p0) {
1709 short int var /* : Bool */;
1710 short int var1 /* : Bool */;
1711 int cltype;
1712 int idtype;
1713 const struct type* type_struct;
1714 const char* var_class_name;
1715 val* var_k /* var k: Object */;
1716 val* var2 /* : HashMap[Object, nullable Object] */;
1717 val* var3 /* : nullable HashNode[Object] */;
1718 val* var4 /* : null */;
1719 short int var5 /* : Bool */;
1720 /* Covariant cast for argument 0 (k) <p0:Object> isa Collection#0 */
1721 /* <p0:Object> isa Collection#0 */
1722 type_struct = self->type->resolution_table->types[COLOR_abstract_collection__Collection_FT0];
1723 cltype = type_struct->color;
1724 idtype = type_struct->id;
1725 if(cltype >= p0->type->table_size) {
1726 var1 = 0;
1727 } else {
1728 var1 = p0->type->type_table[cltype] == idtype;
1729 }
1730 if (!var1) {
1731 var_class_name = p0 == NULL ? "null" : p0->type->name;
1732 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Collection#0", var_class_name);
1733 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 256);
1734 show_backtrace(1);
1735 }
1736 var_k = p0;
1737 var2 = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapKeys__map]))(self) /* map on <self:HashMapKeys[Object, nullable Object]>*/;
1738 var3 = ((val* (*)(val*, val*))(var2->class->vft[COLOR_hash_collection__HashCollection__node_at]))(var2, var_k) /* node_at on <var2:HashMap[Object, nullable Object]>*/;
1739 var4 = NULL;
1740 if (var3 == NULL) {
1741 var5 = 0; /* is null */
1742 } else {
1743 var5 = 1; /* arg is null and recv is not */
1744 }
1745 var = var5;
1746 goto RET_LABEL;
1747 RET_LABEL:;
1748 return var;
1749 }
1750 /* method hash_collection#HashMapKeys#has for (self: Object, nullable Object): Bool */
1751 short int VIRTUAL_hash_collection__HashMapKeys__has(val* self, val* p0) {
1752 short int var /* : Bool */;
1753 short int var1 /* : Bool */;
1754 var1 = hash_collection__HashMapKeys__has(self, p0);
1755 var = var1;
1756 RET_LABEL:;
1757 return var;
1758 }
1759 /* method hash_collection#HashMapKeys#has_only for (self: HashMapKeys[Object, nullable Object], Object): Bool */
1760 short int hash_collection__HashMapKeys__has_only(val* self, val* p0) {
1761 short int var /* : Bool */;
1762 short int var1 /* : Bool */;
1763 int cltype;
1764 int idtype;
1765 const struct type* type_struct;
1766 const char* var_class_name;
1767 val* var_k /* var k: Object */;
1768 short int var2 /* : Bool */;
1769 short int var3 /* : Bool */;
1770 short int var4 /* : Bool */;
1771 short int var_ /* var : Bool */;
1772 long var5 /* : Int */;
1773 long var6 /* : Int */;
1774 short int var7 /* : Bool */;
1775 short int var9 /* : Bool */;
1776 short int var_10 /* var : Bool */;
1777 short int var11 /* : Bool */;
1778 /* Covariant cast for argument 0 (k) <p0:Object> isa Collection#0 */
1779 /* <p0:Object> isa Collection#0 */
1780 type_struct = self->type->resolution_table->types[COLOR_abstract_collection__Collection_FT0];
1781 cltype = type_struct->color;
1782 idtype = type_struct->id;
1783 if(cltype >= p0->type->table_size) {
1784 var1 = 0;
1785 } else {
1786 var1 = p0->type->type_table[cltype] == idtype;
1787 }
1788 if (!var1) {
1789 var_class_name = p0 == NULL ? "null" : p0->type->name;
1790 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Collection#0", var_class_name);
1791 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 257);
1792 show_backtrace(1);
1793 }
1794 var_k = p0;
1795 var4 = ((short int (*)(val*, val*))(self->class->vft[COLOR_abstract_collection__Collection__has]))(self, var_k) /* has on <self:HashMapKeys[Object, nullable Object]>*/;
1796 var_ = var4;
1797 if (var4){
1798 var5 = ((long (*)(val*))(self->class->vft[COLOR_abstract_collection__Collection__length]))(self) /* length on <self:HashMapKeys[Object, nullable Object]>*/;
1799 var6 = 1;
1800 { /* Inline kernel#Int#== (var5,var6) */
1801 var9 = var5 == var6;
1802 var7 = var9;
1803 goto RET_LABEL8;
1804 RET_LABEL8:(void)0;
1805 }
1806 var3 = var7;
1807 } else {
1808 var3 = var_;
1809 }
1810 var_10 = var3;
1811 if (var3){
1812 var2 = var_10;
1813 } else {
1814 var11 = ((short int (*)(val*))(self->class->vft[COLOR_abstract_collection__Collection__is_empty]))(self) /* is_empty on <self:HashMapKeys[Object, nullable Object]>*/;
1815 var2 = var11;
1816 }
1817 var = var2;
1818 goto RET_LABEL;
1819 RET_LABEL:;
1820 return var;
1821 }
1822 /* method hash_collection#HashMapKeys#has_only for (self: Object, nullable Object): Bool */
1823 short int VIRTUAL_hash_collection__HashMapKeys__has_only(val* self, val* p0) {
1824 short int var /* : Bool */;
1825 short int var1 /* : Bool */;
1826 var1 = hash_collection__HashMapKeys__has_only(self, p0);
1827 var = var1;
1828 RET_LABEL:;
1829 return var;
1830 }
1831 /* method hash_collection#HashMapKeys#is_empty for (self: HashMapKeys[Object, nullable Object]): Bool */
1832 short int hash_collection__HashMapKeys__is_empty(val* self) {
1833 short int var /* : Bool */;
1834 val* var1 /* : HashMap[Object, nullable Object] */;
1835 short int var2 /* : Bool */;
1836 var1 = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapKeys__map]))(self) /* map on <self:HashMapKeys[Object, nullable Object]>*/;
1837 var2 = ((short int (*)(val*))(var1->class->vft[COLOR_abstract_collection__MapRead__is_empty]))(var1) /* is_empty on <var1:HashMap[Object, nullable Object]>*/;
1838 var = var2;
1839 goto RET_LABEL;
1840 RET_LABEL:;
1841 return var;
1842 }
1843 /* method hash_collection#HashMapKeys#is_empty for (self: Object): Bool */
1844 short int VIRTUAL_hash_collection__HashMapKeys__is_empty(val* self) {
1845 short int var /* : Bool */;
1846 short int var1 /* : Bool */;
1847 var1 = hash_collection__HashMapKeys__is_empty(self);
1848 var = var1;
1849 RET_LABEL:;
1850 return var;
1851 }
1852 /* method hash_collection#HashMapKeys#length for (self: HashMapKeys[Object, nullable Object]): Int */
1853 long hash_collection__HashMapKeys__length(val* self) {
1854 long var /* : Int */;
1855 val* var1 /* : HashMap[Object, nullable Object] */;
1856 long var2 /* : Int */;
1857 var1 = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapKeys__map]))(self) /* map on <self:HashMapKeys[Object, nullable Object]>*/;
1858 var2 = ((long (*)(val*))(var1->class->vft[COLOR_abstract_collection__MapRead__length]))(var1) /* length on <var1:HashMap[Object, nullable Object]>*/;
1859 var = var2;
1860 goto RET_LABEL;
1861 RET_LABEL:;
1862 return var;
1863 }
1864 /* method hash_collection#HashMapKeys#length for (self: Object): Int */
1865 long VIRTUAL_hash_collection__HashMapKeys__length(val* self) {
1866 long var /* : Int */;
1867 long var1 /* : Int */;
1868 var1 = hash_collection__HashMapKeys__length(self);
1869 var = var1;
1870 RET_LABEL:;
1871 return var;
1872 }
1873 /* method hash_collection#HashMapKeys#iterator for (self: HashMapKeys[Object, nullable Object]): Iterator[Object] */
1874 val* hash_collection__HashMapKeys__iterator(val* self) {
1875 val* var /* : Iterator[Object] */;
1876 val* var1 /* : MapKeysIterator[Object, nullable Object] */;
1877 val* var2 /* : HashMap[Object, nullable Object] */;
1878 val* var3 /* : MapIterator[Object, nullable Object] */;
1879 var1 = NEW_abstract_collection__MapKeysIterator(self->type->resolution_table->types[COLOR_abstract_collection__MapKeysIteratorhash_collection__HashMapKeys_FT0hash_collection__HashMapKeys_FT1]);
1880 var2 = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapKeys__map]))(self) /* map on <self:HashMapKeys[Object, nullable Object]>*/;
1881 var3 = ((val* (*)(val*))(var2->class->vft[COLOR_abstract_collection__MapRead__iterator]))(var2) /* iterator on <var2:HashMap[Object, nullable Object]>*/;
1882 ((void (*)(val*, val*))(var1->class->vft[COLOR_abstract_collection__MapKeysIterator__init]))(var1, var3) /* init on <var1:MapKeysIterator[Object, nullable Object]>*/;
1883 var = var1;
1884 goto RET_LABEL;
1885 RET_LABEL:;
1886 return var;
1887 }
1888 /* method hash_collection#HashMapKeys#iterator for (self: Object): Iterator[nullable Object] */
1889 val* VIRTUAL_hash_collection__HashMapKeys__iterator(val* self) {
1890 val* var /* : Iterator[nullable Object] */;
1891 val* var1 /* : Iterator[Object] */;
1892 var1 = hash_collection__HashMapKeys__iterator(self);
1893 var = var1;
1894 RET_LABEL:;
1895 return var;
1896 }
1897 /* method hash_collection#HashMapKeys#clear for (self: HashMapKeys[Object, nullable Object]) */
1898 void hash_collection__HashMapKeys__clear(val* self) {
1899 val* var /* : HashMap[Object, nullable Object] */;
1900 var = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapKeys__map]))(self) /* map on <self:HashMapKeys[Object, nullable Object]>*/;
1901 ((void (*)(val*))(var->class->vft[COLOR_abstract_collection__Map__clear]))(var) /* clear on <var:HashMap[Object, nullable Object]>*/;
1902 RET_LABEL:;
1903 }
1904 /* method hash_collection#HashMapKeys#clear for (self: Object) */
1905 void VIRTUAL_hash_collection__HashMapKeys__clear(val* self) {
1906 hash_collection__HashMapKeys__clear(self);
1907 RET_LABEL:;
1908 }
1909 /* method hash_collection#HashMapKeys#remove for (self: HashMapKeys[Object, nullable Object], Object) */
1910 void hash_collection__HashMapKeys__remove(val* self, val* p0) {
1911 short int var /* : Bool */;
1912 int cltype;
1913 int idtype;
1914 const struct type* type_struct;
1915 const char* var_class_name;
1916 val* var_key /* var key: Object */;
1917 val* var1 /* : HashMap[Object, nullable Object] */;
1918 /* Covariant cast for argument 0 (key) <p0:Object> isa RemovableCollection#0 */
1919 /* <p0:Object> isa RemovableCollection#0 */
1920 type_struct = self->type->resolution_table->types[COLOR_abstract_collection__RemovableCollection_FT0];
1921 cltype = type_struct->color;
1922 idtype = type_struct->id;
1923 if(cltype >= p0->type->table_size) {
1924 var = 0;
1925 } else {
1926 var = p0->type->type_table[cltype] == idtype;
1927 }
1928 if (!var) {
1929 var_class_name = p0 == NULL ? "null" : p0->type->name;
1930 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "RemovableCollection#0", var_class_name);
1931 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 265);
1932 show_backtrace(1);
1933 }
1934 var_key = p0;
1935 var1 = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapKeys__map]))(self) /* map on <self:HashMapKeys[Object, nullable Object]>*/;
1936 ((void (*)(val*, val*))(var1->class->vft[COLOR_hash_collection__HashCollection__remove_node]))(var1, var_key) /* remove_node on <var1:HashMap[Object, nullable Object]>*/;
1937 RET_LABEL:;
1938 }
1939 /* method hash_collection#HashMapKeys#remove for (self: Object, nullable Object) */
1940 void VIRTUAL_hash_collection__HashMapKeys__remove(val* self, val* p0) {
1941 hash_collection__HashMapKeys__remove(self, p0);
1942 RET_LABEL:;
1943 }
1944 /* method hash_collection#HashMapKeys#remove_all for (self: HashMapKeys[Object, nullable Object], Object) */
1945 void hash_collection__HashMapKeys__remove_all(val* self, val* p0) {
1946 short int var /* : Bool */;
1947 int cltype;
1948 int idtype;
1949 const struct type* type_struct;
1950 const char* var_class_name;
1951 val* var_key /* var key: Object */;
1952 val* var1 /* : HashMap[Object, nullable Object] */;
1953 /* Covariant cast for argument 0 (key) <p0:Object> isa RemovableCollection#0 */
1954 /* <p0:Object> isa RemovableCollection#0 */
1955 type_struct = self->type->resolution_table->types[COLOR_abstract_collection__RemovableCollection_FT0];
1956 cltype = type_struct->color;
1957 idtype = type_struct->id;
1958 if(cltype >= p0->type->table_size) {
1959 var = 0;
1960 } else {
1961 var = p0->type->type_table[cltype] == idtype;
1962 }
1963 if (!var) {
1964 var_class_name = p0 == NULL ? "null" : p0->type->name;
1965 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "RemovableCollection#0", var_class_name);
1966 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 266);
1967 show_backtrace(1);
1968 }
1969 var_key = p0;
1970 var1 = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapKeys__map]))(self) /* map on <self:HashMapKeys[Object, nullable Object]>*/;
1971 ((void (*)(val*, val*))(var1->class->vft[COLOR_hash_collection__HashCollection__remove_node]))(var1, var_key) /* remove_node on <var1:HashMap[Object, nullable Object]>*/;
1972 RET_LABEL:;
1973 }
1974 /* method hash_collection#HashMapKeys#remove_all for (self: Object, nullable Object) */
1975 void VIRTUAL_hash_collection__HashMapKeys__remove_all(val* self, val* p0) {
1976 hash_collection__HashMapKeys__remove_all(self, p0);
1977 RET_LABEL:;
1978 }
1979 /* method hash_collection#HashMapKeys#init for (self: HashMapKeys[Object, nullable Object], HashMap[Object, nullable Object]) */
1980 void hash_collection__HashMapKeys__init(val* self, val* p0) {
1981 short int var /* : Bool */;
1982 int cltype;
1983 int idtype;
1984 const struct type* type_struct;
1985 const char* var_class_name;
1986 /* Covariant cast for argument 0 (map) <p0:HashMap[Object, nullable Object]> isa HashMap[HashMapKeys#0, HashMapKeys#1] */
1987 /* <p0:HashMap[Object, nullable Object]> isa HashMap[HashMapKeys#0, HashMapKeys#1] */
1988 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashMaphash_collection__HashMapKeys_FT0hash_collection__HashMapKeys_FT1];
1989 cltype = type_struct->color;
1990 idtype = type_struct->id;
1991 if(cltype >= p0->type->table_size) {
1992 var = 0;
1993 } else {
1994 var = p0->type->type_table[cltype] == idtype;
1995 }
1996 if (!var) {
1997 var_class_name = p0 == NULL ? "null" : p0->type->name;
1998 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap[HashMapKeys#0, HashMapKeys#1]", var_class_name);
1999 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 248);
2000 show_backtrace(1);
2001 }
2002 self->attrs[COLOR_hash_collection__HashMapKeys___64dmap].val = p0; /* @map on <self:HashMapKeys[Object, nullable Object]> */
2003 RET_LABEL:;
2004 }
2005 /* method hash_collection#HashMapKeys#init for (self: Object, HashMap[Object, nullable Object]) */
2006 void VIRTUAL_hash_collection__HashMapKeys__init(val* self, val* p0) {
2007 hash_collection__HashMapKeys__init(self, p0);
2008 RET_LABEL:;
2009 }
2010 /* method hash_collection#HashMapValues#map for (self: HashMapValues[Object, nullable Object]): HashMap[Object, nullable Object] */
2011 val* hash_collection__HashMapValues__map(val* self) {
2012 val* var /* : HashMap[Object, nullable Object] */;
2013 val* var1 /* : HashMap[Object, nullable Object] */;
2014 var1 = self->attrs[COLOR_hash_collection__HashMapValues___64dmap].val; /* @map on <self:HashMapValues[Object, nullable Object]> */
2015 if (var1 == NULL) {
2016 fprintf(stderr, "Runtime error: %s", "Uninitialized attribute @map");
2017 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 272);
2018 show_backtrace(1);
2019 }
2020 var = var1;
2021 RET_LABEL:;
2022 return var;
2023 }
2024 /* method hash_collection#HashMapValues#map for (self: Object): HashMap[Object, nullable Object] */
2025 val* VIRTUAL_hash_collection__HashMapValues__map(val* self) {
2026 val* var /* : HashMap[Object, nullable Object] */;
2027 val* var1 /* : HashMap[Object, nullable Object] */;
2028 var1 = hash_collection__HashMapValues__map(self);
2029 var = var1;
2030 RET_LABEL:;
2031 return var;
2032 }
2033 /* method hash_collection#HashMapValues#map= for (self: HashMapValues[Object, nullable Object], HashMap[Object, nullable Object]) */
2034 void hash_collection__HashMapValues__map_61d(val* self, val* p0) {
2035 short int var /* : Bool */;
2036 int cltype;
2037 int idtype;
2038 const struct type* type_struct;
2039 const char* var_class_name;
2040 /* Covariant cast for argument 0 (map) <p0:HashMap[Object, nullable Object]> isa HashMap[HashMapValues#0, HashMapValues#1] */
2041 /* <p0:HashMap[Object, nullable Object]> isa HashMap[HashMapValues#0, HashMapValues#1] */
2042 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashMaphash_collection__HashMapValues_FT0hash_collection__HashMapValues_FT1];
2043 cltype = type_struct->color;
2044 idtype = type_struct->id;
2045 if(cltype >= p0->type->table_size) {
2046 var = 0;
2047 } else {
2048 var = p0->type->type_table[cltype] == idtype;
2049 }
2050 if (!var) {
2051 var_class_name = p0 == NULL ? "null" : p0->type->name;
2052 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap[HashMapValues#0, HashMapValues#1]", var_class_name);
2053 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 272);
2054 show_backtrace(1);
2055 }
2056 self->attrs[COLOR_hash_collection__HashMapValues___64dmap].val = p0; /* @map on <self:HashMapValues[Object, nullable Object]> */
2057 RET_LABEL:;
2058 }
2059 /* method hash_collection#HashMapValues#map= for (self: Object, HashMap[Object, nullable Object]) */
2060 void VIRTUAL_hash_collection__HashMapValues__map_61d(val* self, val* p0) {
2061 hash_collection__HashMapValues__map_61d(self, p0);
2062 RET_LABEL:;
2063 }
2064 /* method hash_collection#HashMapValues#count for (self: HashMapValues[Object, nullable Object], nullable Object): Int */
2065 long hash_collection__HashMapValues__count(val* self, val* p0) {
2066 long var /* : Int */;
2067 short int var1 /* : Bool */;
2068 int cltype;
2069 int idtype;
2070 const struct type* type_struct;
2071 short int is_nullable;
2072 const char* var_class_name;
2073 val* var_item /* var item: nullable Object */;
2074 long var2 /* : Int */;
2075 long var_nb /* var nb: Int */;
2076 val* var3 /* : HashMap[Object, nullable Object] */;
2077 val* var4 /* : nullable HashNode[Object] */;
2078 val* var_c /* var c: nullable HashMapNode[Object, nullable Object] */;
2079 val* var5 /* : null */;
2080 short int var6 /* : Bool */;
2081 val* var7 /* : nullable Object */;
2082 short int var8 /* : Bool */;
2083 long var9 /* : Int */;
2084 long var10 /* : Int */;
2085 long var12 /* : Int */;
2086 val* var13 /* : nullable HashNode[Object] */;
2087 /* Covariant cast for argument 0 (item) <p0:nullable Object> isa Collection#0 */
2088 /* <p0:nullable Object> isa Collection#0 */
2089 type_struct = self->type->resolution_table->types[COLOR_abstract_collection__Collection_FT0];
2090 cltype = type_struct->color;
2091 idtype = type_struct->id;
2092 is_nullable = type_struct->is_nullable;
2093 if(p0 == NULL) {
2094 var1 = is_nullable;
2095 } else {
2096 if(cltype >= p0->type->table_size) {
2097 var1 = 0;
2098 } else {
2099 var1 = p0->type->type_table[cltype] == idtype;
2100 }
2101 }
2102 if (!var1) {
2103 var_class_name = p0 == NULL ? "null" : p0->type->name;
2104 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Collection#0", var_class_name);
2105 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 275);
2106 show_backtrace(1);
2107 }
2108 var_item = p0;
2109 var2 = 0;
2110 var_nb = var2;
2111 var3 = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapValues__map]))(self) /* map on <self:HashMapValues[Object, nullable Object]>*/;
2112 var4 = var3->attrs[COLOR_hash_collection__HashCollection___first_item].val; /* _first_item on <var3:HashMap[Object, nullable Object]> */
2113 var_c = var4;
2114 for(;;) {
2115 var5 = NULL;
2116 if (var_c == NULL) {
2117 var6 = 0; /* is null */
2118 } else {
2119 var6 = 1; /* arg is null and recv is not */
2120 }
2121 if (!var6) break;
2122 var7 = var_c->attrs[COLOR_hash_collection__HashMapNode___value].val; /* _value on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
2123 if (var7 == NULL) {
2124 var8 = (var_item == NULL);
2125 } else {
2126 var8 = ((short int (*)(val*, val*))(var7->class->vft[COLOR_kernel__Object___61d_61d]))(var7, var_item) /* == on <var7:nullable Object>*/;
2127 }
2128 if (var8){
2129 var9 = 1;
2130 { /* Inline kernel#Int#+ (var_nb,var9) */
2131 var12 = var_nb + var9;
2132 var10 = var12;
2133 goto RET_LABEL11;
2134 RET_LABEL11:(void)0;
2135 }
2136 var_nb = var10;
2137 } else {
2138 }
2139 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])> */
2140 var_c = var13;
2141 CONTINUE_label: (void)0;
2142 }
2143 BREAK_label: (void)0;
2144 var = var_nb;
2145 goto RET_LABEL;
2146 RET_LABEL:;
2147 return var;
2148 }
2149 /* method hash_collection#HashMapValues#count for (self: Object, nullable Object): Int */
2150 long VIRTUAL_hash_collection__HashMapValues__count(val* self, val* p0) {
2151 long var /* : Int */;
2152 long var1 /* : Int */;
2153 var1 = hash_collection__HashMapValues__count(self, p0);
2154 var = var1;
2155 RET_LABEL:;
2156 return var;
2157 }
2158 /* method hash_collection#HashMapValues#first for (self: HashMapValues[Object, nullable Object]): nullable Object */
2159 val* hash_collection__HashMapValues__first(val* self) {
2160 val* var /* : nullable Object */;
2161 val* var1 /* : HashMap[Object, nullable Object] */;
2162 val* var2 /* : nullable HashNode[Object] */;
2163 val* var3 /* : nullable Object */;
2164 var1 = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapValues__map]))(self) /* map on <self:HashMapValues[Object, nullable Object]>*/;
2165 var2 = var1->attrs[COLOR_hash_collection__HashCollection___first_item].val; /* _first_item on <var1:HashMap[Object, nullable Object]> */
2166 if (var2 == NULL) {
2167 fprintf(stderr, "Runtime error: %s", "Reciever is null");
2168 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 285);
2169 show_backtrace(1);
2170 }
2171 var3 = var2->attrs[COLOR_hash_collection__HashMapNode___value].val; /* _value on <var2:nullable HashNode[Object](nullable HashMapNode[Object, nullable Object])> */
2172 var = var3;
2173 goto RET_LABEL;
2174 RET_LABEL:;
2175 return var;
2176 }
2177 /* method hash_collection#HashMapValues#first for (self: Object): nullable Object */
2178 val* VIRTUAL_hash_collection__HashMapValues__first(val* self) {
2179 val* var /* : nullable Object */;
2180 val* var1 /* : nullable Object */;
2181 var1 = hash_collection__HashMapValues__first(self);
2182 var = var1;
2183 RET_LABEL:;
2184 return var;
2185 }
2186 /* method hash_collection#HashMapValues#has for (self: HashMapValues[Object, nullable Object], nullable Object): Bool */
2187 short int hash_collection__HashMapValues__has(val* self, val* p0) {
2188 short int var /* : Bool */;
2189 short int var1 /* : Bool */;
2190 int cltype;
2191 int idtype;
2192 const struct type* type_struct;
2193 short int is_nullable;
2194 const char* var_class_name;
2195 val* var_item /* var item: nullable Object */;
2196 val* var2 /* : HashMap[Object, nullable Object] */;
2197 val* var3 /* : nullable HashNode[Object] */;
2198 val* var_c /* var c: nullable HashMapNode[Object, nullable Object] */;
2199 val* var4 /* : null */;
2200 short int var5 /* : Bool */;
2201 val* var6 /* : nullable Object */;
2202 short int var7 /* : Bool */;
2203 short int var8 /* : Bool */;
2204 val* var9 /* : nullable HashNode[Object] */;
2205 short int var10 /* : Bool */;
2206 /* Covariant cast for argument 0 (item) <p0:nullable Object> isa Collection#0 */
2207 /* <p0:nullable Object> isa Collection#0 */
2208 type_struct = self->type->resolution_table->types[COLOR_abstract_collection__Collection_FT0];
2209 cltype = type_struct->color;
2210 idtype = type_struct->id;
2211 is_nullable = type_struct->is_nullable;
2212 if(p0 == NULL) {
2213 var1 = is_nullable;
2214 } else {
2215 if(cltype >= p0->type->table_size) {
2216 var1 = 0;
2217 } else {
2218 var1 = p0->type->type_table[cltype] == idtype;
2219 }
2220 }
2221 if (!var1) {
2222 var_class_name = p0 == NULL ? "null" : p0->type->name;
2223 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Collection#0", var_class_name);
2224 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 287);
2225 show_backtrace(1);
2226 }
2227 var_item = p0;
2228 var2 = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapValues__map]))(self) /* map on <self:HashMapValues[Object, nullable Object]>*/;
2229 var3 = var2->attrs[COLOR_hash_collection__HashCollection___first_item].val; /* _first_item on <var2:HashMap[Object, nullable Object]> */
2230 var_c = var3;
2231 for(;;) {
2232 var4 = NULL;
2233 if (var_c == NULL) {
2234 var5 = 0; /* is null */
2235 } else {
2236 var5 = 1; /* arg is null and recv is not */
2237 }
2238 if (!var5) break;
2239 var6 = var_c->attrs[COLOR_hash_collection__HashMapNode___value].val; /* _value on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
2240 if (var6 == NULL) {
2241 var7 = (var_item == NULL);
2242 } else {
2243 var7 = ((short int (*)(val*, val*))(var6->class->vft[COLOR_kernel__Object___61d_61d]))(var6, var_item) /* == on <var6:nullable Object>*/;
2244 }
2245 if (var7){
2246 var8 = 1;
2247 var = var8;
2248 goto RET_LABEL;
2249 } else {
2250 }
2251 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])> */
2252 var_c = var9;
2253 CONTINUE_label: (void)0;
2254 }
2255 BREAK_label: (void)0;
2256 var10 = 0;
2257 var = var10;
2258 goto RET_LABEL;
2259 RET_LABEL:;
2260 return var;
2261 }
2262 /* method hash_collection#HashMapValues#has for (self: Object, nullable Object): Bool */
2263 short int VIRTUAL_hash_collection__HashMapValues__has(val* self, val* p0) {
2264 short int var /* : Bool */;
2265 short int var1 /* : Bool */;
2266 var1 = hash_collection__HashMapValues__has(self, p0);
2267 var = var1;
2268 RET_LABEL:;
2269 return var;
2270 }
2271 /* method hash_collection#HashMapValues#has_only for (self: HashMapValues[Object, nullable Object], nullable Object): Bool */
2272 short int hash_collection__HashMapValues__has_only(val* self, val* p0) {
2273 short int var /* : Bool */;
2274 short int var1 /* : Bool */;
2275 int cltype;
2276 int idtype;
2277 const struct type* type_struct;
2278 short int is_nullable;
2279 const char* var_class_name;
2280 val* var_item /* var item: nullable Object */;
2281 val* var2 /* : HashMap[Object, nullable Object] */;
2282 val* var3 /* : nullable HashNode[Object] */;
2283 val* var_c /* var c: nullable HashMapNode[Object, nullable Object] */;
2284 val* var4 /* : null */;
2285 short int var5 /* : Bool */;
2286 val* var6 /* : nullable Object */;
2287 short int var7 /* : Bool */;
2288 short int var8 /* : Bool */;
2289 val* var9 /* : nullable HashNode[Object] */;
2290 short int var10 /* : Bool */;
2291 /* Covariant cast for argument 0 (item) <p0:nullable Object> isa Collection#0 */
2292 /* <p0:nullable Object> isa Collection#0 */
2293 type_struct = self->type->resolution_table->types[COLOR_abstract_collection__Collection_FT0];
2294 cltype = type_struct->color;
2295 idtype = type_struct->id;
2296 is_nullable = type_struct->is_nullable;
2297 if(p0 == NULL) {
2298 var1 = is_nullable;
2299 } else {
2300 if(cltype >= p0->type->table_size) {
2301 var1 = 0;
2302 } else {
2303 var1 = p0->type->type_table[cltype] == idtype;
2304 }
2305 }
2306 if (!var1) {
2307 var_class_name = p0 == NULL ? "null" : p0->type->name;
2308 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Collection#0", var_class_name);
2309 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 297);
2310 show_backtrace(1);
2311 }
2312 var_item = p0;
2313 var2 = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapValues__map]))(self) /* map on <self:HashMapValues[Object, nullable Object]>*/;
2314 var3 = var2->attrs[COLOR_hash_collection__HashCollection___first_item].val; /* _first_item on <var2:HashMap[Object, nullable Object]> */
2315 var_c = var3;
2316 for(;;) {
2317 var4 = NULL;
2318 if (var_c == NULL) {
2319 var5 = 0; /* is null */
2320 } else {
2321 var5 = 1; /* arg is null and recv is not */
2322 }
2323 if (!var5) break;
2324 var6 = var_c->attrs[COLOR_hash_collection__HashMapNode___value].val; /* _value on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
2325 if (var6 == NULL) {
2326 var7 = (var_item != NULL);
2327 } else {
2328 var7 = ((short int (*)(val*, val*))(var6->class->vft[COLOR_kernel__Object___33d_61d]))(var6, var_item) /* != on <var6:nullable Object>*/;
2329 }
2330 if (var7){
2331 var8 = 0;
2332 var = var8;
2333 goto RET_LABEL;
2334 } else {
2335 }
2336 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])> */
2337 var_c = var9;
2338 CONTINUE_label: (void)0;
2339 }
2340 BREAK_label: (void)0;
2341 var10 = 1;
2342 var = var10;
2343 goto RET_LABEL;
2344 RET_LABEL:;
2345 return var;
2346 }
2347 /* method hash_collection#HashMapValues#has_only for (self: Object, nullable Object): Bool */
2348 short int VIRTUAL_hash_collection__HashMapValues__has_only(val* self, val* p0) {
2349 short int var /* : Bool */;
2350 short int var1 /* : Bool */;
2351 var1 = hash_collection__HashMapValues__has_only(self, p0);
2352 var = var1;
2353 RET_LABEL:;
2354 return var;
2355 }
2356 /* method hash_collection#HashMapValues#is_empty for (self: HashMapValues[Object, nullable Object]): Bool */
2357 short int hash_collection__HashMapValues__is_empty(val* self) {
2358 short int var /* : Bool */;
2359 val* var1 /* : HashMap[Object, nullable Object] */;
2360 short int var2 /* : Bool */;
2361 var1 = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapValues__map]))(self) /* map on <self:HashMapValues[Object, nullable Object]>*/;
2362 var2 = ((short int (*)(val*))(var1->class->vft[COLOR_abstract_collection__MapRead__is_empty]))(var1) /* is_empty on <var1:HashMap[Object, nullable Object]>*/;
2363 var = var2;
2364 goto RET_LABEL;
2365 RET_LABEL:;
2366 return var;
2367 }
2368 /* method hash_collection#HashMapValues#is_empty for (self: Object): Bool */
2369 short int VIRTUAL_hash_collection__HashMapValues__is_empty(val* self) {
2370 short int var /* : Bool */;
2371 short int var1 /* : Bool */;
2372 var1 = hash_collection__HashMapValues__is_empty(self);
2373 var = var1;
2374 RET_LABEL:;
2375 return var;
2376 }
2377 /* method hash_collection#HashMapValues#length for (self: HashMapValues[Object, nullable Object]): Int */
2378 long hash_collection__HashMapValues__length(val* self) {
2379 long var /* : Int */;
2380 val* var1 /* : HashMap[Object, nullable Object] */;
2381 long var2 /* : Int */;
2382 var1 = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapValues__map]))(self) /* map on <self:HashMapValues[Object, nullable Object]>*/;
2383 var2 = ((long (*)(val*))(var1->class->vft[COLOR_abstract_collection__MapRead__length]))(var1) /* length on <var1:HashMap[Object, nullable Object]>*/;
2384 var = var2;
2385 goto RET_LABEL;
2386 RET_LABEL:;
2387 return var;
2388 }
2389 /* method hash_collection#HashMapValues#length for (self: Object): Int */
2390 long VIRTUAL_hash_collection__HashMapValues__length(val* self) {
2391 long var /* : Int */;
2392 long var1 /* : Int */;
2393 var1 = hash_collection__HashMapValues__length(self);
2394 var = var1;
2395 RET_LABEL:;
2396 return var;
2397 }
2398 /* method hash_collection#HashMapValues#iterator for (self: HashMapValues[Object, nullable Object]): Iterator[nullable Object] */
2399 val* hash_collection__HashMapValues__iterator(val* self) {
2400 val* var /* : Iterator[nullable Object] */;
2401 val* var1 /* : MapValuesIterator[Object, nullable Object] */;
2402 val* var2 /* : HashMap[Object, nullable Object] */;
2403 val* var3 /* : MapIterator[Object, nullable Object] */;
2404 var1 = NEW_abstract_collection__MapValuesIterator(self->type->resolution_table->types[COLOR_abstract_collection__MapValuesIteratorhash_collection__HashMapValues_FT0hash_collection__HashMapValues_FT1]);
2405 var2 = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapValues__map]))(self) /* map on <self:HashMapValues[Object, nullable Object]>*/;
2406 var3 = ((val* (*)(val*))(var2->class->vft[COLOR_abstract_collection__MapRead__iterator]))(var2) /* iterator on <var2:HashMap[Object, nullable Object]>*/;
2407 ((void (*)(val*, val*))(var1->class->vft[COLOR_abstract_collection__MapValuesIterator__init]))(var1, var3) /* init on <var1:MapValuesIterator[Object, nullable Object]>*/;
2408 var = var1;
2409 goto RET_LABEL;
2410 RET_LABEL:;
2411 return var;
2412 }
2413 /* method hash_collection#HashMapValues#iterator for (self: Object): Iterator[nullable Object] */
2414 val* VIRTUAL_hash_collection__HashMapValues__iterator(val* self) {
2415 val* var /* : Iterator[nullable Object] */;
2416 val* var1 /* : Iterator[nullable Object] */;
2417 var1 = hash_collection__HashMapValues__iterator(self);
2418 var = var1;
2419 RET_LABEL:;
2420 return var;
2421 }
2422 /* method hash_collection#HashMapValues#clear for (self: HashMapValues[Object, nullable Object]) */
2423 void hash_collection__HashMapValues__clear(val* self) {
2424 val* var /* : HashMap[Object, nullable Object] */;
2425 var = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapValues__map]))(self) /* map on <self:HashMapValues[Object, nullable Object]>*/;
2426 ((void (*)(val*))(var->class->vft[COLOR_abstract_collection__Map__clear]))(var) /* clear on <var:HashMap[Object, nullable Object]>*/;
2427 RET_LABEL:;
2428 }
2429 /* method hash_collection#HashMapValues#clear for (self: Object) */
2430 void VIRTUAL_hash_collection__HashMapValues__clear(val* self) {
2431 hash_collection__HashMapValues__clear(self);
2432 RET_LABEL:;
2433 }
2434 /* method hash_collection#HashMapValues#remove for (self: HashMapValues[Object, nullable Object], nullable Object) */
2435 void hash_collection__HashMapValues__remove(val* self, val* p0) {
2436 short int var /* : Bool */;
2437 int cltype;
2438 int idtype;
2439 const struct type* type_struct;
2440 short int is_nullable;
2441 const char* var_class_name;
2442 val* var_item /* var item: nullable Object */;
2443 val* var1 /* : HashMap[Object, nullable Object] */;
2444 val* var_map /* var map: HashMap[Object, nullable Object] */;
2445 val* var2 /* : nullable HashNode[Object] */;
2446 val* var_c /* var c: nullable HashMapNode[Object, nullable Object] */;
2447 val* var3 /* : null */;
2448 short int var4 /* : Bool */;
2449 val* var5 /* : nullable Object */;
2450 short int var6 /* : Bool */;
2451 val* var7 /* : Object */;
2452 val* var8 /* : nullable HashNode[Object] */;
2453 /* Covariant cast for argument 0 (item) <p0:nullable Object> isa RemovableCollection#0 */
2454 /* <p0:nullable Object> isa RemovableCollection#0 */
2455 type_struct = self->type->resolution_table->types[COLOR_abstract_collection__RemovableCollection_FT0];
2456 cltype = type_struct->color;
2457 idtype = type_struct->id;
2458 is_nullable = type_struct->is_nullable;
2459 if(p0 == NULL) {
2460 var = is_nullable;
2461 } else {
2462 if(cltype >= p0->type->table_size) {
2463 var = 0;
2464 } else {
2465 var = p0->type->type_table[cltype] == idtype;
2466 }
2467 }
2468 if (!var) {
2469 var_class_name = p0 == NULL ? "null" : p0->type->name;
2470 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "RemovableCollection#0", var_class_name);
2471 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 314);
2472 show_backtrace(1);
2473 }
2474 var_item = p0;
2475 var1 = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapValues__map]))(self) /* map on <self:HashMapValues[Object, nullable Object]>*/;
2476 var_map = var1;
2477 var2 = var_map->attrs[COLOR_hash_collection__HashCollection___first_item].val; /* _first_item on <var_map:HashMap[Object, nullable Object]> */
2478 var_c = var2;
2479 for(;;) {
2480 var3 = NULL;
2481 if (var_c == NULL) {
2482 var4 = 0; /* is null */
2483 } else {
2484 var4 = 1; /* arg is null and recv is not */
2485 }
2486 if (!var4) break;
2487 var5 = var_c->attrs[COLOR_hash_collection__HashMapNode___value].val; /* _value on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
2488 if (var5 == NULL) {
2489 var6 = (var_item == NULL);
2490 } else {
2491 var6 = ((short int (*)(val*, val*))(var5->class->vft[COLOR_kernel__Object___61d_61d]))(var5, var_item) /* == on <var5:nullable Object>*/;
2492 }
2493 if (var6){
2494 var7 = var_c->attrs[COLOR_hash_collection__HashNode___key].val; /* _key on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
2495 if (var7 == NULL) {
2496 fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _key");
2497 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 320);
2498 show_backtrace(1);
2499 }
2500 ((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]>*/;
2501 goto RET_LABEL;
2502 } else {
2503 }
2504 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])> */
2505 var_c = var8;
2506 CONTINUE_label: (void)0;
2507 }
2508 BREAK_label: (void)0;
2509 RET_LABEL:;
2510 }
2511 /* method hash_collection#HashMapValues#remove for (self: Object, nullable Object) */
2512 void VIRTUAL_hash_collection__HashMapValues__remove(val* self, val* p0) {
2513 hash_collection__HashMapValues__remove(self, p0);
2514 RET_LABEL:;
2515 }
2516 /* method hash_collection#HashMapValues#remove_all for (self: HashMapValues[Object, nullable Object], nullable Object) */
2517 void hash_collection__HashMapValues__remove_all(val* self, val* p0) {
2518 short int var /* : Bool */;
2519 int cltype;
2520 int idtype;
2521 const struct type* type_struct;
2522 short int is_nullable;
2523 const char* var_class_name;
2524 val* var_item /* var item: nullable Object */;
2525 val* var1 /* : HashMap[Object, nullable Object] */;
2526 val* var_map /* var map: HashMap[Object, nullable Object] */;
2527 val* var2 /* : nullable HashNode[Object] */;
2528 val* var_c /* var c: nullable HashMapNode[Object, nullable Object] */;
2529 val* var3 /* : null */;
2530 short int var4 /* : Bool */;
2531 val* var5 /* : nullable Object */;
2532 short int var6 /* : Bool */;
2533 val* var7 /* : Object */;
2534 val* var8 /* : nullable HashNode[Object] */;
2535 /* Covariant cast for argument 0 (item) <p0:nullable Object> isa RemovableCollection#0 */
2536 /* <p0:nullable Object> isa RemovableCollection#0 */
2537 type_struct = self->type->resolution_table->types[COLOR_abstract_collection__RemovableCollection_FT0];
2538 cltype = type_struct->color;
2539 idtype = type_struct->id;
2540 is_nullable = type_struct->is_nullable;
2541 if(p0 == NULL) {
2542 var = is_nullable;
2543 } else {
2544 if(cltype >= p0->type->table_size) {
2545 var = 0;
2546 } else {
2547 var = p0->type->type_table[cltype] == idtype;
2548 }
2549 }
2550 if (!var) {
2551 var_class_name = p0 == NULL ? "null" : p0->type->name;
2552 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "RemovableCollection#0", var_class_name);
2553 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 327);
2554 show_backtrace(1);
2555 }
2556 var_item = p0;
2557 var1 = ((val* (*)(val*))(self->class->vft[COLOR_hash_collection__HashMapValues__map]))(self) /* map on <self:HashMapValues[Object, nullable Object]>*/;
2558 var_map = var1;
2559 var2 = var_map->attrs[COLOR_hash_collection__HashCollection___first_item].val; /* _first_item on <var_map:HashMap[Object, nullable Object]> */
2560 var_c = var2;
2561 for(;;) {
2562 var3 = NULL;
2563 if (var_c == NULL) {
2564 var4 = 0; /* is null */
2565 } else {
2566 var4 = 1; /* arg is null and recv is not */
2567 }
2568 if (!var4) break;
2569 var5 = var_c->attrs[COLOR_hash_collection__HashMapNode___value].val; /* _value on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
2570 if (var5 == NULL) {
2571 var6 = (var_item == NULL);
2572 } else {
2573 var6 = ((short int (*)(val*, val*))(var5->class->vft[COLOR_kernel__Object___61d_61d]))(var5, var_item) /* == on <var5:nullable Object>*/;
2574 }
2575 if (var6){
2576 var7 = var_c->attrs[COLOR_hash_collection__HashNode___key].val; /* _key on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
2577 if (var7 == NULL) {
2578 fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _key");
2579 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 333);
2580 show_backtrace(1);
2581 }
2582 ((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]>*/;
2583 } else {
2584 }
2585 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])> */
2586 var_c = var8;
2587 CONTINUE_label: (void)0;
2588 }
2589 BREAK_label: (void)0;
2590 RET_LABEL:;
2591 }
2592 /* method hash_collection#HashMapValues#remove_all for (self: Object, nullable Object) */
2593 void VIRTUAL_hash_collection__HashMapValues__remove_all(val* self, val* p0) {
2594 hash_collection__HashMapValues__remove_all(self, p0);
2595 RET_LABEL:;
2596 }
2597 /* method hash_collection#HashMapValues#init for (self: HashMapValues[Object, nullable Object], HashMap[Object, nullable Object]) */
2598 void hash_collection__HashMapValues__init(val* self, val* p0) {
2599 short int var /* : Bool */;
2600 int cltype;
2601 int idtype;
2602 const struct type* type_struct;
2603 const char* var_class_name;
2604 /* Covariant cast for argument 0 (map) <p0:HashMap[Object, nullable Object]> isa HashMap[HashMapValues#0, HashMapValues#1] */
2605 /* <p0:HashMap[Object, nullable Object]> isa HashMap[HashMapValues#0, HashMapValues#1] */
2606 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashMaphash_collection__HashMapValues_FT0hash_collection__HashMapValues_FT1];
2607 cltype = type_struct->color;
2608 idtype = type_struct->id;
2609 if(cltype >= p0->type->table_size) {
2610 var = 0;
2611 } else {
2612 var = p0->type->type_table[cltype] == idtype;
2613 }
2614 if (!var) {
2615 var_class_name = p0 == NULL ? "null" : p0->type->name;
2616 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap[HashMapValues#0, HashMapValues#1]", var_class_name);
2617 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 269);
2618 show_backtrace(1);
2619 }
2620 self->attrs[COLOR_hash_collection__HashMapValues___64dmap].val = p0; /* @map on <self:HashMapValues[Object, nullable Object]> */
2621 RET_LABEL:;
2622 }
2623 /* method hash_collection#HashMapValues#init for (self: Object, HashMap[Object, nullable Object]) */
2624 void VIRTUAL_hash_collection__HashMapValues__init(val* self, val* p0) {
2625 hash_collection__HashMapValues__init(self, p0);
2626 RET_LABEL:;
2627 }
2628 /* method hash_collection#HashMapNode#init for (self: HashMapNode[Object, nullable Object], Object, nullable Object) */
2629 void hash_collection__HashMapNode__init(val* self, val* p0, val* p1) {
2630 short int var /* : Bool */;
2631 int cltype;
2632 int idtype;
2633 const struct type* type_struct;
2634 const char* var_class_name;
2635 short int var1 /* : Bool */;
2636 int cltype2;
2637 int idtype3;
2638 const struct type* type_struct4;
2639 short int is_nullable;
2640 const char* var_class_name5;
2641 val* var_k /* var k: Object */;
2642 val* var_v /* var v: nullable Object */;
2643 /* Covariant cast for argument 0 (k) <p0:Object> isa HashMapNode#0 */
2644 /* <p0:Object> isa HashMapNode#0 */
2645 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashMapNode_FT0];
2646 cltype = type_struct->color;
2647 idtype = type_struct->id;
2648 if(cltype >= p0->type->table_size) {
2649 var = 0;
2650 } else {
2651 var = p0->type->type_table[cltype] == idtype;
2652 }
2653 if (!var) {
2654 var_class_name = p0 == NULL ? "null" : p0->type->name;
2655 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMapNode#0", var_class_name);
2656 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 345);
2657 show_backtrace(1);
2658 }
2659 /* Covariant cast for argument 1 (v) <p1:nullable Object> isa HashMapNode#1 */
2660 /* <p1:nullable Object> isa HashMapNode#1 */
2661 type_struct4 = self->type->resolution_table->types[COLOR_hash_collection__HashMapNode_FT1];
2662 cltype2 = type_struct4->color;
2663 idtype3 = type_struct4->id;
2664 is_nullable = type_struct4->is_nullable;
2665 if(p1 == NULL) {
2666 var1 = is_nullable;
2667 } else {
2668 if(cltype2 >= p1->type->table_size) {
2669 var1 = 0;
2670 } else {
2671 var1 = p1->type->type_table[cltype2] == idtype3;
2672 }
2673 }
2674 if (!var1) {
2675 var_class_name5 = p1 == NULL ? "null" : p1->type->name;
2676 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMapNode#1", var_class_name5);
2677 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 345);
2678 show_backtrace(1);
2679 }
2680 var_k = p0;
2681 var_v = p1;
2682 ((void (*)(val*, val*))(self->class->vft[COLOR_hash_collection__HashNode__init]))(self, var_k) /* init on <self:HashMapNode[Object, nullable Object]>*/;
2683 self->attrs[COLOR_hash_collection__HashMapNode___value].val = var_v; /* _value on <self:HashMapNode[Object, nullable Object]> */
2684 RET_LABEL:;
2685 }
2686 /* method hash_collection#HashMapNode#init for (self: Object, Object, nullable Object) */
2687 void VIRTUAL_hash_collection__HashMapNode__init(val* self, val* p0, val* p1) {
2688 hash_collection__HashMapNode__init(self, p0, p1);
2689 RET_LABEL:;
2690 }
2691 /* method hash_collection#HashMapIterator#is_ok for (self: HashMapIterator[Object, nullable Object]): Bool */
2692 short int hash_collection__HashMapIterator__is_ok(val* self) {
2693 short int var /* : Bool */;
2694 val* var1 /* : nullable HashMapNode[Object, nullable Object] */;
2695 val* var2 /* : null */;
2696 short int var3 /* : Bool */;
2697 var1 = self->attrs[COLOR_hash_collection__HashMapIterator___node].val; /* _node on <self:HashMapIterator[Object, nullable Object]> */
2698 var2 = NULL;
2699 if (var1 == NULL) {
2700 var3 = 0; /* is null */
2701 } else {
2702 var3 = 1; /* arg is null and recv is not */
2703 }
2704 var = var3;
2705 goto RET_LABEL;
2706 RET_LABEL:;
2707 return var;
2708 }
2709 /* method hash_collection#HashMapIterator#is_ok for (self: Object): Bool */
2710 short int VIRTUAL_hash_collection__HashMapIterator__is_ok(val* self) {
2711 short int var /* : Bool */;
2712 short int var1 /* : Bool */;
2713 var1 = hash_collection__HashMapIterator__is_ok(self);
2714 var = var1;
2715 RET_LABEL:;
2716 return var;
2717 }
2718 /* method hash_collection#HashMapIterator#item for (self: HashMapIterator[Object, nullable Object]): nullable Object */
2719 val* hash_collection__HashMapIterator__item(val* self) {
2720 val* var /* : nullable Object */;
2721 short int var1 /* : Bool */;
2722 val* var2 /* : nullable HashMapNode[Object, nullable Object] */;
2723 val* var3 /* : nullable Object */;
2724 var1 = ((short int (*)(val*))(self->class->vft[COLOR_abstract_collection__MapIterator__is_ok]))(self) /* is_ok on <self:HashMapIterator[Object, nullable Object]>*/;
2725 if (!var1) {
2726 fprintf(stderr, "Runtime error: %s", "Assert failed");
2727 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 358);
2728 show_backtrace(1);
2729 }
2730 var2 = self->attrs[COLOR_hash_collection__HashMapIterator___node].val; /* _node on <self:HashMapIterator[Object, nullable Object]> */
2731 if (var2 == NULL) {
2732 fprintf(stderr, "Runtime error: %s", "Reciever is null");
2733 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 359);
2734 show_backtrace(1);
2735 }
2736 var3 = var2->attrs[COLOR_hash_collection__HashMapNode___value].val; /* _value on <var2:nullable HashMapNode[Object, nullable Object]> */
2737 var = var3;
2738 goto RET_LABEL;
2739 RET_LABEL:;
2740 return var;
2741 }
2742 /* method hash_collection#HashMapIterator#item for (self: Object): nullable Object */
2743 val* VIRTUAL_hash_collection__HashMapIterator__item(val* self) {
2744 val* var /* : nullable Object */;
2745 val* var1 /* : nullable Object */;
2746 var1 = hash_collection__HashMapIterator__item(self);
2747 var = var1;
2748 RET_LABEL:;
2749 return var;
2750 }
2751 /* method hash_collection#HashMapIterator#key for (self: HashMapIterator[Object, nullable Object]): Object */
2752 val* hash_collection__HashMapIterator__key(val* self) {
2753 val* var /* : Object */;
2754 short int var1 /* : Bool */;
2755 val* var2 /* : nullable HashMapNode[Object, nullable Object] */;
2756 val* var3 /* : Object */;
2757 var1 = ((short int (*)(val*))(self->class->vft[COLOR_abstract_collection__MapIterator__is_ok]))(self) /* is_ok on <self:HashMapIterator[Object, nullable Object]>*/;
2758 if (!var1) {
2759 fprintf(stderr, "Runtime error: %s", "Assert failed");
2760 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 370);
2761 show_backtrace(1);
2762 }
2763 var2 = self->attrs[COLOR_hash_collection__HashMapIterator___node].val; /* _node on <self:HashMapIterator[Object, nullable Object]> */
2764 if (var2 == NULL) {
2765 fprintf(stderr, "Runtime error: %s", "Reciever is null");
2766 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 371);
2767 show_backtrace(1);
2768 }
2769 var3 = var2->attrs[COLOR_hash_collection__HashNode___key].val; /* _key on <var2:nullable HashMapNode[Object, nullable Object]> */
2770 if (var3 == NULL) {
2771 fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _key");
2772 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 371);
2773 show_backtrace(1);
2774 }
2775 var = var3;
2776 goto RET_LABEL;
2777 RET_LABEL:;
2778 return var;
2779 }
2780 /* method hash_collection#HashMapIterator#key for (self: Object): Object */
2781 val* VIRTUAL_hash_collection__HashMapIterator__key(val* self) {
2782 val* var /* : Object */;
2783 val* var1 /* : Object */;
2784 var1 = hash_collection__HashMapIterator__key(self);
2785 var = var1;
2786 RET_LABEL:;
2787 return var;
2788 }
2789 /* method hash_collection#HashMapIterator#next for (self: HashMapIterator[Object, nullable Object]) */
2790 void hash_collection__HashMapIterator__next(val* self) {
2791 short int var /* : Bool */;
2792 val* var1 /* : nullable HashMapNode[Object, nullable Object] */;
2793 val* var2 /* : nullable HashNode[Object] */;
2794 var = ((short int (*)(val*))(self->class->vft[COLOR_abstract_collection__MapIterator__is_ok]))(self) /* is_ok on <self:HashMapIterator[Object, nullable Object]>*/;
2795 if (!var) {
2796 fprintf(stderr, "Runtime error: %s", "Assert failed");
2797 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 376);
2798 show_backtrace(1);
2799 }
2800 var1 = self->attrs[COLOR_hash_collection__HashMapIterator___node].val; /* _node on <self:HashMapIterator[Object, nullable Object]> */
2801 if (var1 == NULL) {
2802 fprintf(stderr, "Runtime error: %s", "Reciever is null");
2803 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 377);
2804 show_backtrace(1);
2805 }
2806 var2 = var1->attrs[COLOR_hash_collection__HashNode___next_item].val; /* _next_item on <var1:nullable HashMapNode[Object, nullable Object]> */
2807 self->attrs[COLOR_hash_collection__HashMapIterator___node].val = var2; /* _node on <self:HashMapIterator[Object, nullable Object]> */
2808 RET_LABEL:;
2809 }
2810 /* method hash_collection#HashMapIterator#next for (self: Object) */
2811 void VIRTUAL_hash_collection__HashMapIterator__next(val* self) {
2812 hash_collection__HashMapIterator__next(self);
2813 RET_LABEL:;
2814 }
2815 /* method hash_collection#HashMapIterator#init for (self: HashMapIterator[Object, nullable Object], HashMap[Object, nullable Object]) */
2816 void hash_collection__HashMapIterator__init(val* self, val* p0) {
2817 short int var /* : Bool */;
2818 int cltype;
2819 int idtype;
2820 const struct type* type_struct;
2821 const char* var_class_name;
2822 val* var_map /* var map: HashMap[Object, nullable Object] */;
2823 val* var1 /* : nullable HashNode[Object] */;
2824 /* Covariant cast for argument 0 (map) <p0:HashMap[Object, nullable Object]> isa HashMap[HashMapIterator#0, HashMapIterator#1] */
2825 /* <p0:HashMap[Object, nullable Object]> isa HashMap[HashMapIterator#0, HashMapIterator#1] */
2826 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashMaphash_collection__HashMapIterator_FT0hash_collection__HashMapIterator_FT1];
2827 cltype = type_struct->color;
2828 idtype = type_struct->id;
2829 if(cltype >= p0->type->table_size) {
2830 var = 0;
2831 } else {
2832 var = p0->type->type_table[cltype] == idtype;
2833 }
2834 if (!var) {
2835 var_class_name = p0 == NULL ? "null" : p0->type->name;
2836 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap[HashMapIterator#0, HashMapIterator#1]", var_class_name);
2837 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 386);
2838 show_backtrace(1);
2839 }
2840 var_map = p0;
2841 self->attrs[COLOR_hash_collection__HashMapIterator___map].val = var_map; /* _map on <self:HashMapIterator[Object, nullable Object]> */
2842 var1 = ((val* (*)(val*))(var_map->class->vft[COLOR_hash_collection__HashCollection__first_item]))(var_map) /* first_item on <var_map:HashMap[Object, nullable Object]>*/;
2843 self->attrs[COLOR_hash_collection__HashMapIterator___node].val = var1; /* _node on <self:HashMapIterator[Object, nullable Object]> */
2844 RET_LABEL:;
2845 }
2846 /* method hash_collection#HashMapIterator#init for (self: Object, HashMap[Object, nullable Object]) */
2847 void VIRTUAL_hash_collection__HashMapIterator__init(val* self, val* p0) {
2848 hash_collection__HashMapIterator__init(self, p0);
2849 RET_LABEL:;
2850 }
2851 /* method hash_collection#HashSet#length for (self: HashSet[Object]): Int */
2852 long hash_collection__HashSet__length(val* self) {
2853 long var /* : Int */;
2854 long var1 /* : Int */;
2855 var1 = self->attrs[COLOR_hash_collection__HashCollection___length].l; /* _length on <self:HashSet[Object]> */
2856 var = var1;
2857 goto RET_LABEL;
2858 RET_LABEL:;
2859 return var;
2860 }
2861 /* method hash_collection#HashSet#length for (self: Object): Int */
2862 long VIRTUAL_hash_collection__HashSet__length(val* self) {
2863 long var /* : Int */;
2864 long var1 /* : Int */;
2865 var1 = hash_collection__HashSet__length(self);
2866 var = var1;
2867 RET_LABEL:;
2868 return var;
2869 }
2870 /* method hash_collection#HashSet#is_empty for (self: HashSet[Object]): Bool */
2871 short int hash_collection__HashSet__is_empty(val* self) {
2872 short int var /* : Bool */;
2873 long var1 /* : Int */;
2874 long var2 /* : Int */;
2875 short int var3 /* : Bool */;
2876 short int var5 /* : Bool */;
2877 var1 = self->attrs[COLOR_hash_collection__HashCollection___length].l; /* _length on <self:HashSet[Object]> */
2878 var2 = 0;
2879 { /* Inline kernel#Int#== (var1,var2) */
2880 var5 = var1 == var2;
2881 var3 = var5;
2882 goto RET_LABEL4;
2883 RET_LABEL4:(void)0;
2884 }
2885 var = var3;
2886 goto RET_LABEL;
2887 RET_LABEL:;
2888 return var;
2889 }
2890 /* method hash_collection#HashSet#is_empty for (self: Object): Bool */
2891 short int VIRTUAL_hash_collection__HashSet__is_empty(val* self) {
2892 short int var /* : Bool */;
2893 short int var1 /* : Bool */;
2894 var1 = hash_collection__HashSet__is_empty(self);
2895 var = var1;
2896 RET_LABEL:;
2897 return var;
2898 }
2899 /* method hash_collection#HashSet#first for (self: HashSet[Object]): Object */
2900 val* hash_collection__HashSet__first(val* self) {
2901 val* var /* : Object */;
2902 long var1 /* : Int */;
2903 long var2 /* : Int */;
2904 short int var3 /* : Bool */;
2905 short int var5 /* : Bool */;
2906 int cltype;
2907 int idtype;
2908 const char* var_class_name;
2909 short int var6 /* : Bool */;
2910 val* var7 /* : nullable HashNode[Object] */;
2911 val* var8 /* : Object */;
2912 var1 = self->attrs[COLOR_hash_collection__HashCollection___length].l; /* _length on <self:HashSet[Object]> */
2913 var2 = 0;
2914 { /* Inline kernel#Int#> (var1,var2) */
2915 /* Covariant cast for argument 0 (i) <var2:Int> isa OTHER */
2916 /* <var2:Int> isa OTHER */
2917 var5 = 1; /* easy <var2:Int> isa OTHER*/
2918 if (!var5) {
2919 var_class_name = type_kernel__Int.name;
2920 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name);
2921 fprintf(stderr, " (%s:%d)\n", "lib/standard/kernel.nit", 263);
2922 show_backtrace(1);
2923 }
2924 var6 = var1 > var2;
2925 var3 = var6;
2926 goto RET_LABEL4;
2927 RET_LABEL4:(void)0;
2928 }
2929 if (!var3) {
2930 fprintf(stderr, "Runtime error: %s", "Assert failed");
2931 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 405);
2932 show_backtrace(1);
2933 }
2934 var7 = self->attrs[COLOR_hash_collection__HashCollection___first_item].val; /* _first_item on <self:HashSet[Object]> */
2935 if (var7 == NULL) {
2936 fprintf(stderr, "Runtime error: %s", "Reciever is null");
2937 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 406);
2938 show_backtrace(1);
2939 }
2940 var8 = var7->attrs[COLOR_hash_collection__HashNode___key].val; /* _key on <var7:nullable HashNode[Object](nullable HashSetNode[Object])> */
2941 if (var8 == NULL) {
2942 fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _key");
2943 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 406);
2944 show_backtrace(1);
2945 }
2946 var = var8;
2947 goto RET_LABEL;
2948 RET_LABEL:;
2949 return var;
2950 }
2951 /* method hash_collection#HashSet#first for (self: Object): nullable Object */
2952 val* VIRTUAL_hash_collection__HashSet__first(val* self) {
2953 val* var /* : nullable Object */;
2954 val* var1 /* : Object */;
2955 var1 = hash_collection__HashSet__first(self);
2956 var = var1;
2957 RET_LABEL:;
2958 return var;
2959 }
2960 /* method hash_collection#HashSet#has for (self: HashSet[Object], Object): Bool */
2961 short int hash_collection__HashSet__has(val* self, val* p0) {
2962 short int var /* : Bool */;
2963 short int var1 /* : Bool */;
2964 int cltype;
2965 int idtype;
2966 const struct type* type_struct;
2967 const char* var_class_name;
2968 val* var_item /* var item: Object */;
2969 val* var2 /* : nullable HashNode[Object] */;
2970 val* var3 /* : null */;
2971 short int var4 /* : Bool */;
2972 /* Covariant cast for argument 0 (item) <p0:Object> isa Collection#0 */
2973 /* <p0:Object> isa Collection#0 */
2974 type_struct = self->type->resolution_table->types[COLOR_abstract_collection__Collection_FT0];
2975 cltype = type_struct->color;
2976 idtype = type_struct->id;
2977 if(cltype >= p0->type->table_size) {
2978 var1 = 0;
2979 } else {
2980 var1 = p0->type->type_table[cltype] == idtype;
2981 }
2982 if (!var1) {
2983 var_class_name = p0 == NULL ? "null" : p0->type->name;
2984 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Collection#0", var_class_name);
2985 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 409);
2986 show_backtrace(1);
2987 }
2988 var_item = p0;
2989 var2 = ((val* (*)(val*, val*))(self->class->vft[COLOR_hash_collection__HashCollection__node_at]))(self, var_item) /* node_at on <self:HashSet[Object]>*/;
2990 var3 = NULL;
2991 if (var2 == NULL) {
2992 var4 = 0; /* is null */
2993 } else {
2994 var4 = 1; /* arg is null and recv is not */
2995 }
2996 var = var4;
2997 goto RET_LABEL;
2998 RET_LABEL:;
2999 return var;
3000 }
3001 /* method hash_collection#HashSet#has for (self: Object, nullable Object): Bool */
3002 short int VIRTUAL_hash_collection__HashSet__has(val* self, val* p0) {
3003 short int var /* : Bool */;
3004 short int var1 /* : Bool */;
3005 var1 = hash_collection__HashSet__has(self, p0);
3006 var = var1;
3007 RET_LABEL:;
3008 return var;
3009 }
3010 /* method hash_collection#HashSet#add for (self: HashSet[Object], Object) */
3011 void hash_collection__HashSet__add(val* self, val* p0) {
3012 short int var /* : Bool */;
3013 int cltype;
3014 int idtype;
3015 const struct type* type_struct;
3016 const char* var_class_name;
3017 val* var_item /* var item: Object */;
3018 long var1 /* : Int */;
3019 long var_i /* var i: Int */;
3020 val* var2 /* : nullable HashNode[Object] */;
3021 val* var_c /* var c: nullable HashSetNode[Object] */;
3022 val* var3 /* : null */;
3023 short int var4 /* : Bool */;
3024 val* var5 /* : HashSetNode[Object] */;
3025 /* Covariant cast for argument 0 (item) <p0:Object> isa SimpleCollection#0 */
3026 /* <p0:Object> isa SimpleCollection#0 */
3027 type_struct = self->type->resolution_table->types[COLOR_abstract_collection__SimpleCollection_FT0];
3028 cltype = type_struct->color;
3029 idtype = type_struct->id;
3030 if(cltype >= p0->type->table_size) {
3031 var = 0;
3032 } else {
3033 var = p0->type->type_table[cltype] == idtype;
3034 }
3035 if (!var) {
3036 var_class_name = p0 == NULL ? "null" : p0->type->name;
3037 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "SimpleCollection#0", var_class_name);
3038 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 414);
3039 show_backtrace(1);
3040 }
3041 var_item = p0;
3042 var1 = ((long (*)(val*, val*))(self->class->vft[COLOR_hash_collection__HashCollection__index_at]))(self, var_item) /* index_at on <self:HashSet[Object]>*/;
3043 var_i = var1;
3044 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]>*/;
3045 var_c = var2;
3046 var3 = NULL;
3047 if (var_c == NULL) {
3048 var4 = 0; /* is null */
3049 } else {
3050 var4 = 1; /* arg is null and recv is not */
3051 }
3052 if (var4){
3053 var_c->attrs[COLOR_hash_collection__HashNode___key].val = var_item; /* _key on <var_c:nullable HashSetNode[Object](HashSetNode[Object])> */
3054 } else {
3055 var5 = NEW_hash_collection__HashSetNode(self->type->resolution_table->types[COLOR_hash_collection__HashSetNodehash_collection__HashSet_FT0]);
3056 ((void (*)(val*, val*))(var5->class->vft[COLOR_hash_collection__HashSetNode__init]))(var5, var_item) /* init on <var5:HashSetNode[Object]>*/;
3057 ((void (*)(val*, long, val*))(self->class->vft[COLOR_hash_collection__HashCollection__store]))(self, var_i, var5) /* store on <self:HashSet[Object]>*/;
3058 }
3059 RET_LABEL:;
3060 }
3061 /* method hash_collection#HashSet#add for (self: Object, nullable Object) */
3062 void VIRTUAL_hash_collection__HashSet__add(val* self, val* p0) {
3063 hash_collection__HashSet__add(self, p0);
3064 RET_LABEL:;
3065 }
3066 /* method hash_collection#HashSet#remove for (self: HashSet[Object], Object) */
3067 void hash_collection__HashSet__remove(val* self, val* p0) {
3068 short int var /* : Bool */;
3069 int cltype;
3070 int idtype;
3071 const struct type* type_struct;
3072 const char* var_class_name;
3073 val* var_item /* var item: Object */;
3074 /* Covariant cast for argument 0 (item) <p0:Object> isa RemovableCollection#0 */
3075 /* <p0:Object> isa RemovableCollection#0 */
3076 type_struct = self->type->resolution_table->types[COLOR_abstract_collection__RemovableCollection_FT0];
3077 cltype = type_struct->color;
3078 idtype = type_struct->id;
3079 if(cltype >= p0->type->table_size) {
3080 var = 0;
3081 } else {
3082 var = p0->type->type_table[cltype] == idtype;
3083 }
3084 if (!var) {
3085 var_class_name = p0 == NULL ? "null" : p0->type->name;
3086 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "RemovableCollection#0", var_class_name);
3087 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 425);
3088 show_backtrace(1);
3089 }
3090 var_item = p0;
3091 ((void (*)(val*, val*))(self->class->vft[COLOR_hash_collection__HashCollection__remove_node]))(self, var_item) /* remove_node on <self:HashSet[Object]>*/;
3092 RET_LABEL:;
3093 }
3094 /* method hash_collection#HashSet#remove for (self: Object, nullable Object) */
3095 void VIRTUAL_hash_collection__HashSet__remove(val* self, val* p0) {
3096 hash_collection__HashSet__remove(self, p0);
3097 RET_LABEL:;
3098 }
3099 /* method hash_collection#HashSet#clear for (self: HashSet[Object]) */
3100 void hash_collection__HashSet__clear(val* self) {
3101 ((void (*)(val*))(self->class->vft[COLOR_hash_collection__HashCollection__raz]))(self) /* raz on <self:HashSet[Object]>*/;
3102 RET_LABEL:;
3103 }
3104 /* method hash_collection#HashSet#clear for (self: Object) */
3105 void VIRTUAL_hash_collection__HashSet__clear(val* self) {
3106 hash_collection__HashSet__clear(self);
3107 RET_LABEL:;
3108 }
3109 /* method hash_collection#HashSet#iterator for (self: HashSet[Object]): Iterator[Object] */
3110 val* hash_collection__HashSet__iterator(val* self) {
3111 val* var /* : Iterator[Object] */;
3112 val* var1 /* : HashSetIterator[Object] */;
3113 var1 = NEW_hash_collection__HashSetIterator(self->type->resolution_table->types[COLOR_hash_collection__HashSetIteratorhash_collection__HashSet_FT0]);
3114 ((void (*)(val*, val*))(var1->class->vft[COLOR_hash_collection__HashSetIterator__init]))(var1, self) /* init on <var1:HashSetIterator[Object]>*/;
3115 var = var1;
3116 goto RET_LABEL;
3117 RET_LABEL:;
3118 return var;
3119 }
3120 /* method hash_collection#HashSet#iterator for (self: Object): Iterator[nullable Object] */
3121 val* VIRTUAL_hash_collection__HashSet__iterator(val* self) {
3122 val* var /* : Iterator[nullable Object] */;
3123 val* var1 /* : Iterator[Object] */;
3124 var1 = hash_collection__HashSet__iterator(self);
3125 var = var1;
3126 RET_LABEL:;
3127 return var;
3128 }
3129 /* method hash_collection#HashSet#init for (self: HashSet[Object]) */
3130 void hash_collection__HashSet__init(val* self) {
3131 long var /* : Int */;
3132 long var1 /* : Int */;
3133 long var2 /* : Int */;
3134 ((void (*)(val*))(self->class->vft[COLOR_hash_collection__HashCollection__init]))(self) /* init on <self:HashSet[Object]>*/;
3135 var = 0;
3136 self->attrs[COLOR_hash_collection__HashCollection___capacity].l = var; /* _capacity on <self:HashSet[Object]> */
3137 var1 = 0;
3138 self->attrs[COLOR_hash_collection__HashCollection___length].l = var1; /* _length on <self:HashSet[Object]> */
3139 var2 = 0;
3140 ((void (*)(val*, long))(self->class->vft[COLOR_hash_collection__HashCollection__enlarge]))(self, var2) /* enlarge on <self:HashSet[Object]>*/;
3141 RET_LABEL:;
3142 }
3143 /* method hash_collection#HashSet#init for (self: Object) */
3144 void VIRTUAL_hash_collection__HashSet__init(val* self) {
3145 hash_collection__HashSet__init(self);
3146 RET_LABEL:;
3147 }
3148 /* method hash_collection#HashSet#from for (self: HashSet[Object], Collection[Object]) */
3149 void hash_collection__HashSet__from(val* self, val* p0) {
3150 short int var /* : Bool */;
3151 int cltype;
3152 int idtype;
3153 const struct type* type_struct;
3154 const char* var_class_name;
3155 val* var_coll /* var coll: Collection[Object] */;
3156 /* Covariant cast for argument 0 (coll) <p0:Collection[Object]> isa Collection[HashSet#0] */
3157 /* <p0:Collection[Object]> isa Collection[HashSet#0] */
3158 type_struct = self->type->resolution_table->types[COLOR_abstract_collection__Collectionhash_collection__HashSet_FT0];
3159 cltype = type_struct->color;
3160 idtype = type_struct->id;
3161 if(cltype >= p0->type->table_size) {
3162 var = 0;
3163 } else {
3164 var = p0->type->type_table[cltype] == idtype;
3165 }
3166 if (!var) {
3167 var_class_name = p0 == NULL ? "null" : p0->type->name;
3168 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Collection[HashSet#0]", var_class_name);
3169 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 438);
3170 show_backtrace(1);
3171 }
3172 var_coll = p0;
3173 ((void (*)(val*))(self->class->vft[COLOR_hash_collection__HashSet__init]))(self) /* init on <self:HashSet[Object]>*/;
3174 ((void (*)(val*, val*))(self->class->vft[COLOR_abstract_collection__SimpleCollection__add_all]))(self, var_coll) /* add_all on <self:HashSet[Object]>*/;
3175 RET_LABEL:;
3176 }
3177 /* method hash_collection#HashSet#from for (self: Object, Collection[Object]) */
3178 void VIRTUAL_hash_collection__HashSet__from(val* self, val* p0) {
3179 hash_collection__HashSet__from(self, p0);
3180 RET_LABEL:;
3181 }
3182 /* method hash_collection#HashSetNode#init for (self: HashSetNode[Object], Object) */
3183 void hash_collection__HashSetNode__init(val* self, val* p0) {
3184 short int var /* : Bool */;
3185 int cltype;
3186 int idtype;
3187 const struct type* type_struct;
3188 const char* var_class_name;
3189 val* var_e /* var e: Object */;
3190 /* Covariant cast for argument 0 (e) <p0:Object> isa HashSetNode#0 */
3191 /* <p0:Object> isa HashSetNode#0 */
3192 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashSetNode_FT0];
3193 cltype = type_struct->color;
3194 idtype = type_struct->id;
3195 if(cltype >= p0->type->table_size) {
3196 var = 0;
3197 } else {
3198 var = p0->type->type_table[cltype] == idtype;
3199 }
3200 if (!var) {
3201 var_class_name = p0 == NULL ? "null" : p0->type->name;
3202 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashSetNode#0", var_class_name);
3203 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 449);
3204 show_backtrace(1);
3205 }
3206 var_e = p0;
3207 ((void (*)(val*, val*))(self->class->vft[COLOR_hash_collection__HashNode__init]))(self, p0) /* init on <self:HashSetNode[Object]>*/;
3208 self->attrs[COLOR_hash_collection__HashNode___key].val = var_e; /* _key on <self:HashSetNode[Object]> */
3209 RET_LABEL:;
3210 }
3211 /* method hash_collection#HashSetNode#init for (self: Object, Object) */
3212 void VIRTUAL_hash_collection__HashSetNode__init(val* self, val* p0) {
3213 hash_collection__HashSetNode__init(self, p0);
3214 RET_LABEL:;
3215 }
3216 /* method hash_collection#HashSetIterator#is_ok for (self: HashSetIterator[Object]): Bool */
3217 short int hash_collection__HashSetIterator__is_ok(val* self) {
3218 short int var /* : Bool */;
3219 val* var1 /* : nullable HashSetNode[Object] */;
3220 val* var2 /* : null */;
3221 short int var3 /* : Bool */;
3222 var1 = self->attrs[COLOR_hash_collection__HashSetIterator___node].val; /* _node on <self:HashSetIterator[Object]> */
3223 var2 = NULL;
3224 if (var1 == NULL) {
3225 var3 = 0; /* is null */
3226 } else {
3227 var3 = 1; /* arg is null and recv is not */
3228 }
3229 var = var3;
3230 goto RET_LABEL;
3231 RET_LABEL:;
3232 return var;
3233 }
3234 /* method hash_collection#HashSetIterator#is_ok for (self: Object): Bool */
3235 short int VIRTUAL_hash_collection__HashSetIterator__is_ok(val* self) {
3236 short int var /* : Bool */;
3237 short int var1 /* : Bool */;
3238 var1 = hash_collection__HashSetIterator__is_ok(self);
3239 var = var1;
3240 RET_LABEL:;
3241 return var;
3242 }
3243 /* method hash_collection#HashSetIterator#item for (self: HashSetIterator[Object]): Object */
3244 val* hash_collection__HashSetIterator__item(val* self) {
3245 val* var /* : Object */;
3246 short int var1 /* : Bool */;
3247 val* var2 /* : nullable HashSetNode[Object] */;
3248 val* var3 /* : Object */;
3249 var1 = ((short int (*)(val*))(self->class->vft[COLOR_abstract_collection__Iterator__is_ok]))(self) /* is_ok on <self:HashSetIterator[Object]>*/;
3250 if (!var1) {
3251 fprintf(stderr, "Runtime error: %s", "Assert failed");
3252 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 461);
3253 show_backtrace(1);
3254 }
3255 var2 = self->attrs[COLOR_hash_collection__HashSetIterator___node].val; /* _node on <self:HashSetIterator[Object]> */
3256 if (var2 == NULL) {
3257 fprintf(stderr, "Runtime error: %s", "Reciever is null");
3258 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 462);
3259 show_backtrace(1);
3260 }
3261 var3 = var2->attrs[COLOR_hash_collection__HashNode___key].val; /* _key on <var2:nullable HashSetNode[Object]> */
3262 if (var3 == NULL) {
3263 fprintf(stderr, "Runtime error: %s", "Uninitialized attribute _key");
3264 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 462);
3265 show_backtrace(1);
3266 }
3267 var = var3;
3268 goto RET_LABEL;
3269 RET_LABEL:;
3270 return var;
3271 }
3272 /* method hash_collection#HashSetIterator#item for (self: Object): nullable Object */
3273 val* VIRTUAL_hash_collection__HashSetIterator__item(val* self) {
3274 val* var /* : nullable Object */;
3275 val* var1 /* : Object */;
3276 var1 = hash_collection__HashSetIterator__item(self);
3277 var = var1;
3278 RET_LABEL:;
3279 return var;
3280 }
3281 /* method hash_collection#HashSetIterator#next for (self: HashSetIterator[Object]) */
3282 void hash_collection__HashSetIterator__next(val* self) {
3283 short int var /* : Bool */;
3284 val* var1 /* : nullable HashSetNode[Object] */;
3285 val* var2 /* : nullable HashNode[Object] */;
3286 var = ((short int (*)(val*))(self->class->vft[COLOR_abstract_collection__Iterator__is_ok]))(self) /* is_ok on <self:HashSetIterator[Object]>*/;
3287 if (!var) {
3288 fprintf(stderr, "Runtime error: %s", "Assert failed");
3289 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 467);
3290 show_backtrace(1);
3291 }
3292 var1 = self->attrs[COLOR_hash_collection__HashSetIterator___node].val; /* _node on <self:HashSetIterator[Object]> */
3293 if (var1 == NULL) {
3294 fprintf(stderr, "Runtime error: %s", "Reciever is null");
3295 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 468);
3296 show_backtrace(1);
3297 }
3298 var2 = var1->attrs[COLOR_hash_collection__HashNode___next_item].val; /* _next_item on <var1:nullable HashSetNode[Object]> */
3299 self->attrs[COLOR_hash_collection__HashSetIterator___node].val = var2; /* _node on <self:HashSetIterator[Object]> */
3300 RET_LABEL:;
3301 }
3302 /* method hash_collection#HashSetIterator#next for (self: Object) */
3303 void VIRTUAL_hash_collection__HashSetIterator__next(val* self) {
3304 hash_collection__HashSetIterator__next(self);
3305 RET_LABEL:;
3306 }
3307 /* method hash_collection#HashSetIterator#init for (self: HashSetIterator[Object], HashSet[Object]) */
3308 void hash_collection__HashSetIterator__init(val* self, val* p0) {
3309 short int var /* : Bool */;
3310 int cltype;
3311 int idtype;
3312 const struct type* type_struct;
3313 const char* var_class_name;
3314 val* var_set /* var set: HashSet[Object] */;
3315 val* var1 /* : nullable HashNode[Object] */;
3316 /* Covariant cast for argument 0 (set) <p0:HashSet[Object]> isa HashSet[HashSetIterator#0] */
3317 /* <p0:HashSet[Object]> isa HashSet[HashSetIterator#0] */
3318 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashSethash_collection__HashSetIterator_FT0];
3319 cltype = type_struct->color;
3320 idtype = type_struct->id;
3321 if(cltype >= p0->type->table_size) {
3322 var = 0;
3323 } else {
3324 var = p0->type->type_table[cltype] == idtype;
3325 }
3326 if (!var) {
3327 var_class_name = p0 == NULL ? "null" : p0->type->name;
3328 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashSet[HashSetIterator#0]", var_class_name);
3329 fprintf(stderr, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 477);
3330 show_backtrace(1);
3331 }
3332 var_set = p0;
3333 self->attrs[COLOR_hash_collection__HashSetIterator___set].val = var_set; /* _set on <self:HashSetIterator[Object]> */
3334 var1 = var_set->attrs[COLOR_hash_collection__HashCollection___first_item].val; /* _first_item on <var_set:HashSet[Object]> */
3335 self->attrs[COLOR_hash_collection__HashSetIterator___node].val = var1; /* _node on <self:HashSetIterator[Object]> */
3336 RET_LABEL:;
3337 }
3338 /* method hash_collection#HashSetIterator#init for (self: Object, HashSet[Object]) */
3339 void VIRTUAL_hash_collection__HashSetIterator__init(val* self, val* p0) {
3340 hash_collection__HashSetIterator__init(self, p0);
3341 RET_LABEL:;
3342 }