-if (!var1) {
-var_class_name5 = p1 == NULL ? "null" : p1->type->name;
-fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap3#1", var_class_name5);
-fprintf(stderr, " (%s:%d)\n", "lib/more_collections.nit", 80);
-exit(1);
-}
-/* Covariant cast for argument 2 (k3) <p2:Object> isa HashMap3#2 */
-/* <p2:Object> isa HashMap3#2 */
-type_struct9 = self->type->resolution_table->types[COLOR_more_collections__HashMap3_FT2];
-cltype7 = type_struct9->color;
-idtype8 = type_struct9->id;
-if(cltype7 >= p2->type->table_size) {
-var6 = 0;
-} else {
-var6 = p2->type->type_table[cltype7] == idtype8;
-}
-if (!var6) {
-var_class_name10 = p2 == NULL ? "null" : p2->type->name;
-fprintf(stderr, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap3#2", var_class_name10);
-fprintf(stderr, " (%s:%d)\n", "lib/more_collections.nit", 80);
-exit(1);
-}
-/* Covariant cast for argument 3 (v) <p3:nullable Object> isa HashMap3#3 */
-/* <p3:nullable Object> isa HashMap3#3 */
-type_struct14 = self->type->resolution_table->types[COLOR_more_collections__HashMap3_FT3];
-cltype12 = type_struct14->color;
-idtype13 = type_struct14->id;
-is_nullable = type_struct14->is_nullable;
+}
+if (unlikely(!var1)) {
+var_class_name6 = p1 == NULL ? "null" : p1->type->name;
+PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "K2", var_class_name6);
+PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 120);
+show_backtrace(1);
+}
+/* Covariant cast for argument 2 (k3) <p2:nullable Object> isa K3 */
+/* <p2:nullable Object> isa K3 */
+type_struct10 = self->type->resolution_table->types[COLOR_more_collections__HashMap3___35dK3];
+cltype8 = type_struct10->color;
+idtype9 = type_struct10->id;
+is_nullable11 = type_struct10->is_nullable;
+if(p2 == NULL) {
+var7 = is_nullable11;
+} else {
+if(cltype8 >= p2->type->table_size) {
+var7 = 0;
+} else {
+var7 = p2->type->type_table[cltype8] == idtype9;
+}
+}
+if (unlikely(!var7)) {
+var_class_name12 = p2 == NULL ? "null" : p2->type->name;
+PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "K3", var_class_name12);
+PRINT_ERROR(" (%s:%d)\n", FILE_more_collections, 120);
+show_backtrace(1);
+}
+/* Covariant cast for argument 3 (v) <p3:nullable Object> isa V */
+/* <p3:nullable Object> isa V */
+type_struct16 = self->type->resolution_table->types[COLOR_more_collections__HashMap3___35dV];
+cltype14 = type_struct16->color;
+idtype15 = type_struct16->id;
+is_nullable17 = type_struct16->is_nullable;