; LLVM IR from ThePhysicsGuys/Physics3D :: graphics/meshRegistry.ll (ZN3P3D8Graphics12MeshRegistry9createBoxEfff)

; 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"

%"struct.P3D::Graphics::ExtendedTriangleMesh" = type { %"class.P3D::TriangleMesh", %"class.std::shared_ptr", %"class.std::shared_ptr.4", %"class.std::shared_ptr", %"class.std::shared_ptr" }
%"class.P3D::TriangleMesh" = type { %"class.P3D::MeshPrototype" }
%"class.P3D::MeshPrototype" = type { %"class.P3D::UniqueAlignedPointer", %"class.P3D::UniqueAlignedPointer.3", i32, i32 }
%"class.P3D::UniqueAlignedPointer" = type { ptr }
%"class.P3D::UniqueAlignedPointer.3" = type { ptr }
%"class.std::shared_ptr.4" = type { %"class.std::__shared_ptr.5" }
%"class.std::__shared_ptr.5" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.P3D::Polyhedron" = type { %"class.P3D::TriangleMesh" }
%"struct.P3D::Triangle" = type { %union.anon.10 }
%union.anon.10 = type { %struct.anon.11 }
%struct.anon.11 = type { i32, i32, i32 }
%"struct.P3D::Vector" = type { %union.anon }
%union.anon = type { [3 x float] }
%"struct.P3D::Vector.7" = type { %union.anon.8 }
%union.anon.8 = type { [2 x float] }
%struct.anon.9 = type { float, float }

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3P3D6VectorIfLm3EEC2Efff(ptr noundef nonnull align 4 dereferenceable(12), float noundef, float noundef, float noundef) unnamed_addr #1 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) #2

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt10shared_ptrIA_KN3P3D6VectorIfLm2EEEEC2IS2_vEEPT_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #4 align 2

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3P3D8Graphics12MeshRegistry9createBoxEfff(ptr dead_on_unwind noalias writable sret(%"struct.P3D::Graphics::ExtendedTriangleMesh") align 8 %0, float noundef %1, float noundef %2, float noundef %3) #7 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca %"class.P3D::Polyhedron", align 8
  %10 = alloca i1, align 1
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  %16 = alloca %"struct.P3D::Triangle", align 4
  %17 = alloca { i64, i32 }, align 8
  %18 = alloca [3 x %"struct.P3D::Vector"], align 16
  %19 = alloca %"struct.P3D::Vector", align 4
  %20 = alloca { <2 x float>, float }, align 8
  %21 = alloca %"struct.P3D::Vector", align 4
  %22 = alloca { <2 x float>, float }, align 8
  %23 = alloca %"struct.P3D::Vector", align 4
  %24 = alloca { <2 x float>, float }, align 8
  %25 = alloca %"struct.P3D::Vector", align 4
  %26 = alloca %"struct.P3D::Triangle", align 4
  %27 = alloca { i64, i32 }, align 4
  %28 = alloca { <2 x float>, float }, align 8
  %29 = alloca i32, align 4
  %30 = alloca %"struct.P3D::Vector", align 4
  %31 = alloca i64, align 8
  %32 = alloca %"struct.P3D::Vector.7", align 4
  %33 = alloca %"struct.P3D::Vector.7", align 4
  %34 = alloca %"class.std::shared_ptr.4", align 8
  store ptr %0, ptr %5, align 8
  store float %1, ptr %6, align 4, !tbaa !5
  store float %2, ptr %7, align 4, !tbaa !5
  store float %3, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #10
  %35 = load float, ptr %6, align 4, !tbaa !5
  %36 = load float, ptr %7, align 4, !tbaa !5
  %37 = load float, ptr %8, align 4, !tbaa !5
  call void @_ZN3P3D12ShapeLibrary9createBoxEfff(ptr dead_on_unwind writable sret(%"class.P3D::Polyhedron") align 8 %9, float noundef %35, float noundef %36, float noundef %37)
  store i1 false, ptr %10, align 1
  invoke void @_ZN3P3D8Graphics20ExtendedTriangleMesh25generateSplitNormalsShapeERKNS_12TriangleMeshE(ptr dead_on_unwind writable sret(%"struct.P3D::Graphics::ExtendedTriangleMesh") align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %9)
          to label %38 unwind label %64

38:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #10
  %39 = getelementptr inbounds %"class.P3D::MeshPrototype", ptr %0, i32 0, i32 3
  %40 = load i32, ptr %39, align 4, !tbaa !9
  %41 = mul nsw i32 %40, 3
  %42 = sext i32 %41 to i64
  %43 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %42, i64 8)
  %44 = extractvalue { i64, i1 } %43, 1
  %45 = extractvalue { i64, i1 } %43, 0
  %46 = select i1 %44, i64 -1, i64 %45
  %47 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %46) #11
          to label %48 unwind label %68

48:                                               ; preds = %38
  %49 = icmp eq i64 %42, 0
  br i1 %49, label %56, label %50

50:                                               ; preds = %48
  %51 = getelementptr inbounds %"struct.P3D::Vector.7", ptr %47, i64 %42
  br label %52

52:                                               ; preds = %52, %50
  %53 = phi ptr [ %47, %50 ], [ %54, %52 ]
  call void @_ZN3P3D6VectorIfLm2EEC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %53) #10
  %54 = getelementptr inbounds %"struct.P3D::Vector.7", ptr %53, i64 1
  %55 = icmp eq ptr %54, %51
  br i1 %55, label %56, label %52

56:                                               ; preds = %52, %48
  store ptr %47, ptr %13, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #10
  store i64 0, ptr %14, align 8, !tbaa !16
  br label %57

57:                                               ; preds = %217, %56
  %58 = load i64, ptr %14, align 8, !tbaa !16
  %59 = getelementptr inbounds %"class.P3D::MeshPrototype", ptr %0, i32 0, i32 3
  %60 = load i32, ptr %59, align 4, !tbaa !9
  %61 = sext i32 %60 to i64
  %62 = icmp ult i64 %58, %61
  br i1 %62, label %72, label %63

63:                                               ; preds = %57
  store i32 2, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #10
  br label %223

64:                                               ; preds = %4
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %11, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %12, align 4
  br label %240

68:                                               ; preds = %38
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %11, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %12, align 4
  br label %237

72:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 12, ptr %16) #10
  %73 = load i64, ptr %14, align 8, !tbaa !16
  %74 = trunc i64 %73 to i32
  %75 = invoke { i64, i32 } @_ZNK3P3D13MeshPrototype11getTriangleEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %74)
          to label %76 unwind label %127

76:                                               ; preds = %72
  %77 = getelementptr inbounds %"struct.P3D::Triangle", ptr %16, i32 0, i32 0
  %78 = getelementptr inbounds %union.anon.10, ptr %77, i32 0, i32 0
  store { i64, i32 } %75, ptr %17, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %78, ptr align 8 %17, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 36, ptr %18) #10
  %79 = getelementptr inbounds [3 x %"struct.P3D::Vector"], ptr %18, i32 0, i32 0
  %80 = getelementptr inbounds %"struct.P3D::Vector", ptr %79, i64 3
  br label %81

81:                                               ; preds = %81, %76
  %82 = phi ptr [ %79, %76 ], [ %83, %81 ]
  call void @_ZN3P3D6VectorIfLm3EEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %82) #10
  %83 = getelementptr inbounds %"struct.P3D::Vector", ptr %82, i64 1
  %84 = icmp eq ptr %83, %80
  br i1 %84, label %85, label %81

85:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 12, ptr %19) #10
  %86 = getelementptr inbounds %"struct.P3D::Triangle", ptr %16, i32 0, i32 0
  %87 = getelementptr inbounds %struct.anon.11, ptr %86, i32 0, i32 0
  %88 = load i32, ptr %87, align 4, !tbaa !18
  %89 = invoke { <2 x float>, float } @_ZNK3P3D13MeshPrototype9getVertexEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %88)
          to label %90 unwind label %131

90:                                               ; preds = %85
  %91 = getelementptr inbounds %"struct.P3D::Vector", ptr %19, i32 0, i32 0
  %92 = getelementptr inbounds %union.anon, ptr %91, i32 0, i32 0
  store { <2 x float>, float } %89, ptr %20, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %92, ptr align 8 %20, i64 12, i1 false)
  %93 = getelementptr inbounds [3 x %"struct.P3D::Vector"], ptr %18, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %93, ptr align 4 %19, i64 12, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.end.p0(i64 12, ptr %19) #10
  call void @llvm.lifetime.start.p0(i64 12, ptr %21) #10
  %94 = getelementptr inbounds %"struct.P3D::Triangle", ptr %16, i32 0, i32 0
  %95 = getelementptr inbounds %struct.anon.11, ptr %94, i32 0, i32 1
  %96 = load i32, ptr %95, align 4, !tbaa !18
  %97 = invoke { <2 x float>, float } @_ZNK3P3D13MeshPrototype9getVertexEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %96)
          to label %98 unwind label %135

98:                                               ; preds = %90
  %99 = getelementptr inbounds %"struct.P3D::Vector", ptr %21, i32 0, i32 0
  %100 = getelementptr inbounds %union.anon, ptr %99, i32 0, i32 0
  store { <2 x float>, float } %97, ptr %22, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %100, ptr align 8 %22, i64 12, i1 false)
  %101 = getelementptr inbounds [3 x %"struct.P3D::Vector"], ptr %18, i64 0, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %101, ptr align 4 %21, i64 12, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.end.p0(i64 12, ptr %21) #10
  call void @llvm.lifetime.start.p0(i64 12, ptr %23) #10
  %102 = getelementptr inbounds %"struct.P3D::Triangle", ptr %16, i32 0, i32 0
  %103 = getelementptr inbounds %struct.anon.11, ptr %102, i32 0, i32 2
  %104 = load i32, ptr %103, align 4, !tbaa !18
  %105 = invoke { <2 x float>, float } @_ZNK3P3D13MeshPrototype9getVertexEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %104)
          to label %106 unwind label %139

106:                                              ; preds = %98
  %107 = getelementptr inbounds %"struct.P3D::Vector", ptr %23, i32 0, i32 0
  %108 = getelementptr inbounds %union.anon, ptr %107, i32 0, i32 0
  store { <2 x float>, float } %105, ptr %24, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %108, ptr align 8 %24, i64 12, i1 false)
  %109 = getelementptr inbounds [3 x %"struct.P3D::Vector"], ptr %18, i64 0, i64 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %109, ptr align 4 %23, i64 12, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.end.p0(i64 12, ptr %23) #10
  call void @llvm.lifetime.start.p0(i64 12, ptr %25) #10
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %26, ptr align 4 %16, i64 12, i1 false), !tbaa.struct !19
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %27, ptr align 4 %26, i64 12, i1 false)
  %110 = getelementptr inbounds { i64, i32 }, ptr %27, i32 0, i32 0
  %111 = load i64, ptr %110, align 4
  %112 = getelementptr inbounds { i64, i32 }, ptr %27, i32 0, i32 1
  %113 = load i32, ptr %112, align 4
  %114 = invoke { <2 x float>, float } @_ZNK3P3D12TriangleMesh22getNormalVecOfTriangleENS_8TriangleE(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 %111, i32 %113)
          to label %115 unwind label %143

115:                                              ; preds = %106
  %116 = getelementptr inbounds %"struct.P3D::Vector", ptr %25, i32 0, i32 0
  %117 = getelementptr inbounds %union.anon, ptr %116, i32 0, i32 0
  store { <2 x float>, float } %114, ptr %28, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %117, ptr align 8 %28, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #10
  %118 = call noundef i64 @_ZN3P3D21getAbsMaxElementIndexIfLm3EEEmRKNS_6VectorIT_XT0_EEE(ptr noundef nonnull align 4 dereferenceable(12) %25) #10
  %119 = trunc i64 %118 to i32
  store i32 %119, ptr %29, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 12, ptr %30) #10
  %120 = load float, ptr %6, align 4, !tbaa !5
  %121 = load float, ptr %7, align 4, !tbaa !5
  %122 = load float, ptr %8, align 4, !tbaa !5
  call void @_ZN3P3D6VectorIfLm3EEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %30, float noundef %120, float noundef %121, float noundef %122) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #10
  store i64 0, ptr %31, align 8, !tbaa !16
  br label %123

123:                                              ; preds = %204, %115
  %124 = load i64, ptr %31, align 8, !tbaa !16
  %125 = icmp ult i64 %124, 3
  br i1 %125, label %147, label %126

126:                                              ; preds = %123
  store i32 5, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #10
  br label %216

127:                                              ; preds = %72
  %128 = landingpad { ptr, i32 }
          cleanup
  %129 = extractvalue { ptr, i32 } %128, 0
  store ptr %129, ptr %11, align 8
  %130 = extractvalue { ptr, i32 } %128, 1
  store i32 %130, ptr %12, align 4
  br label %222

131:                                              ; preds = %85
  %132 = landingpad { ptr, i32 }
          cleanup
  %133 = extractvalue { ptr, i32 } %132, 0
  store ptr %133, ptr %11, align 8
  %134 = extractvalue { ptr, i32 } %132, 1
  store i32 %134, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %19) #10
  br label %221

135:                                              ; preds = %90
  %136 = landingpad { ptr, i32 }
          cleanup
  %137 = extractvalue { ptr, i32 } %136, 0
  store ptr %137, ptr %11, align 8
  %138 = extractvalue { ptr, i32 } %136, 1
  store i32 %138, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %21) #10
  br label %221

139:                                              ; preds = %98
  %140 = landingpad { ptr, i32 }
          cleanup
  %141 = extractvalue { ptr, i32 } %140, 0
  store ptr %141, ptr %11, align 8
  %142 = extractvalue { ptr, i32 } %140, 1
  store i32 %142, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %23) #10
  br label %221

143:                                              ; preds = %106
  %144 = landingpad { ptr, i32 }
          cleanup
  %145 = extractvalue { ptr, i32 } %144, 0
  store ptr %145, ptr %11, align 8
  %146 = extractvalue { ptr, i32 } %144, 1
  store i32 %146, ptr %12, align 4
  br label %220

147:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #10
  %148 = load i64, ptr %31, align 8, !tbaa !16
  %149 = getelementptr inbounds [3 x %"struct.P3D::Vector"], ptr %18, i64 0, i64 %148
  %150 = load i32, ptr %29, align 4, !tbaa !20
  %151 = sext i32 %150 to i64
  %152 = invoke <2 x float> @_ZN3P3D12withoutIndexIfLm3EEENS_6VectorIT_XmiT0_Li1EEEERKNS1_IS2_XT0_EEEm(ptr noundef nonnull align 4 dereferenceable(12) %149, i64 noundef %151)
          to label %153 unwind label %207

153:                                              ; preds = %147
  %154 = getelementptr inbounds %"struct.P3D::Vector.7", ptr %32, i32 0, i32 0
  %155 = getelementptr inbounds %union.anon.8, ptr %154, i32 0, i32 0
  store <2 x float> %152, ptr %155, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #10
  %156 = load i32, ptr %29, align 4, !tbaa !20
  %157 = sext i32 %156 to i64
  %158 = invoke <2 x float> @_ZN3P3D12withoutIndexIfLm3EEENS_6VectorIT_XmiT0_Li1EEEERKNS1_IS2_XT0_EEEm(ptr noundef nonnull align 4 dereferenceable(12) %30, i64 noundef %157)
          to label %159 unwind label %211

159:                                              ; preds = %153
  %160 = getelementptr inbounds %"struct.P3D::Vector.7", ptr %33, i32 0, i32 0
  %161 = getelementptr inbounds %union.anon.8, ptr %160, i32 0, i32 0
  store <2 x float> %158, ptr %161, align 4
  %162 = getelementptr inbounds %"struct.P3D::Vector.7", ptr %32, i32 0, i32 0
  %163 = getelementptr inbounds %struct.anon.9, ptr %162, i32 0, i32 0
  %164 = load float, ptr %163, align 4, !tbaa !18
  %165 = fpext float %164 to double
  %166 = getelementptr inbounds %"struct.P3D::Vector.7", ptr %33, i32 0, i32 0
  %167 = getelementptr inbounds %struct.anon.9, ptr %166, i32 0, i32 0
  %168 = load float, ptr %167, align 4, !tbaa !18
  %169 = fpext float %168 to double
  %170 = fdiv double %169, 2.000000e+00
  %171 = fadd double %165, %170
  %172 = getelementptr inbounds %"struct.P3D::Vector.7", ptr %33, i32 0, i32 0
  %173 = getelementptr inbounds %struct.anon.9, ptr %172, i32 0, i32 0
  %174 = load float, ptr %173, align 4, !tbaa !18
  %175 = fpext float %174 to double
  %176 = fdiv double %171, %175
  %177 = fptrunc double %176 to float
  %178 = getelementptr inbounds %"struct.P3D::Vector.7", ptr %32, i32 0, i32 0
  %179 = getelementptr inbounds %struct.anon.9, ptr %178, i32 0, i32 0
  store float %177, ptr %179, align 4, !tbaa !18
  %180 = getelementptr inbounds %"struct.P3D::Vector.7", ptr %32, i32 0, i32 0
  %181 = getelementptr inbounds %struct.anon.9, ptr %180, i32 0, i32 1
  %182 = load float, ptr %181, align 4, !tbaa !18
  %183 = fpext float %182 to double
  %184 = getelementptr inbounds %"struct.P3D::Vector.7", ptr %33, i32 0, i32 0
  %185 = getelementptr inbounds %struct.anon.9, ptr %184, i32 0, i32 1
  %186 = load float, ptr %185, align 4, !tbaa !18
  %187 = fpext float %186 to double
  %188 = fdiv double %187, 2.000000e+00
  %189 = fadd double %183, %188
  %190 = getelementptr inbounds %"struct.P3D::Vector.7", ptr %33, i32 0, i32 0
  %191 = getelementptr inbounds %struct.anon.9, ptr %190, i32 0, i32 1
  %192 = load float, ptr %191, align 4, !tbaa !18
  %193 = fpext float %192 to double
  %194 = fdiv double %189, %193
  %195 = fptrunc double %194 to float
  %196 = getelementptr inbounds %"struct.P3D::Vector.7", ptr %32, i32 0, i32 0
  %197 = getelementptr inbounds %struct.anon.9, ptr %196, i32 0, i32 1
  store float %195, ptr %197, align 4, !tbaa !18
  %198 = load ptr, ptr %13, align 8, !tbaa !15
  %199 = load i64, ptr %14, align 8, !tbaa !16
  %200 = mul i64 %199, 3
  %201 = load i64, ptr %31, align 8, !tbaa !16
  %202 = add i64 %200, %201
  %203 = getelementptr inbounds %"struct.P3D::Vector.7", ptr %198, i64 %202
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %203, ptr align 4 %32, i64 8, i1 false), !tbaa.struct !21
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #10
  br label %204

204:                                              ; preds = %159
  %205 = load i64, ptr %31, align 8, !tbaa !16
  %206 = add i64 %205, 1
  store i64 %206, ptr %31, align 8, !tbaa !16
  br label %123, !llvm.loop !22

207:                                              ; preds = %147
  %208 = landingpad { ptr, i32 }
          cleanup
  %209 = extractvalue { ptr, i32 } %208, 0
  store ptr %209, ptr %11, align 8
  %210 = extractvalue { ptr, i32 } %208, 1
  store i32 %210, ptr %12, align 4
  br label %215

211:                                              ; preds = %153
  %212 = landingpad { ptr, i32 }
          cleanup
  %213 = extractvalue { ptr, i32 } %212, 0
  store ptr %213, ptr %11, align 8
  %214 = extractvalue { ptr, i32 } %212, 1
  store i32 %214, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #10
  br label %215

215:                                              ; preds = %211, %207
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #10
  call void @llvm.lifetime.end.p0(i64 12, ptr %30) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #10
  br label %220

216:                                              ; preds = %126
  call void @llvm.lifetime.end.p0(i64 12, ptr %30) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #10
  call void @llvm.lifetime.end.p0(i64 12, ptr %25) #10
  call void @llvm.lifetime.end.p0(i64 36, ptr %18) #10
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #10
  br label %217

217:                                              ; preds = %216
  %218 = load i64, ptr %14, align 8, !tbaa !16
  %219 = add i64 %218, 1
  store i64 %219, ptr %14, align 8, !tbaa !16
  br label %57, !llvm.loop !24

220:                                              ; preds = %215, %143
  call void @llvm.lifetime.end.p0(i64 12, ptr %25) #10
  br label %221

221:                                              ; preds = %220, %139, %135, %131
  call void @llvm.lifetime.end.p0(i64 36, ptr %18) #10
  br label %222

222:                                              ; preds = %221, %127
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #10
  br label %237

223:                                              ; preds = %63
  call void @llvm.lifetime.start.p0(i64 16, ptr %34) #10
  %224 = load ptr, ptr %13, align 8, !tbaa !15
  invoke void @_ZNSt10shared_ptrIA_KN3P3D6VectorIfLm2EEEEC2IS2_vEEPT_(ptr noundef nonnull align 8 dereferenceable(16) %34, ptr noundef %224)
          to label %225 unwind label %228

225:                                              ; preds = %223
  invoke void @_ZN3P3D8Graphics20ExtendedTriangleMesh11setUVBufferERKSt10shared_ptrIA_KNS_6VectorIfLm2EEEE(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef nonnull align 8 dereferenceable(16) %34)
          to label %226 unwind label %232

226:                                              ; preds = %225
  call void @_ZNSt12__shared_ptrIA_KN3P3D6VectorIfLm2EEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %34) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %34) #10
  store i1 true, ptr %10, align 1
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #10
  %227 = load i1, ptr %10, align 1
  br i1 %227, label %239, label %238

228:                                              ; preds = %223
  %229 = landingpad { ptr, i32 }
          cleanup
  %230 = extractvalue { ptr, i32 } %229, 0
  store ptr %230, ptr %11, align 8
  %231 = extractvalue { ptr, i32 } %229, 1
  store i32 %231, ptr %12, align 4
  br label %236

232:                                              ; preds = %225
  %233 = landingpad { ptr, i32 }
          cleanup
  %234 = extractvalue { ptr, i32 } %233, 0
  store ptr %234, ptr %11, align 8
  %235 = extractvalue { ptr, i32 } %233, 1
  store i32 %235, ptr %12, align 4
  call void @_ZNSt12__shared_ptrIA_KN3P3D6VectorIfLm2EEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %34) #10
  br label %236

236:                                              ; preds = %232, %228
  call void @llvm.lifetime.end.p0(i64 16, ptr %34) #10
  br label %237

237:                                              ; preds = %236, %222, %68
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #10
  call void @_ZN3P3D8Graphics20ExtendedTriangleMeshD2Ev(ptr noundef nonnull align 8 dereferenceable(88) %0) #10
  br label %240

238:                                              ; preds = %226
  call void @_ZN3P3D8Graphics20ExtendedTriangleMeshD2Ev(ptr noundef nonnull align 8 dereferenceable(88) %0) #10
  br label %239

239:                                              ; preds = %238, %226
  call void @_ZN3P3D13MeshPrototypeD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #10
  ret void

240:                                              ; preds = %237, %64
  call void @_ZN3P3D13MeshPrototypeD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #10
  br label %241

241:                                              ; preds = %240
  %242 = load ptr, ptr %11, align 8
  %243 = load i32, ptr %12, align 4
  %244 = insertvalue { ptr, i32 } poison, ptr %242, 0
  %245 = insertvalue { ptr, i32 } %244, i32 %243, 1
  resume { ptr, i32 } %245
}

declare void @_ZN3P3D12ShapeLibrary9createBoxEfff(ptr dead_on_unwind writable sret(%"class.P3D::Polyhedron") align 8, float noundef, float noundef, float noundef) #8

declare void @_ZN3P3D8Graphics20ExtendedTriangleMesh25generateSplitNormalsShapeERKNS_12TriangleMeshE(ptr dead_on_unwind writable sret(%"struct.P3D::Graphics::ExtendedTriangleMesh") align 8, ptr noundef nonnull align 8 dereferenceable(24)) #8

declare { i64, i32 } @_ZNK3P3D13MeshPrototype11getTriangleEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #8

declare { <2 x float>, float } @_ZNK3P3D13MeshPrototype9getVertexEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #8

declare { <2 x float>, float } @_ZNK3P3D12TriangleMesh22getNormalVecOfTriangleENS_8TriangleE(ptr noundef nonnull align 8 dereferenceable(24), i64, i32) #8

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local <2 x float> @_ZN3P3D12withoutIndexIfLm3EEENS_6VectorIT_XmiT0_Li1EEEERKNS1_IS2_XT0_EEEm(ptr noundef nonnull align 4 dereferenceable(12), i64 noundef) #9

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { mustprogress uwtable "min-legal-vector-width"="64" "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 #8 = { "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 #9 = { mustprogress nounwind uwtable "min-legal-vector-width"="64" "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 #10 = { nounwind }
attributes #11 = { builtin allocsize(0) }

!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, !14, i64 20}
!10 = !{!"_ZTSN3P3D13MeshPrototypeE", !11, i64 0, !13, i64 8, !14, i64 16, !14, i64 20}
!11 = !{!"_ZTSN3P3D20UniqueAlignedPointerIfEE", !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!"_ZTSN3P3D20UniqueAlignedPointerIiEE", !12, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!12, !12, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!7, !7, i64 0}
!19 = !{i64 0, i64 12, !18}
!20 = !{!14, !14, i64 0}
!21 = !{i64 0, i64 8, !18}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}


; 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"

%"struct.P3D::Graphics::ExtendedTriangleMesh" = type { %"class.P3D::TriangleMesh", %"class.std::shared_ptr", %"class.std::shared_ptr.4", %"class.std::shared_ptr", %"class.std::shared_ptr" }
%"class.P3D::TriangleMesh" = type { %"class.P3D::MeshPrototype" }
%"class.P3D::MeshPrototype" = type { %"class.P3D::UniqueAlignedPointer", %"class.P3D::UniqueAlignedPointer.3", i32, i32 }
%"class.P3D::UniqueAlignedPointer" = type { ptr }
%"class.P3D::UniqueAlignedPointer.3" = type { ptr }
%"class.std::shared_ptr.4" = type { %"class.std::__shared_ptr.5" }
%"class.std::__shared_ptr.5" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.P3D::Polyhedron" = type { %"class.P3D::TriangleMesh" }
%"struct.P3D::Vector" = type { %union.anon }
%union.anon = type { [3 x float] }
%"struct.P3D::Vector.7" = type { %union.anon.8 }
%union.anon.8 = type { [2 x float] }

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt10shared_ptrIA_KN3P3D6VectorIfLm2EEEEC2IS2_vEEPT_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #3 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3P3D8Graphics20ExtendedTriangleMeshD2Ev(ptr noundef nonnull align 8 dereferenceable(88)) unnamed_addr #4 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3P3D8Graphics12MeshRegistry9createBoxEfff(ptr dead_on_unwind noalias writable sret(%"struct.P3D::Graphics::ExtendedTriangleMesh") align 8 %0, float noundef %1, float noundef %2, float noundef %3) local_unnamed_addr #5 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.P3D::Polyhedron", align 8
  %6 = alloca [3 x %"struct.P3D::Vector"], align 16
  %7 = alloca %"struct.P3D::Vector", align 8
  %8 = alloca %"struct.P3D::Vector", align 4
  %9 = alloca %"class.std::shared_ptr.4", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #8
  call void @_ZN3P3D12ShapeLibrary9createBoxEfff(ptr dead_on_unwind nonnull writable sret(%"class.P3D::Polyhedron") align 8 %5, float noundef %1, float noundef %2, float noundef %3)
  invoke void @_ZN3P3D8Graphics20ExtendedTriangleMesh25generateSplitNormalsShapeERKNS_12TriangleMeshE(ptr dead_on_unwind writable sret(%"struct.P3D::Graphics::ExtendedTriangleMesh") align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %5)
          to label %10 unwind label %30

10:                                               ; preds = %4
  %11 = getelementptr inbounds i8, ptr %0, i64 20
  %12 = load i32, ptr %11, align 4, !tbaa !5
  %13 = mul nsw i32 %12, 3
  %14 = sext i32 %13 to i64
  %15 = icmp slt i32 %12, 0
  %16 = shl nsw i64 %14, 3
  %17 = select i1 %15, i64 -1, i64 %16
  %18 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %17) #9
          to label %19 unwind label %32

19:                                               ; preds = %10
  %20 = icmp eq i32 %12, 0
  br i1 %20, label %._crit_edge, label %21

21:                                               ; preds = %19
  %22 = getelementptr inbounds %"struct.P3D::Vector.7", ptr %18, i64 %14
  br label %23

23:                                               ; preds = %23, %21
  %24 = phi ptr [ %18, %21 ], [ %25, %23 ]
  call void @_ZN3P3D6VectorIfLm2EEC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %24) #8
  %25 = getelementptr inbounds i8, ptr %24, i64 8
  %26 = icmp eq ptr %25, %22
  br i1 %26, label %.loopexit, label %23

.loopexit:                                        ; preds = %23
  %.pre = load i32, ptr %11, align 4, !tbaa !5
  %27 = icmp eq i32 %.pre, 0
  br i1 %27, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.loopexit
  %.sroa.534.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 8
  %28 = getelementptr inbounds i8, ptr %6, i64 12
  %.sroa.528.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 20
  %29 = getelementptr inbounds i8, ptr %6, i64 24
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 32
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %7, i64 8
  br label %34

._crit_edge:                                      ; preds = %45, %19, %.loopexit
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #8
  invoke void @_ZNSt10shared_ptrIA_KN3P3D6VectorIfLm2EEEEC2IS2_vEEPT_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull %18)
          to label %90 unwind label %91

30:                                               ; preds = %4
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %94

32:                                               ; preds = %10
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %93

34:                                               ; preds = %.lr.ph, %45
  %.06170 = phi i64 [ 0, %.lr.ph ], [ %75, %45 ]
  %35 = trunc i64 %.06170 to i32
  %36 = invoke { i64, i32 } @_ZNK3P3D13MeshPrototype11getTriangleEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %35)
          to label %37 unwind label %79

37:                                               ; preds = %34
  %.fca.0.extract35 = extractvalue { i64, i32 } %36, 0
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %6) #8
  call void @_ZN3P3D6VectorIfLm3EEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %6) #8
  call void @_ZN3P3D6VectorIfLm3EEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %28) #8
  call void @_ZN3P3D6VectorIfLm3EEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %29) #8
  %.fca.1.extract36 = extractvalue { i64, i32 } %36, 1
  %.sroa.039.0.extract.trunc = trunc i64 %.fca.0.extract35 to i32
  %38 = invoke { <2 x float>, float } @_ZNK3P3D13MeshPrototype9getVertexEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.sroa.039.0.extract.trunc)
          to label %39 unwind label %81

39:                                               ; preds = %37
  %.fca.0.extract29 = extractvalue { <2 x float>, float } %38, 0
  %.fca.1.extract30 = extractvalue { <2 x float>, float } %38, 1
  store <2 x float> %.fca.0.extract29, ptr %6, align 16
  store float %.fca.1.extract30, ptr %.sroa.534.0..sroa_idx, align 8, !tbaa !13
  %.sroa.039.4.extract.shift = lshr i64 %.fca.0.extract35, 32
  %.sroa.039.4.extract.trunc = trunc nuw i64 %.sroa.039.4.extract.shift to i32
  %40 = invoke { <2 x float>, float } @_ZNK3P3D13MeshPrototype9getVertexEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.sroa.039.4.extract.trunc)
          to label %41 unwind label %83

41:                                               ; preds = %39
  %.fca.0.extract23 = extractvalue { <2 x float>, float } %40, 0
  %.fca.1.extract24 = extractvalue { <2 x float>, float } %40, 1
  store <2 x float> %.fca.0.extract23, ptr %28, align 4
  store float %.fca.1.extract24, ptr %.sroa.528.0..sroa_idx, align 4, !tbaa !13
  %42 = invoke { <2 x float>, float } @_ZNK3P3D13MeshPrototype9getVertexEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.fca.1.extract36)
          to label %43 unwind label %85

43:                                               ; preds = %41
  %.fca.0.extract18 = extractvalue { <2 x float>, float } %42, 0
  %.fca.1.extract19 = extractvalue { <2 x float>, float } %42, 1
  store <2 x float> %.fca.0.extract18, ptr %29, align 8
  store float %.fca.1.extract19, ptr %.sroa.5.0..sroa_idx, align 16, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #8
  %44 = invoke { <2 x float>, float } @_ZNK3P3D12TriangleMesh22getNormalVecOfTriangleENS_8TriangleE(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 %.fca.0.extract35, i32 %.fca.1.extract36)
          to label %45 unwind label %87

45:                                               ; preds = %43
  %.fca.0.extract = extractvalue { <2 x float>, float } %44, 0
  %.fca.1.extract = extractvalue { <2 x float>, float } %44, 1
  store <2 x float> %.fca.0.extract, ptr %7, align 8
  store float %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  %46 = call noundef i64 @_ZN3P3D21getAbsMaxElementIndexIfLm3EEEmRKNS_6VectorIT_XT0_EEE(ptr noundef nonnull align 4 dereferenceable(12) %7) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #8
  call void @_ZN3P3D6VectorIfLm3EEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %8, float noundef %1, float noundef %2, float noundef %3) #8
  %sext = shl i64 %46, 32
  %47 = ashr exact i64 %sext, 32
  %.idx68 = mul i64 %.06170, 24
  %48 = getelementptr i8, ptr %18, i64 %.idx68
  %49 = call <2 x float> @_ZN3P3D12withoutIndexIfLm3EEENS_6VectorIT_XmiT0_Li1EEEERKNS1_IS2_XT0_EEEm(ptr noundef nonnull align 4 dereferenceable(12) %6, i64 noundef %47)
  %50 = call <2 x float> @_ZN3P3D12withoutIndexIfLm3EEENS_6VectorIT_XmiT0_Li1EEEERKNS1_IS2_XT0_EEEm(ptr noundef nonnull align 4 dereferenceable(12) %8, i64 noundef %47)
  %51 = fpext <2 x float> %49 to <2 x double>
  %52 = fpext <2 x float> %50 to <2 x double>
  %53 = fmul <2 x double> %52, <double 5.000000e-01, double 5.000000e-01>
  %54 = fadd <2 x double> %53, %51
  %55 = fdiv <2 x double> %54, %52
  %56 = fptrunc <2 x double> %55 to <2 x float>
  store <2 x float> %56, ptr %48, align 4, !tbaa !13
  %57 = call <2 x float> @_ZN3P3D12withoutIndexIfLm3EEENS_6VectorIT_XmiT0_Li1EEEERKNS1_IS2_XT0_EEEm(ptr noundef nonnull align 4 dereferenceable(12) %28, i64 noundef %47)
  %58 = call <2 x float> @_ZN3P3D12withoutIndexIfLm3EEENS_6VectorIT_XmiT0_Li1EEEERKNS1_IS2_XT0_EEEm(ptr noundef nonnull align 4 dereferenceable(12) %8, i64 noundef %47)
  %59 = fpext <2 x float> %57 to <2 x double>
  %60 = fpext <2 x float> %58 to <2 x double>
  %61 = fmul <2 x double> %60, <double 5.000000e-01, double 5.000000e-01>
  %62 = fadd <2 x double> %61, %59
  %63 = fdiv <2 x double> %62, %60
  %64 = fptrunc <2 x double> %63 to <2 x float>
  %65 = getelementptr i8, ptr %48, i64 8
  store <2 x float> %64, ptr %65, align 4, !tbaa !13
  %66 = call <2 x float> @_ZN3P3D12withoutIndexIfLm3EEENS_6VectorIT_XmiT0_Li1EEEERKNS1_IS2_XT0_EEEm(ptr noundef nonnull align 4 dereferenceable(12) %29, i64 noundef %47)
  %67 = call <2 x float> @_ZN3P3D12withoutIndexIfLm3EEENS_6VectorIT_XmiT0_Li1EEEERKNS1_IS2_XT0_EEEm(ptr noundef nonnull align 4 dereferenceable(12) %8, i64 noundef %47)
  %68 = fpext <2 x float> %66 to <2 x double>
  %69 = fpext <2 x float> %67 to <2 x double>
  %70 = fmul <2 x double> %69, <double 5.000000e-01, double 5.000000e-01>
  %71 = fadd <2 x double> %70, %68
  %72 = fdiv <2 x double> %71, %69
  %73 = fptrunc <2 x double> %72 to <2 x float>
  %74 = getelementptr i8, ptr %48, i64 16
  store <2 x float> %73, ptr %74, align 4, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %6) #8
  %75 = add nuw i64 %.06170, 1
  %76 = load i32, ptr %11, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = icmp ult i64 %75, %77
  br i1 %78, label %34, label %._crit_edge, !llvm.loop !14

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

81:                                               ; preds = %37
  %82 = landingpad { ptr, i32 }
          cleanup
  br label %89

83:                                               ; preds = %39
  %84 = landingpad { ptr, i32 }
          cleanup
  br label %89

85:                                               ; preds = %41
  %86 = landingpad { ptr, i32 }
          cleanup
  br label %89

87:                                               ; preds = %43
  %88 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #8
  br label %89

89:                                               ; preds = %87, %85, %83, %81
  %.pn = phi { ptr, i32 } [ %88, %87 ], [ %86, %85 ], [ %84, %83 ], [ %82, %81 ]
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %6) #8
  br label %93

90:                                               ; preds = %._crit_edge
  call void @_ZN3P3D8Graphics20ExtendedTriangleMesh11setUVBufferERKSt10shared_ptrIA_KNS_6VectorIfLm2EEEE(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef nonnull align 8 dereferenceable(16) %9)
  call void @_ZNSt12__shared_ptrIA_KN3P3D6VectorIfLm2EEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #8
  call void @_ZN3P3D13MeshPrototypeD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #8
  ret void

91:                                               ; preds = %._crit_edge
  %92 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #8
  br label %93

93:                                               ; preds = %79, %89, %91, %32
  %.pn.pn.pn = phi { ptr, i32 } [ %92, %91 ], [ %33, %32 ], [ %.pn, %89 ], [ %80, %79 ]
  call void @_ZN3P3D8Graphics20ExtendedTriangleMeshD2Ev(ptr noundef nonnull align 8 dereferenceable(88) %0) #8
  br label %94

94:                                               ; preds = %93, %30
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %93 ], [ %31, %30 ]
  call void @_ZN3P3D13MeshPrototypeD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #8
  resume { ptr, i32 } %.pn.pn.pn.pn
}

declare void @_ZN3P3D12ShapeLibrary9createBoxEfff(ptr dead_on_unwind writable sret(%"class.P3D::Polyhedron") align 8, float noundef, float noundef, float noundef) local_unnamed_addr #6

declare void @_ZN3P3D8Graphics20ExtendedTriangleMesh25generateSplitNormalsShapeERKNS_12TriangleMeshE(ptr dead_on_unwind writable sret(%"struct.P3D::Graphics::ExtendedTriangleMesh") align 8, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #6

declare { i64, i32 } @_ZNK3P3D13MeshPrototype11getTriangleEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #6

declare { <2 x float>, float } @_ZNK3P3D13MeshPrototype9getVertexEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #6

declare { <2 x float>, float } @_ZNK3P3D12TriangleMesh22getNormalVecOfTriangleENS_8TriangleE(ptr noundef nonnull align 8 dereferenceable(24), i64, i32) local_unnamed_addr #6

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local <2 x float> @_ZN3P3D12withoutIndexIfLm3EEENS_6VectorIT_XmiT0_Li1EEEERKNS1_IS2_XT0_EEEm(ptr noundef nonnull align 4 dereferenceable(12), i64 noundef) local_unnamed_addr #7

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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 #5 = { mustprogress uwtable "min-legal-vector-width"="64" "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 = { "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 #7 = { mustprogress nounwind uwtable "min-legal-vector-width"="64" "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 #8 = { nounwind }
attributes #9 = { builtin allocsize(0) }

!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, !12, i64 20}
!6 = !{!"_ZTSN3P3D13MeshPrototypeE", !7, i64 0, !11, i64 8, !12, i64 16, !12, i64 20}
!7 = !{!"_ZTSN3P3D20UniqueAlignedPointerIfEE", !8, i64 0}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSN3P3D20UniqueAlignedPointerIiEE", !8, i64 0}
!12 = !{!"int", !9, i64 0}
!13 = !{!9, !9, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


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