; LLVM IR from skywind3000/RenderHelp :: sample_07_specular (main)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%class.RenderHelp = type { ptr, ptr, ptr, i32, i32, i32, i32, [3 x %"struct.RenderHelp::Vertex"], i32, i32, i32, i32, i8, i8, %"class.std::function", %"class.std::function.24" }
%"struct.RenderHelp::Vertex" = type <{ %struct.ShaderContext, float, %struct.Vector, %struct.Vector.16, %struct.Vector.20, [4 x i8] }>
%struct.ShaderContext = type { %"class.std::map", %"class.std::map.0", %"class.std::map.5", %"class.std::map.10" }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, float>, std::_Select1st<std::pair<const int, float>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, float>, std::_Select1st<std::pair<const int, float>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::map.0" = type { %"class.std::_Rb_tree.1" }
%"class.std::_Rb_tree.1" = type { %"struct.std::_Rb_tree<int, std::pair<const int, Vector<2, float>>, std::_Select1st<std::pair<const int, Vector<2, float>>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, Vector<2, float>>, std::_Select1st<std::pair<const int, Vector<2, float>>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.std::map.5" = type { %"class.std::_Rb_tree.6" }
%"class.std::_Rb_tree.6" = type { %"struct.std::_Rb_tree<int, std::pair<const int, Vector<3, float>>, std::_Select1st<std::pair<const int, Vector<3, float>>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, Vector<3, float>>, std::_Select1st<std::pair<const int, Vector<3, float>>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.std::map.10" = type { %"class.std::_Rb_tree.11" }
%"class.std::_Rb_tree.11" = type { %"struct.std::_Rb_tree<int, std::pair<const int, Vector<4, float>>, std::_Select1st<std::pair<const int, Vector<4, float>>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, Vector<4, float>>, std::_Select1st<std::pair<const int, Vector<4, float>>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%struct.Vector = type { %union.anon }
%union.anon = type { %struct.anon }
%struct.anon = type { float, float, float, float }
%struct.Vector.16 = type { %union.anon.17 }
%union.anon.17 = type { %struct.anon.18 }
%struct.anon.18 = type { float, float }
%struct.Vector.20 = type { %union.anon.21 }
%union.anon.21 = type { %struct.anon.22 }
%struct.anon.22 = type { i32, i32 }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%"class.std::function.24" = type { %"class.std::_Function_base", ptr }
%class.Model = type { ptr, %"class.std::vector", %"class.std::vector.29", %"class.std::vector", %"class.std::vector.34", ptr, ptr, ptr }
%"class.std::vector.29" = type { %"struct.std::_Vector_base.30" }
%"struct.std::_Vector_base.30" = type { %"struct.std::_Vector_base<std::vector<Vector<3, int>>, std::allocator<std::vector<Vector<3, int>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<Vector<3, int>>, std::allocator<std::vector<Vector<3, int>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<Vector<3, int>>, std::allocator<std::vector<Vector<3, int>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<Vector<3, int>>, std::allocator<std::vector<Vector<3, int>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Vector<3, float>, std::allocator<Vector<3, float>>>::_Vector_impl" }
%"struct.std::_Vector_base<Vector<3, float>, std::allocator<Vector<3, float>>>::_Vector_impl" = type { %"struct.std::_Vector_base<Vector<3, float>, std::allocator<Vector<3, float>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Vector<3, float>, std::allocator<Vector<3, float>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.34" = type { %"struct.std::_Vector_base.35" }
%"struct.std::_Vector_base.35" = type { %"struct.std::_Vector_base<Vector<2, float>, std::allocator<Vector<2, float>>>::_Vector_impl" }
%"struct.std::_Vector_base<Vector<2, float>, std::allocator<Vector<2, float>>>::_Vector_impl" = type { %"struct.std::_Vector_base<Vector<2, float>, std::allocator<Vector<2, float>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Vector<2, float>, std::allocator<Vector<2, float>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Vector.39 = type { %union.anon.40 }
%union.anon.40 = type { %struct.anon.41 }
%struct.anon.41 = type { float, float, float }
%struct.Matrix = type { [4 x [4 x float]] }
%struct.anon.43 = type { %struct.Vector.39, %struct.Vector.39, %struct.Vector.16 }
%class.anon = type { ptr, ptr, ptr, ptr, ptr, ptr }
%class.anon.44 = type { ptr, ptr, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [21 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %class.RenderHelp, align 8
  %3 = alloca %class.Model, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca %struct.Vector.39, align 4
  %7 = alloca %struct.Vector.39, align 4
  %8 = alloca %struct.Vector.39, align 4
  %9 = alloca %struct.Vector.39, align 4
  %10 = alloca float, align 4
  %11 = alloca %struct.Matrix, align 4
  %12 = alloca %struct.Matrix, align 4
  %13 = alloca %struct.Matrix, align 4
  %14 = alloca %struct.Matrix, align 4
  %15 = alloca %struct.Matrix, align 4
  %16 = alloca %struct.Matrix, align 4
  %17 = alloca %struct.Matrix, align 4
  %18 = alloca [3 x %struct.anon.43], align 16
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca %"class.std::function", align 8
  %22 = alloca %class.anon, align 8
  %23 = alloca %"class.std::function.24", align 8
  %24 = alloca %class.anon.44, align 8
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca %struct.Vector.39, align 4
  %29 = alloca %struct.Vector.16, align 4
  %30 = alloca %struct.Vector.39, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 824, ptr %2) #7
  call void @_ZN10RenderHelpC2Eii(ptr noundef nonnull align 8 dereferenceable(824) %2, i32 noundef 600, i32 noundef 800)
  call void @llvm.lifetime.start.p0(i64 128, ptr %3) #7
  invoke void @_ZN5ModelC2EPKc(ptr noundef nonnull align 8 dereferenceable(128) %3, ptr noundef @.str)
          to label %31 unwind label %73

31:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 12, ptr %6) #7
  invoke void @_ZN6VectorILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %6, float noundef 0.000000e+00, float noundef -5.000000e-01, float noundef 0x3FFB333340000000)
          to label %32 unwind label %77

32:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 12, ptr %7) #7
  invoke void @_ZN6VectorILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %7, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00)
          to label %33 unwind label %81

33:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 12, ptr %8) #7
  invoke void @_ZN6VectorILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %8, float noundef 0.000000e+00, float noundef 1.000000e+00, float noundef 0.000000e+00)
          to label %34 unwind label %85

34:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 12, ptr %9) #7
  invoke void @_ZN6VectorILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %9, float noundef 1.000000e+00, float noundef 1.000000e+00, float noundef 0x3FEB333340000000)
          to label %35 unwind label %89

35:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store float 0x3FF921FB40000000, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 64, ptr %11) #7
  invoke void @_ZL16matrix_set_scalefff(ptr dead_on_unwind writable sret(%struct.Matrix) align 4 %11, float noundef 1.000000e+00, float noundef 1.000000e+00, float noundef 1.000000e+00)
          to label %36 unwind label %93

36:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 64, ptr %12) #7
  invoke void @_ZL17matrix_set_lookatRK6VectorILm3EfES2_S2_(ptr dead_on_unwind writable sret(%struct.Matrix) align 4 %12, ptr noundef nonnull align 4 dereferenceable(12) %6, ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %8)
          to label %37 unwind label %97

37:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 64, ptr %13) #7
  %38 = load float, ptr %10, align 4, !tbaa !5
  invoke void @_ZL22matrix_set_perspectiveffff(ptr dead_on_unwind writable sret(%struct.Matrix) align 4 %13, float noundef %38, float noundef 7.500000e-01, float noundef 1.000000e+00, float noundef 5.000000e+02)
          to label %39 unwind label %101

39:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 64, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 64, ptr %15) #7
  invoke void @_ZmlILm4ELm4ELm4EfE6MatrixIXT_EXT1_ET2_ERKS0_IXT_EXT0_ES1_ERKS0_IXT0_EXT1_ES1_E(ptr dead_on_unwind writable sret(%struct.Matrix) align 4 %15, ptr noundef nonnull align 4 dereferenceable(64) %11, ptr noundef nonnull align 4 dereferenceable(64) %12)
          to label %40 unwind label %105

40:                                               ; preds = %39
  invoke void @_ZmlILm4ELm4ELm4EfE6MatrixIXT_EXT1_ET2_ERKS0_IXT_EXT0_ES1_ERKS0_IXT0_EXT1_ES1_E(ptr dead_on_unwind writable sret(%struct.Matrix) align 4 %14, ptr noundef nonnull align 4 dereferenceable(64) %15, ptr noundef nonnull align 4 dereferenceable(64) %13)
          to label %41 unwind label %105

41:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 64, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 64, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 64, ptr %17) #7
  invoke void @_Z13matrix_invertILm4EfE6MatrixIXT_EXT_ET0_ERKS2_(ptr dead_on_unwind writable sret(%struct.Matrix) align 4 %17, ptr noundef nonnull align 4 dereferenceable(64) %11)
          to label %42 unwind label %109

42:                                               ; preds = %41
  invoke void @_ZNK6MatrixILm4ELm4EfE9TransposeEv(ptr dead_on_unwind writable sret(%struct.Matrix) align 4 %16, ptr noundef nonnull align 4 dereferenceable(64) %17)
          to label %43 unwind label %109

43:                                               ; preds = %42
  call void @llvm.lifetime.end.p0(i64 64, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 96, ptr %18) #7
  %44 = getelementptr inbounds [3 x %struct.anon.43], ptr %18, i32 0, i32 0
  %45 = getelementptr inbounds %struct.anon.43, ptr %44, i64 3
  br label %46

46:                                               ; preds = %48, %43
  %47 = phi ptr [ %44, %43 ], [ %49, %48 ]
  invoke void @"_ZZ4mainEN3$_2C2Ev"(ptr noundef nonnull align 4 dereferenceable(32) %47)
          to label %48 unwind label %113

48:                                               ; preds = %46
  %49 = getelementptr inbounds %struct.anon.43, ptr %47, i64 1
  %50 = icmp eq ptr %49, %45
  br i1 %50, label %51, label %46

51:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  store i32 1, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 48, ptr %22) #7
  %52 = getelementptr inbounds %class.anon, ptr %22, i32 0, i32 0
  store ptr %18, ptr %52, align 8, !tbaa !11
  %53 = getelementptr inbounds %class.anon, ptr %22, i32 0, i32 1
  store ptr %14, ptr %53, align 8, !tbaa !11
  %54 = getelementptr inbounds %class.anon, ptr %22, i32 0, i32 2
  store ptr %11, ptr %54, align 8, !tbaa !11
  %55 = getelementptr inbounds %class.anon, ptr %22, i32 0, i32 3
  store ptr %6, ptr %55, align 8, !tbaa !11
  %56 = getelementptr inbounds %class.anon, ptr %22, i32 0, i32 4
  store ptr %19, ptr %56, align 8, !tbaa !11
  %57 = getelementptr inbounds %class.anon, ptr %22, i32 0, i32 5
  store ptr %20, ptr %57, align 8, !tbaa !11
  invoke void @"_ZNSt8functionIF6VectorILm4EfEiR13ShaderContextEEC2IZ4mainE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %21, ptr noundef nonnull align 8 dereferenceable(48) %22)
          to label %58 unwind label %117

58:                                               ; preds = %51
  invoke void @_ZN10RenderHelp15SetVertexShaderESt8functionIF6VectorILm4EfEiR13ShaderContextEE(ptr noundef nonnull align 8 dereferenceable(824) %2, ptr noundef %21)
          to label %59 unwind label %121

59:                                               ; preds = %58
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %21) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %22) #7
  call void @llvm.lifetime.start.p0(i64 40, ptr %24) #7
  %60 = getelementptr inbounds %class.anon.44, ptr %24, i32 0, i32 0
  store ptr %19, ptr %60, align 8, !tbaa !11
  %61 = getelementptr inbounds %class.anon.44, ptr %24, i32 0, i32 1
  store ptr %20, ptr %61, align 8, !tbaa !11
  %62 = getelementptr inbounds %class.anon.44, ptr %24, i32 0, i32 2
  store ptr %9, ptr %62, align 8, !tbaa !11
  %63 = getelementptr inbounds %class.anon.44, ptr %24, i32 0, i32 3
  store ptr %3, ptr %63, align 8, !tbaa !11
  %64 = getelementptr inbounds %class.anon.44, ptr %24, i32 0, i32 4
  store ptr %16, ptr %64, align 8, !tbaa !11
  invoke void @"_ZNSt8functionIF6VectorILm4EfER13ShaderContextEEC2IZ4mainE3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %23, ptr noundef nonnull align 8 dereferenceable(40) %24)
          to label %65 unwind label %126

65:                                               ; preds = %59
  invoke void @_ZN10RenderHelp14SetPixelShaderESt8functionIF6VectorILm4EfER13ShaderContextEE(ptr noundef nonnull align 8 dereferenceable(824) %2, ptr noundef %23)
          to label %66 unwind label %130

66:                                               ; preds = %65
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %23) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr %24) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  store i32 0, ptr %25, align 4, !tbaa !9
  br label %67

67:                                               ; preds = %185, %66
  %68 = load i32, ptr %25, align 4, !tbaa !9
  %69 = invoke noundef i32 @_ZNK5Model6nfacesEv(ptr noundef nonnull align 8 dereferenceable(128) %3)
          to label %70 unwind label %135

70:                                               ; preds = %67
  %71 = icmp slt i32 %68, %69
  br i1 %71, label %139, label %72

72:                                               ; preds = %70
  store i32 2, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %189

73:                                               ; preds = %0
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %4, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %5, align 4
  br label %207

77:                                               ; preds = %31
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %4, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %5, align 4
  br label %206

81:                                               ; preds = %32
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %4, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %5, align 4
  br label %205

85:                                               ; preds = %33
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %4, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %5, align 4
  br label %204

89:                                               ; preds = %34
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %4, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %5, align 4
  br label %203

93:                                               ; preds = %35
  %94 = landingpad { ptr, i32 }
          cleanup
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %4, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %5, align 4
  br label %202

97:                                               ; preds = %36
  %98 = landingpad { ptr, i32 }
          cleanup
  %99 = extractvalue { ptr, i32 } %98, 0
  store ptr %99, ptr %4, align 8
  %100 = extractvalue { ptr, i32 } %98, 1
  store i32 %100, ptr %5, align 4
  br label %201

101:                                              ; preds = %37
  %102 = landingpad { ptr, i32 }
          cleanup
  %103 = extractvalue { ptr, i32 } %102, 0
  store ptr %103, ptr %4, align 8
  %104 = extractvalue { ptr, i32 } %102, 1
  store i32 %104, ptr %5, align 4
  br label %200

105:                                              ; preds = %40, %39
  %106 = landingpad { ptr, i32 }
          cleanup
  %107 = extractvalue { ptr, i32 } %106, 0
  store ptr %107, ptr %4, align 8
  %108 = extractvalue { ptr, i32 } %106, 1
  store i32 %108, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 64, ptr %15) #7
  br label %199

109:                                              ; preds = %42, %41
  %110 = landingpad { ptr, i32 }
          cleanup
  %111 = extractvalue { ptr, i32 } %110, 0
  store ptr %111, ptr %4, align 8
  %112 = extractvalue { ptr, i32 } %110, 1
  store i32 %112, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 64, ptr %17) #7
  br label %198

113:                                              ; preds = %46
  %114 = landingpad { ptr, i32 }
          cleanup
  %115 = extractvalue { ptr, i32 } %114, 0
  store ptr %115, ptr %4, align 8
  %116 = extractvalue { ptr, i32 } %114, 1
  store i32 %116, ptr %5, align 4
  br label %197

117:                                              ; preds = %51
  %118 = landingpad { ptr, i32 }
          cleanup
  %119 = extractvalue { ptr, i32 } %118, 0
  store ptr %119, ptr %4, align 8
  %120 = extractvalue { ptr, i32 } %118, 1
  store i32 %120, ptr %5, align 4
  br label %125

121:                                              ; preds = %58
  %122 = landingpad { ptr, i32 }
          cleanup
  %123 = extractvalue { ptr, i32 } %122, 0
  store ptr %123, ptr %4, align 8
  %124 = extractvalue { ptr, i32 } %122, 1
  store i32 %124, ptr %5, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %21) #7
  br label %125

125:                                              ; preds = %121, %117
  call void @llvm.lifetime.end.p0(i64 48, ptr %22) #7
  br label %196

126:                                              ; preds = %59
  %127 = landingpad { ptr, i32 }
          cleanup
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %4, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %5, align 4
  br label %134

130:                                              ; preds = %65
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %4, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %5, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %23) #7
  br label %134

134:                                              ; preds = %130, %126
  call void @llvm.lifetime.end.p0(i64 40, ptr %24) #7
  br label %196

135:                                              ; preds = %182, %67
  %136 = landingpad { ptr, i32 }
          cleanup
  %137 = extractvalue { ptr, i32 } %136, 0
  store ptr %137, ptr %4, align 8
  %138 = extractvalue { ptr, i32 } %136, 1
  store i32 %138, ptr %5, align 4
  br label %188

139:                                              ; preds = %70
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  store i32 0, ptr %27, align 4, !tbaa !9
  br label %140

140:                                              ; preds = %166, %139
  %141 = load i32, ptr %27, align 4, !tbaa !9
  %142 = icmp slt i32 %141, 3
  br i1 %142, label %144, label %143

143:                                              ; preds = %140
  store i32 5, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  br label %182

144:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 12, ptr %28) #7
  %145 = load i32, ptr %25, align 4, !tbaa !9
  %146 = load i32, ptr %27, align 4, !tbaa !9
  invoke void @_ZN5Model4vertEii(ptr dead_on_unwind writable sret(%struct.Vector.39) align 4 %28, ptr noundef nonnull align 8 dereferenceable(128) %3, i32 noundef %145, i32 noundef %146)
          to label %147 unwind label %169

147:                                              ; preds = %144
  %148 = load i32, ptr %27, align 4, !tbaa !9
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [3 x %struct.anon.43], ptr %18, i64 0, i64 %149
  %151 = getelementptr inbounds %struct.anon.43, ptr %150, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %151, ptr align 4 %28, i64 12, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 12, ptr %28) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #7
  %152 = load i32, ptr %25, align 4, !tbaa !9
  %153 = load i32, ptr %27, align 4, !tbaa !9
  invoke void @_ZNK5Model2uvEii(ptr dead_on_unwind writable sret(%struct.Vector.16) align 4 %29, ptr noundef nonnull align 8 dereferenceable(128) %3, i32 noundef %152, i32 noundef %153)
          to label %154 unwind label %173

154:                                              ; preds = %147
  %155 = load i32, ptr %27, align 4, !tbaa !9
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [3 x %struct.anon.43], ptr %18, i64 0, i64 %156
  %158 = getelementptr inbounds %struct.anon.43, ptr %157, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %158, ptr align 4 %29, i64 8, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %30) #7
  %159 = load i32, ptr %25, align 4, !tbaa !9
  %160 = load i32, ptr %27, align 4, !tbaa !9
  invoke void @_ZNK5Model6normalEii(ptr dead_on_unwind writable sret(%struct.Vector.39) align 4 %30, ptr noundef nonnull align 8 dereferenceable(128) %3, i32 noundef %159, i32 noundef %160)
          to label %161 unwind label %177

161:                                              ; preds = %154
  %162 = load i32, ptr %27, align 4, !tbaa !9
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [3 x %struct.anon.43], ptr %18, i64 0, i64 %163
  %165 = getelementptr inbounds %struct.anon.43, ptr %164, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %165, ptr align 4 %30, i64 12, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 12, ptr %30) #7
  br label %166

166:                                              ; preds = %161
  %167 = load i32, ptr %27, align 4, !tbaa !9
  %168 = add nsw i32 %167, 1
  store i32 %168, ptr %27, align 4, !tbaa !9
  br label %140, !llvm.loop !16

169:                                              ; preds = %144
  %170 = landingpad { ptr, i32 }
          cleanup
  %171 = extractvalue { ptr, i32 } %170, 0
  store ptr %171, ptr %4, align 8
  %172 = extractvalue { ptr, i32 } %170, 1
  store i32 %172, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %28) #7
  br label %181

173:                                              ; preds = %147
  %174 = landingpad { ptr, i32 }
          cleanup
  %175 = extractvalue { ptr, i32 } %174, 0
  store ptr %175, ptr %4, align 8
  %176 = extractvalue { ptr, i32 } %174, 1
  store i32 %176, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  br label %181

177:                                              ; preds = %154
  %178 = landingpad { ptr, i32 }
          cleanup
  %179 = extractvalue { ptr, i32 } %178, 0
  store ptr %179, ptr %4, align 8
  %180 = extractvalue { ptr, i32 } %178, 1
  store i32 %180, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %30) #7
  br label %181

181:                                              ; preds = %177, %173, %169
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  br label %188

182:                                              ; preds = %143
  %183 = invoke noundef zeroext i1 @_ZN10RenderHelp13DrawPrimitiveEv(ptr noundef nonnull align 8 dereferenceable(824) %2)
          to label %184 unwind label %135

184:                                              ; preds = %182
  br label %185

185:                                              ; preds = %184
  %186 = load i32, ptr %25, align 4, !tbaa !9
  %187 = add nsw i32 %186, 1
  store i32 %187, ptr %25, align 4, !tbaa !9
  br label %67, !llvm.loop !18

188:                                              ; preds = %181, %135
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %196

189:                                              ; preds = %72
  invoke void @_ZN10RenderHelp8SaveFileEPKc(ptr noundef nonnull align 8 dereferenceable(824) %2, ptr noundef @.str.1)
          to label %190 unwind label %192

190:                                              ; preds = %189
  store i32 0, ptr %1, align 4
  store i32 1, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 96, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %6) #7
  call void @_ZN5ModelD2Ev(ptr noundef nonnull align 8 dereferenceable(128) %3) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr %3) #7
  call void @_ZN10RenderHelpD2Ev(ptr noundef nonnull align 8 dereferenceable(824) %2) #7
  call void @llvm.lifetime.end.p0(i64 824, ptr %2) #7
  %191 = load i32, ptr %1, align 4
  ret i32 %191

192:                                              ; preds = %189
  %193 = landingpad { ptr, i32 }
          cleanup
  %194 = extractvalue { ptr, i32 } %193, 0
  store ptr %194, ptr %4, align 8
  %195 = extractvalue { ptr, i32 } %193, 1
  store i32 %195, ptr %5, align 4
  br label %196

196:                                              ; preds = %192, %188, %134, %125
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %197

197:                                              ; preds = %196, %113
  call void @llvm.lifetime.end.p0(i64 96, ptr %18) #7
  br label %198

198:                                              ; preds = %197, %109
  call void @llvm.lifetime.end.p0(i64 64, ptr %16) #7
  br label %199

199:                                              ; preds = %198, %105
  call void @llvm.lifetime.end.p0(i64 64, ptr %14) #7
  br label %200

200:                                              ; preds = %199, %101
  call void @llvm.lifetime.end.p0(i64 64, ptr %13) #7
  br label %201

201:                                              ; preds = %200, %97
  call void @llvm.lifetime.end.p0(i64 64, ptr %12) #7
  br label %202

202:                                              ; preds = %201, %93
  call void @llvm.lifetime.end.p0(i64 64, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %203

203:                                              ; preds = %202, %89
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #7
  br label %204

204:                                              ; preds = %203, %85
  call void @llvm.lifetime.end.p0(i64 12, ptr %8) #7
  br label %205

205:                                              ; preds = %204, %81
  call void @llvm.lifetime.end.p0(i64 12, ptr %7) #7
  br label %206

206:                                              ; preds = %205, %77
  call void @llvm.lifetime.end.p0(i64 12, ptr %6) #7
  call void @_ZN5ModelD2Ev(ptr noundef nonnull align 8 dereferenceable(128) %3) #7
  br label %207

207:                                              ; preds = %206, %73
  call void @llvm.lifetime.end.p0(i64 128, ptr %3) #7
  call void @_ZN10RenderHelpD2Ev(ptr noundef nonnull align 8 dereferenceable(824) %2) #7
  call void @llvm.lifetime.end.p0(i64 824, ptr %2) #7
  br label %208

208:                                              ; preds = %207
  %209 = load ptr, ptr %4, align 8
  %210 = load i32, ptr %5, align 4
  %211 = insertvalue { ptr, i32 } poison, ptr %209, 0
  %212 = insertvalue { ptr, i32 } %211, i32 %210, 1
  resume { ptr, i32 } %212
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN10RenderHelpC2Eii(ptr noundef nonnull align 8 dereferenceable(824), i32 noundef, i32 noundef) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5ModelC2EPKc(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6VectorILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12), float noundef, float noundef, float noundef) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @_ZL16matrix_set_scalefff(ptr dead_on_unwind noalias writable sret(%struct.Matrix) align 4, float noundef, float noundef, float noundef) #2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @_ZL17matrix_set_lookatRK6VectorILm3EfES2_S2_(ptr dead_on_unwind noalias writable sret(%struct.Matrix) align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @_ZL22matrix_set_perspectiveffff(ptr dead_on_unwind noalias writable sret(%struct.Matrix) align 4, float noundef, float noundef, float noundef, float noundef) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZmlILm4ELm4ELm4EfE6MatrixIXT_EXT1_ET2_ERKS0_IXT_EXT0_ES1_ERKS0_IXT0_EXT1_ES1_E(ptr dead_on_unwind noalias writable sret(%struct.Matrix) align 4, ptr noundef nonnull align 4 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(64)) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z13matrix_invertILm4EfE6MatrixIXT_EXT_ET0_ERKS2_(ptr dead_on_unwind noalias writable sret(%struct.Matrix) align 4, ptr noundef nonnull align 4 dereferenceable(64)) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK6MatrixILm4ELm4EfE9TransposeEv(ptr dead_on_unwind noalias writable sret(%struct.Matrix) align 4, ptr noundef nonnull align 4 dereferenceable(64)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZZ4mainEN3$_2C2Ev"(ptr noundef nonnull align 4 dereferenceable(32)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN10RenderHelp15SetVertexShaderESt8functionIF6VectorILm4EfEiR13ShaderContextEE(ptr noundef nonnull align 8 dereferenceable(824), ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt8functionIF6VectorILm4EfEiR13ShaderContextEEC2IZ4mainE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN10RenderHelp14SetPixelShaderESt8functionIF6VectorILm4EfER13ShaderContextEE(ptr noundef nonnull align 8 dereferenceable(824), ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt8functionIF6VectorILm4EfER13ShaderContextEEC2IZ4mainE3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK5Model6nfacesEv(ptr noundef nonnull align 8 dereferenceable(128)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5Model4vertEii(ptr dead_on_unwind noalias writable sret(%struct.Vector.39) align 4, ptr noundef nonnull align 8 dereferenceable(128), i32 noundef, i32 noundef) #2 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Model2uvEii(ptr dead_on_unwind noalias writable sret(%struct.Vector.16) align 4, ptr noundef nonnull align 8 dereferenceable(128), i32 noundef, i32 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Model6normalEii(ptr dead_on_unwind noalias writable sret(%struct.Vector.39) align 4, ptr noundef nonnull align 8 dereferenceable(128), i32 noundef, i32 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN10RenderHelp13DrawPrimitiveEv(ptr noundef nonnull align 8 dereferenceable(824)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN10RenderHelp8SaveFileEPKc(ptr noundef nonnull align 8 dereferenceable(824), ptr noundef) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5ModelD2Ev(ptr noundef nonnull align 8 dereferenceable(128)) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN10RenderHelpD2Ev(ptr noundef nonnull align 8 dereferenceable(824)) unnamed_addr #3 align 2

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{i64 0, i64 12, !14}
!14 = !{!7, !7, i64 0}
!15 = !{i64 0, i64 8, !14}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%class.RenderHelp = type { ptr, ptr, ptr, i32, i32, i32, i32, [3 x %"struct.RenderHelp::Vertex"], i32, i32, i32, i32, i8, i8, %"class.std::function", %"class.std::function.24" }
%"struct.RenderHelp::Vertex" = type <{ %struct.ShaderContext, float, %struct.Vector, %struct.Vector.16, %struct.Vector.20, [4 x i8] }>
%struct.ShaderContext = type { %"class.std::map", %"class.std::map.0", %"class.std::map.5", %"class.std::map.10" }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, float>, std::_Select1st<std::pair<const int, float>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, float>, std::_Select1st<std::pair<const int, float>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::map.0" = type { %"class.std::_Rb_tree.1" }
%"class.std::_Rb_tree.1" = type { %"struct.std::_Rb_tree<int, std::pair<const int, Vector<2, float>>, std::_Select1st<std::pair<const int, Vector<2, float>>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, Vector<2, float>>, std::_Select1st<std::pair<const int, Vector<2, float>>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.std::map.5" = type { %"class.std::_Rb_tree.6" }
%"class.std::_Rb_tree.6" = type { %"struct.std::_Rb_tree<int, std::pair<const int, Vector<3, float>>, std::_Select1st<std::pair<const int, Vector<3, float>>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, Vector<3, float>>, std::_Select1st<std::pair<const int, Vector<3, float>>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.std::map.10" = type { %"class.std::_Rb_tree.11" }
%"class.std::_Rb_tree.11" = type { %"struct.std::_Rb_tree<int, std::pair<const int, Vector<4, float>>, std::_Select1st<std::pair<const int, Vector<4, float>>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, Vector<4, float>>, std::_Select1st<std::pair<const int, Vector<4, float>>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%struct.Vector = type { %union.anon }
%union.anon = type { %struct.anon }
%struct.anon = type { float, float, float, float }
%struct.Vector.16 = type { %union.anon.17 }
%union.anon.17 = type { %struct.anon.18 }
%struct.anon.18 = type { float, float }
%struct.Vector.20 = type { %union.anon.21 }
%union.anon.21 = type { %struct.anon.22 }
%struct.anon.22 = type { i32, i32 }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%"class.std::function.24" = type { %"class.std::_Function_base", ptr }
%class.Model = type { ptr, %"class.std::vector", %"class.std::vector.29", %"class.std::vector", %"class.std::vector.34", ptr, ptr, ptr }
%"class.std::vector.29" = type { %"struct.std::_Vector_base.30" }
%"struct.std::_Vector_base.30" = type { %"struct.std::_Vector_base<std::vector<Vector<3, int>>, std::allocator<std::vector<Vector<3, int>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<Vector<3, int>>, std::allocator<std::vector<Vector<3, int>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<Vector<3, int>>, std::allocator<std::vector<Vector<3, int>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<Vector<3, int>>, std::allocator<std::vector<Vector<3, int>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Vector<3, float>, std::allocator<Vector<3, float>>>::_Vector_impl" }
%"struct.std::_Vector_base<Vector<3, float>, std::allocator<Vector<3, float>>>::_Vector_impl" = type { %"struct.std::_Vector_base<Vector<3, float>, std::allocator<Vector<3, float>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Vector<3, float>, std::allocator<Vector<3, float>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.34" = type { %"struct.std::_Vector_base.35" }
%"struct.std::_Vector_base.35" = type { %"struct.std::_Vector_base<Vector<2, float>, std::allocator<Vector<2, float>>>::_Vector_impl" }
%"struct.std::_Vector_base<Vector<2, float>, std::allocator<Vector<2, float>>>::_Vector_impl" = type { %"struct.std::_Vector_base<Vector<2, float>, std::allocator<Vector<2, float>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Vector<2, float>, std::allocator<Vector<2, float>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Vector.39 = type { %union.anon.40 }
%union.anon.40 = type { %struct.anon.41 }
%struct.anon.41 = type { float, float, float }
%struct.Matrix = type { [4 x [4 x float]] }
%struct.anon.43 = type { %struct.Vector.39, %struct.Vector.39, %struct.Vector.16 }
%class.anon = type { ptr, ptr, ptr, ptr, ptr, ptr }
%class.anon.44 = type { ptr, ptr, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [21 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %class.RenderHelp, align 8
  %2 = alloca %class.Model, align 8
  %3 = alloca %struct.Vector.39, align 4
  %4 = alloca %struct.Vector.39, align 4
  %5 = alloca %struct.Vector.39, align 4
  %6 = alloca %struct.Vector.39, align 4
  %7 = alloca %struct.Matrix, align 4
  %8 = alloca %struct.Matrix, align 4
  %9 = alloca %struct.Matrix, align 4
  %10 = alloca %struct.Matrix, align 4
  %11 = alloca %struct.Matrix, align 4
  %12 = alloca %struct.Matrix, align 4
  %13 = alloca %struct.Matrix, align 4
  %14 = alloca [3 x %struct.anon.43], align 16
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %"class.std::function", align 8
  %18 = alloca %class.anon, align 8
  %19 = alloca %"class.std::function.24", align 8
  %20 = alloca %class.anon.44, align 8
  %21 = alloca %struct.Vector.39, align 4
  %22 = alloca %struct.Vector.16, align 8
  %23 = alloca %struct.Vector.39, align 4
  call void @llvm.lifetime.start.p0(i64 824, ptr nonnull %1) #7
  call void @_ZN10RenderHelpC2Eii(ptr noundef nonnull align 8 dereferenceable(824) %1, i32 noundef 600, i32 noundef 800)
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %2) #7
  invoke void @_ZN5ModelC2EPKc(ptr noundef nonnull align 8 dereferenceable(128) %2, ptr noundef nonnull @.str)
          to label %24 unwind label %56

24:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #7
  call void @_ZN6VectorILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %3, float noundef 0.000000e+00, float noundef -5.000000e-01, float noundef 0x3FFB333340000000)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #7
  call void @_ZN6VectorILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %4, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #7
  call void @_ZN6VectorILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %5, float noundef 0.000000e+00, float noundef 1.000000e+00, float noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #7
  call void @_ZN6VectorILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %6, float noundef 1.000000e+00, float noundef 1.000000e+00, float noundef 0x3FEB333340000000)
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %7) #7
  invoke void @_ZL16matrix_set_scalefff(ptr dead_on_unwind nonnull writable sret(%struct.Matrix) align 4 %7, float noundef 1.000000e+00, float noundef 1.000000e+00, float noundef 1.000000e+00)
          to label %25 unwind label %58

25:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %8) #7
  invoke void @_ZL17matrix_set_lookatRK6VectorILm3EfES2_S2_(ptr dead_on_unwind nonnull writable sret(%struct.Matrix) align 4 %8, ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %5)
          to label %26 unwind label %60

26:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %9) #7
  invoke void @_ZL22matrix_set_perspectiveffff(ptr dead_on_unwind nonnull writable sret(%struct.Matrix) align 4 %9, float noundef 0x3FF921FB40000000, float noundef 7.500000e-01, float noundef 1.000000e+00, float noundef 5.000000e+02)
          to label %27 unwind label %62

27:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %11) #7
  invoke void @_ZmlILm4ELm4ELm4EfE6MatrixIXT_EXT1_ET2_ERKS0_IXT_EXT0_ES1_ERKS0_IXT0_EXT1_ES1_E(ptr dead_on_unwind nonnull writable sret(%struct.Matrix) align 4 %11, ptr noundef nonnull align 4 dereferenceable(64) %7, ptr noundef nonnull align 4 dereferenceable(64) %8)
          to label %28 unwind label %64

28:                                               ; preds = %27
  invoke void @_ZmlILm4ELm4ELm4EfE6MatrixIXT_EXT1_ET2_ERKS0_IXT_EXT0_ES1_ERKS0_IXT0_EXT1_ES1_E(ptr dead_on_unwind nonnull writable sret(%struct.Matrix) align 4 %10, ptr noundef nonnull align 4 dereferenceable(64) %11, ptr noundef nonnull align 4 dereferenceable(64) %9)
          to label %29 unwind label %64

29:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %11) #7
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %12) #7
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %13) #7
  invoke void @_Z13matrix_invertILm4EfE6MatrixIXT_EXT_ET0_ERKS2_(ptr dead_on_unwind nonnull writable sret(%struct.Matrix) align 4 %13, ptr noundef nonnull align 4 dereferenceable(64) %7)
          to label %30 unwind label %66

30:                                               ; preds = %29
  invoke void @_ZNK6MatrixILm4ELm4EfE9TransposeEv(ptr dead_on_unwind nonnull writable sret(%struct.Matrix) align 4 %12, ptr noundef nonnull align 4 dereferenceable(64) %13)
          to label %31 unwind label %66

31:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %14) #7
  invoke void @"_ZZ4mainEN3$_2C2Ev"(ptr noundef nonnull align 4 dereferenceable(32) %14)
          to label %32 unwind label %68

32:                                               ; preds = %31
  %.ptr.1 = getelementptr inbounds i8, ptr %14, i64 32
  invoke void @"_ZZ4mainEN3$_2C2Ev"(ptr noundef nonnull align 4 dereferenceable(32) %.ptr.1)
          to label %33 unwind label %68

33:                                               ; preds = %32
  %.ptr.2 = getelementptr inbounds i8, ptr %14, i64 64
  invoke void @"_ZZ4mainEN3$_2C2Ev"(ptr noundef nonnull align 4 dereferenceable(32) %.ptr.2)
          to label %34 unwind label %68

34:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #7
  store i32 0, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #7
  store i32 1, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %18) #7
  store ptr %14, ptr %18, align 8, !tbaa !9
  %35 = getelementptr inbounds i8, ptr %18, i64 8
  store ptr %10, ptr %35, align 8, !tbaa !9
  %36 = getelementptr inbounds i8, ptr %18, i64 16
  store ptr %7, ptr %36, align 8, !tbaa !9
  %37 = getelementptr inbounds i8, ptr %18, i64 24
  store ptr %3, ptr %37, align 8, !tbaa !9
  %38 = getelementptr inbounds i8, ptr %18, i64 32
  store ptr %15, ptr %38, align 8, !tbaa !9
  %39 = getelementptr inbounds i8, ptr %18, i64 40
  store ptr %16, ptr %39, align 8, !tbaa !9
  invoke void @"_ZNSt8functionIF6VectorILm4EfEiR13ShaderContextEEC2IZ4mainE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %17, ptr noundef nonnull align 8 dereferenceable(48) %18)
          to label %40 unwind label %70

40:                                               ; preds = %34
  invoke void @_ZN10RenderHelp15SetVertexShaderESt8functionIF6VectorILm4EfEiR13ShaderContextEE(ptr noundef nonnull align 8 dereferenceable(824) %1, ptr noundef nonnull %17)
          to label %41 unwind label %72

41:                                               ; preds = %40
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %18) #7
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %20) #7
  store ptr %15, ptr %20, align 8, !tbaa !9
  %42 = getelementptr inbounds i8, ptr %20, i64 8
  store ptr %16, ptr %42, align 8, !tbaa !9
  %43 = getelementptr inbounds i8, ptr %20, i64 16
  store ptr %6, ptr %43, align 8, !tbaa !9
  %44 = getelementptr inbounds i8, ptr %20, i64 24
  store ptr %2, ptr %44, align 8, !tbaa !9
  %45 = getelementptr inbounds i8, ptr %20, i64 32
  store ptr %12, ptr %45, align 8, !tbaa !9
  invoke void @"_ZNSt8functionIF6VectorILm4EfER13ShaderContextEEC2IZ4mainE3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef nonnull align 8 dereferenceable(40) %20)
          to label %46 unwind label %75

46:                                               ; preds = %41
  invoke void @_ZN10RenderHelp14SetPixelShaderESt8functionIF6VectorILm4EfER13ShaderContextEE(ptr noundef nonnull align 8 dereferenceable(824) %1, ptr noundef nonnull %19)
          to label %47 unwind label %77

47:                                               ; preds = %46
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %20) #7
  %48 = call noundef i32 @_ZNK5Model6nfacesEv(ptr noundef nonnull align 8 dereferenceable(128) %2)
  %49 = icmp sgt i32 %48, 0
  br i1 %49, label %.preheader.preheader, label %._crit_edge

.preheader.preheader:                             ; preds = %47
  %50 = getelementptr inbounds i8, ptr %14, i64 24
  %51 = getelementptr inbounds i8, ptr %14, i64 12
  %52 = getelementptr inbounds i8, ptr %14, i64 56
  %53 = getelementptr inbounds i8, ptr %14, i64 44
  %54 = getelementptr inbounds i8, ptr %14, i64 88
  %55 = getelementptr inbounds i8, ptr %14, i64 76
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %101
  %.01647 = phi i32 [ %102, %101 ], [ 0, %.preheader.preheader ]
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %21) #7
  invoke void @_ZN5Model4vertEii(ptr dead_on_unwind nonnull writable sret(%struct.Vector.39) align 4 %21, ptr noundef nonnull align 8 dereferenceable(128) %2, i32 noundef %.01647, i32 noundef 0)
          to label %82 unwind label %95

._crit_edge:                                      ; preds = %101, %47
  invoke void @_ZN10RenderHelp8SaveFileEPKc(ptr noundef nonnull align 8 dereferenceable(824) %1, ptr noundef nonnull @.str.1)
          to label %105 unwind label %106

56:                                               ; preds = %0
  %57 = landingpad { ptr, i32 }
          cleanup
  br label %115

58:                                               ; preds = %24
  %59 = landingpad { ptr, i32 }
          cleanup
  br label %114

60:                                               ; preds = %25
  %61 = landingpad { ptr, i32 }
          cleanup
  br label %113

62:                                               ; preds = %26
  %63 = landingpad { ptr, i32 }
          cleanup
  br label %112

64:                                               ; preds = %28, %27
  %65 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %11) #7
  br label %111

66:                                               ; preds = %30, %29
  %67 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %13) #7
  br label %110

68:                                               ; preds = %33, %32, %31
  %69 = landingpad { ptr, i32 }
          cleanup
  br label %109

70:                                               ; preds = %34
  %71 = landingpad { ptr, i32 }
          cleanup
  br label %74

72:                                               ; preds = %40
  %73 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #7
  br label %74

74:                                               ; preds = %72, %70
  %.pn = phi { ptr, i32 } [ %73, %72 ], [ %71, %70 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %18) #7
  br label %108

75:                                               ; preds = %41
  %76 = landingpad { ptr, i32 }
          cleanup
  br label %79

77:                                               ; preds = %46
  %78 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #7
  br label %79

79:                                               ; preds = %77, %75
  %.pn33 = phi { ptr, i32 } [ %78, %77 ], [ %76, %75 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %20) #7
  br label %108

80:                                               ; preds = %93
  %81 = landingpad { ptr, i32 }
          cleanup
  br label %108

82:                                               ; preds = %.preheader
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(12) %14, ptr noundef nonnull align 4 dereferenceable(12) %21, i64 12, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %21) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %22) #7
  invoke void @_ZNK5Model2uvEii(ptr dead_on_unwind nonnull writable sret(%struct.Vector.16) align 4 %22, ptr noundef nonnull align 8 dereferenceable(128) %2, i32 noundef %.01647, i32 noundef 0)
          to label %83 unwind label %97

83:                                               ; preds = %82
  %84 = load i64, ptr %22, align 8, !tbaa !12
  store i64 %84, ptr %50, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %23) #7
  invoke void @_ZNK5Model6normalEii(ptr dead_on_unwind nonnull writable sret(%struct.Vector.39) align 4 %23, ptr noundef nonnull align 8 dereferenceable(128) %2, i32 noundef %.01647, i32 noundef 0)
          to label %85 unwind label %99

85:                                               ; preds = %83
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %51, ptr noundef nonnull align 4 dereferenceable(12) %23, i64 12, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %23) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %21) #7
  invoke void @_ZN5Model4vertEii(ptr dead_on_unwind nonnull writable sret(%struct.Vector.39) align 4 %21, ptr noundef nonnull align 8 dereferenceable(128) %2, i32 noundef %.01647, i32 noundef 1)
          to label %86 unwind label %95

86:                                               ; preds = %85
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(12) %.ptr.1, ptr noundef nonnull align 4 dereferenceable(12) %21, i64 12, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %21) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %22) #7
  invoke void @_ZNK5Model2uvEii(ptr dead_on_unwind nonnull writable sret(%struct.Vector.16) align 4 %22, ptr noundef nonnull align 8 dereferenceable(128) %2, i32 noundef %.01647, i32 noundef 1)
          to label %87 unwind label %97

87:                                               ; preds = %86
  %88 = load i64, ptr %22, align 8, !tbaa !12
  store i64 %88, ptr %52, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %23) #7
  invoke void @_ZNK5Model6normalEii(ptr dead_on_unwind nonnull writable sret(%struct.Vector.39) align 4 %23, ptr noundef nonnull align 8 dereferenceable(128) %2, i32 noundef %.01647, i32 noundef 1)
          to label %89 unwind label %99

89:                                               ; preds = %87
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %53, ptr noundef nonnull align 4 dereferenceable(12) %23, i64 12, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %23) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %21) #7
  invoke void @_ZN5Model4vertEii(ptr dead_on_unwind nonnull writable sret(%struct.Vector.39) align 4 %21, ptr noundef nonnull align 8 dereferenceable(128) %2, i32 noundef %.01647, i32 noundef 2)
          to label %90 unwind label %95

90:                                               ; preds = %89
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(12) %.ptr.2, ptr noundef nonnull align 4 dereferenceable(12) %21, i64 12, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %21) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %22) #7
  invoke void @_ZNK5Model2uvEii(ptr dead_on_unwind nonnull writable sret(%struct.Vector.16) align 4 %22, ptr noundef nonnull align 8 dereferenceable(128) %2, i32 noundef %.01647, i32 noundef 2)
          to label %91 unwind label %97

91:                                               ; preds = %90
  %92 = load i64, ptr %22, align 8, !tbaa !12
  store i64 %92, ptr %54, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %23) #7
  invoke void @_ZNK5Model6normalEii(ptr dead_on_unwind nonnull writable sret(%struct.Vector.39) align 4 %23, ptr noundef nonnull align 8 dereferenceable(128) %2, i32 noundef %.01647, i32 noundef 2)
          to label %93 unwind label %99

93:                                               ; preds = %91
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %55, ptr noundef nonnull align 4 dereferenceable(12) %23, i64 12, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %23) #7
  %94 = invoke noundef zeroext i1 @_ZN10RenderHelp13DrawPrimitiveEv(ptr noundef nonnull align 8 dereferenceable(824) %1)
          to label %101 unwind label %80

95:                                               ; preds = %89, %85, %.preheader
  %96 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %21) #7
  br label %108

97:                                               ; preds = %90, %86, %82
  %98 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #7
  br label %108

99:                                               ; preds = %91, %87, %83
  %100 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %23) #7
  br label %108

101:                                              ; preds = %93
  %102 = add nuw nsw i32 %.01647, 1
  %103 = call noundef i32 @_ZNK5Model6nfacesEv(ptr noundef nonnull align 8 dereferenceable(128) %2)
  %104 = icmp slt i32 %102, %103
  br i1 %104, label %.preheader, label %._crit_edge, !llvm.loop !13

105:                                              ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #7
  call void @_ZN5ModelD2Ev(ptr noundef nonnull align 8 dereferenceable(128) %2) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %2) #7
  call void @_ZN10RenderHelpD2Ev(ptr noundef nonnull align 8 dereferenceable(824) %1) #7
  call void @llvm.lifetime.end.p0(i64 824, ptr nonnull %1) #7
  ret i32 0

106:                                              ; preds = %._crit_edge
  %107 = landingpad { ptr, i32 }
          cleanup
  br label %108

108:                                              ; preds = %80, %99, %97, %95, %106, %79, %74
  %.pn35.pn.pn = phi { ptr, i32 } [ %107, %106 ], [ %.pn33, %79 ], [ %.pn, %74 ], [ %81, %80 ], [ %100, %99 ], [ %98, %97 ], [ %96, %95 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #7
  br label %109

109:                                              ; preds = %108, %68
  %.pn35.pn.pn.pn = phi { ptr, i32 } [ %.pn35.pn.pn, %108 ], [ %69, %68 ]
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %14) #7
  br label %110

110:                                              ; preds = %109, %66
  %.pn35.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn35.pn.pn.pn, %109 ], [ %67, %66 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %12) #7
  br label %111

111:                                              ; preds = %110, %64
  %.pn35.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn35.pn.pn.pn.pn, %110 ], [ %65, %64 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %10) #7
  br label %112

112:                                              ; preds = %111, %62
  %.pn35.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn35.pn.pn.pn.pn.pn, %111 ], [ %63, %62 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %9) #7
  br label %113

113:                                              ; preds = %112, %60
  %.pn35.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn35.pn.pn.pn.pn.pn.pn, %112 ], [ %61, %60 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %8) #7
  br label %114

114:                                              ; preds = %113, %58
  %.pn35.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn35.pn.pn.pn.pn.pn.pn.pn, %113 ], [ %59, %58 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #7
  call void @_ZN5ModelD2Ev(ptr noundef nonnull align 8 dereferenceable(128) %2) #7
  br label %115

115:                                              ; preds = %114, %56
  %.pn35.pn.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn35.pn.pn.pn.pn.pn.pn.pn.pn, %114 ], [ %57, %56 ]
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %2) #7
  call void @_ZN10RenderHelpD2Ev(ptr noundef nonnull align 8 dereferenceable(824) %1) #7
  call void @llvm.lifetime.end.p0(i64 824, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn35.pn.pn.pn.pn.pn.pn.pn.pn.pn
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN10RenderHelpC2Eii(ptr noundef nonnull align 8 dereferenceable(824), i32 noundef, i32 noundef) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5ModelC2EPKc(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6VectorILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12), float noundef, float noundef, float noundef) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @_ZL16matrix_set_scalefff(ptr dead_on_unwind noalias writable sret(%struct.Matrix) align 4, float noundef, float noundef, float noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @_ZL17matrix_set_lookatRK6VectorILm3EfES2_S2_(ptr dead_on_unwind noalias writable sret(%struct.Matrix) align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @_ZL22matrix_set_perspectiveffff(ptr dead_on_unwind noalias writable sret(%struct.Matrix) align 4, float noundef, float noundef, float noundef, float noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZmlILm4ELm4ELm4EfE6MatrixIXT_EXT1_ET2_ERKS0_IXT_EXT0_ES1_ERKS0_IXT0_EXT1_ES1_E(ptr dead_on_unwind noalias writable sret(%struct.Matrix) align 4, ptr noundef nonnull align 4 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(64)) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z13matrix_invertILm4EfE6MatrixIXT_EXT_ET0_ERKS2_(ptr dead_on_unwind noalias writable sret(%struct.Matrix) align 4, ptr noundef nonnull align 4 dereferenceable(64)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK6MatrixILm4ELm4EfE9TransposeEv(ptr dead_on_unwind noalias writable sret(%struct.Matrix) align 4, ptr noundef nonnull align 4 dereferenceable(64)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZZ4mainEN3$_2C2Ev"(ptr noundef nonnull align 4 dereferenceable(32)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN10RenderHelp15SetVertexShaderESt8functionIF6VectorILm4EfEiR13ShaderContextEE(ptr noundef nonnull align 8 dereferenceable(824), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt8functionIF6VectorILm4EfEiR13ShaderContextEEC2IZ4mainE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN10RenderHelp14SetPixelShaderESt8functionIF6VectorILm4EfER13ShaderContextEE(ptr noundef nonnull align 8 dereferenceable(824), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt8functionIF6VectorILm4EfER13ShaderContextEEC2IZ4mainE3$_1vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK5Model6nfacesEv(ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5Model4vertEii(ptr dead_on_unwind noalias writable sret(%struct.Vector.39) align 4, ptr noundef nonnull align 8 dereferenceable(128), i32 noundef, i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Model2uvEii(ptr dead_on_unwind noalias writable sret(%struct.Vector.16) align 4, ptr noundef nonnull align 8 dereferenceable(128), i32 noundef, i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Model6normalEii(ptr dead_on_unwind noalias writable sret(%struct.Vector.39) align 4, ptr noundef nonnull align 8 dereferenceable(128), i32 noundef, i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN10RenderHelp13DrawPrimitiveEv(ptr noundef nonnull align 8 dereferenceable(824)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN10RenderHelp8SaveFileEPKc(ptr noundef nonnull align 8 dereferenceable(824), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5ModelD2Ev(ptr noundef nonnull align 8 dereferenceable(128)) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN10RenderHelpD2Ev(ptr noundef nonnull align 8 dereferenceable(824)) unnamed_addr #3 align 2

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{i64 0, i64 12, !12}
!12 = !{!7, !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass