README: document nit_env.sh
[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[nullable Object, nullable Object], nullable Object, nullable Object) */
3 void more_collections___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 is_nullable;
9 const char* var_class_name;
10 short int var1 /* : Bool */;
11 int cltype2;
12 int idtype3;
13 const struct type* type_struct4;
14 short int is_nullable5;
15 const char* var_class_name6;
16 val* var_k /* var k: nullable Object */;
17 val* var_v /* var v: nullable Object */;
18 val* var7 /* : nullable Object */;
19 val* var_x /* var x: nullable Array[nullable Object] */;
20 short int var8 /* : Bool */;
21 short int var9 /* : Bool */;
22 val* var_other /* var other: nullable Object */;
23 short int var11 /* : Bool */;
24 short int var12 /* : Bool */;
25 val* var13 /* : Array[nullable Object] */;
26 val* var_ /* var : Array[nullable Object] */;
27 /* Covariant cast for argument 0 (k) <p0:nullable Object> isa K */
28 /* <p0:nullable Object> isa K */
29 type_struct = self->type->resolution_table->types[COLOR_more_collections__MultiHashMap___35dK];
30 cltype = type_struct->color;
31 idtype = type_struct->id;
32 is_nullable = type_struct->is_nullable;
33 if(p0 == NULL) {
34 var = is_nullable;
35 } else {
36 if(cltype >= (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->table_size) {
37 var = 0;
38 } else {
39 var = (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->type_table[cltype] == idtype;
40 }
41 }
42 if (unlikely(!var)) {
43 var_class_name = p0 == NULL ? "null" : (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->name;
44 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "K", var_class_name);
45 PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 37);
46 fatal_exit(1);
47 }
48 /* Covariant cast for argument 1 (v) <p1:nullable Object> isa V */
49 /* <p1:nullable Object> isa V */
50 type_struct4 = self->type->resolution_table->types[COLOR_more_collections__MultiHashMap___35dV];
51 cltype2 = type_struct4->color;
52 idtype3 = type_struct4->id;
53 is_nullable5 = type_struct4->is_nullable;
54 if(p1 == NULL) {
55 var1 = is_nullable5;
56 } else {
57 if(cltype2 >= (((long)p1&3)?type_info[((long)p1&3)]:p1->type)->table_size) {
58 var1 = 0;
59 } else {
60 var1 = (((long)p1&3)?type_info[((long)p1&3)]:p1->type)->type_table[cltype2] == idtype3;
61 }
62 }
63 if (unlikely(!var1)) {
64 var_class_name6 = p1 == NULL ? "null" : (((long)p1&3)?type_info[((long)p1&3)]:p1->type)->name;
65 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "V", var_class_name6);
66 PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 37);
67 fatal_exit(1);
68 }
69 var_k = p0;
70 var_v = p1;
71 {
72 var7 = standard___standard__HashMap___standard__abstract_collection__MapRead__get_or_null(self, var_k);
73 }
74 var_x = var7;
75 if (var_x == NULL) {
76 var8 = 0; /* is null */
77 } else {
78 var8 = 1; /* arg is null and recv is not */
79 }
80 if (0) {
81 { /* Inline kernel#Object#!= (var_x,((val*)NULL)) on <var_x:nullable Array[nullable Object]> */
82 var_other = ((val*)NULL);
83 {
84 var11 = ((short int(*)(val* self, val* p0))(var_x->class->vft[COLOR_standard__kernel__Object___61d_61d]))(var_x, var_other); /* == on <var_x:nullable Array[nullable Object](Array[nullable Object])>*/
85 }
86 var12 = !var11;
87 var9 = var12;
88 goto RET_LABEL10;
89 RET_LABEL10:(void)0;
90 }
91 var8 = var9;
92 }
93 if (var8){
94 {
95 standard___standard__Array___standard__abstract_collection__SimpleCollection__add(var_x, var_v); /* Direct call array#Array#add on <var_x:nullable Array[nullable Object](Array[nullable Object])>*/
96 }
97 } else {
98 var13 = NEW_standard__Array(self->type->resolution_table->types[COLOR_standard__Array__more_collections__MultiHashMap___35dV]);
99 {
100 standard___standard__Array___with_capacity(var13, 1l); /* Direct call array#Array#with_capacity on <var13:Array[nullable Object]>*/
101 }
102 var_ = var13;
103 {
104 standard___standard__AbstractArray___standard__abstract_collection__Sequence__push(var_, var_v); /* Direct call array#AbstractArray#push on <var_:Array[nullable Object]>*/
105 }
106 {
107 standard___standard__HashMap___standard__abstract_collection__Map___91d_93d_61d(self, var_k, var_); /* Direct call hash_collection#HashMap#[]= on <self:MultiHashMap[nullable Object, nullable Object]>*/
108 }
109 }
110 RET_LABEL:;
111 }
112 /* method more_collections#MultiHashMap#provide_default_value for (self: MultiHashMap[nullable Object, nullable Object], nullable Object): Array[nullable Object] */
113 val* more_collections___more_collections__MultiHashMap___standard__abstract_collection__MapRead__provide_default_value(val* self, val* p0) {
114 val* var /* : Array[nullable Object] */;
115 val* var_key /* var key: nullable Object */;
116 val* var1 /* : Array[nullable Object] */;
117 val* var_res /* var res: Array[nullable Object] */;
118 short int var2 /* : Bool */;
119 int cltype;
120 int idtype;
121 const struct type* type_struct;
122 short int is_nullable;
123 const char* var_class_name;
124 var_key = p0;
125 var1 = NEW_standard__Array(self->type->resolution_table->types[COLOR_standard__Array__more_collections__MultiHashMap___35dV]);
126 {
127 standard___standard__Array___standard__kernel__Object__init(var1); /* Direct call array#Array#init on <var1:Array[nullable Object]>*/
128 }
129 var_res = var1;
130 /* <var_key:nullable Object> isa K */
131 type_struct = self->type->resolution_table->types[COLOR_more_collections__MultiHashMap___35dK];
132 cltype = type_struct->color;
133 idtype = type_struct->id;
134 is_nullable = type_struct->is_nullable;
135 if(var_key == NULL) {
136 var2 = is_nullable;
137 } else {
138 if(cltype >= (((long)var_key&3)?type_info[((long)var_key&3)]:var_key->type)->table_size) {
139 var2 = 0;
140 } else {
141 var2 = (((long)var_key&3)?type_info[((long)var_key&3)]:var_key->type)->type_table[cltype] == idtype;
142 }
143 }
144 if (unlikely(!var2)) {
145 var_class_name = var_key == NULL ? "null" : (((long)var_key&3)?type_info[((long)var_key&3)]:var_key->type)->name;
146 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "K", var_class_name);
147 PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 51);
148 fatal_exit(1);
149 }
150 {
151 standard___standard__HashMap___standard__abstract_collection__Map___91d_93d_61d(self, var_key, var_res); /* Direct call hash_collection#HashMap#[]= on <self:MultiHashMap[nullable Object, nullable Object]>*/
152 }
153 var = var_res;
154 goto RET_LABEL;
155 RET_LABEL:;
156 return var;
157 }
158 /* method more_collections#HashMap2#level1 for (self: HashMap2[nullable Object, nullable Object, nullable Object]): HashMap[nullable Object, HashMap[nullable Object, nullable Object]] */
159 val* more_collections___more_collections__HashMap2___level1(val* self) {
160 val* var /* : HashMap[nullable Object, HashMap[nullable Object, nullable Object]] */;
161 val* var1 /* : HashMap[nullable Object, HashMap[nullable Object, nullable Object]] */;
162 var1 = self->attrs[COLOR_more_collections__HashMap2___level1].val; /* _level1 on <self:HashMap2[nullable Object, nullable Object, nullable Object]> */
163 if (unlikely(var1 == NULL)) {
164 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _level1");
165 PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 67);
166 fatal_exit(1);
167 }
168 var = var1;
169 RET_LABEL:;
170 return var;
171 }
172 /* method more_collections#HashMap2#[] for (self: HashMap2[nullable Object, nullable Object, nullable Object], nullable Object, nullable Object): nullable Object */
173 val* more_collections___more_collections__HashMap2____91d_93d(val* self, val* p0, val* p1) {
174 val* var /* : nullable Object */;
175 short int var1 /* : Bool */;
176 int cltype;
177 int idtype;
178 const struct type* type_struct;
179 short int is_nullable;
180 const char* var_class_name;
181 short int var2 /* : Bool */;
182 int cltype3;
183 int idtype4;
184 const struct type* type_struct5;
185 short int is_nullable6;
186 const char* var_class_name7;
187 val* var_k1 /* var k1: nullable Object */;
188 val* var_k2 /* var k2: nullable Object */;
189 val* var8 /* : HashMap[nullable Object, HashMap[nullable Object, nullable Object]] */;
190 val* var10 /* : HashMap[nullable Object, HashMap[nullable Object, nullable Object]] */;
191 val* var_level1 /* var level1: HashMap[nullable Object, HashMap[nullable Object, nullable Object]] */;
192 val* var11 /* : nullable Object */;
193 val* var_level2 /* var level2: nullable HashMap[nullable Object, nullable Object] */;
194 short int var12 /* : Bool */;
195 short int var13 /* : Bool */;
196 val* var14 /* : nullable Object */;
197 /* Covariant cast for argument 0 (k1) <p0:nullable Object> isa K1 */
198 /* <p0:nullable Object> isa K1 */
199 type_struct = self->type->resolution_table->types[COLOR_more_collections__HashMap2___35dK1];
200 cltype = type_struct->color;
201 idtype = type_struct->id;
202 is_nullable = type_struct->is_nullable;
203 if(p0 == NULL) {
204 var1 = is_nullable;
205 } else {
206 if(cltype >= (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->table_size) {
207 var1 = 0;
208 } else {
209 var1 = (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->type_table[cltype] == idtype;
210 }
211 }
212 if (unlikely(!var1)) {
213 var_class_name = p0 == NULL ? "null" : (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->name;
214 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "K1", var_class_name);
215 PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 69);
216 fatal_exit(1);
217 }
218 /* Covariant cast for argument 1 (k2) <p1:nullable Object> isa K2 */
219 /* <p1:nullable Object> isa K2 */
220 type_struct5 = self->type->resolution_table->types[COLOR_more_collections__HashMap2___35dK2];
221 cltype3 = type_struct5->color;
222 idtype4 = type_struct5->id;
223 is_nullable6 = type_struct5->is_nullable;
224 if(p1 == NULL) {
225 var2 = is_nullable6;
226 } else {
227 if(cltype3 >= (((long)p1&3)?type_info[((long)p1&3)]:p1->type)->table_size) {
228 var2 = 0;
229 } else {
230 var2 = (((long)p1&3)?type_info[((long)p1&3)]:p1->type)->type_table[cltype3] == idtype4;
231 }
232 }
233 if (unlikely(!var2)) {
234 var_class_name7 = p1 == NULL ? "null" : (((long)p1&3)?type_info[((long)p1&3)]:p1->type)->name;
235 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "K2", var_class_name7);
236 PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 69);
237 fatal_exit(1);
238 }
239 var_k1 = p0;
240 var_k2 = p1;
241 {
242 { /* Inline more_collections#HashMap2#level1 (self) on <self:HashMap2[nullable Object, nullable Object, nullable Object]> */
243 var10 = self->attrs[COLOR_more_collections__HashMap2___level1].val; /* _level1 on <self:HashMap2[nullable Object, nullable Object, nullable Object]> */
244 if (unlikely(var10 == NULL)) {
245 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _level1");
246 PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 67);
247 fatal_exit(1);
248 }
249 var8 = var10;
250 RET_LABEL9:(void)0;
251 }
252 }
253 var_level1 = var8;
254 {
255 var11 = standard___standard__HashMap___standard__abstract_collection__MapRead__get_or_null(var_level1, var_k1);
256 }
257 var_level2 = var11;
258 if (var_level2 == NULL) {
259 var12 = 1; /* is null */
260 } else {
261 var12 = 0; /* arg is null but recv is not */
262 }
263 if (0) {
264 var13 = standard___standard__MapRead___standard__kernel__Object___61d_61d(var_level2, ((val*)NULL));
265 var12 = var13;
266 }
267 if (var12){
268 var = ((val*)NULL);
269 goto RET_LABEL;
270 } else {
271 }
272 {
273 var14 = standard___standard__HashMap___standard__abstract_collection__MapRead__get_or_null(var_level2, var_k2);
274 }
275 var = var14;
276 goto RET_LABEL;
277 RET_LABEL:;
278 return var;
279 }
280 /* method more_collections#HashMap2#[]= for (self: HashMap2[nullable Object, nullable Object, nullable Object], nullable Object, nullable Object, nullable Object) */
281 void more_collections___more_collections__HashMap2____91d_93d_61d(val* self, val* p0, val* p1, val* p2) {
282 short int var /* : Bool */;
283 int cltype;
284 int idtype;
285 const struct type* type_struct;
286 short int is_nullable;
287 const char* var_class_name;
288 short int var1 /* : Bool */;
289 int cltype2;
290 int idtype3;
291 const struct type* type_struct4;
292 short int is_nullable5;
293 const char* var_class_name6;
294 short int var7 /* : Bool */;
295 int cltype8;
296 int idtype9;
297 const struct type* type_struct10;
298 short int is_nullable11;
299 const char* var_class_name12;
300 val* var_k1 /* var k1: nullable Object */;
301 val* var_k2 /* var k2: nullable Object */;
302 val* var_v /* var v: nullable Object */;
303 val* var13 /* : HashMap[nullable Object, HashMap[nullable Object, nullable Object]] */;
304 val* var15 /* : HashMap[nullable Object, HashMap[nullable Object, nullable Object]] */;
305 val* var_level1 /* var level1: HashMap[nullable Object, HashMap[nullable Object, nullable Object]] */;
306 val* var16 /* : nullable Object */;
307 val* var_level2 /* var level2: nullable HashMap[nullable Object, nullable Object] */;
308 short int var17 /* : Bool */;
309 short int var18 /* : Bool */;
310 val* var19 /* : HashMap[nullable Object, nullable Object] */;
311 /* Covariant cast for argument 0 (k1) <p0:nullable Object> isa K1 */
312 /* <p0:nullable Object> isa K1 */
313 type_struct = self->type->resolution_table->types[COLOR_more_collections__HashMap2___35dK1];
314 cltype = type_struct->color;
315 idtype = type_struct->id;
316 is_nullable = type_struct->is_nullable;
317 if(p0 == NULL) {
318 var = is_nullable;
319 } else {
320 if(cltype >= (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->table_size) {
321 var = 0;
322 } else {
323 var = (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->type_table[cltype] == idtype;
324 }
325 }
326 if (unlikely(!var)) {
327 var_class_name = p0 == NULL ? "null" : (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->name;
328 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "K1", var_class_name);
329 PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 79);
330 fatal_exit(1);
331 }
332 /* Covariant cast for argument 1 (k2) <p1:nullable Object> isa K2 */
333 /* <p1:nullable Object> isa K2 */
334 type_struct4 = self->type->resolution_table->types[COLOR_more_collections__HashMap2___35dK2];
335 cltype2 = type_struct4->color;
336 idtype3 = type_struct4->id;
337 is_nullable5 = type_struct4->is_nullable;
338 if(p1 == NULL) {
339 var1 = is_nullable5;
340 } else {
341 if(cltype2 >= (((long)p1&3)?type_info[((long)p1&3)]:p1->type)->table_size) {
342 var1 = 0;
343 } else {
344 var1 = (((long)p1&3)?type_info[((long)p1&3)]:p1->type)->type_table[cltype2] == idtype3;
345 }
346 }
347 if (unlikely(!var1)) {
348 var_class_name6 = p1 == NULL ? "null" : (((long)p1&3)?type_info[((long)p1&3)]:p1->type)->name;
349 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "K2", var_class_name6);
350 PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 79);
351 fatal_exit(1);
352 }
353 /* Covariant cast for argument 2 (v) <p2:nullable Object> isa V */
354 /* <p2:nullable Object> isa V */
355 type_struct10 = self->type->resolution_table->types[COLOR_more_collections__HashMap2___35dV];
356 cltype8 = type_struct10->color;
357 idtype9 = type_struct10->id;
358 is_nullable11 = type_struct10->is_nullable;
359 if(p2 == NULL) {
360 var7 = is_nullable11;
361 } else {
362 if(cltype8 >= (((long)p2&3)?type_info[((long)p2&3)]:p2->type)->table_size) {
363 var7 = 0;
364 } else {
365 var7 = (((long)p2&3)?type_info[((long)p2&3)]:p2->type)->type_table[cltype8] == idtype9;
366 }
367 }
368 if (unlikely(!var7)) {
369 var_class_name12 = p2 == NULL ? "null" : (((long)p2&3)?type_info[((long)p2&3)]:p2->type)->name;
370 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "V", var_class_name12);
371 PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 79);
372 fatal_exit(1);
373 }
374 var_k1 = p0;
375 var_k2 = p1;
376 var_v = p2;
377 {
378 { /* Inline more_collections#HashMap2#level1 (self) on <self:HashMap2[nullable Object, nullable Object, nullable Object]> */
379 var15 = self->attrs[COLOR_more_collections__HashMap2___level1].val; /* _level1 on <self:HashMap2[nullable Object, nullable Object, nullable Object]> */
380 if (unlikely(var15 == NULL)) {
381 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _level1");
382 PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 67);
383 fatal_exit(1);
384 }
385 var13 = var15;
386 RET_LABEL14:(void)0;
387 }
388 }
389 var_level1 = var13;
390 {
391 var16 = standard___standard__HashMap___standard__abstract_collection__MapRead__get_or_null(var_level1, var_k1);
392 }
393 var_level2 = var16;
394 if (var_level2 == NULL) {
395 var17 = 1; /* is null */
396 } else {
397 var17 = 0; /* arg is null but recv is not */
398 }
399 if (0) {
400 var18 = standard___standard__MapRead___standard__kernel__Object___61d_61d(var_level2, ((val*)NULL));
401 var17 = var18;
402 }
403 if (var17){
404 var19 = NEW_standard__HashMap(self->type->resolution_table->types[COLOR_standard__HashMap__more_collections__HashMap2___35dK2__more_collections__HashMap2___35dV]);
405 {
406 standard___standard__HashMap___standard__kernel__Object__init(var19); /* Direct call hash_collection#HashMap#init on <var19:HashMap[nullable Object, nullable Object]>*/
407 }
408 var_level2 = var19;
409 {
410 standard___standard__HashMap___standard__abstract_collection__Map___91d_93d_61d(var_level1, var_k1, var_level2); /* Direct call hash_collection#HashMap#[]= on <var_level1:HashMap[nullable Object, HashMap[nullable Object, nullable Object]]>*/
411 }
412 } else {
413 }
414 {
415 standard___standard__HashMap___standard__abstract_collection__Map___91d_93d_61d(var_level2, var_k2, var_v); /* Direct call hash_collection#HashMap#[]= on <var_level2:nullable HashMap[nullable Object, nullable Object](HashMap[nullable Object, nullable Object])>*/
416 }
417 RET_LABEL:;
418 }
419 /* method more_collections#HashMap3#level1 for (self: HashMap3[nullable Object, nullable Object, nullable Object, nullable Object]): HashMap[nullable Object, HashMap2[nullable Object, nullable Object, nullable Object]] */
420 val* more_collections___more_collections__HashMap3___level1(val* self) {
421 val* var /* : HashMap[nullable Object, HashMap2[nullable Object, nullable Object, nullable Object]] */;
422 val* var1 /* : HashMap[nullable Object, HashMap2[nullable Object, nullable Object, nullable Object]] */;
423 var1 = self->attrs[COLOR_more_collections__HashMap3___level1].val; /* _level1 on <self:HashMap3[nullable Object, nullable Object, nullable Object, nullable Object]> */
424 if (unlikely(var1 == NULL)) {
425 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _level1");
426 PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 115);
427 fatal_exit(1);
428 }
429 var = var1;
430 RET_LABEL:;
431 return var;
432 }
433 /* method more_collections#HashMap3#[] for (self: HashMap3[nullable Object, nullable Object, nullable Object, nullable Object], nullable Object, nullable Object, nullable Object): nullable Object */
434 val* more_collections___more_collections__HashMap3____91d_93d(val* self, val* p0, val* p1, val* p2) {
435 val* var /* : nullable Object */;
436 short int var1 /* : Bool */;
437 int cltype;
438 int idtype;
439 const struct type* type_struct;
440 short int is_nullable;
441 const char* var_class_name;
442 short int var2 /* : Bool */;
443 int cltype3;
444 int idtype4;
445 const struct type* type_struct5;
446 short int is_nullable6;
447 const char* var_class_name7;
448 short int var8 /* : Bool */;
449 int cltype9;
450 int idtype10;
451 const struct type* type_struct11;
452 short int is_nullable12;
453 const char* var_class_name13;
454 val* var_k1 /* var k1: nullable Object */;
455 val* var_k2 /* var k2: nullable Object */;
456 val* var_k3 /* var k3: nullable Object */;
457 val* var14 /* : HashMap[nullable Object, HashMap2[nullable Object, nullable Object, nullable Object]] */;
458 val* var16 /* : HashMap[nullable Object, HashMap2[nullable Object, nullable Object, nullable Object]] */;
459 val* var_level1 /* var level1: HashMap[nullable Object, HashMap2[nullable Object, nullable Object, nullable Object]] */;
460 val* var17 /* : nullable Object */;
461 val* var_level2 /* var level2: nullable HashMap2[nullable Object, nullable Object, nullable Object] */;
462 short int var18 /* : Bool */;
463 short int var19 /* : Bool */;
464 val* var_other /* var other: nullable Object */;
465 short int var21 /* : Bool */;
466 short int var23 /* : Bool */;
467 val* var24 /* : nullable Object */;
468 /* Covariant cast for argument 0 (k1) <p0:nullable Object> isa K1 */
469 /* <p0:nullable Object> isa K1 */
470 type_struct = self->type->resolution_table->types[COLOR_more_collections__HashMap3___35dK1];
471 cltype = type_struct->color;
472 idtype = type_struct->id;
473 is_nullable = type_struct->is_nullable;
474 if(p0 == NULL) {
475 var1 = is_nullable;
476 } else {
477 if(cltype >= (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->table_size) {
478 var1 = 0;
479 } else {
480 var1 = (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->type_table[cltype] == idtype;
481 }
482 }
483 if (unlikely(!var1)) {
484 var_class_name = p0 == NULL ? "null" : (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->name;
485 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "K1", var_class_name);
486 PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 117);
487 fatal_exit(1);
488 }
489 /* Covariant cast for argument 1 (k2) <p1:nullable Object> isa K2 */
490 /* <p1:nullable Object> isa K2 */
491 type_struct5 = self->type->resolution_table->types[COLOR_more_collections__HashMap3___35dK2];
492 cltype3 = type_struct5->color;
493 idtype4 = type_struct5->id;
494 is_nullable6 = type_struct5->is_nullable;
495 if(p1 == NULL) {
496 var2 = is_nullable6;
497 } else {
498 if(cltype3 >= (((long)p1&3)?type_info[((long)p1&3)]:p1->type)->table_size) {
499 var2 = 0;
500 } else {
501 var2 = (((long)p1&3)?type_info[((long)p1&3)]:p1->type)->type_table[cltype3] == idtype4;
502 }
503 }
504 if (unlikely(!var2)) {
505 var_class_name7 = p1 == NULL ? "null" : (((long)p1&3)?type_info[((long)p1&3)]:p1->type)->name;
506 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "K2", var_class_name7);
507 PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 117);
508 fatal_exit(1);
509 }
510 /* Covariant cast for argument 2 (k3) <p2:nullable Object> isa K3 */
511 /* <p2:nullable Object> isa K3 */
512 type_struct11 = self->type->resolution_table->types[COLOR_more_collections__HashMap3___35dK3];
513 cltype9 = type_struct11->color;
514 idtype10 = type_struct11->id;
515 is_nullable12 = type_struct11->is_nullable;
516 if(p2 == NULL) {
517 var8 = is_nullable12;
518 } else {
519 if(cltype9 >= (((long)p2&3)?type_info[((long)p2&3)]:p2->type)->table_size) {
520 var8 = 0;
521 } else {
522 var8 = (((long)p2&3)?type_info[((long)p2&3)]:p2->type)->type_table[cltype9] == idtype10;
523 }
524 }
525 if (unlikely(!var8)) {
526 var_class_name13 = p2 == NULL ? "null" : (((long)p2&3)?type_info[((long)p2&3)]:p2->type)->name;
527 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "K3", var_class_name13);
528 PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 117);
529 fatal_exit(1);
530 }
531 var_k1 = p0;
532 var_k2 = p1;
533 var_k3 = p2;
534 {
535 { /* Inline more_collections#HashMap3#level1 (self) on <self:HashMap3[nullable Object, nullable Object, nullable Object, nullable Object]> */
536 var16 = self->attrs[COLOR_more_collections__HashMap3___level1].val; /* _level1 on <self:HashMap3[nullable Object, nullable Object, nullable Object, nullable Object]> */
537 if (unlikely(var16 == NULL)) {
538 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _level1");
539 PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 115);
540 fatal_exit(1);
541 }
542 var14 = var16;
543 RET_LABEL15:(void)0;
544 }
545 }
546 var_level1 = var14;
547 {
548 var17 = standard___standard__HashMap___standard__abstract_collection__MapRead__get_or_null(var_level1, var_k1);
549 }
550 var_level2 = var17;
551 if (var_level2 == NULL) {
552 var18 = 1; /* is null */
553 } else {
554 var18 = 0; /* arg is null but recv is not */
555 }
556 if (0) {
557 { /* Inline kernel#Object#== (var_level2,((val*)NULL)) on <var_level2:nullable HashMap2[nullable Object, nullable Object, nullable Object]> */
558 var_other = ((val*)NULL);
559 {
560 { /* Inline kernel#Object#is_same_instance (var_level2,var_other) on <var_level2:nullable HashMap2[nullable Object, nullable Object, nullable Object](HashMap2[nullable Object, nullable Object, nullable Object])> */
561 var23 = var_level2 == var_other;
562 var21 = var23;
563 goto RET_LABEL22;
564 RET_LABEL22:(void)0;
565 }
566 }
567 var19 = var21;
568 goto RET_LABEL20;
569 RET_LABEL20:(void)0;
570 }
571 var18 = var19;
572 }
573 if (var18){
574 var = ((val*)NULL);
575 goto RET_LABEL;
576 } else {
577 }
578 {
579 var24 = more_collections___more_collections__HashMap2____91d_93d(var_level2, var_k2, var_k3);
580 }
581 var = var24;
582 goto RET_LABEL;
583 RET_LABEL:;
584 return var;
585 }
586 /* method more_collections#HashMap3#[]= for (self: HashMap3[nullable Object, nullable Object, nullable Object, nullable Object], nullable Object, nullable Object, nullable Object, nullable Object) */
587 void more_collections___more_collections__HashMap3____91d_93d_61d(val* self, val* p0, val* p1, val* p2, val* p3) {
588 short int var /* : Bool */;
589 int cltype;
590 int idtype;
591 const struct type* type_struct;
592 short int is_nullable;
593 const char* var_class_name;
594 short int var1 /* : Bool */;
595 int cltype2;
596 int idtype3;
597 const struct type* type_struct4;
598 short int is_nullable5;
599 const char* var_class_name6;
600 short int var7 /* : Bool */;
601 int cltype8;
602 int idtype9;
603 const struct type* type_struct10;
604 short int is_nullable11;
605 const char* var_class_name12;
606 short int var13 /* : Bool */;
607 int cltype14;
608 int idtype15;
609 const struct type* type_struct16;
610 short int is_nullable17;
611 const char* var_class_name18;
612 val* var_k1 /* var k1: nullable Object */;
613 val* var_k2 /* var k2: nullable Object */;
614 val* var_k3 /* var k3: nullable Object */;
615 val* var_v /* var v: nullable Object */;
616 val* var19 /* : HashMap[nullable Object, HashMap2[nullable Object, nullable Object, nullable Object]] */;
617 val* var21 /* : HashMap[nullable Object, HashMap2[nullable Object, nullable Object, nullable Object]] */;
618 val* var_level1 /* var level1: HashMap[nullable Object, HashMap2[nullable Object, nullable Object, nullable Object]] */;
619 val* var22 /* : nullable Object */;
620 val* var_level2 /* var level2: nullable HashMap2[nullable Object, nullable Object, nullable Object] */;
621 short int var23 /* : Bool */;
622 short int var24 /* : Bool */;
623 val* var_other /* var other: nullable Object */;
624 short int var26 /* : Bool */;
625 short int var28 /* : Bool */;
626 val* var29 /* : HashMap2[nullable Object, nullable Object, nullable Object] */;
627 /* Covariant cast for argument 0 (k1) <p0:nullable Object> isa K1 */
628 /* <p0:nullable Object> isa K1 */
629 type_struct = self->type->resolution_table->types[COLOR_more_collections__HashMap3___35dK1];
630 cltype = type_struct->color;
631 idtype = type_struct->id;
632 is_nullable = type_struct->is_nullable;
633 if(p0 == NULL) {
634 var = is_nullable;
635 } else {
636 if(cltype >= (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->table_size) {
637 var = 0;
638 } else {
639 var = (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->type_table[cltype] == idtype;
640 }
641 }
642 if (unlikely(!var)) {
643 var_class_name = p0 == NULL ? "null" : (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->name;
644 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "K1", var_class_name);
645 PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 127);
646 fatal_exit(1);
647 }
648 /* Covariant cast for argument 1 (k2) <p1:nullable Object> isa K2 */
649 /* <p1:nullable Object> isa K2 */
650 type_struct4 = self->type->resolution_table->types[COLOR_more_collections__HashMap3___35dK2];
651 cltype2 = type_struct4->color;
652 idtype3 = type_struct4->id;
653 is_nullable5 = type_struct4->is_nullable;
654 if(p1 == NULL) {
655 var1 = is_nullable5;
656 } else {
657 if(cltype2 >= (((long)p1&3)?type_info[((long)p1&3)]:p1->type)->table_size) {
658 var1 = 0;
659 } else {
660 var1 = (((long)p1&3)?type_info[((long)p1&3)]:p1->type)->type_table[cltype2] == idtype3;
661 }
662 }
663 if (unlikely(!var1)) {
664 var_class_name6 = p1 == NULL ? "null" : (((long)p1&3)?type_info[((long)p1&3)]:p1->type)->name;
665 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "K2", var_class_name6);
666 PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 127);
667 fatal_exit(1);
668 }
669 /* Covariant cast for argument 2 (k3) <p2:nullable Object> isa K3 */
670 /* <p2:nullable Object> isa K3 */
671 type_struct10 = self->type->resolution_table->types[COLOR_more_collections__HashMap3___35dK3];
672 cltype8 = type_struct10->color;
673 idtype9 = type_struct10->id;
674 is_nullable11 = type_struct10->is_nullable;
675 if(p2 == NULL) {
676 var7 = is_nullable11;
677 } else {
678 if(cltype8 >= (((long)p2&3)?type_info[((long)p2&3)]:p2->type)->table_size) {
679 var7 = 0;
680 } else {
681 var7 = (((long)p2&3)?type_info[((long)p2&3)]:p2->type)->type_table[cltype8] == idtype9;
682 }
683 }
684 if (unlikely(!var7)) {
685 var_class_name12 = p2 == NULL ? "null" : (((long)p2&3)?type_info[((long)p2&3)]:p2->type)->name;
686 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "K3", var_class_name12);
687 PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 127);
688 fatal_exit(1);
689 }
690 /* Covariant cast for argument 3 (v) <p3:nullable Object> isa V */
691 /* <p3:nullable Object> isa V */
692 type_struct16 = self->type->resolution_table->types[COLOR_more_collections__HashMap3___35dV];
693 cltype14 = type_struct16->color;
694 idtype15 = type_struct16->id;
695 is_nullable17 = type_struct16->is_nullable;
696 if(p3 == NULL) {
697 var13 = is_nullable17;
698 } else {
699 if(cltype14 >= (((long)p3&3)?type_info[((long)p3&3)]:p3->type)->table_size) {
700 var13 = 0;
701 } else {
702 var13 = (((long)p3&3)?type_info[((long)p3&3)]:p3->type)->type_table[cltype14] == idtype15;
703 }
704 }
705 if (unlikely(!var13)) {
706 var_class_name18 = p3 == NULL ? "null" : (((long)p3&3)?type_info[((long)p3&3)]:p3->type)->name;
707 PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "V", var_class_name18);
708 PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 127);
709 fatal_exit(1);
710 }
711 var_k1 = p0;
712 var_k2 = p1;
713 var_k3 = p2;
714 var_v = p3;
715 {
716 { /* Inline more_collections#HashMap3#level1 (self) on <self:HashMap3[nullable Object, nullable Object, nullable Object, nullable Object]> */
717 var21 = self->attrs[COLOR_more_collections__HashMap3___level1].val; /* _level1 on <self:HashMap3[nullable Object, nullable Object, nullable Object, nullable Object]> */
718 if (unlikely(var21 == NULL)) {
719 PRINT_ERROR("Runtime error: %s", "Uninitialized attribute _level1");
720 PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 115);
721 fatal_exit(1);
722 }
723 var19 = var21;
724 RET_LABEL20:(void)0;
725 }
726 }
727 var_level1 = var19;
728 {
729 var22 = standard___standard__HashMap___standard__abstract_collection__MapRead__get_or_null(var_level1, var_k1);
730 }
731 var_level2 = var22;
732 if (var_level2 == NULL) {
733 var23 = 1; /* is null */
734 } else {
735 var23 = 0; /* arg is null but recv is not */
736 }
737 if (0) {
738 { /* Inline kernel#Object#== (var_level2,((val*)NULL)) on <var_level2:nullable HashMap2[nullable Object, nullable Object, nullable Object]> */
739 var_other = ((val*)NULL);
740 {
741 { /* Inline kernel#Object#is_same_instance (var_level2,var_other) on <var_level2:nullable HashMap2[nullable Object, nullable Object, nullable Object](HashMap2[nullable Object, nullable Object, nullable Object])> */
742 var28 = var_level2 == var_other;
743 var26 = var28;
744 goto RET_LABEL27;
745 RET_LABEL27:(void)0;
746 }
747 }
748 var24 = var26;
749 goto RET_LABEL25;
750 RET_LABEL25:(void)0;
751 }
752 var23 = var24;
753 }
754 if (var23){
755 var29 = NEW_more_collections__HashMap2(self->type->resolution_table->types[COLOR_more_collections__HashMap2__more_collections__HashMap3___35dK2__more_collections__HashMap3___35dK3__more_collections__HashMap3___35dV]);
756 {
757 { /* Inline kernel#Object#init (var29) on <var29:HashMap2[nullable Object, nullable Object, nullable Object]> */
758 RET_LABEL30:(void)0;
759 }
760 }
761 var_level2 = var29;
762 {
763 standard___standard__HashMap___standard__abstract_collection__Map___91d_93d_61d(var_level1, var_k1, var_level2); /* Direct call hash_collection#HashMap#[]= on <var_level1:HashMap[nullable Object, HashMap2[nullable Object, nullable Object, nullable Object]]>*/
764 }
765 } else {
766 }
767 {
768 more_collections___more_collections__HashMap2____91d_93d_61d(var_level2, var_k2, var_k3, var_v); /* Direct call more_collections#HashMap2#[]= on <var_level2:nullable HashMap2[nullable Object, nullable Object, nullable Object](HashMap2[nullable Object, nullable Object, nullable Object])>*/
769 }
770 RET_LABEL:;
771 }