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

; 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.ScalarField = type { i32, i32, i32, double, double, double, double, double, double, double, double, i8, [7 x i8], %class.Array3d, %class.Array3d.0, %class.Array3d, %class.Array3d.0, i8, %"class.vmath::vec3" }
%class.Array3d = type <{ i32, i32, i32, [4 x i8], ptr, i8, [3 x i8], float, i32, [4 x i8] }>
%class.Array3d.0 = type { i32, i32, i32, ptr, i8, i8, i32 }

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN11ScalarField21tricubicInterpolationEN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(248) %0, ptr noundef %1) #1 align 2 {
  %3 = alloca double, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca [4 x [4 x [4 x double]]], align 16
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca double, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %27 = load ptr, ptr %4, align 8
  %28 = getelementptr inbounds %"class.vmath::vec3", ptr %1, i32 0, i32 0
  %29 = load float, ptr %28, align 4, !tbaa !9
  %30 = fpext float %29 to double
  %31 = getelementptr inbounds %"class.vmath::vec3", ptr %1, i32 0, i32 1
  %32 = load float, ptr %31, align 4, !tbaa !12
  %33 = fpext float %32 to double
  %34 = getelementptr inbounds %"class.vmath::vec3", ptr %1, i32 0, i32 2
  %35 = load float, ptr %34, align 4, !tbaa !13
  %36 = fpext float %35 to double
  %37 = getelementptr inbounds %class.ScalarField, ptr %27, i32 0, i32 3
  %38 = load double, ptr %37, align 8, !tbaa !14
  %39 = getelementptr inbounds %class.ScalarField, ptr %27, i32 0, i32 0
  %40 = load i32, ptr %39, align 8, !tbaa !21
  %41 = getelementptr inbounds %class.ScalarField, ptr %27, i32 0, i32 1
  %42 = load i32, ptr %41, align 4, !tbaa !22
  %43 = getelementptr inbounds %class.ScalarField, ptr %27, i32 0, i32 2
  %44 = load i32, ptr %43, align 8, !tbaa !23
  %45 = call noundef zeroext i1 @_ZN6Grid3d16isPositionInGridEddddiii(double noundef %30, double noundef %33, double noundef %36, double noundef %38, i32 noundef %40, i32 noundef %42, i32 noundef %44)
  br i1 %45, label %47, label %46

46:                                               ; preds = %2
  store double 0.000000e+00, ptr %3, align 8
  br label %236

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

97:                                               ; preds = %213, %47
  %98 = load i32, ptr %22, align 4, !tbaa !24
  %99 = icmp slt i32 %98, 4
  br i1 %99, label %101, label %100

100:                                              ; preds = %97
  store i32 2, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %216

101:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  store i32 0, ptr %24, align 4, !tbaa !24
  br label %102

102:                                              ; preds = %209, %101
  %103 = load i32, ptr %24, align 4, !tbaa !24
  %104 = icmp slt i32 %103, 4
  br i1 %104, label %106, label %105

105:                                              ; preds = %102
  store i32 5, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  br label %212

106:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  store i32 0, ptr %25, align 4, !tbaa !24
  br label %107

107:                                              ; preds = %205, %106
  %108 = load i32, ptr %25, align 4, !tbaa !24
  %109 = icmp slt i32 %108, 4
  br i1 %109, label %111, label %110

110:                                              ; preds = %107
  store i32 8, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  br label %208

111:                                              ; preds = %107
  %112 = getelementptr inbounds %class.ScalarField, ptr %27, i32 0, i32 13
  %113 = load i32, ptr %25, align 4, !tbaa !24
  %114 = load i32, ptr %16, align 4, !tbaa !24
  %115 = add nsw i32 %113, %114
  %116 = load i32, ptr %24, align 4, !tbaa !24
  %117 = load i32, ptr %17, align 4, !tbaa !24
  %118 = add nsw i32 %116, %117
  %119 = load i32, ptr %22, align 4, !tbaa !24
  %120 = load i32, ptr %18, align 4, !tbaa !24
  %121 = add nsw i32 %119, %120
  %122 = call noundef zeroext i1 @_ZN7Array3dIfE14isIndexInRangeEiii(ptr noundef nonnull align 8 dereferenceable(36) %112, i32 noundef %115, i32 noundef %118, i32 noundef %121)
  br i1 %122, label %123, label %194

123:                                              ; preds = %111
  %124 = getelementptr inbounds %class.ScalarField, ptr %27, i32 0, i32 13
  %125 = load i32, ptr %25, align 4, !tbaa !24
  %126 = load i32, ptr %16, align 4, !tbaa !24
  %127 = add nsw i32 %125, %126
  %128 = load i32, ptr %24, align 4, !tbaa !24
  %129 = load i32, ptr %17, align 4, !tbaa !24
  %130 = add nsw i32 %128, %129
  %131 = load i32, ptr %22, align 4, !tbaa !24
  %132 = load i32, ptr %18, align 4, !tbaa !24
  %133 = add nsw i32 %131, %132
  %134 = call noundef float @_ZN7Array3dIfEclEiii(ptr noundef nonnull align 8 dereferenceable(36) %124, i32 noundef %127, i32 noundef %130, i32 noundef %133)
  %135 = fpext float %134 to double
  %136 = load i32, ptr %25, align 4, !tbaa !24
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %21, i64 0, i64 %137
  %139 = load i32, ptr %24, align 4, !tbaa !24
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [4 x [4 x double]], ptr %138, i64 0, i64 %140
  %142 = load i32, ptr %22, align 4, !tbaa !24
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [4 x double], ptr %141, i64 0, i64 %143
  store double %135, ptr %144, align 8, !tbaa !25
  %145 = load i32, ptr %25, align 4, !tbaa !24
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %21, i64 0, i64 %146
  %148 = load i32, ptr %24, align 4, !tbaa !24
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [4 x [4 x double]], ptr %147, i64 0, i64 %149
  %151 = load i32, ptr %22, align 4, !tbaa !24
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [4 x double], ptr %150, i64 0, i64 %152
  %154 = load double, ptr %153, align 8, !tbaa !25
  %155 = load double, ptr %19, align 8, !tbaa !25
  %156 = fcmp olt double %154, %155
  br i1 %156, label %157, label %168

157:                                              ; preds = %123
  %158 = load i32, ptr %25, align 4, !tbaa !24
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %21, i64 0, i64 %159
  %161 = load i32, ptr %24, align 4, !tbaa !24
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [4 x [4 x double]], ptr %160, i64 0, i64 %162
  %164 = load i32, ptr %22, align 4, !tbaa !24
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [4 x double], ptr %163, i64 0, i64 %165
  %167 = load double, ptr %166, align 8, !tbaa !25
  store double %167, ptr %19, align 8, !tbaa !25
  br label %193

168:                                              ; preds = %123
  %169 = load i32, ptr %25, align 4, !tbaa !24
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %21, i64 0, i64 %170
  %172 = load i32, ptr %24, align 4, !tbaa !24
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [4 x [4 x double]], ptr %171, i64 0, i64 %173
  %175 = load i32, ptr %22, align 4, !tbaa !24
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [4 x double], ptr %174, i64 0, i64 %176
  %178 = load double, ptr %177, align 8, !tbaa !25
  %179 = load double, ptr %20, align 8, !tbaa !25
  %180 = fcmp ogt double %178, %179
  br i1 %180, label %181, label %192

181:                                              ; preds = %168
  %182 = load i32, ptr %25, align 4, !tbaa !24
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %21, i64 0, i64 %183
  %185 = load i32, ptr %24, align 4, !tbaa !24
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [4 x [4 x double]], ptr %184, i64 0, i64 %186
  %188 = load i32, ptr %22, align 4, !tbaa !24
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [4 x double], ptr %187, i64 0, i64 %189
  %191 = load double, ptr %190, align 8, !tbaa !25
  store double %191, ptr %20, align 8, !tbaa !25
  br label %192

192:                                              ; preds = %181, %168
  br label %193

193:                                              ; preds = %192, %157
  br label %204

194:                                              ; preds = %111
  %195 = load i32, ptr %25, align 4, !tbaa !24
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %21, i64 0, i64 %196
  %198 = load i32, ptr %24, align 4, !tbaa !24
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [4 x [4 x double]], ptr %197, i64 0, i64 %199
  %201 = load i32, ptr %22, align 4, !tbaa !24
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [4 x double], ptr %200, i64 0, i64 %202
  store double 0.000000e+00, ptr %203, align 8, !tbaa !25
  br label %204

204:                                              ; preds = %194, %193
  br label %205

205:                                              ; preds = %204
  %206 = load i32, ptr %25, align 4, !tbaa !24
  %207 = add nsw i32 %206, 1
  store i32 %207, ptr %25, align 4, !tbaa !24
  br label %107, !llvm.loop !26

208:                                              ; preds = %110
  br label %209

209:                                              ; preds = %208
  %210 = load i32, ptr %24, align 4, !tbaa !24
  %211 = add nsw i32 %210, 1
  store i32 %211, ptr %24, align 4, !tbaa !24
  br label %102, !llvm.loop !28

212:                                              ; preds = %105
  br label %213

213:                                              ; preds = %212
  %214 = load i32, ptr %22, align 4, !tbaa !24
  %215 = add nsw i32 %214, 1
  store i32 %215, ptr %22, align 4, !tbaa !24
  br label %97, !llvm.loop !29

216:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %217 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %21, i64 0, i64 0
  %218 = load double, ptr %13, align 8, !tbaa !25
  %219 = load double, ptr %14, align 8, !tbaa !25
  %220 = load double, ptr %15, align 8, !tbaa !25
  %221 = call noundef double @_ZN13Interpolation19tricubicInterpolateEPA4_A4_dddd(ptr noundef %217, double noundef %218, double noundef %219, double noundef %220)
  store double %221, ptr %26, align 8, !tbaa !25
  %222 = load double, ptr %26, align 8, !tbaa !25
  %223 = load double, ptr %19, align 8, !tbaa !25
  %224 = fcmp olt double %222, %223
  br i1 %224, label %225, label %227

225:                                              ; preds = %216
  %226 = load double, ptr %19, align 8, !tbaa !25
  store double %226, ptr %26, align 8, !tbaa !25
  br label %234

227:                                              ; preds = %216
  %228 = load double, ptr %26, align 8, !tbaa !25
  %229 = load double, ptr %20, align 8, !tbaa !25
  %230 = fcmp ogt double %228, %229
  br i1 %230, label %231, label %233

231:                                              ; preds = %227
  %232 = load double, ptr %20, align 8, !tbaa !25
  store double %232, ptr %26, align 8, !tbaa !25
  br label %233

233:                                              ; preds = %231, %227
  br label %234

234:                                              ; preds = %233, %225
  %235 = load double, ptr %26, align 8, !tbaa !25
  store double %235, ptr %3, align 8
  store i32 1, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 512, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %236

236:                                              ; preds = %234, %46
  %237 = load double, ptr %3, align 8
  ret double %237
}

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

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

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

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

declare noundef double @_ZN13Interpolation19tricubicInterpolateEPA4_A4_dddd(ptr noundef, double noundef, double noundef, double noundef) #4

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

!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 = !{!"_ZTSN5vmath4vec3E", !11, i64 0, !11, i64 4, !11, i64 8}
!11 = !{!"float", !7, i64 0}
!12 = !{!10, !11, i64 4}
!13 = !{!10, !11, i64 8}
!14 = !{!15, !17, i64 16}
!15 = !{!"_ZTS11ScalarField", !16, i64 0, !16, i64 4, !16, i64 8, !17, i64 16, !17, i64 24, !17, i64 32, !17, i64 40, !17, i64 48, !17, i64 56, !17, i64 64, !17, i64 72, !18, i64 80, !19, i64 88, !20, i64 128, !19, i64 160, !20, i64 200, !18, i64 232, !10, i64 236}
!16 = !{!"int", !7, i64 0}
!17 = !{!"double", !7, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{!"_ZTS7Array3dIfE", !16, i64 0, !16, i64 4, !16, i64 8, !6, i64 16, !18, i64 24, !11, i64 28, !16, i64 32}
!20 = !{!"_ZTS7Array3dIbE", !16, i64 0, !16, i64 4, !16, i64 8, !6, i64 16, !18, i64 24, !18, i64 25, !16, i64 28}
!21 = !{!15, !16, i64 0}
!22 = !{!15, !16, i64 4}
!23 = !{!15, !16, i64 8}
!24 = !{!16, !16, i64 0}
!25 = !{!17, !17, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = distinct !{!28, !27}
!29 = distinct !{!29, !27}


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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN11ScalarField21tricubicInterpolationEN5vmath4vec3E(ptr noundef nonnull align 8 dereferenceable(248) %0, ptr nocapture noundef readonly %1) local_unnamed_addr #1 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca [4 x [4 x [4 x double]]], align 16
  %10 = load float, ptr %1, align 4, !tbaa !5
  %11 = fpext float %10 to double
  %12 = getelementptr inbounds i8, ptr %1, i64 4
  %13 = load float, ptr %12, align 4, !tbaa !10
  %14 = fpext float %13 to double
  %15 = getelementptr inbounds i8, ptr %1, i64 8
  %16 = load float, ptr %15, align 4, !tbaa !11
  %17 = fpext float %16 to double
  %18 = getelementptr inbounds i8, ptr %0, i64 16
  %19 = load double, ptr %18, align 8, !tbaa !12
  %20 = load i32, ptr %0, align 8, !tbaa !20
  %21 = getelementptr inbounds i8, ptr %0, i64 4
  %22 = load i32, ptr %21, align 4, !tbaa !21
  %23 = getelementptr inbounds i8, ptr %0, i64 8
  %24 = load i32, ptr %23, align 8, !tbaa !22
  %25 = tail call noundef zeroext i1 @_ZN6Grid3d16isPositionInGridEddddiii(double noundef %11, double noundef %14, double noundef %17, double noundef %19, i32 noundef %20, i32 noundef %22, i32 noundef %24)
  br i1 %25, label %26, label %127

26:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %27 = load float, ptr %1, align 4, !tbaa !5
  %28 = fpext float %27 to double
  %29 = load float, ptr %12, align 4, !tbaa !10
  %30 = fpext float %29 to double
  %31 = load float, ptr %15, align 4, !tbaa !11
  %32 = fpext float %31 to double
  %33 = load double, ptr %18, align 8, !tbaa !12
  call void @_ZN6Grid3d19positionToGridIndexEddddPiS0_S0_(double noundef %28, double noundef %30, double noundef %32, double noundef %33, ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5)
  %34 = load i32, ptr %3, align 4, !tbaa !23
  %35 = load i32, ptr %4, align 4, !tbaa !23
  %36 = load i32, ptr %5, align 4, !tbaa !23
  %37 = load double, ptr %18, align 8, !tbaa !12
  call void @_ZN6Grid3d19GridIndexToPositionEiiidPdS0_S0_(i32 noundef %34, i32 noundef %35, i32 noundef %36, double noundef %37, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %8)
  %38 = load double, ptr %18, align 8, !tbaa !12
  %39 = load float, ptr %1, align 4, !tbaa !5
  %40 = fpext float %39 to double
  %41 = load double, ptr %6, align 8, !tbaa !24
  %42 = fsub double %40, %41
  %43 = load float, ptr %12, align 4, !tbaa !10
  %44 = fpext float %43 to double
  %45 = load double, ptr %7, align 8, !tbaa !24
  %46 = fsub double %44, %45
  %47 = load float, ptr %15, align 4, !tbaa !11
  %48 = fpext float %47 to double
  %49 = load double, ptr %8, align 8, !tbaa !24
  %50 = fsub double %48, %49
  %51 = load i32, ptr %3, align 4, !tbaa !23
  %52 = add nsw i32 %51, -1
  %53 = load i32, ptr %4, align 4, !tbaa !23
  %54 = add nsw i32 %53, -1
  %55 = load i32, ptr %5, align 4, !tbaa !23
  %56 = add nsw i32 %55, -1
  %57 = call noundef double @_ZNSt14numeric_limitsIdE8infinityEv() #5
  %58 = call noundef double @_ZNSt14numeric_limitsIdE8infinityEv() #5
  %59 = fneg double %58
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %9) #5
  %60 = getelementptr inbounds i8, ptr %0, i64 88
  %61 = add i32 %51, 1
  %62 = add i32 %51, 2
  br label %.preheader64

.preheader64:                                     ; preds = %26, %75
  %indvars.iv76 = phi i64 [ 0, %26 ], [ %indvars.iv.next77, %75 ]
  %.05572 = phi double [ %59, %26 ], [ %.3.3, %75 ]
  %.05671 = phi double [ %57, %26 ], [ %.359.3, %75 ]
  %63 = trunc i64 %indvars.iv76 to i32
  %64 = add i32 %56, %63
  br label %.preheader

65:                                               ; preds = %75
  %66 = fdiv double 1.000000e+00, %38
  %67 = fmul double %66, %42
  %68 = fmul double %66, %46
  %69 = fmul double %66, %50
  %70 = call noundef double @_ZN13Interpolation19tricubicInterpolateEPA4_A4_dddd(ptr noundef nonnull %9, double noundef %67, double noundef %68, double noundef %69)
  %71 = fcmp olt double %70, %.359.3
  br i1 %71, label %126, label %123

.preheader:                                       ; preds = %.preheader64, %122
  %indvars.iv = phi i64 [ 0, %.preheader64 ], [ %indvars.iv.next, %122 ]
  %.169 = phi double [ %.05572, %.preheader64 ], [ %.3.3, %122 ]
  %.15768 = phi double [ %.05671, %.preheader64 ], [ %.359.3, %122 ]
  %72 = trunc i64 %indvars.iv to i32
  %73 = add i32 %54, %72
  %74 = call noundef zeroext i1 @_ZN7Array3dIfE14isIndexInRangeEiii(ptr noundef nonnull align 8 dereferenceable(36) %60, i32 noundef %52, i32 noundef %73, i32 noundef %64)
  br i1 %74, label %76, label %84

75:                                               ; preds = %122
  %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
  %exitcond79.not = icmp eq i64 %indvars.iv.next77, 4
  br i1 %exitcond79.not, label %65, label %.preheader64, !llvm.loop !25

76:                                               ; preds = %.preheader
  %77 = call noundef float @_ZN7Array3dIfEclEiii(ptr noundef nonnull align 8 dereferenceable(36) %60, i32 noundef %52, i32 noundef %73, i32 noundef %64)
  %78 = fpext float %77 to double
  %79 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %9, i64 0, i64 0, i64 %indvars.iv, i64 %indvars.iv76
  store double %78, ptr %79, align 8, !tbaa !24
  %80 = fcmp ogt double %.15768, %78
  br i1 %80, label %86, label %81

81:                                               ; preds = %76
  %82 = fcmp olt double %.169, %78
  br i1 %82, label %83, label %86

83:                                               ; preds = %81
  br label %86

84:                                               ; preds = %.preheader
  %85 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %9, i64 0, i64 0, i64 %indvars.iv, i64 %indvars.iv76
  store double 0.000000e+00, ptr %85, align 8, !tbaa !24
  br label %86

86:                                               ; preds = %76, %84, %81, %83
  %.359 = phi double [ %.15768, %83 ], [ %.15768, %81 ], [ %.15768, %84 ], [ %78, %76 ]
  %.3 = phi double [ %78, %83 ], [ %.169, %81 ], [ %.169, %84 ], [ %.169, %76 ]
  %87 = call noundef zeroext i1 @_ZN7Array3dIfE14isIndexInRangeEiii(ptr noundef nonnull align 8 dereferenceable(36) %60, i32 noundef %51, i32 noundef %73, i32 noundef %64)
  br i1 %87, label %90, label %88

88:                                               ; preds = %86
  %89 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %9, i64 0, i64 1, i64 %indvars.iv, i64 %indvars.iv76
  store double 0.000000e+00, ptr %89, align 8, !tbaa !24
  br label %98

90:                                               ; preds = %86
  %91 = call noundef float @_ZN7Array3dIfEclEiii(ptr noundef nonnull align 8 dereferenceable(36) %60, i32 noundef %51, i32 noundef %73, i32 noundef %64)
  %92 = fpext float %91 to double
  %93 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %9, i64 0, i64 1, i64 %indvars.iv, i64 %indvars.iv76
  store double %92, ptr %93, align 8, !tbaa !24
  %94 = fcmp ogt double %.359, %92
  br i1 %94, label %98, label %95

95:                                               ; preds = %90
  %96 = fcmp olt double %.3, %92
  br i1 %96, label %97, label %98

97:                                               ; preds = %95
  br label %98

98:                                               ; preds = %97, %95, %90, %88
  %.359.1 = phi double [ %.359, %97 ], [ %.359, %95 ], [ %.359, %88 ], [ %92, %90 ]
  %.3.1 = phi double [ %92, %97 ], [ %.3, %95 ], [ %.3, %88 ], [ %.3, %90 ]
  %99 = call noundef zeroext i1 @_ZN7Array3dIfE14isIndexInRangeEiii(ptr noundef nonnull align 8 dereferenceable(36) %60, i32 noundef %61, i32 noundef %73, i32 noundef %64)
  br i1 %99, label %102, label %100

100:                                              ; preds = %98
  %101 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %9, i64 0, i64 2, i64 %indvars.iv, i64 %indvars.iv76
  store double 0.000000e+00, ptr %101, align 8, !tbaa !24
  br label %110

102:                                              ; preds = %98
  %103 = call noundef float @_ZN7Array3dIfEclEiii(ptr noundef nonnull align 8 dereferenceable(36) %60, i32 noundef %61, i32 noundef %73, i32 noundef %64)
  %104 = fpext float %103 to double
  %105 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %9, i64 0, i64 2, i64 %indvars.iv, i64 %indvars.iv76
  store double %104, ptr %105, align 8, !tbaa !24
  %106 = fcmp ogt double %.359.1, %104
  br i1 %106, label %110, label %107

107:                                              ; preds = %102
  %108 = fcmp olt double %.3.1, %104
  br i1 %108, label %109, label %110

109:                                              ; preds = %107
  br label %110

110:                                              ; preds = %109, %107, %102, %100
  %.359.2 = phi double [ %.359.1, %109 ], [ %.359.1, %107 ], [ %.359.1, %100 ], [ %104, %102 ]
  %.3.2 = phi double [ %104, %109 ], [ %.3.1, %107 ], [ %.3.1, %100 ], [ %.3.1, %102 ]
  %111 = call noundef zeroext i1 @_ZN7Array3dIfE14isIndexInRangeEiii(ptr noundef nonnull align 8 dereferenceable(36) %60, i32 noundef %62, i32 noundef %73, i32 noundef %64)
  br i1 %111, label %114, label %112

112:                                              ; preds = %110
  %113 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %9, i64 0, i64 3, i64 %indvars.iv, i64 %indvars.iv76
  store double 0.000000e+00, ptr %113, align 8, !tbaa !24
  br label %122

114:                                              ; preds = %110
  %115 = call noundef float @_ZN7Array3dIfEclEiii(ptr noundef nonnull align 8 dereferenceable(36) %60, i32 noundef %62, i32 noundef %73, i32 noundef %64)
  %116 = fpext float %115 to double
  %117 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %9, i64 0, i64 3, i64 %indvars.iv, i64 %indvars.iv76
  store double %116, ptr %117, align 8, !tbaa !24
  %118 = fcmp ogt double %.359.2, %116
  br i1 %118, label %122, label %119

119:                                              ; preds = %114
  %120 = fcmp olt double %.3.2, %116
  br i1 %120, label %121, label %122

121:                                              ; preds = %119
  br label %122

122:                                              ; preds = %121, %119, %114, %112
  %.359.3 = phi double [ %.359.2, %121 ], [ %.359.2, %119 ], [ %.359.2, %112 ], [ %116, %114 ]
  %.3.3 = phi double [ %116, %121 ], [ %.3.2, %119 ], [ %.3.2, %112 ], [ %.3.2, %114 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 4
  br i1 %exitcond.not, label %75, label %.preheader, !llvm.loop !27

123:                                              ; preds = %65
  %124 = fcmp ogt double %70, %.3.3
  br i1 %124, label %125, label %126

125:                                              ; preds = %123
  br label %126

126:                                              ; preds = %65, %123, %125
  %.0 = phi double [ %.3.3, %125 ], [ %70, %123 ], [ %.359.3, %65 ]
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  br label %127

127:                                              ; preds = %2, %126
  %.060 = phi double [ %.0, %126 ], [ 0.000000e+00, %2 ]
  ret double %.060
}

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

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

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

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

declare noundef double @_ZN13Interpolation19tricubicInterpolateEPA4_A4_dddd(ptr noundef, double noundef, double noundef, double noundef) local_unnamed_addr #4

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

!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 = !{!"_ZTSN5vmath4vec3E", !7, i64 0, !7, i64 4, !7, i64 8}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!6, !7, i64 4}
!11 = !{!6, !7, i64 8}
!12 = !{!13, !15, i64 16}
!13 = !{!"_ZTS11ScalarField", !14, i64 0, !14, i64 4, !14, i64 8, !15, i64 16, !15, i64 24, !15, i64 32, !15, i64 40, !15, i64 48, !15, i64 56, !15, i64 64, !15, i64 72, !16, i64 80, !17, i64 88, !19, i64 128, !17, i64 160, !19, i64 200, !16, i64 232, !6, i64 236}
!14 = !{!"int", !8, i64 0}
!15 = !{!"double", !8, i64 0}
!16 = !{!"bool", !8, i64 0}
!17 = !{!"_ZTS7Array3dIfE", !14, i64 0, !14, i64 4, !14, i64 8, !18, i64 16, !16, i64 24, !7, i64 28, !14, i64 32}
!18 = !{!"any pointer", !8, i64 0}
!19 = !{!"_ZTS7Array3dIbE", !14, i64 0, !14, i64 4, !14, i64 8, !18, i64 16, !16, i64 24, !16, i64 25, !14, i64 28}
!20 = !{!13, !14, i64 0}
!21 = !{!13, !14, i64 4}
!22 = !{!13, !14, i64 8}
!23 = !{!14, !14, i64 0}
!24 = !{!15, !15, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = distinct !{!27, !26}


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