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