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