; LLVM IR from SourangshuGhosh/Fluid-Simulation-for-Computer-Graphics :: src (turbulencefield)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

declare void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #2

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

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

; 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
define dso_local noundef double @_ZN15TurbulenceField30_calculateTurbulenceAtGridCellEiiiR7Array3dIN5vmath4vec3EE(ptr noundef nonnull align 8 dereferenceable(1560) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef nonnull align 8 dereferenceable(44) %4) #5 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca %"class.vmath::vec3", align 4
  %12 = alloca %"class.vmath::vec3", align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca %"class.vmath::vec3", align 4
  %16 = alloca %"class.vmath::vec3", align 4
  %17 = alloca %"class.vmath::vec3", align 4
  %18 = alloca %"class.vmath::vec3", align 4
  %19 = alloca %"class.vmath::vec3", align 4
  %20 = alloca %"class.vmath::vec3", align 4
  %21 = alloca double, align 8
  %22 = alloca double, align 8
  %23 = alloca double, align 8
  %24 = alloca double, align 8
  %25 = alloca double, align 8
  %26 = alloca %struct.GridIndex, align 4
  %27 = alloca i32, align 4
  %28 = alloca %"class.vmath::vec3", align 4
  %29 = alloca %"class.vmath::vec3", align 4
  %30 = alloca %"class.vmath::vec3", align 4
  %31 = alloca %"class.vmath::vec3", align 4
  %32 = alloca %"class.vmath::vec3", align 4
  %33 = alloca %"class.vmath::vec3", align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store i32 %2, ptr %8, align 4, !tbaa !9
  store i32 %3, ptr %9, align 4, !tbaa !9
  store ptr %4, ptr %10, align 8, !tbaa !5
  %34 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 12, ptr %11) #9
  %35 = load ptr, ptr %10, align 8, !tbaa !5
  %36 = load i32, ptr %7, align 4, !tbaa !9
  %37 = load i32, ptr %8, align 4, !tbaa !9
  %38 = load i32, ptr %9, align 4, !tbaa !9
  call void @_ZN7Array3dIN5vmath4vec3EEclEiii(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %11, ptr noundef nonnull align 8 dereferenceable(44) %35, i32 noundef %36, i32 noundef %37, i32 noundef %38)
  call void @llvm.lifetime.start.p0(i64 12, ptr %12) #9
  %39 = load i32, ptr %7, align 4, !tbaa !9
  %40 = load i32, ptr %8, align 4, !tbaa !9
  %41 = load i32, ptr %9, align 4, !tbaa !9
  %42 = getelementptr inbounds %class.TurbulenceField, ptr %34, i32 0, i32 4
  %43 = load double, ptr %42, align 8, !tbaa !11
  invoke void @_ZN6Grid3d21GridIndexToCellCenterEiiid(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %12, i32 noundef %39, i32 noundef %40, i32 noundef %41, double noundef %43)
          to label %44 unwind label %65

44:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 12, ptr %15) #9
  invoke void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %15)
          to label %45 unwind label %69

45:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 12, ptr %16) #9
  invoke void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %16)
          to label %46 unwind label %73

46:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 12, ptr %17) #9
  invoke void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %17)
          to label %47 unwind label %77

47:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 12, ptr %18) #9
  invoke void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %18)
          to label %48 unwind label %81

48:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 12, ptr %19) #9
  invoke void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %19)
          to label %49 unwind label %85

49:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 12, ptr %20) #9
  invoke void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %20)
          to label %50 unwind label %89

50:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #9
  store double 1.000000e-05, ptr %23, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #9
  %51 = getelementptr inbounds %class.TurbulenceField, ptr %34, i32 0, i32 5
  %52 = load double, ptr %51, align 8, !tbaa !18
  %53 = fdiv double 1.000000e+00, %52
  store double %53, ptr %24, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #9
  store double 0.000000e+00, ptr %25, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 12, ptr %26) #9
  invoke void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %26)
          to label %54 unwind label %93

54:                                               ; preds = %50
  %55 = load i32, ptr %7, align 4, !tbaa !9
  %56 = load i32, ptr %8, align 4, !tbaa !9
  %57 = load i32, ptr %9, align 4, !tbaa !9
  %58 = getelementptr inbounds %class.TurbulenceField, ptr %34, i32 0, i32 6
  %59 = getelementptr inbounds [124 x %struct.GridIndex], ptr %58, i64 0, i64 0
  invoke void @_ZN6Grid3d26getNeighbourGridIndices124EiiiP9GridIndex(i32 noundef %55, i32 noundef %56, i32 noundef %57, ptr noundef %59)
          to label %60 unwind label %93

60:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #9
  store i32 0, ptr %27, align 4, !tbaa !9
  br label %61

61:                                               ; preds = %195, %60
  %62 = load i32, ptr %27, align 4, !tbaa !9
  %63 = icmp slt i32 %62, 124
  br i1 %63, label %97, label %64

64:                                               ; preds = %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #9
  br label %199

65:                                               ; preds = %5
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %13, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %14, align 4
  br label %208

69:                                               ; preds = %44
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %13, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %14, align 4
  br label %207

73:                                               ; preds = %45
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %13, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %14, align 4
  br label %206

77:                                               ; preds = %46
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %13, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %14, align 4
  br label %205

81:                                               ; preds = %47
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %13, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %14, align 4
  br label %204

85:                                               ; preds = %48
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %13, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %14, align 4
  br label %203

89:                                               ; preds = %49
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %13, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %14, align 4
  br label %202

93:                                               ; preds = %54, %50
  %94 = landingpad { ptr, i32 }
          cleanup
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %13, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %14, align 4
  br label %201

97:                                               ; preds = %61
  %98 = getelementptr inbounds %class.TurbulenceField, ptr %34, i32 0, i32 6
  %99 = load i32, ptr %27, align 4, !tbaa !9
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [124 x %struct.GridIndex], ptr %98, i64 0, i64 %100
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %26, ptr align 4 %101, i64 12, i1 false), !tbaa.struct !19
  %102 = getelementptr inbounds %struct.GridIndex, ptr %26, i32 0, i32 0
  %103 = load i32, ptr %102, align 4, !tbaa !20
  %104 = getelementptr inbounds %struct.GridIndex, ptr %26, i32 0, i32 1
  %105 = load i32, ptr %104, align 4, !tbaa !22
  %106 = getelementptr inbounds %struct.GridIndex, ptr %26, i32 0, i32 2
  %107 = load i32, ptr %106, align 4, !tbaa !23
  %108 = getelementptr inbounds %class.TurbulenceField, ptr %34, i32 0, i32 1
  %109 = load i32, ptr %108, align 8, !tbaa !24
  %110 = getelementptr inbounds %class.TurbulenceField, ptr %34, i32 0, i32 2
  %111 = load i32, ptr %110, align 4, !tbaa !25
  %112 = getelementptr inbounds %class.TurbulenceField, ptr %34, i32 0, i32 3
  %113 = load i32, ptr %112, align 8, !tbaa !26
  %114 = invoke noundef zeroext i1 @_ZN6Grid3d18isGridIndexInRangeEiiiiii(i32 noundef %103, i32 noundef %105, i32 noundef %107, i32 noundef %109, i32 noundef %111, i32 noundef %113)
          to label %115 unwind label %134

115:                                              ; preds = %97
  br i1 %114, label %116, label %194

116:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 12, ptr %28) #9
  %117 = load ptr, ptr %10, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.GridIndex, ptr %26, i32 0, i32 0
  %119 = load i32, ptr %118, align 4, !tbaa !20
  %120 = getelementptr inbounds %struct.GridIndex, ptr %26, i32 0, i32 1
  %121 = load i32, ptr %120, align 4, !tbaa !22
  %122 = getelementptr inbounds %struct.GridIndex, ptr %26, i32 0, i32 2
  %123 = load i32, ptr %122, align 4, !tbaa !23
  invoke void @_ZN7Array3dIN5vmath4vec3EEclEiii(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %28, ptr noundef nonnull align 8 dereferenceable(44) %117, i32 noundef %119, i32 noundef %121, i32 noundef %123)
          to label %124 unwind label %138

124:                                              ; preds = %116
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %28, i64 12, i1 false), !tbaa.struct !27
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %28) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %28) #9
  call void @llvm.lifetime.start.p0(i64 12, ptr %29) #9
  invoke void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %29, ptr noundef nonnull align 4 dereferenceable(12) %11, ptr noundef nonnull align 4 dereferenceable(12) %15)
          to label %125 unwind label %142

125:                                              ; preds = %124
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %29, i64 12, i1 false), !tbaa.struct !27
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %29) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %29) #9
  %126 = invoke noundef float @_ZN5vmath6lengthERKNS_4vec3E(ptr noundef nonnull align 4 dereferenceable(12) %16)
          to label %127 unwind label %134

127:                                              ; preds = %125
  %128 = fpext float %126 to double
  store double %128, ptr %21, align 8, !tbaa !17
  %129 = load double, ptr %21, align 8, !tbaa !17
  %130 = call double @llvm.fabs.f64(double %129)
  %131 = load double, ptr %23, align 8, !tbaa !17
  %132 = fcmp olt double %130, %131
  br i1 %132, label %133, label %146

133:                                              ; preds = %127
  br label %195

134:                                              ; preds = %165, %159, %125, %97
  %135 = landingpad { ptr, i32 }
          cleanup
  %136 = extractvalue { ptr, i32 } %135, 0
  store ptr %136, ptr %13, align 8
  %137 = extractvalue { ptr, i32 } %135, 1
  store i32 %137, ptr %14, align 4
  br label %198

138:                                              ; preds = %116
  %139 = landingpad { ptr, i32 }
          cleanup
  %140 = extractvalue { ptr, i32 } %139, 0
  store ptr %140, ptr %13, align 8
  %141 = extractvalue { ptr, i32 } %139, 1
  store i32 %141, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %28) #9
  br label %198

142:                                              ; preds = %124
  %143 = landingpad { ptr, i32 }
          cleanup
  %144 = extractvalue { ptr, i32 } %143, 0
  store ptr %144, ptr %13, align 8
  %145 = extractvalue { ptr, i32 } %143, 1
  store i32 %145, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %29) #9
  br label %198

146:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 12, ptr %30) #9
  %147 = load double, ptr %21, align 8, !tbaa !17
  %148 = fptrunc double %147 to float
  invoke void @_ZN5vmathdvERKNS_4vec3Ef(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %30, ptr noundef nonnull align 4 dereferenceable(12) %16, float noundef %148)
          to label %149 unwind label %178

149:                                              ; preds = %146
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %30, i64 12, i1 false), !tbaa.struct !27
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %30) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %30) #9
  call void @llvm.lifetime.start.p0(i64 12, ptr %31) #9
  %150 = getelementptr inbounds %struct.GridIndex, ptr %26, i32 0, i32 0
  %151 = load i32, ptr %150, align 4, !tbaa !20
  %152 = getelementptr inbounds %struct.GridIndex, ptr %26, i32 0, i32 1
  %153 = load i32, ptr %152, align 4, !tbaa !22
  %154 = getelementptr inbounds %struct.GridIndex, ptr %26, i32 0, i32 2
  %155 = load i32, ptr %154, align 4, !tbaa !23
  %156 = getelementptr inbounds %class.TurbulenceField, ptr %34, i32 0, i32 4
  %157 = load double, ptr %156, align 8, !tbaa !11
  invoke void @_ZN6Grid3d21GridIndexToCellCenterEiiid(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %31, i32 noundef %151, i32 noundef %153, i32 noundef %155, double noundef %157)
          to label %158 unwind label %182

158:                                              ; preds = %149
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 4 %31, i64 12, i1 false), !tbaa.struct !27
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %31) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %31) #9
  call void @llvm.lifetime.start.p0(i64 12, ptr %32) #9
  invoke void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %32, ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef nonnull align 4 dereferenceable(12) %18)
          to label %159 unwind label %186

159:                                              ; preds = %158
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %32, i64 12, i1 false), !tbaa.struct !27
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %32) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %32) #9
  %160 = invoke noundef float @_ZN5vmath6lengthERKNS_4vec3E(ptr noundef nonnull align 4 dereferenceable(12) %19)
          to label %161 unwind label %134

161:                                              ; preds = %159
  %162 = fpext float %160 to double
  store double %162, ptr %22, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 12, ptr %33) #9
  %163 = load double, ptr %22, align 8, !tbaa !17
  %164 = fptrunc double %163 to float
  invoke void @_ZN5vmathdvERKNS_4vec3Ef(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %33, ptr noundef nonnull align 4 dereferenceable(12) %19, float noundef %164)
          to label %165 unwind label %190

165:                                              ; preds = %161
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %20, ptr align 4 %33, i64 12, i1 false), !tbaa.struct !27
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %33) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %33) #9
  %166 = load double, ptr %21, align 8, !tbaa !17
  %167 = invoke noundef float @_ZN5vmath3dotERKNS_4vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %17, ptr noundef nonnull align 4 dereferenceable(12) %20)
          to label %168 unwind label %134

168:                                              ; preds = %165
  %169 = fpext float %167 to double
  %170 = fsub double 1.000000e+00, %169
  %171 = fmul double %166, %170
  %172 = load double, ptr %22, align 8, !tbaa !17
  %173 = load double, ptr %24, align 8, !tbaa !17
  %174 = fneg double %172
  %175 = call double @llvm.fmuladd.f64(double %174, double %173, double 1.000000e+00)
  %176 = load double, ptr %25, align 8, !tbaa !17
  %177 = call double @llvm.fmuladd.f64(double %171, double %175, double %176)
  store double %177, ptr %25, align 8, !tbaa !17
  br label %194

178:                                              ; preds = %146
  %179 = landingpad { ptr, i32 }
          cleanup
  %180 = extractvalue { ptr, i32 } %179, 0
  store ptr %180, ptr %13, align 8
  %181 = extractvalue { ptr, i32 } %179, 1
  store i32 %181, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %30) #9
  br label %198

182:                                              ; preds = %149
  %183 = landingpad { ptr, i32 }
          cleanup
  %184 = extractvalue { ptr, i32 } %183, 0
  store ptr %184, ptr %13, align 8
  %185 = extractvalue { ptr, i32 } %183, 1
  store i32 %185, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %31) #9
  br label %198

186:                                              ; preds = %158
  %187 = landingpad { ptr, i32 }
          cleanup
  %188 = extractvalue { ptr, i32 } %187, 0
  store ptr %188, ptr %13, align 8
  %189 = extractvalue { ptr, i32 } %187, 1
  store i32 %189, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %32) #9
  br label %198

190:                                              ; preds = %161
  %191 = landingpad { ptr, i32 }
          cleanup
  %192 = extractvalue { ptr, i32 } %191, 0
  store ptr %192, ptr %13, align 8
  %193 = extractvalue { ptr, i32 } %191, 1
  store i32 %193, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %33) #9
  br label %198

194:                                              ; preds = %168, %115
  br label %195

195:                                              ; preds = %194, %133
  %196 = load i32, ptr %27, align 4, !tbaa !9
  %197 = add nsw i32 %196, 1
  store i32 %197, ptr %27, align 4, !tbaa !9
  br label %61, !llvm.loop !29

198:                                              ; preds = %190, %186, %182, %178, %142, %138, %134
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #9
  br label %201

199:                                              ; preds = %64
  %200 = load double, ptr %25, align 8, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 12, ptr %26) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %20) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %20) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %19) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %19) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %18) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %18) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %17) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %16) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %15) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %15) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %12) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %11) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #9
  ret double %200

201:                                              ; preds = %198, %93
  call void @llvm.lifetime.end.p0(i64 12, ptr %26) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %20) #9
  br label %202

202:                                              ; preds = %201, %89
  call void @llvm.lifetime.end.p0(i64 12, ptr %20) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %19) #9
  br label %203

203:                                              ; preds = %202, %85
  call void @llvm.lifetime.end.p0(i64 12, ptr %19) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %18) #9
  br label %204

204:                                              ; preds = %203, %81
  call void @llvm.lifetime.end.p0(i64 12, ptr %18) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %17) #9
  br label %205

205:                                              ; preds = %204, %77
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %16) #9
  br label %206

206:                                              ; preds = %205, %73
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %15) #9
  br label %207

207:                                              ; preds = %206, %69
  call void @llvm.lifetime.end.p0(i64 12, ptr %15) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %12) #9
  br label %208

208:                                              ; preds = %207, %65
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %11) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #9
  br label %209

209:                                              ; preds = %208
  %210 = load ptr, ptr %13, align 8
  %211 = load i32, ptr %14, align 4
  %212 = insertvalue { ptr, i32 } poison, ptr %210, 0
  %213 = insertvalue { ptr, i32 } %212, i32 %211, 1
  resume { ptr, i32 } %213
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Array3dIN5vmath4vec3EEclEiii(ptr dead_on_unwind noalias writable sret(%"class.vmath::vec3") align 4, ptr noundef nonnull align 8 dereferenceable(44), i32 noundef, i32 noundef, i32 noundef) #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6Grid3d21GridIndexToCellCenterEiiid(ptr dead_on_unwind noalias writable sret(%"class.vmath::vec3") align 4, i32 noundef, i32 noundef, i32 noundef, double noundef) #6

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN6Grid3d18isGridIndexInRangeEiiiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #7

declare void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef float @_ZN5vmath6lengthERKNS_4vec3E(ptr noundef nonnull align 4 dereferenceable(12)) #6

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

declare void @_ZN5vmathdvERKNS_4vec3Ef(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4, ptr noundef nonnull align 4 dereferenceable(12), float noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZN5vmath3dotERKNS_4vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #7

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !16, i64 56}
!12 = !{!"_ZTS15TurbulenceField", !13, i64 0, !10, i64 40, !10, i64 44, !10, i64 48, !16, i64 56, !16, i64 64, !7, i64 72}
!13 = !{!"_ZTS7Array3dIfE", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16, !14, i64 24, !15, i64 28, !10, i64 32}
!14 = !{!"bool", !7, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = !{!16, !16, i64 0}
!18 = !{!12, !16, i64 64}
!19 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9}
!20 = !{!21, !10, i64 0}
!21 = !{!"_ZTS9GridIndex", !10, i64 0, !10, i64 4, !10, i64 8}
!22 = !{!21, !10, i64 4}
!23 = !{!21, !10, i64 8}
!24 = !{!12, !10, i64 40}
!25 = !{!12, !10, i64 44}
!26 = !{!12, !10, i64 48}
!27 = !{i64 0, i64 4, !28, i64 4, i64 4, !28, i64 8, i64 4, !28}
!28 = !{!15, !15, i64 0}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}


; 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 }
%struct.GridIndex = type { i32, i32, i32 }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

declare void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #2

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

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

; 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
define dso_local noundef double @_ZN15TurbulenceField30_calculateTurbulenceAtGridCellEiiiR7Array3dIN5vmath4vec3EE(ptr noundef nonnull align 8 dereferenceable(1560) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef nonnull align 8 dereferenceable(44) %4) local_unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"class.vmath::vec3", align 4
  %7 = alloca %"class.vmath::vec3", align 4
  %8 = alloca %"class.vmath::vec3", align 4
  %9 = alloca %"class.vmath::vec3", align 4
  %10 = alloca %"class.vmath::vec3", align 4
  %11 = alloca %"class.vmath::vec3", align 4
  %12 = alloca %"class.vmath::vec3", align 4
  %13 = alloca %"class.vmath::vec3", align 4
  %14 = alloca %struct.GridIndex, align 4
  %15 = alloca %"class.vmath::vec3", align 4
  %16 = alloca %"class.vmath::vec3", align 4
  %17 = alloca %"class.vmath::vec3", align 4
  %18 = alloca %"class.vmath::vec3", align 4
  %19 = alloca %"class.vmath::vec3", align 4
  %20 = alloca %"class.vmath::vec3", align 4
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #9
  call void @_ZN7Array3dIN5vmath4vec3EEclEiii(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %6, ptr noundef nonnull align 8 dereferenceable(44) %4, i32 noundef %1, i32 noundef %2, i32 noundef %3)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #9
  %21 = getelementptr inbounds i8, ptr %0, i64 56
  %22 = load double, ptr %21, align 8, !tbaa !5
  invoke void @_ZN6Grid3d21GridIndexToCellCenterEiiid(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %7, i32 noundef %1, i32 noundef %2, i32 noundef %3, double noundef %22)
          to label %23 unwind label %40

23:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #9
  invoke void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %8)
          to label %24 unwind label %42

24:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #9
  invoke void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %9)
          to label %25 unwind label %44

25:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #9
  invoke void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %10)
          to label %26 unwind label %46

26:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %11) #9
  invoke void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %11)
          to label %27 unwind label %48

27:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %12) #9
  invoke void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %12)
          to label %28 unwind label %50

28:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %13) #9
  invoke void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %13)
          to label %29 unwind label %52

29:                                               ; preds = %28
  %30 = getelementptr inbounds i8, ptr %0, i64 64
  %31 = load double, ptr %30, align 8, !tbaa !15
  %32 = fdiv double 1.000000e+00, %31
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %14) #9
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %14)
  %33 = getelementptr inbounds i8, ptr %0, i64 72
  invoke void @_ZN6Grid3d26getNeighbourGridIndices124EiiiP9GridIndex(i32 noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef nonnull %33)
          to label %.preheader unwind label %54

.preheader:                                       ; preds = %29
  %34 = getelementptr inbounds i8, ptr %14, i64 4
  %35 = getelementptr inbounds i8, ptr %14, i64 8
  %36 = getelementptr inbounds i8, ptr %0, i64 40
  %37 = getelementptr inbounds i8, ptr %0, i64 44
  %38 = getelementptr inbounds i8, ptr %0, i64 48
  br label %56

39:                                               ; preds = %109
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %14) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %13) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %12) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %11) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %10) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %6) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #9
  ret double %.1

40:                                               ; preds = %5
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %117

42:                                               ; preds = %23
  %43 = landingpad { ptr, i32 }
          cleanup
  br label %116

44:                                               ; preds = %24
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %115

46:                                               ; preds = %25
  %47 = landingpad { ptr, i32 }
          cleanup
  br label %114

48:                                               ; preds = %26
  %49 = landingpad { ptr, i32 }
          cleanup
  br label %113

50:                                               ; preds = %27
  %51 = landingpad { ptr, i32 }
          cleanup
  br label %112

52:                                               ; preds = %28
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %111

54:                                               ; preds = %29
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %110

56:                                               ; preds = %.preheader, %109
  %indvars.iv = phi i64 [ 0, %.preheader ], [ %indvars.iv.next, %109 ]
  %.02553 = phi double [ 0.000000e+00, %.preheader ], [ %.1, %109 ]
  %57 = getelementptr inbounds [124 x %struct.GridIndex], ptr %33, i64 0, i64 %indvars.iv
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %14, ptr noundef nonnull align 4 dereferenceable(12) %57, i64 12, i1 false), !tbaa.struct !16
  %58 = load i32, ptr %14, align 4, !tbaa !18
  %59 = load i32, ptr %34, align 4, !tbaa !20
  %60 = load i32, ptr %35, align 4, !tbaa !21
  %61 = load i32, ptr %36, align 8, !tbaa !22
  %62 = load i32, ptr %37, align 4, !tbaa !23
  %63 = load i32, ptr %38, align 8, !tbaa !24
  %64 = call noundef zeroext i1 @_ZN6Grid3d18isGridIndexInRangeEiiiiii(i32 noundef %58, i32 noundef %59, i32 noundef %60, i32 noundef %61, i32 noundef %62, i32 noundef %63)
  br i1 %64, label %65, label %109

65:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %15) #9
  %66 = load i32, ptr %14, align 4, !tbaa !18
  %67 = load i32, ptr %34, align 4, !tbaa !20
  %68 = load i32, ptr %35, align 4, !tbaa !21
  invoke void @_ZN7Array3dIN5vmath4vec3EEclEiii(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %15, ptr noundef nonnull align 8 dereferenceable(44) %4, i32 noundef %66, i32 noundef %67, i32 noundef %68)
          to label %69 unwind label %78

69:                                               ; preds = %65
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(12) %15, i64 12, i1 false), !tbaa.struct !25
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %15) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %15) #9
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %16) #9
  invoke void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %16, ptr noundef nonnull align 4 dereferenceable(12) %6, ptr noundef nonnull align 4 dereferenceable(12) %8)
          to label %70 unwind label %80

70:                                               ; preds = %69
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %16, i64 12, i1 false), !tbaa.struct !25
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %16) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %16) #9
  %71 = invoke noundef float @_ZN5vmath6lengthERKNS_4vec3E(ptr noundef nonnull align 4 dereferenceable(12) %9)
          to label %72 unwind label %76

72:                                               ; preds = %70
  %73 = fpext float %71 to double
  %74 = call double @llvm.fabs.f64(double %73)
  %75 = fcmp olt double %74, 1.000000e-05
  br i1 %75, label %109, label %82

76:                                               ; preds = %89, %70
  %77 = landingpad { ptr, i32 }
          cleanup
  br label %110

78:                                               ; preds = %65
  %79 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %15) #9
  br label %110

80:                                               ; preds = %69
  %81 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %16) #9
  br label %110

82:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %17) #9
  invoke void @_ZN5vmathdvERKNS_4vec3Ef(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %17, ptr noundef nonnull align 4 dereferenceable(12) %9, float noundef %71)
          to label %83 unwind label %101

83:                                               ; preds = %82
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %17, i64 12, i1 false), !tbaa.struct !25
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %17) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %17) #9
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %18) #9
  %84 = load i32, ptr %14, align 4, !tbaa !18
  %85 = load i32, ptr %34, align 4, !tbaa !20
  %86 = load i32, ptr %35, align 4, !tbaa !21
  %87 = load double, ptr %21, align 8, !tbaa !5
  invoke void @_ZN6Grid3d21GridIndexToCellCenterEiiid(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %18, i32 noundef %84, i32 noundef %85, i32 noundef %86, double noundef %87)
          to label %88 unwind label %103

88:                                               ; preds = %83
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %11, ptr noundef nonnull align 4 dereferenceable(12) %18, i64 12, i1 false), !tbaa.struct !25
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %18) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %18) #9
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %19) #9
  invoke void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %19, ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %11)
          to label %89 unwind label %105

89:                                               ; preds = %88
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef nonnull align 4 dereferenceable(12) %19, i64 12, i1 false), !tbaa.struct !25
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %19) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %19) #9
  %90 = invoke noundef float @_ZN5vmath6lengthERKNS_4vec3E(ptr noundef nonnull align 4 dereferenceable(12) %12)
          to label %91 unwind label %76

91:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %20) #9
  invoke void @_ZN5vmathdvERKNS_4vec3Ef(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %20, ptr noundef nonnull align 4 dereferenceable(12) %12, float noundef %90)
          to label %92 unwind label %107

92:                                               ; preds = %91
  %93 = fpext float %90 to double
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %13, ptr noundef nonnull align 4 dereferenceable(12) %20, i64 12, i1 false), !tbaa.struct !25
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %20) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %20) #9
  %94 = call noundef float @_ZN5vmath3dotERKNS_4vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %13)
  %95 = fpext float %94 to double
  %96 = fsub double 1.000000e+00, %95
  %97 = fmul double %96, %73
  %98 = fneg double %93
  %99 = call double @llvm.fmuladd.f64(double %98, double %32, double 1.000000e+00)
  %100 = call double @llvm.fmuladd.f64(double %97, double %99, double %.02553)
  br label %109

101:                                              ; preds = %82
  %102 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %17) #9
  br label %110

103:                                              ; preds = %83
  %104 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %18) #9
  br label %110

105:                                              ; preds = %88
  %106 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %19) #9
  br label %110

107:                                              ; preds = %91
  %108 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %20) #9
  br label %110

109:                                              ; preds = %56, %92, %72
  %.1 = phi double [ %.02553, %72 ], [ %100, %92 ], [ %.02553, %56 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 124
  br i1 %exitcond.not, label %39, label %56, !llvm.loop !27

110:                                              ; preds = %76, %78, %80, %101, %103, %105, %107, %54
  %.pn.pn = phi { ptr, i32 } [ %55, %54 ], [ %108, %107 ], [ %77, %76 ], [ %106, %105 ], [ %104, %103 ], [ %102, %101 ], [ %81, %80 ], [ %79, %78 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %14) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %13) #9
  br label %111

111:                                              ; preds = %110, %52
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %110 ], [ %53, %52 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %12) #9
  br label %112

112:                                              ; preds = %111, %50
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %111 ], [ %51, %50 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %11) #9
  br label %113

113:                                              ; preds = %112, %48
  %.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn, %112 ], [ %49, %48 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %10) #9
  br label %114

114:                                              ; preds = %113, %46
  %.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn.pn, %113 ], [ %47, %46 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #9
  br label %115

115:                                              ; preds = %114, %44
  %.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn.pn.pn, %114 ], [ %45, %44 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #9
  br label %116

116:                                              ; preds = %115, %42
  %.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn.pn.pn.pn, %115 ], [ %43, %42 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %7) #9
  br label %117

117:                                              ; preds = %116, %40
  %.pn.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn.pn.pn.pn.pn, %116 ], [ %41, %40 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %6) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #9
  resume { ptr, i32 } %.pn.pn.pn.pn.pn.pn.pn.pn.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Array3dIN5vmath4vec3EEclEiii(ptr dead_on_unwind noalias writable sret(%"class.vmath::vec3") align 4, ptr noundef nonnull align 8 dereferenceable(44), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6Grid3d21GridIndexToCellCenterEiiid(ptr dead_on_unwind noalias writable sret(%"class.vmath::vec3") align 4, i32 noundef, i32 noundef, i32 noundef, double noundef) local_unnamed_addr #6

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

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

declare void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef float @_ZN5vmath6lengthERKNS_4vec3E(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #6

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

declare void @_ZN5vmathdvERKNS_4vec3Ef(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4, ptr noundef nonnull align 4 dereferenceable(12), float noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZN5vmath3dotERKNS_4vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #7

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 #8 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { 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, !14, i64 56}
!6 = !{!"_ZTS15TurbulenceField", !7, i64 0, !8, i64 40, !8, i64 44, !8, i64 48, !14, i64 56, !14, i64 64, !9, i64 72}
!7 = !{!"_ZTS7Array3dIfE", !8, i64 0, !8, i64 4, !8, i64 8, !11, i64 16, !12, i64 24, !13, i64 28, !8, i64 32}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!"bool", !9, i64 0}
!13 = !{!"float", !9, i64 0}
!14 = !{!"double", !9, i64 0}
!15 = !{!6, !14, i64 64}
!16 = !{i64 0, i64 4, !17, i64 4, i64 4, !17, i64 8, i64 4, !17}
!17 = !{!8, !8, i64 0}
!18 = !{!19, !8, i64 0}
!19 = !{!"_ZTS9GridIndex", !8, i64 0, !8, i64 4, !8, i64 8}
!20 = !{!19, !8, i64 4}
!21 = !{!19, !8, i64 8}
!22 = !{!6, !8, i64 40}
!23 = !{!6, !8, i64 44}
!24 = !{!6, !8, i64 48}
!25 = !{i64 0, i64 4, !26, i64 4, i64 4, !26, i64 8, i64 4, !26}
!26 = !{!13, !13, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}


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