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

; 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 }
%struct.GridIndex = type { i32, i32, i32 }
%class.LevelSet = type { i32, i32, i32, double, i32, %class.TriangleMesh, %class.Array3d.20, %class.Array3d.22, %class.Array3d.24, %"class.std::vector.10", double, i32, %class.Array3d.24 }
%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" = 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 }
%"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.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 }
%class.Array3d.20 = type <{ i32, i32, i32, [4 x i8], ptr, i8, [3 x i8], float, i32, [4 x i8] }>
%class.Array3d.22 = type <{ i32, i32, i32, [4 x i8], ptr, i8, [3 x i8], i32, i32, [4 x i8] }>
%"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.24 = type { i32, i32, i32, ptr, i8, i8, i32 }

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7Array3dIbEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(32), i64, i32) #5 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN6Grid3d18isGridIndexInRangeE9GridIndexiii(i64, i32, i32 noundef, i32 noundef, i32 noundef) #6

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7Array3dIiEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(36), i64, i32) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNSt14numeric_limitsIdE8infinityEv() #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZN8LevelSet25_minDistToTriangleSquaredEN5vmath4vec3EiPS1_(ptr noundef nonnull align 8 dereferenceable(448), ptr noundef, i32 noundef, ptr noundef) #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { i64, i32 } @_ZN6Grid3d19positionToGridIndexEN5vmath4vec3Ed(ptr noundef, double noundef) #7

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8LevelSet26_findClosestPointOnSurfaceEN5vmath4vec3EPi(ptr dead_on_unwind noalias writable sret(%"class.vmath::vec3") align 4 %0, ptr noundef nonnull align 8 dereferenceable(448) %1, ptr noundef %2, ptr noundef %3) #5 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %struct.GridIndex, align 4
  %10 = alloca %"class.vmath::vec3", align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca { i64, i32 }, align 8
  %14 = alloca [7 x %struct.GridIndex], align 16
  %15 = alloca %struct.GridIndex, align 4
  %16 = alloca { i64, i32 }, align 4
  %17 = alloca double, align 8
  %18 = alloca i1, align 1
  %19 = alloca i32, align 4
  %20 = alloca %struct.GridIndex, align 4
  %21 = alloca i32, align 4
  %22 = alloca %struct.GridIndex, align 4
  %23 = alloca { i64, i32 }, align 4
  %24 = alloca %struct.GridIndex, align 4
  %25 = alloca { i64, i32 }, align 4
  %26 = alloca %"class.vmath::vec3", align 4
  %27 = alloca double, align 8
  %28 = alloca %"class.vmath::vec3", align 4
  %29 = alloca %struct.GridIndex, align 4
  %30 = alloca { i64, i32 }, align 4
  %31 = alloca %struct.GridIndex, align 4
  %32 = alloca { i64, i32 }, align 4
  store ptr %0, ptr %5, align 8
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  %33 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 12, ptr %9) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %2, i64 12, i1 false), !tbaa.struct !9
  %34 = getelementptr inbounds %class.LevelSet, ptr %33, i32 0, i32 3
  %35 = load double, ptr %34, align 8, !tbaa !12
  %36 = invoke { i64, i32 } @_ZN6Grid3d19positionToGridIndexEN5vmath4vec3Ed(ptr noundef %10, double noundef %35)
          to label %37 unwind label %57

37:                                               ; preds = %4
  store { i64, i32 } %36, ptr %13, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 8 %13, i64 12, i1 false)
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %10) #8
  call void @llvm.lifetime.start.p0(i64 84, ptr %14) #8
  %38 = getelementptr inbounds [7 x %struct.GridIndex], ptr %14, i32 0, i32 0
  %39 = getelementptr inbounds %struct.GridIndex, ptr %38, i64 7
  br label %40

40:                                               ; preds = %40, %37
  %41 = phi ptr [ %38, %37 ], [ %42, %40 ]
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %41)
  %42 = getelementptr inbounds %struct.GridIndex, ptr %41, i64 1
  %43 = icmp eq ptr %42, %39
  br i1 %43, label %44, label %40

44:                                               ; preds = %40
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %9, i64 12, i1 false), !tbaa.struct !42
  %45 = getelementptr inbounds [7 x %struct.GridIndex], ptr %14, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %15, i64 12, i1 false)
  %46 = getelementptr inbounds { i64, i32 }, ptr %16, i32 0, i32 0
  %47 = load i64, ptr %46, align 4
  %48 = getelementptr inbounds { i64, i32 }, ptr %16, i32 0, i32 1
  %49 = load i32, ptr %48, align 4
  call void @_ZN8LevelSet25_getNeighbourGridIndices6E9GridIndexPS0_(ptr noundef nonnull align 8 dereferenceable(448) %33, i64 %47, i32 %49, ptr noundef %45)
  %50 = getelementptr inbounds [7 x %struct.GridIndex], ptr %14, i64 0, i64 6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %50, ptr align 4 %9, i64 12, i1 false), !tbaa.struct !42
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %51 = call noundef double @_ZNSt14numeric_limitsIdE8infinityEv() #8
  store double %51, ptr %17, align 8, !tbaa !44
  store i1 false, ptr %18, align 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %0, ptr align 4 %2, i64 12, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  store i32 -1, ptr %19, align 4, !tbaa !43
  call void @llvm.lifetime.start.p0(i64 12, ptr %20) #8
  invoke void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %20)
          to label %52 unwind label %61

52:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  store i32 0, ptr %21, align 4, !tbaa !43
  br label %53

53:                                               ; preds = %132, %52
  %54 = load i32, ptr %21, align 4, !tbaa !43
  %55 = icmp slt i32 %54, 7
  br i1 %55, label %65, label %56

56:                                               ; preds = %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %136

57:                                               ; preds = %4
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %11, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %12, align 4
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %10) #8
  br label %143

61:                                               ; preds = %44
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %11, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %12, align 4
  br label %140

65:                                               ; preds = %53
  %66 = load i32, ptr %21, align 4, !tbaa !43
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [7 x %struct.GridIndex], ptr %14, i64 0, i64 %67
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %20, ptr align 4 %68, i64 12, i1 false), !tbaa.struct !42
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 4 %9, i64 12, i1 false), !tbaa.struct !42
  %69 = getelementptr inbounds %class.LevelSet, ptr %33, i32 0, i32 0
  %70 = load i32, ptr %69, align 8, !tbaa !45
  %71 = getelementptr inbounds %class.LevelSet, ptr %33, i32 0, i32 1
  %72 = load i32, ptr %71, align 4, !tbaa !46
  %73 = getelementptr inbounds %class.LevelSet, ptr %33, i32 0, i32 2
  %74 = load i32, ptr %73, align 8, !tbaa !47
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 4 %22, i64 12, i1 false)
  %75 = getelementptr inbounds { i64, i32 }, ptr %23, i32 0, i32 0
  %76 = load i64, ptr %75, align 4
  %77 = getelementptr inbounds { i64, i32 }, ptr %23, i32 0, i32 1
  %78 = load i32, ptr %77, align 4
  %79 = invoke noundef zeroext i1 @_ZN6Grid3d18isGridIndexInRangeE9GridIndexiii(i64 %76, i32 %78, i32 noundef %70, i32 noundef %72, i32 noundef %74)
          to label %80 unwind label %112

80:                                               ; preds = %65
  br i1 %79, label %81, label %131

81:                                               ; preds = %80
  %82 = getelementptr inbounds %class.LevelSet, ptr %33, i32 0, i32 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %24, ptr align 4 %20, i64 12, i1 false), !tbaa.struct !42
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %25, ptr align 4 %24, i64 12, i1 false)
  %83 = getelementptr inbounds { i64, i32 }, ptr %25, i32 0, i32 0
  %84 = load i64, ptr %83, align 4
  %85 = getelementptr inbounds { i64, i32 }, ptr %25, i32 0, i32 1
  %86 = load i32, ptr %85, align 4
  %87 = invoke noundef zeroext i1 @_ZN7Array3dIbEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(32) %82, i64 %84, i32 %86)
          to label %88 unwind label %112

88:                                               ; preds = %81
  br i1 %87, label %89, label %131

89:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 12, ptr %26) #8
  invoke void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %26)
          to label %90 unwind label %116

90:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %28, ptr align 4 %2, i64 12, i1 false), !tbaa.struct !9
  %91 = getelementptr inbounds %class.LevelSet, ptr %33, i32 0, i32 7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %29, ptr align 4 %20, i64 12, i1 false), !tbaa.struct !42
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %30, ptr align 4 %29, i64 12, i1 false)
  %92 = getelementptr inbounds { i64, i32 }, ptr %30, i32 0, i32 0
  %93 = load i64, ptr %92, align 4
  %94 = getelementptr inbounds { i64, i32 }, ptr %30, i32 0, i32 1
  %95 = load i32, ptr %94, align 4
  %96 = invoke noundef i32 @_ZN7Array3dIiEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(36) %91, i64 %93, i32 %95)
          to label %97 unwind label %120

97:                                               ; preds = %90
  %98 = invoke noundef double @_ZN8LevelSet25_minDistToTriangleSquaredEN5vmath4vec3EiPS1_(ptr noundef nonnull align 8 dereferenceable(448) %33, ptr noundef %28, i32 noundef %96, ptr noundef %26)
          to label %99 unwind label %120

99:                                               ; preds = %97
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %28) #8
  store double %98, ptr %27, align 8, !tbaa !44
  %100 = load double, ptr %27, align 8, !tbaa !44
  %101 = load double, ptr %17, align 8, !tbaa !44
  %102 = fcmp olt double %100, %101
  br i1 %102, label %103, label %128

103:                                              ; preds = %99
  %104 = load double, ptr %27, align 8, !tbaa !44
  store double %104, ptr %17, align 8, !tbaa !44
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %0, ptr align 4 %26, i64 12, i1 false), !tbaa.struct !9
  %105 = getelementptr inbounds %class.LevelSet, ptr %33, i32 0, i32 7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %31, ptr align 4 %20, i64 12, i1 false), !tbaa.struct !42
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %32, ptr align 4 %31, i64 12, i1 false)
  %106 = getelementptr inbounds { i64, i32 }, ptr %32, i32 0, i32 0
  %107 = load i64, ptr %106, align 4
  %108 = getelementptr inbounds { i64, i32 }, ptr %32, i32 0, i32 1
  %109 = load i32, ptr %108, align 4
  %110 = invoke noundef i32 @_ZN7Array3dIiEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(36) %105, i64 %107, i32 %109)
          to label %111 unwind label %124

111:                                              ; preds = %103
  store i32 %110, ptr %19, align 4, !tbaa !43
  br label %128

112:                                              ; preds = %81, %65
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %11, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %12, align 4
  br label %135

116:                                              ; preds = %89
  %117 = landingpad { ptr, i32 }
          cleanup
  %118 = extractvalue { ptr, i32 } %117, 0
  store ptr %118, ptr %11, align 8
  %119 = extractvalue { ptr, i32 } %117, 1
  store i32 %119, ptr %12, align 4
  br label %130

120:                                              ; preds = %97, %90
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %11, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %12, align 4
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %28) #8
  br label %129

124:                                              ; preds = %103
  %125 = landingpad { ptr, i32 }
          cleanup
  %126 = extractvalue { ptr, i32 } %125, 0
  store ptr %126, ptr %11, align 8
  %127 = extractvalue { ptr, i32 } %125, 1
  store i32 %127, ptr %12, align 4
  br label %129

128:                                              ; preds = %111, %99
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %26) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %26) #8
  br label %131

129:                                              ; preds = %124, %120
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %26) #8
  br label %130

130:                                              ; preds = %129, %116
  call void @llvm.lifetime.end.p0(i64 12, ptr %26) #8
  br label %135

131:                                              ; preds = %128, %88, %80
  br label %132

132:                                              ; preds = %131
  %133 = load i32, ptr %21, align 4, !tbaa !43
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %21, align 4, !tbaa !43
  br label %53, !llvm.loop !48

135:                                              ; preds = %130, %112
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %140

136:                                              ; preds = %56
  %137 = load i32, ptr %19, align 4, !tbaa !43
  %138 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 %137, ptr %138, align 4, !tbaa !43
  store i1 true, ptr %18, align 1
  call void @llvm.lifetime.end.p0(i64 12, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  %139 = load i1, ptr %18, align 1
  br i1 %139, label %142, label %141

140:                                              ; preds = %135, %61
  call void @llvm.lifetime.end.p0(i64 12, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 84, ptr %14) #8
  br label %143

141:                                              ; preds = %136
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #8
  br label %142

142:                                              ; preds = %141, %136
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 84, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #8
  ret void

143:                                              ; preds = %140, %57
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #8
  br label %144

144:                                              ; preds = %143
  %145 = load ptr, ptr %11, align 8
  %146 = load i32, ptr %12, align 4
  %147 = insertvalue { ptr, i32 } poison, ptr %145, 0
  %148 = insertvalue { ptr, i32 } %147, i32 %146, 1
  resume { ptr, i32 } %148
}

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 #4 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress uwtable "min-legal-vector-width"="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 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 #7 = { 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 #8 = { 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 = !{i64 0, i64 4, !10, i64 4, i64 4, !10, i64 8, i64 4, !10}
!10 = !{!11, !11, i64 0}
!11 = !{!"float", !7, i64 0}
!12 = !{!13, !15, i64 16}
!13 = !{!"_ZTS8LevelSet", !14, i64 0, !14, i64 4, !14, i64 8, !15, i64 16, !14, i64 24, !16, i64 32, !39, i64 264, !40, i64 304, !41, i64 344, !29, i64 376, !15, i64 400, !14, i64 408, !41, i64 416}
!14 = !{!"int", !7, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = !{!"_ZTS12TriangleMesh", !17, i64 0, !17, i64 24, !17, i64 48, !21, i64 72, !14, i64 96, !14, i64 100, !14, i64 104, !15, i64 112, !25, i64 120, !29, i64 144, !33, i64 168}
!17 = !{!"_ZTSSt6vectorIN5vmath4vec3ESaIS1_EE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIN5vmath4vec3ESaIS1_EE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIN5vmath4vec3ESaIS1_EE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIN5vmath4vec3ESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!21 = !{!"_ZTSSt6vectorI8TriangleSaIS0_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseI8TriangleSaIS0_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseI8TriangleSaIS0_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseI8TriangleSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!25 = !{!"_ZTSSt6vectorIS_IiSaIiEESaIS1_EE", !26, i64 0}
!26 = !{!"_ZTSSt12_Vector_baseISt6vectorIiSaIiEESaIS2_EE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseISt6vectorIiSaIiEESaIS2_EE12_Vector_implE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseISt6vectorIiSaIiEESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!29 = !{!"_ZTSSt6vectorIdSaIdEE", !30, i64 0}
!30 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!33 = !{!"_ZTS7Array3dISt6vectorIiSaIiEEE", !14, i64 0, !14, i64 4, !14, i64 8, !6, i64 16, !34, i64 24, !35, i64 32, !14, i64 56}
!34 = !{!"bool", !7, i64 0}
!35 = !{!"_ZTSSt6vectorIiSaIiEE", !36, i64 0}
!36 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !37, i64 0}
!37 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !38, i64 0}
!38 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!39 = !{!"_ZTS7Array3dIfE", !14, i64 0, !14, i64 4, !14, i64 8, !6, i64 16, !34, i64 24, !11, i64 28, !14, i64 32}
!40 = !{!"_ZTS7Array3dIiE", !14, i64 0, !14, i64 4, !14, i64 8, !6, i64 16, !34, i64 24, !14, i64 28, !14, i64 32}
!41 = !{!"_ZTS7Array3dIbE", !14, i64 0, !14, i64 4, !14, i64 8, !6, i64 16, !34, i64 24, !34, i64 25, !14, i64 28}
!42 = !{i64 0, i64 4, !43, i64 4, i64 4, !43, i64 8, i64 4, !43}
!43 = !{!14, !14, i64 0}
!44 = !{!15, !15, i64 0}
!45 = !{!13, !14, i64 0}
!46 = !{!13, !14, i64 4}
!47 = !{!13, !14, i64 8}
!48 = distinct !{!48, !49}
!49 = !{!"llvm.loop.mustprogress"}


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

%"class.vmath::vec3" = type { float, float, float }
%struct.GridIndex = type { i32, i32, i32 }

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; 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 nounwind uwtable
declare dso_local void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7Array3dIbEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(32), i64, i32) local_unnamed_addr #5 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN6Grid3d18isGridIndexInRangeE9GridIndexiii(i64, i32, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7Array3dIiEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(36), i64, i32) local_unnamed_addr #5 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZN8LevelSet25_minDistToTriangleSquaredEN5vmath4vec3EiPS1_(ptr noundef nonnull align 8 dereferenceable(448), ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { i64, i32 } @_ZN6Grid3d19positionToGridIndexEN5vmath4vec3Ed(ptr noundef, double noundef) local_unnamed_addr #7

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8LevelSet26_findClosestPointOnSurfaceEN5vmath4vec3EPi(ptr dead_on_unwind noalias writable sret(%"class.vmath::vec3") align 4 %0, ptr noundef nonnull align 8 dereferenceable(448) %1, ptr nocapture noundef readonly %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.vmath::vec3", align 4
  %6 = alloca [7 x %struct.GridIndex], align 16
  %7 = alloca %struct.GridIndex, align 8
  %8 = alloca %"class.vmath::vec3", align 4
  %9 = alloca %"class.vmath::vec3", align 4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %2, i64 12, i1 false), !tbaa.struct !5
  %10 = getelementptr inbounds i8, ptr %1, i64 16
  %11 = load double, ptr %10, align 8, !tbaa !10
  %12 = invoke { i64, i32 } @_ZN6Grid3d19positionToGridIndexEN5vmath4vec3Ed(ptr noundef nonnull %5, double noundef %11)
          to label %13 unwind label %20

13:                                               ; preds = %4
  %.fca.0.extract = extractvalue { i64, i32 } %12, 0
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %5) #8
  call void @llvm.lifetime.start.p0(i64 84, ptr nonnull %6) #8
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %6)
  %.ptr.1 = getelementptr inbounds i8, ptr %6, i64 12
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.1)
  %.ptr.2 = getelementptr inbounds i8, ptr %6, i64 24
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.2)
  %.ptr.3 = getelementptr inbounds i8, ptr %6, i64 36
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.3)
  %.ptr.4 = getelementptr inbounds i8, ptr %6, i64 48
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.4)
  %.ptr.5 = getelementptr inbounds i8, ptr %6, i64 60
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.5)
  %.ptr.6 = getelementptr inbounds i8, ptr %6, i64 72
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.6)
  %.fca.1.extract = extractvalue { i64, i32 } %12, 1
  call void @_ZN8LevelSet25_getNeighbourGridIndices6E9GridIndexPS0_(ptr noundef nonnull align 8 dereferenceable(448) %1, i64 %.fca.0.extract, i32 %.fca.1.extract, ptr noundef nonnull %6)
  store i64 %.fca.0.extract, ptr %.ptr.6, align 8
  %.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 80
  store i32 %.fca.1.extract, ptr %.sroa.7.0..sroa_idx, align 16, !tbaa !41
  %14 = call noundef double @_ZNSt14numeric_limitsIdE8infinityEv() #8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %2, i64 12, i1 false), !tbaa.struct !5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #8
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %7)
  %15 = getelementptr inbounds i8, ptr %1, i64 4
  %16 = getelementptr inbounds i8, ptr %1, i64 8
  %17 = getelementptr inbounds i8, ptr %1, i64 344
  %.sroa.211.0..sroa_idx = getelementptr inbounds i8, ptr %7, i64 8
  %18 = getelementptr inbounds i8, ptr %1, i64 304
  br label %22

19:                                               ; preds = %51
  store i32 %.242, ptr %3, align 4, !tbaa !41
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 84, ptr nonnull %6) #8
  ret void

20:                                               ; preds = %4
  %21 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %5) #8
  br label %53

22:                                               ; preds = %13, %51
  %indvars.iv = phi i64 [ 0, %13 ], [ %indvars.iv.next, %51 ]
  %.03756 = phi double [ %14, %13 ], [ %.239, %51 ]
  %.04055 = phi i32 [ -1, %13 ], [ %.242, %51 ]
  %23 = getelementptr inbounds [7 x %struct.GridIndex], ptr %6, i64 0, i64 %indvars.iv
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %23, i64 12, i1 false), !tbaa.struct !42
  %24 = load i32, ptr %1, align 8, !tbaa !43
  %25 = load i32, ptr %15, align 4, !tbaa !44
  %26 = load i32, ptr %16, align 8, !tbaa !45
  %27 = call noundef zeroext i1 @_ZN6Grid3d18isGridIndexInRangeE9GridIndexiii(i64 %.fca.0.extract, i32 %.fca.1.extract, i32 noundef %24, i32 noundef %25, i32 noundef %26)
  br i1 %27, label %28, label %51

28:                                               ; preds = %22
  %.sroa.010.0.copyload = load i64, ptr %7, align 8
  %.sroa.211.0.copyload = load i32, ptr %.sroa.211.0..sroa_idx, align 8, !tbaa !41
  %29 = invoke noundef zeroext i1 @_ZN7Array3dIbEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(32) %17, i64 %.sroa.010.0.copyload, i32 %.sroa.211.0.copyload)
          to label %30 unwind label %40

30:                                               ; preds = %28
  br i1 %29, label %31, label %51

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

32:                                               ; preds = %31
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %2, i64 12, i1 false), !tbaa.struct !5
  %.sroa.05.0.copyload = load i64, ptr %7, align 8
  %.sroa.26.0.copyload = load i32, ptr %.sroa.211.0..sroa_idx, align 8, !tbaa !41
  %33 = invoke noundef i32 @_ZN7Array3dIiEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(36) %18, i64 %.sroa.05.0.copyload, i32 %.sroa.26.0.copyload)
          to label %34 unwind label %44

34:                                               ; preds = %32
  %35 = invoke noundef double @_ZN8LevelSet25_minDistToTriangleSquaredEN5vmath4vec3EiPS1_(ptr noundef nonnull align 8 dereferenceable(448) %1, ptr noundef nonnull %9, i32 noundef %33, ptr noundef nonnull %8)
          to label %36 unwind label %44

36:                                               ; preds = %34
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #8
  %37 = fcmp olt double %35, %.03756
  br i1 %37, label %38, label %48

38:                                               ; preds = %36
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %8, i64 12, i1 false), !tbaa.struct !5
  %.sroa.01.0.copyload = load i64, ptr %7, align 8
  %.sroa.22.0.copyload = load i32, ptr %.sroa.211.0..sroa_idx, align 8, !tbaa !41
  %39 = invoke noundef i32 @_ZN7Array3dIiEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(36) %18, i64 %.sroa.01.0.copyload, i32 %.sroa.22.0.copyload)
          to label %48 unwind label %46

40:                                               ; preds = %28
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %52

42:                                               ; preds = %31
  %43 = landingpad { ptr, i32 }
          cleanup
  br label %50

44:                                               ; preds = %34, %32
  %45 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #8
  br label %49

46:                                               ; preds = %38
  %47 = landingpad { ptr, i32 }
          cleanup
  br label %49

48:                                               ; preds = %38, %36
  %.141 = phi i32 [ %.04055, %36 ], [ %39, %38 ]
  %.138 = phi double [ %.03756, %36 ], [ %35, %38 ]
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #8
  br label %51

49:                                               ; preds = %46, %44
  %.pn = phi { ptr, i32 } [ %47, %46 ], [ %45, %44 ]
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #8
  br label %50

50:                                               ; preds = %49, %42
  %.pn.pn = phi { ptr, i32 } [ %.pn, %49 ], [ %43, %42 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #8
  br label %52

51:                                               ; preds = %22, %30, %48
  %.242 = phi i32 [ %.141, %48 ], [ %.04055, %30 ], [ %.04055, %22 ]
  %.239 = phi double [ %.138, %48 ], [ %.03756, %30 ], [ %.03756, %22 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 7
  br i1 %exitcond.not, label %19, label %22, !llvm.loop !46

52:                                               ; preds = %50, %40
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %50 ], [ %41, %40 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #8
  call void @llvm.lifetime.end.p0(i64 84, ptr nonnull %6) #8
  br label %53

53:                                               ; preds = %52, %20
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %52 ], [ %21, %20 ]
  resume { ptr, i32 } %.pn.pn.pn.pn
}

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 #4 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress uwtable "min-legal-vector-width"="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 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 #7 = { 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 #8 = { 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, !13, i64 16}
!11 = !{!"_ZTS8LevelSet", !12, i64 0, !12, i64 4, !12, i64 8, !13, i64 16, !12, i64 24, !14, i64 32, !38, i64 264, !39, i64 304, !40, i64 344, !28, i64 376, !13, i64 400, !12, i64 408, !40, i64 416}
!12 = !{!"int", !8, i64 0}
!13 = !{!"double", !8, i64 0}
!14 = !{!"_ZTS12TriangleMesh", !15, i64 0, !15, i64 24, !15, i64 48, !20, i64 72, !12, i64 96, !12, i64 100, !12, i64 104, !13, i64 112, !24, i64 120, !28, i64 144, !32, i64 168}
!15 = !{!"_ZTSSt6vectorIN5vmath4vec3ESaIS1_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseIN5vmath4vec3ESaIS1_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIN5vmath4vec3ESaIS1_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIN5vmath4vec3ESaIS1_EE17_Vector_impl_dataE", !19, i64 0, !19, i64 8, !19, i64 16}
!19 = !{!"any pointer", !8, i64 0}
!20 = !{!"_ZTSSt6vectorI8TriangleSaIS0_EE", !21, i64 0}
!21 = !{!"_ZTSSt12_Vector_baseI8TriangleSaIS0_EE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseI8TriangleSaIS0_EE12_Vector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseI8TriangleSaIS0_EE17_Vector_impl_dataE", !19, i64 0, !19, i64 8, !19, i64 16}
!24 = !{!"_ZTSSt6vectorIS_IiSaIiEESaIS1_EE", !25, i64 0}
!25 = !{!"_ZTSSt12_Vector_baseISt6vectorIiSaIiEESaIS2_EE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseISt6vectorIiSaIiEESaIS2_EE12_Vector_implE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseISt6vectorIiSaIiEESaIS2_EE17_Vector_impl_dataE", !19, i64 0, !19, i64 8, !19, i64 16}
!28 = !{!"_ZTSSt6vectorIdSaIdEE", !29, i64 0}
!29 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !19, i64 0, !19, i64 8, !19, i64 16}
!32 = !{!"_ZTS7Array3dISt6vectorIiSaIiEEE", !12, i64 0, !12, i64 4, !12, i64 8, !19, i64 16, !33, i64 24, !34, i64 32, !12, i64 56}
!33 = !{!"bool", !8, i64 0}
!34 = !{!"_ZTSSt6vectorIiSaIiEE", !35, i64 0}
!35 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !36, i64 0}
!36 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !37, i64 0}
!37 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !19, i64 0, !19, i64 8, !19, i64 16}
!38 = !{!"_ZTS7Array3dIfE", !12, i64 0, !12, i64 4, !12, i64 8, !19, i64 16, !33, i64 24, !7, i64 28, !12, i64 32}
!39 = !{!"_ZTS7Array3dIiE", !12, i64 0, !12, i64 4, !12, i64 8, !19, i64 16, !33, i64 24, !12, i64 28, !12, i64 32}
!40 = !{!"_ZTS7Array3dIbE", !12, i64 0, !12, i64 4, !12, i64 8, !19, i64 16, !33, i64 24, !33, i64 25, !12, i64 28}
!41 = !{!12, !12, i64 0}
!42 = !{i64 0, i64 4, !41, i64 4, i64 4, !41, i64 8, i64 4, !41}
!43 = !{!11, !12, i64 0}
!44 = !{!11, !12, i64 4}
!45 = !{!11, !12, i64 8}
!46 = distinct !{!46, !47}
!47 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LICMPass,LoopRotatePass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass