; LLVM IR from SourangshuGhosh/Fluid-Simulation-for-Computer-Graphics :: src/trianglemesh.ll (ZN12TriangleMesh19updateVertexNormalsEv)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl" }
%"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl" = type { %"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl_data" }
%"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Triangle = type { [3 x i32] }
%"class.vmath::vec3" = type { float, float, float }
%class.TriangleMesh = type { %"class.std::vector", %"class.std::vector", %"class.std::vector", %"class.std::vector.0", i32, i32, i32, double, %"class.std::vector.5", %"class.std::vector.10", %class.Array3d }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<Triangle, std::allocator<Triangle>>::_Vector_impl" }
%"struct.std::_Vector_base<Triangle, std::allocator<Triangle>>::_Vector_impl" = type { %"struct.std::_Vector_base<Triangle, std::allocator<Triangle>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Triangle, std::allocator<Triangle>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.Array3d = type <{ i32, i32, i32, [4 x i8], ptr, i8, [7 x i8], %"class.std::vector.15", i32, [4 x i8] }>
%"class.std::vector.15" = type { %"struct.std::_Vector_base.16" }
%"struct.std::_Vector_base.16" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorI8TriangleSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

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

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

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

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

declare void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #3

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

; Function Attrs: nounwind
declare void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #4

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12TriangleMesh19updateVertexNormalsEv(ptr noundef nonnull align 8 dereferenceable(232) %0) #5 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca %struct.Triangle, align 4
  %7 = alloca %"class.vmath::vec3", align 4
  %8 = alloca %"class.vmath::vec3", align 4
  %9 = alloca i32, align 4
  %10 = alloca %"class.vmath::vec3", align 4
  %11 = alloca %"class.vmath::vec3", align 4
  %12 = alloca %"class.vmath::vec3", align 4
  %13 = alloca %"class.vmath::vec3", align 4
  %14 = alloca %"class.vmath::vec3", align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %"class.vmath::vec3", align 4
  %18 = alloca i32, align 4
  %19 = alloca %"class.vmath::vec3", align 4
  %20 = alloca %"class.vmath::vec3", align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %21 = load ptr, ptr %2, align 8
  %22 = getelementptr inbounds %class.TriangleMesh, ptr %21, i32 0, i32 2
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #7
  call void @_ZN12TriangleMesh22_updateVertexTrianglesEv(ptr noundef nonnull align 8 dereferenceable(232) %21)
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #7
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  %23 = getelementptr inbounds %class.TriangleMesh, ptr %21, i32 0, i32 3
  %24 = call noundef i64 @_ZNKSt6vectorI8TriangleSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %23) #7
  %25 = trunc i64 %24 to i32
  %26 = sext i32 %25 to i64
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %26)
          to label %27 unwind label %38

27:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 12, ptr %6) #7
  invoke void @_ZN8TriangleC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %6)
          to label %28 unwind label %42

28:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 12, ptr %7) #7
  invoke void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %7)
          to label %29 unwind label %46

29:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 12, ptr %8) #7
  invoke void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %8)
          to label %30 unwind label %50

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

31:                                               ; preds = %88, %30
  %32 = load i32, ptr %9, align 4, !tbaa !9
  %33 = zext i32 %32 to i64
  %34 = getelementptr inbounds %class.TriangleMesh, ptr %21, i32 0, i32 3
  %35 = call noundef i64 @_ZNKSt6vectorI8TriangleSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %34) #7
  %36 = icmp ult i64 %33, %35
  br i1 %36, label %54, label %37

37:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %114

38:                                               ; preds = %1
  %39 = landingpad { ptr, i32 }
          cleanup
  %40 = extractvalue { ptr, i32 } %39, 0
  store ptr %40, ptr %4, align 8
  %41 = extractvalue { ptr, i32 } %39, 1
  store i32 %41, ptr %5, align 4
  br label %197

42:                                               ; preds = %27
  %43 = landingpad { ptr, i32 }
          cleanup
  %44 = extractvalue { ptr, i32 } %43, 0
  store ptr %44, ptr %4, align 8
  %45 = extractvalue { ptr, i32 } %43, 1
  store i32 %45, ptr %5, align 4
  br label %196

46:                                               ; preds = %28
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %4, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %5, align 4
  br label %195

50:                                               ; preds = %29
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %4, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %5, align 4
  br label %194

54:                                               ; preds = %31
  %55 = getelementptr inbounds %class.TriangleMesh, ptr %21, i32 0, i32 3
  %56 = load i32, ptr %9, align 4, !tbaa !9
  %57 = zext i32 %56 to i64
  %58 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI8TriangleSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %55, i64 noundef %57) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %6, ptr align 4 %58, i64 12, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.start.p0(i64 12, ptr %10) #7
  %59 = getelementptr inbounds %class.TriangleMesh, ptr %21, i32 0, i32 0
  %60 = getelementptr inbounds %struct.Triangle, ptr %6, i32 0, i32 0
  %61 = getelementptr inbounds [3 x i32], ptr %60, i64 0, i64 1
  %62 = load i32, ptr %61, align 4, !tbaa !9
  %63 = sext i32 %62 to i64
  %64 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %59, i64 noundef %63) #7
  %65 = getelementptr inbounds %class.TriangleMesh, ptr %21, i32 0, i32 0
  %66 = getelementptr inbounds %struct.Triangle, ptr %6, i32 0, i32 0
  %67 = getelementptr inbounds [3 x i32], ptr %66, i64 0, i64 0
  %68 = load i32, ptr %67, align 4, !tbaa !9
  %69 = sext i32 %68 to i64
  %70 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %65, i64 noundef %69) #7
  invoke void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %10, ptr noundef nonnull align 4 dereferenceable(12) %64, ptr noundef nonnull align 4 dereferenceable(12) %70)
          to label %71 unwind label %91

71:                                               ; preds = %54
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %7, ptr align 4 %10, i64 12, i1 false), !tbaa.struct !13
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %10) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %11) #7
  %72 = getelementptr inbounds %class.TriangleMesh, ptr %21, i32 0, i32 0
  %73 = getelementptr inbounds %struct.Triangle, ptr %6, i32 0, i32 0
  %74 = getelementptr inbounds [3 x i32], ptr %73, i64 0, i64 2
  %75 = load i32, ptr %74, align 4, !tbaa !9
  %76 = sext i32 %75 to i64
  %77 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %72, i64 noundef %76) #7
  %78 = getelementptr inbounds %class.TriangleMesh, ptr %21, i32 0, i32 0
  %79 = getelementptr inbounds %struct.Triangle, ptr %6, i32 0, i32 0
  %80 = getelementptr inbounds [3 x i32], ptr %79, i64 0, i64 0
  %81 = load i32, ptr %80, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %78, i64 noundef %82) #7
  invoke void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %11, ptr noundef nonnull align 4 dereferenceable(12) %77, ptr noundef nonnull align 4 dereferenceable(12) %83)
          to label %84 unwind label %95

84:                                               ; preds = %71
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %8, ptr align 4 %11, i64 12, i1 false), !tbaa.struct !13
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %11) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %13) #7
  invoke void @_ZN5vmath5crossERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %13, ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %8)
          to label %85 unwind label %99

85:                                               ; preds = %84
  invoke void @_ZN5vmath9normalizeERKNS_4vec3E(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %12, ptr noundef nonnull align 4 dereferenceable(12) %13)
          to label %86 unwind label %103

86:                                               ; preds = %85
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %13) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #7
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(12) %12)
          to label %87 unwind label %108

87:                                               ; preds = %86
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %12) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #7
  br label %88

88:                                               ; preds = %87
  %89 = load i32, ptr %9, align 4, !tbaa !9
  %90 = add i32 %89, 1
  store i32 %90, ptr %9, align 4, !tbaa !9
  br label %31, !llvm.loop !16

91:                                               ; preds = %54
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %4, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #7
  br label %113

95:                                               ; preds = %71
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %4, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #7
  br label %113

99:                                               ; preds = %84
  %100 = landingpad { ptr, i32 }
          cleanup
  %101 = extractvalue { ptr, i32 } %100, 0
  store ptr %101, ptr %4, align 8
  %102 = extractvalue { ptr, i32 } %100, 1
  store i32 %102, ptr %5, align 4
  br label %107

103:                                              ; preds = %85
  %104 = landingpad { ptr, i32 }
          cleanup
  %105 = extractvalue { ptr, i32 } %104, 0
  store ptr %105, ptr %4, align 8
  %106 = extractvalue { ptr, i32 } %104, 1
  store i32 %106, ptr %5, align 4
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %13) #7
  br label %107

107:                                              ; preds = %103, %99
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #7
  br label %112

108:                                              ; preds = %86
  %109 = landingpad { ptr, i32 }
          cleanup
  %110 = extractvalue { ptr, i32 } %109, 0
  store ptr %110, ptr %4, align 8
  %111 = extractvalue { ptr, i32 } %109, 1
  store i32 %111, ptr %5, align 4
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %12) #7
  br label %112

112:                                              ; preds = %108, %107
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #7
  br label %113

113:                                              ; preds = %112, %95, %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %193

114:                                              ; preds = %37
  call void @llvm.lifetime.start.p0(i64 12, ptr %14) #7
  invoke void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %14)
          to label %115 unwind label %123

115:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %116

116:                                              ; preds = %174, %115
  %117 = load i32, ptr %15, align 4, !tbaa !9
  %118 = zext i32 %117 to i64
  %119 = getelementptr inbounds %class.TriangleMesh, ptr %21, i32 0, i32 8
  %120 = call noundef i64 @_ZNKSt6vectorIS_IiSaIiEESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %119) #7
  %121 = icmp ult i64 %118, %120
  br i1 %121, label %127, label %122

122:                                              ; preds = %116
  store i32 5, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %191

123:                                              ; preds = %114
  %124 = landingpad { ptr, i32 }
          cleanup
  %125 = extractvalue { ptr, i32 } %124, 0
  store ptr %125, ptr %4, align 8
  %126 = extractvalue { ptr, i32 } %124, 1
  store i32 %126, ptr %5, align 4
  br label %192

127:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 12, ptr %17) #7
  invoke void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %17)
          to label %128 unwind label %139

128:                                              ; preds = %127
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %17, i64 12, i1 false), !tbaa.struct !13
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %17) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %129

129:                                              ; preds = %156, %128
  %130 = load i32, ptr %18, align 4, !tbaa !9
  %131 = zext i32 %130 to i64
  %132 = getelementptr inbounds %class.TriangleMesh, ptr %21, i32 0, i32 8
  %133 = load i32, ptr %15, align 4, !tbaa !9
  %134 = zext i32 %133 to i64
  %135 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %132, i64 noundef %134) #7
  %136 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %135) #7
  %137 = icmp ult i64 %131, %136
  br i1 %137, label %143, label %138

138:                                              ; preds = %129
  store i32 8, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %163

139:                                              ; preds = %127
  %140 = landingpad { ptr, i32 }
          cleanup
  %141 = extractvalue { ptr, i32 } %140, 0
  store ptr %141, ptr %4, align 8
  %142 = extractvalue { ptr, i32 } %140, 1
  store i32 %142, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #7
  br label %190

143:                                              ; preds = %129
  %144 = getelementptr inbounds %class.TriangleMesh, ptr %21, i32 0, i32 8
  %145 = load i32, ptr %15, align 4, !tbaa !9
  %146 = zext i32 %145 to i64
  %147 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %144, i64 noundef %146) #7
  %148 = load i32, ptr %18, align 4, !tbaa !9
  %149 = zext i32 %148 to i64
  %150 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %147, i64 noundef %149) #7
  %151 = load i32, ptr %150, align 4, !tbaa !9
  %152 = sext i32 %151 to i64
  %153 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %152) #7
  %154 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZN5vmathpLERNS_4vec3ERKS0_(ptr noundef nonnull align 4 dereferenceable(12) %14, ptr noundef nonnull align 4 dereferenceable(12) %153)
          to label %155 unwind label %159

155:                                              ; preds = %143
  br label %156

156:                                              ; preds = %155
  %157 = load i32, ptr %18, align 4, !tbaa !9
  %158 = add i32 %157, 1
  store i32 %158, ptr %18, align 4, !tbaa !9
  br label %129, !llvm.loop !18

159:                                              ; preds = %143
  %160 = landingpad { ptr, i32 }
          cleanup
  %161 = extractvalue { ptr, i32 } %160, 0
  store ptr %161, ptr %4, align 8
  %162 = extractvalue { ptr, i32 } %160, 1
  store i32 %162, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %190

163:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 12, ptr %19) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %20) #7
  %164 = getelementptr inbounds %class.TriangleMesh, ptr %21, i32 0, i32 8
  %165 = load i32, ptr %15, align 4, !tbaa !9
  %166 = zext i32 %165 to i64
  %167 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %164, i64 noundef %166) #7
  %168 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %167) #7
  %169 = uitofp i64 %168 to float
  invoke void @_ZN5vmathdvERKNS_4vec3Ef(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %20, ptr noundef nonnull align 4 dereferenceable(12) %14, float noundef %169)
          to label %170 unwind label %177

170:                                              ; preds = %163
  invoke void @_ZN5vmath9normalizeERKNS_4vec3E(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %19, ptr noundef nonnull align 4 dereferenceable(12) %20)
          to label %171 unwind label %181

171:                                              ; preds = %170
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %19, i64 12, i1 false), !tbaa.struct !13
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %19) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %20) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %19) #7
  %172 = getelementptr inbounds %class.TriangleMesh, ptr %21, i32 0, i32 2
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %172, ptr noundef nonnull align 4 dereferenceable(12) %14)
          to label %173 unwind label %186

173:                                              ; preds = %171
  br label %174

174:                                              ; preds = %173
  %175 = load i32, ptr %15, align 4, !tbaa !9
  %176 = add i32 %175, 1
  store i32 %176, ptr %15, align 4, !tbaa !9
  br label %116, !llvm.loop !19

177:                                              ; preds = %163
  %178 = landingpad { ptr, i32 }
          cleanup
  %179 = extractvalue { ptr, i32 } %178, 0
  store ptr %179, ptr %4, align 8
  %180 = extractvalue { ptr, i32 } %178, 1
  store i32 %180, ptr %5, align 4
  br label %185

181:                                              ; preds = %170
  %182 = landingpad { ptr, i32 }
          cleanup
  %183 = extractvalue { ptr, i32 } %182, 0
  store ptr %183, ptr %4, align 8
  %184 = extractvalue { ptr, i32 } %182, 1
  store i32 %184, ptr %5, align 4
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %20) #7
  br label %185

185:                                              ; preds = %181, %177
  call void @llvm.lifetime.end.p0(i64 12, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %19) #7
  br label %190

186:                                              ; preds = %171
  %187 = landingpad { ptr, i32 }
          cleanup
  %188 = extractvalue { ptr, i32 } %187, 0
  store ptr %188, ptr %4, align 8
  %189 = extractvalue { ptr, i32 } %187, 1
  store i32 %189, ptr %5, align 4
  br label %190

190:                                              ; preds = %186, %185, %159, %139
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %14) #7
  br label %192

191:                                              ; preds = %122
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %14) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %8) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %6) #7
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #7
  ret void

192:                                              ; preds = %190, %123
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #7
  br label %193

193:                                              ; preds = %192, %113
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #7
  br label %194

194:                                              ; preds = %193, %50
  call void @llvm.lifetime.end.p0(i64 12, ptr %8) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #7
  br label %195

195:                                              ; preds = %194, %46
  call void @llvm.lifetime.end.p0(i64 12, ptr %7) #7
  br label %196

196:                                              ; preds = %195, %42
  call void @llvm.lifetime.end.p0(i64 12, ptr %6) #7
  br label %197

197:                                              ; preds = %196, %38
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #7
  br label %198

198:                                              ; preds = %197
  %199 = load ptr, ptr %4, align 8
  %200 = load i32, ptr %5, align 4
  %201 = insertvalue { ptr, i32 } poison, ptr %199, 0
  %202 = insertvalue { ptr, i32 } %201, i32 %200, 1
  resume { ptr, i32 } %202
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN12TriangleMesh22_updateVertexTrianglesEv(ptr noundef nonnull align 8 dereferenceable(232)) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #5 align 2

declare void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5vmath9normalizeERKNS_4vec3E(ptr dead_on_unwind noalias writable sret(%"class.vmath::vec3") align 4, ptr noundef nonnull align 4 dereferenceable(12)) #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5vmath5crossERKNS_4vec3ES2_(ptr dead_on_unwind noalias writable sret(%"class.vmath::vec3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #6

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12)) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIS_IiSaIiEESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

declare noundef nonnull align 4 dereferenceable(12) ptr @_ZN5vmathpLERNS_4vec3ERKS0_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

declare void @_ZN5vmathdvERKNS_4vec3Ef(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4, ptr noundef nonnull align 4 dereferenceable(12), float noundef) #3

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

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

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


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl" }
%"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl" = type { %"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl_data" }
%"struct.std::_Vector_base<vmath::vec3, std::allocator<vmath::vec3>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Triangle = type { [3 x i32] }
%"class.vmath::vec3" = type { float, float, float }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorI8TriangleSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

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

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

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

declare void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #3

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

; Function Attrs: nounwind
declare void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #4

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12TriangleMesh19updateVertexNormalsEv(ptr noundef nonnull align 8 dereferenceable(232) %0) local_unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca %struct.Triangle, align 4
  %4 = alloca %"class.vmath::vec3", align 4
  %5 = alloca %"class.vmath::vec3", align 4
  %6 = alloca %"class.vmath::vec3", align 4
  %7 = alloca %"class.vmath::vec3", align 4
  %8 = alloca %"class.vmath::vec3", align 4
  %9 = alloca %"class.vmath::vec3", align 4
  %10 = alloca %"class.vmath::vec3", align 4
  %11 = alloca %"class.vmath::vec3", align 4
  %12 = alloca %"class.vmath::vec3", align 4
  %13 = alloca %"class.vmath::vec3", align 4
  %14 = getelementptr inbounds i8, ptr %0, i64 48
  tail call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #7
  tail call void @_ZN12TriangleMesh22_updateVertexTrianglesEv(ptr noundef nonnull align 8 dereferenceable(232) %0)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #7
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  %15 = getelementptr inbounds i8, ptr %0, i64 72
  %16 = call noundef i64 @_ZNKSt6vectorI8TriangleSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #7
  %sext = shl i64 %16, 32
  %17 = ashr exact i64 %sext, 32
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %17)
          to label %18 unwind label %25

18:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #7
  call void @_ZN8TriangleC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %3)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #7
  invoke void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %4)
          to label %19 unwind label %27

19:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #7
  invoke void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %5)
          to label %.preheader42 unwind label %29

.preheader42:                                     ; preds = %19
  %20 = call noundef i64 @_ZNKSt6vectorI8TriangleSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #7
  %.not = icmp eq i64 %20, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader42
  %21 = getelementptr inbounds i8, ptr %3, i64 4
  %22 = getelementptr inbounds i8, ptr %3, i64 8
  br label %31

._crit_edge:                                      ; preds = %50, %.preheader42
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #7
  invoke void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %10)
          to label %.preheader unwind label %67

.preheader:                                       ; preds = %._crit_edge
  %23 = getelementptr inbounds i8, ptr %0, i64 120
  %24 = call noundef i64 @_ZNKSt6vectorIS_IiSaIiEESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %23) #7
  %.not51 = icmp eq i64 %24, 0
  br i1 %.not51, label %._crit_edge50, label %.lr.ph49

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

27:                                               ; preds = %18
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %111

29:                                               ; preds = %19
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %110

31:                                               ; preds = %.lr.ph, %50
  %32 = phi i64 [ 0, %.lr.ph ], [ %52, %50 ]
  %.01443 = phi i32 [ 0, %.lr.ph ], [ %51, %50 ]
  %33 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI8TriangleSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %32) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %33, i64 12, i1 false), !tbaa.struct !5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #7
  %34 = load i32, ptr %21, align 4, !tbaa !9
  %35 = sext i32 %34 to i64
  %36 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %35) #7
  %37 = load i32, ptr %3, align 4, !tbaa !9
  %38 = sext i32 %37 to i64
  %39 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %38) #7
  invoke void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %6, ptr noundef nonnull align 4 dereferenceable(12) %36, ptr noundef nonnull align 4 dereferenceable(12) %39)
          to label %40 unwind label %55

40:                                               ; preds = %31
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %6, i64 12, i1 false), !tbaa.struct !11
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %6) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #7
  %41 = load i32, ptr %22, align 4, !tbaa !9
  %42 = sext i32 %41 to i64
  %43 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %42) #7
  %44 = load i32, ptr %3, align 4, !tbaa !9
  %45 = sext i32 %44 to i64
  %46 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %45) #7
  invoke void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %7, ptr noundef nonnull align 4 dereferenceable(12) %43, ptr noundef nonnull align 4 dereferenceable(12) %46)
          to label %47 unwind label %57

47:                                               ; preds = %40
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %7, i64 12, i1 false), !tbaa.struct !11
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #7
  invoke void @_ZN5vmath5crossERKNS_4vec3ES2_(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %9, ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %5)
          to label %48 unwind label %59

48:                                               ; preds = %47
  invoke void @_ZN5vmath9normalizeERKNS_4vec3E(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %8, ptr noundef nonnull align 4 dereferenceable(12) %9)
          to label %49 unwind label %61

49:                                               ; preds = %48
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #7
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 4 dereferenceable(12) %8)
          to label %50 unwind label %64

50:                                               ; preds = %49
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #7
  %51 = add i32 %.01443, 1
  %52 = zext i32 %51 to i64
  %53 = call noundef i64 @_ZNKSt6vectorI8TriangleSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #7
  %54 = icmp ugt i64 %53, %52
  br i1 %54, label %31, label %._crit_edge, !llvm.loop !14

55:                                               ; preds = %31
  %56 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #7
  br label %109

57:                                               ; preds = %40
  %58 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #7
  br label %109

59:                                               ; preds = %47
  %60 = landingpad { ptr, i32 }
          cleanup
  br label %63

61:                                               ; preds = %48
  %62 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #7
  br label %63

63:                                               ; preds = %61, %59
  %.pn33 = phi { ptr, i32 } [ %62, %61 ], [ %60, %59 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #7
  br label %66

64:                                               ; preds = %49
  %65 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #7
  br label %66

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

._crit_edge50:                                    ; preds = %95, %.preheader
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %10) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %5) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %4) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #7
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #7
  ret void

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

.lr.ph49:                                         ; preds = %.preheader, %95
  %69 = phi i64 [ %97, %95 ], [ 0, %.preheader ]
  %.01348 = phi i32 [ %96, %95 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %11) #7
  invoke void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %11)
          to label %70 unwind label %76

70:                                               ; preds = %.lr.ph49
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %11, i64 12, i1 false), !tbaa.struct !11
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %11) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #7
  %71 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %69) #7
  %72 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %71) #7
  %.not52 = icmp eq i64 %72, 0
  br i1 %.not52, label %._crit_edge47, label %.lr.ph46

._crit_edge47:                                    ; preds = %85, %70
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %12) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %13) #7
  %73 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %69) #7
  %74 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %73) #7
  %75 = uitofp i64 %74 to float
  invoke void @_ZN5vmathdvERKNS_4vec3Ef(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %13, ptr noundef nonnull align 4 dereferenceable(12) %10, float noundef %75)
          to label %93 unwind label %100

76:                                               ; preds = %.lr.ph49
  %77 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #7
  br label %107

.lr.ph46:                                         ; preds = %70, %85
  %78 = phi i64 [ %87, %85 ], [ 0, %70 ]
  %.044 = phi i32 [ %86, %85 ], [ 0, %70 ]
  %79 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %69) #7
  %80 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %79, i64 noundef %78) #7
  %81 = load i32, ptr %80, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %82) #7
  %84 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZN5vmathpLERNS_4vec3ERKS0_(ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %83)
          to label %85 unwind label %91

85:                                               ; preds = %.lr.ph46
  %86 = add i32 %.044, 1
  %87 = zext i32 %86 to i64
  %88 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %69) #7
  %89 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %88) #7
  %90 = icmp ugt i64 %89, %87
  br i1 %90, label %.lr.ph46, label %._crit_edge47, !llvm.loop !16

91:                                               ; preds = %.lr.ph46
  %92 = landingpad { ptr, i32 }
          cleanup
  br label %107

93:                                               ; preds = %._crit_edge47
  invoke void @_ZN5vmath9normalizeERKNS_4vec3E(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %12, ptr noundef nonnull align 4 dereferenceable(12) %13)
          to label %94 unwind label %102

94:                                               ; preds = %93
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %12, i64 12, i1 false), !tbaa.struct !11
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %12) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %13) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #7
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 4 dereferenceable(12) %10)
          to label %95 unwind label %105

95:                                               ; preds = %94
  %96 = add i32 %.01348, 1
  %97 = zext i32 %96 to i64
  %98 = call noundef i64 @_ZNKSt6vectorIS_IiSaIiEESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %23) #7
  %99 = icmp ugt i64 %98, %97
  br i1 %99, label %.lr.ph49, label %._crit_edge50, !llvm.loop !17

100:                                              ; preds = %._crit_edge47
  %101 = landingpad { ptr, i32 }
          cleanup
  br label %104

102:                                              ; preds = %93
  %103 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %13) #7
  br label %104

104:                                              ; preds = %102, %100
  %.pn = phi { ptr, i32 } [ %103, %102 ], [ %101, %100 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #7
  br label %107

105:                                              ; preds = %94
  %106 = landingpad { ptr, i32 }
          cleanup
  br label %107

107:                                              ; preds = %105, %104, %91, %76
  %.pn30 = phi { ptr, i32 } [ %92, %91 ], [ %106, %105 ], [ %.pn, %104 ], [ %77, %76 ]
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %10) #7
  br label %108

108:                                              ; preds = %107, %67
  %.pn30.pn = phi { ptr, i32 } [ %.pn30, %107 ], [ %68, %67 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #7
  br label %109

109:                                              ; preds = %55, %57, %66, %108
  %.pn35.pn.pn = phi { ptr, i32 } [ %.pn30.pn, %108 ], [ %.pn35, %66 ], [ %58, %57 ], [ %56, %55 ]
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %5) #7
  br label %110

110:                                              ; preds = %109, %29
  %.pn35.pn.pn.pn = phi { ptr, i32 } [ %.pn35.pn.pn, %109 ], [ %30, %29 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #7
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %4) #7
  br label %111

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

112:                                              ; preds = %111, %25
  %.pn35.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn35.pn.pn.pn.pn, %111 ], [ %26, %25 ]
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #7
  resume { ptr, i32 } %.pn35.pn.pn.pn.pn.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN12TriangleMesh22_updateVertexTrianglesEv(ptr noundef nonnull align 8 dereferenceable(232)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #5 align 2

declare void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5vmath9normalizeERKNS_4vec3E(ptr dead_on_unwind noalias writable sret(%"class.vmath::vec3") align 4, ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5vmath5crossERKNS_4vec3ES2_(ptr dead_on_unwind noalias writable sret(%"class.vmath::vec3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIS_IiSaIiEESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

declare noundef nonnull align 4 dereferenceable(12) ptr @_ZN5vmathpLERNS_4vec3ERKS0_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #3

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

declare void @_ZN5vmathdvERKNS_4vec3Ef(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4, ptr noundef nonnull align 4 dereferenceable(12), float noundef) local_unnamed_addr #3

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

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

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


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