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

; 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"

%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 }

; 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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZN7Array3dIfEclEiii(ptr noundef nonnull align 8 dereferenceable(36), i32 noundef, i32 noundef, i32 noundef) #3 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8LevelSet32_floodFillMissingSignedDistancesEv(ptr noundef nonnull align 8 dereferenceable(448) %0) #3 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca [6 x %struct.GridIndex], align 16
  %4 = alloca %struct.GridIndex, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %struct.GridIndex, align 4
  %11 = alloca { i64, i32 }, align 4
  %12 = alloca %struct.GridIndex, align 4
  %13 = alloca { i64, i32 }, align 4
  %14 = alloca double, align 8
  %15 = alloca %struct.GridIndex, align 4
  %16 = alloca { i64, i32 }, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %17 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 72, ptr %3) #6
  %18 = getelementptr inbounds [6 x %struct.GridIndex], ptr %3, i32 0, i32 0
  %19 = getelementptr inbounds %struct.GridIndex, ptr %18, i64 6
  br label %20

20:                                               ; preds = %20, %1
  %21 = phi ptr [ %18, %1 ], [ %22, %20 ]
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %21)
  %22 = getelementptr inbounds %struct.GridIndex, ptr %21, i64 1
  %23 = icmp eq ptr %22, %19
  br i1 %23, label %24, label %20

24:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 12, ptr %4) #6
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %4)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %25

25:                                               ; preds = %115, %24
  %26 = load i32, ptr %5, align 4, !tbaa !9
  %27 = getelementptr inbounds %class.LevelSet, ptr %17, i32 0, i32 2
  %28 = load i32, ptr %27, align 8, !tbaa !11
  %29 = icmp slt i32 %26, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %25
  store i32 2, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %118

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

32:                                               ; preds = %111, %31
  %33 = load i32, ptr %7, align 4, !tbaa !9
  %34 = getelementptr inbounds %class.LevelSet, ptr %17, i32 0, i32 1
  %35 = load i32, ptr %34, align 4, !tbaa !41
  %36 = icmp slt i32 %33, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %32
  store i32 5, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %114

38:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %39

39:                                               ; preds = %107, %38
  %40 = load i32, ptr %8, align 4, !tbaa !9
  %41 = getelementptr inbounds %class.LevelSet, ptr %17, i32 0, i32 0
  %42 = load i32, ptr %41, align 8, !tbaa !42
  %43 = icmp slt i32 %40, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %39
  store i32 8, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %110

45:                                               ; preds = %39
  %46 = getelementptr inbounds %class.LevelSet, ptr %17, i32 0, i32 8
  %47 = load i32, ptr %8, align 4, !tbaa !9
  %48 = load i32, ptr %7, align 4, !tbaa !9
  %49 = load i32, ptr %5, align 4, !tbaa !9
  %50 = call noundef zeroext i1 @_ZN7Array3dIbEclEiii(ptr noundef nonnull align 8 dereferenceable(32) %46, i32 noundef %47, i32 noundef %48, i32 noundef %49)
  br i1 %50, label %51, label %106

51:                                               ; preds = %45
  %52 = load i32, ptr %8, align 4, !tbaa !9
  %53 = load i32, ptr %7, align 4, !tbaa !9
  %54 = load i32, ptr %5, align 4, !tbaa !9
  %55 = getelementptr inbounds [6 x %struct.GridIndex], ptr %3, i64 0, i64 0
  call void @_ZN6Grid3d24getNeighbourGridIndices6EiiiP9GridIndex(i32 noundef %52, i32 noundef %53, i32 noundef %54, ptr noundef %55)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %56

56:                                               ; preds = %102, %51
  %57 = load i32, ptr %9, align 4, !tbaa !9
  %58 = icmp slt i32 %57, 6
  br i1 %58, label %60, label %59

59:                                               ; preds = %56
  store i32 11, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %105

60:                                               ; preds = %56
  %61 = load i32, ptr %9, align 4, !tbaa !9
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [6 x %struct.GridIndex], ptr %3, i64 0, i64 %62
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %4, ptr align 4 %63, i64 12, i1 false), !tbaa.struct !43
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %4, i64 12, i1 false), !tbaa.struct !43
  %64 = getelementptr inbounds %class.LevelSet, ptr %17, i32 0, i32 0
  %65 = load i32, ptr %64, align 8, !tbaa !42
  %66 = getelementptr inbounds %class.LevelSet, ptr %17, i32 0, i32 1
  %67 = load i32, ptr %66, align 4, !tbaa !41
  %68 = getelementptr inbounds %class.LevelSet, ptr %17, i32 0, i32 2
  %69 = load i32, ptr %68, align 8, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 %10, i64 12, i1 false)
  %70 = getelementptr inbounds { i64, i32 }, ptr %11, i32 0, i32 0
  %71 = load i64, ptr %70, align 4
  %72 = getelementptr inbounds { i64, i32 }, ptr %11, i32 0, i32 1
  %73 = load i32, ptr %72, align 4
  %74 = call noundef zeroext i1 @_ZN6Grid3d18isGridIndexInRangeE9GridIndexiii(i64 %71, i32 %73, i32 noundef %65, i32 noundef %67, i32 noundef %69)
  br i1 %74, label %75, label %101

75:                                               ; preds = %60
  %76 = getelementptr inbounds %class.LevelSet, ptr %17, i32 0, i32 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 4 %4, i64 12, i1 false), !tbaa.struct !43
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %12, i64 12, i1 false)
  %77 = getelementptr inbounds { i64, i32 }, ptr %13, i32 0, i32 0
  %78 = load i64, ptr %77, align 4
  %79 = getelementptr inbounds { i64, i32 }, ptr %13, i32 0, i32 1
  %80 = load i32, ptr %79, align 4
  %81 = call noundef zeroext i1 @_ZN7Array3dIbEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(32) %76, i64 %78, i32 %80)
  br i1 %81, label %101, label %82

82:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %83 = getelementptr inbounds %class.LevelSet, ptr %17, i32 0, i32 6
  %84 = load i32, ptr %8, align 4, !tbaa !9
  %85 = load i32, ptr %7, align 4, !tbaa !9
  %86 = load i32, ptr %5, align 4, !tbaa !9
  %87 = call noundef float @_ZN7Array3dIfEclEiii(ptr noundef nonnull align 8 dereferenceable(36) %83, i32 noundef %84, i32 noundef %85, i32 noundef %86)
  %88 = fpext float %87 to double
  %89 = fcmp ogt double %88, 0.000000e+00
  br i1 %89, label %90, label %92

90:                                               ; preds = %82
  %91 = call noundef double @_ZNSt14numeric_limitsIdE8infinityEv() #6
  store double %91, ptr %14, align 8, !tbaa !44
  br label %95

92:                                               ; preds = %82
  %93 = call noundef double @_ZNSt14numeric_limitsIdE8infinityEv() #6
  %94 = fneg double %93
  store double %94, ptr %14, align 8, !tbaa !44
  br label %95

95:                                               ; preds = %92, %90
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %4, i64 12, i1 false), !tbaa.struct !43
  %96 = load double, ptr %14, align 8, !tbaa !44
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %15, i64 12, i1 false)
  %97 = getelementptr inbounds { i64, i32 }, ptr %16, i32 0, i32 0
  %98 = load i64, ptr %97, align 4
  %99 = getelementptr inbounds { i64, i32 }, ptr %16, i32 0, i32 1
  %100 = load i32, ptr %99, align 4
  call void @_ZN8LevelSet22_floodFillWithDistanceE9GridIndexd(ptr noundef nonnull align 8 dereferenceable(448) %17, i64 %98, i32 %100, double noundef %96)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %101

101:                                              ; preds = %95, %75, %60
  br label %102

102:                                              ; preds = %101
  %103 = load i32, ptr %9, align 4, !tbaa !9
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %9, align 4, !tbaa !9
  br label %56, !llvm.loop !45

105:                                              ; preds = %59
  br label %106

106:                                              ; preds = %105, %45
  br label %107

107:                                              ; preds = %106
  %108 = load i32, ptr %8, align 4, !tbaa !9
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %8, align 4, !tbaa !9
  br label %39, !llvm.loop !47

110:                                              ; preds = %44
  br label %111

111:                                              ; preds = %110
  %112 = load i32, ptr %7, align 4, !tbaa !9
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %7, align 4, !tbaa !9
  br label %32, !llvm.loop !48

114:                                              ; preds = %37
  br label %115

115:                                              ; preds = %114
  %116 = load i32, ptr %5, align 4, !tbaa !9
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %5, align 4, !tbaa !9
  br label %25, !llvm.loop !49

118:                                              ; preds = %30
  call void @llvm.lifetime.end.p0(i64 12, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr %3) #6
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6Grid3d24getNeighbourGridIndices6EiiiP9GridIndex(i32 noundef, i32 noundef, i32 noundef, ptr noundef) #5

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

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { 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 #5 = { 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 #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 8}
!12 = !{!"_ZTS8LevelSet", !10, i64 0, !10, i64 4, !10, i64 8, !13, i64 16, !10, i64 24, !14, i64 32, !37, i64 264, !39, i64 304, !40, i64 344, !27, i64 376, !13, i64 400, !10, i64 408, !40, i64 416}
!13 = !{!"double", !7, i64 0}
!14 = !{!"_ZTS12TriangleMesh", !15, i64 0, !15, i64 24, !15, i64 48, !19, i64 72, !10, i64 96, !10, i64 100, !10, i64 104, !13, i64 112, !23, i64 120, !27, i64 144, !31, 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", !6, i64 0, !6, i64 8, !6, i64 16}
!19 = !{!"_ZTSSt6vectorI8TriangleSaIS0_EE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseI8TriangleSaIS0_EE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseI8TriangleSaIS0_EE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseI8TriangleSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!23 = !{!"_ZTSSt6vectorIS_IiSaIiEESaIS1_EE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseISt6vectorIiSaIiEESaIS2_EE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseISt6vectorIiSaIiEESaIS2_EE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseISt6vectorIiSaIiEESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!27 = !{!"_ZTSSt6vectorIdSaIdEE", !28, i64 0}
!28 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!31 = !{!"_ZTS7Array3dISt6vectorIiSaIiEEE", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16, !32, i64 24, !33, i64 32, !10, i64 56}
!32 = !{!"bool", !7, i64 0}
!33 = !{!"_ZTSSt6vectorIiSaIiEE", !34, i64 0}
!34 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !35, i64 0}
!35 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !36, i64 0}
!36 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!37 = !{!"_ZTS7Array3dIfE", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16, !32, i64 24, !38, i64 28, !10, i64 32}
!38 = !{!"float", !7, i64 0}
!39 = !{!"_ZTS7Array3dIiE", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16, !32, i64 24, !10, i64 28, !10, i64 32}
!40 = !{!"_ZTS7Array3dIbE", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16, !32, i64 24, !32, i64 25, !10, i64 28}
!41 = !{!12, !10, i64 4}
!42 = !{!12, !10, i64 0}
!43 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9}
!44 = !{!13, !13, i64 0}
!45 = distinct !{!45, !46}
!46 = !{!"llvm.loop.mustprogress"}
!47 = distinct !{!47, !46}
!48 = distinct !{!48, !46}
!49 = distinct !{!49, !46}


; 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"

%struct.GridIndex = type { i32, i32, i32 }

; 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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZN7Array3dIfEclEiii(ptr noundef nonnull align 8 dereferenceable(36), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8LevelSet32_floodFillMissingSignedDistancesEv(ptr noundef nonnull align 8 dereferenceable(448) %0) local_unnamed_addr #3 align 2 {
  %2 = alloca [6 x %struct.GridIndex], align 16
  %3 = alloca %struct.GridIndex, align 8
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %2) #6
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %2)
  %.ptr.1 = getelementptr inbounds i8, ptr %2, i64 12
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.1)
  %.ptr.2 = getelementptr inbounds i8, ptr %2, i64 24
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.2)
  %.ptr.3 = getelementptr inbounds i8, ptr %2, i64 36
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.3)
  %.ptr.4 = getelementptr inbounds i8, ptr %2, i64 48
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.4)
  %.ptr.5 = getelementptr inbounds i8, ptr %2, i64 60
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %.ptr.5)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #6
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %3)
  %4 = getelementptr inbounds i8, ptr %0, i64 8
  %5 = load i32, ptr %4, align 8, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.preheader34.lr.ph, label %._crit_edge41

.preheader34.lr.ph:                               ; preds = %1
  %7 = getelementptr inbounds i8, ptr %0, i64 4
  %8 = getelementptr inbounds i8, ptr %0, i64 344
  %.sroa.210.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 8
  %9 = getelementptr inbounds i8, ptr %0, i64 264
  %10 = load i32, ptr %7, align 4, !tbaa !39
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.preheader34, label %._crit_edge41

.preheader34:                                     ; preds = %.preheader34.lr.ph, %._crit_edge38
  %12 = phi i32 [ %21, %._crit_edge38 ], [ %5, %.preheader34.lr.ph ]
  %13 = phi i32 [ %22, %._crit_edge38 ], [ %10, %.preheader34.lr.ph ]
  %14 = phi i32 [ %23, %._crit_edge38 ], [ %10, %.preheader34.lr.ph ]
  %.039 = phi i32 [ %24, %._crit_edge38 ], [ 0, %.preheader34.lr.ph ]
  %15 = icmp sgt i32 %14, 0
  %16 = load i32, ptr %0, align 8
  %17 = icmp sgt i32 %16, 0
  %or.cond = select i1 %15, i1 %17, i1 false
  br i1 %or.cond, label %.preheader, label %._crit_edge38

._crit_edge41:                                    ; preds = %._crit_edge38, %.preheader34.lr.ph, %1
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %2) #6
  ret void

.preheader:                                       ; preds = %.preheader34, %._crit_edge
  %18 = phi i32 [ %26, %._crit_edge ], [ %13, %.preheader34 ]
  %19 = phi i32 [ %27, %._crit_edge ], [ %16, %.preheader34 ]
  %.02937 = phi i32 [ %28, %._crit_edge ], [ 0, %.preheader34 ]
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %.lr.ph, label %._crit_edge

._crit_edge38.loopexit:                           ; preds = %._crit_edge
  %.pre45 = load i32, ptr %4, align 8, !tbaa !5
  br label %._crit_edge38

._crit_edge38:                                    ; preds = %._crit_edge38.loopexit, %.preheader34
  %21 = phi i32 [ %.pre45, %._crit_edge38.loopexit ], [ %12, %.preheader34 ]
  %22 = phi i32 [ %26, %._crit_edge38.loopexit ], [ %13, %.preheader34 ]
  %23 = phi i32 [ %26, %._crit_edge38.loopexit ], [ %14, %.preheader34 ]
  %24 = add nuw nsw i32 %.039, 1
  %25 = icmp slt i32 %24, %21
  br i1 %25, label %.preheader34, label %._crit_edge41, !llvm.loop !40

._crit_edge.loopexit:                             ; preds = %.loopexit
  %.pre = load i32, ptr %7, align 4, !tbaa !39
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %26 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %18, %.preheader ]
  %27 = phi i32 [ %104, %._crit_edge.loopexit ], [ %19, %.preheader ]
  %28 = add nuw nsw i32 %.02937, 1
  %29 = icmp slt i32 %28, %26
  br i1 %29, label %.preheader, label %._crit_edge38.loopexit, !llvm.loop !43

.lr.ph:                                           ; preds = %.preheader, %.loopexit
  %.03036 = phi i32 [ %103, %.loopexit ], [ 0, %.preheader ]
  %30 = call noundef zeroext i1 @_ZN7Array3dIbEclEiii(ptr noundef nonnull align 8 dereferenceable(32) %8, i32 noundef %.03036, i32 noundef %.02937, i32 noundef %.039)
  br i1 %30, label %31, label %.loopexit

31:                                               ; preds = %.lr.ph
  call void @_ZN6Grid3d24getNeighbourGridIndices6EiiiP9GridIndex(i32 noundef %.03036, i32 noundef %.02937, i32 noundef %.039, ptr noundef nonnull %2)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(12) %3, ptr noundef nonnull align 16 dereferenceable(12) %2, i64 12, i1 false), !tbaa.struct !44
  %.sroa.09.0.copyload = load i64, ptr %3, align 8
  %.sroa.210.0.copyload = load i32, ptr %.sroa.210.0..sroa_idx, align 8, !tbaa !45
  %32 = load i32, ptr %0, align 8, !tbaa !46
  %33 = load i32, ptr %7, align 4, !tbaa !39
  %34 = load i32, ptr %4, align 8, !tbaa !5
  %35 = call noundef zeroext i1 @_ZN6Grid3d18isGridIndexInRangeE9GridIndexiii(i64 %.sroa.09.0.copyload, i32 %.sroa.210.0.copyload, i32 noundef %32, i32 noundef %33, i32 noundef %34)
  br i1 %35, label %36, label %43

36:                                               ; preds = %31
  %.sroa.05.0.copyload = load i64, ptr %3, align 8
  %.sroa.26.0.copyload = load i32, ptr %.sroa.210.0..sroa_idx, align 8, !tbaa !45
  %37 = call noundef zeroext i1 @_ZN7Array3dIbEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(32) %8, i64 %.sroa.05.0.copyload, i32 %.sroa.26.0.copyload)
  br i1 %37, label %43, label %38

38:                                               ; preds = %36
  %39 = call noundef float @_ZN7Array3dIfEclEiii(ptr noundef nonnull align 8 dereferenceable(36) %9, i32 noundef %.03036, i32 noundef %.02937, i32 noundef %.039)
  %40 = fcmp ogt float %39, 0.000000e+00
  %41 = call noundef double @_ZNSt14numeric_limitsIdE8infinityEv() #6
  %42 = fneg double %41
  %.031 = select i1 %40, double %41, double %42
  %.sroa.01.0.copyload = load i64, ptr %3, align 8
  %.sroa.22.0.copyload = load i32, ptr %.sroa.210.0..sroa_idx, align 8, !tbaa !45
  call void @_ZN8LevelSet22_floodFillWithDistanceE9GridIndexd(ptr noundef nonnull align 8 dereferenceable(448) %0, i64 %.sroa.01.0.copyload, i32 %.sroa.22.0.copyload, double noundef %.031)
  br label %43

43:                                               ; preds = %31, %36, %38
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %.ptr.1, i64 12, i1 false), !tbaa.struct !44
  %.sroa.09.0.copyload.1 = load i64, ptr %3, align 8
  %.sroa.210.0.copyload.1 = load i32, ptr %.sroa.210.0..sroa_idx, align 8, !tbaa !45
  %44 = load i32, ptr %0, align 8, !tbaa !46
  %45 = load i32, ptr %7, align 4, !tbaa !39
  %46 = load i32, ptr %4, align 8, !tbaa !5
  %47 = call noundef zeroext i1 @_ZN6Grid3d18isGridIndexInRangeE9GridIndexiii(i64 %.sroa.09.0.copyload.1, i32 %.sroa.210.0.copyload.1, i32 noundef %44, i32 noundef %45, i32 noundef %46)
  br i1 %47, label %48, label %55

48:                                               ; preds = %43
  %.sroa.05.0.copyload.1 = load i64, ptr %3, align 8
  %.sroa.26.0.copyload.1 = load i32, ptr %.sroa.210.0..sroa_idx, align 8, !tbaa !45
  %49 = call noundef zeroext i1 @_ZN7Array3dIbEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(32) %8, i64 %.sroa.05.0.copyload.1, i32 %.sroa.26.0.copyload.1)
  br i1 %49, label %55, label %50

50:                                               ; preds = %48
  %51 = call noundef float @_ZN7Array3dIfEclEiii(ptr noundef nonnull align 8 dereferenceable(36) %9, i32 noundef %.03036, i32 noundef %.02937, i32 noundef %.039)
  %52 = fcmp ogt float %51, 0.000000e+00
  %53 = call noundef double @_ZNSt14numeric_limitsIdE8infinityEv() #6
  %54 = fneg double %53
  %.031.1 = select i1 %52, double %53, double %54
  %.sroa.01.0.copyload.1 = load i64, ptr %3, align 8
  %.sroa.22.0.copyload.1 = load i32, ptr %.sroa.210.0..sroa_idx, align 8, !tbaa !45
  call void @_ZN8LevelSet22_floodFillWithDistanceE9GridIndexd(ptr noundef nonnull align 8 dereferenceable(448) %0, i64 %.sroa.01.0.copyload.1, i32 %.sroa.22.0.copyload.1, double noundef %.031.1)
  br label %55

55:                                               ; preds = %50, %48, %43
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(12) %3, ptr noundef nonnull align 8 dereferenceable(12) %.ptr.2, i64 12, i1 false), !tbaa.struct !44
  %.sroa.09.0.copyload.2 = load i64, ptr %3, align 8
  %.sroa.210.0.copyload.2 = load i32, ptr %.sroa.210.0..sroa_idx, align 8, !tbaa !45
  %56 = load i32, ptr %0, align 8, !tbaa !46
  %57 = load i32, ptr %7, align 4, !tbaa !39
  %58 = load i32, ptr %4, align 8, !tbaa !5
  %59 = call noundef zeroext i1 @_ZN6Grid3d18isGridIndexInRangeE9GridIndexiii(i64 %.sroa.09.0.copyload.2, i32 %.sroa.210.0.copyload.2, i32 noundef %56, i32 noundef %57, i32 noundef %58)
  br i1 %59, label %60, label %67

60:                                               ; preds = %55
  %.sroa.05.0.copyload.2 = load i64, ptr %3, align 8
  %.sroa.26.0.copyload.2 = load i32, ptr %.sroa.210.0..sroa_idx, align 8, !tbaa !45
  %61 = call noundef zeroext i1 @_ZN7Array3dIbEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(32) %8, i64 %.sroa.05.0.copyload.2, i32 %.sroa.26.0.copyload.2)
  br i1 %61, label %67, label %62

62:                                               ; preds = %60
  %63 = call noundef float @_ZN7Array3dIfEclEiii(ptr noundef nonnull align 8 dereferenceable(36) %9, i32 noundef %.03036, i32 noundef %.02937, i32 noundef %.039)
  %64 = fcmp ogt float %63, 0.000000e+00
  %65 = call noundef double @_ZNSt14numeric_limitsIdE8infinityEv() #6
  %66 = fneg double %65
  %.031.2 = select i1 %64, double %65, double %66
  %.sroa.01.0.copyload.2 = load i64, ptr %3, align 8
  %.sroa.22.0.copyload.2 = load i32, ptr %.sroa.210.0..sroa_idx, align 8, !tbaa !45
  call void @_ZN8LevelSet22_floodFillWithDistanceE9GridIndexd(ptr noundef nonnull align 8 dereferenceable(448) %0, i64 %.sroa.01.0.copyload.2, i32 %.sroa.22.0.copyload.2, double noundef %.031.2)
  br label %67

67:                                               ; preds = %62, %60, %55
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %.ptr.3, i64 12, i1 false), !tbaa.struct !44
  %.sroa.09.0.copyload.3 = load i64, ptr %3, align 8
  %.sroa.210.0.copyload.3 = load i32, ptr %.sroa.210.0..sroa_idx, align 8, !tbaa !45
  %68 = load i32, ptr %0, align 8, !tbaa !46
  %69 = load i32, ptr %7, align 4, !tbaa !39
  %70 = load i32, ptr %4, align 8, !tbaa !5
  %71 = call noundef zeroext i1 @_ZN6Grid3d18isGridIndexInRangeE9GridIndexiii(i64 %.sroa.09.0.copyload.3, i32 %.sroa.210.0.copyload.3, i32 noundef %68, i32 noundef %69, i32 noundef %70)
  br i1 %71, label %72, label %79

72:                                               ; preds = %67
  %.sroa.05.0.copyload.3 = load i64, ptr %3, align 8
  %.sroa.26.0.copyload.3 = load i32, ptr %.sroa.210.0..sroa_idx, align 8, !tbaa !45
  %73 = call noundef zeroext i1 @_ZN7Array3dIbEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(32) %8, i64 %.sroa.05.0.copyload.3, i32 %.sroa.26.0.copyload.3)
  br i1 %73, label %79, label %74

74:                                               ; preds = %72
  %75 = call noundef float @_ZN7Array3dIfEclEiii(ptr noundef nonnull align 8 dereferenceable(36) %9, i32 noundef %.03036, i32 noundef %.02937, i32 noundef %.039)
  %76 = fcmp ogt float %75, 0.000000e+00
  %77 = call noundef double @_ZNSt14numeric_limitsIdE8infinityEv() #6
  %78 = fneg double %77
  %.031.3 = select i1 %76, double %77, double %78
  %.sroa.01.0.copyload.3 = load i64, ptr %3, align 8
  %.sroa.22.0.copyload.3 = load i32, ptr %.sroa.210.0..sroa_idx, align 8, !tbaa !45
  call void @_ZN8LevelSet22_floodFillWithDistanceE9GridIndexd(ptr noundef nonnull align 8 dereferenceable(448) %0, i64 %.sroa.01.0.copyload.3, i32 %.sroa.22.0.copyload.3, double noundef %.031.3)
  br label %79

79:                                               ; preds = %74, %72, %67
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(12) %3, ptr noundef nonnull align 16 dereferenceable(12) %.ptr.4, i64 12, i1 false), !tbaa.struct !44
  %.sroa.09.0.copyload.4 = load i64, ptr %3, align 8
  %.sroa.210.0.copyload.4 = load i32, ptr %.sroa.210.0..sroa_idx, align 8, !tbaa !45
  %80 = load i32, ptr %0, align 8, !tbaa !46
  %81 = load i32, ptr %7, align 4, !tbaa !39
  %82 = load i32, ptr %4, align 8, !tbaa !5
  %83 = call noundef zeroext i1 @_ZN6Grid3d18isGridIndexInRangeE9GridIndexiii(i64 %.sroa.09.0.copyload.4, i32 %.sroa.210.0.copyload.4, i32 noundef %80, i32 noundef %81, i32 noundef %82)
  br i1 %83, label %84, label %91

84:                                               ; preds = %79
  %.sroa.05.0.copyload.4 = load i64, ptr %3, align 8
  %.sroa.26.0.copyload.4 = load i32, ptr %.sroa.210.0..sroa_idx, align 8, !tbaa !45
  %85 = call noundef zeroext i1 @_ZN7Array3dIbEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(32) %8, i64 %.sroa.05.0.copyload.4, i32 %.sroa.26.0.copyload.4)
  br i1 %85, label %91, label %86

86:                                               ; preds = %84
  %87 = call noundef float @_ZN7Array3dIfEclEiii(ptr noundef nonnull align 8 dereferenceable(36) %9, i32 noundef %.03036, i32 noundef %.02937, i32 noundef %.039)
  %88 = fcmp ogt float %87, 0.000000e+00
  %89 = call noundef double @_ZNSt14numeric_limitsIdE8infinityEv() #6
  %90 = fneg double %89
  %.031.4 = select i1 %88, double %89, double %90
  %.sroa.01.0.copyload.4 = load i64, ptr %3, align 8
  %.sroa.22.0.copyload.4 = load i32, ptr %.sroa.210.0..sroa_idx, align 8, !tbaa !45
  call void @_ZN8LevelSet22_floodFillWithDistanceE9GridIndexd(ptr noundef nonnull align 8 dereferenceable(448) %0, i64 %.sroa.01.0.copyload.4, i32 %.sroa.22.0.copyload.4, double noundef %.031.4)
  br label %91

91:                                               ; preds = %86, %84, %79
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %.ptr.5, i64 12, i1 false), !tbaa.struct !44
  %.sroa.09.0.copyload.5 = load i64, ptr %3, align 8
  %.sroa.210.0.copyload.5 = load i32, ptr %.sroa.210.0..sroa_idx, align 8, !tbaa !45
  %92 = load i32, ptr %0, align 8, !tbaa !46
  %93 = load i32, ptr %7, align 4, !tbaa !39
  %94 = load i32, ptr %4, align 8, !tbaa !5
  %95 = call noundef zeroext i1 @_ZN6Grid3d18isGridIndexInRangeE9GridIndexiii(i64 %.sroa.09.0.copyload.5, i32 %.sroa.210.0.copyload.5, i32 noundef %92, i32 noundef %93, i32 noundef %94)
  br i1 %95, label %96, label %.loopexit

96:                                               ; preds = %91
  %.sroa.05.0.copyload.5 = load i64, ptr %3, align 8
  %.sroa.26.0.copyload.5 = load i32, ptr %.sroa.210.0..sroa_idx, align 8, !tbaa !45
  %97 = call noundef zeroext i1 @_ZN7Array3dIbEclE9GridIndex(ptr noundef nonnull align 8 dereferenceable(32) %8, i64 %.sroa.05.0.copyload.5, i32 %.sroa.26.0.copyload.5)
  br i1 %97, label %.loopexit, label %98

98:                                               ; preds = %96
  %99 = call noundef float @_ZN7Array3dIfEclEiii(ptr noundef nonnull align 8 dereferenceable(36) %9, i32 noundef %.03036, i32 noundef %.02937, i32 noundef %.039)
  %100 = fcmp ogt float %99, 0.000000e+00
  %101 = call noundef double @_ZNSt14numeric_limitsIdE8infinityEv() #6
  %102 = fneg double %101
  %.031.5 = select i1 %100, double %101, double %102
  %.sroa.01.0.copyload.5 = load i64, ptr %3, align 8
  %.sroa.22.0.copyload.5 = load i32, ptr %.sroa.210.0..sroa_idx, align 8, !tbaa !45
  call void @_ZN8LevelSet22_floodFillWithDistanceE9GridIndexd(ptr noundef nonnull align 8 dereferenceable(448) %0, i64 %.sroa.01.0.copyload.5, i32 %.sroa.22.0.copyload.5, double noundef %.031.5)
  br label %.loopexit

.loopexit:                                        ; preds = %91, %96, %98, %.lr.ph
  %103 = add nuw nsw i32 %.03036, 1
  %104 = load i32, ptr %0, align 8, !tbaa !46
  %105 = icmp slt i32 %103, %104
  br i1 %105, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !47
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6Grid3d24getNeighbourGridIndices6EiiiP9GridIndex(i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #5

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

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { 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 #5 = { 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 #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 8}
!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 = distinct !{!40, !41, !42}
!41 = !{!"llvm.loop.mustprogress"}
!42 = !{!"llvm.loop.unswitch.partial.disable"}
!43 = distinct !{!43, !41, !42}
!44 = !{i64 0, i64 4, !45, i64 4, i64 4, !45, i64 8, i64 4, !45}
!45 = !{!7, !7, i64 0}
!46 = !{!6, !7, i64 0}
!47 = distinct !{!47, !41}


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