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

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

; 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 @_ZN16MACVelocityField1UEiii(ptr noundef nonnull align 8 dereferenceable(148), i32 noundef, i32 noundef, i32 noundef) #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN16MACVelocityField13_interpolateUEddd(ptr noundef nonnull align 8 dereferenceable(148) %0, double noundef %1, double noundef %2, double noundef %3) #1 align 2 {
  %5 = alloca double, align 8
  %6 = alloca ptr, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %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 i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca [4 x [4 x [4 x double]]], align 16
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store double %1, ptr %7, align 8, !tbaa !9
  store double %2, ptr %8, align 8, !tbaa !9
  store double %3, ptr %9, align 8, !tbaa !9
  %28 = load ptr, ptr %6, align 8
  %29 = load double, ptr %7, align 8, !tbaa !9
  %30 = load double, ptr %8, align 8, !tbaa !9
  %31 = load double, ptr %9, align 8, !tbaa !9
  %32 = getelementptr inbounds %class.MACVelocityField, ptr %28, i32 0, i32 4
  %33 = load double, ptr %32, align 8, !tbaa !11
  %34 = getelementptr inbounds %class.MACVelocityField, ptr %28, i32 0, i32 1
  %35 = load i32, ptr %34, align 4, !tbaa !17
  %36 = getelementptr inbounds %class.MACVelocityField, ptr %28, i32 0, i32 2
  %37 = load i32, ptr %36, align 8, !tbaa !18
  %38 = getelementptr inbounds %class.MACVelocityField, ptr %28, i32 0, i32 3
  %39 = load i32, ptr %38, align 4, !tbaa !19
  %40 = call noundef zeroext i1 @_ZN6Grid3d16isPositionInGridEddddiii(double noundef %29, double noundef %30, double noundef %31, double noundef %33, i32 noundef %35, i32 noundef %37, i32 noundef %39)
  br i1 %40, label %42, label %41

41:                                               ; preds = %4
  store double 0.000000e+00, ptr %5, align 8
  br label %137

42:                                               ; preds = %4
  %43 = getelementptr inbounds %class.MACVelocityField, ptr %28, i32 0, i32 4
  %44 = load double, ptr %43, align 8, !tbaa !11
  %45 = load double, ptr %8, align 8, !tbaa !9
  %46 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %44, double %45)
  store double %46, ptr %8, align 8, !tbaa !9
  %47 = getelementptr inbounds %class.MACVelocityField, ptr %28, i32 0, i32 4
  %48 = load double, ptr %47, align 8, !tbaa !11
  %49 = load double, ptr %9, align 8, !tbaa !9
  %50 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %48, double %49)
  store double %50, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %51 = load double, ptr %7, align 8, !tbaa !9
  %52 = load double, ptr %8, align 8, !tbaa !9
  %53 = load double, ptr %9, align 8, !tbaa !9
  %54 = getelementptr inbounds %class.MACVelocityField, ptr %28, i32 0, i32 4
  %55 = load double, ptr %54, align 8, !tbaa !11
  call void @_ZN6Grid3d19positionToGridIndexEddddPiS0_S0_(double noundef %51, double noundef %52, double noundef %53, double noundef %55, ptr noundef %10, ptr noundef %11, ptr noundef %12)
  %56 = load i32, ptr %10, align 4, !tbaa !20
  %57 = load i32, ptr %11, align 4, !tbaa !20
  %58 = load i32, ptr %12, align 4, !tbaa !20
  %59 = getelementptr inbounds %class.MACVelocityField, ptr %28, i32 0, i32 4
  %60 = load double, ptr %59, align 8, !tbaa !11
  call void @_ZN6Grid3d19GridIndexToPositionEiiidPdS0_S0_(i32 noundef %56, i32 noundef %57, i32 noundef %58, double noundef %60, ptr noundef %13, ptr noundef %14, ptr noundef %15)
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %61 = getelementptr inbounds %class.MACVelocityField, ptr %28, i32 0, i32 4
  %62 = load double, ptr %61, align 8, !tbaa !11
  %63 = fdiv double 1.000000e+00, %62
  store double %63, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %64 = load double, ptr %7, align 8, !tbaa !9
  %65 = load double, ptr %13, align 8, !tbaa !9
  %66 = fsub double %64, %65
  %67 = load double, ptr %16, align 8, !tbaa !9
  %68 = fmul double %66, %67
  store double %68, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %69 = load double, ptr %8, align 8, !tbaa !9
  %70 = load double, ptr %14, align 8, !tbaa !9
  %71 = fsub double %69, %70
  %72 = load double, ptr %16, align 8, !tbaa !9
  %73 = fmul double %71, %72
  store double %73, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %74 = load double, ptr %9, align 8, !tbaa !9
  %75 = load double, ptr %15, align 8, !tbaa !9
  %76 = fsub double %74, %75
  %77 = load double, ptr %16, align 8, !tbaa !9
  %78 = fmul double %76, %77
  store double %78, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  %79 = load i32, ptr %10, align 4, !tbaa !20
  %80 = sub nsw i32 %79, 1
  store i32 %80, ptr %20, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  %81 = load i32, ptr %11, align 4, !tbaa !20
  %82 = sub nsw i32 %81, 1
  store i32 %82, ptr %21, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %83 = load i32, ptr %12, align 4, !tbaa !20
  %84 = sub nsw i32 %83, 1
  store i32 %84, ptr %22, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 512, ptr %23) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  store i32 0, ptr %24, align 4, !tbaa !20
  br label %85

85:                                               ; preds = %128, %42
  %86 = load i32, ptr %24, align 4, !tbaa !20
  %87 = icmp slt i32 %86, 4
  br i1 %87, label %89, label %88

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

89:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  store i32 0, ptr %26, align 4, !tbaa !20
  br label %90

90:                                               ; preds = %124, %89
  %91 = load i32, ptr %26, align 4, !tbaa !20
  %92 = icmp slt i32 %91, 4
  br i1 %92, label %94, label %93

93:                                               ; preds = %90
  store i32 5, ptr %25, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  br label %127

94:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  store i32 0, ptr %27, align 4, !tbaa !20
  br label %95

95:                                               ; preds = %120, %94
  %96 = load i32, ptr %27, align 4, !tbaa !20
  %97 = icmp slt i32 %96, 4
  br i1 %97, label %99, label %98

98:                                               ; preds = %95
  store i32 8, ptr %25, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  br label %123

99:                                               ; preds = %95
  %100 = load i32, ptr %27, align 4, !tbaa !20
  %101 = load i32, ptr %20, align 4, !tbaa !20
  %102 = add nsw i32 %100, %101
  %103 = load i32, ptr %26, align 4, !tbaa !20
  %104 = load i32, ptr %21, align 4, !tbaa !20
  %105 = add nsw i32 %103, %104
  %106 = load i32, ptr %24, align 4, !tbaa !20
  %107 = load i32, ptr %22, align 4, !tbaa !20
  %108 = add nsw i32 %106, %107
  %109 = call noundef float @_ZN16MACVelocityField1UEiii(ptr noundef nonnull align 8 dereferenceable(148) %28, i32 noundef %102, i32 noundef %105, i32 noundef %108)
  %110 = fpext float %109 to double
  %111 = load i32, ptr %24, align 4, !tbaa !20
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %23, i64 0, i64 %112
  %114 = load i32, ptr %26, align 4, !tbaa !20
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [4 x [4 x double]], ptr %113, i64 0, i64 %115
  %117 = load i32, ptr %27, align 4, !tbaa !20
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [4 x double], ptr %116, i64 0, i64 %118
  store double %110, ptr %119, align 8, !tbaa !9
  br label %120

120:                                              ; preds = %99
  %121 = load i32, ptr %27, align 4, !tbaa !20
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %27, align 4, !tbaa !20
  br label %95, !llvm.loop !21

123:                                              ; preds = %98
  br label %124

124:                                              ; preds = %123
  %125 = load i32, ptr %26, align 4, !tbaa !20
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %26, align 4, !tbaa !20
  br label %90, !llvm.loop !23

127:                                              ; preds = %93
  br label %128

128:                                              ; preds = %127
  %129 = load i32, ptr %24, align 4, !tbaa !20
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %24, align 4, !tbaa !20
  br label %85, !llvm.loop !24

131:                                              ; preds = %88
  %132 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %23, i64 0, i64 0
  %133 = load double, ptr %17, align 8, !tbaa !9
  %134 = load double, ptr %18, align 8, !tbaa !9
  %135 = load double, ptr %19, align 8, !tbaa !9
  %136 = call noundef double @_ZN13Interpolation19tricubicInterpolateEPA4_A4_dddd(ptr noundef %132, double noundef %133, double noundef %134, double noundef %135)
  store double %136, ptr %5, align 8
  store i32 1, ptr %25, align 4
  call void @llvm.lifetime.end.p0(i64 512, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, 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 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %137

137:                                              ; preds = %131, %41
  %138 = load double, ptr %5, align 8
  ret double %138
}

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

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

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

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #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, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !10, i64 16}
!12 = !{!"_ZTS16MACVelocityField", !13, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !10, i64 16, !15, i64 24, !15, i64 64, !15, i64 104, !14, i64 144}
!13 = !{!"float", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_ZTS7Array3dIfE", !14, i64 0, !14, i64 4, !14, i64 8, !6, i64 16, !16, i64 24, !13, i64 28, !14, i64 32}
!16 = !{!"bool", !7, i64 0}
!17 = !{!12, !14, i64 4}
!18 = !{!12, !14, i64 8}
!19 = !{!12, !14, i64 12}
!20 = !{!14, !14, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}
!24 = distinct !{!24, !22}


; 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 @_ZN16MACVelocityField1UEiii(ptr noundef nonnull align 8 dereferenceable(148), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1 align 2

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

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

21:                                               ; preds = %4
  %22 = load double, ptr %12, align 8, !tbaa !5
  %23 = tail call double @llvm.fmuladd.f64(double %22, double -5.000000e-01, double %2)
  %24 = tail call double @llvm.fmuladd.f64(double %22, double -5.000000e-01, double %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  call void @_ZN6Grid3d19positionToGridIndexEddddPiS0_S0_(double noundef %1, double noundef %23, double noundef %24, double noundef %22, ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef nonnull %7)
  %25 = load i32, ptr %5, align 4, !tbaa !18
  %26 = load i32, ptr %6, align 4, !tbaa !18
  %27 = load i32, ptr %7, align 4, !tbaa !18
  %28 = load double, ptr %12, align 8, !tbaa !5
  call void @_ZN6Grid3d19GridIndexToPositionEiiidPdS0_S0_(i32 noundef %25, i32 noundef %26, i32 noundef %27, double noundef %28, ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %10)
  %29 = load double, ptr %12, align 8, !tbaa !5
  %30 = load double, ptr %8, align 8, !tbaa !19
  %31 = fsub double %1, %30
  %32 = load double, ptr %9, align 8, !tbaa !19
  %33 = fsub double %23, %32
  %34 = load double, ptr %10, align 8, !tbaa !19
  %35 = fsub double %24, %34
  %36 = load i32, ptr %5, align 4, !tbaa !18
  %37 = add nsw i32 %36, -1
  %38 = load i32, ptr %6, align 4, !tbaa !18
  %39 = add nsw i32 %38, -1
  %40 = load i32, ptr %7, align 4, !tbaa !18
  %41 = add nsw i32 %40, -1
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %11) #5
  %42 = add i32 %38, 2
  %43 = add i32 %36, 1
  %44 = add i32 %36, 2
  %45 = add i32 %38, 1
  br label %.preheader36

.preheader36:                                     ; preds = %21, %.preheader36
  %indvars.iv = phi i64 [ 0, %21 ], [ %indvars.iv.next, %.preheader36 ]
  %46 = trunc i64 %indvars.iv to i32
  %47 = add i32 %41, %46
  %48 = call noundef float @_ZN16MACVelocityField1UEiii(ptr noundef nonnull align 8 dereferenceable(148) %0, i32 noundef %37, i32 noundef %39, i32 noundef %47)
  %49 = fpext float %48 to double
  %50 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %11, i64 0, i64 %indvars.iv, i64 0, i64 0
  store double %49, ptr %50, align 16, !tbaa !19
  %51 = call noundef float @_ZN16MACVelocityField1UEiii(ptr noundef nonnull align 8 dereferenceable(148) %0, i32 noundef %36, i32 noundef %39, i32 noundef %47)
  %52 = fpext float %51 to double
  %53 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %11, i64 0, i64 %indvars.iv, i64 0, i64 1
  store double %52, ptr %53, align 8, !tbaa !19
  %54 = call noundef float @_ZN16MACVelocityField1UEiii(ptr noundef nonnull align 8 dereferenceable(148) %0, i32 noundef %43, i32 noundef %39, i32 noundef %47)
  %55 = fpext float %54 to double
  %56 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %11, i64 0, i64 %indvars.iv, i64 0, i64 2
  store double %55, ptr %56, align 16, !tbaa !19
  %57 = call noundef float @_ZN16MACVelocityField1UEiii(ptr noundef nonnull align 8 dereferenceable(148) %0, i32 noundef %44, i32 noundef %39, i32 noundef %47)
  %58 = fpext float %57 to double
  %59 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %11, i64 0, i64 %indvars.iv, i64 0, i64 3
  store double %58, ptr %59, align 8, !tbaa !19
  %60 = call noundef float @_ZN16MACVelocityField1UEiii(ptr noundef nonnull align 8 dereferenceable(148) %0, i32 noundef %37, i32 noundef %38, i32 noundef %47)
  %61 = fpext float %60 to double
  %62 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %11, i64 0, i64 %indvars.iv, i64 1, i64 0
  store double %61, ptr %62, align 16, !tbaa !19
  %63 = call noundef float @_ZN16MACVelocityField1UEiii(ptr noundef nonnull align 8 dereferenceable(148) %0, i32 noundef %36, i32 noundef %38, i32 noundef %47)
  %64 = fpext float %63 to double
  %65 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %11, i64 0, i64 %indvars.iv, i64 1, i64 1
  store double %64, ptr %65, align 8, !tbaa !19
  %66 = call noundef float @_ZN16MACVelocityField1UEiii(ptr noundef nonnull align 8 dereferenceable(148) %0, i32 noundef %43, i32 noundef %38, i32 noundef %47)
  %67 = fpext float %66 to double
  %68 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %11, i64 0, i64 %indvars.iv, i64 1, i64 2
  store double %67, ptr %68, align 16, !tbaa !19
  %69 = call noundef float @_ZN16MACVelocityField1UEiii(ptr noundef nonnull align 8 dereferenceable(148) %0, i32 noundef %44, i32 noundef %38, i32 noundef %47)
  %70 = fpext float %69 to double
  %71 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %11, i64 0, i64 %indvars.iv, i64 1, i64 3
  store double %70, ptr %71, align 8, !tbaa !19
  %72 = call noundef float @_ZN16MACVelocityField1UEiii(ptr noundef nonnull align 8 dereferenceable(148) %0, i32 noundef %37, i32 noundef %45, i32 noundef %47)
  %73 = fpext float %72 to double
  %74 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %11, i64 0, i64 %indvars.iv, i64 2, i64 0
  store double %73, ptr %74, align 16, !tbaa !19
  %75 = call noundef float @_ZN16MACVelocityField1UEiii(ptr noundef nonnull align 8 dereferenceable(148) %0, i32 noundef %36, i32 noundef %45, i32 noundef %47)
  %76 = fpext float %75 to double
  %77 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %11, i64 0, i64 %indvars.iv, i64 2, i64 1
  store double %76, ptr %77, align 8, !tbaa !19
  %78 = call noundef float @_ZN16MACVelocityField1UEiii(ptr noundef nonnull align 8 dereferenceable(148) %0, i32 noundef %43, i32 noundef %45, i32 noundef %47)
  %79 = fpext float %78 to double
  %80 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %11, i64 0, i64 %indvars.iv, i64 2, i64 2
  store double %79, ptr %80, align 16, !tbaa !19
  %81 = call noundef float @_ZN16MACVelocityField1UEiii(ptr noundef nonnull align 8 dereferenceable(148) %0, i32 noundef %44, i32 noundef %45, i32 noundef %47)
  %82 = fpext float %81 to double
  %83 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %11, i64 0, i64 %indvars.iv, i64 2, i64 3
  store double %82, ptr %83, align 8, !tbaa !19
  %84 = call noundef float @_ZN16MACVelocityField1UEiii(ptr noundef nonnull align 8 dereferenceable(148) %0, i32 noundef %37, i32 noundef %42, i32 noundef %47)
  %85 = fpext float %84 to double
  %86 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %11, i64 0, i64 %indvars.iv, i64 3, i64 0
  store double %85, ptr %86, align 16, !tbaa !19
  %87 = call noundef float @_ZN16MACVelocityField1UEiii(ptr noundef nonnull align 8 dereferenceable(148) %0, i32 noundef %36, i32 noundef %42, i32 noundef %47)
  %88 = fpext float %87 to double
  %89 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %11, i64 0, i64 %indvars.iv, i64 3, i64 1
  store double %88, ptr %89, align 8, !tbaa !19
  %90 = call noundef float @_ZN16MACVelocityField1UEiii(ptr noundef nonnull align 8 dereferenceable(148) %0, i32 noundef %43, i32 noundef %42, i32 noundef %47)
  %91 = fpext float %90 to double
  %92 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %11, i64 0, i64 %indvars.iv, i64 3, i64 2
  store double %91, ptr %92, align 16, !tbaa !19
  %93 = call noundef float @_ZN16MACVelocityField1UEiii(ptr noundef nonnull align 8 dereferenceable(148) %0, i32 noundef %44, i32 noundef %42, i32 noundef %47)
  %94 = fpext float %93 to double
  %95 = getelementptr inbounds [4 x [4 x [4 x double]]], ptr %11, i64 0, i64 %indvars.iv, i64 3, i64 3
  store double %94, ptr %95, align 8, !tbaa !19
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 4
  br i1 %exitcond.not, label %96, label %.preheader36, !llvm.loop !20

96:                                               ; preds = %.preheader36
  %97 = fdiv double 1.000000e+00, %29
  %98 = fmul double %97, %31
  %99 = fmul double %97, %33
  %100 = fmul double %97, %35
  %101 = call noundef double @_ZN13Interpolation19tricubicInterpolateEPA4_A4_dddd(ptr noundef nonnull %11, double noundef %98, double noundef %99, double noundef %100)
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  br label %102

102:                                              ; preds = %4, %96
  %.035 = phi double [ %101, %96 ], [ 0.000000e+00, %4 ]
  ret double %.035
}

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

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

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

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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #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, !11, i64 16}
!6 = !{!"_ZTS16MACVelocityField", !7, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !11, i64 16, !12, i64 24, !12, i64 64, !12, i64 104, !10, i64 144}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"double", !8, i64 0}
!12 = !{!"_ZTS7Array3dIfE", !10, i64 0, !10, i64 4, !10, i64 8, !13, i64 16, !14, i64 24, !7, i64 28, !10, i64 32}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!"bool", !8, i64 0}
!15 = !{!6, !10, i64 4}
!16 = !{!6, !10, i64 8}
!17 = !{!6, !10, i64 12}
!18 = !{!10, !10, i64 0}
!19 = !{!11, !11, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}


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