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

; 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.vmath::vec3" = type { float, float, float }
%"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] }
%"struct.std::_Bit_reference" = type { ptr, i64 }
%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 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(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: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

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

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

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

; 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
declare dso_local void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 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)) #4

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

; 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 @_ZN5vmathplERKNS_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)) #4

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12TriangleMesh19_smoothTriangleMeshEdRSt6vectorIbSaIbEE(ptr noundef nonnull align 8 dereferenceable(232) %0, double noundef %1, ptr noundef nonnull align 8 dereferenceable(40) %2) #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca double, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"class.std::vector", align 8
  %8 = alloca ptr, align 8
  %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 %struct.Triangle, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %"struct.std::_Bit_reference", align 8
  %17 = alloca i32, align 4
  %18 = alloca %"class.vmath::vec3", align 4
  %19 = alloca i32, align 4
  %20 = alloca %"class.vmath::vec3", align 4
  %21 = alloca %"class.vmath::vec3", align 4
  %22 = alloca %"class.vmath::vec3", align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store double %1, ptr %5, align 8, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !5
  %23 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #6
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  %24 = getelementptr inbounds %class.TriangleMesh, ptr %23, i32 0, i32 0
  %25 = call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %24) #6
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %25)
          to label %26 unwind label %38

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

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

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

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

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

31:                                               ; preds = %185, %30
  %32 = load i32, ptr %14, align 4, !tbaa !11
  %33 = zext i32 %32 to i64
  %34 = getelementptr inbounds %class.TriangleMesh, ptr %23, i32 0, i32 0
  %35 = call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %34) #6
  %36 = icmp ult i64 %33, %35
  br i1 %36, label %58, label %37

37:                                               ; preds = %31
  store i32 2, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %208

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

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

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

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

54:                                               ; preds = %208, %29
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %8, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %9, align 4
  br label %212

58:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #6
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  %60 = load i32, ptr %14, align 4, !tbaa !11
  %61 = zext i32 %60 to i64
  %62 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %59, i64 noundef %61)
          to label %63 unwind label %76

63:                                               ; preds = %58
  %64 = getelementptr inbounds { ptr, i64 }, ptr %16, i32 0, i32 0
  %65 = extractvalue { ptr, i64 } %62, 0
  store ptr %65, ptr %64, align 8
  %66 = getelementptr inbounds { ptr, i64 }, ptr %16, i32 0, i32 1
  %67 = extractvalue { ptr, i64 } %62, 1
  store i64 %67, ptr %66, align 8
  %68 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %16) #6
  %69 = xor i1 %68, true
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #6
  br i1 %69, label %70, label %84

70:                                               ; preds = %63
  %71 = getelementptr inbounds %class.TriangleMesh, ptr %23, i32 0, i32 0
  %72 = load i32, ptr %14, align 4, !tbaa !11
  %73 = zext i32 %72 to i64
  %74 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %71, i64 noundef %73) #6
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 4 dereferenceable(12) %74)
          to label %75 unwind label %80

75:                                               ; preds = %70
  br label %185

76:                                               ; preds = %58
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %8, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #6
  br label %207

80:                                               ; preds = %70
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %8, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %9, align 4
  br label %207

84:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 12, ptr %18) #6
  invoke void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %18)
          to label %85 unwind label %96

85:                                               ; preds = %84
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 4 %18, i64 12, i1 false), !tbaa.struct !13
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %18) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 0, ptr %19, align 4, !tbaa !11
  br label %86

86:                                               ; preds = %167, %85
  %87 = load i32, ptr %19, align 4, !tbaa !11
  %88 = zext i32 %87 to i64
  %89 = getelementptr inbounds %class.TriangleMesh, ptr %23, i32 0, i32 8
  %90 = load i32, ptr %14, align 4, !tbaa !11
  %91 = zext i32 %90 to i64
  %92 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %89, i64 noundef %91) #6
  %93 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %92) #6
  %94 = icmp ult i64 %88, %93
  br i1 %94, label %100, label %95

95:                                               ; preds = %86
  store i32 5, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %170

96:                                               ; preds = %84
  %97 = landingpad { ptr, i32 }
          cleanup
  %98 = extractvalue { ptr, i32 } %97, 0
  store ptr %98, ptr %8, align 8
  %99 = extractvalue { ptr, i32 } %97, 1
  store i32 %99, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %18) #6
  br label %206

100:                                              ; preds = %86
  %101 = getelementptr inbounds %class.TriangleMesh, ptr %23, i32 0, i32 3
  %102 = getelementptr inbounds %class.TriangleMesh, ptr %23, i32 0, i32 8
  %103 = load i32, ptr %14, align 4, !tbaa !11
  %104 = zext i32 %103 to i64
  %105 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %102, i64 noundef %104) #6
  %106 = load i32, ptr %19, align 4, !tbaa !11
  %107 = zext i32 %106 to i64
  %108 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %105, i64 noundef %107) #6
  %109 = load i32, ptr %108, align 4, !tbaa !11
  %110 = sext i32 %109 to i64
  %111 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI8TriangleSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %101, i64 noundef %110) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %111, i64 12, i1 false), !tbaa.struct !16
  %112 = getelementptr inbounds %struct.Triangle, ptr %13, i32 0, i32 0
  %113 = getelementptr inbounds [3 x i32], ptr %112, i64 0, i64 0
  %114 = load i32, ptr %113, align 4, !tbaa !11
  %115 = load i32, ptr %14, align 4, !tbaa !11
  %116 = icmp ne i32 %114, %115
  br i1 %116, label %117, label %132

117:                                              ; preds = %100
  %118 = getelementptr inbounds %class.TriangleMesh, ptr %23, i32 0, i32 0
  %119 = getelementptr inbounds %struct.Triangle, ptr %13, i32 0, i32 0
  %120 = getelementptr inbounds [3 x i32], ptr %119, i64 0, i64 0
  %121 = load i32, ptr %120, align 4, !tbaa !11
  %122 = sext i32 %121 to i64
  %123 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %118, i64 noundef %122) #6
  %124 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZN5vmathpLERNS_4vec3ERKS0_(ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef nonnull align 4 dereferenceable(12) %123)
          to label %125 unwind label %128

125:                                              ; preds = %117
  %126 = load i32, ptr %17, align 4, !tbaa !11
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %17, align 4, !tbaa !11
  br label %132

128:                                              ; preds = %155, %138, %117
  %129 = landingpad { ptr, i32 }
          cleanup
  %130 = extractvalue { ptr, i32 } %129, 0
  store ptr %130, ptr %8, align 8
  %131 = extractvalue { ptr, i32 } %129, 1
  store i32 %131, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %206

132:                                              ; preds = %125, %100
  %133 = getelementptr inbounds %struct.Triangle, ptr %13, i32 0, i32 0
  %134 = getelementptr inbounds [3 x i32], ptr %133, i64 0, i64 1
  %135 = load i32, ptr %134, align 4, !tbaa !11
  %136 = load i32, ptr %14, align 4, !tbaa !11
  %137 = icmp ne i32 %135, %136
  br i1 %137, label %138, label %149

138:                                              ; preds = %132
  %139 = getelementptr inbounds %class.TriangleMesh, ptr %23, i32 0, i32 0
  %140 = getelementptr inbounds %struct.Triangle, ptr %13, i32 0, i32 0
  %141 = getelementptr inbounds [3 x i32], ptr %140, i64 0, i64 1
  %142 = load i32, ptr %141, align 4, !tbaa !11
  %143 = sext i32 %142 to i64
  %144 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %139, i64 noundef %143) #6
  %145 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZN5vmathpLERNS_4vec3ERKS0_(ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef nonnull align 4 dereferenceable(12) %144)
          to label %146 unwind label %128

146:                                              ; preds = %138
  %147 = load i32, ptr %17, align 4, !tbaa !11
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %17, align 4, !tbaa !11
  br label %149

149:                                              ; preds = %146, %132
  %150 = getelementptr inbounds %struct.Triangle, ptr %13, i32 0, i32 0
  %151 = getelementptr inbounds [3 x i32], ptr %150, i64 0, i64 2
  %152 = load i32, ptr %151, align 4, !tbaa !11
  %153 = load i32, ptr %14, align 4, !tbaa !11
  %154 = icmp ne i32 %152, %153
  br i1 %154, label %155, label %166

155:                                              ; preds = %149
  %156 = getelementptr inbounds %class.TriangleMesh, ptr %23, i32 0, i32 0
  %157 = getelementptr inbounds %struct.Triangle, ptr %13, i32 0, i32 0
  %158 = getelementptr inbounds [3 x i32], ptr %157, i64 0, i64 2
  %159 = load i32, ptr %158, align 4, !tbaa !11
  %160 = sext i32 %159 to i64
  %161 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %156, i64 noundef %160) #6
  %162 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZN5vmathpLERNS_4vec3ERKS0_(ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef nonnull align 4 dereferenceable(12) %161)
          to label %163 unwind label %128

163:                                              ; preds = %155
  %164 = load i32, ptr %17, align 4, !tbaa !11
  %165 = add nsw i32 %164, 1
  store i32 %165, ptr %17, align 4, !tbaa !11
  br label %166

166:                                              ; preds = %163, %149
  br label %167

167:                                              ; preds = %166
  %168 = load i32, ptr %19, align 4, !tbaa !11
  %169 = add i32 %168, 1
  store i32 %169, ptr %19, align 4, !tbaa !11
  br label %86, !llvm.loop !18

170:                                              ; preds = %95
  %171 = load i32, ptr %17, align 4, !tbaa !11
  %172 = sitofp i32 %171 to float
  %173 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZN5vmathdVERNS_4vec3Ef(ptr noundef nonnull align 4 dereferenceable(12) %12, float noundef %172)
          to label %174 unwind label %188

174:                                              ; preds = %170
  %175 = getelementptr inbounds %class.TriangleMesh, ptr %23, i32 0, i32 0
  %176 = load i32, ptr %14, align 4, !tbaa !11
  %177 = zext i32 %176 to i64
  %178 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %175, i64 noundef %177) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %178, i64 12, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.start.p0(i64 12, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr %21) #6
  %179 = load double, ptr %5, align 8, !tbaa !9
  %180 = fptrunc double %179 to float
  call void @llvm.lifetime.start.p0(i64 12, ptr %22) #6
  invoke void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %22, ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef nonnull align 4 dereferenceable(12) %10)
          to label %181 unwind label %192

181:                                              ; preds = %174
  invoke void @_ZN5vmathmlEfRKNS_4vec3E(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %21, float noundef %180, ptr noundef nonnull align 4 dereferenceable(12) %22)
          to label %182 unwind label %196

182:                                              ; preds = %181
  invoke void @_ZN5vmathplERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %20, ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %21)
          to label %183 unwind label %200

183:                                              ; preds = %182
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 %20, i64 12, i1 false), !tbaa.struct !13
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %20) #6
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %21) #6
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %22) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %20) #6
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 4 dereferenceable(12) %11)
          to label %184 unwind label %188

184:                                              ; preds = %183
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %185

185:                                              ; preds = %184, %75
  %186 = load i32, ptr %14, align 4, !tbaa !11
  %187 = add i32 %186, 1
  store i32 %187, ptr %14, align 4, !tbaa !11
  br label %31, !llvm.loop !20

188:                                              ; preds = %183, %170
  %189 = landingpad { ptr, i32 }
          cleanup
  %190 = extractvalue { ptr, i32 } %189, 0
  store ptr %190, ptr %8, align 8
  %191 = extractvalue { ptr, i32 } %189, 1
  store i32 %191, ptr %9, align 4
  br label %206

192:                                              ; preds = %174
  %193 = landingpad { ptr, i32 }
          cleanup
  %194 = extractvalue { ptr, i32 } %193, 0
  store ptr %194, ptr %8, align 8
  %195 = extractvalue { ptr, i32 } %193, 1
  store i32 %195, ptr %9, align 4
  br label %205

196:                                              ; preds = %181
  %197 = landingpad { ptr, i32 }
          cleanup
  %198 = extractvalue { ptr, i32 } %197, 0
  store ptr %198, ptr %8, align 8
  %199 = extractvalue { ptr, i32 } %197, 1
  store i32 %199, ptr %9, align 4
  br label %204

200:                                              ; preds = %182
  %201 = landingpad { ptr, i32 }
          cleanup
  %202 = extractvalue { ptr, i32 } %201, 0
  store ptr %202, ptr %8, align 8
  %203 = extractvalue { ptr, i32 } %201, 1
  store i32 %203, ptr %9, align 4
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %21) #6
  br label %204

204:                                              ; preds = %200, %196
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %22) #6
  br label %205

205:                                              ; preds = %204, %192
  call void @llvm.lifetime.end.p0(i64 12, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %20) #6
  br label %206

206:                                              ; preds = %205, %188, %128, %96
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %207

207:                                              ; preds = %206, %80, %76
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %212

208:                                              ; preds = %37
  %209 = getelementptr inbounds %class.TriangleMesh, ptr %23, i32 0, i32 0
  %210 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %209, ptr noundef nonnull align 8 dereferenceable(24) %7)
          to label %211 unwind label %54

211:                                              ; preds = %208
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #6
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %12) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #6
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %11) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #6
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %10) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #6
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #6
  ret void

212:                                              ; preds = %207, %54
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #6
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %12) #6
  br label %213

213:                                              ; preds = %212, %50
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #6
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %11) #6
  br label %214

214:                                              ; preds = %213, %46
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #6
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %10) #6
  br label %215

215:                                              ; preds = %214, %42
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #6
  br label %216

216:                                              ; preds = %215, %38
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #6
  br label %217

217:                                              ; preds = %216
  %218 = load ptr, ptr %8, align 8
  %219 = load i32, ptr %9, align 4
  %220 = insertvalue { ptr, i32 } poison, ptr %218, 0
  %221 = insertvalue { ptr, i32 } %220, i32 %219, 1
  resume { ptr, i32 } %221
}

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) #2 align 2

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

declare noundef nonnull align 4 dereferenceable(12) ptr @_ZN5vmathdVERNS_4vec3Ef(ptr noundef nonnull align 4 dereferenceable(12), float noundef) #4

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 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { "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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !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 = !{i64 0, i64 12, !17}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}


; 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.vmath::vec3" = type { float, float, float }
%"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] }
%"struct.std::_Bit_reference" = type { ptr, i64 }

; 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 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(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 uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

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

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

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

; 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
declare dso_local void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 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 #4

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

; 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 @_ZN5vmathplERKNS_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 #4

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12TriangleMesh19_smoothTriangleMeshEdRSt6vectorIbSaIbEE(ptr noundef nonnull align 8 dereferenceable(232) %0, double noundef %1, ptr noundef nonnull align 8 dereferenceable(40) %2) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca %"class.vmath::vec3", align 4
  %6 = alloca %"class.vmath::vec3", align 4
  %7 = alloca %"class.vmath::vec3", align 4
  %8 = alloca %struct.Triangle, align 4
  %9 = alloca %"struct.std::_Bit_reference", align 8
  %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
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #6
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  %14 = call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %14)
          to label %15 unwind label %27

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

16:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #6
  invoke void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %6)
          to label %17 unwind label %31

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

18:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #6
  call void @_ZN8TriangleC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %8)
  %19 = call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  %.not62 = icmp eq i64 %19, 0
  br i1 %.not62, label %._crit_edge61, label %.lr.ph60

.lr.ph60:                                         ; preds = %18
  %20 = getelementptr inbounds i8, ptr %9, i64 8
  %21 = getelementptr inbounds i8, ptr %0, i64 120
  %22 = getelementptr inbounds i8, ptr %0, i64 72
  %23 = getelementptr inbounds i8, ptr %8, i64 4
  %24 = getelementptr inbounds i8, ptr %8, i64 8
  %25 = fptrunc double %1 to float
  br label %37

._crit_edge61:                                    ; preds = %100, %18
  %26 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %115 unwind label %35

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

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

31:                                               ; preds = %16
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %118

33:                                               ; preds = %17
  %34 = landingpad { ptr, i32 }
          cleanup
  br label %117

35:                                               ; preds = %._crit_edge61
  %36 = landingpad { ptr, i32 }
          cleanup
  br label %116

37:                                               ; preds = %.lr.ph60, %100
  %38 = phi i64 [ 0, %.lr.ph60 ], [ %102, %100 ]
  %.02257 = phi i32 [ 0, %.lr.ph60 ], [ %101, %100 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #6
  %39 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %2, i64 noundef %38)
          to label %40 unwind label %46

40:                                               ; preds = %37
  %41 = extractvalue { ptr, i64 } %39, 0
  store ptr %41, ptr %9, align 8
  %42 = extractvalue { ptr, i64 } %39, 1
  store i64 %42, ptr %20, align 8
  %43 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %9) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #6
  br i1 %43, label %50, label %44

44:                                               ; preds = %40
  %45 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %38) #6
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 4 dereferenceable(12) %45)
          to label %100 unwind label %48

46:                                               ; preds = %37
  %47 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #6
  br label %116

48:                                               ; preds = %44
  %49 = landingpad { ptr, i32 }
          cleanup
  br label %116

50:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #6
  invoke void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %10)
          to label %51 unwind label %56

51:                                               ; preds = %50
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %10, i64 12, i1 false), !tbaa.struct !5
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %10) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #6
  %52 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %38) #6
  %53 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %52) #6
  %.not63 = icmp eq i64 %53, 0
  br i1 %.not63, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %89, %51
  %.021.lcssa = phi i32 [ 0, %51 ], [ %.3, %89 ]
  %54 = sitofp i32 %.021.lcssa to float
  %55 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZN5vmathdVERNS_4vec3Ef(ptr noundef nonnull align 4 dereferenceable(12) %7, float noundef %54)
          to label %95 unwind label %105

56:                                               ; preds = %50
  %57 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #6
  br label %116

.lr.ph:                                           ; preds = %51, %89
  %58 = phi i64 [ %91, %89 ], [ 0, %51 ]
  %.056 = phi i32 [ %90, %89 ], [ 0, %51 ]
  %.02155 = phi i32 [ %.3, %89 ], [ 0, %51 ]
  %59 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %38) #6
  %60 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %59, i64 noundef %58) #6
  %61 = load i32, ptr %60, align 4, !tbaa !10
  %62 = sext i32 %61 to i64
  %63 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI8TriangleSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %62) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(12) %63, i64 12, i1 false), !tbaa.struct !12
  %64 = load i32, ptr %8, align 4, !tbaa !10
  %.not = icmp eq i32 %64, %.02257
  br i1 %.not, label %73, label %65

65:                                               ; preds = %.lr.ph
  %66 = sext i32 %64 to i64
  %67 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %66) #6
  %68 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZN5vmathpLERNS_4vec3ERKS0_(ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %67)
          to label %69 unwind label %71

69:                                               ; preds = %65
  %70 = add nsw i32 %.02155, 1
  br label %73

71:                                               ; preds = %83, %75, %65
  %72 = landingpad { ptr, i32 }
          cleanup
  br label %116

73:                                               ; preds = %69, %.lr.ph
  %.1 = phi i32 [ %70, %69 ], [ %.02155, %.lr.ph ]
  %74 = load i32, ptr %23, align 4, !tbaa !10
  %.not43 = icmp eq i32 %74, %.02257
  br i1 %.not43, label %81, label %75

75:                                               ; preds = %73
  %76 = sext i32 %74 to i64
  %77 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %76) #6
  %78 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZN5vmathpLERNS_4vec3ERKS0_(ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %77)
          to label %79 unwind label %71

79:                                               ; preds = %75
  %80 = add nsw i32 %.1, 1
  br label %81

81:                                               ; preds = %79, %73
  %.2 = phi i32 [ %80, %79 ], [ %.1, %73 ]
  %82 = load i32, ptr %24, align 4, !tbaa !10
  %.not44 = icmp eq i32 %82, %.02257
  br i1 %.not44, label %89, label %83

83:                                               ; preds = %81
  %84 = sext i32 %82 to i64
  %85 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %84) #6
  %86 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZN5vmathpLERNS_4vec3ERKS0_(ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %85)
          to label %87 unwind label %71

87:                                               ; preds = %83
  %88 = add nsw i32 %.2, 1
  br label %89

89:                                               ; preds = %81, %87
  %.3 = phi i32 [ %88, %87 ], [ %.2, %81 ]
  %90 = add i32 %.056, 1
  %91 = zext i32 %90 to i64
  %92 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %38) #6
  %93 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %92) #6
  %94 = icmp ugt i64 %93, %91
  br i1 %94, label %.lr.ph, label %._crit_edge, !llvm.loop !14

95:                                               ; preds = %._crit_edge
  %96 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN5vmath4vec3ESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %38) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %96, i64 12, i1 false), !tbaa.struct !5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %11) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %12) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %13) #6
  invoke void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %13, ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %5)
          to label %97 unwind label %107

97:                                               ; preds = %95
  invoke void @_ZN5vmathmlEfRKNS_4vec3E(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %12, float noundef %25, ptr noundef nonnull align 4 dereferenceable(12) %13)
          to label %98 unwind label %109

98:                                               ; preds = %97
  invoke void @_ZN5vmathplERKNS_4vec3ES2_(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %11, ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %12)
          to label %99 unwind label %111

99:                                               ; preds = %98
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %6, ptr noundef nonnull align 4 dereferenceable(12) %11, i64 12, i1 false), !tbaa.struct !5
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %11) #6
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %12) #6
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %13) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #6
  invoke void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 4 dereferenceable(12) %6)
          to label %100 unwind label %105

100:                                              ; preds = %99, %44
  %101 = add i32 %.02257, 1
  %102 = zext i32 %101 to i64
  %103 = call noundef i64 @_ZNKSt6vectorIN5vmath4vec3ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  %104 = icmp ugt i64 %103, %102
  br i1 %104, label %37, label %._crit_edge61, !llvm.loop !16

105:                                              ; preds = %99, %._crit_edge
  %106 = landingpad { ptr, i32 }
          cleanup
  br label %116

107:                                              ; preds = %95
  %108 = landingpad { ptr, i32 }
          cleanup
  br label %114

109:                                              ; preds = %97
  %110 = landingpad { ptr, i32 }
          cleanup
  br label %113

111:                                              ; preds = %98
  %112 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %12) #6
  br label %113

113:                                              ; preds = %111, %109
  %.pn = phi { ptr, i32 } [ %112, %111 ], [ %110, %109 ]
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %13) #6
  br label %114

114:                                              ; preds = %113, %107
  %.pn.pn = phi { ptr, i32 } [ %.pn, %113 ], [ %108, %107 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #6
  br label %116

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

116:                                              ; preds = %46, %48, %114, %105, %71, %56, %35
  %.pn47.pn = phi { ptr, i32 } [ %36, %35 ], [ %49, %48 ], [ %47, %46 ], [ %72, %71 ], [ %106, %105 ], [ %.pn.pn, %114 ], [ %57, %56 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #6
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #6
  br label %117

117:                                              ; preds = %116, %33
  %.pn47.pn.pn = phi { ptr, i32 } [ %.pn47.pn, %116 ], [ %34, %33 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #6
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %6) #6
  br label %118

118:                                              ; preds = %117, %31
  %.pn47.pn.pn.pn = phi { ptr, i32 } [ %.pn47.pn.pn, %117 ], [ %32, %31 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #6
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %5) #6
  br label %119

119:                                              ; preds = %118, %29
  %.pn47.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn47.pn.pn.pn, %118 ], [ %30, %29 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #6
  br label %120

120:                                              ; preds = %119, %27
  %.pn47.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn47.pn.pn.pn.pn, %119 ], [ %28, %27 ]
  call void @_ZNSt6vectorIN5vmath4vec3ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  resume { ptr, i32 } %.pn47.pn.pn.pn.pn.pn
}

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

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

declare noundef nonnull align 4 dereferenceable(12) ptr @_ZN5vmathdVERNS_4vec3Ef(ptr noundef nonnull align 4 dereferenceable(12), float noundef) local_unnamed_addr #4

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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { "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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 4, !6, i64 4, i64 4, !6, i64 8, i64 4, !6}
!6 = !{!7, !7, i64 0}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{i64 0, i64 12, !13}
!13 = !{!8, !8, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}


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