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

; 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.vmath::mat3" = type { [9 x 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 }

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: 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) #4

declare noundef nonnull align 4 dereferenceable(12) ptr @_ZN5vmathmIERNS_4vec3ERKS0_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #0

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

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

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)) #0

; 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: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN11ScalarField46_evaluateTricubicFieldFunctionForRadiusSquaredEd(ptr noundef nonnull align 8 dereferenceable(248), double noundef) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11ScalarField19addScalarFieldValueEiiid(ptr noundef nonnull align 8 dereferenceable(248), i32 noundef, i32 noundef, i32 noundef, double noundef) #3 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11ScalarField12addEllipsoidEN5vmath4vec3ENS0_4mat3E(ptr noundef nonnull align 8 dereferenceable(248) %0, ptr noundef %1, ptr noundef %2) #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %struct.GridIndex, align 4
  %8 = alloca %struct.GridIndex, align 4
  %9 = alloca %"class.vmath::vec3", align 4
  %10 = alloca %"class.vmath::mat3", align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca %"class.vmath::vec3", align 4
  %14 = alloca %"class.vmath::vec3", align 4
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca %"class.vmath::vec3", align 4
  %23 = alloca %"class.vmath::vec3", align 4
  %24 = alloca %"class.vmath::vec3", align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %25 = load ptr, ptr %4, align 8
  %26 = getelementptr inbounds %class.ScalarField, ptr %25, i32 0, i32 18
  %27 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5vmathmIERNS_4vec3ERKS0_(ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %26)
  call void @llvm.lifetime.start.p0(i64 12, ptr %7) #8
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %7)
  call void @llvm.lifetime.start.p0(i64 12, ptr %8) #8
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %8)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %1, i64 12, i1 false), !tbaa.struct !9
  %28 = getelementptr inbounds %class.ScalarField, ptr %25, i32 0, i32 4
  %29 = load double, ptr %28, align 8, !tbaa !12
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %2, i64 36, i1 false), !tbaa.struct !20
  %30 = getelementptr inbounds %class.ScalarField, ptr %25, i32 0, i32 3
  %31 = load double, ptr %30, align 8, !tbaa !22
  %32 = getelementptr inbounds %class.ScalarField, ptr %25, i32 0, i32 0
  %33 = load i32, ptr %32, align 8, !tbaa !23
  %34 = getelementptr inbounds %class.ScalarField, ptr %25, i32 0, i32 1
  %35 = load i32, ptr %34, align 4, !tbaa !24
  %36 = getelementptr inbounds %class.ScalarField, ptr %25, i32 0, i32 2
  %37 = load i32, ptr %36, align 8, !tbaa !25
  invoke void @_ZN6Grid3d18getGridIndexBoundsEN5vmath4vec3EdNS0_4mat3EdiiiP9GridIndexS4_(ptr noundef %9, double noundef %29, ptr noundef %10, double noundef %31, i32 noundef %33, i32 noundef %35, i32 noundef %37, ptr noundef %7, ptr noundef %8)
          to label %38 unwind label %53

38:                                               ; preds = %3
  call void @_ZN5vmath4mat3D1Ev(ptr noundef nonnull align 4 dereferenceable(36) %10) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr %13) #8
  call void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %13)
  call void @llvm.lifetime.start.p0(i64 12, ptr %14) #8
  invoke void @_ZN5vmath4vec3C1Ev(ptr noundef nonnull align 4 dereferenceable(12) %14)
          to label %39 unwind label %57

39:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %40 = getelementptr inbounds %class.ScalarField, ptr %25, i32 0, i32 4
  %41 = load double, ptr %40, align 8, !tbaa !12
  %42 = getelementptr inbounds %class.ScalarField, ptr %25, i32 0, i32 4
  %43 = load double, ptr %42, align 8, !tbaa !12
  %44 = fmul double %41, %43
  store double %44, ptr %15, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  %45 = getelementptr inbounds %struct.GridIndex, ptr %7, i32 0, i32 2
  %46 = load i32, ptr %45, align 4, !tbaa !27
  store i32 %46, ptr %18, align 4, !tbaa !29
  br label %47

47:                                               ; preds = %157, %39
  %48 = load i32, ptr %18, align 4, !tbaa !29
  %49 = getelementptr inbounds %struct.GridIndex, ptr %8, i32 0, i32 2
  %50 = load i32, ptr %49, align 4, !tbaa !27
  %51 = icmp sle i32 %48, %50
  br i1 %51, label %61, label %52

52:                                               ; preds = %47
  store i32 2, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %160

53:                                               ; preds = %3
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %11, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %12, align 4
  call void @_ZN5vmath4mat3D1Ev(ptr noundef nonnull align 4 dereferenceable(36) %10) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #8
  br label %162

57:                                               ; preds = %38
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %11, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %12, align 4
  br label %161

61:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  %62 = getelementptr inbounds %struct.GridIndex, ptr %7, i32 0, i32 1
  %63 = load i32, ptr %62, align 4, !tbaa !30
  store i32 %63, ptr %20, align 4, !tbaa !29
  br label %64

64:                                               ; preds = %153, %61
  %65 = load i32, ptr %20, align 4, !tbaa !29
  %66 = getelementptr inbounds %struct.GridIndex, ptr %8, i32 0, i32 1
  %67 = load i32, ptr %66, align 4, !tbaa !30
  %68 = icmp sle i32 %65, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %64
  store i32 5, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  br label %156

70:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  %71 = getelementptr inbounds %struct.GridIndex, ptr %7, i32 0, i32 0
  %72 = load i32, ptr %71, align 4, !tbaa !31
  store i32 %72, ptr %21, align 4, !tbaa !29
  br label %73

73:                                               ; preds = %148, %70
  %74 = load i32, ptr %21, align 4, !tbaa !29
  %75 = getelementptr inbounds %struct.GridIndex, ptr %8, i32 0, i32 0
  %76 = load i32, ptr %75, align 4, !tbaa !31
  %77 = icmp sle i32 %74, %76
  br i1 %77, label %79, label %78

78:                                               ; preds = %73
  store i32 8, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %152

79:                                               ; preds = %73
  %80 = getelementptr inbounds %class.ScalarField, ptr %25, i32 0, i32 11
  %81 = load i8, ptr %80, align 8, !tbaa !32, !range !33, !noundef !34
  %82 = trunc i8 %81 to i1
  br i1 %82, label %83, label %99

83:                                               ; preds = %79
  %84 = getelementptr inbounds %class.ScalarField, ptr %25, i32 0, i32 13
  %85 = load i32, ptr %21, align 4, !tbaa !29
  %86 = load i32, ptr %20, align 4, !tbaa !29
  %87 = load i32, ptr %18, align 4, !tbaa !29
  %88 = invoke noundef float @_ZN7Array3dIfEclEiii(ptr noundef nonnull align 8 dereferenceable(36) %84, i32 noundef %85, i32 noundef %86, i32 noundef %87)
          to label %89 unwind label %95

89:                                               ; preds = %83
  %90 = fpext float %88 to double
  %91 = getelementptr inbounds %class.ScalarField, ptr %25, i32 0, i32 10
  %92 = load double, ptr %91, align 8, !tbaa !35
  %93 = fcmp ogt double %90, %92
  br i1 %93, label %94, label %99

94:                                               ; preds = %89
  br label %148

95:                                               ; preds = %126, %117, %114, %107, %83
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %11, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %12, align 4
  br label %151

99:                                               ; preds = %89, %79
  call void @llvm.lifetime.start.p0(i64 12, ptr %22) #8
  %100 = load i32, ptr %21, align 4, !tbaa !29
  %101 = load i32, ptr %20, align 4, !tbaa !29
  %102 = load i32, ptr %18, align 4, !tbaa !29
  %103 = getelementptr inbounds %class.ScalarField, ptr %25, i32 0, i32 3
  %104 = load double, ptr %103, align 8, !tbaa !22
  invoke void @_ZN6Grid3d19GridIndexToPositionEiiid(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %22, i32 noundef %100, i32 noundef %101, i32 noundef %102, double noundef %104)
          to label %105 unwind label %134

105:                                              ; preds = %99
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %22, i64 12, i1 false), !tbaa.struct !9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %22) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %22) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr %23) #8
  invoke void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %23, ptr noundef nonnull align 4 dereferenceable(12) %13, ptr noundef nonnull align 4 dereferenceable(12) %1)
          to label %106 unwind label %138

106:                                              ; preds = %105
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %23, i64 12, i1 false), !tbaa.struct !9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %23) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %23) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr %24) #8
  invoke void @_ZN5vmathmlERKNS_4mat3ERKNS_4vec3E(ptr dead_on_unwind writable sret(%"class.vmath::vec3") align 4 %24, ptr noundef nonnull align 4 dereferenceable(36) %2, ptr noundef nonnull align 4 dereferenceable(12) %14)
          to label %107 unwind label %142

107:                                              ; preds = %106
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %24, i64 12, i1 false), !tbaa.struct !9
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %24) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %24) #8
  %108 = invoke noundef float @_ZN5vmath3dotERKNS_4vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %14, ptr noundef nonnull align 4 dereferenceable(12) %14)
          to label %109 unwind label %95

109:                                              ; preds = %107
  %110 = fpext float %108 to double
  store double %110, ptr %16, align 8, !tbaa !26
  %111 = load double, ptr %16, align 8, !tbaa !26
  %112 = load double, ptr %15, align 8, !tbaa !26
  %113 = fcmp olt double %111, %112
  br i1 %113, label %114, label %147

114:                                              ; preds = %109
  %115 = load double, ptr %16, align 8, !tbaa !26
  %116 = invoke noundef double @_ZN11ScalarField46_evaluateTricubicFieldFunctionForRadiusSquaredEd(ptr noundef nonnull align 8 dereferenceable(248) %25, double noundef %115)
          to label %117 unwind label %95

117:                                              ; preds = %114
  store double %116, ptr %17, align 8, !tbaa !26
  %118 = load i32, ptr %21, align 4, !tbaa !29
  %119 = load i32, ptr %20, align 4, !tbaa !29
  %120 = load i32, ptr %18, align 4, !tbaa !29
  %121 = load double, ptr %17, align 8, !tbaa !26
  invoke void @_ZN11ScalarField19addScalarFieldValueEiiid(ptr noundef nonnull align 8 dereferenceable(248) %25, i32 noundef %118, i32 noundef %119, i32 noundef %120, double noundef %121)
          to label %122 unwind label %95

122:                                              ; preds = %117
  %123 = getelementptr inbounds %class.ScalarField, ptr %25, i32 0, i32 17
  %124 = load i8, ptr %123, align 8, !tbaa !36, !range !33, !noundef !34
  %125 = trunc i8 %124 to i1
  br i1 %125, label %126, label %146

126:                                              ; preds = %122
  %127 = getelementptr inbounds %class.ScalarField, ptr %25, i32 0, i32 15
  %128 = load i32, ptr %21, align 4, !tbaa !29
  %129 = load i32, ptr %20, align 4, !tbaa !29
  %130 = load i32, ptr %18, align 4, !tbaa !29
  %131 = load double, ptr %17, align 8, !tbaa !26
  %132 = fptrunc double %131 to float
  invoke void @_ZN7Array3dIfE3addEiiif(ptr noundef nonnull align 8 dereferenceable(36) %127, i32 noundef %128, i32 noundef %129, i32 noundef %130, float noundef %132)
          to label %133 unwind label %95

133:                                              ; preds = %126
  br label %146

134:                                              ; preds = %99
  %135 = landingpad { ptr, i32 }
          cleanup
  %136 = extractvalue { ptr, i32 } %135, 0
  store ptr %136, ptr %11, align 8
  %137 = extractvalue { ptr, i32 } %135, 1
  store i32 %137, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %22) #8
  br label %151

138:                                              ; preds = %105
  %139 = landingpad { ptr, i32 }
          cleanup
  %140 = extractvalue { ptr, i32 } %139, 0
  store ptr %140, ptr %11, align 8
  %141 = extractvalue { ptr, i32 } %139, 1
  store i32 %141, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %23) #8
  br label %151

142:                                              ; preds = %106
  %143 = landingpad { ptr, i32 }
          cleanup
  %144 = extractvalue { ptr, i32 } %143, 0
  store ptr %144, ptr %11, align 8
  %145 = extractvalue { ptr, i32 } %143, 1
  store i32 %145, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %24) #8
  br label %151

146:                                              ; preds = %133, %122
  br label %147

147:                                              ; preds = %146, %109
  br label %148

148:                                              ; preds = %147, %94
  %149 = load i32, ptr %21, align 4, !tbaa !29
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %21, align 4, !tbaa !29
  br label %73, !llvm.loop !37

151:                                              ; preds = %142, %138, %134, %95
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %14) #8
  br label %161

152:                                              ; preds = %78
  br label %153

153:                                              ; preds = %152
  %154 = load i32, ptr %20, align 4, !tbaa !29
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %20, align 4, !tbaa !29
  br label %64, !llvm.loop !39

156:                                              ; preds = %69
  br label %157

157:                                              ; preds = %156
  %158 = load i32, ptr %18, align 4, !tbaa !29
  %159 = add nsw i32 %158, 1
  store i32 %159, ptr %18, align 4, !tbaa !29
  br label %47, !llvm.loop !40

160:                                              ; preds = %52
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %14) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %13) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %7) #8
  ret void

161:                                              ; preds = %151, %57
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %13) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #8
  br label %162

162:                                              ; preds = %161, %53
  call void @llvm.lifetime.end.p0(i64 12, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %7) #8
  br label %163

163:                                              ; preds = %162
  %164 = load ptr, ptr %11, align 8
  %165 = load i32, ptr %12, align 4
  %166 = insertvalue { ptr, i32 } poison, ptr %164, 0
  %167 = insertvalue { ptr, i32 } %166, i32 %165, 1
  resume { ptr, i32 } %167
}

; Function Attrs: nounwind
declare void @_ZN5vmath4mat3D1Ev(ptr noundef nonnull align 4 dereferenceable(36)) unnamed_addr #1

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{i64 0, i64 4, !10, i64 4, i64 4, !10, i64 8, i64 4, !10}
!10 = !{!11, !11, i64 0}
!11 = !{!"float", !7, i64 0}
!12 = !{!13, !15, i64 24}
!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, !18, i64 128, !17, i64 160, !18, i64 200, !16, i64 232, !19, i64 236}
!14 = !{!"int", !7, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"_ZTS7Array3dIfE", !14, i64 0, !14, i64 4, !14, i64 8, !6, i64 16, !16, i64 24, !11, i64 28, !14, i64 32}
!18 = !{!"_ZTS7Array3dIbE", !14, i64 0, !14, i64 4, !14, i64 8, !6, i64 16, !16, i64 24, !16, i64 25, !14, i64 28}
!19 = !{!"_ZTSN5vmath4vec3E", !11, i64 0, !11, i64 4, !11, i64 8}
!20 = !{i64 0, i64 36, !21}
!21 = !{!7, !7, i64 0}
!22 = !{!13, !15, i64 16}
!23 = !{!13, !14, i64 0}
!24 = !{!13, !14, i64 4}
!25 = !{!13, !14, i64 8}
!26 = !{!15, !15, i64 0}
!27 = !{!28, !14, i64 8}
!28 = !{!"_ZTS9GridIndex", !14, i64 0, !14, i64 4, !14, i64 8}
!29 = !{!14, !14, i64 0}
!30 = !{!28, !14, i64 4}
!31 = !{!28, !14, i64 0}
!32 = !{!13, !16, i64 80}
!33 = !{i8 0, i8 2}
!34 = !{}
!35 = !{!13, !15, i64 72}
!36 = !{!13, !16, i64 232}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = distinct !{!39, !38}
!40 = distinct !{!40, !38}


; 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 }
%"class.vmath::mat3" = type { [9 x float] }

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: mustprogress 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) #4

declare noundef nonnull align 4 dereferenceable(12) ptr @_ZN5vmathmIERNS_4vec3ERKS0_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0

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

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

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 #0

; 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 nounwind uwtable
declare dso_local noundef double @_ZN11ScalarField46_evaluateTricubicFieldFunctionForRadiusSquaredEd(ptr noundef nonnull align 8 dereferenceable(248), double noundef) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11ScalarField19addScalarFieldValueEiiid(ptr noundef nonnull align 8 dereferenceable(248), i32 noundef, i32 noundef, i32 noundef, double noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11ScalarField12addEllipsoidEN5vmath4vec3ENS0_4mat3E(ptr noundef nonnull align 8 dereferenceable(248) %0, ptr noundef nonnull %1, ptr noundef %2) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %struct.GridIndex, align 4
  %5 = alloca %struct.GridIndex, align 4
  %6 = alloca %"class.vmath::vec3", align 4
  %7 = alloca %"class.vmath::mat3", 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 = getelementptr inbounds i8, ptr %0, i64 236
  %14 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZN5vmathmIERNS_4vec3ERKS0_(ptr noundef nonnull align 4 dereferenceable(12) %1, ptr noundef nonnull align 4 dereferenceable(12) %13)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #8
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %4)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #8
  call void @_ZN9GridIndexC2Ev(ptr noundef nonnull align 4 dereferenceable(12) %5)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %6, ptr noundef nonnull align 4 dereferenceable(12) %1, i64 12, i1 false), !tbaa.struct !5
  %15 = getelementptr inbounds i8, ptr %0, i64 24
  %16 = load double, ptr %15, align 8, !tbaa !10
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(36) %7, ptr noundef nonnull align 4 dereferenceable(36) %2, i64 36, i1 false), !tbaa.struct !19
  %17 = getelementptr inbounds i8, ptr %0, i64 16
  %18 = load double, ptr %17, align 8, !tbaa !21
  %19 = load i32, ptr %0, align 8, !tbaa !22
  %20 = getelementptr inbounds i8, ptr %0, i64 4
  %21 = load i32, ptr %20, align 4, !tbaa !23
  %22 = getelementptr inbounds i8, ptr %0, i64 8
  %23 = load i32, ptr %22, align 8, !tbaa !24
  invoke void @_ZN6Grid3d18getGridIndexBoundsEN5vmath4vec3EdNS0_4mat3EdiiiP9GridIndexS4_(ptr noundef nonnull %6, double noundef %16, ptr noundef nonnull %7, double noundef %18, i32 noundef %19, i32 noundef %21, i32 noundef %23, ptr noundef nonnull %4, ptr noundef nonnull %5)
          to label %24 unwind label %42

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

25:                                               ; preds = %24
  %26 = load double, ptr %15, align 8, !tbaa !10
  %27 = fmul double %26, %26
  %28 = getelementptr inbounds i8, ptr %4, i64 8
  %29 = load i32, ptr %28, align 4, !tbaa !25
  %30 = getelementptr inbounds i8, ptr %5, i64 8
  %31 = load i32, ptr %30, align 4, !tbaa !25
  %.not44 = icmp sgt i32 %29, %31
  br i1 %.not44, label %._crit_edge49, label %.lr.ph48

.lr.ph48:                                         ; preds = %25
  %32 = getelementptr inbounds i8, ptr %4, i64 4
  %33 = getelementptr inbounds i8, ptr %5, i64 4
  %34 = getelementptr inbounds i8, ptr %0, i64 80
  %35 = getelementptr inbounds i8, ptr %0, i64 88
  %36 = getelementptr inbounds i8, ptr %0, i64 72
  %37 = getelementptr inbounds i8, ptr %0, i64 232
  %38 = getelementptr inbounds i8, ptr %0, i64 160
  %39 = load i32, ptr %32, align 4, !tbaa !27
  %40 = load i32, ptr %33, align 4, !tbaa !27
  %41 = icmp sgt i32 %39, %40
  br i1 %41, label %._crit_edge49, label %.lr.ph48.split

._crit_edge49:                                    ; preds = %._crit_edge43, %.lr.ph48, %25
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %8) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #8
  ret void

42:                                               ; preds = %3
  %43 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN5vmath4mat3D1Ev(ptr noundef nonnull align 4 dereferenceable(36) %7) #8
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %6) #8
  br label %99

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

.lr.ph48.split:                                   ; preds = %.lr.ph48, %._crit_edge43
  %46 = phi i32 [ %53, %._crit_edge43 ], [ %31, %.lr.ph48 ]
  %47 = phi i32 [ %54, %._crit_edge43 ], [ %40, %.lr.ph48 ]
  %48 = phi i32 [ %55, %._crit_edge43 ], [ %40, %.lr.ph48 ]
  %.02645 = phi i32 [ %56, %._crit_edge43 ], [ %29, %.lr.ph48 ]
  %49 = load i32, ptr %32, align 4, !tbaa !27
  %.not3239 = icmp sgt i32 %49, %48
  br i1 %.not3239, label %._crit_edge43, label %.lr.ph42

.lr.ph42:                                         ; preds = %.lr.ph48.split
  %50 = load i32, ptr %4, align 4, !tbaa !28
  %51 = load i32, ptr %5, align 4, !tbaa !28
  %52 = icmp sgt i32 %50, %51
  br i1 %52, label %._crit_edge43, label %.lr.ph42.split

._crit_edge43.loopexit50:                         ; preds = %._crit_edge
  %.pre52 = load i32, ptr %30, align 4, !tbaa !25
  br label %._crit_edge43

._crit_edge43:                                    ; preds = %.lr.ph42, %._crit_edge43.loopexit50, %.lr.ph48.split
  %53 = phi i32 [ %.pre52, %._crit_edge43.loopexit50 ], [ %46, %.lr.ph48.split ], [ %46, %.lr.ph42 ]
  %54 = phi i32 [ %60, %._crit_edge43.loopexit50 ], [ %47, %.lr.ph48.split ], [ %47, %.lr.ph42 ]
  %55 = phi i32 [ %60, %._crit_edge43.loopexit50 ], [ %48, %.lr.ph48.split ], [ %48, %.lr.ph42 ]
  %56 = add nsw i32 %.02645, 1
  %.not.not = icmp slt i32 %.02645, %53
  br i1 %.not.not, label %.lr.ph48.split, label %._crit_edge49, !llvm.loop !29

.lr.ph42.split:                                   ; preds = %.lr.ph42, %._crit_edge
  %57 = phi i32 [ %60, %._crit_edge ], [ %47, %.lr.ph42 ]
  %58 = phi i32 [ %61, %._crit_edge ], [ %51, %.lr.ph42 ]
  %.02540 = phi i32 [ %62, %._crit_edge ], [ %49, %.lr.ph42 ]
  %59 = load i32, ptr %4, align 4, !tbaa !28
  %.not3337 = icmp sgt i32 %59, %58
  br i1 %.not3337, label %._crit_edge, label %.lr.ph

._crit_edge.loopexit:                             ; preds = %94
  %.pre = load i32, ptr %33, align 4, !tbaa !27
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.lr.ph42.split
  %60 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %57, %.lr.ph42.split ]
  %61 = phi i32 [ %96, %._crit_edge.loopexit ], [ %58, %.lr.ph42.split ]
  %62 = add nsw i32 %.02540, 1
  %.not32.not = icmp slt i32 %.02540, %60
  br i1 %.not32.not, label %.lr.ph42.split, label %._crit_edge43.loopexit50, !llvm.loop !32

.lr.ph:                                           ; preds = %.lr.ph42.split, %94
  %.038 = phi i32 [ %95, %94 ], [ %59, %.lr.ph42.split ]
  %63 = load i8, ptr %34, align 8, !tbaa !33, !range !34, !noundef !35
  %64 = trunc nuw i8 %63 to i1
  br i1 %64, label %65, label %73

65:                                               ; preds = %.lr.ph
  %66 = invoke noundef float @_ZN7Array3dIfEclEiii(ptr noundef nonnull align 8 dereferenceable(36) %35, i32 noundef %.038, i32 noundef %.02540, i32 noundef %.02645)
          to label %67 unwind label %71

67:                                               ; preds = %65
  %68 = fpext float %66 to double
  %69 = load double, ptr %36, align 8, !tbaa !36
  %70 = fcmp olt double %69, %68
  br i1 %70, label %94, label %73

71:                                               ; preds = %86, %81, %65
  %72 = landingpad { ptr, i32 }
          cleanup
  br label %97

73:                                               ; preds = %67, %.lr.ph
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #8
  %74 = load double, ptr %17, align 8, !tbaa !21
  invoke void @_ZN6Grid3d19GridIndexToPositionEiiid(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %10, i32 noundef %.038, i32 noundef %.02540, i32 noundef %.02645, double noundef %74)
          to label %75 unwind label %88

75:                                               ; preds = %73
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(12) %10, i64 12, i1 false), !tbaa.struct !5
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %10) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %11) #8
  invoke void @_ZN5vmathmiERKNS_4vec3ES2_(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %11, ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(12) %1)
          to label %76 unwind label %90

76:                                               ; preds = %75
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %11, i64 12, i1 false), !tbaa.struct !5
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %11) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %12) #8
  invoke void @_ZN5vmathmlERKNS_4mat3ERKNS_4vec3E(ptr dead_on_unwind nonnull writable sret(%"class.vmath::vec3") align 4 %12, ptr noundef nonnull align 4 dereferenceable(36) %2, ptr noundef nonnull align 4 dereferenceable(12) %9)
          to label %77 unwind label %92

77:                                               ; preds = %76
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %12, i64 12, i1 false), !tbaa.struct !5
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %12) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #8
  %78 = call noundef float @_ZN5vmath3dotERKNS_4vec3ES2_(ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %9)
  %79 = fpext float %78 to double
  %80 = fcmp ogt double %27, %79
  br i1 %80, label %81, label %94

81:                                               ; preds = %77
  %82 = call noundef double @_ZN11ScalarField46_evaluateTricubicFieldFunctionForRadiusSquaredEd(ptr noundef nonnull align 8 dereferenceable(248) %0, double noundef %79)
  invoke void @_ZN11ScalarField19addScalarFieldValueEiiid(ptr noundef nonnull align 8 dereferenceable(248) %0, i32 noundef %.038, i32 noundef %.02540, i32 noundef %.02645, double noundef %82)
          to label %83 unwind label %71

83:                                               ; preds = %81
  %84 = load i8, ptr %37, align 8, !tbaa !37, !range !34, !noundef !35
  %85 = trunc nuw i8 %84 to i1
  br i1 %85, label %86, label %94

86:                                               ; preds = %83
  %87 = fptrunc double %82 to float
  invoke void @_ZN7Array3dIfE3addEiiif(ptr noundef nonnull align 8 dereferenceable(36) %38, i32 noundef %.038, i32 noundef %.02540, i32 noundef %.02645, float noundef %87)
          to label %94 unwind label %71

88:                                               ; preds = %73
  %89 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #8
  br label %97

90:                                               ; preds = %75
  %91 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #8
  br label %97

92:                                               ; preds = %76
  %93 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #8
  br label %97

94:                                               ; preds = %77, %86, %83, %67
  %95 = add nsw i32 %.038, 1
  %96 = load i32, ptr %5, align 4, !tbaa !28
  %.not33.not = icmp slt i32 %.038, %96
  br i1 %.not33.not, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !38

97:                                               ; preds = %92, %90, %88, %71
  %.pn = phi { ptr, i32 } [ %72, %71 ], [ %93, %92 ], [ %91, %90 ], [ %89, %88 ]
  call void @_ZN5vmath4vec3D1Ev(ptr noundef nonnull align 4 dereferenceable(12) %9) #8
  br label %98

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

99:                                               ; preds = %98, %42
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %98 ], [ %43, %42 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #8
  resume { ptr, i32 } %.pn.pn.pn
}

; Function Attrs: nounwind
declare void @_ZN5vmath4mat3D1Ev(ptr noundef nonnull align 4 dereferenceable(36)) unnamed_addr #1

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{i64 0, i64 4, !6, i64 4, i64 4, !6, i64 8, i64 4, !6}
!6 = !{!7, !7, i64 0}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !13, i64 24}
!11 = !{!"_ZTS11ScalarField", !12, i64 0, !12, i64 4, !12, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !13, i64 72, !14, i64 80, !15, i64 88, !17, i64 128, !15, i64 160, !17, i64 200, !14, i64 232, !18, i64 236}
!12 = !{!"int", !8, i64 0}
!13 = !{!"double", !8, i64 0}
!14 = !{!"bool", !8, i64 0}
!15 = !{!"_ZTS7Array3dIfE", !12, i64 0, !12, i64 4, !12, i64 8, !16, i64 16, !14, i64 24, !7, i64 28, !12, i64 32}
!16 = !{!"any pointer", !8, i64 0}
!17 = !{!"_ZTS7Array3dIbE", !12, i64 0, !12, i64 4, !12, i64 8, !16, i64 16, !14, i64 24, !14, i64 25, !12, i64 28}
!18 = !{!"_ZTSN5vmath4vec3E", !7, i64 0, !7, i64 4, !7, i64 8}
!19 = !{i64 0, i64 36, !20}
!20 = !{!8, !8, i64 0}
!21 = !{!11, !13, i64 16}
!22 = !{!11, !12, i64 0}
!23 = !{!11, !12, i64 4}
!24 = !{!11, !12, i64 8}
!25 = !{!26, !12, i64 8}
!26 = !{!"_ZTS9GridIndex", !12, i64 0, !12, i64 4, !12, i64 8}
!27 = !{!26, !12, i64 4}
!28 = !{!26, !12, i64 0}
!29 = distinct !{!29, !30, !31}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!"llvm.loop.unswitch.partial.disable"}
!32 = distinct !{!32, !30, !31}
!33 = !{!11, !14, i64 80}
!34 = !{i8 0, i8 2}
!35 = !{}
!36 = !{!11, !13, i64 72}
!37 = !{!11, !14, i64 232}
!38 = distinct !{!38, !30}


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