; LLVM IR from niessner/Matterport :: code/gaps/pkgs/R3Shapes/R3Grid.ll (ZN6R3Grid8ConvolveEPA3_A3_Kd)

; 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.R3Grid = type { %class.R3Affine, %class.R3Affine, double, double, ptr, [3 x i32], i32, i32, i32 }
%class.R3Affine = type { %class.R3Transformation, %class.R4Matrix, %class.R4Matrix, %class.RNFlags }
%class.R3Transformation = type { ptr }
%class.R4Matrix = type { [4 x [4 x double]] }
%class.RNFlags = type { i64 }

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592), i32 noundef, i32 noundef, i32 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592)) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592)) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6R3Grid12SetGridValueEiiid(ptr noundef nonnull align 8 dereferenceable(592), i32 noundef, i32 noundef, i32 noundef, double noundef) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6R3Grid8ConvolveEPA3_A3_Kd(ptr noundef nonnull align 8 dereferenceable(592) %0, ptr noundef %1) #4 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %class.R3Grid, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca double, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca double, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %23 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 592, ptr %5) #5
  call void @_ZN6R3GridC1ERKS_(ptr noundef nonnull align 8 dereferenceable(592) %5, ptr noundef nonnull align 8 dereferenceable(592) %23)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %24

24:                                               ; preds = %59, %2
  %25 = load i32, ptr %6, align 4, !tbaa !9
  %26 = invoke noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %23)
          to label %27 unwind label %30

27:                                               ; preds = %24
  %28 = icmp slt i32 %25, %26
  br i1 %28, label %34, label %29

29:                                               ; preds = %27
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %63

30:                                               ; preds = %24
  %31 = landingpad { ptr, i32 }
          cleanup
  %32 = extractvalue { ptr, i32 } %31, 0
  store ptr %32, ptr %7, align 8
  %33 = extractvalue { ptr, i32 } %31, 1
  store i32 %33, ptr %8, align 4
  br label %62

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

35:                                               ; preds = %55, %34
  %36 = load i32, ptr %10, align 4, !tbaa !9
  %37 = invoke noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %23)
          to label %38 unwind label %41

38:                                               ; preds = %35
  %39 = icmp slt i32 %36, %37
  br i1 %39, label %45, label %40

40:                                               ; preds = %38
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %58

41:                                               ; preds = %50, %48, %45, %35
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %7, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %62

45:                                               ; preds = %38
  %46 = load i32, ptr %6, align 4, !tbaa !9
  %47 = load i32, ptr %10, align 4, !tbaa !9
  invoke void @_ZN6R3Grid12SetGridValueEiiid(ptr noundef nonnull align 8 dereferenceable(592) %23, i32 noundef 0, i32 noundef %46, i32 noundef %47, double noundef 0.000000e+00)
          to label %48 unwind label %41

48:                                               ; preds = %45
  %49 = invoke noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %23)
          to label %50 unwind label %41

50:                                               ; preds = %48
  %51 = sub nsw i32 %49, 1
  %52 = load i32, ptr %6, align 4, !tbaa !9
  %53 = load i32, ptr %10, align 4, !tbaa !9
  invoke void @_ZN6R3Grid12SetGridValueEiiid(ptr noundef nonnull align 8 dereferenceable(592) %23, i32 noundef %51, i32 noundef %52, i32 noundef %53, double noundef 0.000000e+00)
          to label %54 unwind label %41

54:                                               ; preds = %50
  br label %55

55:                                               ; preds = %54
  %56 = load i32, ptr %10, align 4, !tbaa !9
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %10, align 4, !tbaa !9
  br label %35, !llvm.loop !11

58:                                               ; preds = %40
  br label %59

59:                                               ; preds = %58
  %60 = load i32, ptr %6, align 4, !tbaa !9
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %6, align 4, !tbaa !9
  br label %24, !llvm.loop !13

62:                                               ; preds = %41, %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %264

63:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %64

64:                                               ; preds = %99, %63
  %65 = load i32, ptr %11, align 4, !tbaa !9
  %66 = invoke noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %23)
          to label %67 unwind label %70

67:                                               ; preds = %64
  %68 = icmp slt i32 %65, %66
  br i1 %68, label %74, label %69

69:                                               ; preds = %67
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %103

70:                                               ; preds = %64
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %7, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %8, align 4
  br label %102

74:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %75

75:                                               ; preds = %95, %74
  %76 = load i32, ptr %12, align 4, !tbaa !9
  %77 = invoke noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %23)
          to label %78 unwind label %81

78:                                               ; preds = %75
  %79 = icmp slt i32 %76, %77
  br i1 %79, label %85, label %80

80:                                               ; preds = %78
  store i32 11, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %98

81:                                               ; preds = %91, %88, %85, %75
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %7, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %102

85:                                               ; preds = %78
  %86 = load i32, ptr %11, align 4, !tbaa !9
  %87 = load i32, ptr %12, align 4, !tbaa !9
  invoke void @_ZN6R3Grid12SetGridValueEiiid(ptr noundef nonnull align 8 dereferenceable(592) %23, i32 noundef %86, i32 noundef 0, i32 noundef %87, double noundef 0.000000e+00)
          to label %88 unwind label %81

88:                                               ; preds = %85
  %89 = load i32, ptr %11, align 4, !tbaa !9
  %90 = invoke noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %23)
          to label %91 unwind label %81

91:                                               ; preds = %88
  %92 = sub nsw i32 %90, 1
  %93 = load i32, ptr %12, align 4, !tbaa !9
  invoke void @_ZN6R3Grid12SetGridValueEiiid(ptr noundef nonnull align 8 dereferenceable(592) %23, i32 noundef %89, i32 noundef %92, i32 noundef %93, double noundef 0.000000e+00)
          to label %94 unwind label %81

94:                                               ; preds = %91
  br label %95

95:                                               ; preds = %94
  %96 = load i32, ptr %12, align 4, !tbaa !9
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %12, align 4, !tbaa !9
  br label %75, !llvm.loop !14

98:                                               ; preds = %80
  br label %99

99:                                               ; preds = %98
  %100 = load i32, ptr %11, align 4, !tbaa !9
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %11, align 4, !tbaa !9
  br label %64, !llvm.loop !15

102:                                              ; preds = %81, %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %264

103:                                              ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %104

104:                                              ; preds = %139, %103
  %105 = load i32, ptr %13, align 4, !tbaa !9
  %106 = invoke noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %23)
          to label %107 unwind label %110

107:                                              ; preds = %104
  %108 = icmp slt i32 %105, %106
  br i1 %108, label %114, label %109

109:                                              ; preds = %107
  store i32 14, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %143

110:                                              ; preds = %104
  %111 = landingpad { ptr, i32 }
          cleanup
  %112 = extractvalue { ptr, i32 } %111, 0
  store ptr %112, ptr %7, align 8
  %113 = extractvalue { ptr, i32 } %111, 1
  store i32 %113, ptr %8, align 4
  br label %142

114:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %115

115:                                              ; preds = %135, %114
  %116 = load i32, ptr %14, align 4, !tbaa !9
  %117 = invoke noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %23)
          to label %118 unwind label %121

118:                                              ; preds = %115
  %119 = icmp slt i32 %116, %117
  br i1 %119, label %125, label %120

120:                                              ; preds = %118
  store i32 17, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %138

121:                                              ; preds = %132, %128, %125, %115
  %122 = landingpad { ptr, i32 }
          cleanup
  %123 = extractvalue { ptr, i32 } %122, 0
  store ptr %123, ptr %7, align 8
  %124 = extractvalue { ptr, i32 } %122, 1
  store i32 %124, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %142

125:                                              ; preds = %118
  %126 = load i32, ptr %13, align 4, !tbaa !9
  %127 = load i32, ptr %14, align 4, !tbaa !9
  invoke void @_ZN6R3Grid12SetGridValueEiiid(ptr noundef nonnull align 8 dereferenceable(592) %23, i32 noundef %126, i32 noundef %127, i32 noundef 0, double noundef 0.000000e+00)
          to label %128 unwind label %121

128:                                              ; preds = %125
  %129 = load i32, ptr %13, align 4, !tbaa !9
  %130 = load i32, ptr %14, align 4, !tbaa !9
  %131 = invoke noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %23)
          to label %132 unwind label %121

132:                                              ; preds = %128
  %133 = sub nsw i32 %131, 1
  invoke void @_ZN6R3Grid12SetGridValueEiiid(ptr noundef nonnull align 8 dereferenceable(592) %23, i32 noundef %129, i32 noundef %130, i32 noundef %133, double noundef 0.000000e+00)
          to label %134 unwind label %121

134:                                              ; preds = %132
  br label %135

135:                                              ; preds = %134
  %136 = load i32, ptr %14, align 4, !tbaa !9
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr %14, align 4, !tbaa !9
  br label %115, !llvm.loop !16

138:                                              ; preds = %120
  br label %139

139:                                              ; preds = %138
  %140 = load i32, ptr %13, align 4, !tbaa !9
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %13, align 4, !tbaa !9
  br label %104, !llvm.loop !17

142:                                              ; preds = %121, %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %264

143:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 1, ptr %15, align 4, !tbaa !9
  br label %144

144:                                              ; preds = %259, %143
  %145 = load i32, ptr %15, align 4, !tbaa !9
  %146 = invoke noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %23)
          to label %147 unwind label %151

147:                                              ; preds = %144
  %148 = sub nsw i32 %146, 1
  %149 = icmp slt i32 %145, %148
  br i1 %149, label %155, label %150

150:                                              ; preds = %147
  store i32 20, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %263

151:                                              ; preds = %144
  %152 = landingpad { ptr, i32 }
          cleanup
  %153 = extractvalue { ptr, i32 } %152, 0
  store ptr %153, ptr %7, align 8
  %154 = extractvalue { ptr, i32 } %152, 1
  store i32 %154, ptr %8, align 4
  br label %262

155:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 1, ptr %16, align 4, !tbaa !9
  br label %156

156:                                              ; preds = %254, %155
  %157 = load i32, ptr %16, align 4, !tbaa !9
  %158 = invoke noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %23)
          to label %159 unwind label %163

159:                                              ; preds = %156
  %160 = sub nsw i32 %158, 1
  %161 = icmp slt i32 %157, %160
  br i1 %161, label %167, label %162

162:                                              ; preds = %159
  store i32 23, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %258

163:                                              ; preds = %156
  %164 = landingpad { ptr, i32 }
          cleanup
  %165 = extractvalue { ptr, i32 } %164, 0
  store ptr %165, ptr %7, align 8
  %166 = extractvalue { ptr, i32 } %164, 1
  store i32 %166, ptr %8, align 4
  br label %257

167:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 1, ptr %17, align 4, !tbaa !9
  br label %168

168:                                              ; preds = %244, %167
  %169 = load i32, ptr %17, align 4, !tbaa !9
  %170 = invoke noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %23)
          to label %171 unwind label %175

171:                                              ; preds = %168
  %172 = sub nsw i32 %170, 1
  %173 = icmp slt i32 %169, %172
  br i1 %173, label %179, label %174

174:                                              ; preds = %171
  store i32 26, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %253

175:                                              ; preds = %168
  %176 = landingpad { ptr, i32 }
          cleanup
  %177 = extractvalue { ptr, i32 } %176, 0
  store ptr %177, ptr %7, align 8
  %178 = extractvalue { ptr, i32 } %176, 1
  store i32 %178, ptr %8, align 4
  br label %252

179:                                              ; preds = %171
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  store double 0.000000e+00, ptr %18, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  store i32 -1, ptr %19, align 4, !tbaa !9
  br label %180

180:                                              ; preds = %235, %179
  %181 = load i32, ptr %19, align 4, !tbaa !9
  %182 = icmp sle i32 %181, 1
  br i1 %182, label %184, label %183

183:                                              ; preds = %180
  store i32 29, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %238

184:                                              ; preds = %180
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  store i32 -1, ptr %20, align 4, !tbaa !9
  br label %185

185:                                              ; preds = %231, %184
  %186 = load i32, ptr %20, align 4, !tbaa !9
  %187 = icmp sle i32 %186, 1
  br i1 %187, label %189, label %188

188:                                              ; preds = %185
  store i32 32, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %234

189:                                              ; preds = %185
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  store i32 -1, ptr %21, align 4, !tbaa !9
  br label %190

190:                                              ; preds = %223, %189
  %191 = load i32, ptr %21, align 4, !tbaa !9
  %192 = icmp sle i32 %191, 1
  br i1 %192, label %194, label %193

193:                                              ; preds = %190
  store i32 35, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  br label %230

194:                                              ; preds = %190
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %195 = load i32, ptr %17, align 4, !tbaa !9
  %196 = load i32, ptr %21, align 4, !tbaa !9
  %197 = add nsw i32 %195, %196
  %198 = load i32, ptr %16, align 4, !tbaa !9
  %199 = load i32, ptr %20, align 4, !tbaa !9
  %200 = add nsw i32 %198, %199
  %201 = load i32, ptr %15, align 4, !tbaa !9
  %202 = load i32, ptr %19, align 4, !tbaa !9
  %203 = add nsw i32 %201, %202
  %204 = invoke noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %5, i32 noundef %197, i32 noundef %200, i32 noundef %203)
          to label %205 unwind label %226

205:                                              ; preds = %194
  store double %204, ptr %22, align 8, !tbaa !18
  %206 = load ptr, ptr %4, align 8, !tbaa !5
  %207 = load i32, ptr %19, align 4, !tbaa !9
  %208 = add nsw i32 %207, 1
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [3 x [3 x double]], ptr %206, i64 %209
  %211 = load i32, ptr %20, align 4, !tbaa !9
  %212 = add nsw i32 %211, 1
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [3 x [3 x double]], ptr %210, i64 0, i64 %213
  %215 = load i32, ptr %21, align 4, !tbaa !9
  %216 = add nsw i32 %215, 1
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [3 x double], ptr %214, i64 0, i64 %217
  %219 = load double, ptr %218, align 8, !tbaa !18
  %220 = load double, ptr %22, align 8, !tbaa !18
  %221 = load double, ptr %18, align 8, !tbaa !18
  %222 = call double @llvm.fmuladd.f64(double %219, double %220, double %221)
  store double %222, ptr %18, align 8, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  br label %223

223:                                              ; preds = %205
  %224 = load i32, ptr %21, align 4, !tbaa !9
  %225 = add nsw i32 %224, 1
  store i32 %225, ptr %21, align 4, !tbaa !9
  br label %190, !llvm.loop !20

226:                                              ; preds = %194
  %227 = landingpad { ptr, i32 }
          cleanup
  %228 = extractvalue { ptr, i32 } %227, 0
  store ptr %228, ptr %7, align 8
  %229 = extractvalue { ptr, i32 } %227, 1
  store i32 %229, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %251

230:                                              ; preds = %193
  br label %231

231:                                              ; preds = %230
  %232 = load i32, ptr %20, align 4, !tbaa !9
  %233 = add nsw i32 %232, 1
  store i32 %233, ptr %20, align 4, !tbaa !9
  br label %185, !llvm.loop !21

234:                                              ; preds = %188
  br label %235

235:                                              ; preds = %234
  %236 = load i32, ptr %19, align 4, !tbaa !9
  %237 = add nsw i32 %236, 1
  store i32 %237, ptr %19, align 4, !tbaa !9
  br label %180, !llvm.loop !22

238:                                              ; preds = %183
  %239 = load i32, ptr %17, align 4, !tbaa !9
  %240 = load i32, ptr %16, align 4, !tbaa !9
  %241 = load i32, ptr %15, align 4, !tbaa !9
  %242 = load double, ptr %18, align 8, !tbaa !18
  invoke void @_ZN6R3Grid12SetGridValueEiiid(ptr noundef nonnull align 8 dereferenceable(592) %23, i32 noundef %239, i32 noundef %240, i32 noundef %241, double noundef %242)
          to label %243 unwind label %247

243:                                              ; preds = %238
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  br label %244

244:                                              ; preds = %243
  %245 = load i32, ptr %17, align 4, !tbaa !9
  %246 = add nsw i32 %245, 1
  store i32 %246, ptr %17, align 4, !tbaa !9
  br label %168, !llvm.loop !23

247:                                              ; preds = %238
  %248 = landingpad { ptr, i32 }
          cleanup
  %249 = extractvalue { ptr, i32 } %248, 0
  store ptr %249, ptr %7, align 8
  %250 = extractvalue { ptr, i32 } %248, 1
  store i32 %250, ptr %8, align 4
  br label %251

251:                                              ; preds = %247, %226
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  br label %252

252:                                              ; preds = %251, %175
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %257

253:                                              ; preds = %174
  br label %254

254:                                              ; preds = %253
  %255 = load i32, ptr %16, align 4, !tbaa !9
  %256 = add nsw i32 %255, 1
  store i32 %256, ptr %16, align 4, !tbaa !9
  br label %156, !llvm.loop !24

257:                                              ; preds = %252, %163
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %262

258:                                              ; preds = %162
  br label %259

259:                                              ; preds = %258
  %260 = load i32, ptr %15, align 4, !tbaa !9
  %261 = add nsw i32 %260, 1
  store i32 %261, ptr %15, align 4, !tbaa !9
  br label %144, !llvm.loop !25

262:                                              ; preds = %257, %151
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %264

263:                                              ; preds = %150
  call void @_ZN6R3GridD1Ev(ptr noundef nonnull align 8 dereferenceable(592) %5) #5
  call void @llvm.lifetime.end.p0(i64 592, ptr %5) #5
  ret void

264:                                              ; preds = %262, %142, %102, %62
  call void @_ZN6R3GridD1Ev(ptr noundef nonnull align 8 dereferenceable(592) %5) #5
  call void @llvm.lifetime.end.p0(i64 592, ptr %5) #5
  br label %265

265:                                              ; preds = %264
  %266 = load ptr, ptr %7, align 8
  %267 = load i32, ptr %8, align 4
  %268 = insertvalue { ptr, i32 } poison, ptr %266, 0
  %269 = insertvalue { ptr, i32 } %268, i32 %267, 1
  resume { ptr, i32 } %269
}

declare void @_ZN6R3GridC1ERKS_(ptr, ptr)

declare void @_ZN6R3GridD1Ev(ptr)

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

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

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


; 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.R3Grid = type { %class.R3Affine, %class.R3Affine, double, double, ptr, [3 x i32], i32, i32, i32 }
%class.R3Affine = type { %class.R3Transformation, %class.R4Matrix, %class.R4Matrix, %class.RNFlags }
%class.R3Transformation = type { ptr }
%class.R4Matrix = type { [4 x [4 x double]] }
%class.RNFlags = type { i64 }

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6R3Grid8ConvolveEPA3_A3_Kd(ptr noundef nonnull align 8 dereferenceable(592) %0, ptr nocapture noundef readonly %1) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %class.R3Grid, align 8
  call void @llvm.lifetime.start.p0(i64 592, ptr nonnull %3) #5
  call void @_ZN6R3GridC1ERKS_(ptr noundef nonnull align 8 dereferenceable(592) %3, ptr noundef nonnull align 8 dereferenceable(592) %0)
  %4 = call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.preheader82, label %.preheader81

.preheader82:                                     ; preds = %2, %._crit_edge
  %.087 = phi i32 [ %10, %._crit_edge ], [ 0, %2 ]
  %6 = call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph, label %._crit_edge

.preheader81:                                     ; preds = %._crit_edge, %2
  %8 = call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.preheader80, label %.preheader79

._crit_edge:                                      ; preds = %18, %.preheader82
  %10 = add nuw nsw i32 %.087, 1
  %11 = call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %12 = icmp slt i32 %10, %11
  br i1 %12, label %.preheader82, label %.preheader81, !llvm.loop !5

13:                                               ; preds = %15, %.lr.ph
  %14 = landingpad { ptr, i32 }
          cleanup
  br label %215

.lr.ph:                                           ; preds = %.preheader82, %18
  %.06586 = phi i32 [ %19, %18 ], [ 0, %.preheader82 ]
  invoke void @_ZN6R3Grid12SetGridValueEiiid(ptr noundef nonnull align 8 dereferenceable(592) %0, i32 noundef 0, i32 noundef %.087, i32 noundef %.06586, double noundef 0.000000e+00)
          to label %15 unwind label %13

15:                                               ; preds = %.lr.ph
  %16 = call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %17 = add nsw i32 %16, -1
  invoke void @_ZN6R3Grid12SetGridValueEiiid(ptr noundef nonnull align 8 dereferenceable(592) %0, i32 noundef %17, i32 noundef %.087, i32 noundef %.06586, double noundef 0.000000e+00)
          to label %18 unwind label %13

18:                                               ; preds = %15
  %19 = add nuw nsw i32 %.06586, 1
  %20 = call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %.lr.ph, label %._crit_edge, !llvm.loop !7

.preheader80:                                     ; preds = %.preheader81, %._crit_edge90
  %.06491 = phi i32 [ %26, %._crit_edge90 ], [ 0, %.preheader81 ]
  %22 = call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %.lr.ph89, label %._crit_edge90

.preheader79:                                     ; preds = %._crit_edge90, %.preheader81
  %24 = call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %25 = icmp sgt i32 %24, 0
  br i1 %25, label %.preheader78, label %.preheader77

._crit_edge90:                                    ; preds = %34, %.preheader80
  %26 = add nuw nsw i32 %.06491, 1
  %27 = call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %.preheader80, label %.preheader79, !llvm.loop !8

29:                                               ; preds = %31, %.lr.ph89
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %215

.lr.ph89:                                         ; preds = %.preheader80, %34
  %.06388 = phi i32 [ %35, %34 ], [ 0, %.preheader80 ]
  invoke void @_ZN6R3Grid12SetGridValueEiiid(ptr noundef nonnull align 8 dereferenceable(592) %0, i32 noundef %.06491, i32 noundef 0, i32 noundef %.06388, double noundef 0.000000e+00)
          to label %31 unwind label %29

31:                                               ; preds = %.lr.ph89
  %32 = call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %33 = add nsw i32 %32, -1
  invoke void @_ZN6R3Grid12SetGridValueEiiid(ptr noundef nonnull align 8 dereferenceable(592) %0, i32 noundef %.06491, i32 noundef %33, i32 noundef %.06388, double noundef 0.000000e+00)
          to label %34 unwind label %29

34:                                               ; preds = %31
  %35 = add nuw nsw i32 %.06388, 1
  %36 = call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %.lr.ph89, label %._crit_edge90, !llvm.loop !9

.preheader78:                                     ; preds = %.preheader79, %._crit_edge94
  %.06295 = phi i32 [ %67, %._crit_edge94 ], [ 0, %.preheader79 ]
  %38 = call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %39 = icmp sgt i32 %38, 0
  br i1 %39, label %.lr.ph93, label %._crit_edge94

.preheader77:                                     ; preds = %._crit_edge94, %.preheader79
  %40 = call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %41 = icmp sgt i32 %40, 2
  br i1 %41, label %.preheader76.lr.ph, label %._crit_edge107

.preheader76.lr.ph:                               ; preds = %.preheader77
  %invariant.gep = getelementptr i8, ptr %1, i64 72
  %42 = getelementptr i8, ptr %1, i64 8
  %43 = getelementptr i8, ptr %1, i64 16
  %44 = getelementptr i8, ptr %1, i64 24
  %45 = getelementptr i8, ptr %1, i64 32
  %46 = getelementptr i8, ptr %1, i64 40
  %47 = getelementptr i8, ptr %1, i64 48
  %48 = getelementptr i8, ptr %1, i64 56
  %49 = getelementptr i8, ptr %1, i64 64
  %50 = getelementptr i8, ptr %1, i64 80
  %51 = getelementptr i8, ptr %1, i64 88
  %52 = getelementptr i8, ptr %1, i64 96
  %53 = getelementptr i8, ptr %1, i64 104
  %54 = getelementptr i8, ptr %1, i64 112
  %55 = getelementptr i8, ptr %1, i64 120
  %56 = getelementptr i8, ptr %1, i64 128
  %57 = getelementptr i8, ptr %1, i64 136
  %58 = getelementptr i8, ptr %1, i64 144
  %59 = getelementptr i8, ptr %1, i64 152
  %60 = getelementptr i8, ptr %1, i64 160
  %61 = getelementptr i8, ptr %1, i64 168
  %62 = getelementptr i8, ptr %1, i64 176
  %63 = getelementptr i8, ptr %1, i64 184
  %64 = getelementptr i8, ptr %1, i64 192
  %65 = getelementptr i8, ptr %1, i64 200
  %66 = getelementptr i8, ptr %1, i64 208
  br label %.preheader76

._crit_edge94:                                    ; preds = %75, %.preheader78
  %67 = add nuw nsw i32 %.06295, 1
  %68 = call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %69 = icmp slt i32 %67, %68
  br i1 %69, label %.preheader78, label %.preheader77, !llvm.loop !10

70:                                               ; preds = %72, %.lr.ph93
  %71 = landingpad { ptr, i32 }
          cleanup
  br label %215

.lr.ph93:                                         ; preds = %.preheader78, %75
  %.06192 = phi i32 [ %76, %75 ], [ 0, %.preheader78 ]
  invoke void @_ZN6R3Grid12SetGridValueEiiid(ptr noundef nonnull align 8 dereferenceable(592) %0, i32 noundef %.06295, i32 noundef %.06192, i32 noundef 0, double noundef 0.000000e+00)
          to label %72 unwind label %70

72:                                               ; preds = %.lr.ph93
  %73 = call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %74 = add nsw i32 %73, -1
  invoke void @_ZN6R3Grid12SetGridValueEiiid(ptr noundef nonnull align 8 dereferenceable(592) %0, i32 noundef %.06295, i32 noundef %.06192, i32 noundef %74, double noundef 0.000000e+00)
          to label %75 unwind label %70

75:                                               ; preds = %72
  %76 = add nuw nsw i32 %.06192, 1
  %77 = call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %78 = icmp slt i32 %76, %77
  br i1 %78, label %.lr.ph93, label %._crit_edge94, !llvm.loop !11

.preheader76:                                     ; preds = %.preheader76.lr.ph, %._crit_edge105
  %indvars.iv117 = phi i64 [ 1, %.preheader76.lr.ph ], [ %indvars.iv.next118, %._crit_edge105 ]
  %79 = call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %80 = icmp sgt i32 %79, 2
  br i1 %80, label %.preheader75.preheader, label %._crit_edge105

.preheader75.preheader:                           ; preds = %.preheader76
  %81 = trunc i64 %indvars.iv117 to i32
  %82 = add i32 %81, -1
  %83 = trunc nuw nsw i64 %indvars.iv117 to i32
  %84 = trunc i64 %indvars.iv117 to i32
  %85 = add i32 %84, 1
  br label %.preheader75

._crit_edge107:                                   ; preds = %._crit_edge105, %.preheader77
  call void @_ZN6R3GridD1Ev(ptr noundef nonnull align 8 dereferenceable(592) %3) #5
  call void @llvm.lifetime.end.p0(i64 592, ptr nonnull %3) #5
  ret void

.preheader75:                                     ; preds = %.preheader75.preheader, %._crit_edge103
  %indvars.iv114 = phi i64 [ 1, %.preheader75.preheader ], [ %indvars.iv.next115.pre-phi, %._crit_edge103 ]
  %86 = call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %87 = icmp sgt i32 %86, 2
  br i1 %87, label %.preheader74.preheader, label %.preheader75.._crit_edge103_crit_edge

.preheader75.._crit_edge103_crit_edge:            ; preds = %.preheader75
  %.pre = add nuw nsw i64 %indvars.iv114, 1
  br label %._crit_edge103

.preheader74.preheader:                           ; preds = %.preheader75
  %88 = trunc i64 %indvars.iv114 to i32
  %89 = add i32 %88, -1
  %90 = trunc nuw nsw i64 %indvars.iv114 to i32
  %91 = add nuw nsw i64 %indvars.iv114, 1
  %92 = trunc nuw nsw i64 %91 to i32
  br label %.preheader74

._crit_edge105:                                   ; preds = %._crit_edge103, %.preheader76
  %indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1
  %93 = call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %94 = add nsw i32 %93, -1
  %95 = sext i32 %94 to i64
  %96 = icmp slt i64 %indvars.iv.next118, %95
  br i1 %96, label %.preheader76, label %._crit_edge107, !llvm.loop !12

.preheader74:                                     ; preds = %.preheader74.preheader, %208
  %indvars.iv = phi i64 [ 1, %.preheader74.preheader ], [ %110, %208 ]
  %97 = trunc i64 %indvars.iv to i32
  %98 = add i32 %97, -1
  %99 = invoke noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %3, i32 noundef %98, i32 noundef %89, i32 noundef %82)
          to label %104 unwind label %206

._crit_edge103:                                   ; preds = %208, %.preheader75.._crit_edge103_crit_edge
  %indvars.iv.next115.pre-phi = phi i64 [ %.pre, %.preheader75.._crit_edge103_crit_edge ], [ %91, %208 ]
  %100 = call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %101 = add nsw i32 %100, -1
  %102 = sext i32 %101 to i64
  %103 = icmp slt i64 %indvars.iv.next115.pre-phi, %102
  br i1 %103, label %.preheader75, label %._crit_edge105, !llvm.loop !13

104:                                              ; preds = %.preheader74
  %105 = load double, ptr %1, align 8, !tbaa !14
  %106 = trunc nuw nsw i64 %indvars.iv to i32
  %107 = invoke noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %3, i32 noundef %106, i32 noundef %89, i32 noundef %82)
          to label %108 unwind label %206

108:                                              ; preds = %104
  %109 = load double, ptr %42, align 8, !tbaa !14
  %110 = add nuw nsw i64 %indvars.iv, 1
  %111 = trunc nuw nsw i64 %110 to i32
  %112 = invoke noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %3, i32 noundef %111, i32 noundef %89, i32 noundef %82)
          to label %.preheader.1 unwind label %206

.preheader.1:                                     ; preds = %108
  %113 = load double, ptr %43, align 8, !tbaa !14
  %114 = invoke noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %3, i32 noundef %98, i32 noundef %90, i32 noundef %82)
          to label %115 unwind label %206

115:                                              ; preds = %.preheader.1
  %116 = load double, ptr %44, align 8, !tbaa !14
  %117 = invoke noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %3, i32 noundef %106, i32 noundef %90, i32 noundef %82)
          to label %118 unwind label %206

118:                                              ; preds = %115
  %119 = load double, ptr %45, align 8, !tbaa !14
  %120 = invoke noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %3, i32 noundef %111, i32 noundef %90, i32 noundef %82)
          to label %.preheader.2 unwind label %206

.preheader.2:                                     ; preds = %118
  %121 = load double, ptr %46, align 8, !tbaa !14
  %122 = invoke noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %3, i32 noundef %98, i32 noundef %92, i32 noundef %82)
          to label %123 unwind label %206

123:                                              ; preds = %.preheader.2
  %124 = load double, ptr %47, align 8, !tbaa !14
  %125 = invoke noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %3, i32 noundef %106, i32 noundef %92, i32 noundef %82)
          to label %126 unwind label %206

126:                                              ; preds = %123
  %127 = load double, ptr %48, align 8, !tbaa !14
  %128 = invoke noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %3, i32 noundef %111, i32 noundef %92, i32 noundef %82)
          to label %.preheader73.1 unwind label %206

.preheader73.1:                                   ; preds = %126
  %129 = load double, ptr %49, align 8, !tbaa !14
  %130 = invoke noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %3, i32 noundef %98, i32 noundef %89, i32 noundef %83)
          to label %131 unwind label %206

131:                                              ; preds = %.preheader73.1
  %132 = load double, ptr %invariant.gep, align 8, !tbaa !14
  %133 = invoke noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %3, i32 noundef %106, i32 noundef %89, i32 noundef %83)
          to label %134 unwind label %206

134:                                              ; preds = %131
  %135 = load double, ptr %50, align 8, !tbaa !14
  %136 = invoke noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %3, i32 noundef %111, i32 noundef %89, i32 noundef %83)
          to label %.preheader.1.1 unwind label %206

.preheader.1.1:                                   ; preds = %134
  %137 = load double, ptr %51, align 8, !tbaa !14
  %138 = invoke noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %3, i32 noundef %98, i32 noundef %90, i32 noundef %83)
          to label %139 unwind label %206

139:                                              ; preds = %.preheader.1.1
  %140 = load double, ptr %52, align 8, !tbaa !14
  %141 = invoke noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %3, i32 noundef %106, i32 noundef %90, i32 noundef %83)
          to label %142 unwind label %206

142:                                              ; preds = %139
  %143 = load double, ptr %53, align 8, !tbaa !14
  %144 = invoke noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %3, i32 noundef %111, i32 noundef %90, i32 noundef %83)
          to label %.preheader.2.1 unwind label %206

.preheader.2.1:                                   ; preds = %142
  %145 = load double, ptr %54, align 8, !tbaa !14
  %146 = invoke noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %3, i32 noundef %98, i32 noundef %92, i32 noundef %83)
          to label %147 unwind label %206

147:                                              ; preds = %.preheader.2.1
  %148 = load double, ptr %55, align 8, !tbaa !14
  %149 = invoke noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %3, i32 noundef %106, i32 noundef %92, i32 noundef %83)
          to label %150 unwind label %206

150:                                              ; preds = %147
  %151 = load double, ptr %56, align 8, !tbaa !14
  %152 = invoke noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %3, i32 noundef %111, i32 noundef %92, i32 noundef %83)
          to label %.preheader73.2 unwind label %206

.preheader73.2:                                   ; preds = %150
  %153 = load double, ptr %57, align 8, !tbaa !14
  %154 = invoke noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %3, i32 noundef %98, i32 noundef %89, i32 noundef %85)
          to label %155 unwind label %206

155:                                              ; preds = %.preheader73.2
  %156 = load double, ptr %58, align 8, !tbaa !14
  %157 = invoke noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %3, i32 noundef %106, i32 noundef %89, i32 noundef %85)
          to label %158 unwind label %206

158:                                              ; preds = %155
  %159 = load double, ptr %59, align 8, !tbaa !14
  %160 = invoke noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %3, i32 noundef %111, i32 noundef %89, i32 noundef %85)
          to label %.preheader.1.2 unwind label %206

.preheader.1.2:                                   ; preds = %158
  %161 = load double, ptr %60, align 8, !tbaa !14
  %162 = invoke noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %3, i32 noundef %98, i32 noundef %90, i32 noundef %85)
          to label %163 unwind label %206

163:                                              ; preds = %.preheader.1.2
  %164 = load double, ptr %61, align 8, !tbaa !14
  %165 = invoke noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %3, i32 noundef %106, i32 noundef %90, i32 noundef %85)
          to label %166 unwind label %206

166:                                              ; preds = %163
  %167 = load double, ptr %62, align 8, !tbaa !14
  %168 = invoke noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %3, i32 noundef %111, i32 noundef %90, i32 noundef %85)
          to label %.preheader.2.2 unwind label %206

.preheader.2.2:                                   ; preds = %166
  %169 = load double, ptr %63, align 8, !tbaa !14
  %170 = invoke noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %3, i32 noundef %98, i32 noundef %92, i32 noundef %85)
          to label %171 unwind label %206

171:                                              ; preds = %.preheader.2.2
  %172 = load double, ptr %64, align 8, !tbaa !14
  %173 = invoke noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %3, i32 noundef %106, i32 noundef %92, i32 noundef %85)
          to label %174 unwind label %206

174:                                              ; preds = %171
  %175 = load double, ptr %65, align 8, !tbaa !14
  %176 = invoke noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %3, i32 noundef %111, i32 noundef %92, i32 noundef %85)
          to label %177 unwind label %206

177:                                              ; preds = %174
  %178 = call double @llvm.fmuladd.f64(double %105, double %99, double 0.000000e+00)
  %179 = call double @llvm.fmuladd.f64(double %109, double %107, double %178)
  %180 = call double @llvm.fmuladd.f64(double %113, double %112, double %179)
  %181 = call double @llvm.fmuladd.f64(double %116, double %114, double %180)
  %182 = call double @llvm.fmuladd.f64(double %119, double %117, double %181)
  %183 = call double @llvm.fmuladd.f64(double %121, double %120, double %182)
  %184 = call double @llvm.fmuladd.f64(double %124, double %122, double %183)
  %185 = call double @llvm.fmuladd.f64(double %127, double %125, double %184)
  %186 = call double @llvm.fmuladd.f64(double %129, double %128, double %185)
  %187 = call double @llvm.fmuladd.f64(double %132, double %130, double %186)
  %188 = call double @llvm.fmuladd.f64(double %135, double %133, double %187)
  %189 = call double @llvm.fmuladd.f64(double %137, double %136, double %188)
  %190 = call double @llvm.fmuladd.f64(double %140, double %138, double %189)
  %191 = call double @llvm.fmuladd.f64(double %143, double %141, double %190)
  %192 = call double @llvm.fmuladd.f64(double %145, double %144, double %191)
  %193 = call double @llvm.fmuladd.f64(double %148, double %146, double %192)
  %194 = call double @llvm.fmuladd.f64(double %151, double %149, double %193)
  %195 = call double @llvm.fmuladd.f64(double %153, double %152, double %194)
  %196 = call double @llvm.fmuladd.f64(double %156, double %154, double %195)
  %197 = call double @llvm.fmuladd.f64(double %159, double %157, double %196)
  %198 = call double @llvm.fmuladd.f64(double %161, double %160, double %197)
  %199 = call double @llvm.fmuladd.f64(double %164, double %162, double %198)
  %200 = call double @llvm.fmuladd.f64(double %167, double %165, double %199)
  %201 = call double @llvm.fmuladd.f64(double %169, double %168, double %200)
  %202 = call double @llvm.fmuladd.f64(double %172, double %170, double %201)
  %203 = call double @llvm.fmuladd.f64(double %175, double %173, double %202)
  %204 = load double, ptr %66, align 8, !tbaa !14
  %205 = call double @llvm.fmuladd.f64(double %204, double %176, double %203)
  invoke void @_ZN6R3Grid12SetGridValueEiiid(ptr noundef nonnull align 8 dereferenceable(592) %0, i32 noundef %106, i32 noundef %90, i32 noundef %83, double noundef %205)
          to label %208 unwind label %213

206:                                              ; preds = %174, %171, %.preheader.2.2, %166, %163, %.preheader.1.2, %158, %155, %.preheader73.2, %150, %147, %.preheader.2.1, %142, %139, %.preheader.1.1, %134, %131, %.preheader73.1, %126, %123, %.preheader.2, %118, %115, %.preheader.1, %108, %104, %.preheader74
  %207 = landingpad { ptr, i32 }
          cleanup
  br label %215

208:                                              ; preds = %177
  %209 = call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %210 = add nsw i32 %209, -1
  %211 = sext i32 %210 to i64
  %212 = icmp slt i64 %110, %211
  br i1 %212, label %.preheader74, label %._crit_edge103, !llvm.loop !18

213:                                              ; preds = %177
  %214 = landingpad { ptr, i32 }
          cleanup
  br label %215

215:                                              ; preds = %206, %213, %70, %29, %13
  %.pn71 = phi { ptr, i32 } [ %14, %13 ], [ %30, %29 ], [ %71, %70 ], [ %207, %206 ], [ %214, %213 ]
  call void @_ZN6R3GridD1Ev(ptr noundef nonnull align 8 dereferenceable(592) %3) #5
  call void @llvm.lifetime.end.p0(i64 592, ptr nonnull %3) #5
  resume { ptr, i32 } %.pn71
}

declare void @_ZN6R3GridC1ERKS_(ptr, ptr) local_unnamed_addr

declare void @_ZN6R3GridD1Ev(ptr) local_unnamed_addr

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = distinct !{!8, !6}
!9 = distinct !{!9, !6}
!10 = distinct !{!10, !6}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6}
!13 = distinct !{!13, !6}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !16, i64 0}
!16 = !{!"omnipotent char", !17, i64 0}
!17 = !{!"Simple C++ TBAA"}
!18 = distinct !{!18, !6}


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