c_src: update for kill is
[nit.git] / c_src / more_collections.sep.1.c
1 #include "more_collections.sep.0.h"
2 /* method more_collections#MultiHashMap#add_one for (self: MultiHashMap[Object, nullable Object], Object, nullable Object) */
3 void more_collections__MultiHashMap__add_one(val* self, val* p0, val* p1) {
4 short int var /* : Bool */;
5 int cltype;
6 int idtype;
7 const struct type* type_struct;
8 const char* var_class_name;
9 short int var1 /* : Bool */;
10 int cltype2;
11 int idtype3;
12 const struct type* type_struct4;
13 short int is_nullable;
14 const char* var_class_name5;
15 val* var_k /* var k: Object */;
16 val* var_v /* var v: nullable Object */;
17 short int var6 /* : Bool */;
18 val* var7 /* : nullable Object */;
19 val* var8 /* : Array[nullable Object] */;
20 long var9 /* : Int */;
21 val* var10 /* : NativeArray[nullable Object] */;
22 /* Covariant cast for argument 0 (k) <p0:Object> isa MultiHashMap#0 */
23 /* <p0:Object> isa MultiHashMap#0 */
24 type_struct = self->type->resolution_table->types[COLOR_more_collections__MultiHashMap_FT0];
25 cltype = type_struct->color;
26 idtype = type_struct->id;
27 if(cltype >= p0->type->table_size) {
28 var = 0;
29 } else {
30 var = p0->type->type_table[cltype] == idtype;
31 }
32 if (!var) {
33 var_class_name = p0 == NULL ? "null" : p0->type->name;
34 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "MultiHashMap#0", var_class_name);
35 fprintf(stderr, " (%s:%d)\n", "lib/more_collections.nit", 22);
36 exit(1);
37 }
38 /* Covariant cast for argument 1 (v) <p1:nullable Object> isa MultiHashMap#1 */
39 /* <p1:nullable Object> isa MultiHashMap#1 */
40 type_struct4 = self->type->resolution_table->types[COLOR_more_collections__MultiHashMap_FT1];
41 cltype2 = type_struct4->color;
42 idtype3 = type_struct4->id;
43 is_nullable = type_struct4->is_nullable;
44 if(p1 == NULL) {
45 var1 = is_nullable;
46 } else {
47 if(cltype2 >= p1->type->table_size) {
48 var1 = 0;
49 } else {
50 var1 = p1->type->type_table[cltype2] == idtype3;
51 }
52 }
53 if (!var1) {
54 var_class_name5 = p1 == NULL ? "null" : p1->type->name;
55 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "MultiHashMap#1", var_class_name5);
56 fprintf(stderr, " (%s:%d)\n", "lib/more_collections.nit", 22);
57 exit(1);
58 }
59 var_k = p0;
60 var_v = p1;
61 var6 = ((short int (*)(val*, val*))(self->class->vft[COLOR_abstract_collection__MapRead__has_key]))(self, var_k) /* has_key on <self:MultiHashMap[Object, nullable Object]>*/;
62 if (var6){
63 var7 = ((val* (*)(val*, val*))(self->class->vft[COLOR_abstract_collection__MapRead___91d_93d]))(self, var_k) /* [] on <self:MultiHashMap[Object, nullable Object]>*/;
64 ((void (*)(val*, val*))(var7->class->vft[COLOR_abstract_collection__SimpleCollection__add]))(var7, var_v) /* add on <var7:nullable Object(Array[nullable Object])>*/;
65 } else {
66 var8 = NEW_array__Array(self->type->resolution_table->types[COLOR_array__Arraymore_collections__MultiHashMap_FT1]);
67 { /* var8 = array_instance Array[MultiHashMap#1] */
68 var9 = 1;
69 var10 = NEW_array__NativeArray(var9, self->type->resolution_table->types[COLOR_array__NativeArraymore_collections__MultiHashMap_FT1]);
70 ((struct instance_array__NativeArray*)var10)->values[0] = (val*) var_v;
71 ((void (*)(val*, val*, long))(var8->class->vft[COLOR_array__Array__with_native]))(var8, var10, var9) /* with_native on <var8:Array[nullable Object]>*/;
72 CHECK_NEW_array__Array(var8);
73 }
74 ((void (*)(val*, val*, val*))(self->class->vft[COLOR_abstract_collection__Map___91d_93d_61d]))(self, var_k, var8) /* []= on <self:MultiHashMap[Object, nullable Object]>*/;
75 }
76 RET_LABEL:;
77 }
78 /* method more_collections#MultiHashMap#add_one for (self: Object, Object, nullable Object) */
79 void VIRTUAL_more_collections__MultiHashMap__add_one(val* self, val* p0, val* p1) {
80 more_collections__MultiHashMap__add_one(self, p0, p1);
81 RET_LABEL:;
82 }
83 /* method more_collections#MultiHashMap#init for (self: MultiHashMap[Object, nullable Object]) */
84 void more_collections__MultiHashMap__init(val* self) {
85 ((void (*)(val*))(self->class->vft[COLOR_hash_collection__HashMap__init]))(self) /* init on <self:MultiHashMap[Object, nullable Object]>*/;
86 RET_LABEL:;
87 }
88 /* method more_collections#MultiHashMap#init for (self: Object) */
89 void VIRTUAL_more_collections__MultiHashMap__init(val* self) {
90 more_collections__MultiHashMap__init(self);
91 RET_LABEL:;
92 }
93 /* method more_collections#HashMap2#level1 for (self: HashMap2[Object, Object, nullable Object]): HashMap[Object, HashMap[Object, nullable Object]] */
94 val* more_collections__HashMap2__level1(val* self) {
95 val* var /* : HashMap[Object, HashMap[Object, nullable Object]] */;
96 val* var1 /* : HashMap[Object, HashMap[Object, nullable Object]] */;
97 var1 = self->attrs[COLOR_more_collections__HashMap2___64dlevel1].val; /* @level1 on <self:HashMap2[Object, Object, nullable Object]> */
98 if (var1 == NULL) {
99 fprintf(stderr, "Runtime error: %s", "Uninitialized attribute @level1");
100 fprintf(stderr, " (%s:%d)\n", "lib/more_collections.nit", 38);
101 exit(1);
102 }
103 var = var1;
104 RET_LABEL:;
105 return var;
106 }
107 /* method more_collections#HashMap2#level1 for (self: Object): HashMap[Object, HashMap[Object, nullable Object]] */
108 val* VIRTUAL_more_collections__HashMap2__level1(val* self) {
109 val* var /* : HashMap[Object, HashMap[Object, nullable Object]] */;
110 val* var1 /* : HashMap[Object, HashMap[Object, nullable Object]] */;
111 var1 = more_collections__HashMap2__level1(self);
112 var = var1;
113 RET_LABEL:;
114 return var;
115 }
116 /* method more_collections#HashMap2#level1= for (self: HashMap2[Object, Object, nullable Object], HashMap[Object, HashMap[Object, nullable Object]]) */
117 void more_collections__HashMap2__level1_61d(val* self, val* p0) {
118 short int var /* : Bool */;
119 int cltype;
120 int idtype;
121 const struct type* type_struct;
122 const char* var_class_name;
123 /* Covariant cast for argument 0 (level1) <p0:HashMap[Object, HashMap[Object, nullable Object]]> isa HashMap[HashMap2#0, HashMap[HashMap2#1, HashMap2#2]] */
124 /* <p0:HashMap[Object, HashMap[Object, nullable Object]]> isa HashMap[HashMap2#0, HashMap[HashMap2#1, HashMap2#2]] */
125 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashMapmore_collections__HashMap2_FT0hash_collection__HashMapmore_collections__HashMap2_FT1more_collections__HashMap2_FT2];
126 cltype = type_struct->color;
127 idtype = type_struct->id;
128 if(cltype >= p0->type->table_size) {
129 var = 0;
130 } else {
131 var = p0->type->type_table[cltype] == idtype;
132 }
133 if (!var) {
134 var_class_name = p0 == NULL ? "null" : p0->type->name;
135 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap[HashMap2#0, HashMap[HashMap2#1, HashMap2#2]]", var_class_name);
136 fprintf(stderr, " (%s:%d)\n", "lib/more_collections.nit", 38);
137 exit(1);
138 }
139 self->attrs[COLOR_more_collections__HashMap2___64dlevel1].val = p0; /* @level1 on <self:HashMap2[Object, Object, nullable Object]> */
140 RET_LABEL:;
141 }
142 /* method more_collections#HashMap2#level1= for (self: Object, HashMap[Object, HashMap[Object, nullable Object]]) */
143 void VIRTUAL_more_collections__HashMap2__level1_61d(val* self, val* p0) {
144 more_collections__HashMap2__level1_61d(self, p0);
145 RET_LABEL:;
146 }
147 /* method more_collections#HashMap2#[] for (self: HashMap2[Object, Object, nullable Object], Object, Object): nullable Object */
148 val* more_collections__HashMap2___91d_93d(val* self, val* p0, val* p1) {
149 val* var /* : nullable Object */;
150 short int var1 /* : Bool */;
151 int cltype;
152 int idtype;
153 const struct type* type_struct;
154 const char* var_class_name;
155 short int var2 /* : Bool */;
156 int cltype3;
157 int idtype4;
158 const struct type* type_struct5;
159 const char* var_class_name6;
160 val* var_k1 /* var k1: Object */;
161 val* var_k2 /* var k2: Object */;
162 val* var7 /* : HashMap[Object, HashMap[Object, nullable Object]] */;
163 val* var_level1 /* var level1: HashMap[Object, HashMap[Object, nullable Object]] */;
164 short int var8 /* : Bool */;
165 short int var9 /* : Bool */;
166 val* var10 /* : null */;
167 val* var11 /* : nullable Object */;
168 val* var_level2 /* var level2: HashMap[Object, nullable Object] */;
169 short int var12 /* : Bool */;
170 short int var13 /* : Bool */;
171 val* var14 /* : null */;
172 val* var15 /* : nullable Object */;
173 /* Covariant cast for argument 0 (k1) <p0:Object> isa HashMap2#0 */
174 /* <p0:Object> isa HashMap2#0 */
175 type_struct = self->type->resolution_table->types[COLOR_more_collections__HashMap2_FT0];
176 cltype = type_struct->color;
177 idtype = type_struct->id;
178 if(cltype >= p0->type->table_size) {
179 var1 = 0;
180 } else {
181 var1 = p0->type->type_table[cltype] == idtype;
182 }
183 if (!var1) {
184 var_class_name = p0 == NULL ? "null" : p0->type->name;
185 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap2#0", var_class_name);
186 fprintf(stderr, " (%s:%d)\n", "lib/more_collections.nit", 40);
187 exit(1);
188 }
189 /* Covariant cast for argument 1 (k2) <p1:Object> isa HashMap2#1 */
190 /* <p1:Object> isa HashMap2#1 */
191 type_struct5 = self->type->resolution_table->types[COLOR_more_collections__HashMap2_FT1];
192 cltype3 = type_struct5->color;
193 idtype4 = type_struct5->id;
194 if(cltype3 >= p1->type->table_size) {
195 var2 = 0;
196 } else {
197 var2 = p1->type->type_table[cltype3] == idtype4;
198 }
199 if (!var2) {
200 var_class_name6 = p1 == NULL ? "null" : p1->type->name;
201 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap2#1", var_class_name6);
202 fprintf(stderr, " (%s:%d)\n", "lib/more_collections.nit", 40);
203 exit(1);
204 }
205 var_k1 = p0;
206 var_k2 = p1;
207 var7 = ((val* (*)(val*))(self->class->vft[COLOR_more_collections__HashMap2__level1]))(self) /* level1 on <self:HashMap2[Object, Object, nullable Object]>*/;
208 var_level1 = var7;
209 var8 = ((short int (*)(val*, val*))(var_level1->class->vft[COLOR_abstract_collection__MapRead__has_key]))(var_level1, var_k1) /* has_key on <var_level1:HashMap[Object, HashMap[Object, nullable Object]]>*/;
210 var9 = !var8;
211 if (var9){
212 var10 = NULL;
213 var = var10;
214 goto RET_LABEL;
215 } else {
216 }
217 var11 = ((val* (*)(val*, val*))(var_level1->class->vft[COLOR_abstract_collection__MapRead___91d_93d]))(var_level1, var_k1) /* [] on <var_level1:HashMap[Object, HashMap[Object, nullable Object]]>*/;
218 var_level2 = var11;
219 var12 = ((short int (*)(val*, val*))(var_level2->class->vft[COLOR_abstract_collection__MapRead__has_key]))(var_level2, var_k2) /* has_key on <var_level2:HashMap[Object, nullable Object]>*/;
220 var13 = !var12;
221 if (var13){
222 var14 = NULL;
223 var = var14;
224 goto RET_LABEL;
225 } else {
226 }
227 var15 = ((val* (*)(val*, val*))(var_level2->class->vft[COLOR_abstract_collection__MapRead___91d_93d]))(var_level2, var_k2) /* [] on <var_level2:HashMap[Object, nullable Object]>*/;
228 var = var15;
229 goto RET_LABEL;
230 RET_LABEL:;
231 return var;
232 }
233 /* method more_collections#HashMap2#[] for (self: Object, Object, Object): nullable Object */
234 val* VIRTUAL_more_collections__HashMap2___91d_93d(val* self, val* p0, val* p1) {
235 val* var /* : nullable Object */;
236 val* var1 /* : nullable Object */;
237 var1 = more_collections__HashMap2___91d_93d(self, p0, p1);
238 var = var1;
239 RET_LABEL:;
240 return var;
241 }
242 /* method more_collections#HashMap2#[]= for (self: HashMap2[Object, Object, nullable Object], Object, Object, nullable Object) */
243 void more_collections__HashMap2___91d_93d_61d(val* self, val* p0, val* p1, val* p2) {
244 short int var /* : Bool */;
245 int cltype;
246 int idtype;
247 const struct type* type_struct;
248 const char* var_class_name;
249 short int var1 /* : Bool */;
250 int cltype2;
251 int idtype3;
252 const struct type* type_struct4;
253 const char* var_class_name5;
254 short int var6 /* : Bool */;
255 int cltype7;
256 int idtype8;
257 const struct type* type_struct9;
258 short int is_nullable;
259 const char* var_class_name10;
260 val* var_k1 /* var k1: Object */;
261 val* var_k2 /* var k2: Object */;
262 val* var_v /* var v: nullable Object */;
263 val* var11 /* : HashMap[Object, HashMap[Object, nullable Object]] */;
264 val* var_level1 /* var level1: HashMap[Object, HashMap[Object, nullable Object]] */;
265 short int var12 /* : Bool */;
266 short int var13 /* : Bool */;
267 val* var14 /* : HashMap[Object, nullable Object] */;
268 val* var_level2 /* var level2: HashMap[Object, nullable Object] */;
269 val* var15 /* : nullable Object */;
270 /* Covariant cast for argument 0 (k1) <p0:Object> isa HashMap2#0 */
271 /* <p0:Object> isa HashMap2#0 */
272 type_struct = self->type->resolution_table->types[COLOR_more_collections__HashMap2_FT0];
273 cltype = type_struct->color;
274 idtype = type_struct->id;
275 if(cltype >= p0->type->table_size) {
276 var = 0;
277 } else {
278 var = p0->type->type_table[cltype] == idtype;
279 }
280 if (!var) {
281 var_class_name = p0 == NULL ? "null" : p0->type->name;
282 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap2#0", var_class_name);
283 fprintf(stderr, " (%s:%d)\n", "lib/more_collections.nit", 51);
284 exit(1);
285 }
286 /* Covariant cast for argument 1 (k2) <p1:Object> isa HashMap2#1 */
287 /* <p1:Object> isa HashMap2#1 */
288 type_struct4 = self->type->resolution_table->types[COLOR_more_collections__HashMap2_FT1];
289 cltype2 = type_struct4->color;
290 idtype3 = type_struct4->id;
291 if(cltype2 >= p1->type->table_size) {
292 var1 = 0;
293 } else {
294 var1 = p1->type->type_table[cltype2] == idtype3;
295 }
296 if (!var1) {
297 var_class_name5 = p1 == NULL ? "null" : p1->type->name;
298 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap2#1", var_class_name5);
299 fprintf(stderr, " (%s:%d)\n", "lib/more_collections.nit", 51);
300 exit(1);
301 }
302 /* Covariant cast for argument 2 (v) <p2:nullable Object> isa HashMap2#2 */
303 /* <p2:nullable Object> isa HashMap2#2 */
304 type_struct9 = self->type->resolution_table->types[COLOR_more_collections__HashMap2_FT2];
305 cltype7 = type_struct9->color;
306 idtype8 = type_struct9->id;
307 is_nullable = type_struct9->is_nullable;
308 if(p2 == NULL) {
309 var6 = is_nullable;
310 } else {
311 if(cltype7 >= p2->type->table_size) {
312 var6 = 0;
313 } else {
314 var6 = p2->type->type_table[cltype7] == idtype8;
315 }
316 }
317 if (!var6) {
318 var_class_name10 = p2 == NULL ? "null" : p2->type->name;
319 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap2#2", var_class_name10);
320 fprintf(stderr, " (%s:%d)\n", "lib/more_collections.nit", 51);
321 exit(1);
322 }
323 var_k1 = p0;
324 var_k2 = p1;
325 var_v = p2;
326 var11 = ((val* (*)(val*))(self->class->vft[COLOR_more_collections__HashMap2__level1]))(self) /* level1 on <self:HashMap2[Object, Object, nullable Object]>*/;
327 var_level1 = var11;
328 var12 = ((short int (*)(val*, val*))(var_level1->class->vft[COLOR_abstract_collection__MapRead__has_key]))(var_level1, var_k1) /* has_key on <var_level1:HashMap[Object, HashMap[Object, nullable Object]]>*/;
329 var13 = !var12;
330 if (var13){
331 var14 = NEW_hash_collection__HashMap(self->type->resolution_table->types[COLOR_hash_collection__HashMapmore_collections__HashMap2_FT1more_collections__HashMap2_FT2]);
332 ((void (*)(val*))(var14->class->vft[COLOR_hash_collection__HashMap__init]))(var14) /* init on <var14:HashMap[Object, nullable Object]>*/;
333 CHECK_NEW_hash_collection__HashMap(var14);
334 var_level2 = var14;
335 ((void (*)(val*, val*, val*))(var_level1->class->vft[COLOR_abstract_collection__Map___91d_93d_61d]))(var_level1, var_k1, var_level2) /* []= on <var_level1:HashMap[Object, HashMap[Object, nullable Object]]>*/;
336 } else {
337 var15 = ((val* (*)(val*, val*))(var_level1->class->vft[COLOR_abstract_collection__MapRead___91d_93d]))(var_level1, var_k1) /* [] on <var_level1:HashMap[Object, HashMap[Object, nullable Object]]>*/;
338 var_level2 = var15;
339 }
340 ((void (*)(val*, val*, val*))(var_level2->class->vft[COLOR_abstract_collection__Map___91d_93d_61d]))(var_level2, var_k2, var_v) /* []= on <var_level2:HashMap[Object, nullable Object]>*/;
341 RET_LABEL:;
342 }
343 /* method more_collections#HashMap2#[]= for (self: Object, Object, Object, nullable Object) */
344 void VIRTUAL_more_collections__HashMap2___91d_93d_61d(val* self, val* p0, val* p1, val* p2) {
345 more_collections__HashMap2___91d_93d_61d(self, p0, p1, p2);
346 RET_LABEL:;
347 }
348 /* method more_collections#HashMap2#init for (self: HashMap2[Object, Object, nullable Object]) */
349 void more_collections__HashMap2__init(val* self) {
350 RET_LABEL:;
351 }
352 /* method more_collections#HashMap2#init for (self: Object) */
353 void VIRTUAL_more_collections__HashMap2__init(val* self) {
354 more_collections__HashMap2__init(self);
355 RET_LABEL:;
356 }
357 /* method more_collections#HashMap3#level1 for (self: HashMap3[Object, Object, Object, nullable Object]): HashMap[Object, HashMap2[Object, Object, nullable Object]] */
358 val* more_collections__HashMap3__level1(val* self) {
359 val* var /* : HashMap[Object, HashMap2[Object, Object, nullable Object]] */;
360 val* var1 /* : HashMap[Object, HashMap2[Object, Object, nullable Object]] */;
361 var1 = self->attrs[COLOR_more_collections__HashMap3___64dlevel1].val; /* @level1 on <self:HashMap3[Object, Object, Object, nullable Object]> */
362 if (var1 == NULL) {
363 fprintf(stderr, "Runtime error: %s", "Uninitialized attribute @level1");
364 fprintf(stderr, " (%s:%d)\n", "lib/more_collections.nit", 68);
365 exit(1);
366 }
367 var = var1;
368 RET_LABEL:;
369 return var;
370 }
371 /* method more_collections#HashMap3#level1 for (self: Object): HashMap[Object, HashMap2[Object, Object, nullable Object]] */
372 val* VIRTUAL_more_collections__HashMap3__level1(val* self) {
373 val* var /* : HashMap[Object, HashMap2[Object, Object, nullable Object]] */;
374 val* var1 /* : HashMap[Object, HashMap2[Object, Object, nullable Object]] */;
375 var1 = more_collections__HashMap3__level1(self);
376 var = var1;
377 RET_LABEL:;
378 return var;
379 }
380 /* method more_collections#HashMap3#level1= for (self: HashMap3[Object, Object, Object, nullable Object], HashMap[Object, HashMap2[Object, Object, nullable Object]]) */
381 void more_collections__HashMap3__level1_61d(val* self, val* p0) {
382 short int var /* : Bool */;
383 int cltype;
384 int idtype;
385 const struct type* type_struct;
386 const char* var_class_name;
387 /* Covariant cast for argument 0 (level1) <p0:HashMap[Object, HashMap2[Object, Object, nullable Object]]> isa HashMap[HashMap3#0, HashMap2[HashMap3#1, HashMap3#2, HashMap3#3]] */
388 /* <p0:HashMap[Object, HashMap2[Object, Object, nullable Object]]> isa HashMap[HashMap3#0, HashMap2[HashMap3#1, HashMap3#2, HashMap3#3]] */
389 type_struct = self->type->resolution_table->types[COLOR_hash_collection__HashMapmore_collections__HashMap3_FT0more_collections__HashMap2more_collections__HashMap3_FT1more_collections__HashMap3_FT2more_collections__HashMap3_FT3];
390 cltype = type_struct->color;
391 idtype = type_struct->id;
392 if(cltype >= p0->type->table_size) {
393 var = 0;
394 } else {
395 var = p0->type->type_table[cltype] == idtype;
396 }
397 if (!var) {
398 var_class_name = p0 == NULL ? "null" : p0->type->name;
399 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap[HashMap3#0, HashMap2[HashMap3#1, HashMap3#2, HashMap3#3]]", var_class_name);
400 fprintf(stderr, " (%s:%d)\n", "lib/more_collections.nit", 68);
401 exit(1);
402 }
403 self->attrs[COLOR_more_collections__HashMap3___64dlevel1].val = p0; /* @level1 on <self:HashMap3[Object, Object, Object, nullable Object]> */
404 RET_LABEL:;
405 }
406 /* method more_collections#HashMap3#level1= for (self: Object, HashMap[Object, HashMap2[Object, Object, nullable Object]]) */
407 void VIRTUAL_more_collections__HashMap3__level1_61d(val* self, val* p0) {
408 more_collections__HashMap3__level1_61d(self, p0);
409 RET_LABEL:;
410 }
411 /* method more_collections#HashMap3#[] for (self: HashMap3[Object, Object, Object, nullable Object], Object, Object, Object): nullable Object */
412 val* more_collections__HashMap3___91d_93d(val* self, val* p0, val* p1, val* p2) {
413 val* var /* : nullable Object */;
414 short int var1 /* : Bool */;
415 int cltype;
416 int idtype;
417 const struct type* type_struct;
418 const char* var_class_name;
419 short int var2 /* : Bool */;
420 int cltype3;
421 int idtype4;
422 const struct type* type_struct5;
423 const char* var_class_name6;
424 short int var7 /* : Bool */;
425 int cltype8;
426 int idtype9;
427 const struct type* type_struct10;
428 const char* var_class_name11;
429 val* var_k1 /* var k1: Object */;
430 val* var_k2 /* var k2: Object */;
431 val* var_k3 /* var k3: Object */;
432 val* var12 /* : HashMap[Object, HashMap2[Object, Object, nullable Object]] */;
433 val* var_level1 /* var level1: HashMap[Object, HashMap2[Object, Object, nullable Object]] */;
434 short int var13 /* : Bool */;
435 short int var14 /* : Bool */;
436 val* var15 /* : null */;
437 val* var16 /* : nullable Object */;
438 val* var_level2 /* var level2: HashMap2[Object, Object, nullable Object] */;
439 val* var17 /* : nullable Object */;
440 /* Covariant cast for argument 0 (k1) <p0:Object> isa HashMap3#0 */
441 /* <p0:Object> isa HashMap3#0 */
442 type_struct = self->type->resolution_table->types[COLOR_more_collections__HashMap3_FT0];
443 cltype = type_struct->color;
444 idtype = type_struct->id;
445 if(cltype >= p0->type->table_size) {
446 var1 = 0;
447 } else {
448 var1 = p0->type->type_table[cltype] == idtype;
449 }
450 if (!var1) {
451 var_class_name = p0 == NULL ? "null" : p0->type->name;
452 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap3#0", var_class_name);
453 fprintf(stderr, " (%s:%d)\n", "lib/more_collections.nit", 70);
454 exit(1);
455 }
456 /* Covariant cast for argument 1 (k2) <p1:Object> isa HashMap3#1 */
457 /* <p1:Object> isa HashMap3#1 */
458 type_struct5 = self->type->resolution_table->types[COLOR_more_collections__HashMap3_FT1];
459 cltype3 = type_struct5->color;
460 idtype4 = type_struct5->id;
461 if(cltype3 >= p1->type->table_size) {
462 var2 = 0;
463 } else {
464 var2 = p1->type->type_table[cltype3] == idtype4;
465 }
466 if (!var2) {
467 var_class_name6 = p1 == NULL ? "null" : p1->type->name;
468 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap3#1", var_class_name6);
469 fprintf(stderr, " (%s:%d)\n", "lib/more_collections.nit", 70);
470 exit(1);
471 }
472 /* Covariant cast for argument 2 (k3) <p2:Object> isa HashMap3#2 */
473 /* <p2:Object> isa HashMap3#2 */
474 type_struct10 = self->type->resolution_table->types[COLOR_more_collections__HashMap3_FT2];
475 cltype8 = type_struct10->color;
476 idtype9 = type_struct10->id;
477 if(cltype8 >= p2->type->table_size) {
478 var7 = 0;
479 } else {
480 var7 = p2->type->type_table[cltype8] == idtype9;
481 }
482 if (!var7) {
483 var_class_name11 = p2 == NULL ? "null" : p2->type->name;
484 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap3#2", var_class_name11);
485 fprintf(stderr, " (%s:%d)\n", "lib/more_collections.nit", 70);
486 exit(1);
487 }
488 var_k1 = p0;
489 var_k2 = p1;
490 var_k3 = p2;
491 var12 = ((val* (*)(val*))(self->class->vft[COLOR_more_collections__HashMap3__level1]))(self) /* level1 on <self:HashMap3[Object, Object, Object, nullable Object]>*/;
492 var_level1 = var12;
493 var13 = ((short int (*)(val*, val*))(var_level1->class->vft[COLOR_abstract_collection__MapRead__has_key]))(var_level1, var_k1) /* has_key on <var_level1:HashMap[Object, HashMap2[Object, Object, nullable Object]]>*/;
494 var14 = !var13;
495 if (var14){
496 var15 = NULL;
497 var = var15;
498 goto RET_LABEL;
499 } else {
500 }
501 var16 = ((val* (*)(val*, val*))(var_level1->class->vft[COLOR_abstract_collection__MapRead___91d_93d]))(var_level1, var_k1) /* [] on <var_level1:HashMap[Object, HashMap2[Object, Object, nullable Object]]>*/;
502 var_level2 = var16;
503 var17 = ((val* (*)(val*, val*, val*))(var_level2->class->vft[COLOR_more_collections__HashMap2___91d_93d]))(var_level2, var_k2, var_k3) /* [] on <var_level2:HashMap2[Object, Object, nullable Object]>*/;
504 var = var17;
505 goto RET_LABEL;
506 RET_LABEL:;
507 return var;
508 }
509 /* method more_collections#HashMap3#[] for (self: Object, Object, Object, Object): nullable Object */
510 val* VIRTUAL_more_collections__HashMap3___91d_93d(val* self, val* p0, val* p1, val* p2) {
511 val* var /* : nullable Object */;
512 val* var1 /* : nullable Object */;
513 var1 = more_collections__HashMap3___91d_93d(self, p0, p1, p2);
514 var = var1;
515 RET_LABEL:;
516 return var;
517 }
518 /* method more_collections#HashMap3#[]= for (self: HashMap3[Object, Object, Object, nullable Object], Object, Object, Object, nullable Object) */
519 void more_collections__HashMap3___91d_93d_61d(val* self, val* p0, val* p1, val* p2, val* p3) {
520 short int var /* : Bool */;
521 int cltype;
522 int idtype;
523 const struct type* type_struct;
524 const char* var_class_name;
525 short int var1 /* : Bool */;
526 int cltype2;
527 int idtype3;
528 const struct type* type_struct4;
529 const char* var_class_name5;
530 short int var6 /* : Bool */;
531 int cltype7;
532 int idtype8;
533 const struct type* type_struct9;
534 const char* var_class_name10;
535 short int var11 /* : Bool */;
536 int cltype12;
537 int idtype13;
538 const struct type* type_struct14;
539 short int is_nullable;
540 const char* var_class_name15;
541 val* var_k1 /* var k1: Object */;
542 val* var_k2 /* var k2: Object */;
543 val* var_k3 /* var k3: Object */;
544 val* var_v /* var v: nullable Object */;
545 val* var16 /* : HashMap[Object, HashMap2[Object, Object, nullable Object]] */;
546 val* var_level1 /* var level1: HashMap[Object, HashMap2[Object, Object, nullable Object]] */;
547 short int var17 /* : Bool */;
548 short int var18 /* : Bool */;
549 val* var19 /* : HashMap2[Object, Object, nullable Object] */;
550 val* var_level2 /* var level2: HashMap2[Object, Object, nullable Object] */;
551 val* var20 /* : nullable Object */;
552 /* Covariant cast for argument 0 (k1) <p0:Object> isa HashMap3#0 */
553 /* <p0:Object> isa HashMap3#0 */
554 type_struct = self->type->resolution_table->types[COLOR_more_collections__HashMap3_FT0];
555 cltype = type_struct->color;
556 idtype = type_struct->id;
557 if(cltype >= p0->type->table_size) {
558 var = 0;
559 } else {
560 var = p0->type->type_table[cltype] == idtype;
561 }
562 if (!var) {
563 var_class_name = p0 == NULL ? "null" : p0->type->name;
564 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap3#0", var_class_name);
565 fprintf(stderr, " (%s:%d)\n", "lib/more_collections.nit", 80);
566 exit(1);
567 }
568 /* Covariant cast for argument 1 (k2) <p1:Object> isa HashMap3#1 */
569 /* <p1:Object> isa HashMap3#1 */
570 type_struct4 = self->type->resolution_table->types[COLOR_more_collections__HashMap3_FT1];
571 cltype2 = type_struct4->color;
572 idtype3 = type_struct4->id;
573 if(cltype2 >= p1->type->table_size) {
574 var1 = 0;
575 } else {
576 var1 = p1->type->type_table[cltype2] == idtype3;
577 }
578 if (!var1) {
579 var_class_name5 = p1 == NULL ? "null" : p1->type->name;
580 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap3#1", var_class_name5);
581 fprintf(stderr, " (%s:%d)\n", "lib/more_collections.nit", 80);
582 exit(1);
583 }
584 /* Covariant cast for argument 2 (k3) <p2:Object> isa HashMap3#2 */
585 /* <p2:Object> isa HashMap3#2 */
586 type_struct9 = self->type->resolution_table->types[COLOR_more_collections__HashMap3_FT2];
587 cltype7 = type_struct9->color;
588 idtype8 = type_struct9->id;
589 if(cltype7 >= p2->type->table_size) {
590 var6 = 0;
591 } else {
592 var6 = p2->type->type_table[cltype7] == idtype8;
593 }
594 if (!var6) {
595 var_class_name10 = p2 == NULL ? "null" : p2->type->name;
596 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap3#2", var_class_name10);
597 fprintf(stderr, " (%s:%d)\n", "lib/more_collections.nit", 80);
598 exit(1);
599 }
600 /* Covariant cast for argument 3 (v) <p3:nullable Object> isa HashMap3#3 */
601 /* <p3:nullable Object> isa HashMap3#3 */
602 type_struct14 = self->type->resolution_table->types[COLOR_more_collections__HashMap3_FT3];
603 cltype12 = type_struct14->color;
604 idtype13 = type_struct14->id;
605 is_nullable = type_struct14->is_nullable;
606 if(p3 == NULL) {
607 var11 = is_nullable;
608 } else {
609 if(cltype12 >= p3->type->table_size) {
610 var11 = 0;
611 } else {
612 var11 = p3->type->type_table[cltype12] == idtype13;
613 }
614 }
615 if (!var11) {
616 var_class_name15 = p3 == NULL ? "null" : p3->type->name;
617 fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap3#3", var_class_name15);
618 fprintf(stderr, " (%s:%d)\n", "lib/more_collections.nit", 80);
619 exit(1);
620 }
621 var_k1 = p0;
622 var_k2 = p1;
623 var_k3 = p2;
624 var_v = p3;
625 var16 = ((val* (*)(val*))(self->class->vft[COLOR_more_collections__HashMap3__level1]))(self) /* level1 on <self:HashMap3[Object, Object, Object, nullable Object]>*/;
626 var_level1 = var16;
627 var17 = ((short int (*)(val*, val*))(var_level1->class->vft[COLOR_abstract_collection__MapRead__has_key]))(var_level1, var_k1) /* has_key on <var_level1:HashMap[Object, HashMap2[Object, Object, nullable Object]]>*/;
628 var18 = !var17;
629 if (var18){
630 var19 = NEW_more_collections__HashMap2(self->type->resolution_table->types[COLOR_more_collections__HashMap2more_collections__HashMap3_FT1more_collections__HashMap3_FT2more_collections__HashMap3_FT3]);
631 ((void (*)(val*))(var19->class->vft[COLOR_more_collections__HashMap2__init]))(var19) /* init on <var19:HashMap2[Object, Object, nullable Object]>*/;
632 CHECK_NEW_more_collections__HashMap2(var19);
633 var_level2 = var19;
634 ((void (*)(val*, val*, val*))(var_level1->class->vft[COLOR_abstract_collection__Map___91d_93d_61d]))(var_level1, var_k1, var_level2) /* []= on <var_level1:HashMap[Object, HashMap2[Object, Object, nullable Object]]>*/;
635 } else {
636 var20 = ((val* (*)(val*, val*))(var_level1->class->vft[COLOR_abstract_collection__MapRead___91d_93d]))(var_level1, var_k1) /* [] on <var_level1:HashMap[Object, HashMap2[Object, Object, nullable Object]]>*/;
637 var_level2 = var20;
638 }
639 ((void (*)(val*, val*, val*, val*))(var_level2->class->vft[COLOR_more_collections__HashMap2___91d_93d_61d]))(var_level2, var_k2, var_k3, var_v) /* []= on <var_level2:HashMap2[Object, Object, nullable Object]>*/;
640 RET_LABEL:;
641 }
642 /* method more_collections#HashMap3#[]= for (self: Object, Object, Object, Object, nullable Object) */
643 void VIRTUAL_more_collections__HashMap3___91d_93d_61d(val* self, val* p0, val* p1, val* p2, val* p3) {
644 more_collections__HashMap3___91d_93d_61d(self, p0, p1, p2, p3);
645 RET_LABEL:;
646 }
647 /* method more_collections#HashMap3#init for (self: HashMap3[Object, Object, Object, nullable Object]) */
648 void more_collections__HashMap3__init(val* self) {
649 RET_LABEL:;
650 }
651 /* method more_collections#HashMap3#init for (self: Object) */
652 void VIRTUAL_more_collections__HashMap3__init(val* self) {
653 more_collections__HashMap3__init(self);
654 RET_LABEL:;
655 }