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

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

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

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

41:                                               ; preds = %37
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %7, i64 12, i1 false), !tbaa.struct !42
  %42 = getelementptr inbounds [7 x %struct.GridIndex], ptr %12, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %13, i64 12, i1 false)
  %43 = getelementptr inbounds { i64, i32 }, ptr %14, i32 0, i32 0
  %44 = load i64, ptr %43, align 4
  %45 = getelementptr inbounds { i64, i32 }, ptr %14, i32 0, i32 1
  %46 = load i32, ptr %45, align 4
  call void @_ZN8LevelSet25_getNeighbourGridIndices6E9GridIndexPS0_(ptr noundef nonnull align 8 dereferenceable(448) %30, i64 %44, i32 %46, ptr noundef %42)
  %47 = getelementptr inbounds [7 x %struct.GridIndex], ptr %12, i64 0, i64 6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %47, ptr align 4 %7, i64 12, i1 false), !tbaa.struct !42
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %48 = call noundef double @_ZNSt14numeric_limitsIdE8infinityEv() #8
  store double %48, ptr %15, align 8, !tbaa !44
  store i1 false, ptr %16, 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 12, ptr %17) #8
  invoke void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %17)
          to label %49 unwind label %58

49:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  store i32 0, ptr %18, align 4, !tbaa !43
  br label %50

50:                                               ; preds = %130, %49
  %51 = load i32, ptr %18, align 4, !tbaa !43
  %52 = icmp slt i32 %51, 7
  br i1 %52, label %62, label %53

53:                                               ; preds = %50
  store i32 2, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %134

54:                                               ; preds = %3
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %9, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %10, align 4
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #8
  br label %139

58:                                               ; preds = %41
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %9, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %10, align 4
  br label %136

62:                                               ; preds = %50
  %63 = load i32, ptr %18, align 4, !tbaa !43
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [7 x %struct.GridIndex], ptr %12, i64 0, i64 %64
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %65, i64 12, i1 false), !tbaa.struct !42
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %20, ptr align 4 %7, i64 12, i1 false), !tbaa.struct !42
  %66 = getelementptr inbounds %class.LevelSet, ptr %30, i32 0, i32 0
  %67 = load i32, ptr %66, align 8, !tbaa !45
  %68 = getelementptr inbounds %class.LevelSet, ptr %30, i32 0, i32 1
  %69 = load i32, ptr %68, align 4, !tbaa !46
  %70 = getelementptr inbounds %class.LevelSet, ptr %30, i32 0, i32 2
  %71 = load i32, ptr %70, align 8, !tbaa !47
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %21, ptr align 4 %20, i64 12, i1 false)
  %72 = getelementptr inbounds { i64, i32 }, ptr %21, i32 0, i32 0
  %73 = load i64, ptr %72, align 4
  %74 = getelementptr inbounds { i64, i32 }, ptr %21, i32 0, i32 1
  %75 = load i32, ptr %74, align 4
  %76 = invoke noundef zeroext i1 @_ZN6Grid3d18isGridIndexInRangeE9GridIndexiii(i64 %73, i32 %75, i32 noundef %67, i32 noundef %69, i32 noundef %71)
          to label %77 unwind label %98

77:                                               ; preds = %62
  br i1 %76, label %78, label %129

78:                                               ; preds = %77
  %79 = getelementptr inbounds %class.LevelSet, ptr %30, i32 0, i32 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 4 %17, i64 12, i1 false), !tbaa.struct !42
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 4 %22, i64 12, i1 false)
  %80 = getelementptr inbounds { i64, i32 }, ptr %23, i32 0, i32 0
  %81 = load i64, ptr %80, align 4
  %82 = getelementptr inbounds { i64, i32 }, ptr %23, i32 0, i32 1
  %83 = load i32, ptr %82, align 4
  %84 = invoke noundef zeroext i1 @_ZN7Array3dIbEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(32) %79, i64 %81, i32 %83)
          to label %85 unwind label %98

85:                                               ; preds = %78
  br i1 %84, label %86, label %129

86:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 12, ptr %24) #8
  invoke void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %24)
          to label %87 unwind label %102

87:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #8
  %88 = getelementptr inbounds %class.LevelSet, ptr %30, i32 0, i32 7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %26, ptr align 4 %17, i64 12, i1 false), !tbaa.struct !42
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %27, ptr align 4 %26, i64 12, i1 false)
  %89 = getelementptr inbounds { i64, i32 }, ptr %27, i32 0, i32 0
  %90 = load i64, ptr %89, align 4
  %91 = getelementptr inbounds { i64, i32 }, ptr %27, i32 0, i32 1
  %92 = load i32, ptr %91, align 4
  %93 = invoke noundef i32 @_ZN7Array3dIiEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(36) %88, i64 %90, i32 %92)
          to label %94 unwind label %106

94:                                               ; preds = %87
  store i32 %93, ptr %25, align 4, !tbaa !43
  %95 = load i32, ptr %25, align 4, !tbaa !43
  %96 = icmp slt i32 %95, 0
  br i1 %96, label %97, label %110

97:                                               ; preds = %94
  store i32 4, ptr %19, align 4
  br label %124

98:                                               ; preds = %78, %62
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %9, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %10, align 4
  br label %133

102:                                              ; preds = %86
  %103 = landingpad { ptr, i32 }
          cleanup
  %104 = extractvalue { ptr, i32 } %103, 0
  store ptr %104, ptr %9, align 8
  %105 = extractvalue { ptr, i32 } %103, 1
  store i32 %105, ptr %10, align 4
  br label %128

106:                                              ; preds = %87
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %9, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %10, align 4
  br label %127

110:                                              ; preds = %94
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %29, ptr align 4 %2, i64 12, i1 false), !tbaa.struct !9
  %111 = load i32, ptr %25, align 4, !tbaa !43
  %112 = invoke noundef double @_ZN8LevelSet25_minDistToTriangleSquaredEN5vmath4vec3EiPS1_(ptr noundef nonnull align 8 dereferenceable(448) %30, ptr noundef %29, i32 noundef %111, ptr noundef %24)
          to label %113 unwind label %119

113:                                              ; preds = %110
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %29) #8
  store double %112, ptr %28, align 8, !tbaa !44
  %114 = load double, ptr %28, align 8, !tbaa !44
  %115 = load double, ptr %15, align 8, !tbaa !44
  %116 = fcmp olt double %114, %115
  br i1 %116, label %117, label %123

117:                                              ; preds = %113
  %118 = load double, ptr %28, align 8, !tbaa !44
  store double %118, ptr %15, align 8, !tbaa !44
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %0, ptr align 4 %24, i64 12, i1 false), !tbaa.struct !9
  br label %123

119:                                              ; preds = %110
  %120 = landingpad { ptr, i32 }
          cleanup
  %121 = extractvalue { ptr, i32 } %120, 0
  store ptr %121, ptr %9, align 8
  %122 = extractvalue { ptr, i32 } %120, 1
  store i32 %122, ptr %10, align 4
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %29) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  br label %127

123:                                              ; preds = %117, %113
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  store i32 0, ptr %19, align 4
  br label %124

124:                                              ; preds = %123, %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %24) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %24) #8
  %125 = load i32, ptr %19, align 4
  switch i32 %125, label %145 [
    i32 0, label %126
    i32 4, label %130
  ]

126:                                              ; preds = %124
  br label %129

127:                                              ; preds = %119, %106
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %24) #8
  br label %128

128:                                              ; preds = %127, %102
  call void @llvm.lifetime.end.p0(i64 12, ptr %24) #8
  br label %133

129:                                              ; preds = %126, %85, %77
  br label %130

130:                                              ; preds = %129, %124
  %131 = load i32, ptr %18, align 4, !tbaa !43
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %18, align 4, !tbaa !43
  br label %50, !llvm.loop !48

133:                                              ; preds = %128, %98
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %136

134:                                              ; preds = %53
  store i1 true, ptr %16, align 1
  store i32 1, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #8
  %135 = load i1, ptr %16, align 1
  br i1 %135, label %138, label %137

136:                                              ; preds = %133, %58
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 84, ptr %12) #8
  br label %139

137:                                              ; preds = %134
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %0) #8
  br label %138

138:                                              ; preds = %137, %134
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 84, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %7) #8
  ret void

139:                                              ; preds = %136, %54
  call void @llvm.lifetime.end.p0(i64 12, ptr %7) #8
  br label %140

140:                                              ; preds = %139
  %141 = load ptr, ptr %9, align 8
  %142 = load i32, ptr %10, align 4
  %143 = insertvalue { ptr, i32 } poison, ptr %141, 0
  %144 = insertvalue { ptr, i32 } %143, i32 %142, 1
  resume { ptr, i32 } %144

145:                                              ; preds = %124
  unreachable
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { i64, i32 } @_ZN6Grid3d19positionToGridIndexEN5vmath4vec3Ed(ptr noundef, double noundef) #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 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: mustprogress uwtable
define dso_local void @_ZN8LevelSet26_findClosestPointOnSurfaceEN5vmath4vec3E(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) local_unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.vmath::vec3", align 4
  %5 = alloca [7 x %struct.GridIndex], align 16
  %6 = alloca %struct.GridIndex, align 8
  %7 = alloca %"class.vmath::vec3", align 4
  %8 = alloca %"class.vmath::vec3", align 4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %2, i64 12, i1 false), !tbaa.struct !5
  %9 = getelementptr inbounds i8, ptr %1, i64 16
  %10 = load double, ptr %9, align 8, !tbaa !10
  %11 = invoke { i64, i32 } @_ZN6Grid3d19positionToGridIndexEN5vmath4vec3Ed(ptr noundef nonnull %4, double noundef %10)
          to label %12 unwind label %19

12:                                               ; preds = %3
  %.fca.0.extract = extractvalue { i64, i32 } %11, 0
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %4) #8
  call void @llvm.lifetime.start.p0(i64 84, ptr nonnull %5) #8
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %5)
  %.ptr.1 = getelementptr inbounds i8, ptr %5, i64 12
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.1)
  %.ptr.2 = getelementptr inbounds i8, ptr %5, i64 24
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.2)
  %.ptr.3 = getelementptr inbounds i8, ptr %5, i64 36
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.3)
  %.ptr.4 = getelementptr inbounds i8, ptr %5, i64 48
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.4)
  %.ptr.5 = getelementptr inbounds i8, ptr %5, i64 60
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.5)
  %.ptr.6 = getelementptr inbounds i8, ptr %5, i64 72
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.6)
  %.fca.1.extract = extractvalue { i64, i32 } %11, 1
  call void @_ZN8LevelSet25_getNeighbourGridIndices6E9GridIndexPS0_(ptr noundef nonnull align 8 dereferenceable(448) %1, i64 %.fca.0.extract, i32 %.fca.1.extract, ptr noundef nonnull %5)
  store i64 %.fca.0.extract, ptr %.ptr.6, align 8
  %.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %5, i64 80
  store i32 %.fca.1.extract, ptr %.sroa.7.0..sroa_idx, align 16, !tbaa !41
  %13 = 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 %6) #8
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %6)
  %14 = getelementptr inbounds i8, ptr %1, i64 4
  %15 = getelementptr inbounds i8, ptr %1, i64 8
  %16 = getelementptr inbounds i8, ptr %1, i64 344
  %.sroa.28.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 8
  %17 = getelementptr inbounds i8, ptr %1, i64 304
  br label %21

18:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 84, ptr nonnull %5) #8
  ret void

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

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

27:                                               ; preds = %21
  %.sroa.07.0.copyload = load i64, ptr %6, align 8
  %.sroa.28.0.copyload = load i32, ptr %.sroa.28.0..sroa_idx, align 8, !tbaa !41
  %28 = invoke noundef zeroext i1 @_ZN7Array3dIbEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(32) %16, i64 %.sroa.07.0.copyload, i32 %.sroa.28.0.copyload)
          to label %29 unwind label %35

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

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

31:                                               ; preds = %30
  %.sroa.02.0.copyload = load i64, ptr %6, align 8
  %.sroa.23.0.copyload = load i32, ptr %.sroa.28.0..sroa_idx, align 8, !tbaa !41
  %32 = invoke noundef i32 @_ZN7Array3dIiEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(36) %17, i64 %.sroa.02.0.copyload, i32 %.sroa.23.0.copyload)
          to label %33 unwind label %39

33:                                               ; preds = %31
  %34 = icmp slt i32 %32, 0
  br i1 %34, label %48, label %41

35:                                               ; preds = %27
  %36 = landingpad { ptr, i32 }
          cleanup
  br label %52

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

39:                                               ; preds = %31
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %49

41:                                               ; preds = %33
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(12) %2, i64 12, i1 false), !tbaa.struct !5
  %42 = invoke noundef double @_ZN8LevelSet25_minDistToTriangleSquaredEN5vmath4vec3EiPS1_(ptr noundef nonnull align 8 dereferenceable(448) %1, ptr noundef nonnull %8, i32 noundef %32, ptr noundef nonnull %7)
          to label %43 unwind label %46

43:                                               ; preds = %41
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #8
  %44 = fcmp olt double %42, %.03346
  br i1 %44, label %45, label %48

45:                                               ; preds = %43
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %7, i64 12, i1 false), !tbaa.struct !5
  br label %48

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

48:                                               ; preds = %43, %45, %33
  %.235 = phi double [ %.03346, %33 ], [ %42, %45 ], [ %.03346, %43 ]
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #8
  br label %51

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

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

51:                                               ; preds = %48, %21, %29
  %.336 = phi double [ %.235, %48 ], [ %.03346, %29 ], [ %.03346, %21 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 7
  br i1 %exitcond.not, label %18, label %21, !llvm.loop !46

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { i64, i32 } @_ZN6Grid3d19positionToGridIndexEN5vmath4vec3Ed(ptr noundef, double noundef) 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 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,LICMPass,LoopRotatePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass