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