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

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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"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 }

@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [19 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [105 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1
@__FUNCTION__._ZN8LevelSet26_findClosestPointOnSurfaceE9GridIndex = external hidden unnamed_addr constant [27 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1

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 uwtable
declare dso_local noundef zeroext i1 @_ZN7Array3dIbEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(32), i64, i32) #4 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6Grid3d21GridIndexToCellCenterE9GridIndexd(ptr dead_on_unwind noalias writable sret(%"class.vmath::vec3") align 4, i64, i32, double noundef) #6

declare void @_ZN12TriangleMesh19getTrianglePositionEjPN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(232), i32 noundef, ptr noundef) #2

declare void @_ZN9Collision26findClosestPointOnTriangleEN5vmath4vec3ES1_S1_S1_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

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

39:                                               ; preds = %4
  %40 = getelementptr inbounds %class.LevelSet, ptr %27, i32 0, i32 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 %6, i64 12, i1 false), !tbaa.struct !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 4 %11, i64 12, i1 false)
  %41 = getelementptr inbounds { i64, i32 }, ptr %12, i32 0, i32 0
  %42 = load i64, ptr %41, align 4
  %43 = getelementptr inbounds { i64, i32 }, ptr %12, i32 0, i32 1
  %44 = load i32, ptr %43, align 4
  %45 = call noundef zeroext i1 @_ZN7Array3dIbEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(32) %40, i64 %42, i32 %44)
  br i1 %45, label %56, label %46

46:                                               ; preds = %39, %4
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str)
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %47, ptr noundef @.str.1)
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %48, ptr noundef @.str.2)
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %49, ptr noundef @.str.3)
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %50, ptr noundef @.str.4)
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %51, ptr noundef @__FUNCTION__._ZN8LevelSet26_findClosestPointOnSurfaceE9GridIndex)
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %52, ptr noundef @.str.5)
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %53, i32 noundef 343)
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %54, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @abort() #8
  unreachable

56:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 36, ptr %13) #9
  %57 = getelementptr inbounds [3 x %"class.vmath::vec3"], ptr %13, i32 0, i32 0
  %58 = getelementptr inbounds %"class.vmath::vec3", ptr %57, i64 3
  br label %59

59:                                               ; preds = %61, %56
  %60 = phi ptr [ %57, %56 ], [ %62, %61 ]
  invoke void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %60)
          to label %61 unwind label %88

61:                                               ; preds = %59
  %62 = getelementptr inbounds %"class.vmath::vec3", ptr %60, i64 1
  %63 = icmp eq ptr %62, %58
  br i1 %63, label %64, label %59

64:                                               ; preds = %61
  %65 = getelementptr inbounds %class.LevelSet, ptr %27, i32 0, i32 5
  %66 = getelementptr inbounds %class.LevelSet, ptr %27, i32 0, i32 7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %6, i64 12, i1 false), !tbaa.struct !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %16, i64 12, i1 false)
  %67 = getelementptr inbounds { i64, i32 }, ptr %17, i32 0, i32 0
  %68 = load i64, ptr %67, align 4
  %69 = getelementptr inbounds { i64, i32 }, ptr %17, i32 0, i32 1
  %70 = load i32, ptr %69, align 4
  %71 = invoke noundef i32 @_ZN7Array3dIiEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(36) %66, i64 %68, i32 %70)
          to label %72 unwind label %98

72:                                               ; preds = %64
  %73 = getelementptr inbounds [3 x %"class.vmath::vec3"], ptr %13, i64 0, i64 0
  invoke void @_ZN12TriangleMesh19getTrianglePositionEjPN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(232) %65, i32 noundef %71, ptr noundef %73)
          to label %74 unwind label %98

74:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 12, ptr %18) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %6, i64 12, i1 false), !tbaa.struct !9
  %75 = getelementptr inbounds %class.LevelSet, ptr %27, i32 0, i32 3
  %76 = load double, ptr %75, align 8, !tbaa !44
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %20, ptr align 4 %19, i64 12, i1 false)
  %77 = getelementptr inbounds { i64, i32 }, ptr %20, i32 0, i32 0
  %78 = load i64, ptr %77, align 4
  %79 = getelementptr inbounds { i64, i32 }, ptr %20, i32 0, i32 1
  %80 = load i32, ptr %79, align 4
  invoke void @_ZN6Grid3d21GridIndexToCellCenterE9GridIndexd(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %18, i64 %78, i32 %80, double noundef %76)
          to label %81 unwind label %102

81:                                               ; preds = %74
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %21, ptr align 4 %18, i64 12, i1 false), !tbaa.struct !45
  %82 = getelementptr inbounds [3 x %"class.vmath::vec3"], ptr %13, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 16 %82, i64 12, i1 false), !tbaa.struct !45
  %83 = getelementptr inbounds [3 x %"class.vmath::vec3"], ptr %13, i64 0, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 4 %83, i64 12, i1 false), !tbaa.struct !45
  %84 = getelementptr inbounds [3 x %"class.vmath::vec3"], ptr %13, i64 0, i64 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %24, ptr align 8 %84, i64 12, i1 false), !tbaa.struct !45
  invoke void @_ZN9Collision26findClosestPointOnTriangleEN5vmath4vec3ES1_S1_S1_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %0, ptr noundef %21, ptr noundef %22, ptr noundef %23, ptr noundef %24)
          to label %85 unwind label %106

85:                                               ; preds = %81
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %24) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %23) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %22) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %21) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %18) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %18) #9
  %86 = getelementptr inbounds [3 x %"class.vmath::vec3"], ptr %13, i32 0, i32 0
  %87 = getelementptr inbounds %"class.vmath::vec3", ptr %86, i64 3
  br label %111

88:                                               ; preds = %59
  %89 = landingpad { ptr, i32 }
          cleanup
  %90 = extractvalue { ptr, i32 } %89, 0
  store ptr %90, ptr %14, align 8
  %91 = extractvalue { ptr, i32 } %89, 1
  store i32 %91, ptr %15, align 4
  %92 = icmp eq ptr %57, %60
  br i1 %92, label %97, label %93

93:                                               ; preds = %93, %88
  %94 = phi ptr [ %60, %88 ], [ %95, %93 ]
  %95 = getelementptr inbounds %"class.vmath::vec3", ptr %94, i64 -1
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %95) #9
  %96 = icmp eq ptr %95, %57
  br i1 %96, label %97, label %93

97:                                               ; preds = %93, %88
  br label %124

98:                                               ; preds = %72, %64
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %14, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %15, align 4
  br label %116

102:                                              ; preds = %74
  %103 = landingpad { ptr, i32 }
          cleanup
  %104 = extractvalue { ptr, i32 } %103, 0
  store ptr %104, ptr %14, align 8
  %105 = extractvalue { ptr, i32 } %103, 1
  store i32 %105, ptr %15, align 4
  br label %110

106:                                              ; preds = %81
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %14, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %15, align 4
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %24) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %23) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %22) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %21) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %18) #9
  br label %110

110:                                              ; preds = %106, %102
  call void @llvm.lifetime.end.p0(i64 12, ptr %18) #9
  br label %116

111:                                              ; preds = %111, %85
  %112 = phi ptr [ %87, %85 ], [ %113, %111 ]
  %113 = getelementptr inbounds %"class.vmath::vec3", ptr %112, i64 -1
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %113) #9
  %114 = icmp eq ptr %113, %86
  br i1 %114, label %115, label %111

115:                                              ; preds = %111
  call void @llvm.lifetime.end.p0(i64 36, ptr %13) #9
  ret void

116:                                              ; preds = %110, %98
  %117 = getelementptr inbounds [3 x %"class.vmath::vec3"], ptr %13, i32 0, i32 0
  %118 = getelementptr inbounds %"class.vmath::vec3", ptr %117, i64 3
  br label %119

119:                                              ; preds = %119, %116
  %120 = phi ptr [ %118, %116 ], [ %121, %119 ]
  %121 = getelementptr inbounds %"class.vmath::vec3", ptr %120, i64 -1
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %121) #9
  %122 = icmp eq ptr %121, %117
  br i1 %122, label %123, label %119

123:                                              ; preds = %119
  br label %124

124:                                              ; preds = %123, %97
  call void @llvm.lifetime.end.p0(i64 36, ptr %13) #9
  br label %125

125:                                              ; preds = %124
  %126 = load ptr, ptr %14, align 8
  %127 = load i32, ptr %15, align 4
  %128 = insertvalue { ptr, i32 } poison, ptr %126, 0
  %129 = insertvalue { ptr, i32 } %128, i32 %127, 1
  resume { ptr, i32 } %129
}

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #6

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #6

; Function Attrs: noreturn nounwind
declare void @abort() #7

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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { noreturn 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 #8 = { noreturn nounwind }
attributes #9 = { 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 = !{!"int", !7, i64 0}
!12 = !{!13, !11, i64 0}
!13 = !{!"_ZTS8LevelSet", !11, i64 0, !11, i64 4, !11, i64 8, !14, i64 16, !11, i64 24, !15, i64 32, !38, i64 264, !40, i64 304, !41, i64 344, !28, i64 376, !14, i64 400, !11, i64 408, !41, i64 416}
!14 = !{!"double", !7, i64 0}
!15 = !{!"_ZTS12TriangleMesh", !16, i64 0, !16, i64 24, !16, i64 48, !20, i64 72, !11, i64 96, !11, i64 100, !11, i64 104, !14, i64 112, !24, i64 120, !28, i64 144, !32, i64 168}
!16 = !{!"_ZTSSt6vectorIN5vmath4vec3ESaIS1_EE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseIN5vmath4vec3ESaIS1_EE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIN5vmath4vec3ESaIS1_EE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIN5vmath4vec3ESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!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", !6, i64 0, !6, i64 8, !6, 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", !6, i64 0, !6, i64 8, !6, 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", !6, i64 0, !6, i64 8, !6, i64 16}
!32 = !{!"_ZTS7Array3dISt6vectorIiSaIiEEE", !11, i64 0, !11, i64 4, !11, i64 8, !6, i64 16, !33, i64 24, !34, i64 32, !11, i64 56}
!33 = !{!"bool", !7, 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", !6, i64 0, !6, i64 8, !6, i64 16}
!38 = !{!"_ZTS7Array3dIfE", !11, i64 0, !11, i64 4, !11, i64 8, !6, i64 16, !33, i64 24, !39, i64 28, !11, i64 32}
!39 = !{!"float", !7, i64 0}
!40 = !{!"_ZTS7Array3dIiE", !11, i64 0, !11, i64 4, !11, i64 8, !6, i64 16, !33, i64 24, !11, i64 28, !11, i64 32}
!41 = !{!"_ZTS7Array3dIbE", !11, i64 0, !11, i64 4, !11, i64 8, !6, i64 16, !33, i64 24, !33, i64 25, !11, i64 28}
!42 = !{!13, !11, i64 4}
!43 = !{!13, !11, i64 8}
!44 = !{!13, !14, i64 16}
!45 = !{i64 0, i64 4, !46, i64 4, i64 4, !46, i64 8, i64 4, !46}
!46 = !{!39, !39, i64 0}


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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.vmath::vec3" = type { float, float, float }

@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [19 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [105 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1
@__FUNCTION__._ZN8LevelSet26_findClosestPointOnSurfaceE9GridIndex = external hidden unnamed_addr constant [27 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1

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 uwtable
declare dso_local noundef zeroext i1 @_ZN7Array3dIbEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(32), i64, i32) local_unnamed_addr #4 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 #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6Grid3d21GridIndexToCellCenterE9GridIndexd(ptr dead_on_unwind noalias writable sret(%"class.vmath::vec3") align 4, i64, i32, double noundef) local_unnamed_addr #6

declare void @_ZN12TriangleMesh19getTrianglePositionEjPN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(232), i32 noundef, ptr noundef) local_unnamed_addr #2

declare void @_ZN9Collision26findClosestPointOnTriangleEN5vmath4vec3ES1_S1_S1_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8LevelSet26_findClosestPointOnSurfaceE9GridIndex(ptr dead_on_unwind noalias writable sret(%"class.vmath::vec3") align 4 %0, ptr noundef nonnull align 8 dereferenceable(448) %1, i64 %2, i32 %3) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca [3 x %"class.vmath::vec3"], align 16
  %6 = alloca %"class.vmath::vec3", align 4
  %7 = alloca %"class.vmath::vec3", align 4
  %8 = alloca %"class.vmath::vec3", align 4
  %9 = alloca %"class.vmath::vec3", align 4
  %10 = alloca %"class.vmath::vec3", align 4
  %11 = load i32, ptr %1, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %1, i64 4
  %13 = load i32, ptr %12, align 4, !tbaa !39
  %14 = getelementptr inbounds i8, ptr %1, i64 8
  %15 = load i32, ptr %14, align 8, !tbaa !40
  %16 = tail call noundef zeroext i1 @_ZN6Grid3d18isGridIndexInRangeE9GridIndexiii(i64 %2, i32 %3, i32 noundef %11, i32 noundef %13, i32 noundef %15)
  br i1 %16, label %17, label %20

17:                                               ; preds = %4
  %18 = getelementptr inbounds i8, ptr %1, i64 344
  %19 = tail call noundef zeroext i1 @_ZN7Array3dIbEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(32) %18, i64 %2, i32 %3)
  br i1 %19, label %30, label %20

20:                                               ; preds = %17, %4
  %21 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str)
  %22 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull @.str.1)
  %23 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull @.str.2)
  %24 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull @.str.3)
  %25 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull @.str.4)
  %26 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull @__FUNCTION__._ZN8LevelSet26_findClosestPointOnSurfaceE9GridIndex)
  %27 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull @.str.5)
  %28 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %27, i32 noundef 343)
  %29 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  tail call void @abort() #8
  unreachable

30:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %5) #9
  call void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %5)
  %.ptr.1 = getelementptr inbounds i8, ptr %5, i64 12
  invoke void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.1)
          to label %31 unwind label %.preheader.preheader

31:                                               ; preds = %30
  %.ptr.2 = getelementptr inbounds i8, ptr %5, i64 24
  invoke void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.2)
          to label %32 unwind label %.preheader.preheader

32:                                               ; preds = %31
  %33 = getelementptr inbounds i8, ptr %1, i64 304
  %34 = invoke noundef i32 @_ZN7Array3dIiEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(36) %33, i64 %2, i32 %3)
          to label %35 unwind label %47

35:                                               ; preds = %32
  %36 = getelementptr inbounds i8, ptr %1, i64 32
  invoke void @_ZN12TriangleMesh19getTrianglePositionEjPN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(232) %36, i32 noundef %34, ptr noundef nonnull %5)
          to label %37 unwind label %47

37:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #9
  %38 = getelementptr inbounds i8, ptr %1, i64 16
  %39 = load double, ptr %38, align 8, !tbaa !41
  invoke void @_ZN6Grid3d21GridIndexToCellCenterE9GridIndexd(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %6, i64 %2, i32 %3, double noundef %39)
          to label %40 unwind label %49

40:                                               ; preds = %37
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %6, i64 12, i1 false), !tbaa.struct !42
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 16 dereferenceable(12) %5, i64 12, i1 false), !tbaa.struct !42
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %.ptr.1, i64 12, i1 false), !tbaa.struct !42
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 8 dereferenceable(12) %.ptr.2, i64 12, i1 false), !tbaa.struct !42
  invoke void @_ZN9Collision26findClosestPointOnTriangleEN5vmath4vec3ES1_S1_S1_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %0, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %10)
          to label %41 unwind label %51

41:                                               ; preds = %40
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %10) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %6) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #9
  %42 = getelementptr inbounds i8, ptr %5, i64 24
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %42) #9
  %43 = getelementptr inbounds i8, ptr %5, i64 12
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %43) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %5) #9
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %5) #9
  ret void

.preheader.preheader:                             ; preds = %30, %31
  %.ptr.lcssa.ph = phi ptr [ %.ptr.2, %31 ], [ %.ptr.1, %30 ]
  %lpad.thr_comm = landingpad { ptr, i32 }
          cleanup
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %44 = phi ptr [ %45, %.preheader ], [ %.ptr.lcssa.ph, %.preheader.preheader ]
  %45 = getelementptr inbounds i8, ptr %44, i64 -12
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %45) #9
  %46 = icmp eq ptr %45, %5
  br i1 %46, label %.loopexit, label %.preheader

47:                                               ; preds = %35, %32
  %48 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.loopexit

49:                                               ; preds = %37
  %50 = landingpad { ptr, i32 }
          cleanup
  br label %53

51:                                               ; preds = %40
  %52 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %10) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %6) #9
  br label %53

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

.loopexit.loopexit:                               ; preds = %53, %47
  %.pn.pn = phi { ptr, i32 } [ %.pn, %53 ], [ %48, %47 ]
  %54 = getelementptr inbounds i8, ptr %5, i64 24
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %54) #9
  %55 = getelementptr inbounds i8, ptr %5, i64 12
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %55) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %5) #9
  br label %.loopexit

.loopexit:                                        ; preds = %.preheader, %.loopexit.loopexit
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %.loopexit.loopexit ], [ %lpad.thr_comm, %.preheader ]
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %5) #9
  resume { ptr, i32 } %.pn.pn.pn
}

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #6

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #6

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #7

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


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