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

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #5

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

43:                                               ; preds = %2
  %44 = xor i1 %42, true
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %6) #8
  br i1 %44, label %45, label %50

45:                                               ; preds = %43
  store double 0.000000e+00, ptr %3, align 8
  br label %245

46:                                               ; preds = %2
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %7, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %8, align 4
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %6) #8
  br label %247

50:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %51 = getelementptr inbounds %"class.vmath::vec3", ptr %1, i32 0, i32 0
  %52 = load float, ptr %51, align 4, !tbaa !45
  %53 = fpext float %52 to double
  %54 = getelementptr inbounds %class.LevelSet, ptr %33, i32 0, i32 3
  %55 = load double, ptr %54, align 8, !tbaa !12
  %56 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %55, double %53)
  store double %56, ptr %9, align 8, !tbaa !47
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %57 = getelementptr inbounds %"class.vmath::vec3", ptr %1, i32 0, i32 1
  %58 = load float, ptr %57, align 4, !tbaa !48
  %59 = fpext float %58 to double
  %60 = getelementptr inbounds %class.LevelSet, ptr %33, i32 0, i32 3
  %61 = load double, ptr %60, align 8, !tbaa !12
  %62 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %61, double %59)
  store double %62, ptr %10, align 8, !tbaa !47
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %63 = getelementptr inbounds %"class.vmath::vec3", ptr %1, i32 0, i32 2
  %64 = load float, ptr %63, align 4, !tbaa !49
  %65 = fpext float %64 to double
  %66 = getelementptr inbounds %class.LevelSet, ptr %33, i32 0, i32 3
  %67 = load double, ptr %66, align 8, !tbaa !12
  %68 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %67, double %65)
  store double %68, ptr %11, align 8, !tbaa !47
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %69 = load double, ptr %9, align 8, !tbaa !47
  %70 = load double, ptr %10, align 8, !tbaa !47
  %71 = load double, ptr %11, align 8, !tbaa !47
  %72 = getelementptr inbounds %class.LevelSet, ptr %33, i32 0, i32 3
  %73 = load double, ptr %72, align 8, !tbaa !12
  call void @_ZN6Grid3d19positionToGridIndexEddddPiS0_S0_(double noundef %69, double noundef %70, double noundef %71, double noundef %73, ptr noundef %12, ptr noundef %13, ptr noundef %14)
  %74 = load i32, ptr %12, align 4, !tbaa !50
  %75 = load i32, ptr %13, align 4, !tbaa !50
  %76 = load i32, ptr %14, align 4, !tbaa !50
  %77 = getelementptr inbounds %class.LevelSet, ptr %33, i32 0, i32 3
  %78 = load double, ptr %77, align 8, !tbaa !12
  call void @_ZN6Grid3d19GridIndexToPositionEiiidPdS0_S0_(i32 noundef %74, i32 noundef %75, i32 noundef %76, double noundef %78, ptr noundef %15, ptr noundef %16, ptr noundef %17)
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %79 = getelementptr inbounds %class.LevelSet, ptr %33, i32 0, i32 3
  %80 = load double, ptr %79, align 8, !tbaa !12
  %81 = fdiv double 1.000000e+00, %80
  store double %81, ptr %18, align 8, !tbaa !47
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %82 = load double, ptr %9, align 8, !tbaa !47
  %83 = load double, ptr %15, align 8, !tbaa !47
  %84 = fsub double %82, %83
  %85 = load double, ptr %18, align 8, !tbaa !47
  %86 = fmul double %84, %85
  store double %86, ptr %19, align 8, !tbaa !47
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %87 = load double, ptr %10, align 8, !tbaa !47
  %88 = load double, ptr %16, align 8, !tbaa !47
  %89 = fsub double %87, %88
  %90 = load double, ptr %18, align 8, !tbaa !47
  %91 = fmul double %89, %90
  store double %91, ptr %20, align 8, !tbaa !47
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %92 = load double, ptr %11, align 8, !tbaa !47
  %93 = load double, ptr %17, align 8, !tbaa !47
  %94 = fsub double %92, %93
  %95 = load double, ptr %18, align 8, !tbaa !47
  %96 = fmul double %94, %95
  store double %96, ptr %21, align 8, !tbaa !47
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  %97 = load i32, ptr %12, align 4, !tbaa !50
  %98 = sub nsw i32 %97, 1
  store i32 %98, ptr %22, align 4, !tbaa !50
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  %99 = load i32, ptr %13, align 4, !tbaa !50
  %100 = sub nsw i32 %99, 1
  store i32 %100, ptr %23, align 4, !tbaa !50
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  %101 = load i32, ptr %14, align 4, !tbaa !50
  %102 = sub nsw i32 %101, 1
  store i32 %102, ptr %24, align 4, !tbaa !50
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %103 = call noundef double @_ZNSt14numeric_limitsIdE8infinityEv() #8
  store double %103, ptr %25, align 8, !tbaa !47
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  %104 = call noundef double @_ZNSt14numeric_limitsIdE8infinityEv() #8
  %105 = fneg double %104
  store double %105, ptr %26, align 8, !tbaa !47
  call void @llvm.lifetime.start.p0(i64 512, ptr %27) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #8
  store i32 0, ptr %28, align 4, !tbaa !50
  br label %106

106:                                              ; preds = %222, %50
  %107 = load i32, ptr %28, align 4, !tbaa !50
  %108 = icmp slt i32 %107, 4
  br i1 %108, label %110, label %109

109:                                              ; preds = %106
  store i32 2, ptr %29, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #8
  br label %225

110:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #8
  store i32 0, ptr %30, align 4, !tbaa !50
  br label %111

111:                                              ; preds = %218, %110
  %112 = load i32, ptr %30, align 4, !tbaa !50
  %113 = icmp slt i32 %112, 4
  br i1 %113, label %115, label %114

114:                                              ; preds = %111
  store i32 5, ptr %29, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #8
  br label %221

115:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #8
  store i32 0, ptr %31, align 4, !tbaa !50
  br label %116

116:                                              ; preds = %214, %115
  %117 = load i32, ptr %31, align 4, !tbaa !50
  %118 = icmp slt i32 %117, 4
  br i1 %118, label %120, label %119

119:                                              ; preds = %116
  store i32 8, ptr %29, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #8
  br label %217

120:                                              ; preds = %116
  %121 = getelementptr inbounds %class.LevelSet, ptr %33, i32 0, i32 6
  %122 = load i32, ptr %31, align 4, !tbaa !50
  %123 = load i32, ptr %22, align 4, !tbaa !50
  %124 = add nsw i32 %122, %123
  %125 = load i32, ptr %30, align 4, !tbaa !50
  %126 = load i32, ptr %23, align 4, !tbaa !50
  %127 = add nsw i32 %125, %126
  %128 = load i32, ptr %28, align 4, !tbaa !50
  %129 = load i32, ptr %24, align 4, !tbaa !50
  %130 = add nsw i32 %128, %129
  %131 = call noundef zeroext i1 @_ZN7Array3dIfE14isIndexInRangeEiii(ptr noundef nonnull align 8 dereferenceable(36) %121, i32 noundef %124, i32 noundef %127, i32 noundef %130)
  br i1 %131, label %132, label %203

132:                                              ; preds = %120
  %133 = getelementptr inbounds %class.LevelSet, ptr %33, i32 0, i32 6
  %134 = load i32, ptr %31, align 4, !tbaa !50
  %135 = load i32, ptr %22, align 4, !tbaa !50
  %136 = add nsw i32 %134, %135
  %137 = load i32, ptr %30, align 4, !tbaa !50
  %138 = load i32, ptr %23, align 4, !tbaa !50
  %139 = add nsw i32 %137, %138
  %140 = load i32, ptr %28, align 4, !tbaa !50
  %141 = load i32, ptr %24, align 4, !tbaa !50
  %142 = add nsw i32 %140, %141
  %143 = call noundef float @_ZN7Array3dIfEclEiii(ptr noundef nonnull align 8 dereferenceable(36) %133, i32 noundef %136, i32 noundef %139, i32 noundef %142)
  %144 = fpext float %143 to double
  %145 = load i32, ptr %31, align 4, !tbaa !50
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %27, i64 0, i64 %146
  %148 = load i32, ptr %30, align 4, !tbaa !50
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [4 x [4 x double]], ptr %147, i64 0, i64 %149
  %151 = load i32, ptr %28, align 4, !tbaa !50
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [4 x double], ptr %150, i64 0, i64 %152
  store double %144, ptr %153, align 8, !tbaa !47
  %154 = load i32, ptr %31, align 4, !tbaa !50
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %27, i64 0, i64 %155
  %157 = load i32, ptr %30, align 4, !tbaa !50
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [4 x [4 x double]], ptr %156, i64 0, i64 %158
  %160 = load i32, ptr %28, align 4, !tbaa !50
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [4 x double], ptr %159, i64 0, i64 %161
  %163 = load double, ptr %162, align 8, !tbaa !47
  %164 = load double, ptr %25, align 8, !tbaa !47
  %165 = fcmp olt double %163, %164
  br i1 %165, label %166, label %177

166:                                              ; preds = %132
  %167 = load i32, ptr %31, align 4, !tbaa !50
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %27, i64 0, i64 %168
  %170 = load i32, ptr %30, align 4, !tbaa !50
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [4 x [4 x double]], ptr %169, i64 0, i64 %171
  %173 = load i32, ptr %28, align 4, !tbaa !50
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [4 x double], ptr %172, i64 0, i64 %174
  %176 = load double, ptr %175, align 8, !tbaa !47
  store double %176, ptr %25, align 8, !tbaa !47
  br label %202

177:                                              ; preds = %132
  %178 = load i32, ptr %31, align 4, !tbaa !50
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %27, i64 0, i64 %179
  %181 = load i32, ptr %30, align 4, !tbaa !50
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [4 x [4 x double]], ptr %180, i64 0, i64 %182
  %184 = load i32, ptr %28, align 4, !tbaa !50
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [4 x double], ptr %183, i64 0, i64 %185
  %187 = load double, ptr %186, align 8, !tbaa !47
  %188 = load double, ptr %26, align 8, !tbaa !47
  %189 = fcmp ogt double %187, %188
  br i1 %189, label %190, label %201

190:                                              ; preds = %177
  %191 = load i32, ptr %31, align 4, !tbaa !50
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %27, i64 0, i64 %192
  %194 = load i32, ptr %30, align 4, !tbaa !50
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [4 x [4 x double]], ptr %193, i64 0, i64 %195
  %197 = load i32, ptr %28, align 4, !tbaa !50
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [4 x double], ptr %196, i64 0, i64 %198
  %200 = load double, ptr %199, align 8, !tbaa !47
  store double %200, ptr %26, align 8, !tbaa !47
  br label %201

201:                                              ; preds = %190, %177
  br label %202

202:                                              ; preds = %201, %166
  br label %213

203:                                              ; preds = %120
  %204 = load i32, ptr %31, align 4, !tbaa !50
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %27, i64 0, i64 %205
  %207 = load i32, ptr %30, align 4, !tbaa !50
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [4 x [4 x double]], ptr %206, i64 0, i64 %208
  %210 = load i32, ptr %28, align 4, !tbaa !50
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [4 x double], ptr %209, i64 0, i64 %211
  store double 0.000000e+00, ptr %212, align 8, !tbaa !47
  br label %213

213:                                              ; preds = %203, %202
  br label %214

214:                                              ; preds = %213
  %215 = load i32, ptr %31, align 4, !tbaa !50
  %216 = add nsw i32 %215, 1
  store i32 %216, ptr %31, align 4, !tbaa !50
  br label %116, !llvm.loop !51

217:                                              ; preds = %119
  br label %218

218:                                              ; preds = %217
  %219 = load i32, ptr %30, align 4, !tbaa !50
  %220 = add nsw i32 %219, 1
  store i32 %220, ptr %30, align 4, !tbaa !50
  br label %111, !llvm.loop !53

221:                                              ; preds = %114
  br label %222

222:                                              ; preds = %221
  %223 = load i32, ptr %28, align 4, !tbaa !50
  %224 = add nsw i32 %223, 1
  store i32 %224, ptr %28, align 4, !tbaa !50
  br label %106, !llvm.loop !54

225:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #8
  %226 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %27, i64 0, i64 0
  %227 = load double, ptr %19, align 8, !tbaa !47
  %228 = load double, ptr %20, align 8, !tbaa !47
  %229 = load double, ptr %21, align 8, !tbaa !47
  %230 = call noundef double @_ZN13Interpolation19tricubicInterpolateEPA4_A4_dddd(ptr noundef %226, double noundef %227, double noundef %228, double noundef %229)
  store double %230, ptr %32, align 8, !tbaa !47
  %231 = load double, ptr %32, align 8, !tbaa !47
  %232 = load double, ptr %25, align 8, !tbaa !47
  %233 = fcmp olt double %231, %232
  br i1 %233, label %234, label %236

234:                                              ; preds = %225
  %235 = load double, ptr %25, align 8, !tbaa !47
  store double %235, ptr %32, align 8, !tbaa !47
  br label %243

236:                                              ; preds = %225
  %237 = load double, ptr %32, align 8, !tbaa !47
  %238 = load double, ptr %26, align 8, !tbaa !47
  %239 = fcmp ogt double %237, %238
  br i1 %239, label %240, label %242

240:                                              ; preds = %236
  %241 = load double, ptr %26, align 8, !tbaa !47
  store double %241, ptr %32, align 8, !tbaa !47
  br label %242

242:                                              ; preds = %240, %236
  br label %243

243:                                              ; preds = %242, %234
  %244 = load double, ptr %32, align 8, !tbaa !47
  store double %244, ptr %3, align 8
  store i32 1, ptr %29, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #8
  call void @llvm.lifetime.end.p0(i64 512, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  br label %245

245:                                              ; preds = %243, %45
  %246 = load double, ptr %3, align 8
  ret double %246

247:                                              ; preds = %46
  %248 = load ptr, ptr %7, align 8
  %249 = load i32, ptr %8, align 4
  %250 = insertvalue { ptr, i32 } poison, ptr %248, 0
  %251 = insertvalue { ptr, i32 } %250, i32 %249, 1
  resume { ptr, i32 } %251
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6Grid3d19positionToGridIndexEddddPiS0_S0_(double noundef, double noundef, double noundef, double noundef, ptr noundef, ptr noundef, ptr noundef) #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6Grid3d19GridIndexToPositionEiiidPdS0_S0_(i32 noundef, i32 noundef, i32 noundef, double noundef, ptr noundef, ptr noundef, ptr noundef) #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7Array3dIfE14isIndexInRangeEiii(ptr noundef nonnull align 8 dereferenceable(36), i32 noundef, i32 noundef, i32 noundef) #6 align 2

declare noundef double @_ZN13Interpolation19tricubicInterpolateEPA4_A4_dddd(ptr noundef, double noundef, double 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 = { 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 #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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { "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 = !{!13, !14, i64 0}
!43 = !{!13, !14, i64 4}
!44 = !{!13, !14, i64 8}
!45 = !{!46, !11, i64 0}
!46 = !{!"_ZTSN5vmath4vec3E", !11, i64 0, !11, i64 4, !11, i64 8}
!47 = !{!15, !15, i64 0}
!48 = !{!46, !11, i64 4}
!49 = !{!46, !11, i64 8}
!50 = !{!14, !14, i64 0}
!51 = distinct !{!51, !52}
!52 = !{!"llvm.loop.mustprogress"}
!53 = distinct !{!53, !52}
!54 = distinct !{!54, !52}


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

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

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

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

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #5

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN8LevelSet31_cubicInterpolateSignedDistanceEN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(448) %0, ptr nocapture noundef readonly %1) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.vmath::vec3", align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca [4 x [4 x [4 x double]]], align 16
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %1, i64 12, i1 false), !tbaa.struct !5
  %11 = getelementptr inbounds i8, ptr %0, i64 16
  %12 = load double, ptr %11, align 8, !tbaa !10
  %13 = load i32, ptr %0, align 8, !tbaa !41
  %14 = getelementptr inbounds i8, ptr %0, i64 4
  %15 = load i32, ptr %14, align 4, !tbaa !42
  %16 = getelementptr inbounds i8, ptr %0, i64 8
  %17 = load i32, ptr %16, align 8, !tbaa !43
  %18 = call noundef zeroext i1 @_ZN6Grid3d16isPositionInGridEN5vmath4vec3Ediii(ptr noundef nonnull %3, double noundef %12, i32 noundef %13, i32 noundef %15, i32 noundef %17)
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %3) #8
  br i1 %18, label %19, label %119

19:                                               ; preds = %2
  %20 = load float, ptr %1, align 4, !tbaa !44
  %21 = fpext float %20 to double
  %22 = load double, ptr %11, align 8, !tbaa !10
  %23 = call double @llvm.fmuladd.f64(double %22, double -5.000000e-01, double %21)
  %24 = getelementptr inbounds i8, ptr %1, i64 4
  %25 = load float, ptr %24, align 4, !tbaa !46
  %26 = fpext float %25 to double
  %27 = call double @llvm.fmuladd.f64(double %22, double -5.000000e-01, double %26)
  %28 = getelementptr inbounds i8, ptr %1, i64 8
  %29 = load float, ptr %28, align 4, !tbaa !47
  %30 = fpext float %29 to double
  %31 = call double @llvm.fmuladd.f64(double %22, double -5.000000e-01, double %30)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #8
  call void @_ZN6Grid3d19positionToGridIndexEddddPiS0_S0_(double noundef %23, double noundef %27, double noundef %31, double noundef %22, ptr noundef nonnull %4, ptr noundef nonnull %5, ptr noundef nonnull %6)
  %32 = load i32, ptr %4, align 4, !tbaa !48
  %33 = load i32, ptr %5, align 4, !tbaa !48
  %34 = load i32, ptr %6, align 4, !tbaa !48
  %35 = load double, ptr %11, align 8, !tbaa !10
  call void @_ZN6Grid3d19GridIndexToPositionEiiidPdS0_S0_(i32 noundef %32, i32 noundef %33, i32 noundef %34, double noundef %35, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9)
  %36 = load double, ptr %11, align 8, !tbaa !10
  %37 = load double, ptr %7, align 8, !tbaa !49
  %38 = fsub double %23, %37
  %39 = load double, ptr %8, align 8, !tbaa !49
  %40 = fsub double %27, %39
  %41 = load double, ptr %9, align 8, !tbaa !49
  %42 = fsub double %31, %41
  %43 = load i32, ptr %4, align 4, !tbaa !48
  %44 = add nsw i32 %43, -1
  %45 = load i32, ptr %5, align 4, !tbaa !48
  %46 = add nsw i32 %45, -1
  %47 = load i32, ptr %6, align 4, !tbaa !48
  %48 = add nsw i32 %47, -1
  %49 = call noundef double @_ZNSt14numeric_limitsIdE8infinityEv() #8
  %50 = call noundef double @_ZNSt14numeric_limitsIdE8infinityEv() #8
  %51 = fneg double %50
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %10) #8
  %52 = getelementptr inbounds i8, ptr %0, i64 264
  %53 = add i32 %43, 1
  %54 = add i32 %43, 2
  br label %.preheader70

.preheader70:                                     ; preds = %19, %67
  %indvars.iv82 = phi i64 [ 0, %19 ], [ %indvars.iv.next83, %67 ]
  %.06178 = phi double [ %51, %19 ], [ %.3.3, %67 ]
  %.06277 = phi double [ %49, %19 ], [ %.365.3, %67 ]
  %55 = trunc i64 %indvars.iv82 to i32
  %56 = add i32 %48, %55
  br label %.preheader

57:                                               ; preds = %67
  %58 = fdiv double 1.000000e+00, %36
  %59 = fmul double %58, %38
  %60 = fmul double %58, %40
  %61 = fmul double %58, %42
  %62 = call noundef double @_ZN13Interpolation19tricubicInterpolateEPA4_A4_dddd(ptr noundef nonnull %10, double noundef %59, double noundef %60, double noundef %61)
  %63 = fcmp olt double %62, %.365.3
  br i1 %63, label %118, label %115

.preheader:                                       ; preds = %.preheader70, %114
  %indvars.iv = phi i64 [ 0, %.preheader70 ], [ %indvars.iv.next, %114 ]
  %.175 = phi double [ %.06178, %.preheader70 ], [ %.3.3, %114 ]
  %.16374 = phi double [ %.06277, %.preheader70 ], [ %.365.3, %114 ]
  %64 = trunc i64 %indvars.iv to i32
  %65 = add i32 %46, %64
  %66 = call noundef zeroext i1 @_ZN7Array3dIfE14isIndexInRangeEiii(ptr noundef nonnull align 8 dereferenceable(36) %52, i32 noundef %44, i32 noundef %65, i32 noundef %56)
  br i1 %66, label %68, label %76

67:                                               ; preds = %114
  %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
  %exitcond85.not = icmp eq i64 %indvars.iv.next83, 4
  br i1 %exitcond85.not, label %57, label %.preheader70, !llvm.loop !50

68:                                               ; preds = %.preheader
  %69 = call noundef float @_ZN7Array3dIfEclEiii(ptr noundef nonnull align 8 dereferenceable(36) %52, i32 noundef %44, i32 noundef %65, i32 noundef %56)
  %70 = fpext float %69 to double
  %71 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %10, i64 0, i64 0, i64 %indvars.iv, i64 %indvars.iv82
  store double %70, ptr %71, align 8, !tbaa !49
  %72 = fcmp ogt double %.16374, %70
  br i1 %72, label %78, label %73

73:                                               ; preds = %68
  %74 = fcmp olt double %.175, %70
  br i1 %74, label %75, label %78

75:                                               ; preds = %73
  br label %78

76:                                               ; preds = %.preheader
  %77 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %10, i64 0, i64 0, i64 %indvars.iv, i64 %indvars.iv82
  store double 0.000000e+00, ptr %77, align 8, !tbaa !49
  br label %78

78:                                               ; preds = %68, %76, %73, %75
  %.365 = phi double [ %.16374, %75 ], [ %.16374, %73 ], [ %.16374, %76 ], [ %70, %68 ]
  %.3 = phi double [ %70, %75 ], [ %.175, %73 ], [ %.175, %76 ], [ %.175, %68 ]
  %79 = call noundef zeroext i1 @_ZN7Array3dIfE14isIndexInRangeEiii(ptr noundef nonnull align 8 dereferenceable(36) %52, i32 noundef %43, i32 noundef %65, i32 noundef %56)
  br i1 %79, label %82, label %80

80:                                               ; preds = %78
  %81 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %10, i64 0, i64 1, i64 %indvars.iv, i64 %indvars.iv82
  store double 0.000000e+00, ptr %81, align 8, !tbaa !49
  br label %90

82:                                               ; preds = %78
  %83 = call noundef float @_ZN7Array3dIfEclEiii(ptr noundef nonnull align 8 dereferenceable(36) %52, i32 noundef %43, i32 noundef %65, i32 noundef %56)
  %84 = fpext float %83 to double
  %85 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %10, i64 0, i64 1, i64 %indvars.iv, i64 %indvars.iv82
  store double %84, ptr %85, align 8, !tbaa !49
  %86 = fcmp ogt double %.365, %84
  br i1 %86, label %90, label %87

87:                                               ; preds = %82
  %88 = fcmp olt double %.3, %84
  br i1 %88, label %89, label %90

89:                                               ; preds = %87
  br label %90

90:                                               ; preds = %89, %87, %82, %80
  %.365.1 = phi double [ %.365, %89 ], [ %.365, %87 ], [ %.365, %80 ], [ %84, %82 ]
  %.3.1 = phi double [ %84, %89 ], [ %.3, %87 ], [ %.3, %80 ], [ %.3, %82 ]
  %91 = call noundef zeroext i1 @_ZN7Array3dIfE14isIndexInRangeEiii(ptr noundef nonnull align 8 dereferenceable(36) %52, i32 noundef %53, i32 noundef %65, i32 noundef %56)
  br i1 %91, label %94, label %92

92:                                               ; preds = %90
  %93 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %10, i64 0, i64 2, i64 %indvars.iv, i64 %indvars.iv82
  store double 0.000000e+00, ptr %93, align 8, !tbaa !49
  br label %102

94:                                               ; preds = %90
  %95 = call noundef float @_ZN7Array3dIfEclEiii(ptr noundef nonnull align 8 dereferenceable(36) %52, i32 noundef %53, i32 noundef %65, i32 noundef %56)
  %96 = fpext float %95 to double
  %97 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %10, i64 0, i64 2, i64 %indvars.iv, i64 %indvars.iv82
  store double %96, ptr %97, align 8, !tbaa !49
  %98 = fcmp ogt double %.365.1, %96
  br i1 %98, label %102, label %99

99:                                               ; preds = %94
  %100 = fcmp olt double %.3.1, %96
  br i1 %100, label %101, label %102

101:                                              ; preds = %99
  br label %102

102:                                              ; preds = %101, %99, %94, %92
  %.365.2 = phi double [ %.365.1, %101 ], [ %.365.1, %99 ], [ %.365.1, %92 ], [ %96, %94 ]
  %.3.2 = phi double [ %96, %101 ], [ %.3.1, %99 ], [ %.3.1, %92 ], [ %.3.1, %94 ]
  %103 = call noundef zeroext i1 @_ZN7Array3dIfE14isIndexInRangeEiii(ptr noundef nonnull align 8 dereferenceable(36) %52, i32 noundef %54, i32 noundef %65, i32 noundef %56)
  br i1 %103, label %106, label %104

104:                                              ; preds = %102
  %105 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %10, i64 0, i64 3, i64 %indvars.iv, i64 %indvars.iv82
  store double 0.000000e+00, ptr %105, align 8, !tbaa !49
  br label %114

106:                                              ; preds = %102
  %107 = call noundef float @_ZN7Array3dIfEclEiii(ptr noundef nonnull align 8 dereferenceable(36) %52, i32 noundef %54, i32 noundef %65, i32 noundef %56)
  %108 = fpext float %107 to double
  %109 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %10, i64 0, i64 3, i64 %indvars.iv, i64 %indvars.iv82
  store double %108, ptr %109, align 8, !tbaa !49
  %110 = fcmp ogt double %.365.2, %108
  br i1 %110, label %114, label %111

111:                                              ; preds = %106
  %112 = fcmp olt double %.3.2, %108
  br i1 %112, label %113, label %114

113:                                              ; preds = %111
  br label %114

114:                                              ; preds = %113, %111, %106, %104
  %.365.3 = phi double [ %.365.2, %113 ], [ %.365.2, %111 ], [ %.365.2, %104 ], [ %108, %106 ]
  %.3.3 = phi double [ %108, %113 ], [ %.3.2, %111 ], [ %.3.2, %104 ], [ %.3.2, %106 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 4
  br i1 %exitcond.not, label %67, label %.preheader, !llvm.loop !52

115:                                              ; preds = %57
  %116 = fcmp ogt double %62, %.3.3
  br i1 %116, label %117, label %118

117:                                              ; preds = %115
  br label %118

118:                                              ; preds = %57, %115, %117
  %.0 = phi double [ %.3.3, %117 ], [ %62, %115 ], [ %.365.3, %57 ]
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  br label %119

119:                                              ; preds = %2, %118
  %.066 = phi double [ %.0, %118 ], [ 0.000000e+00, %2 ]
  ret double %.066
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6Grid3d19positionToGridIndexEddddPiS0_S0_(double noundef, double noundef, double noundef, double noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6Grid3d19GridIndexToPositionEiiidPdS0_S0_(i32 noundef, i32 noundef, i32 noundef, double noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7Array3dIfE14isIndexInRangeEiii(ptr noundef nonnull align 8 dereferenceable(36), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #6 align 2

declare noundef double @_ZN13Interpolation19tricubicInterpolateEPA4_A4_dddd(ptr noundef, double noundef, double 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 = { 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 #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 = { 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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { "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 = !{!11, !12, i64 0}
!42 = !{!11, !12, i64 4}
!43 = !{!11, !12, i64 8}
!44 = !{!45, !7, i64 0}
!45 = !{!"_ZTSN5vmath4vec3E", !7, i64 0, !7, i64 4, !7, i64 8}
!46 = !{!45, !7, i64 4}
!47 = !{!45, !7, i64 8}
!48 = !{!12, !12, i64 0}
!49 = !{!13, !13, i64 0}
!50 = distinct !{!50, !51}
!51 = !{!"llvm.loop.mustprogress"}
!52 = distinct !{!52, !51}


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