; LLVM IR from niessner/Matterport :: code/gaps/pkgs/R2Shapes/R2Grid.ll (ZN6R2Grid4BlurEd)

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

@.str = external hidden unnamed_addr constant [41 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [7 x i8], align 1
@RN_TWO_PI = external constant double, align 8

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #0

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #1

declare void @_Z7RNAbortPKcz(ptr noundef, ...) #2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208)) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208)) #4 align 2

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #6

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

; Function Attrs: nounwind
declare double @sqrt(double noundef) #7

; Function Attrs: nounwind
declare double @exp(double noundef) #7

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6R2Grid4BlurEd(ptr noundef nonnull align 8 dereferenceable(208) %0, double noundef %1) #8 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca double, align 8
  %25 = alloca i32, align 4
  %26 = alloca double, align 8
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca double, align 8
  %31 = alloca double, align 8
  %32 = alloca double, align 8
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca double, align 8
  %36 = alloca i32, align 4
  %37 = alloca double, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store double %1, ptr %4, align 8, !tbaa !9
  %38 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #9
  %39 = load double, ptr %4, align 8, !tbaa !9
  store double %39, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #9
  %40 = load double, ptr %5, align 8, !tbaa !9
  %41 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %40, double 5.000000e-01)
  %42 = fptosi double %41 to i32
  store i32 %42, ptr %6, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #9
  %43 = load i32, ptr %6, align 4, !tbaa !11
  %44 = add nsw i32 %43, 1
  %45 = sext i32 %44 to i64
  %46 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %45, i64 8)
  %47 = extractvalue { i64, i1 } %46, 1
  %48 = extractvalue { i64, i1 } %46, 0
  %49 = select i1 %47, i64 -1, i64 %48
  %50 = call noalias noundef nonnull ptr @_Znam(i64 noundef %49) #10
  store ptr %50, ptr %7, align 8, !tbaa !5
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = icmp ne ptr %51, null
  br i1 %52, label %54, label %53

53:                                               ; preds = %2
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.9, i32 noundef 856, ptr noundef @.str.2)
  br label %54

54:                                               ; preds = %53, %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  %55 = call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %38)
  store i32 %55, ptr %8, align 4, !tbaa !11
  %56 = load i32, ptr %8, align 4, !tbaa !11
  %57 = call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %38)
  %58 = icmp slt i32 %56, %57
  br i1 %58, label %59, label %61

59:                                               ; preds = %54
  %60 = call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %38)
  store i32 %60, ptr %8, align 4, !tbaa !11
  br label %61

61:                                               ; preds = %59, %54
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #9
  %62 = load i32, ptr %8, align 4, !tbaa !11
  %63 = sext i32 %62 to i64
  %64 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %63, i64 8)
  %65 = extractvalue { i64, i1 } %64, 1
  %66 = extractvalue { i64, i1 } %64, 0
  %67 = select i1 %65, i64 -1, i64 %66
  %68 = call noalias noundef nonnull ptr @_Znam(i64 noundef %67) #10
  store ptr %68, ptr %9, align 8, !tbaa !5
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  %70 = icmp ne ptr %69, null
  br i1 %70, label %72, label %71

71:                                               ; preds = %61
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.10, i32 noundef 862, ptr noundef @.str.2)
  br label %72

72:                                               ; preds = %71, %61
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #9
  %73 = load double, ptr @RN_TWO_PI, align 8, !tbaa !9
  %74 = call double @sqrt(double noundef %73) #9
  store double %74, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #9
  %75 = load double, ptr %10, align 8, !tbaa !9
  %76 = load double, ptr %5, align 8, !tbaa !9
  %77 = fmul double %75, %76
  store double %77, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  %78 = load double, ptr %11, align 8, !tbaa !9
  %79 = load double, ptr %11, align 8, !tbaa !9
  %80 = fmul double %78, %79
  %81 = load double, ptr %11, align 8, !tbaa !9
  %82 = fmul double %80, %81
  %83 = fdiv double 1.000000e+00, %82
  store double %83, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #9
  %84 = load double, ptr %5, align 8, !tbaa !9
  %85 = fmul double 2.000000e+00, %84
  %86 = load double, ptr %5, align 8, !tbaa !9
  %87 = fmul double %85, %86
  store double %87, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #9
  store i32 0, ptr %14, align 4, !tbaa !11
  br label %88

88:                                               ; preds = %108, %72
  %89 = load i32, ptr %14, align 4, !tbaa !11
  %90 = load i32, ptr %6, align 4, !tbaa !11
  %91 = icmp sle i32 %89, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #9
  br label %111

93:                                               ; preds = %88
  %94 = load double, ptr %12, align 8, !tbaa !9
  %95 = load i32, ptr %14, align 4, !tbaa !11
  %96 = sub nsw i32 0, %95
  %97 = load i32, ptr %14, align 4, !tbaa !11
  %98 = mul nsw i32 %96, %97
  %99 = sitofp i32 %98 to double
  %100 = load double, ptr %13, align 8, !tbaa !9
  %101 = fdiv double %99, %100
  %102 = call double @exp(double noundef %101) #9
  %103 = fmul double %94, %102
  %104 = load ptr, ptr %7, align 8, !tbaa !5
  %105 = load i32, ptr %14, align 4, !tbaa !11
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds double, ptr %104, i64 %106
  store double %103, ptr %107, align 8, !tbaa !9
  br label %108

108:                                              ; preds = %93
  %109 = load i32, ptr %14, align 4, !tbaa !11
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %14, align 4, !tbaa !11
  br label %88, !llvm.loop !13

111:                                              ; preds = %92
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #9
  store i32 0, ptr %15, align 4, !tbaa !11
  br label %112

112:                                              ; preds = %271, %111
  %113 = load i32, ptr %15, align 4, !tbaa !11
  %114 = call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %38)
  %115 = icmp slt i32 %113, %114
  br i1 %115, label %117, label %116

116:                                              ; preds = %112
  store i32 5, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  br label %274

117:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #9
  store i32 0, ptr %17, align 4, !tbaa !11
  br label %118

118:                                              ; preds = %131, %117
  %119 = load i32, ptr %17, align 4, !tbaa !11
  %120 = call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %38)
  %121 = icmp slt i32 %119, %120
  br i1 %121, label %123, label %122

122:                                              ; preds = %118
  store i32 8, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #9
  br label %134

123:                                              ; preds = %118
  %124 = load i32, ptr %17, align 4, !tbaa !11
  %125 = load i32, ptr %15, align 4, !tbaa !11
  %126 = call noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %38, i32 noundef %124, i32 noundef %125)
  %127 = load ptr, ptr %9, align 8, !tbaa !5
  %128 = load i32, ptr %17, align 4, !tbaa !11
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds double, ptr %127, i64 %129
  store double %126, ptr %130, align 8, !tbaa !9
  br label %131

131:                                              ; preds = %123
  %132 = load i32, ptr %17, align 4, !tbaa !11
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %17, align 4, !tbaa !11
  br label %118, !llvm.loop !15

134:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #9
  store i32 0, ptr %18, align 4, !tbaa !11
  br label %135

135:                                              ; preds = %267, %134
  %136 = load i32, ptr %18, align 4, !tbaa !11
  %137 = call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %38)
  %138 = icmp slt i32 %136, %137
  br i1 %138, label %140, label %139

139:                                              ; preds = %135
  store i32 11, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #9
  br label %270

140:                                              ; preds = %135
  %141 = load ptr, ptr %9, align 8, !tbaa !5
  %142 = load i32, ptr %18, align 4, !tbaa !11
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds double, ptr %141, i64 %143
  %145 = load double, ptr %144, align 8, !tbaa !9
  %146 = fcmp oeq double %145, -3.210000e+02
  br i1 %146, label %147, label %148

147:                                              ; preds = %140
  br label %267

148:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #9
  store double 0.000000e+00, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #9
  store double 0.000000e+00, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #9
  %149 = load ptr, ptr %9, align 8, !tbaa !5
  %150 = load i32, ptr %18, align 4, !tbaa !11
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds double, ptr %149, i64 %151
  %153 = load double, ptr %152, align 8, !tbaa !9
  store double %153, ptr %21, align 8, !tbaa !9
  %154 = load double, ptr %21, align 8, !tbaa !9
  %155 = fcmp une double %154, -3.210000e+02
  br i1 %155, label %156, label %168

156:                                              ; preds = %148
  %157 = load ptr, ptr %7, align 8, !tbaa !5
  %158 = getelementptr inbounds double, ptr %157, i64 0
  %159 = load double, ptr %158, align 8, !tbaa !9
  %160 = load double, ptr %21, align 8, !tbaa !9
  %161 = load double, ptr %19, align 8, !tbaa !9
  %162 = call double @llvm.fmuladd.f64(double %159, double %160, double %161)
  store double %162, ptr %19, align 8, !tbaa !9
  %163 = load ptr, ptr %7, align 8, !tbaa !5
  %164 = getelementptr inbounds double, ptr %163, i64 0
  %165 = load double, ptr %164, align 8, !tbaa !9
  %166 = load double, ptr %20, align 8, !tbaa !9
  %167 = fadd double %166, %165
  store double %167, ptr %20, align 8, !tbaa !9
  br label %168

168:                                              ; preds = %156, %148
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #9
  %169 = load i32, ptr %18, align 4, !tbaa !11
  store i32 %169, ptr %22, align 4, !tbaa !11
  %170 = load i32, ptr %22, align 4, !tbaa !11
  %171 = load i32, ptr %6, align 4, !tbaa !11
  %172 = icmp sgt i32 %170, %171
  br i1 %172, label %173, label %175

173:                                              ; preds = %168
  %174 = load i32, ptr %6, align 4, !tbaa !11
  store i32 %174, ptr %22, align 4, !tbaa !11
  br label %175

175:                                              ; preds = %173, %168
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #9
  store i32 1, ptr %23, align 4, !tbaa !11
  br label %176

176:                                              ; preds = %208, %175
  %177 = load i32, ptr %23, align 4, !tbaa !11
  %178 = load i32, ptr %22, align 4, !tbaa !11
  %179 = icmp sle i32 %177, %178
  br i1 %179, label %181, label %180

180:                                              ; preds = %176
  store i32 14, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #9
  br label %211

181:                                              ; preds = %176
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #9
  %182 = load ptr, ptr %9, align 8, !tbaa !5
  %183 = load i32, ptr %18, align 4, !tbaa !11
  %184 = load i32, ptr %23, align 4, !tbaa !11
  %185 = sub nsw i32 %183, %184
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds double, ptr %182, i64 %186
  %188 = load double, ptr %187, align 8, !tbaa !9
  store double %188, ptr %24, align 8, !tbaa !9
  %189 = load double, ptr %24, align 8, !tbaa !9
  %190 = fcmp une double %189, -3.210000e+02
  br i1 %190, label %191, label %207

191:                                              ; preds = %181
  %192 = load ptr, ptr %7, align 8, !tbaa !5
  %193 = load i32, ptr %23, align 4, !tbaa !11
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds double, ptr %192, i64 %194
  %196 = load double, ptr %195, align 8, !tbaa !9
  %197 = load double, ptr %24, align 8, !tbaa !9
  %198 = load double, ptr %19, align 8, !tbaa !9
  %199 = call double @llvm.fmuladd.f64(double %196, double %197, double %198)
  store double %199, ptr %19, align 8, !tbaa !9
  %200 = load ptr, ptr %7, align 8, !tbaa !5
  %201 = load i32, ptr %23, align 4, !tbaa !11
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds double, ptr %200, i64 %202
  %204 = load double, ptr %203, align 8, !tbaa !9
  %205 = load double, ptr %20, align 8, !tbaa !9
  %206 = fadd double %205, %204
  store double %206, ptr %20, align 8, !tbaa !9
  br label %207

207:                                              ; preds = %191, %181
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #9
  br label %208

208:                                              ; preds = %207
  %209 = load i32, ptr %23, align 4, !tbaa !11
  %210 = add nsw i32 %209, 1
  store i32 %210, ptr %23, align 4, !tbaa !11
  br label %176, !llvm.loop !16

211:                                              ; preds = %180
  %212 = call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %38)
  %213 = sub nsw i32 %212, 1
  %214 = load i32, ptr %18, align 4, !tbaa !11
  %215 = sub nsw i32 %213, %214
  store i32 %215, ptr %22, align 4, !tbaa !11
  %216 = load i32, ptr %22, align 4, !tbaa !11
  %217 = load i32, ptr %6, align 4, !tbaa !11
  %218 = icmp sgt i32 %216, %217
  br i1 %218, label %219, label %221

219:                                              ; preds = %211
  %220 = load i32, ptr %6, align 4, !tbaa !11
  store i32 %220, ptr %22, align 4, !tbaa !11
  br label %221

221:                                              ; preds = %219, %211
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #9
  store i32 1, ptr %25, align 4, !tbaa !11
  br label %222

222:                                              ; preds = %254, %221
  %223 = load i32, ptr %25, align 4, !tbaa !11
  %224 = load i32, ptr %22, align 4, !tbaa !11
  %225 = icmp sle i32 %223, %224
  br i1 %225, label %227, label %226

226:                                              ; preds = %222
  store i32 17, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #9
  br label %257

227:                                              ; preds = %222
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #9
  %228 = load ptr, ptr %9, align 8, !tbaa !5
  %229 = load i32, ptr %18, align 4, !tbaa !11
  %230 = load i32, ptr %25, align 4, !tbaa !11
  %231 = add nsw i32 %229, %230
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds double, ptr %228, i64 %232
  %234 = load double, ptr %233, align 8, !tbaa !9
  store double %234, ptr %26, align 8, !tbaa !9
  %235 = load double, ptr %26, align 8, !tbaa !9
  %236 = fcmp une double %235, -3.210000e+02
  br i1 %236, label %237, label %253

237:                                              ; preds = %227
  %238 = load ptr, ptr %7, align 8, !tbaa !5
  %239 = load i32, ptr %25, align 4, !tbaa !11
  %240 = sext i32 %239 to i64
  %241 = getelementptr inbounds double, ptr %238, i64 %240
  %242 = load double, ptr %241, align 8, !tbaa !9
  %243 = load double, ptr %26, align 8, !tbaa !9
  %244 = load double, ptr %19, align 8, !tbaa !9
  %245 = call double @llvm.fmuladd.f64(double %242, double %243, double %244)
  store double %245, ptr %19, align 8, !tbaa !9
  %246 = load ptr, ptr %7, align 8, !tbaa !5
  %247 = load i32, ptr %25, align 4, !tbaa !11
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds double, ptr %246, i64 %248
  %250 = load double, ptr %249, align 8, !tbaa !9
  %251 = load double, ptr %20, align 8, !tbaa !9
  %252 = fadd double %251, %250
  store double %252, ptr %20, align 8, !tbaa !9
  br label %253

253:                                              ; preds = %237, %227
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #9
  br label %254

254:                                              ; preds = %253
  %255 = load i32, ptr %25, align 4, !tbaa !11
  %256 = add nsw i32 %255, 1
  store i32 %256, ptr %25, align 4, !tbaa !11
  br label %222, !llvm.loop !17

257:                                              ; preds = %226
  %258 = load double, ptr %20, align 8, !tbaa !9
  %259 = fcmp ogt double %258, 0.000000e+00
  br i1 %259, label %260, label %266

260:                                              ; preds = %257
  %261 = load i32, ptr %18, align 4, !tbaa !11
  %262 = load i32, ptr %15, align 4, !tbaa !11
  %263 = load double, ptr %19, align 8, !tbaa !9
  %264 = load double, ptr %20, align 8, !tbaa !9
  %265 = fdiv double %263, %264
  call void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %38, i32 noundef %261, i32 noundef %262, double noundef %265)
  br label %266

266:                                              ; preds = %260, %257
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #9
  br label %267

267:                                              ; preds = %266, %147
  %268 = load i32, ptr %18, align 4, !tbaa !11
  %269 = add nsw i32 %268, 1
  store i32 %269, ptr %18, align 4, !tbaa !11
  br label %135, !llvm.loop !18

270:                                              ; preds = %139
  br label %271

271:                                              ; preds = %270
  %272 = load i32, ptr %15, align 4, !tbaa !11
  %273 = add nsw i32 %272, 1
  store i32 %273, ptr %15, align 4, !tbaa !11
  br label %112, !llvm.loop !19

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

275:                                              ; preds = %434, %274
  %276 = load i32, ptr %27, align 4, !tbaa !11
  %277 = call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %38)
  %278 = icmp slt i32 %276, %277
  br i1 %278, label %280, label %279

279:                                              ; preds = %275
  store i32 20, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #9
  br label %437

280:                                              ; preds = %275
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #9
  store i32 0, ptr %28, align 4, !tbaa !11
  br label %281

281:                                              ; preds = %294, %280
  %282 = load i32, ptr %28, align 4, !tbaa !11
  %283 = call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %38)
  %284 = icmp slt i32 %282, %283
  br i1 %284, label %286, label %285

285:                                              ; preds = %281
  store i32 23, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #9
  br label %297

286:                                              ; preds = %281
  %287 = load i32, ptr %27, align 4, !tbaa !11
  %288 = load i32, ptr %28, align 4, !tbaa !11
  %289 = call noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %38, i32 noundef %287, i32 noundef %288)
  %290 = load ptr, ptr %9, align 8, !tbaa !5
  %291 = load i32, ptr %28, align 4, !tbaa !11
  %292 = sext i32 %291 to i64
  %293 = getelementptr inbounds double, ptr %290, i64 %292
  store double %289, ptr %293, align 8, !tbaa !9
  br label %294

294:                                              ; preds = %286
  %295 = load i32, ptr %28, align 4, !tbaa !11
  %296 = add nsw i32 %295, 1
  store i32 %296, ptr %28, align 4, !tbaa !11
  br label %281, !llvm.loop !20

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

298:                                              ; preds = %430, %297
  %299 = load i32, ptr %29, align 4, !tbaa !11
  %300 = call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %38)
  %301 = icmp slt i32 %299, %300
  br i1 %301, label %303, label %302

302:                                              ; preds = %298
  store i32 26, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #9
  br label %433

303:                                              ; preds = %298
  %304 = load ptr, ptr %9, align 8, !tbaa !5
  %305 = load i32, ptr %29, align 4, !tbaa !11
  %306 = sext i32 %305 to i64
  %307 = getelementptr inbounds double, ptr %304, i64 %306
  %308 = load double, ptr %307, align 8, !tbaa !9
  %309 = fcmp oeq double %308, -3.210000e+02
  br i1 %309, label %310, label %311

310:                                              ; preds = %303
  br label %430

311:                                              ; preds = %303
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #9
  store double 0.000000e+00, ptr %30, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #9
  store double 0.000000e+00, ptr %31, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #9
  %312 = load ptr, ptr %9, align 8, !tbaa !5
  %313 = load i32, ptr %29, align 4, !tbaa !11
  %314 = sext i32 %313 to i64
  %315 = getelementptr inbounds double, ptr %312, i64 %314
  %316 = load double, ptr %315, align 8, !tbaa !9
  store double %316, ptr %32, align 8, !tbaa !9
  %317 = load double, ptr %32, align 8, !tbaa !9
  %318 = fcmp une double %317, -3.210000e+02
  br i1 %318, label %319, label %331

319:                                              ; preds = %311
  %320 = load ptr, ptr %7, align 8, !tbaa !5
  %321 = getelementptr inbounds double, ptr %320, i64 0
  %322 = load double, ptr %321, align 8, !tbaa !9
  %323 = load double, ptr %32, align 8, !tbaa !9
  %324 = load double, ptr %30, align 8, !tbaa !9
  %325 = call double @llvm.fmuladd.f64(double %322, double %323, double %324)
  store double %325, ptr %30, align 8, !tbaa !9
  %326 = load ptr, ptr %7, align 8, !tbaa !5
  %327 = getelementptr inbounds double, ptr %326, i64 0
  %328 = load double, ptr %327, align 8, !tbaa !9
  %329 = load double, ptr %31, align 8, !tbaa !9
  %330 = fadd double %329, %328
  store double %330, ptr %31, align 8, !tbaa !9
  br label %331

331:                                              ; preds = %319, %311
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #9
  %332 = load i32, ptr %29, align 4, !tbaa !11
  store i32 %332, ptr %33, align 4, !tbaa !11
  %333 = load i32, ptr %33, align 4, !tbaa !11
  %334 = load i32, ptr %6, align 4, !tbaa !11
  %335 = icmp sgt i32 %333, %334
  br i1 %335, label %336, label %338

336:                                              ; preds = %331
  %337 = load i32, ptr %6, align 4, !tbaa !11
  store i32 %337, ptr %33, align 4, !tbaa !11
  br label %338

338:                                              ; preds = %336, %331
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #9
  store i32 1, ptr %34, align 4, !tbaa !11
  br label %339

339:                                              ; preds = %371, %338
  %340 = load i32, ptr %34, align 4, !tbaa !11
  %341 = load i32, ptr %33, align 4, !tbaa !11
  %342 = icmp sle i32 %340, %341
  br i1 %342, label %344, label %343

343:                                              ; preds = %339
  store i32 29, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #9
  br label %374

344:                                              ; preds = %339
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #9
  %345 = load ptr, ptr %9, align 8, !tbaa !5
  %346 = load i32, ptr %29, align 4, !tbaa !11
  %347 = load i32, ptr %34, align 4, !tbaa !11
  %348 = sub nsw i32 %346, %347
  %349 = sext i32 %348 to i64
  %350 = getelementptr inbounds double, ptr %345, i64 %349
  %351 = load double, ptr %350, align 8, !tbaa !9
  store double %351, ptr %35, align 8, !tbaa !9
  %352 = load double, ptr %35, align 8, !tbaa !9
  %353 = fcmp une double %352, -3.210000e+02
  br i1 %353, label %354, label %370

354:                                              ; preds = %344
  %355 = load ptr, ptr %7, align 8, !tbaa !5
  %356 = load i32, ptr %34, align 4, !tbaa !11
  %357 = sext i32 %356 to i64
  %358 = getelementptr inbounds double, ptr %355, i64 %357
  %359 = load double, ptr %358, align 8, !tbaa !9
  %360 = load double, ptr %35, align 8, !tbaa !9
  %361 = load double, ptr %30, align 8, !tbaa !9
  %362 = call double @llvm.fmuladd.f64(double %359, double %360, double %361)
  store double %362, ptr %30, align 8, !tbaa !9
  %363 = load ptr, ptr %7, align 8, !tbaa !5
  %364 = load i32, ptr %34, align 4, !tbaa !11
  %365 = sext i32 %364 to i64
  %366 = getelementptr inbounds double, ptr %363, i64 %365
  %367 = load double, ptr %366, align 8, !tbaa !9
  %368 = load double, ptr %31, align 8, !tbaa !9
  %369 = fadd double %368, %367
  store double %369, ptr %31, align 8, !tbaa !9
  br label %370

370:                                              ; preds = %354, %344
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #9
  br label %371

371:                                              ; preds = %370
  %372 = load i32, ptr %34, align 4, !tbaa !11
  %373 = add nsw i32 %372, 1
  store i32 %373, ptr %34, align 4, !tbaa !11
  br label %339, !llvm.loop !21

374:                                              ; preds = %343
  %375 = call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %38)
  %376 = sub nsw i32 %375, 1
  %377 = load i32, ptr %29, align 4, !tbaa !11
  %378 = sub nsw i32 %376, %377
  store i32 %378, ptr %33, align 4, !tbaa !11
  %379 = load i32, ptr %33, align 4, !tbaa !11
  %380 = load i32, ptr %6, align 4, !tbaa !11
  %381 = icmp sgt i32 %379, %380
  br i1 %381, label %382, label %384

382:                                              ; preds = %374
  %383 = load i32, ptr %6, align 4, !tbaa !11
  store i32 %383, ptr %33, align 4, !tbaa !11
  br label %384

384:                                              ; preds = %382, %374
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #9
  store i32 1, ptr %36, align 4, !tbaa !11
  br label %385

385:                                              ; preds = %417, %384
  %386 = load i32, ptr %36, align 4, !tbaa !11
  %387 = load i32, ptr %33, align 4, !tbaa !11
  %388 = icmp sle i32 %386, %387
  br i1 %388, label %390, label %389

389:                                              ; preds = %385
  store i32 32, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #9
  br label %420

390:                                              ; preds = %385
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #9
  %391 = load ptr, ptr %9, align 8, !tbaa !5
  %392 = load i32, ptr %29, align 4, !tbaa !11
  %393 = load i32, ptr %36, align 4, !tbaa !11
  %394 = add nsw i32 %392, %393
  %395 = sext i32 %394 to i64
  %396 = getelementptr inbounds double, ptr %391, i64 %395
  %397 = load double, ptr %396, align 8, !tbaa !9
  store double %397, ptr %37, align 8, !tbaa !9
  %398 = load double, ptr %37, align 8, !tbaa !9
  %399 = fcmp une double %398, -3.210000e+02
  br i1 %399, label %400, label %416

400:                                              ; preds = %390
  %401 = load ptr, ptr %7, align 8, !tbaa !5
  %402 = load i32, ptr %36, align 4, !tbaa !11
  %403 = sext i32 %402 to i64
  %404 = getelementptr inbounds double, ptr %401, i64 %403
  %405 = load double, ptr %404, align 8, !tbaa !9
  %406 = load double, ptr %37, align 8, !tbaa !9
  %407 = load double, ptr %30, align 8, !tbaa !9
  %408 = call double @llvm.fmuladd.f64(double %405, double %406, double %407)
  store double %408, ptr %30, align 8, !tbaa !9
  %409 = load ptr, ptr %7, align 8, !tbaa !5
  %410 = load i32, ptr %36, align 4, !tbaa !11
  %411 = sext i32 %410 to i64
  %412 = getelementptr inbounds double, ptr %409, i64 %411
  %413 = load double, ptr %412, align 8, !tbaa !9
  %414 = load double, ptr %31, align 8, !tbaa !9
  %415 = fadd double %414, %413
  store double %415, ptr %31, align 8, !tbaa !9
  br label %416

416:                                              ; preds = %400, %390
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #9
  br label %417

417:                                              ; preds = %416
  %418 = load i32, ptr %36, align 4, !tbaa !11
  %419 = add nsw i32 %418, 1
  store i32 %419, ptr %36, align 4, !tbaa !11
  br label %385, !llvm.loop !22

420:                                              ; preds = %389
  %421 = load double, ptr %31, align 8, !tbaa !9
  %422 = fcmp ogt double %421, 0.000000e+00
  br i1 %422, label %423, label %429

423:                                              ; preds = %420
  %424 = load i32, ptr %27, align 4, !tbaa !11
  %425 = load i32, ptr %29, align 4, !tbaa !11
  %426 = load double, ptr %30, align 8, !tbaa !9
  %427 = load double, ptr %31, align 8, !tbaa !9
  %428 = fdiv double %426, %427
  call void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %38, i32 noundef %424, i32 noundef %425, double noundef %428)
  br label %429

429:                                              ; preds = %423, %420
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #9
  br label %430

430:                                              ; preds = %429, %310
  %431 = load i32, ptr %29, align 4, !tbaa !11
  %432 = add nsw i32 %431, 1
  store i32 %432, ptr %29, align 4, !tbaa !11
  br label %298, !llvm.loop !23

433:                                              ; preds = %302
  br label %434

434:                                              ; preds = %433
  %435 = load i32, ptr %27, align 4, !tbaa !11
  %436 = add nsw i32 %435, 1
  store i32 %436, ptr %27, align 4, !tbaa !11
  br label %275, !llvm.loop !24

437:                                              ; preds = %279
  %438 = load ptr, ptr %7, align 8, !tbaa !5
  %439 = icmp eq ptr %438, null
  br i1 %439, label %441, label %440

440:                                              ; preds = %437
  call void @_ZdaPv(ptr noundef %438) #11
  br label %441

441:                                              ; preds = %440, %437
  %442 = load ptr, ptr %9, align 8, !tbaa !5
  %443 = icmp eq ptr %442, null
  br i1 %443, label %445, label %444

444:                                              ; preds = %441
  call void @_ZdaPv(ptr noundef %442) #11
  br label %445

445:                                              ; preds = %444, %441
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #9
  ret void
}

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

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

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


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

@RN_TWO_PI = external local_unnamed_addr constant double, align 8

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208)) local_unnamed_addr #1 align 2

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @exp(double noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6R2Grid4BlurEd(ptr noundef nonnull align 8 dereferenceable(208) %0, double noundef %1) local_unnamed_addr #6 align 2 {
  %3 = tail call double @llvm.fmuladd.f64(double %1, double 3.000000e+00, double 5.000000e-01)
  %4 = fptosi double %3 to i32
  %5 = add i32 %4, 1
  %6 = sext i32 %5 to i64
  %7 = icmp slt i32 %4, -1
  %8 = shl nsw i64 %6, 3
  %9 = select i1 %7, i64 -1, i64 %8
  %10 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %9) #8
  %11 = tail call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %12 = tail call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %13 = icmp slt i32 %11, %12
  br i1 %13, label %14, label %16

14:                                               ; preds = %2
  %15 = tail call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  br label %16

16:                                               ; preds = %14, %2
  %.0 = phi i32 [ %15, %14 ], [ %11, %2 ]
  %17 = zext nneg i32 %.0 to i64
  %18 = icmp slt i32 %.0, 0
  %19 = shl nuw nsw i64 %17, 3
  %20 = select i1 %18, i64 -1, i64 %19
  %21 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %20) #8
  %22 = load double, ptr @RN_TWO_PI, align 8, !tbaa !5
  %23 = tail call double @sqrt(double noundef %22) #9
  %24 = fmul double %23, %1
  %25 = fmul double %24, %24
  %26 = fmul double %24, %25
  %27 = fdiv double 1.000000e+00, %26
  %28 = fmul double %1, 2.000000e+00
  %29 = fmul double %28, %1
  %.not200 = icmp slt i32 %4, 0
  br i1 %.not200, label %.preheader199, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %16
  %wide.trip.count = zext i32 %5 to i64
  br label %.lr.ph

.preheader199:                                    ; preds = %.lr.ph, %16
  %30 = tail call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %31 = icmp sgt i32 %30, 0
  br i1 %31, label %.preheader198, label %.preheader196

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %32 = trunc nuw nsw i64 %indvars.iv to i32
  %33 = mul i32 %32, %32
  %34 = sub i32 0, %33
  %35 = sitofp i32 %34 to double
  %36 = fdiv double %35, %29
  %37 = tail call double @exp(double noundef %36) #9
  %38 = fmul double %27, %37
  %39 = getelementptr inbounds double, ptr %10, i64 %indvars.iv
  store double %38, ptr %39, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader199, label %.lr.ph, !llvm.loop !9

.preheader198:                                    ; preds = %.preheader199, %._crit_edge221
  %.0151222 = phi i32 [ %52, %._crit_edge221 ], [ 0, %.preheader199 ]
  %40 = tail call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %41 = icmp sgt i32 %40, 0
  br i1 %41, label %.lr.ph203, label %.preheader197

.preheader196:                                    ; preds = %._crit_edge221, %.preheader199
  %42 = tail call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %43 = icmp sgt i32 %42, 0
  br i1 %43, label %.preheader195, label %._crit_edge247

.preheader197:                                    ; preds = %.lr.ph203, %.preheader198
  %44 = tail call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %45 = icmp sgt i32 %44, 0
  br i1 %45, label %.lr.ph220, label %._crit_edge221

.lr.ph203:                                        ; preds = %.preheader198, %.lr.ph203
  %indvars.iv249 = phi i64 [ %indvars.iv.next250, %.lr.ph203 ], [ 0, %.preheader198 ]
  %46 = trunc nuw nsw i64 %indvars.iv249 to i32
  %47 = tail call noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %46, i32 noundef %.0151222)
  %48 = getelementptr inbounds double, ptr %21, i64 %indvars.iv249
  store double %47, ptr %48, align 8, !tbaa !5
  %indvars.iv.next250 = add nuw nsw i64 %indvars.iv249, 1
  %49 = tail call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %50 = sext i32 %49 to i64
  %51 = icmp slt i64 %indvars.iv.next250, %50
  br i1 %51, label %.lr.ph203, label %.preheader197, !llvm.loop !11

._crit_edge221:                                   ; preds = %127, %.preheader197
  %52 = add nuw nsw i32 %.0151222, 1
  %53 = tail call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %.preheader198, label %.preheader196, !llvm.loop !12

.lr.ph220:                                        ; preds = %.preheader197, %127
  %indvars.iv260 = phi i64 [ %indvars.iv.next261, %127 ], [ 0, %.preheader197 ]
  %55 = trunc i64 %indvars.iv260 to i32
  %smin282 = tail call i32 @llvm.smin.i32(i32 %4, i32 %55)
  %56 = add nsw i32 %smin282, 1
  %57 = zext i32 %56 to i64
  %58 = add nsw i64 %57, -1
  %59 = trunc nuw nsw i64 %indvars.iv260 to i32
  %60 = getelementptr inbounds double, ptr %21, i64 %indvars.iv260
  %61 = load double, ptr %60, align 8, !tbaa !5
  %62 = fcmp oeq double %61, -3.210000e+02
  br i1 %62, label %127, label %63

63:                                               ; preds = %.lr.ph220
  %smin = tail call i32 @llvm.smin.i32(i32 %4, i32 %59)
  %64 = load double, ptr %10, align 8, !tbaa !5
  %65 = tail call double @llvm.fmuladd.f64(double %64, double %61, double 0.000000e+00)
  %66 = fadd double %64, 0.000000e+00
  %.not190204 = icmp slt i32 %smin, 1
  br i1 %.not190204, label %._crit_edge, label %.lr.ph208.preheader

.lr.ph208.preheader:                              ; preds = %63
  %xtraiter = and i64 %58, 1
  %67 = icmp eq i32 %56, 2
  br i1 %67, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph208.preheader.new

.lr.ph208.preheader.new:                          ; preds = %.lr.ph208.preheader
  %unroll_iter = and i64 %58, -2
  br label %.lr.ph208

._crit_edge.loopexit.unr-lcssa:                   ; preds = %101, %.lr.ph208.preheader
  %.2175.lcssa.ph = phi double [ poison, %.lr.ph208.preheader ], [ %.2175.1, %101 ]
  %.2170.lcssa.ph = phi double [ poison, %.lr.ph208.preheader ], [ %.2170.1, %101 ]
  %indvars.iv252.unr = phi i64 [ 1, %.lr.ph208.preheader ], [ %indvars.iv.next253.1, %101 ]
  %.1169206.unr = phi double [ %66, %.lr.ph208.preheader ], [ %.2170.1, %101 ]
  %.1174205.unr = phi double [ %65, %.lr.ph208.preheader ], [ %.2175.1, %101 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph208.epil

.lr.ph208.epil:                                   ; preds = %._crit_edge.loopexit.unr-lcssa
  %68 = sub nsw i64 %indvars.iv260, %indvars.iv252.unr
  %69 = getelementptr inbounds double, ptr %21, i64 %68
  %70 = load double, ptr %69, align 8, !tbaa !5
  %71 = fcmp une double %70, -3.210000e+02
  br i1 %71, label %72, label %._crit_edge

72:                                               ; preds = %.lr.ph208.epil
  %73 = getelementptr inbounds double, ptr %10, i64 %indvars.iv252.unr
  %74 = load double, ptr %73, align 8, !tbaa !5
  %75 = tail call double @llvm.fmuladd.f64(double %74, double %70, double %.1174205.unr)
  %76 = fadd double %.1169206.unr, %74
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %72, %.lr.ph208.epil, %63
  %.1174.lcssa = phi double [ %65, %63 ], [ %.2175.lcssa.ph, %._crit_edge.loopexit.unr-lcssa ], [ %75, %72 ], [ %.1174205.unr, %.lr.ph208.epil ]
  %.1169.lcssa = phi double [ %66, %63 ], [ %.2170.lcssa.ph, %._crit_edge.loopexit.unr-lcssa ], [ %76, %72 ], [ %.1169206.unr, %.lr.ph208.epil ]
  %77 = tail call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %78 = trunc i64 %indvars.iv260 to i32
  %79 = xor i32 %78, -1
  %80 = add i32 %77, %79
  %spec.select192 = tail call i32 @llvm.smin.i32(i32 %80, i32 %4)
  %.not191210 = icmp slt i32 %spec.select192, 1
  br i1 %.not191210, label %._crit_edge216, label %.lr.ph215.preheader

.lr.ph215.preheader:                              ; preds = %._crit_edge
  %81 = zext nneg i32 %spec.select192 to i64
  %invariant.gep = getelementptr inbounds double, ptr %21, i64 %indvars.iv260
  %xtraiter285 = and i64 %81, 1
  %82 = icmp eq i32 %spec.select192, 1
  br i1 %82, label %._crit_edge216.loopexit.unr-lcssa, label %.lr.ph215.preheader.new

.lr.ph215.preheader.new:                          ; preds = %.lr.ph215.preheader
  %unroll_iter289 = and i64 %81, 2147483646
  br label %.lr.ph215

.lr.ph208:                                        ; preds = %101, %.lr.ph208.preheader.new
  %indvars.iv252 = phi i64 [ 1, %.lr.ph208.preheader.new ], [ %indvars.iv.next253.1, %101 ]
  %.1169206 = phi double [ %66, %.lr.ph208.preheader.new ], [ %.2170.1, %101 ]
  %.1174205 = phi double [ %65, %.lr.ph208.preheader.new ], [ %.2175.1, %101 ]
  %niter = phi i64 [ 0, %.lr.ph208.preheader.new ], [ %niter.next.1, %101 ]
  %83 = sub nsw i64 %indvars.iv260, %indvars.iv252
  %84 = getelementptr inbounds double, ptr %21, i64 %83
  %85 = load double, ptr %84, align 8, !tbaa !5
  %86 = fcmp une double %85, -3.210000e+02
  br i1 %86, label %87, label %.lr.ph208.1

87:                                               ; preds = %.lr.ph208
  %88 = getelementptr inbounds double, ptr %10, i64 %indvars.iv252
  %89 = load double, ptr %88, align 8, !tbaa !5
  %90 = tail call double @llvm.fmuladd.f64(double %89, double %85, double %.1174205)
  %91 = fadd double %.1169206, %89
  br label %.lr.ph208.1

.lr.ph208.1:                                      ; preds = %87, %.lr.ph208
  %.2175 = phi double [ %90, %87 ], [ %.1174205, %.lr.ph208 ]
  %.2170 = phi double [ %91, %87 ], [ %.1169206, %.lr.ph208 ]
  %indvars.iv.next253 = add nuw nsw i64 %indvars.iv252, 1
  %92 = sub nsw i64 %indvars.iv260, %indvars.iv.next253
  %93 = getelementptr inbounds double, ptr %21, i64 %92
  %94 = load double, ptr %93, align 8, !tbaa !5
  %95 = fcmp une double %94, -3.210000e+02
  br i1 %95, label %96, label %101

96:                                               ; preds = %.lr.ph208.1
  %97 = getelementptr inbounds double, ptr %10, i64 %indvars.iv.next253
  %98 = load double, ptr %97, align 8, !tbaa !5
  %99 = tail call double @llvm.fmuladd.f64(double %98, double %94, double %.2175)
  %100 = fadd double %.2170, %98
  br label %101

101:                                              ; preds = %96, %.lr.ph208.1
  %.2175.1 = phi double [ %99, %96 ], [ %.2175, %.lr.ph208.1 ]
  %.2170.1 = phi double [ %100, %96 ], [ %.2170, %.lr.ph208.1 ]
  %indvars.iv.next253.1 = add nuw nsw i64 %indvars.iv252, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph208, !llvm.loop !13

._crit_edge216.loopexit.unr-lcssa:                ; preds = %124, %.lr.ph215.preheader
  %.4177.lcssa.ph = phi double [ poison, %.lr.ph215.preheader ], [ %.4177.1, %124 ]
  %.4172.lcssa.ph = phi double [ poison, %.lr.ph215.preheader ], [ %.4172.1, %124 ]
  %indvars.iv257.unr = phi i64 [ 1, %.lr.ph215.preheader ], [ %indvars.iv.next258.1, %124 ]
  %.3171212.unr = phi double [ %.1169.lcssa, %.lr.ph215.preheader ], [ %.4172.1, %124 ]
  %.3176211.unr = phi double [ %.1174.lcssa, %.lr.ph215.preheader ], [ %.4177.1, %124 ]
  %lcmp.mod286.not = icmp eq i64 %xtraiter285, 0
  br i1 %lcmp.mod286.not, label %._crit_edge216, label %.lr.ph215.epil

.lr.ph215.epil:                                   ; preds = %._crit_edge216.loopexit.unr-lcssa
  %gep.epil = getelementptr inbounds double, ptr %invariant.gep, i64 %indvars.iv257.unr
  %102 = load double, ptr %gep.epil, align 8, !tbaa !5
  %103 = fcmp une double %102, -3.210000e+02
  br i1 %103, label %104, label %._crit_edge216

104:                                              ; preds = %.lr.ph215.epil
  %105 = getelementptr inbounds double, ptr %10, i64 %indvars.iv257.unr
  %106 = load double, ptr %105, align 8, !tbaa !5
  %107 = tail call double @llvm.fmuladd.f64(double %106, double %102, double %.3176211.unr)
  %108 = fadd double %.3171212.unr, %106
  br label %._crit_edge216

._crit_edge216:                                   ; preds = %._crit_edge216.loopexit.unr-lcssa, %104, %.lr.ph215.epil, %._crit_edge
  %.3176.lcssa = phi double [ %.1174.lcssa, %._crit_edge ], [ %.4177.lcssa.ph, %._crit_edge216.loopexit.unr-lcssa ], [ %107, %104 ], [ %.3176211.unr, %.lr.ph215.epil ]
  %.3171.lcssa = phi double [ %.1169.lcssa, %._crit_edge ], [ %.4172.lcssa.ph, %._crit_edge216.loopexit.unr-lcssa ], [ %108, %104 ], [ %.3171212.unr, %.lr.ph215.epil ]
  %109 = fcmp ogt double %.3171.lcssa, 0.000000e+00
  br i1 %109, label %125, label %127

.lr.ph215:                                        ; preds = %124, %.lr.ph215.preheader.new
  %indvars.iv257 = phi i64 [ 1, %.lr.ph215.preheader.new ], [ %indvars.iv.next258.1, %124 ]
  %.3171212 = phi double [ %.1169.lcssa, %.lr.ph215.preheader.new ], [ %.4172.1, %124 ]
  %.3176211 = phi double [ %.1174.lcssa, %.lr.ph215.preheader.new ], [ %.4177.1, %124 ]
  %niter290 = phi i64 [ 0, %.lr.ph215.preheader.new ], [ %niter290.next.1, %124 ]
  %gep = getelementptr inbounds double, ptr %invariant.gep, i64 %indvars.iv257
  %110 = load double, ptr %gep, align 8, !tbaa !5
  %111 = fcmp une double %110, -3.210000e+02
  br i1 %111, label %112, label %.lr.ph215.1

112:                                              ; preds = %.lr.ph215
  %113 = getelementptr inbounds double, ptr %10, i64 %indvars.iv257
  %114 = load double, ptr %113, align 8, !tbaa !5
  %115 = tail call double @llvm.fmuladd.f64(double %114, double %110, double %.3176211)
  %116 = fadd double %.3171212, %114
  br label %.lr.ph215.1

.lr.ph215.1:                                      ; preds = %112, %.lr.ph215
  %.4177 = phi double [ %115, %112 ], [ %.3176211, %.lr.ph215 ]
  %.4172 = phi double [ %116, %112 ], [ %.3171212, %.lr.ph215 ]
  %indvars.iv.next258 = add nuw nsw i64 %indvars.iv257, 1
  %gep.1 = getelementptr inbounds double, ptr %invariant.gep, i64 %indvars.iv.next258
  %117 = load double, ptr %gep.1, align 8, !tbaa !5
  %118 = fcmp une double %117, -3.210000e+02
  br i1 %118, label %119, label %124

119:                                              ; preds = %.lr.ph215.1
  %120 = getelementptr inbounds double, ptr %10, i64 %indvars.iv.next258
  %121 = load double, ptr %120, align 8, !tbaa !5
  %122 = tail call double @llvm.fmuladd.f64(double %121, double %117, double %.4177)
  %123 = fadd double %.4172, %121
  br label %124

124:                                              ; preds = %119, %.lr.ph215.1
  %.4177.1 = phi double [ %122, %119 ], [ %.4177, %.lr.ph215.1 ]
  %.4172.1 = phi double [ %123, %119 ], [ %.4172, %.lr.ph215.1 ]
  %indvars.iv.next258.1 = add nuw nsw i64 %indvars.iv257, 2
  %niter290.next.1 = add i64 %niter290, 2
  %niter290.ncmp.1.not = icmp eq i64 %niter290.next.1, %unroll_iter289
  br i1 %niter290.ncmp.1.not, label %._crit_edge216.loopexit.unr-lcssa, label %.lr.ph215, !llvm.loop !14

125:                                              ; preds = %._crit_edge216
  %126 = fdiv double %.3176.lcssa, %.3171.lcssa
  tail call void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %59, i32 noundef %.0151222, double noundef %126)
  br label %127

127:                                              ; preds = %._crit_edge216, %125, %.lr.ph220
  %indvars.iv.next261 = add nuw nsw i64 %indvars.iv260, 1
  %128 = tail call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %129 = sext i32 %128 to i64
  %130 = icmp slt i64 %indvars.iv.next261, %129
  br i1 %130, label %.lr.ph220, label %._crit_edge221, !llvm.loop !15

.preheader195:                                    ; preds = %.preheader196, %._crit_edge245
  %.0161246 = phi i32 [ %141, %._crit_edge245 ], [ 0, %.preheader196 ]
  %131 = tail call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %132 = icmp sgt i32 %131, 0
  br i1 %132, label %.lr.ph224, label %.preheader

.preheader:                                       ; preds = %.lr.ph224, %.preheader195
  %133 = tail call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %134 = icmp sgt i32 %133, 0
  br i1 %134, label %.lr.ph244, label %._crit_edge245

.lr.ph224:                                        ; preds = %.preheader195, %.lr.ph224
  %indvars.iv263 = phi i64 [ %indvars.iv.next264, %.lr.ph224 ], [ 0, %.preheader195 ]
  %135 = trunc nuw nsw i64 %indvars.iv263 to i32
  %136 = tail call noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %.0161246, i32 noundef %135)
  %137 = getelementptr inbounds double, ptr %21, i64 %indvars.iv263
  store double %136, ptr %137, align 8, !tbaa !5
  %indvars.iv.next264 = add nuw nsw i64 %indvars.iv263, 1
  %138 = tail call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %139 = sext i32 %138 to i64
  %140 = icmp slt i64 %indvars.iv.next264, %139
  br i1 %140, label %.lr.ph224, label %.preheader, !llvm.loop !16

._crit_edge245:                                   ; preds = %216, %.preheader
  %141 = add nuw nsw i32 %.0161246, 1
  %142 = tail call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %143 = icmp slt i32 %141, %142
  br i1 %143, label %.preheader195, label %._crit_edge247, !llvm.loop !17

.lr.ph244:                                        ; preds = %.preheader, %216
  %indvars.iv275 = phi i64 [ %indvars.iv.next276, %216 ], [ 0, %.preheader ]
  %144 = trunc i64 %indvars.iv275 to i32
  %smin291 = tail call i32 @llvm.smin.i32(i32 %4, i32 %144)
  %145 = add nsw i32 %smin291, 1
  %146 = zext i32 %145 to i64
  %147 = add nsw i64 %146, -1
  %148 = trunc nuw nsw i64 %indvars.iv275 to i32
  %149 = getelementptr inbounds double, ptr %21, i64 %indvars.iv275
  %150 = load double, ptr %149, align 8, !tbaa !5
  %151 = fcmp oeq double %150, -3.210000e+02
  br i1 %151, label %216, label %152

152:                                              ; preds = %.lr.ph244
  %smin269 = tail call i32 @llvm.smin.i32(i32 %4, i32 %148)
  %153 = load double, ptr %10, align 8, !tbaa !5
  %154 = tail call double @llvm.fmuladd.f64(double %153, double %150, double 0.000000e+00)
  %155 = fadd double %153, 0.000000e+00
  %.not188225 = icmp slt i32 %smin269, 1
  br i1 %.not188225, label %._crit_edge231, label %.lr.ph230.preheader

.lr.ph230.preheader:                              ; preds = %152
  %xtraiter292 = and i64 %147, 1
  %156 = icmp eq i32 %145, 2
  br i1 %156, label %._crit_edge231.loopexit.unr-lcssa, label %.lr.ph230.preheader.new

.lr.ph230.preheader.new:                          ; preds = %.lr.ph230.preheader
  %unroll_iter296 = and i64 %147, -2
  br label %.lr.ph230

._crit_edge231.loopexit.unr-lcssa:                ; preds = %190, %.lr.ph230.preheader
  %.2156.lcssa.ph = phi double [ poison, %.lr.ph230.preheader ], [ %.2156.1, %190 ]
  %.2.lcssa.ph = phi double [ poison, %.lr.ph230.preheader ], [ %.2.1, %190 ]
  %indvars.iv266.unr = phi i64 [ 1, %.lr.ph230.preheader ], [ %indvars.iv.next267.1, %190 ]
  %.1153227.unr = phi double [ %155, %.lr.ph230.preheader ], [ %.2.1, %190 ]
  %.1155226.unr = phi double [ %154, %.lr.ph230.preheader ], [ %.2156.1, %190 ]
  %lcmp.mod293.not = icmp eq i64 %xtraiter292, 0
  br i1 %lcmp.mod293.not, label %._crit_edge231, label %.lr.ph230.epil

.lr.ph230.epil:                                   ; preds = %._crit_edge231.loopexit.unr-lcssa
  %157 = sub nsw i64 %indvars.iv275, %indvars.iv266.unr
  %158 = getelementptr inbounds double, ptr %21, i64 %157
  %159 = load double, ptr %158, align 8, !tbaa !5
  %160 = fcmp une double %159, -3.210000e+02
  br i1 %160, label %161, label %._crit_edge231

161:                                              ; preds = %.lr.ph230.epil
  %162 = getelementptr inbounds double, ptr %10, i64 %indvars.iv266.unr
  %163 = load double, ptr %162, align 8, !tbaa !5
  %164 = tail call double @llvm.fmuladd.f64(double %163, double %159, double %.1155226.unr)
  %165 = fadd double %.1153227.unr, %163
  br label %._crit_edge231

._crit_edge231:                                   ; preds = %._crit_edge231.loopexit.unr-lcssa, %161, %.lr.ph230.epil, %152
  %.1155.lcssa = phi double [ %154, %152 ], [ %.2156.lcssa.ph, %._crit_edge231.loopexit.unr-lcssa ], [ %164, %161 ], [ %.1155226.unr, %.lr.ph230.epil ]
  %.1153.lcssa = phi double [ %155, %152 ], [ %.2.lcssa.ph, %._crit_edge231.loopexit.unr-lcssa ], [ %165, %161 ], [ %.1153227.unr, %.lr.ph230.epil ]
  %166 = tail call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %167 = trunc i64 %indvars.iv275 to i32
  %168 = xor i32 %167, -1
  %169 = add i32 %166, %168
  %spec.select194 = tail call i32 @llvm.smin.i32(i32 %169, i32 %4)
  %.not189234 = icmp slt i32 %spec.select194, 1
  br i1 %.not189234, label %._crit_edge240, label %.lr.ph239.preheader

.lr.ph239.preheader:                              ; preds = %._crit_edge231
  %170 = zext nneg i32 %spec.select194 to i64
  %invariant.gep280 = getelementptr inbounds double, ptr %21, i64 %indvars.iv275
  %xtraiter298 = and i64 %170, 1
  %171 = icmp eq i32 %spec.select194, 1
  br i1 %171, label %._crit_edge240.loopexit.unr-lcssa, label %.lr.ph239.preheader.new

.lr.ph239.preheader.new:                          ; preds = %.lr.ph239.preheader
  %unroll_iter302 = and i64 %170, 2147483646
  br label %.lr.ph239

.lr.ph230:                                        ; preds = %190, %.lr.ph230.preheader.new
  %indvars.iv266 = phi i64 [ 1, %.lr.ph230.preheader.new ], [ %indvars.iv.next267.1, %190 ]
  %.1153227 = phi double [ %155, %.lr.ph230.preheader.new ], [ %.2.1, %190 ]
  %.1155226 = phi double [ %154, %.lr.ph230.preheader.new ], [ %.2156.1, %190 ]
  %niter297 = phi i64 [ 0, %.lr.ph230.preheader.new ], [ %niter297.next.1, %190 ]
  %172 = sub nsw i64 %indvars.iv275, %indvars.iv266
  %173 = getelementptr inbounds double, ptr %21, i64 %172
  %174 = load double, ptr %173, align 8, !tbaa !5
  %175 = fcmp une double %174, -3.210000e+02
  br i1 %175, label %176, label %.lr.ph230.1

176:                                              ; preds = %.lr.ph230
  %177 = getelementptr inbounds double, ptr %10, i64 %indvars.iv266
  %178 = load double, ptr %177, align 8, !tbaa !5
  %179 = tail call double @llvm.fmuladd.f64(double %178, double %174, double %.1155226)
  %180 = fadd double %.1153227, %178
  br label %.lr.ph230.1

.lr.ph230.1:                                      ; preds = %176, %.lr.ph230
  %.2156 = phi double [ %179, %176 ], [ %.1155226, %.lr.ph230 ]
  %.2 = phi double [ %180, %176 ], [ %.1153227, %.lr.ph230 ]
  %indvars.iv.next267 = add nuw nsw i64 %indvars.iv266, 1
  %181 = sub nsw i64 %indvars.iv275, %indvars.iv.next267
  %182 = getelementptr inbounds double, ptr %21, i64 %181
  %183 = load double, ptr %182, align 8, !tbaa !5
  %184 = fcmp une double %183, -3.210000e+02
  br i1 %184, label %185, label %190

185:                                              ; preds = %.lr.ph230.1
  %186 = getelementptr inbounds double, ptr %10, i64 %indvars.iv.next267
  %187 = load double, ptr %186, align 8, !tbaa !5
  %188 = tail call double @llvm.fmuladd.f64(double %187, double %183, double %.2156)
  %189 = fadd double %.2, %187
  br label %190

190:                                              ; preds = %185, %.lr.ph230.1
  %.2156.1 = phi double [ %188, %185 ], [ %.2156, %.lr.ph230.1 ]
  %.2.1 = phi double [ %189, %185 ], [ %.2, %.lr.ph230.1 ]
  %indvars.iv.next267.1 = add nuw nsw i64 %indvars.iv266, 2
  %niter297.next.1 = add i64 %niter297, 2
  %niter297.ncmp.1 = icmp eq i64 %niter297.next.1, %unroll_iter296
  br i1 %niter297.ncmp.1, label %._crit_edge231.loopexit.unr-lcssa, label %.lr.ph230, !llvm.loop !18

._crit_edge240.loopexit.unr-lcssa:                ; preds = %213, %.lr.ph239.preheader
  %.4158.lcssa.ph = phi double [ poison, %.lr.ph239.preheader ], [ %.4158.1, %213 ]
  %.4.lcssa.ph = phi double [ poison, %.lr.ph239.preheader ], [ %.4.1, %213 ]
  %indvars.iv272.unr = phi i64 [ 1, %.lr.ph239.preheader ], [ %indvars.iv.next273.1, %213 ]
  %.3236.unr = phi double [ %.1153.lcssa, %.lr.ph239.preheader ], [ %.4.1, %213 ]
  %.3157235.unr = phi double [ %.1155.lcssa, %.lr.ph239.preheader ], [ %.4158.1, %213 ]
  %lcmp.mod299.not = icmp eq i64 %xtraiter298, 0
  br i1 %lcmp.mod299.not, label %._crit_edge240, label %.lr.ph239.epil

.lr.ph239.epil:                                   ; preds = %._crit_edge240.loopexit.unr-lcssa
  %gep281.epil = getelementptr inbounds double, ptr %invariant.gep280, i64 %indvars.iv272.unr
  %191 = load double, ptr %gep281.epil, align 8, !tbaa !5
  %192 = fcmp une double %191, -3.210000e+02
  br i1 %192, label %193, label %._crit_edge240

193:                                              ; preds = %.lr.ph239.epil
  %194 = getelementptr inbounds double, ptr %10, i64 %indvars.iv272.unr
  %195 = load double, ptr %194, align 8, !tbaa !5
  %196 = tail call double @llvm.fmuladd.f64(double %195, double %191, double %.3157235.unr)
  %197 = fadd double %.3236.unr, %195
  br label %._crit_edge240

._crit_edge240:                                   ; preds = %._crit_edge240.loopexit.unr-lcssa, %193, %.lr.ph239.epil, %._crit_edge231
  %.3157.lcssa = phi double [ %.1155.lcssa, %._crit_edge231 ], [ %.4158.lcssa.ph, %._crit_edge240.loopexit.unr-lcssa ], [ %196, %193 ], [ %.3157235.unr, %.lr.ph239.epil ]
  %.3.lcssa = phi double [ %.1153.lcssa, %._crit_edge231 ], [ %.4.lcssa.ph, %._crit_edge240.loopexit.unr-lcssa ], [ %197, %193 ], [ %.3236.unr, %.lr.ph239.epil ]
  %198 = fcmp ogt double %.3.lcssa, 0.000000e+00
  br i1 %198, label %214, label %216

.lr.ph239:                                        ; preds = %213, %.lr.ph239.preheader.new
  %indvars.iv272 = phi i64 [ 1, %.lr.ph239.preheader.new ], [ %indvars.iv.next273.1, %213 ]
  %.3236 = phi double [ %.1153.lcssa, %.lr.ph239.preheader.new ], [ %.4.1, %213 ]
  %.3157235 = phi double [ %.1155.lcssa, %.lr.ph239.preheader.new ], [ %.4158.1, %213 ]
  %niter303 = phi i64 [ 0, %.lr.ph239.preheader.new ], [ %niter303.next.1, %213 ]
  %gep281 = getelementptr inbounds double, ptr %invariant.gep280, i64 %indvars.iv272
  %199 = load double, ptr %gep281, align 8, !tbaa !5
  %200 = fcmp une double %199, -3.210000e+02
  br i1 %200, label %201, label %.lr.ph239.1

201:                                              ; preds = %.lr.ph239
  %202 = getelementptr inbounds double, ptr %10, i64 %indvars.iv272
  %203 = load double, ptr %202, align 8, !tbaa !5
  %204 = tail call double @llvm.fmuladd.f64(double %203, double %199, double %.3157235)
  %205 = fadd double %.3236, %203
  br label %.lr.ph239.1

.lr.ph239.1:                                      ; preds = %201, %.lr.ph239
  %.4158 = phi double [ %204, %201 ], [ %.3157235, %.lr.ph239 ]
  %.4 = phi double [ %205, %201 ], [ %.3236, %.lr.ph239 ]
  %indvars.iv.next273 = add nuw nsw i64 %indvars.iv272, 1
  %gep281.1 = getelementptr inbounds double, ptr %invariant.gep280, i64 %indvars.iv.next273
  %206 = load double, ptr %gep281.1, align 8, !tbaa !5
  %207 = fcmp une double %206, -3.210000e+02
  br i1 %207, label %208, label %213

208:                                              ; preds = %.lr.ph239.1
  %209 = getelementptr inbounds double, ptr %10, i64 %indvars.iv.next273
  %210 = load double, ptr %209, align 8, !tbaa !5
  %211 = tail call double @llvm.fmuladd.f64(double %210, double %206, double %.4158)
  %212 = fadd double %.4, %210
  br label %213

213:                                              ; preds = %208, %.lr.ph239.1
  %.4158.1 = phi double [ %211, %208 ], [ %.4158, %.lr.ph239.1 ]
  %.4.1 = phi double [ %212, %208 ], [ %.4, %.lr.ph239.1 ]
  %indvars.iv.next273.1 = add nuw nsw i64 %indvars.iv272, 2
  %niter303.next.1 = add i64 %niter303, 2
  %niter303.ncmp.1.not = icmp eq i64 %niter303.next.1, %unroll_iter302
  br i1 %niter303.ncmp.1.not, label %._crit_edge240.loopexit.unr-lcssa, label %.lr.ph239, !llvm.loop !19

214:                                              ; preds = %._crit_edge240
  %215 = fdiv double %.3157.lcssa, %.3.lcssa
  tail call void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %.0161246, i32 noundef %148, double noundef %215)
  br label %216

216:                                              ; preds = %._crit_edge240, %214, %.lr.ph244
  %indvars.iv.next276 = add nuw nsw i64 %indvars.iv275, 1
  %217 = tail call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %218 = sext i32 %217 to i64
  %219 = icmp slt i64 %indvars.iv.next276, %218
  br i1 %219, label %.lr.ph244, label %._crit_edge245, !llvm.loop !20

._crit_edge247:                                   ; preds = %._crit_edge245, %.preheader196
  tail call void @_ZdaPv(ptr noundef nonnull %10) #10
  tail call void @_ZdaPv(ptr noundef nonnull %21) #10
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #7

attributes #0 = { nobuiltin allocsize(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 = { 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 #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 = { nobuiltin 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 #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { mustprogress nofree nounwind willreturn memory(write) "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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { nounwind }
attributes #10 = { builtin 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}


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