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

; 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.Array3d.22 = type <{ i32, i32, i32, [4 x i8], ptr, i8, [3 x i8], i32, i32, [4 x i8] }>
%class.GridIndexVector = type { i32, i32, i32, %"class.std::vector.15" }
%"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.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.Array3d.20 = type <{ i32, i32, i32, [4 x i8], ptr, i8, [3 x i8], float, 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: mustprogress nounwind uwtable
declare dso_local void @_ZN7Array3dIiED2Ev(ptr noundef nonnull align 8 dereferenceable(36)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Array3dIiEC2Eiiii(ptr noundef nonnull align 8 dereferenceable(36), i32 noundef, i32 noundef, i32 noundef, i32 noundef) unnamed_addr #1 align 2

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

declare void @_ZN15GridIndexVectorC1Eiii(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef, i32 noundef, i32 noundef) unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN15GridIndexVector4sizeEv(ptr noundef nonnull align 8 dereferenceable(40)) #4 align 2

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

; Function Attrs: nounwind
declare void @_ZN15GridIndexVectorD1Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8LevelSet14_getLayerCellsEiR15GridIndexVectorS1_R7Array3dIiE(ptr noundef nonnull align 8 dereferenceable(448), i32 noundef, ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(36)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8LevelSet14_getCellLayersERSt6vectorI15GridIndexVectorSaIS1_EE(ptr noundef nonnull align 8 dereferenceable(448) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %class.Array3d.22, align 8
  %6 = alloca %class.GridIndexVector, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %class.GridIndexVector, align 8
  %14 = alloca i32, align 4
  %15 = alloca %class.GridIndexVector, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %16 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 40, ptr %5) #7
  %17 = getelementptr inbounds %class.LevelSet, ptr %16, i32 0, i32 0
  %18 = load i32, ptr %17, align 8, !tbaa !9
  %19 = getelementptr inbounds %class.LevelSet, ptr %16, i32 0, i32 1
  %20 = load i32, ptr %19, align 4, !tbaa !40
  %21 = getelementptr inbounds %class.LevelSet, ptr %16, i32 0, i32 2
  %22 = load i32, ptr %21, align 8, !tbaa !41
  call void @_ZN7Array3dIiEC2Eiiii(ptr noundef nonnull align 8 dereferenceable(36) %5, i32 noundef %18, i32 noundef %20, i32 noundef %22, i32 noundef -1)
  call void @llvm.lifetime.start.p0(i64 40, ptr %6) #7
  %23 = getelementptr inbounds %class.LevelSet, ptr %16, i32 0, i32 0
  %24 = load i32, ptr %23, align 8, !tbaa !9
  %25 = getelementptr inbounds %class.LevelSet, ptr %16, i32 0, i32 1
  %26 = load i32, ptr %25, align 4, !tbaa !40
  %27 = getelementptr inbounds %class.LevelSet, ptr %16, i32 0, i32 2
  %28 = load i32, ptr %27, align 8, !tbaa !41
  invoke void @_ZN15GridIndexVectorC1Eiii(ptr noundef nonnull align 8 dereferenceable(40) %6, i32 noundef %24, i32 noundef %26, i32 noundef %28)
          to label %29 unwind label %36

29:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !42
  br label %30

30:                                               ; preds = %83, %29
  %31 = load i32, ptr %9, align 4, !tbaa !42
  %32 = getelementptr inbounds %class.LevelSet, ptr %16, i32 0, i32 2
  %33 = load i32, ptr %32, align 8, !tbaa !41
  %34 = icmp slt i32 %31, %33
  br i1 %34, label %40, label %35

35:                                               ; preds = %30
  store i32 2, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %86

36:                                               ; preds = %2
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %7, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %8, align 4
  br label %167

40:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !42
  br label %41

41:                                               ; preds = %79, %40
  %42 = load i32, ptr %11, align 4, !tbaa !42
  %43 = getelementptr inbounds %class.LevelSet, ptr %16, i32 0, i32 1
  %44 = load i32, ptr %43, align 4, !tbaa !40
  %45 = icmp slt i32 %42, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %41
  store i32 5, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %82

47:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !42
  br label %48

48:                                               ; preds = %75, %47
  %49 = load i32, ptr %12, align 4, !tbaa !42
  %50 = getelementptr inbounds %class.LevelSet, ptr %16, i32 0, i32 0
  %51 = load i32, ptr %50, align 8, !tbaa !9
  %52 = icmp slt i32 %49, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %48
  store i32 8, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %78

54:                                               ; preds = %48
  %55 = getelementptr inbounds %class.LevelSet, ptr %16, i32 0, i32 8
  %56 = load i32, ptr %12, align 4, !tbaa !42
  %57 = load i32, ptr %11, align 4, !tbaa !42
  %58 = load i32, ptr %9, align 4, !tbaa !42
  %59 = invoke noundef zeroext i1 @_ZN7Array3dIbEclEiii(ptr noundef nonnull align 8 dereferenceable(32) %55, i32 noundef %56, i32 noundef %57, i32 noundef %58)
          to label %60 unwind label %70

60:                                               ; preds = %54
  br i1 %59, label %61, label %74

61:                                               ; preds = %60
  %62 = load i32, ptr %12, align 4, !tbaa !42
  %63 = load i32, ptr %11, align 4, !tbaa !42
  %64 = load i32, ptr %9, align 4, !tbaa !42
  invoke void @_ZN15GridIndexVector9push_backEiii(ptr noundef nonnull align 8 dereferenceable(40) %6, i32 noundef %62, i32 noundef %63, i32 noundef %64)
          to label %65 unwind label %70

65:                                               ; preds = %61
  %66 = load i32, ptr %12, align 4, !tbaa !42
  %67 = load i32, ptr %11, align 4, !tbaa !42
  %68 = load i32, ptr %9, align 4, !tbaa !42
  invoke void @_ZN7Array3dIiE3setEiiii(ptr noundef nonnull align 8 dereferenceable(36) %5, i32 noundef %66, i32 noundef %67, i32 noundef %68, i32 noundef 0)
          to label %69 unwind label %70

69:                                               ; preds = %65
  br label %74

70:                                               ; preds = %65, %61, %54
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %7, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %166

74:                                               ; preds = %69, %60
  br label %75

75:                                               ; preds = %74
  %76 = load i32, ptr %12, align 4, !tbaa !42
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %12, align 4, !tbaa !42
  br label %48, !llvm.loop !43

78:                                               ; preds = %53
  br label %79

79:                                               ; preds = %78
  %80 = load i32, ptr %11, align 4, !tbaa !42
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %11, align 4, !tbaa !42
  br label %41, !llvm.loop !45

82:                                               ; preds = %46
  br label %83

83:                                               ; preds = %82
  %84 = load i32, ptr %9, align 4, !tbaa !42
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %9, align 4, !tbaa !42
  br label %30, !llvm.loop !46

86:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 40, ptr %13) #7
  %87 = getelementptr inbounds %class.LevelSet, ptr %16, i32 0, i32 0
  %88 = load i32, ptr %87, align 8, !tbaa !9
  %89 = getelementptr inbounds %class.LevelSet, ptr %16, i32 0, i32 1
  %90 = load i32, ptr %89, align 4, !tbaa !40
  %91 = getelementptr inbounds %class.LevelSet, ptr %16, i32 0, i32 2
  %92 = load i32, ptr %91, align 8, !tbaa !41
  invoke void @_ZN15GridIndexVectorC1Eiii(ptr noundef nonnull align 8 dereferenceable(40) %13, i32 noundef %88, i32 noundef %90, i32 noundef %92)
          to label %93 unwind label %116

93:                                               ; preds = %86
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZNSt6vectorI15GridIndexVectorSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %94, ptr noundef nonnull align 8 dereferenceable(40) %13)
          to label %95 unwind label %120

95:                                               ; preds = %93
  %96 = load ptr, ptr %4, align 8, !tbaa !5
  %97 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorI15GridIndexVectorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %96, i64 noundef 0) #7
  invoke void @_ZN8LevelSet14_getLayerCellsEiR15GridIndexVectorS1_R7Array3dIiE(ptr noundef nonnull align 8 dereferenceable(448) %16, i32 noundef 1, ptr noundef nonnull align 8 dereferenceable(40) %6, ptr noundef nonnull align 8 dereferenceable(40) %97, ptr noundef nonnull align 8 dereferenceable(36) %5)
          to label %98 unwind label %120

98:                                               ; preds = %95
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 2, ptr %14, align 4, !tbaa !42
  br label %99

99:                                               ; preds = %150, %98
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = load i32, ptr %14, align 4, !tbaa !42
  %102 = sub nsw i32 %101, 2
  %103 = sext i32 %102 to i64
  %104 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorI15GridIndexVectorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %100, i64 noundef %103) #7
  %105 = invoke noundef i64 @_ZN15GridIndexVector4sizeEv(ptr noundef nonnull align 8 dereferenceable(40) %104)
          to label %106 unwind label %124

106:                                              ; preds = %99
  %107 = icmp ugt i64 %105, 0
  br i1 %107, label %108, label %113

108:                                              ; preds = %106
  %109 = load i32, ptr %14, align 4, !tbaa !42
  %110 = getelementptr inbounds %class.LevelSet, ptr %16, i32 0, i32 4
  %111 = load i32, ptr %110, align 8, !tbaa !47
  %112 = icmp slt i32 %109, %111
  br label %113

113:                                              ; preds = %108, %106
  %114 = phi i1 [ false, %106 ], [ %112, %108 ]
  br i1 %114, label %128, label %115

115:                                              ; preds = %113
  store i32 11, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %163

116:                                              ; preds = %86
  %117 = landingpad { ptr, i32 }
          cleanup
  %118 = extractvalue { ptr, i32 } %117, 0
  store ptr %118, ptr %7, align 8
  %119 = extractvalue { ptr, i32 } %117, 1
  store i32 %119, ptr %8, align 4
  br label %165

120:                                              ; preds = %95, %93
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %7, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %8, align 4
  br label %164

124:                                              ; preds = %99
  %125 = landingpad { ptr, i32 }
          cleanup
  %126 = extractvalue { ptr, i32 } %125, 0
  store ptr %126, ptr %7, align 8
  %127 = extractvalue { ptr, i32 } %125, 1
  store i32 %127, ptr %8, align 4
  br label %162

128:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 40, ptr %15) #7
  %129 = getelementptr inbounds %class.LevelSet, ptr %16, i32 0, i32 0
  %130 = load i32, ptr %129, align 8, !tbaa !9
  %131 = getelementptr inbounds %class.LevelSet, ptr %16, i32 0, i32 1
  %132 = load i32, ptr %131, align 4, !tbaa !40
  %133 = getelementptr inbounds %class.LevelSet, ptr %16, i32 0, i32 2
  %134 = load i32, ptr %133, align 8, !tbaa !41
  invoke void @_ZN15GridIndexVectorC1Eiii(ptr noundef nonnull align 8 dereferenceable(40) %15, i32 noundef %130, i32 noundef %132, i32 noundef %134)
          to label %135 unwind label %153

135:                                              ; preds = %128
  %136 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZNSt6vectorI15GridIndexVectorSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %136, ptr noundef nonnull align 8 dereferenceable(40) %15)
          to label %137 unwind label %157

137:                                              ; preds = %135
  %138 = load i32, ptr %14, align 4, !tbaa !42
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  %140 = load i32, ptr %14, align 4, !tbaa !42
  %141 = sub nsw i32 %140, 2
  %142 = sext i32 %141 to i64
  %143 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorI15GridIndexVectorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %139, i64 noundef %142) #7
  %144 = load ptr, ptr %4, align 8, !tbaa !5
  %145 = load i32, ptr %14, align 4, !tbaa !42
  %146 = sub nsw i32 %145, 1
  %147 = sext i32 %146 to i64
  %148 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorI15GridIndexVectorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %144, i64 noundef %147) #7
  invoke void @_ZN8LevelSet14_getLayerCellsEiR15GridIndexVectorS1_R7Array3dIiE(ptr noundef nonnull align 8 dereferenceable(448) %16, i32 noundef %138, ptr noundef nonnull align 8 dereferenceable(40) %143, ptr noundef nonnull align 8 dereferenceable(40) %148, ptr noundef nonnull align 8 dereferenceable(36) %5)
          to label %149 unwind label %157

149:                                              ; preds = %137
  call void @_ZN15GridIndexVectorD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %15) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr %15) #7
  br label %150

150:                                              ; preds = %149
  %151 = load i32, ptr %14, align 4, !tbaa !42
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %14, align 4, !tbaa !42
  br label %99, !llvm.loop !48

153:                                              ; preds = %128
  %154 = landingpad { ptr, i32 }
          cleanup
  %155 = extractvalue { ptr, i32 } %154, 0
  store ptr %155, ptr %7, align 8
  %156 = extractvalue { ptr, i32 } %154, 1
  store i32 %156, ptr %8, align 4
  br label %161

157:                                              ; preds = %137, %135
  %158 = landingpad { ptr, i32 }
          cleanup
  %159 = extractvalue { ptr, i32 } %158, 0
  store ptr %159, ptr %7, align 8
  %160 = extractvalue { ptr, i32 } %158, 1
  store i32 %160, ptr %8, align 4
  call void @_ZN15GridIndexVectorD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %15) #7
  br label %161

161:                                              ; preds = %157, %153
  call void @llvm.lifetime.end.p0(i64 40, ptr %15) #7
  br label %162

162:                                              ; preds = %161, %124
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %164

163:                                              ; preds = %115
  call void @_ZN15GridIndexVectorD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %13) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr %13) #7
  call void @_ZN15GridIndexVectorD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %6) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr %6) #7
  call void @_ZN7Array3dIiED2Ev(ptr noundef nonnull align 8 dereferenceable(36) %5) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr %5) #7
  ret void

164:                                              ; preds = %162, %120
  call void @_ZN15GridIndexVectorD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %13) #7
  br label %165

165:                                              ; preds = %164, %116
  call void @llvm.lifetime.end.p0(i64 40, ptr %13) #7
  br label %166

166:                                              ; preds = %165, %70
  call void @_ZN15GridIndexVectorD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %6) #7
  br label %167

167:                                              ; preds = %166, %36
  call void @llvm.lifetime.end.p0(i64 40, ptr %6) #7
  call void @_ZN7Array3dIiED2Ev(ptr noundef nonnull align 8 dereferenceable(36) %5) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr %5) #7
  br label %168

168:                                              ; preds = %167
  %169 = load ptr, ptr %7, align 8
  %170 = load i32, ptr %8, align 4
  %171 = insertvalue { ptr, i32 } poison, ptr %169, 0
  %172 = insertvalue { ptr, i32 } %171, i32 %170, 1
  resume { ptr, i32 } %172
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN15GridIndexVector9push_backEiii(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef, i32 noundef, i32 noundef) #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Array3dIiE3setEiiii(ptr noundef nonnull align 8 dereferenceable(36), i32 noundef, i32 noundef, i32 noundef, i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI15GridIndexVectorSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(40)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorI15GridIndexVectorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

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


; 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.Array3d.22 = type <{ i32, i32, i32, [4 x i8], ptr, i8, [3 x i8], i32, i32, [4 x i8] }>
%class.GridIndexVector = type { i32, i32, i32, %"class.std::vector.15" }
%"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 }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7Array3dIiED2Ev(ptr noundef nonnull align 8 dereferenceable(36)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Array3dIiEC2Eiiii(ptr noundef nonnull align 8 dereferenceable(36), i32 noundef, i32 noundef, i32 noundef, i32 noundef) unnamed_addr #1 align 2

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

declare void @_ZN15GridIndexVectorC1Eiii(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef, i32 noundef, i32 noundef) unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN15GridIndexVector4sizeEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #4 align 2

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

; Function Attrs: nounwind
declare void @_ZN15GridIndexVectorD1Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8LevelSet14_getLayerCellsEiR15GridIndexVectorS1_R7Array3dIiE(ptr noundef nonnull align 8 dereferenceable(448), i32 noundef, ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(36)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8LevelSet14_getCellLayersERSt6vectorI15GridIndexVectorSaIS1_EE(ptr noundef nonnull align 8 dereferenceable(448) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %class.Array3d.22, align 8
  %4 = alloca %class.GridIndexVector, align 8
  %5 = alloca %class.GridIndexVector, align 8
  %6 = alloca %class.GridIndexVector, align 8
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %3) #7
  %7 = load i32, ptr %0, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 4
  %9 = load i32, ptr %8, align 4, !tbaa !39
  %10 = getelementptr inbounds i8, ptr %0, i64 8
  %11 = load i32, ptr %10, align 8, !tbaa !40
  call void @_ZN7Array3dIiEC2Eiiii(ptr noundef nonnull align 8 dereferenceable(36) %3, i32 noundef %7, i32 noundef %9, i32 noundef %11, i32 noundef -1)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %4) #7
  %12 = load i32, ptr %0, align 8, !tbaa !5
  %13 = load i32, ptr %8, align 4, !tbaa !39
  %14 = load i32, ptr %10, align 8, !tbaa !40
  invoke void @_ZN15GridIndexVectorC1Eiii(ptr noundef nonnull align 8 dereferenceable(40) %4, i32 noundef %12, i32 noundef %13, i32 noundef %14)
          to label %.preheader48 unwind label %27

.preheader48:                                     ; preds = %2
  %15 = load i32, ptr %10, align 8, !tbaa !40
  %16 = icmp sgt i32 %15, 0
  %.pre65 = load i32, ptr %8, align 4, !tbaa !39
  br i1 %16, label %.preheader47.lr.ph, label %._crit_edge55

.preheader47.lr.ph:                               ; preds = %.preheader48
  %17 = getelementptr inbounds i8, ptr %0, i64 344
  %18 = icmp sgt i32 %.pre65, 0
  br i1 %18, label %.preheader47, label %._crit_edge55

.preheader47:                                     ; preds = %.preheader47.lr.ph, %._crit_edge52
  %19 = phi i32 [ %32, %._crit_edge52 ], [ %15, %.preheader47.lr.ph ]
  %20 = phi i32 [ %33, %._crit_edge52 ], [ %.pre65, %.preheader47.lr.ph ]
  %21 = phi i32 [ %34, %._crit_edge52 ], [ %.pre65, %.preheader47.lr.ph ]
  %.03153 = phi i32 [ %35, %._crit_edge52 ], [ 0, %.preheader47.lr.ph ]
  %22 = icmp sgt i32 %21, 0
  %23 = load i32, ptr %0, align 8
  %24 = icmp sgt i32 %23, 0
  %or.cond71 = select i1 %22, i1 %24, i1 false
  br i1 %or.cond71, label %.preheader46, label %._crit_edge52

._crit_edge55:                                    ; preds = %._crit_edge52, %.preheader47.lr.ph, %.preheader48
  %25 = phi i32 [ %.pre65, %.preheader48 ], [ %.pre65, %.preheader47.lr.ph ], [ %33, %._crit_edge52 ]
  %.lcssa = phi i32 [ %15, %.preheader48 ], [ %15, %.preheader47.lr.ph ], [ %32, %._crit_edge52 ]
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %5) #7
  %26 = load i32, ptr %0, align 8, !tbaa !5
  invoke void @_ZN15GridIndexVectorC1Eiii(ptr noundef nonnull align 8 dereferenceable(40) %5, i32 noundef %26, i32 noundef %25, i32 noundef %.lcssa)
          to label %51 unwind label %59

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

.preheader46:                                     ; preds = %.preheader47, %._crit_edge
  %29 = phi i32 [ %37, %._crit_edge ], [ %20, %.preheader47 ]
  %30 = phi i32 [ %38, %._crit_edge ], [ %23, %.preheader47 ]
  %.03051 = phi i32 [ %39, %._crit_edge ], [ 0, %.preheader47 ]
  %31 = icmp sgt i32 %30, 0
  br i1 %31, label %.lr.ph, label %._crit_edge

._crit_edge52.loopexit:                           ; preds = %._crit_edge
  %.pre64 = load i32, ptr %10, align 8, !tbaa !40
  br label %._crit_edge52

._crit_edge52:                                    ; preds = %._crit_edge52.loopexit, %.preheader47
  %32 = phi i32 [ %.pre64, %._crit_edge52.loopexit ], [ %19, %.preheader47 ]
  %33 = phi i32 [ %37, %._crit_edge52.loopexit ], [ %20, %.preheader47 ]
  %34 = phi i32 [ %37, %._crit_edge52.loopexit ], [ %21, %.preheader47 ]
  %35 = add nuw nsw i32 %.03153, 1
  %36 = icmp slt i32 %35, %32
  br i1 %36, label %.preheader47, label %._crit_edge55, !llvm.loop !41

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

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader46
  %37 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %29, %.preheader46 ]
  %38 = phi i32 [ %49, %._crit_edge.loopexit ], [ %30, %.preheader46 ]
  %39 = add nuw nsw i32 %.03051, 1
  %40 = icmp slt i32 %39, %37
  br i1 %40, label %.preheader46, label %._crit_edge52.loopexit, !llvm.loop !44

.lr.ph:                                           ; preds = %.preheader46, %47
  %.02950 = phi i32 [ %48, %47 ], [ 0, %.preheader46 ]
  %41 = invoke noundef zeroext i1 @_ZN7Array3dIbEclEiii(ptr noundef nonnull align 8 dereferenceable(32) %17, i32 noundef %.02950, i32 noundef %.03051, i32 noundef %.03153)
          to label %42 unwind label %45

42:                                               ; preds = %.lr.ph
  br i1 %41, label %43, label %47

43:                                               ; preds = %42
  invoke void @_ZN15GridIndexVector9push_backEiii(ptr noundef nonnull align 8 dereferenceable(40) %4, i32 noundef %.02950, i32 noundef %.03051, i32 noundef %.03153)
          to label %44 unwind label %45

44:                                               ; preds = %43
  invoke void @_ZN7Array3dIiE3setEiiii(ptr noundef nonnull align 8 dereferenceable(36) %3, i32 noundef %.02950, i32 noundef %.03051, i32 noundef %.03153, i32 noundef 0)
          to label %47 unwind label %45

45:                                               ; preds = %44, %43, %.lr.ph
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %86

47:                                               ; preds = %42, %44
  %48 = add nuw nsw i32 %.02950, 1
  %49 = load i32, ptr %0, align 8, !tbaa !5
  %50 = icmp slt i32 %48, %49
  br i1 %50, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !45

51:                                               ; preds = %._crit_edge55
  invoke void @_ZNSt6vectorI15GridIndexVectorSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(40) %5)
          to label %52 unwind label %61

52:                                               ; preds = %51
  %53 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorI15GridIndexVectorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef 0) #7
  invoke void @_ZN8LevelSet14_getLayerCellsEiR15GridIndexVectorS1_R7Array3dIiE(ptr noundef nonnull align 8 dereferenceable(448) %0, i32 noundef 1, ptr noundef nonnull align 8 dereferenceable(40) %4, ptr noundef nonnull align 8 dereferenceable(40) %53, ptr noundef nonnull align 8 dereferenceable(36) %3)
          to label %.preheader unwind label %61

.preheader:                                       ; preds = %52
  %54 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorI15GridIndexVectorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef 0) #7
  %55 = call noundef i64 @_ZN15GridIndexVector4sizeEv(ptr noundef nonnull align 8 dereferenceable(40) %54)
  %.not56 = icmp ne i64 %55, 0
  %56 = getelementptr inbounds i8, ptr %0, i64 24
  %57 = load i32, ptr %56, align 8
  %58 = icmp sgt i32 %57, 2
  %or.cond57 = select i1 %.not56, i1 %58, i1 false
  br i1 %or.cond57, label %.lr.ph59, label %.critedge

.critedge:                                        ; preds = %73, %.preheader
  call void @_ZN15GridIndexVectorD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #7
  call void @_ZN15GridIndexVectorD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %4) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #7
  call void @_ZN7Array3dIiED2Ev(ptr noundef nonnull align 8 dereferenceable(36) %3) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %3) #7
  ret void

59:                                               ; preds = %._crit_edge55
  %60 = landingpad { ptr, i32 }
          cleanup
  br label %85

61:                                               ; preds = %52, %51
  %62 = landingpad { ptr, i32 }
          cleanup
  br label %84

.lr.ph59:                                         ; preds = %.preheader, %73
  %indvars.iv = phi i64 [ %indvars.iv.next, %73 ], [ 2, %.preheader ]
  %63 = phi i64 [ %70, %73 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #7
  %64 = load i32, ptr %0, align 8, !tbaa !5
  %65 = load i32, ptr %8, align 4, !tbaa !39
  %66 = load i32, ptr %10, align 8, !tbaa !40
  invoke void @_ZN15GridIndexVectorC1Eiii(ptr noundef nonnull align 8 dereferenceable(40) %6, i32 noundef %64, i32 noundef %65, i32 noundef %66)
          to label %67 unwind label %79

67:                                               ; preds = %.lr.ph59
  invoke void @_ZNSt6vectorI15GridIndexVectorSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(40) %6)
          to label %68 unwind label %81

68:                                               ; preds = %67
  %69 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorI15GridIndexVectorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %63) #7
  %70 = add nsw i64 %indvars.iv, -1
  %71 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorI15GridIndexVectorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %70) #7
  %72 = trunc nuw nsw i64 %indvars.iv to i32
  invoke void @_ZN8LevelSet14_getLayerCellsEiR15GridIndexVectorS1_R7Array3dIiE(ptr noundef nonnull align 8 dereferenceable(448) %0, i32 noundef %72, ptr noundef nonnull align 8 dereferenceable(40) %69, ptr noundef nonnull align 8 dereferenceable(40) %71, ptr noundef nonnull align 8 dereferenceable(36) %3)
          to label %73 unwind label %81

73:                                               ; preds = %68
  call void @_ZN15GridIndexVectorD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %6) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %74 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorI15GridIndexVectorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %70) #7
  %75 = call noundef i64 @_ZN15GridIndexVector4sizeEv(ptr noundef nonnull align 8 dereferenceable(40) %74)
  %.not = icmp ne i64 %75, 0
  %76 = load i32, ptr %56, align 8
  %77 = sext i32 %76 to i64
  %78 = icmp slt i64 %indvars.iv.next, %77
  %or.cond = select i1 %.not, i1 %78, i1 false
  br i1 %or.cond, label %.lr.ph59, label %.critedge, !llvm.loop !46

79:                                               ; preds = %.lr.ph59
  %80 = landingpad { ptr, i32 }
          cleanup
  br label %83

81:                                               ; preds = %68, %67
  %82 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN15GridIndexVectorD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %6) #7
  br label %83

83:                                               ; preds = %81, %79
  %.pn = phi { ptr, i32 } [ %82, %81 ], [ %80, %79 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #7
  br label %84

84:                                               ; preds = %83, %61
  %.pn.pn = phi { ptr, i32 } [ %.pn, %83 ], [ %62, %61 ]
  call void @_ZN15GridIndexVectorD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #7
  br label %85

85:                                               ; preds = %84, %59
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %84 ], [ %60, %59 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #7
  br label %86

86:                                               ; preds = %85, %45
  %.pn41 = phi { ptr, i32 } [ %46, %45 ], [ %.pn.pn.pn, %85 ]
  call void @_ZN15GridIndexVectorD1Ev(ptr noundef nonnull align 8 dereferenceable(40) %4) #7
  br label %87

87:                                               ; preds = %86, %27
  %.pn41.pn = phi { ptr, i32 } [ %.pn41, %86 ], [ %28, %27 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #7
  call void @_ZN7Array3dIiED2Ev(ptr noundef nonnull align 8 dereferenceable(36) %3) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %3) #7
  resume { ptr, i32 } %.pn41.pn
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN15GridIndexVector9push_backEiii(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Array3dIiE3setEiiii(ptr noundef nonnull align 8 dereferenceable(36), i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI15GridIndexVectorSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorI15GridIndexVectorSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 = { 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 = distinct !{!41, !42, !43}
!42 = !{!"llvm.loop.mustprogress"}
!43 = !{!"llvm.loop.unswitch.partial.disable"}
!44 = distinct !{!44, !42, !43}
!45 = distinct !{!45, !42}
!46 = distinct !{!46, !42}


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