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