; LLVM IR from ThePhysicsGuys/Physics3D :: graphics (extendedTriangleMesh)

; 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.1", %"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.0", i32, i32 }
%"class.P3D::UniqueAlignedPointer" = type { ptr }
%"class.P3D::UniqueAlignedPointer.0" = type { ptr }
%"class.std::shared_ptr.1" = type { %"class.std::__shared_ptr.2" }
%"class.std::__shared_ptr.2" = 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" }
%"struct.P3D::Triangle" = type { %union.anon.4 }
%union.anon.4 = type { %struct.anon.5 }
%struct.anon.5 = type { i32, i32, i32 }
%"struct.P3D::Vector" = type { %union.anon }
%union.anon = type { [3 x 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 nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #1

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

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

; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; 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: mustprogress uwtable
define dso_local void @_ZN3P3D8Graphics20ExtendedTriangleMesh25generateSplitNormalsShapeERKNS_12TriangleMeshE(ptr dead_on_unwind noalias writable sret(%"struct.P3D::Graphics::ExtendedTriangleMesh") align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %1) #6 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %"struct.P3D::Triangle", align 4
  %10 = alloca { i64, i32 }, align 8
  %11 = alloca %"struct.P3D::Vector", align 4
  %12 = alloca { <2 x float>, float }, align 8
  %13 = alloca %"struct.P3D::Vector", align 4
  %14 = alloca { <2 x float>, float }, align 8
  %15 = alloca %"struct.P3D::Vector", align 4
  %16 = alloca { <2 x float>, float }, align 8
  %17 = alloca %"struct.P3D::Vector", align 4
  %18 = alloca %"struct.P3D::Vector", align 4
  %19 = alloca %"struct.P3D::Triangle", align 4
  %20 = alloca { i64, i32 }, align 4
  %21 = alloca { <2 x float>, float }, align 8
  %22 = alloca { <2 x float>, float }, align 8
  %23 = alloca %"struct.P3D::Triangle", align 4
  %24 = alloca i1, align 1
  %25 = alloca %"class.P3D::TriangleMesh", align 8
  %26 = alloca ptr, align 8
  %27 = alloca i32, align 4
  %28 = alloca %"class.std::shared_ptr", align 8
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #10
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %"class.P3D::MeshPrototype", ptr %29, i32 0, i32 3
  %31 = load i32, ptr %30, align 4, !tbaa !9
  %32 = mul nsw i32 %31, 3
  %33 = sext i32 %32 to i64
  %34 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %33, i64 12)
  %35 = extractvalue { i64, i1 } %34, 1
  %36 = extractvalue { i64, i1 } %34, 0
  %37 = select i1 %35, i64 -1, i64 %36
  %38 = call noalias noundef nonnull ptr @_Znam(i64 noundef %37) #11
  %39 = icmp eq i64 %33, 0
  br i1 %39, label %46, label %40

40:                                               ; preds = %2
  %41 = getelementptr inbounds %"struct.P3D::Vector", ptr %38, i64 %33
  br label %42

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

46:                                               ; preds = %42, %2
  store ptr %38, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #10
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = getelementptr inbounds %"class.P3D::MeshPrototype", ptr %47, i32 0, i32 3
  %49 = load i32, ptr %48, align 4, !tbaa !9
  %50 = mul nsw i32 %49, 3
  %51 = sext i32 %50 to i64
  %52 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %51, i64 12)
  %53 = extractvalue { i64, i1 } %52, 1
  %54 = extractvalue { i64, i1 } %52, 0
  %55 = select i1 %53, i64 -1, i64 %54
  %56 = call noalias noundef nonnull ptr @_Znam(i64 noundef %55) #11
  %57 = icmp eq i64 %51, 0
  br i1 %57, label %64, label %58

58:                                               ; preds = %46
  %59 = getelementptr inbounds %"struct.P3D::Vector", ptr %56, i64 %51
  br label %60

60:                                               ; preds = %60, %58
  %61 = phi ptr [ %56, %58 ], [ %62, %60 ]
  call void @_ZN3P3D6VectorIfLm3EEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %61) #10
  %62 = getelementptr inbounds %"struct.P3D::Vector", ptr %61, i64 1
  %63 = icmp eq ptr %62, %59
  br i1 %63, label %64, label %60

64:                                               ; preds = %60, %46
  store ptr %56, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #10
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds %"class.P3D::MeshPrototype", ptr %65, i32 0, i32 3
  %67 = load i32, ptr %66, align 4, !tbaa !9
  %68 = sext i32 %67 to i64
  %69 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %68, i64 12)
  %70 = extractvalue { i64, i1 } %69, 1
  %71 = extractvalue { i64, i1 } %69, 0
  %72 = select i1 %70, i64 -1, i64 %71
  %73 = call noalias noundef nonnull ptr @_Znam(i64 noundef %72) #11
  store ptr %73, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #10
  store i32 0, ptr %8, align 4, !tbaa !14
  br label %74

74:                                               ; preds = %169, %64
  %75 = load i32, ptr %8, align 4, !tbaa !14
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = getelementptr inbounds %"class.P3D::MeshPrototype", ptr %76, i32 0, i32 3
  %78 = load i32, ptr %77, align 4, !tbaa !9
  %79 = icmp slt i32 %75, %78
  br i1 %79, label %81, label %80

80:                                               ; preds = %74
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #10
  br label %172

81:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 12, ptr %9) #10
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  %83 = load i32, ptr %8, align 4, !tbaa !14
  %84 = call { i64, i32 } @_ZNK3P3D13MeshPrototype11getTriangleEi(ptr noundef nonnull align 8 dereferenceable(24) %82, i32 noundef %83)
  %85 = getelementptr inbounds %"struct.P3D::Triangle", ptr %9, i32 0, i32 0
  %86 = getelementptr inbounds %union.anon.4, ptr %85, i32 0, i32 0
  store { i64, i32 } %84, ptr %10, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %86, ptr align 8 %10, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr %11) #10
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  %88 = getelementptr inbounds %"struct.P3D::Triangle", ptr %9, i32 0, i32 0
  %89 = getelementptr inbounds %struct.anon.5, ptr %88, i32 0, i32 0
  %90 = load i32, ptr %89, align 4, !tbaa !15
  %91 = call { <2 x float>, float } @_ZNK3P3D13MeshPrototype9getVertexEi(ptr noundef nonnull align 8 dereferenceable(24) %87, i32 noundef %90)
  %92 = getelementptr inbounds %"struct.P3D::Vector", ptr %11, i32 0, i32 0
  %93 = getelementptr inbounds %union.anon, ptr %92, i32 0, i32 0
  store { <2 x float>, float } %91, ptr %12, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %93, ptr align 8 %12, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr %13) #10
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = getelementptr inbounds %"struct.P3D::Triangle", ptr %9, i32 0, i32 0
  %96 = getelementptr inbounds %struct.anon.5, ptr %95, i32 0, i32 1
  %97 = load i32, ptr %96, align 4, !tbaa !15
  %98 = call { <2 x float>, float } @_ZNK3P3D13MeshPrototype9getVertexEi(ptr noundef nonnull align 8 dereferenceable(24) %94, i32 noundef %97)
  %99 = getelementptr inbounds %"struct.P3D::Vector", ptr %13, i32 0, i32 0
  %100 = getelementptr inbounds %union.anon, ptr %99, i32 0, i32 0
  store { <2 x float>, float } %98, ptr %14, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %100, ptr align 8 %14, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr %15) #10
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  %102 = getelementptr inbounds %"struct.P3D::Triangle", ptr %9, i32 0, i32 0
  %103 = getelementptr inbounds %struct.anon.5, ptr %102, i32 0, i32 2
  %104 = load i32, ptr %103, align 4, !tbaa !15
  %105 = call { <2 x float>, float } @_ZNK3P3D13MeshPrototype9getVertexEi(ptr noundef nonnull align 8 dereferenceable(24) %101, i32 noundef %104)
  %106 = getelementptr inbounds %"struct.P3D::Vector", ptr %15, i32 0, i32 0
  %107 = getelementptr inbounds %union.anon, ptr %106, i32 0, i32 0
  store { <2 x float>, float } %105, ptr %16, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %107, ptr align 8 %16, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr %17) #10
  call void @llvm.lifetime.start.p0(i64 12, ptr %18) #10
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %9, i64 12, i1 false), !tbaa.struct !16
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %20, ptr align 4 %19, i64 12, i1 false)
  %109 = getelementptr inbounds { i64, i32 }, ptr %20, i32 0, i32 0
  %110 = load i64, ptr %109, align 4
  %111 = getelementptr inbounds { i64, i32 }, ptr %20, i32 0, i32 1
  %112 = load i32, ptr %111, align 4
  %113 = call { <2 x float>, float } @_ZNK3P3D12TriangleMesh22getNormalVecOfTriangleENS_8TriangleE(ptr noundef nonnull align 8 dereferenceable(24) %108, i64 %110, i32 %112)
  %114 = getelementptr inbounds %"struct.P3D::Vector", ptr %18, i32 0, i32 0
  %115 = getelementptr inbounds %union.anon, ptr %114, i32 0, i32 0
  store { <2 x float>, float } %113, ptr %21, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %115, ptr align 8 %21, i64 12, i1 false)
  %116 = call { <2 x float>, float } @_ZN3P3D9normalizeIfLm3EEENS_6VectorIT_XT0_EEERKS3_(ptr noundef nonnull align 4 dereferenceable(12) %18) #10
  %117 = getelementptr inbounds %"struct.P3D::Vector", ptr %17, i32 0, i32 0
  %118 = getelementptr inbounds %union.anon, ptr %117, i32 0, i32 0
  store { <2 x float>, float } %116, ptr %22, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %118, ptr align 8 %22, i64 12, i1 false)
  call void @llvm.lifetime.end.p0(i64 12, ptr %18) #10
  %119 = load ptr, ptr %5, align 8, !tbaa !5
  %120 = load i32, ptr %8, align 4, !tbaa !14
  %121 = mul nsw i32 %120, 3
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds %"struct.P3D::Vector", ptr %119, i64 %122
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %123, ptr align 4 %11, i64 12, i1 false), !tbaa.struct !16
  %124 = load ptr, ptr %5, align 8, !tbaa !5
  %125 = load i32, ptr %8, align 4, !tbaa !14
  %126 = mul nsw i32 %125, 3
  %127 = add nsw i32 %126, 1
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds %"struct.P3D::Vector", ptr %124, i64 %128
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %129, ptr align 4 %13, i64 12, i1 false), !tbaa.struct !16
  %130 = load ptr, ptr %5, align 8, !tbaa !5
  %131 = load i32, ptr %8, align 4, !tbaa !14
  %132 = mul nsw i32 %131, 3
  %133 = add nsw i32 %132, 2
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds %"struct.P3D::Vector", ptr %130, i64 %134
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %135, ptr align 4 %15, i64 12, i1 false), !tbaa.struct !16
  %136 = load ptr, ptr %6, align 8, !tbaa !5
  %137 = load i32, ptr %8, align 4, !tbaa !14
  %138 = mul nsw i32 %137, 3
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds %"struct.P3D::Vector", ptr %136, i64 %139
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %140, ptr align 4 %17, i64 12, i1 false), !tbaa.struct !16
  %141 = load ptr, ptr %6, align 8, !tbaa !5
  %142 = load i32, ptr %8, align 4, !tbaa !14
  %143 = mul nsw i32 %142, 3
  %144 = add nsw i32 %143, 1
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds %"struct.P3D::Vector", ptr %141, i64 %145
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %146, ptr align 4 %17, i64 12, i1 false), !tbaa.struct !16
  %147 = load ptr, ptr %6, align 8, !tbaa !5
  %148 = load i32, ptr %8, align 4, !tbaa !14
  %149 = mul nsw i32 %148, 3
  %150 = add nsw i32 %149, 2
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds %"struct.P3D::Vector", ptr %147, i64 %151
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %152, ptr align 4 %17, i64 12, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.start.p0(i64 12, ptr %23) #10
  %153 = getelementptr inbounds %"struct.P3D::Triangle", ptr %23, i32 0, i32 0
  %154 = getelementptr inbounds %struct.anon.5, ptr %153, i32 0, i32 0
  %155 = load i32, ptr %8, align 4, !tbaa !14
  %156 = mul nsw i32 %155, 3
  store i32 %156, ptr %154, align 4, !tbaa !17
  %157 = getelementptr inbounds %struct.anon.5, ptr %153, i32 0, i32 1
  %158 = load i32, ptr %8, align 4, !tbaa !14
  %159 = mul nsw i32 %158, 3
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %157, align 4, !tbaa !19
  %161 = getelementptr inbounds %struct.anon.5, ptr %153, i32 0, i32 2
  %162 = load i32, ptr %8, align 4, !tbaa !14
  %163 = mul nsw i32 %162, 3
  %164 = add nsw i32 %163, 2
  store i32 %164, ptr %161, align 4, !tbaa !20
  %165 = load ptr, ptr %7, align 8, !tbaa !5
  %166 = load i32, ptr %8, align 4, !tbaa !14
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds %"struct.P3D::Triangle", ptr %165, i64 %167
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %168, ptr align 4 %23, i64 12, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 12, ptr %23) #10
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #10
  call void @llvm.lifetime.end.p0(i64 12, ptr %15) #10
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #10
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #10
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #10
  br label %169

169:                                              ; preds = %81
  %170 = load i32, ptr %8, align 4, !tbaa !14
  %171 = add nsw i32 %170, 1
  store i32 %171, ptr %8, align 4, !tbaa !14
  br label %74, !llvm.loop !21

172:                                              ; preds = %80
  store i1 false, ptr %24, align 1
  call void @llvm.lifetime.start.p0(i64 24, ptr %25) #10
  %173 = load ptr, ptr %4, align 8, !tbaa !5
  %174 = getelementptr inbounds %"class.P3D::MeshPrototype", ptr %173, i32 0, i32 3
  %175 = load i32, ptr %174, align 4, !tbaa !9
  %176 = mul nsw i32 %175, 3
  %177 = load ptr, ptr %4, align 8, !tbaa !5
  %178 = getelementptr inbounds %"class.P3D::MeshPrototype", ptr %177, i32 0, i32 3
  %179 = load i32, ptr %178, align 4, !tbaa !9
  %180 = load ptr, ptr %5, align 8, !tbaa !5
  %181 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN3P3D12TriangleMeshC1EiiPKNS_6VectorIfLm3EEEPKNS_8TriangleE(ptr noundef nonnull align 8 dereferenceable(24) %25, i32 noundef %176, i32 noundef %179, ptr noundef %180, ptr noundef %181)
  invoke void @_ZN3P3D8Graphics20ExtendedTriangleMeshC2ERKNS_12TriangleMeshE(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef nonnull align 8 dereferenceable(24) %25)
          to label %182 unwind label %187

182:                                              ; preds = %172
  call void @_ZN3P3D13MeshPrototypeD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %25) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr %25) #10
  call void @llvm.lifetime.start.p0(i64 16, ptr %28) #10
  %183 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @_ZNSt10shared_ptrIA_KN3P3D6VectorIfLm3EEEEC2IS2_vEEPT_(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef %183)
          to label %184 unwind label %191

184:                                              ; preds = %182
  invoke void @_ZN3P3D8Graphics20ExtendedTriangleMesh15setNormalBufferERKSt10shared_ptrIA_KNS_6VectorIfLm3EEEE(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef nonnull align 8 dereferenceable(16) %28)
          to label %185 unwind label %195

185:                                              ; preds = %184
  call void @_ZNSt12__shared_ptrIA_KN3P3D6VectorIfLm3EEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %28) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #10
  store i1 true, ptr %24, align 1
  %186 = load i1, ptr %24, align 1
  br i1 %186, label %201, label %200

187:                                              ; preds = %172
  %188 = landingpad { ptr, i32 }
          cleanup
  %189 = extractvalue { ptr, i32 } %188, 0
  store ptr %189, ptr %26, align 8
  %190 = extractvalue { ptr, i32 } %188, 1
  store i32 %190, ptr %27, align 4
  call void @_ZN3P3D13MeshPrototypeD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %25) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr %25) #10
  br label %202

191:                                              ; preds = %182
  %192 = landingpad { ptr, i32 }
          cleanup
  %193 = extractvalue { ptr, i32 } %192, 0
  store ptr %193, ptr %26, align 8
  %194 = extractvalue { ptr, i32 } %192, 1
  store i32 %194, ptr %27, align 4
  br label %199

195:                                              ; preds = %184
  %196 = landingpad { ptr, i32 }
          cleanup
  %197 = extractvalue { ptr, i32 } %196, 0
  store ptr %197, ptr %26, align 8
  %198 = extractvalue { ptr, i32 } %196, 1
  store i32 %198, ptr %27, align 4
  call void @_ZNSt12__shared_ptrIA_KN3P3D6VectorIfLm3EEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %28) #10
  br label %199

199:                                              ; preds = %195, %191
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #10
  call void @_ZN3P3D8Graphics20ExtendedTriangleMeshD2Ev(ptr noundef nonnull align 8 dereferenceable(88) %0) #10
  br label %202

200:                                              ; preds = %185
  call void @_ZN3P3D8Graphics20ExtendedTriangleMeshD2Ev(ptr noundef nonnull align 8 dereferenceable(88) %0) #10
  br label %201

201:                                              ; preds = %200, %185
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #10
  ret void

202:                                              ; preds = %199, %187
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #10
  br label %203

203:                                              ; preds = %202
  %204 = load ptr, ptr %26, align 8
  %205 = load i32, ptr %27, align 4
  %206 = insertvalue { ptr, i32 } poison, ptr %204, 0
  %207 = insertvalue { ptr, i32 } %206, i32 %205, 1
  resume { ptr, i32 } %207
}

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

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

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

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

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

declare void @_ZN3P3D12TriangleMeshC1EiiPKNS_6VectorIfLm3EEEPKNS_8TriangleE(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef, ptr noundef, ptr noundef) unnamed_addr #7

; 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 nosync nounwind speculatable willreturn memory(none) }
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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !13, i64 20}
!10 = !{!"_ZTSN3P3D13MeshPrototypeE", !11, i64 0, !12, i64 8, !13, i64 16, !13, i64 20}
!11 = !{!"_ZTSN3P3D20UniqueAlignedPointerIfEE", !6, i64 0}
!12 = !{!"_ZTSN3P3D20UniqueAlignedPointerIiEE", !6, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{!7, !7, i64 0}
!16 = !{i64 0, i64 12, !15}
!17 = !{!18, !13, i64 0}
!18 = !{!"_ZTSN3P3D8TriangleUt_Ut_E", !13, i64 0, !13, i64 4, !13, i64 8}
!19 = !{!18, !13, i64 4}
!20 = !{!18, !13, i64 8}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}


; 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.1", %"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.0", i32, i32 }
%"class.P3D::UniqueAlignedPointer" = type { ptr }
%"class.P3D::UniqueAlignedPointer.0" = type { ptr }
%"class.std::shared_ptr.1" = type { %"class.std::__shared_ptr.2" }
%"class.std::__shared_ptr.2" = 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" }
%"struct.P3D::Vector" = type { %union.anon }
%union.anon = type { [3 x float] }
%"struct.P3D::Triangle" = type { %union.anon.4 }
%union.anon.4 = type { %struct.anon.5 }
%struct.anon.5 = type { i32, i32, i32 }

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

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

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

; 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 #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; 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: mustprogress uwtable
define dso_local void @_ZN3P3D8Graphics20ExtendedTriangleMesh25generateSplitNormalsShapeERKNS_12TriangleMeshE(ptr dead_on_unwind noalias writable sret(%"struct.P3D::Graphics::ExtendedTriangleMesh") align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %1) local_unnamed_addr #6 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"struct.P3D::Vector", align 8
  %4 = alloca %"class.P3D::TriangleMesh", align 8
  %5 = alloca %"class.std::shared_ptr", align 8
  %6 = getelementptr inbounds i8, ptr %1, i64 20
  %7 = load i32, ptr %6, align 4, !tbaa !5
  %8 = mul nsw i32 %7, 3
  %9 = sext i32 %8 to i64
  %10 = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %9, i64 12)
  %11 = extractvalue { i64, i1 } %10, 1
  %12 = extractvalue { i64, i1 } %10, 0
  %13 = select i1 %11, i64 -1, i64 %12
  %14 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %13) #9
  %15 = icmp eq i32 %7, 0
  br i1 %15, label %.loopexit83, label %16

16:                                               ; preds = %2
  %17 = getelementptr inbounds %"struct.P3D::Vector", ptr %14, i64 %9
  br label %18

18:                                               ; preds = %18, %16
  %19 = phi ptr [ %14, %16 ], [ %20, %18 ]
  tail call void @_ZN3P3D6VectorIfLm3EEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %19) #10
  %20 = getelementptr inbounds i8, ptr %19, i64 12
  %21 = icmp eq ptr %20, %17
  br i1 %21, label %.loopexit83.loopexit, label %18

.loopexit83.loopexit:                             ; preds = %18
  %.pre = load i32, ptr %6, align 4, !tbaa !5
  br label %.loopexit83

.loopexit83:                                      ; preds = %.loopexit83.loopexit, %2
  %22 = phi i32 [ %.pre, %.loopexit83.loopexit ], [ 0, %2 ]
  %23 = mul nsw i32 %22, 3
  %24 = sext i32 %23 to i64
  %25 = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %24, i64 12)
  %26 = extractvalue { i64, i1 } %25, 1
  %27 = extractvalue { i64, i1 } %25, 0
  %28 = select i1 %26, i64 -1, i64 %27
  %29 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %28) #9
  %30 = icmp eq i32 %22, 0
  br i1 %30, label %.loopexit, label %31

31:                                               ; preds = %.loopexit83
  %32 = getelementptr inbounds %"struct.P3D::Vector", ptr %29, i64 %24
  br label %33

33:                                               ; preds = %33, %31
  %34 = phi ptr [ %29, %31 ], [ %35, %33 ]
  tail call void @_ZN3P3D6VectorIfLm3EEC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %34) #10
  %35 = getelementptr inbounds i8, ptr %34, i64 12
  %36 = icmp eq ptr %35, %32
  br i1 %36, label %.loopexit.loopexit, label %33

.loopexit.loopexit:                               ; preds = %33
  %.pre87 = load i32, ptr %6, align 4, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %.loopexit83
  %37 = phi i32 [ %.pre87, %.loopexit.loopexit ], [ 0, %.loopexit83 ]
  %38 = sext i32 %37 to i64
  %39 = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %38, i64 12)
  %40 = extractvalue { i64, i1 } %39, 1
  %41 = extractvalue { i64, i1 } %39, 0
  %42 = select i1 %40, i64 -1, i64 %41
  %43 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %42) #9
  %44 = icmp sgt i32 %37, 0
  br i1 %44, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.loopexit
  %.sroa.26.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 8
  br label %46

._crit_edge:                                      ; preds = %46, %.loopexit
  %.lcssa = phi i32 [ %37, %.loopexit ], [ %67, %46 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #10
  %45 = mul nsw i32 %.lcssa, 3
  call void @_ZN3P3D12TriangleMeshC1EiiPKNS_6VectorIfLm3EEEPKNS_8TriangleE(ptr noundef nonnull align 8 dereferenceable(24) %4, i32 noundef %45, i32 noundef %.lcssa, ptr noundef nonnull %14, ptr noundef nonnull %43)
  invoke void @_ZN3P3D8Graphics20ExtendedTriangleMeshC2ERKNS_12TriangleMeshE(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %70 unwind label %72

46:                                               ; preds = %.lr.ph, %46
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %46 ]
  %47 = trunc nuw nsw i64 %indvars.iv to i32
  %48 = call { i64, i32 } @_ZNK3P3D13MeshPrototype11getTriangleEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %47)
  %.fca.0.extract36 = extractvalue { i64, i32 } %48, 0
  %.fca.1.extract37 = extractvalue { i64, i32 } %48, 1
  %.sroa.040.0.extract.trunc = trunc i64 %.fca.0.extract36 to i32
  %49 = call { <2 x float>, float } @_ZNK3P3D13MeshPrototype9getVertexEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %.sroa.040.0.extract.trunc)
  %.fca.0.extract30 = extractvalue { <2 x float>, float } %49, 0
  %.fca.1.extract31 = extractvalue { <2 x float>, float } %49, 1
  %.sroa.040.4.extract.shift = lshr i64 %.fca.0.extract36, 32
  %.sroa.040.4.extract.trunc = trunc nuw i64 %.sroa.040.4.extract.shift to i32
  %50 = call { <2 x float>, float } @_ZNK3P3D13MeshPrototype9getVertexEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %.sroa.040.4.extract.trunc)
  %.fca.0.extract24 = extractvalue { <2 x float>, float } %50, 0
  %.fca.1.extract25 = extractvalue { <2 x float>, float } %50, 1
  %51 = call { <2 x float>, float } @_ZNK3P3D13MeshPrototype9getVertexEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %.fca.1.extract37)
  %.fca.0.extract18 = extractvalue { <2 x float>, float } %51, 0
  %.fca.1.extract19 = extractvalue { <2 x float>, float } %51, 1
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #10
  %52 = call { <2 x float>, float } @_ZNK3P3D12TriangleMesh22getNormalVecOfTriangleENS_8TriangleE(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 %.fca.0.extract36, i32 %.fca.1.extract37)
  %.fca.0.extract3 = extractvalue { <2 x float>, float } %52, 0
  %.fca.1.extract4 = extractvalue { <2 x float>, float } %52, 1
  store <2 x float> %.fca.0.extract3, ptr %3, align 8
  store float %.fca.1.extract4, ptr %.sroa.26.0..sroa_idx, align 8
  %53 = call { <2 x float>, float } @_ZN3P3D9normalizeIfLm3EEENS_6VectorIT_XT0_EEERKS3_(ptr noundef nonnull align 4 dereferenceable(12) %3) #10
  %.fca.0.extract = extractvalue { <2 x float>, float } %53, 0
  %.fca.1.extract = extractvalue { <2 x float>, float } %53, 1
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #10
  %54 = mul nuw nsw i64 %indvars.iv, 3
  %55 = getelementptr inbounds %"struct.P3D::Vector", ptr %14, i64 %54
  store <2 x float> %.fca.0.extract30, ptr %55, align 4
  %.sroa.435.0..sroa_idx = getelementptr inbounds i8, ptr %55, i64 8
  store float %.fca.1.extract31, ptr %.sroa.435.0..sroa_idx, align 4, !tbaa !13
  %56 = add nuw nsw i64 %54, 1
  %57 = getelementptr inbounds %"struct.P3D::Vector", ptr %14, i64 %56
  store <2 x float> %.fca.0.extract24, ptr %57, align 4
  %.sroa.429.0..sroa_idx = getelementptr inbounds i8, ptr %57, i64 8
  store float %.fca.1.extract25, ptr %.sroa.429.0..sroa_idx, align 4, !tbaa !13
  %58 = add nuw nsw i64 %54, 2
  %59 = getelementptr inbounds %"struct.P3D::Vector", ptr %14, i64 %58
  store <2 x float> %.fca.0.extract18, ptr %59, align 4
  %.sroa.423.0..sroa_idx = getelementptr inbounds i8, ptr %59, i64 8
  store float %.fca.1.extract19, ptr %.sroa.423.0..sroa_idx, align 4, !tbaa !13
  %60 = getelementptr inbounds %"struct.P3D::Vector", ptr %29, i64 %54
  store <2 x float> %.fca.0.extract, ptr %60, align 4
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %60, i64 8
  store float %.fca.1.extract, ptr %.sroa.6.0..sroa_idx, align 4, !tbaa !13
  %61 = getelementptr inbounds %"struct.P3D::Vector", ptr %29, i64 %56
  store <2 x float> %.fca.0.extract, ptr %61, align 4
  %.sroa.6.0..sroa_idx14 = getelementptr inbounds i8, ptr %61, i64 8
  store float %.fca.1.extract, ptr %.sroa.6.0..sroa_idx14, align 4, !tbaa !13
  %62 = getelementptr inbounds %"struct.P3D::Vector", ptr %29, i64 %58
  store <2 x float> %.fca.0.extract, ptr %62, align 4
  %.sroa.6.0..sroa_idx16 = getelementptr inbounds i8, ptr %62, i64 8
  store float %.fca.1.extract, ptr %.sroa.6.0..sroa_idx16, align 4, !tbaa !13
  %63 = getelementptr inbounds %"struct.P3D::Triangle", ptr %43, i64 %indvars.iv
  %64 = trunc nuw i64 %54 to i32
  store i32 %64, ptr %63, align 4
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %63, i64 4
  %65 = trunc nuw i64 %56 to i32
  store i32 %65, ptr %.sroa.4.0..sroa_idx, align 4
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %63, i64 8
  %66 = trunc nuw i64 %58 to i32
  store i32 %66, ptr %.sroa.5.0..sroa_idx, align 4, !tbaa !13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %67 = load i32, ptr %6, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = icmp slt i64 %indvars.iv.next, %68
  br i1 %69, label %46, label %._crit_edge, !llvm.loop !14

70:                                               ; preds = %._crit_edge
  call void @_ZN3P3D13MeshPrototypeD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #10
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #10
  invoke void @_ZNSt10shared_ptrIA_KN3P3D6VectorIfLm3EEEEC2IS2_vEEPT_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull %29)
          to label %71 unwind label %74

71:                                               ; preds = %70
  call void @_ZN3P3D8Graphics20ExtendedTriangleMesh15setNormalBufferERKSt10shared_ptrIA_KNS_6VectorIfLm3EEEE(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef nonnull align 8 dereferenceable(16) %5)
  call void @_ZNSt12__shared_ptrIA_KN3P3D6VectorIfLm3EEELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #10
  ret void

72:                                               ; preds = %._crit_edge
  %73 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3P3D13MeshPrototypeD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #10
  br label %76

74:                                               ; preds = %70
  %75 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #10
  call void @_ZN3P3D8Graphics20ExtendedTriangleMeshD2Ev(ptr noundef nonnull align 8 dereferenceable(88) %0) #10
  br label %76

76:                                               ; preds = %74, %72
  %.pn = phi { ptr, i32 } [ %75, %74 ], [ %73, %72 ]
  resume { ptr, i32 } %.pn
}

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

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

; 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

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

declare void @_ZN3P3D12TriangleMeshC1EiiPKNS_6VectorIfLm3EEEPKNS_8TriangleE(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef, ptr noundef, ptr noundef) unnamed_addr #7

; 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { 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 = { builtin allocsize(0) }
attributes #10 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !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,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass