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

; 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" }
%"class.P3D::IteratorFactory" = type { %"struct.P3D::ShapeVertexIter", %"struct.P3D::ShapeVertexIter" }
%"struct.P3D::ShapeVertexIter" = type { ptr, i64 }
%"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 = type { float, 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: 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) #1

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

; 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)) #3 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 #3 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 #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN3P3D2piIdEET_v() #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3P3D8Graphics12MeshRegistry12createSphereEdi(ptr dead_on_unwind noalias writable sret(%"struct.P3D::Graphics::ExtendedTriangleMesh") align 8 %0, double noundef %1, i32 noundef %2) #7 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca double, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"class.P3D::Polyhedron", align 8
  %8 = alloca i1, align 1
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca %"class.P3D::IteratorFactory", align 8
  %16 = alloca %"struct.P3D::ShapeVertexIter", align 8
  %17 = alloca %"struct.P3D::ShapeVertexIter", align 8
  %18 = alloca %"struct.P3D::Vector", align 4
  %19 = alloca { <2 x float>, float }, align 8
  %20 = alloca %"struct.P3D::Vector", align 4
  %21 = alloca { <2 x float>, float }, align 8
  %22 = alloca %"struct.P3D::Vector.7", align 4
  %23 = alloca %"class.std::shared_ptr", align 8
  %24 = alloca %"class.std::shared_ptr.4", align 8
  store ptr %0, ptr %4, align 8
  store double %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #11
  %25 = load double, ptr %5, align 8, !tbaa !5
  %26 = fptrunc double %25 to float
  %27 = load i32, ptr %6, align 4, !tbaa !9
  call void @_ZN3P3D12ShapeLibrary12createSphereEfi(ptr dead_on_unwind writable sret(%"class.P3D::Polyhedron") align 8 %7, float noundef %26, i32 noundef %27)
  store i1 false, ptr %8, align 1
  invoke void @_ZN3P3D8Graphics20ExtendedTriangleMeshC2ERKNS_12TriangleMeshE(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef nonnull align 8 dereferenceable(24) %7)
          to label %28 unwind label %82

28:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #11
  store i32 0, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #11
  %29 = getelementptr inbounds %"class.P3D::MeshPrototype", ptr %0, i32 0, i32 2
  %30 = load i32, ptr %29, align 8, !tbaa !11
  %31 = sext i32 %30 to i64
  %32 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %31, i64 12)
  %33 = extractvalue { i64, i1 } %32, 1
  %34 = extractvalue { i64, i1 } %32, 0
  %35 = select i1 %33, i64 -1, i64 %34
  %36 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %35) #12
          to label %37 unwind label %86

37:                                               ; preds = %28
  %38 = icmp eq i64 %31, 0
  br i1 %38, label %45, label %39

39:                                               ; preds = %37
  %40 = getelementptr inbounds %"struct.P3D::Vector", ptr %36, i64 %31
  br label %41

41:                                               ; preds = %41, %39
  %42 = phi ptr [ %36, %39 ], [ %43, %41 ]
  call void @_ZN3P3D6VectorIfLm3EEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %42) #11
  %43 = getelementptr inbounds %"struct.P3D::Vector", ptr %42, i64 1
  %44 = icmp eq ptr %43, %40
  br i1 %44, label %45, label %41

45:                                               ; preds = %41, %37
  store ptr %36, ptr %12, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #11
  %46 = getelementptr inbounds %"class.P3D::MeshPrototype", ptr %0, i32 0, i32 2
  %47 = load i32, ptr %46, align 8, !tbaa !11
  %48 = sext i32 %47 to i64
  %49 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %48, i64 8)
  %50 = extractvalue { i64, i1 } %49, 1
  %51 = extractvalue { i64, i1 } %49, 0
  %52 = select i1 %50, i64 -1, i64 %51
  %53 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %52) #12
          to label %54 unwind label %90

54:                                               ; preds = %45
  %55 = icmp eq i64 %48, 0
  br i1 %55, label %62, label %56

56:                                               ; preds = %54
  %57 = getelementptr inbounds %"struct.P3D::Vector.7", ptr %53, i64 %48
  br label %58

58:                                               ; preds = %58, %56
  %59 = phi ptr [ %53, %56 ], [ %60, %58 ]
  call void @_ZN3P3D6VectorIfLm2EEC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %59) #11
  %60 = getelementptr inbounds %"struct.P3D::Vector.7", ptr %59, i64 1
  %61 = icmp eq ptr %60, %57
  br i1 %61, label %62, label %58

62:                                               ; preds = %58, %54
  store ptr %53, ptr %13, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #11
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #11
  invoke void @_ZNK3P3D12TriangleMesh12iterVerticesEv(ptr dead_on_unwind writable sret(%"class.P3D::IteratorFactory") align 8 %15, ptr noundef nonnull align 8 dereferenceable(24) %0)
          to label %63 unwind label %94

63:                                               ; preds = %62
  store ptr %15, ptr %14, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #11
  %64 = load ptr, ptr %14, align 8, !tbaa !16
  %65 = invoke { ptr, i64 } @_ZNK3P3D15IteratorFactoryINS_15ShapeVertexIterES1_E5beginEv(ptr noundef nonnull align 8 dereferenceable(32) %64)
          to label %66 unwind label %98

66:                                               ; preds = %63
  %67 = getelementptr inbounds { ptr, i64 }, ptr %16, i32 0, i32 0
  %68 = extractvalue { ptr, i64 } %65, 0
  store ptr %68, ptr %67, align 8
  %69 = getelementptr inbounds { ptr, i64 }, ptr %16, i32 0, i32 1
  %70 = extractvalue { ptr, i64 } %65, 1
  store i64 %70, ptr %69, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #11
  %71 = load ptr, ptr %14, align 8, !tbaa !16
  %72 = invoke { ptr, i64 } @_ZNK3P3D15IteratorFactoryINS_15ShapeVertexIterES1_E3endEv(ptr noundef nonnull align 8 dereferenceable(32) %71)
          to label %73 unwind label %102

73:                                               ; preds = %66
  %74 = getelementptr inbounds { ptr, i64 }, ptr %17, i32 0, i32 0
  %75 = extractvalue { ptr, i64 } %72, 0
  store ptr %75, ptr %74, align 8
  %76 = getelementptr inbounds { ptr, i64 }, ptr %17, i32 0, i32 1
  %77 = extractvalue { ptr, i64 } %72, 1
  store i64 %77, ptr %76, align 8
  br label %78

78:                                               ; preds = %146, %73
  %79 = invoke noundef zeroext i1 @_ZNK3P3D15ShapeVertexIterneERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(16) %17)
          to label %80 unwind label %102

80:                                               ; preds = %78
  br i1 %79, label %106, label %81

81:                                               ; preds = %80
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #11
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #11
  br label %159

82:                                               ; preds = %3
  %83 = landingpad { ptr, i32 }
          cleanup
  %84 = extractvalue { ptr, i32 } %83, 0
  store ptr %84, ptr %9, align 8
  %85 = extractvalue { ptr, i32 } %83, 1
  store i32 %85, ptr %10, align 4
  br label %189

86:                                               ; preds = %28
  %87 = landingpad { ptr, i32 }
          cleanup
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %9, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %10, align 4
  br label %186

90:                                               ; preds = %45
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %9, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %10, align 4
  br label %185

94:                                               ; preds = %62
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %9, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %10, align 4
  br label %158

98:                                               ; preds = %63
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %9, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %10, align 4
  br label %157

102:                                              ; preds = %145, %78, %66
  %103 = landingpad { ptr, i32 }
          cleanup
  %104 = extractvalue { ptr, i32 } %103, 0
  store ptr %104, ptr %9, align 8
  %105 = extractvalue { ptr, i32 } %103, 1
  store i32 %105, ptr %10, align 4
  br label %156

106:                                              ; preds = %80
  call void @llvm.lifetime.start.p0(i64 12, ptr %18) #11
  %107 = invoke { <2 x float>, float } @_ZNK3P3D15ShapeVertexIterdeEv(ptr noundef nonnull align 8 dereferenceable(16) %16)
          to label %108 unwind label %147

108:                                              ; preds = %106
  %109 = getelementptr inbounds %"struct.P3D::Vector", ptr %18, i32 0, i32 0
  %110 = getelementptr inbounds %union.anon, ptr %109, i32 0, i32 0
  store { <2 x float>, float } %107, ptr %19, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %110, ptr align 8 %19, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr %20) #11
  %111 = call { <2 x float>, float } @_ZN3P3D9normalizeIfLm3EEENS_6VectorIT_XT0_EEERKS3_(ptr noundef nonnull align 4 dereferenceable(12) %18) #11
  %112 = getelementptr inbounds %"struct.P3D::Vector", ptr %20, i32 0, i32 0
  %113 = getelementptr inbounds %union.anon, ptr %112, i32 0, i32 0
  store { <2 x float>, float } %111, ptr %21, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %113, ptr align 8 %21, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #11
  %114 = getelementptr inbounds %"struct.P3D::Vector", ptr %20, i32 0, i32 0
  %115 = getelementptr inbounds %struct.anon, ptr %114, i32 0, i32 0
  %116 = load float, ptr %115, align 4, !tbaa !17
  %117 = fpext float %116 to double
  %118 = getelementptr inbounds %"struct.P3D::Vector", ptr %20, i32 0, i32 0
  %119 = getelementptr inbounds %struct.anon, ptr %118, i32 0, i32 2
  %120 = load float, ptr %119, align 4, !tbaa !17
  %121 = fpext float %120 to double
  %122 = call double @atan2(double noundef %117, double noundef %121) #11
  %123 = invoke noundef double @_ZN3P3D2piIdEET_v()
          to label %124 unwind label %151

124:                                              ; preds = %108
  %125 = fmul double 2.000000e+00, %123
  %126 = fdiv double %122, %125
  %127 = fadd double %126, 5.000000e-01
  %128 = fptrunc double %127 to float
  %129 = getelementptr inbounds %"struct.P3D::Vector", ptr %20, i32 0, i32 0
  %130 = getelementptr inbounds %struct.anon, ptr %129, i32 0, i32 1
  %131 = load float, ptr %130, align 4, !tbaa !17
  %132 = fpext float %131 to double
  %133 = call double @llvm.fmuladd.f64(double %132, double 5.000000e-01, double 5.000000e-01)
  %134 = fptrunc double %133 to float
  call void @_ZN3P3D6VectorIfLm2EEC2Eff(ptr noundef nonnull align 4 dereferenceable(8) %22, float noundef %128, float noundef %134) #11
  %135 = load ptr, ptr %12, align 8, !tbaa !16
  %136 = load i32, ptr %11, align 4, !tbaa !9
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds %"struct.P3D::Vector", ptr %135, i64 %137
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %138, ptr align 4 %20, i64 12, i1 false), !tbaa.struct !18
  %139 = load ptr, ptr %13, align 8, !tbaa !16
  %140 = load i32, ptr %11, align 4, !tbaa !9
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds %"struct.P3D::Vector.7", ptr %139, i64 %141
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %142, ptr align 4 %22, i64 8, i1 false), !tbaa.struct !19
  %143 = load i32, ptr %11, align 4, !tbaa !9
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #11
  call void @llvm.lifetime.end.p0(i64 12, ptr %20) #11
  call void @llvm.lifetime.end.p0(i64 12, ptr %18) #11
  br label %145

145:                                              ; preds = %124
  invoke void @_ZN3P3D15ShapeVertexIterppEv(ptr noundef nonnull align 8 dereferenceable(16) %16)
          to label %146 unwind label %102

146:                                              ; preds = %145
  br label %78

147:                                              ; preds = %106
  %148 = landingpad { ptr, i32 }
          cleanup
  %149 = extractvalue { ptr, i32 } %148, 0
  store ptr %149, ptr %9, align 8
  %150 = extractvalue { ptr, i32 } %148, 1
  store i32 %150, ptr %10, align 4
  br label %155

151:                                              ; preds = %108
  %152 = landingpad { ptr, i32 }
          cleanup
  %153 = extractvalue { ptr, i32 } %152, 0
  store ptr %153, ptr %9, align 8
  %154 = extractvalue { ptr, i32 } %152, 1
  store i32 %154, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #11
  call void @llvm.lifetime.end.p0(i64 12, ptr %20) #11
  br label %155

155:                                              ; preds = %151, %147
  call void @llvm.lifetime.end.p0(i64 12, ptr %18) #11
  br label %156

156:                                              ; preds = %155, %102
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #11
  br label %157

157:                                              ; preds = %156, %98
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #11
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #11
  br label %158

158:                                              ; preds = %157, %94
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #11
  br label %185

159:                                              ; preds = %81
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #11
  %160 = load ptr, ptr %12, align 8, !tbaa !16
  invoke void @_ZNSt10shared_ptrIA_KN3P3D6VectorIfLm3EEEEC2IS2_vEEPT_(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef %160)
          to label %161 unwind label %167

161:                                              ; preds = %159
  invoke void @_ZN3P3D8Graphics20ExtendedTriangleMesh15setNormalBufferERKSt10shared_ptrIA_KNS_6VectorIfLm3EEEE(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef nonnull align 8 dereferenceable(16) %23)
          to label %162 unwind label %171

162:                                              ; preds = %161
  call void @_ZNSt12__shared_ptrIA_KN3P3D6VectorIfLm3EEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %23) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #11
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #11
  %163 = load ptr, ptr %13, align 8, !tbaa !16
  invoke void @_ZNSt10shared_ptrIA_KN3P3D6VectorIfLm2EEEEC2IS2_vEEPT_(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef %163)
          to label %164 unwind label %176

164:                                              ; preds = %162
  invoke void @_ZN3P3D8Graphics20ExtendedTriangleMesh11setUVBufferERKSt10shared_ptrIA_KNS_6VectorIfLm2EEEE(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef nonnull align 8 dereferenceable(16) %24)
          to label %165 unwind label %180

165:                                              ; preds = %164
  call void @_ZNSt12__shared_ptrIA_KN3P3D6VectorIfLm2EEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %24) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #11
  store i1 true, ptr %8, align 1
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #11
  %166 = load i1, ptr %8, align 1
  br i1 %166, label %188, label %187

167:                                              ; preds = %159
  %168 = landingpad { ptr, i32 }
          cleanup
  %169 = extractvalue { ptr, i32 } %168, 0
  store ptr %169, ptr %9, align 8
  %170 = extractvalue { ptr, i32 } %168, 1
  store i32 %170, ptr %10, align 4
  br label %175

171:                                              ; preds = %161
  %172 = landingpad { ptr, i32 }
          cleanup
  %173 = extractvalue { ptr, i32 } %172, 0
  store ptr %173, ptr %9, align 8
  %174 = extractvalue { ptr, i32 } %172, 1
  store i32 %174, ptr %10, align 4
  call void @_ZNSt12__shared_ptrIA_KN3P3D6VectorIfLm3EEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %23) #11
  br label %175

175:                                              ; preds = %171, %167
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #11
  br label %185

176:                                              ; preds = %162
  %177 = landingpad { ptr, i32 }
          cleanup
  %178 = extractvalue { ptr, i32 } %177, 0
  store ptr %178, ptr %9, align 8
  %179 = extractvalue { ptr, i32 } %177, 1
  store i32 %179, ptr %10, align 4
  br label %184

180:                                              ; preds = %164
  %181 = landingpad { ptr, i32 }
          cleanup
  %182 = extractvalue { ptr, i32 } %181, 0
  store ptr %182, ptr %9, align 8
  %183 = extractvalue { ptr, i32 } %181, 1
  store i32 %183, ptr %10, align 4
  call void @_ZNSt12__shared_ptrIA_KN3P3D6VectorIfLm2EEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %24) #11
  br label %184

184:                                              ; preds = %180, %176
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #11
  br label %185

185:                                              ; preds = %184, %175, %158, %90
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #11
  br label %186

186:                                              ; preds = %185, %86
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #11
  call void @_ZN3P3D8Graphics20ExtendedTriangleMeshD2Ev(ptr noundef nonnull align 8 dereferenceable(88) %0) #11
  br label %189

187:                                              ; preds = %165
  call void @_ZN3P3D8Graphics20ExtendedTriangleMeshD2Ev(ptr noundef nonnull align 8 dereferenceable(88) %0) #11
  br label %188

188:                                              ; preds = %187, %165
  call void @_ZN3P3D13MeshPrototypeD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #11
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #11
  ret void

189:                                              ; preds = %186, %82
  call void @_ZN3P3D13MeshPrototypeD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #11
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #11
  br label %190

190:                                              ; preds = %189
  %191 = load ptr, ptr %9, align 8
  %192 = load i32, ptr %10, align 4
  %193 = insertvalue { ptr, i32 } poison, ptr %191, 0
  %194 = insertvalue { ptr, i32 } %193, i32 %192, 1
  resume { ptr, i32 } %194
}

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

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

declare void @_ZNK3P3D12TriangleMesh12iterVerticesEv(ptr dead_on_unwind writable sret(%"class.P3D::IteratorFactory") align 8, ptr noundef nonnull align 8 dereferenceable(24)) #8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { ptr, i64 } @_ZNK3P3D15IteratorFactoryINS_15ShapeVertexIterES1_E5beginEv(ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { ptr, i64 } @_ZNK3P3D15IteratorFactoryINS_15ShapeVertexIterES1_E3endEv(ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3P3D15ShapeVertexIterneERKS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { <2 x float>, float } @_ZNK3P3D15ShapeVertexIterdeEv(ptr noundef nonnull align 8 dereferenceable(16)) #3 align 2

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

; Function Attrs: nounwind
declare double @atan2(double noundef, double noundef) #10

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3P3D15ShapeVertexIterppEv(ptr noundef nonnull align 8 dereferenceable(16)) #3 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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 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 = { 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 "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 #11 = { nounwind }
attributes #12 = { 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 = !{!"double", !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, !10, i64 16}
!12 = !{!"_ZTSN3P3D13MeshPrototypeE", !13, i64 0, !15, i64 8, !10, i64 16, !10, i64 20}
!13 = !{!"_ZTSN3P3D20UniqueAlignedPointerIfEE", !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!"_ZTSN3P3D20UniqueAlignedPointerIiEE", !14, i64 0}
!16 = !{!14, !14, i64 0}
!17 = !{!7, !7, i64 0}
!18 = !{i64 0, i64 12, !17}
!19 = !{i64 0, i64 8, !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"

%"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" }
%"class.P3D::IteratorFactory" = type { %"struct.P3D::ShapeVertexIter", %"struct.P3D::ShapeVertexIter" }
%"struct.P3D::ShapeVertexIter" = type { ptr, i64 }
%"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 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 #1

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

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

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

declare i32 @__gxx_personality_v0(...)

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

; 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 #2 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 #2 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 nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #5

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN3P3D2piIdEET_v() local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3P3D8Graphics12MeshRegistry12createSphereEdi(ptr dead_on_unwind noalias writable sret(%"struct.P3D::Graphics::ExtendedTriangleMesh") align 8 %0, double noundef %1, i32 noundef %2) local_unnamed_addr #6 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.P3D::Polyhedron", align 8
  %5 = alloca %"class.P3D::IteratorFactory", align 8
  %6 = alloca %"struct.P3D::ShapeVertexIter", align 8
  %7 = alloca %"struct.P3D::ShapeVertexIter", align 8
  %8 = alloca %"struct.P3D::Vector", align 8
  %9 = alloca %"struct.P3D::Vector.7", align 8
  %10 = alloca %"class.std::shared_ptr", align 8
  %11 = alloca %"class.std::shared_ptr.4", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #10
  %12 = fptrunc double %1 to float
  call void @_ZN3P3D12ShapeLibrary12createSphereEfi(ptr dead_on_unwind nonnull writable sret(%"class.P3D::Polyhedron") align 8 %4, float noundef %12, i32 noundef %2)
  invoke void @_ZN3P3D8Graphics20ExtendedTriangleMeshC2ERKNS_12TriangleMeshE(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %13 unwind label %55

13:                                               ; preds = %3
  %14 = getelementptr inbounds i8, ptr %0, i64 16
  %15 = load i32, ptr %14, align 8, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %16, i64 12)
  %18 = extractvalue { i64, i1 } %17, 1
  %19 = extractvalue { i64, i1 } %17, 0
  %20 = select i1 %18, i64 -1, i64 %19
  %21 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %20) #11
          to label %22 unwind label %57

22:                                               ; preds = %13
  %23 = icmp eq i32 %15, 0
  br i1 %23, label %.loopexit27.thread, label %24

24:                                               ; preds = %22
  %25 = getelementptr inbounds %"struct.P3D::Vector", ptr %21, i64 %16
  br label %26

26:                                               ; preds = %26, %24
  %27 = phi ptr [ %21, %24 ], [ %28, %26 ]
  call void @_ZN3P3D6VectorIfLm3EEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %27) #10
  %28 = getelementptr inbounds i8, ptr %27, i64 12
  %29 = icmp eq ptr %28, %25
  br i1 %29, label %.loopexit27, label %26

.loopexit27:                                      ; preds = %26
  %.pre = load i32, ptr %14, align 8, !tbaa !5
  %.pre.fr = freeze i32 %.pre
  %30 = sext i32 %.pre.fr to i64
  %31 = icmp slt i32 %.pre.fr, 0
  %32 = shl nsw i64 %30, 3
  %spec.select = select i1 %31, i64 -1, i64 %32
  %33 = icmp eq i32 %.pre.fr, 0
  br label %.loopexit27.thread

.loopexit27.thread:                               ; preds = %.loopexit27, %22
  %34 = phi i64 [ 0, %22 ], [ %30, %.loopexit27 ]
  %35 = phi i1 [ true, %22 ], [ %33, %.loopexit27 ]
  %36 = phi i64 [ 0, %22 ], [ %spec.select, %.loopexit27 ]
  %37 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %36) #11
          to label %38 unwind label %59

38:                                               ; preds = %.loopexit27.thread
  br i1 %35, label %.loopexit, label %39

39:                                               ; preds = %38
  %40 = getelementptr inbounds %"struct.P3D::Vector.7", ptr %37, i64 %34
  br label %41

41:                                               ; preds = %41, %39
  %42 = phi ptr [ %37, %39 ], [ %43, %41 ]
  call void @_ZN3P3D6VectorIfLm2EEC2Ev(ptr noundef nonnull align 4 dereferenceable(8) %42) #10
  %43 = getelementptr inbounds i8, ptr %42, i64 8
  %44 = icmp eq ptr %43, %40
  br i1 %44, label %.loopexit, label %41

.loopexit:                                        ; preds = %41, %38
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #10
  invoke void @_ZNK3P3D12TriangleMesh12iterVerticesEv(ptr dead_on_unwind nonnull writable sret(%"class.P3D::IteratorFactory") align 8 %5, ptr noundef nonnull align 8 dereferenceable(24) %0)
          to label %45 unwind label %61

45:                                               ; preds = %.loopexit
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #10
  %46 = call { ptr, i64 } @_ZNK3P3D15IteratorFactoryINS_15ShapeVertexIterES1_E5beginEv(ptr noundef nonnull align 8 dereferenceable(32) %5)
  %47 = extractvalue { ptr, i64 } %46, 0
  store ptr %47, ptr %6, align 8
  %48 = getelementptr inbounds i8, ptr %6, i64 8
  %49 = extractvalue { ptr, i64 } %46, 1
  store i64 %49, ptr %48, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #10
  %50 = call { ptr, i64 } @_ZNK3P3D15IteratorFactoryINS_15ShapeVertexIterES1_E3endEv(ptr noundef nonnull align 8 dereferenceable(32) %5)
  %51 = extractvalue { ptr, i64 } %50, 0
  store ptr %51, ptr %7, align 8
  %52 = getelementptr inbounds i8, ptr %7, i64 8
  %53 = extractvalue { ptr, i64 } %50, 1
  store i64 %53, ptr %52, align 8
  %54 = call noundef zeroext i1 @_ZNK3P3D15ShapeVertexIterneERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(16) %7)
  br i1 %54, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %45
  %.sroa.25.0..sroa_idx = getelementptr inbounds i8, ptr %8, i64 8
  br label %63

._crit_edge:                                      ; preds = %63, %45
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #10
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #10
  invoke void @_ZNSt10shared_ptrIA_KN3P3D6VectorIfLm3EEEEC2IS2_vEEPT_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull %21)
          to label %81 unwind label %83

55:                                               ; preds = %3
  %56 = landingpad { ptr, i32 }
          cleanup
  br label %88

57:                                               ; preds = %13
  %58 = landingpad { ptr, i32 }
          cleanup
  br label %87

59:                                               ; preds = %.loopexit27.thread
  %60 = landingpad { ptr, i32 }
          cleanup
  br label %87

61:                                               ; preds = %.loopexit
  %62 = landingpad { ptr, i32 }
          cleanup
  br label %87

63:                                               ; preds = %.lr.ph, %63
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %63 ]
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #10
  %64 = call { <2 x float>, float } @_ZNK3P3D15ShapeVertexIterdeEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  %.fca.0.extract2 = extractvalue { <2 x float>, float } %64, 0
  %.fca.1.extract3 = extractvalue { <2 x float>, float } %64, 1
  store <2 x float> %.fca.0.extract2, ptr %8, align 8
  store float %.fca.1.extract3, ptr %.sroa.25.0..sroa_idx, align 8
  %65 = call { <2 x float>, float } @_ZN3P3D9normalizeIfLm3EEENS_6VectorIT_XT0_EEERKS3_(ptr noundef nonnull align 4 dereferenceable(12) %8) #10
  %.fca.0.extract = extractvalue { <2 x float>, float } %65, 0
  %.fca.1.extract = extractvalue { <2 x float>, float } %65, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #10
  %.sroa.01.0.vec.extract = extractelement <2 x float> %.fca.0.extract, i64 0
  %66 = fpext float %.sroa.01.0.vec.extract to double
  %67 = fpext float %.fca.1.extract to double
  %68 = call double @atan2(double noundef %66, double noundef %67) #10
  %69 = call noundef double @_ZN3P3D2piIdEET_v()
  %70 = fmul double %69, 2.000000e+00
  %71 = fdiv double %68, %70
  %72 = fadd double %71, 5.000000e-01
  %73 = fptrunc double %72 to float
  %.sroa.01.4.vec.extract = extractelement <2 x float> %.fca.0.extract, i64 1
  %74 = fpext float %.sroa.01.4.vec.extract to double
  %75 = call double @llvm.fmuladd.f64(double %74, double 5.000000e-01, double 5.000000e-01)
  %76 = fptrunc double %75 to float
  call void @_ZN3P3D6VectorIfLm2EEC2Eff(ptr noundef nonnull align 4 dereferenceable(8) %9, float noundef %73, float noundef %76) #10
  %77 = getelementptr inbounds %"struct.P3D::Vector", ptr %21, i64 %indvars.iv
  store <2 x float> %.fca.0.extract, ptr %77, align 4
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %77, i64 8
  store float %.fca.1.extract, ptr %.sroa.6.0..sroa_idx, align 4, !tbaa !13
  %78 = getelementptr inbounds %"struct.P3D::Vector.7", ptr %37, i64 %indvars.iv
  %79 = load i64, ptr %9, align 8, !tbaa !13
  store i64 %79, ptr %78, align 4, !tbaa !13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #10
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #10
  call void @_ZN3P3D15ShapeVertexIterppEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  %80 = call noundef zeroext i1 @_ZNK3P3D15ShapeVertexIterneERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(16) %7)
  br i1 %80, label %63, label %._crit_edge

81:                                               ; preds = %._crit_edge
  call void @_ZN3P3D8Graphics20ExtendedTriangleMesh15setNormalBufferERKSt10shared_ptrIA_KNS_6VectorIfLm3EEEE(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef nonnull align 8 dereferenceable(16) %10)
  call void @_ZNSt12__shared_ptrIA_KN3P3D6VectorIfLm3EEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #10
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #10
  invoke void @_ZNSt10shared_ptrIA_KN3P3D6VectorIfLm2EEEEC2IS2_vEEPT_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull %37)
          to label %82 unwind label %85

82:                                               ; preds = %81
  call void @_ZN3P3D8Graphics20ExtendedTriangleMesh11setUVBufferERKSt10shared_ptrIA_KNS_6VectorIfLm2EEEE(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef nonnull align 8 dereferenceable(16) %11)
  call void @_ZNSt12__shared_ptrIA_KN3P3D6VectorIfLm2EEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #10
  call void @_ZN3P3D13MeshPrototypeD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #10
  ret void

83:                                               ; preds = %._crit_edge
  %84 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #10
  br label %87

85:                                               ; preds = %81
  %86 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #10
  br label %87

87:                                               ; preds = %59, %61, %83, %85, %57
  %.pn.pn = phi { ptr, i32 } [ %58, %57 ], [ %86, %85 ], [ %84, %83 ], [ %62, %61 ], [ %60, %59 ]
  call void @_ZN3P3D8Graphics20ExtendedTriangleMeshD2Ev(ptr noundef nonnull align 8 dereferenceable(88) %0) #10
  br label %88

88:                                               ; preds = %87, %55
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %87 ], [ %56, %55 ]
  call void @_ZN3P3D13MeshPrototypeD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #10
  resume { ptr, i32 } %.pn.pn.pn
}

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

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

declare void @_ZNK3P3D12TriangleMesh12iterVerticesEv(ptr dead_on_unwind writable sret(%"class.P3D::IteratorFactory") align 8, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #7

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { ptr, i64 } @_ZNK3P3D15IteratorFactoryINS_15ShapeVertexIterES1_E5beginEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { ptr, i64 } @_ZNK3P3D15IteratorFactoryINS_15ShapeVertexIterES1_E3endEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3P3D15ShapeVertexIterneERKS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { <2 x float>, float } @_ZNK3P3D15ShapeVertexIterdeEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { <2 x float>, float } @_ZN3P3D9normalizeIfLm3EEENS_6VectorIT_XT0_EEERKS3_(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #8

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @atan2(double noundef, double noundef) local_unnamed_addr #9

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3P3D15ShapeVertexIterppEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 #7 = { "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 = { 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 #9 = { mustprogress nofree nounwind willreturn memory(write) "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, !12, i64 16}
!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}


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