; LLVM IR from szxp/3d-soft-engine :: src/Mesh.ll (ZN2g38loadCubeERNS_12TriangleMeshE)

; 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.g3::Vec" = type { [3 x float] }
%"class.std::initializer_list" = type { ptr, i64 }
%"struct.g3::TriangleMesh" = type { i32, %"class.std::unique_ptr", i32, %"class.std::unique_ptr.2", float, float, float, %"class.g3::Vec" }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.1" }
%"struct.std::_Head_base.1" = type { ptr }
%"class.std::unique_ptr.2" = type { %"struct.std::__uniq_ptr_data.3" }
%"struct.std::__uniq_ptr_data.3" = type { %"class.std::__uniq_ptr_impl.4" }
%"class.std::__uniq_ptr_impl.4" = type { %"class.std::tuple.5" }
%"class.std::tuple.5" = type { %"struct.std::_Tuple_impl.6" }
%"struct.std::_Tuple_impl.6" = type { %"struct.std::_Head_base.9" }
%"struct.std::_Head_base.9" = type { ptr }
%"struct.g3::Vertex" = type { %"class.g3::Vec" }
%"struct.g3::Triangle" = type { [3 x i32] }

@__const._ZN2g38loadCubeERNS_12TriangleMeshE.vs = external hidden unnamed_addr constant [24 x float], align 16
@__const._ZN2g38loadCubeERNS_12TriangleMeshE.indices = external hidden unnamed_addr constant [36 x i32], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2g38loadCubeERNS_12TriangleMeshE(ptr noundef nonnull align 8 dereferenceable(56) %0) #0 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca [24 x float], align 16
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.g3::Vec", align 4
  %9 = alloca %"class.std::initializer_list", align 8
  %10 = alloca [3 x float], align 4
  %11 = alloca [36 x i32], align 16
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %"class.g3::Vec", align 4
  %15 = alloca %"class.std::initializer_list", align 8
  %16 = alloca [3 x float], align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = getelementptr inbounds %"struct.g3::TriangleMesh", ptr %17, i32 0, i32 0
  store i32 8, ptr %18, align 8, !tbaa !9
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  %20 = getelementptr inbounds %"struct.g3::TriangleMesh", ptr %19, i32 0, i32 1
  %21 = load ptr, ptr %2, align 8, !tbaa !5
  %22 = getelementptr inbounds %"struct.g3::TriangleMesh", ptr %21, i32 0, i32 0
  %23 = load i32, ptr %22, align 8, !tbaa !9
  %24 = zext i32 %23 to i64
  %25 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %24, i64 12)
  %26 = extractvalue { i64, i1 } %25, 1
  %27 = extractvalue { i64, i1 } %25, 0
  %28 = select i1 %26, i64 -1, i64 %27
  %29 = call noalias noundef nonnull ptr @_Znam(i64 noundef %28) #8
  %30 = icmp eq i64 %24, 0
  br i1 %30, label %38, label %31

31:                                               ; preds = %1
  %32 = getelementptr inbounds %"struct.g3::Vertex", ptr %29, i64 %24
  br label %33

33:                                               ; preds = %35, %31
  %34 = phi ptr [ %29, %31 ], [ %36, %35 ]
  invoke void @_ZN2g36VertexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %34)
          to label %35 unwind label %46

35:                                               ; preds = %33
  %36 = getelementptr inbounds %"struct.g3::Vertex", ptr %34, i64 1
  %37 = icmp eq ptr %36, %32
  br i1 %37, label %38, label %33

38:                                               ; preds = %35, %1
  call void @_ZNSt10unique_ptrIA_N2g36VertexESt14default_deleteIS2_EE5resetIPS1_vEEvT_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef %29) #9
  call void @llvm.lifetime.start.p0(i64 96, ptr %5) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %5, ptr align 16 @__const._ZN2g38loadCubeERNS_12TriangleMeshE.vs, i64 96, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #9
  store i32 0, ptr %6, align 4, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #9
  store i32 0, ptr %7, align 4, !tbaa !26
  br label %39

39:                                               ; preds = %80, %38
  %40 = load i32, ptr %6, align 4, !tbaa !26
  %41 = load ptr, ptr %2, align 8, !tbaa !5
  %42 = getelementptr inbounds %"struct.g3::TriangleMesh", ptr %41, i32 0, i32 0
  %43 = load i32, ptr %42, align 8, !tbaa !9
  %44 = icmp ult i32 %40, %43
  br i1 %44, label %50, label %45

45:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #9
  br label %85

46:                                               ; preds = %33
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %3, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %4, align 4
  call void @_ZdaPvm(ptr noundef %29, i64 noundef %28) #10
  br label %165

50:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 12, ptr %10) #9
  %51 = load i32, ptr %7, align 4, !tbaa !26
  %52 = zext i32 %51 to i64
  %53 = getelementptr inbounds [24 x float], ptr %5, i64 0, i64 %52
  %54 = load float, ptr %53, align 4, !tbaa !27
  store float %54, ptr %10, align 4, !tbaa !27
  %55 = getelementptr inbounds float, ptr %10, i64 1
  %56 = load i32, ptr %7, align 4, !tbaa !26
  %57 = add i32 %56, 1
  %58 = zext i32 %57 to i64
  %59 = getelementptr inbounds [24 x float], ptr %5, i64 0, i64 %58
  %60 = load float, ptr %59, align 4, !tbaa !27
  store float %60, ptr %55, align 4, !tbaa !27
  %61 = getelementptr inbounds float, ptr %10, i64 2
  %62 = load i32, ptr %7, align 4, !tbaa !26
  %63 = add i32 %62, 2
  %64 = zext i32 %63 to i64
  %65 = getelementptr inbounds [24 x float], ptr %5, i64 0, i64 %64
  %66 = load float, ptr %65, align 4, !tbaa !27
  store float %66, ptr %61, align 4, !tbaa !27
  %67 = getelementptr inbounds %"class.std::initializer_list", ptr %9, i32 0, i32 0
  store ptr %10, ptr %67, align 8, !tbaa !28
  %68 = getelementptr inbounds %"class.std::initializer_list", ptr %9, i32 0, i32 1
  store i64 3, ptr %68, align 8, !tbaa !31
  %69 = getelementptr inbounds { ptr, i64 }, ptr %9, i32 0, i32 0
  %70 = load ptr, ptr %69, align 8
  %71 = getelementptr inbounds { ptr, i64 }, ptr %9, i32 0, i32 1
  %72 = load i64, ptr %71, align 8
  call void @_ZN2g33VecILm3EEC2ESt16initializer_listIfE(ptr noundef nonnull align 4 dereferenceable(12) %8, ptr %70, i64 %72)
  %73 = load ptr, ptr %2, align 8, !tbaa !5
  %74 = getelementptr inbounds %"struct.g3::TriangleMesh", ptr %73, i32 0, i32 1
  %75 = load i32, ptr %6, align 4, !tbaa !26
  %76 = zext i32 %75 to i64
  %77 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt10unique_ptrIA_N2g36VertexESt14default_deleteIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(8) %74, i64 noundef %76)
  %78 = getelementptr inbounds %"struct.g3::Vertex", ptr %77, i32 0, i32 0
  %79 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN2g33VecILm3EEaSES1_(ptr noundef nonnull align 4 dereferenceable(12) %78, ptr noundef %8)
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #9
  br label %80

80:                                               ; preds = %50
  %81 = load i32, ptr %6, align 4, !tbaa !26
  %82 = add i32 %81, 1
  store i32 %82, ptr %6, align 4, !tbaa !26
  %83 = load i32, ptr %7, align 4, !tbaa !26
  %84 = add i32 %83, 3
  store i32 %84, ptr %7, align 4, !tbaa !26
  br label %39, !llvm.loop !32

85:                                               ; preds = %45
  %86 = load ptr, ptr %2, align 8, !tbaa !5
  %87 = getelementptr inbounds %"struct.g3::TriangleMesh", ptr %86, i32 0, i32 2
  store i32 12, ptr %87, align 8, !tbaa !34
  %88 = load ptr, ptr %2, align 8, !tbaa !5
  %89 = getelementptr inbounds %"struct.g3::TriangleMesh", ptr %88, i32 0, i32 3
  %90 = load ptr, ptr %2, align 8, !tbaa !5
  %91 = getelementptr inbounds %"struct.g3::TriangleMesh", ptr %90, i32 0, i32 2
  %92 = load i32, ptr %91, align 8, !tbaa !34
  %93 = zext i32 %92 to i64
  %94 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %93, i64 12)
  %95 = extractvalue { i64, i1 } %94, 1
  %96 = extractvalue { i64, i1 } %94, 0
  %97 = select i1 %95, i64 -1, i64 %96
  %98 = call noalias noundef nonnull ptr @_Znam(i64 noundef %97) #8
  call void @_ZNSt10unique_ptrIA_N2g38TriangleESt14default_deleteIS2_EE5resetIPS1_vEEvT_(ptr noundef nonnull align 8 dereferenceable(8) %89, ptr noundef %98) #9
  call void @llvm.lifetime.start.p0(i64 144, ptr %11) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %11, ptr align 16 @__const._ZN2g38loadCubeERNS_12TriangleMeshE.indices, i64 144, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #9
  store i32 0, ptr %12, align 4, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  store i32 0, ptr %13, align 4, !tbaa !26
  br label %99

99:                                               ; preds = %142, %85
  %100 = load i32, ptr %12, align 4, !tbaa !26
  %101 = load ptr, ptr %2, align 8, !tbaa !5
  %102 = getelementptr inbounds %"struct.g3::TriangleMesh", ptr %101, i32 0, i32 2
  %103 = load i32, ptr %102, align 8, !tbaa !34
  %104 = icmp ult i32 %100, %103
  br i1 %104, label %106, label %105

105:                                              ; preds = %99
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  br label %147

106:                                              ; preds = %99
  %107 = load i32, ptr %13, align 4, !tbaa !26
  %108 = zext i32 %107 to i64
  %109 = getelementptr inbounds [36 x i32], ptr %11, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !26
  %111 = load ptr, ptr %2, align 8, !tbaa !5
  %112 = getelementptr inbounds %"struct.g3::TriangleMesh", ptr %111, i32 0, i32 3
  %113 = load i32, ptr %12, align 4, !tbaa !26
  %114 = zext i32 %113 to i64
  %115 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt10unique_ptrIA_N2g38TriangleESt14default_deleteIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(8) %112, i64 noundef %114)
  %116 = getelementptr inbounds %"struct.g3::Triangle", ptr %115, i32 0, i32 0
  %117 = getelementptr inbounds [3 x i32], ptr %116, i64 0, i64 0
  store i32 %110, ptr %117, align 4, !tbaa !26
  %118 = load i32, ptr %13, align 4, !tbaa !26
  %119 = add i32 %118, 1
  %120 = zext i32 %119 to i64
  %121 = getelementptr inbounds [36 x i32], ptr %11, i64 0, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !26
  %123 = load ptr, ptr %2, align 8, !tbaa !5
  %124 = getelementptr inbounds %"struct.g3::TriangleMesh", ptr %123, i32 0, i32 3
  %125 = load i32, ptr %12, align 4, !tbaa !26
  %126 = zext i32 %125 to i64
  %127 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt10unique_ptrIA_N2g38TriangleESt14default_deleteIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(8) %124, i64 noundef %126)
  %128 = getelementptr inbounds %"struct.g3::Triangle", ptr %127, i32 0, i32 0
  %129 = getelementptr inbounds [3 x i32], ptr %128, i64 0, i64 1
  store i32 %122, ptr %129, align 4, !tbaa !26
  %130 = load i32, ptr %13, align 4, !tbaa !26
  %131 = add i32 %130, 2
  %132 = zext i32 %131 to i64
  %133 = getelementptr inbounds [36 x i32], ptr %11, i64 0, i64 %132
  %134 = load i32, ptr %133, align 4, !tbaa !26
  %135 = load ptr, ptr %2, align 8, !tbaa !5
  %136 = getelementptr inbounds %"struct.g3::TriangleMesh", ptr %135, i32 0, i32 3
  %137 = load i32, ptr %12, align 4, !tbaa !26
  %138 = zext i32 %137 to i64
  %139 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt10unique_ptrIA_N2g38TriangleESt14default_deleteIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(8) %136, i64 noundef %138)
  %140 = getelementptr inbounds %"struct.g3::Triangle", ptr %139, i32 0, i32 0
  %141 = getelementptr inbounds [3 x i32], ptr %140, i64 0, i64 2
  store i32 %134, ptr %141, align 4, !tbaa !26
  br label %142

142:                                              ; preds = %106
  %143 = load i32, ptr %12, align 4, !tbaa !26
  %144 = add i32 %143, 1
  store i32 %144, ptr %12, align 4, !tbaa !26
  %145 = load i32, ptr %13, align 4, !tbaa !26
  %146 = add i32 %145, 3
  store i32 %146, ptr %13, align 4, !tbaa !26
  br label %99, !llvm.loop !35

147:                                              ; preds = %105
  %148 = load ptr, ptr %2, align 8, !tbaa !5
  %149 = getelementptr inbounds %"struct.g3::TriangleMesh", ptr %148, i32 0, i32 6
  store float 0.000000e+00, ptr %149, align 8, !tbaa !36
  %150 = load ptr, ptr %2, align 8, !tbaa !5
  %151 = getelementptr inbounds %"struct.g3::TriangleMesh", ptr %150, i32 0, i32 5
  store float 0.000000e+00, ptr %151, align 4, !tbaa !37
  %152 = load ptr, ptr %2, align 8, !tbaa !5
  %153 = getelementptr inbounds %"struct.g3::TriangleMesh", ptr %152, i32 0, i32 4
  store float 0.000000e+00, ptr %153, align 8, !tbaa !38
  call void @llvm.lifetime.start.p0(i64 12, ptr %16) #9
  store float 4.000000e+00, ptr %16, align 4, !tbaa !27
  %154 = getelementptr inbounds float, ptr %16, i64 1
  store float 2.000000e+00, ptr %154, align 4, !tbaa !27
  %155 = getelementptr inbounds float, ptr %16, i64 2
  store float -2.000000e+00, ptr %155, align 4, !tbaa !27
  %156 = getelementptr inbounds %"class.std::initializer_list", ptr %15, i32 0, i32 0
  store ptr %16, ptr %156, align 8, !tbaa !28
  %157 = getelementptr inbounds %"class.std::initializer_list", ptr %15, i32 0, i32 1
  store i64 3, ptr %157, align 8, !tbaa !31
  %158 = getelementptr inbounds { ptr, i64 }, ptr %15, i32 0, i32 0
  %159 = load ptr, ptr %158, align 8
  %160 = getelementptr inbounds { ptr, i64 }, ptr %15, i32 0, i32 1
  %161 = load i64, ptr %160, align 8
  call void @_ZN2g33VecILm3EEC2ESt16initializer_listIfE(ptr noundef nonnull align 4 dereferenceable(12) %14, ptr %159, i64 %161)
  %162 = load ptr, ptr %2, align 8, !tbaa !5
  %163 = getelementptr inbounds %"struct.g3::TriangleMesh", ptr %162, i32 0, i32 7
  %164 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN2g33VecILm3EEaSES1_(ptr noundef nonnull align 4 dereferenceable(12) %163, ptr noundef %14)
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #9
  call void @llvm.lifetime.end.p0(i64 144, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 96, ptr %5) #9
  ret void

165:                                              ; preds = %46
  %166 = load ptr, ptr %3, align 8
  %167 = load i32, ptr %4, align 4
  %168 = insertvalue { ptr, i32 } poison, ptr %166, 0
  %169 = insertvalue { ptr, i32 } %168, i32 %167, 1
  resume { ptr, i32 } %169
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10unique_ptrIA_N2g36VertexESt14default_deleteIS2_EE5resetIPS1_vEEvT_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN2g36VertexC2Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #4 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPvm(ptr noundef, i64 noundef) #5

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

; 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) #7

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2g33VecILm3EEC2ESt16initializer_listIfE(ptr noundef nonnull align 4 dereferenceable(12), ptr, i64) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt10unique_ptrIA_N2g36VertexESt14default_deleteIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZN2g33VecILm3EEaSES1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef) #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10unique_ptrIA_N2g38TriangleESt14default_deleteIS2_EE5resetIPS1_vEEvT_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt10unique_ptrIA_N2g38TriangleESt14default_deleteIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #1 align 2

attributes #0 = { 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 #1 = { 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 #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nobuiltin allocsize(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 = { 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 #5 = { nobuiltin nounwind "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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { nounwind }
attributes #10 = { builtin 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTSN2g312TriangleMeshE", !11, i64 0, !12, i64 8, !11, i64 16, !18, i64 24, !24, i64 32, !24, i64 36, !24, i64 40, !25, i64 44}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSSt10unique_ptrIA_N2g36VertexESt14default_deleteIS2_EE", !13, i64 0}
!13 = !{!"_ZTSSt15__uniq_ptr_dataIN2g36VertexESt14default_deleteIA_S1_ELb1ELb1EE", !14, i64 0}
!14 = !{!"_ZTSSt15__uniq_ptr_implIN2g36VertexESt14default_deleteIA_S1_EE", !15, i64 0}
!15 = !{!"_ZTSSt5tupleIJPN2g36VertexESt14default_deleteIA_S1_EEE", !16, i64 0}
!16 = !{!"_ZTSSt11_Tuple_implILm0EJPN2g36VertexESt14default_deleteIA_S1_EEE", !17, i64 0}
!17 = !{!"_ZTSSt10_Head_baseILm0EPN2g36VertexELb0EE", !6, i64 0}
!18 = !{!"_ZTSSt10unique_ptrIA_N2g38TriangleESt14default_deleteIS2_EE", !19, i64 0}
!19 = !{!"_ZTSSt15__uniq_ptr_dataIN2g38TriangleESt14default_deleteIA_S1_ELb1ELb1EE", !20, i64 0}
!20 = !{!"_ZTSSt15__uniq_ptr_implIN2g38TriangleESt14default_deleteIA_S1_EE", !21, i64 0}
!21 = !{!"_ZTSSt5tupleIJPN2g38TriangleESt14default_deleteIA_S1_EEE", !22, i64 0}
!22 = !{!"_ZTSSt11_Tuple_implILm0EJPN2g38TriangleESt14default_deleteIA_S1_EEE", !23, i64 0}
!23 = !{!"_ZTSSt10_Head_baseILm0EPN2g38TriangleELb0EE", !6, i64 0}
!24 = !{!"float", !7, i64 0}
!25 = !{!"_ZTSN2g33VecILm3EEE", !7, i64 0}
!26 = !{!11, !11, i64 0}
!27 = !{!24, !24, i64 0}
!28 = !{!29, !6, i64 0}
!29 = !{!"_ZTSSt16initializer_listIfE", !6, i64 0, !30, i64 8}
!30 = !{!"long", !7, i64 0}
!31 = !{!29, !30, i64 8}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{!10, !11, i64 16}
!35 = distinct !{!35, !33}
!36 = !{!10, !24, i64 40}
!37 = !{!10, !24, i64 36}
!38 = !{!10, !24, i64 32}


; 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.g3::Vec" = type { [3 x float] }

@__const._ZN2g38loadCubeERNS_12TriangleMeshE.vs = external hidden unnamed_addr constant [24 x float], align 16
@__const._ZN2g38loadCubeERNS_12TriangleMeshE.indices = external hidden unnamed_addr constant [36 x i32], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2g38loadCubeERNS_12TriangleMeshE(ptr noundef nonnull align 8 dereferenceable(56) %0) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.g3::Vec", align 4
  %3 = alloca [3 x float], align 4
  %4 = alloca %"class.g3::Vec", align 4
  %5 = alloca [3 x float], align 8
  store i32 8, ptr %0, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  %7 = tail call noalias noundef nonnull dereferenceable(96) ptr @_Znam(i64 noundef 96) #6
  invoke void @_ZN2g36VertexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %7)
          to label %8 unwind label %23

8:                                                ; preds = %1
  %.ptr.1 = getelementptr inbounds i8, ptr %7, i64 12
  invoke void @_ZN2g36VertexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.1)
          to label %9 unwind label %23

9:                                                ; preds = %8
  %.ptr.2 = getelementptr inbounds i8, ptr %7, i64 24
  invoke void @_ZN2g36VertexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.2)
          to label %10 unwind label %23

10:                                               ; preds = %9
  %.ptr.3 = getelementptr inbounds i8, ptr %7, i64 36
  invoke void @_ZN2g36VertexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.3)
          to label %11 unwind label %23

11:                                               ; preds = %10
  %.ptr.4 = getelementptr inbounds i8, ptr %7, i64 48
  invoke void @_ZN2g36VertexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.4)
          to label %12 unwind label %23

12:                                               ; preds = %11
  %.ptr.5 = getelementptr inbounds i8, ptr %7, i64 60
  invoke void @_ZN2g36VertexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.5)
          to label %13 unwind label %23

13:                                               ; preds = %12
  %.ptr.6 = getelementptr inbounds i8, ptr %7, i64 72
  invoke void @_ZN2g36VertexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.6)
          to label %14 unwind label %23

14:                                               ; preds = %13
  %.ptr.7 = getelementptr inbounds i8, ptr %7, i64 84
  invoke void @_ZN2g36VertexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.7)
          to label %15 unwind label %23

15:                                               ; preds = %14
  tail call void @_ZNSt10unique_ptrIA_N2g36VertexESt14default_deleteIS2_EE5resetIPS1_vEEvT_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull %7) #7
  %16 = load i32, ptr %0, align 8, !tbaa !5
  %.not = icmp eq i32 %16, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %15
  %17 = getelementptr inbounds i8, ptr %3, i64 4
  %18 = getelementptr inbounds i8, ptr %3, i64 8
  br label %25

._crit_edge:                                      ; preds = %25, %15
  %19 = getelementptr inbounds i8, ptr %0, i64 16
  store i32 12, ptr %19, align 8, !tbaa !25
  %20 = getelementptr inbounds i8, ptr %0, i64 24
  %21 = call noalias noundef nonnull dereferenceable(144) ptr @_Znam(i64 noundef 144) #6
  call void @_ZNSt10unique_ptrIA_N2g38TriangleESt14default_deleteIS2_EE5resetIPS1_vEEvT_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull %21) #7
  %22 = load i32, ptr %19, align 8, !tbaa !25
  %.not47 = icmp eq i32 %22, 0
  br i1 %.not47, label %._crit_edge46, label %.lr.ph45

23:                                               ; preds = %14, %13, %12, %11, %10, %9, %8, %1
  %24 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdaPvm(ptr noundef nonnull %7, i64 noundef 96) #8
  resume { ptr, i32 } %24

25:                                               ; preds = %.lr.ph, %25
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %25 ]
  %.03540 = phi i32 [ 0, %.lr.ph ], [ %39, %25 ]
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #7
  %26 = zext i32 %.03540 to i64
  %27 = getelementptr inbounds [24 x float], ptr @__const._ZN2g38loadCubeERNS_12TriangleMeshE.vs, i64 0, i64 %26
  %28 = load float, ptr %27, align 4, !tbaa !26
  store float %28, ptr %3, align 4, !tbaa !26
  %29 = add i32 %.03540, 1
  %30 = zext i32 %29 to i64
  %31 = getelementptr inbounds [24 x float], ptr @__const._ZN2g38loadCubeERNS_12TriangleMeshE.vs, i64 0, i64 %30
  %32 = load float, ptr %31, align 4, !tbaa !26
  store float %32, ptr %17, align 4, !tbaa !26
  %33 = add i32 %.03540, 2
  %34 = zext i32 %33 to i64
  %35 = getelementptr inbounds [24 x float], ptr @__const._ZN2g38loadCubeERNS_12TriangleMeshE.vs, i64 0, i64 %34
  %36 = load float, ptr %35, align 4, !tbaa !26
  store float %36, ptr %18, align 4, !tbaa !26
  call void @_ZN2g33VecILm3EEC2ESt16initializer_listIfE(ptr noundef nonnull align 4 dereferenceable(12) %2, ptr nonnull %3, i64 3)
  %37 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt10unique_ptrIA_N2g36VertexESt14default_deleteIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(8) %6, i64 noundef %indvars.iv)
  %38 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN2g33VecILm3EEaSES1_(ptr noundef nonnull align 4 dereferenceable(12) %37, ptr noundef nonnull %2)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %39 = add i32 %.03540, 3
  %40 = load i32, ptr %0, align 8, !tbaa !5
  %41 = zext i32 %40 to i64
  %42 = icmp ult i64 %indvars.iv.next, %41
  br i1 %42, label %25, label %._crit_edge, !llvm.loop !27

._crit_edge46:                                    ; preds = %.lr.ph45, %._crit_edge
  %43 = getelementptr inbounds i8, ptr %0, i64 40
  store float 0.000000e+00, ptr %43, align 8, !tbaa !29
  %44 = getelementptr inbounds i8, ptr %0, i64 32
  store <2 x float> zeroinitializer, ptr %44, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #7
  store <2 x float> <float 4.000000e+00, float 2.000000e+00>, ptr %5, align 8, !tbaa !26
  %45 = getelementptr inbounds i8, ptr %5, i64 8
  store float -2.000000e+00, ptr %45, align 8, !tbaa !26
  call void @_ZN2g33VecILm3EEC2ESt16initializer_listIfE(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr nonnull %5, i64 3)
  %46 = getelementptr inbounds i8, ptr %0, i64 44
  %47 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN2g33VecILm3EEaSES1_(ptr noundef nonnull align 4 dereferenceable(12) %46, ptr noundef nonnull %4)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #7
  ret void

.lr.ph45:                                         ; preds = %._crit_edge, %.lr.ph45
  %indvars.iv49 = phi i64 [ %indvars.iv.next50, %.lr.ph45 ], [ 0, %._crit_edge ]
  %.03643 = phi i32 [ %64, %.lr.ph45 ], [ 0, %._crit_edge ]
  %48 = zext i32 %.03643 to i64
  %49 = getelementptr inbounds [36 x i32], ptr @__const._ZN2g38loadCubeERNS_12TriangleMeshE.indices, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !30
  %51 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt10unique_ptrIA_N2g38TriangleESt14default_deleteIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(8) %20, i64 noundef %indvars.iv49)
  store i32 %50, ptr %51, align 4, !tbaa !30
  %52 = add i32 %.03643, 1
  %53 = zext i32 %52 to i64
  %54 = getelementptr inbounds [36 x i32], ptr @__const._ZN2g38loadCubeERNS_12TriangleMeshE.indices, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !30
  %56 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt10unique_ptrIA_N2g38TriangleESt14default_deleteIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(8) %20, i64 noundef %indvars.iv49)
  %57 = getelementptr inbounds i8, ptr %56, i64 4
  store i32 %55, ptr %57, align 4, !tbaa !30
  %58 = add i32 %.03643, 2
  %59 = zext i32 %58 to i64
  %60 = getelementptr inbounds [36 x i32], ptr @__const._ZN2g38loadCubeERNS_12TriangleMeshE.indices, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !30
  %62 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt10unique_ptrIA_N2g38TriangleESt14default_deleteIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(8) %20, i64 noundef %indvars.iv49)
  %63 = getelementptr inbounds i8, ptr %62, i64 8
  store i32 %61, ptr %63, align 4, !tbaa !30
  %indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1
  %64 = add i32 %.03643, 3
  %65 = load i32, ptr %19, align 8, !tbaa !25
  %66 = zext i32 %65 to i64
  %67 = icmp ult i64 %indvars.iv.next50, %66
  br i1 %67, label %.lr.ph45, label %._crit_edge46, !llvm.loop !31
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10unique_ptrIA_N2g36VertexESt14default_deleteIS2_EE5resetIPS1_vEEvT_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #2

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPvm(ptr noundef, i64 noundef) local_unnamed_addr #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2g33VecILm3EEC2ESt16initializer_listIfE(ptr noundef nonnull align 4 dereferenceable(12), ptr, i64) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt10unique_ptrIA_N2g36VertexESt14default_deleteIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZN2g33VecILm3EEaSES1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10unique_ptrIA_N2g38TriangleESt14default_deleteIS2_EE5resetIPS1_vEEvT_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt10unique_ptrIA_N2g38TriangleESt14default_deleteIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #1 align 2

attributes #0 = { 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 #1 = { 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 #2 = { nobuiltin allocsize(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 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 = { nobuiltin nounwind "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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { builtin allocsize(0) }
attributes #7 = { nounwind }
attributes #8 = { builtin 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, !7, i64 0}
!6 = !{!"_ZTSN2g312TriangleMeshE", !7, i64 0, !10, i64 8, !7, i64 16, !17, i64 24, !23, i64 32, !23, i64 36, !23, i64 40, !24, i64 44}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSSt10unique_ptrIA_N2g36VertexESt14default_deleteIS2_EE", !11, i64 0}
!11 = !{!"_ZTSSt15__uniq_ptr_dataIN2g36VertexESt14default_deleteIA_S1_ELb1ELb1EE", !12, i64 0}
!12 = !{!"_ZTSSt15__uniq_ptr_implIN2g36VertexESt14default_deleteIA_S1_EE", !13, i64 0}
!13 = !{!"_ZTSSt5tupleIJPN2g36VertexESt14default_deleteIA_S1_EEE", !14, i64 0}
!14 = !{!"_ZTSSt11_Tuple_implILm0EJPN2g36VertexESt14default_deleteIA_S1_EEE", !15, i64 0}
!15 = !{!"_ZTSSt10_Head_baseILm0EPN2g36VertexELb0EE", !16, i64 0}
!16 = !{!"any pointer", !8, i64 0}
!17 = !{!"_ZTSSt10unique_ptrIA_N2g38TriangleESt14default_deleteIS2_EE", !18, i64 0}
!18 = !{!"_ZTSSt15__uniq_ptr_dataIN2g38TriangleESt14default_deleteIA_S1_ELb1ELb1EE", !19, i64 0}
!19 = !{!"_ZTSSt15__uniq_ptr_implIN2g38TriangleESt14default_deleteIA_S1_EE", !20, i64 0}
!20 = !{!"_ZTSSt5tupleIJPN2g38TriangleESt14default_deleteIA_S1_EEE", !21, i64 0}
!21 = !{!"_ZTSSt11_Tuple_implILm0EJPN2g38TriangleESt14default_deleteIA_S1_EEE", !22, i64 0}
!22 = !{!"_ZTSSt10_Head_baseILm0EPN2g38TriangleELb0EE", !16, i64 0}
!23 = !{!"float", !8, i64 0}
!24 = !{!"_ZTSN2g33VecILm3EEE", !8, i64 0}
!25 = !{!6, !7, i64 16}
!26 = !{!23, !23, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!6, !23, i64 40}
!30 = !{!7, !7, i64 0}
!31 = distinct !{!31, !28}


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