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

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

45:                                               ; preds = %3
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.9, i32 noundef 787, ptr noundef @.str.2)
  br label %46

46:                                               ; preds = %45, %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #9
  %47 = load i32, ptr %5, align 4, !tbaa !9
  %48 = call noundef i32 @_ZNK6R2Grid10ResolutionEi(ptr noundef nonnull align 8 dereferenceable(208) %30, i32 noundef %47)
  store i32 %48, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #9
  %49 = load i32, ptr %10, align 4, !tbaa !9
  %50 = sext i32 %49 to i64
  %51 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %50, i64 8)
  %52 = extractvalue { i64, i1 } %51, 1
  %53 = extractvalue { i64, i1 } %51, 0
  %54 = select i1 %52, i64 -1, i64 %53
  %55 = call noalias noundef nonnull ptr @_Znam(i64 noundef %54) #10
  store ptr %55, ptr %11, align 8, !tbaa !5
  %56 = load ptr, ptr %11, align 8, !tbaa !5
  %57 = icmp ne ptr %56, null
  br i1 %57, label %59, label %58

58:                                               ; preds = %46
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.10, i32 noundef 792, ptr noundef @.str.2)
  br label %59

59:                                               ; preds = %58, %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  %60 = load double, ptr @RN_TWO_PI, align 8, !tbaa !11
  %61 = call double @sqrt(double noundef %60) #9
  store double %61, ptr %12, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #9
  %62 = load double, ptr %12, align 8, !tbaa !11
  %63 = load double, ptr %7, align 8, !tbaa !11
  %64 = fmul double %62, %63
  store double %64, ptr %13, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #9
  %65 = load double, ptr %13, align 8, !tbaa !11
  %66 = load double, ptr %13, align 8, !tbaa !11
  %67 = fmul double %65, %66
  %68 = load double, ptr %13, align 8, !tbaa !11
  %69 = fmul double %67, %68
  %70 = fdiv double 1.000000e+00, %69
  store double %70, ptr %14, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #9
  %71 = load double, ptr %7, align 8, !tbaa !11
  %72 = fmul double 2.000000e+00, %71
  %73 = load double, ptr %7, align 8, !tbaa !11
  %74 = fmul double %72, %73
  store double %74, ptr %15, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #9
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %75

75:                                               ; preds = %95, %59
  %76 = load i32, ptr %16, align 4, !tbaa !9
  %77 = load i32, ptr %8, align 4, !tbaa !9
  %78 = icmp sle i32 %76, %77
  br i1 %78, label %80, label %79

79:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #9
  br label %98

80:                                               ; preds = %75
  %81 = load double, ptr %14, align 8, !tbaa !11
  %82 = load i32, ptr %16, align 4, !tbaa !9
  %83 = sub nsw i32 0, %82
  %84 = load i32, ptr %16, align 4, !tbaa !9
  %85 = mul nsw i32 %83, %84
  %86 = sitofp i32 %85 to double
  %87 = load double, ptr %15, align 8, !tbaa !11
  %88 = fdiv double %86, %87
  %89 = call double @exp(double noundef %88) #9
  %90 = fmul double %81, %89
  %91 = load ptr, ptr %9, align 8, !tbaa !5
  %92 = load i32, ptr %16, align 4, !tbaa !9
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds double, ptr %91, i64 %93
  store double %90, ptr %94, align 8, !tbaa !11
  br label %95

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

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

99:                                               ; preds = %280, %98
  %100 = load i32, ptr %17, align 4, !tbaa !9
  %101 = load i32, ptr %5, align 4, !tbaa !9
  %102 = sub nsw i32 1, %101
  %103 = call noundef i32 @_ZNK6R2Grid10ResolutionEi(ptr noundef nonnull align 8 dereferenceable(208) %30, i32 noundef %102)
  %104 = icmp slt i32 %100, %103
  br i1 %104, label %106, label %105

105:                                              ; preds = %99
  store i32 5, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #9
  br label %283

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

107:                                              ; preds = %130, %106
  %108 = load i32, ptr %19, align 4, !tbaa !9
  %109 = load i32, ptr %5, align 4, !tbaa !9
  %110 = call noundef i32 @_ZNK6R2Grid10ResolutionEi(ptr noundef nonnull align 8 dereferenceable(208) %30, i32 noundef %109)
  %111 = icmp slt i32 %108, %110
  br i1 %111, label %113, label %112

112:                                              ; preds = %107
  store i32 8, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #9
  br label %133

113:                                              ; preds = %107
  %114 = load i32, ptr %5, align 4, !tbaa !9
  %115 = icmp eq i32 %114, 0
  br i1 %115, label %116, label %120

116:                                              ; preds = %113
  %117 = load i32, ptr %19, align 4, !tbaa !9
  %118 = load i32, ptr %17, align 4, !tbaa !9
  %119 = call noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %30, i32 noundef %117, i32 noundef %118)
  br label %124

120:                                              ; preds = %113
  %121 = load i32, ptr %17, align 4, !tbaa !9
  %122 = load i32, ptr %19, align 4, !tbaa !9
  %123 = call noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %30, i32 noundef %121, i32 noundef %122)
  br label %124

124:                                              ; preds = %120, %116
  %125 = phi double [ %119, %116 ], [ %123, %120 ]
  %126 = load ptr, ptr %11, align 8, !tbaa !5
  %127 = load i32, ptr %19, align 4, !tbaa !9
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds double, ptr %126, i64 %128
  store double %125, ptr %129, align 8, !tbaa !11
  br label %130

130:                                              ; preds = %124
  %131 = load i32, ptr %19, align 4, !tbaa !9
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %19, align 4, !tbaa !9
  br label %107, !llvm.loop !15

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

134:                                              ; preds = %276, %133
  %135 = load i32, ptr %20, align 4, !tbaa !9
  %136 = load i32, ptr %5, align 4, !tbaa !9
  %137 = call noundef i32 @_ZNK6R2Grid10ResolutionEi(ptr noundef nonnull align 8 dereferenceable(208) %30, i32 noundef %136)
  %138 = icmp slt i32 %135, %137
  br i1 %138, label %140, label %139

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

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

147:                                              ; preds = %140
  br label %276

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

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

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

173:                                              ; preds = %168
  %174 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %174, ptr %24, align 4, !tbaa !9
  br label %175

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

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

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

181:                                              ; preds = %176
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #9
  %182 = load ptr, ptr %11, align 8, !tbaa !5
  %183 = load i32, ptr %20, align 4, !tbaa !9
  %184 = load i32, ptr %25, align 4, !tbaa !9
  %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 !11
  store double %188, ptr %26, align 8, !tbaa !11
  %189 = load double, ptr %26, align 8, !tbaa !11
  %190 = fcmp une double %189, -3.210000e+02
  br i1 %190, label %191, label %207

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

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

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

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

219:                                              ; preds = %211
  %220 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %220, ptr %24, align 4, !tbaa !9
  br label %221

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

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

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

227:                                              ; preds = %222
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #9
  %228 = load ptr, ptr %11, align 8, !tbaa !5
  %229 = load i32, ptr %20, align 4, !tbaa !9
  %230 = load i32, ptr %27, align 4, !tbaa !9
  %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 !11
  store double %234, ptr %28, align 8, !tbaa !11
  %235 = load double, ptr %28, align 8, !tbaa !11
  %236 = fcmp une double %235, -3.210000e+02
  br i1 %236, label %237, label %253

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

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

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

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

260:                                              ; preds = %257
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #9
  %261 = load double, ptr %21, align 8, !tbaa !11
  %262 = load double, ptr %22, align 8, !tbaa !11
  %263 = fdiv double %261, %262
  store double %263, ptr %29, align 8, !tbaa !11
  %264 = load i32, ptr %5, align 4, !tbaa !9
  %265 = icmp eq i32 %264, 0
  br i1 %265, label %266, label %270

266:                                              ; preds = %260
  %267 = load i32, ptr %20, align 4, !tbaa !9
  %268 = load i32, ptr %17, align 4, !tbaa !9
  %269 = load double, ptr %29, align 8, !tbaa !11
  call void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %30, i32 noundef %267, i32 noundef %268, double noundef %269)
  br label %274

270:                                              ; preds = %260
  %271 = load i32, ptr %17, align 4, !tbaa !9
  %272 = load i32, ptr %20, align 4, !tbaa !9
  %273 = load double, ptr %29, align 8, !tbaa !11
  call void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %30, i32 noundef %271, i32 noundef %272, double noundef %273)
  br label %274

274:                                              ; preds = %270, %266
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #9
  br label %275

275:                                              ; preds = %274, %257
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  br label %276

276:                                              ; preds = %275, %147
  %277 = load i32, ptr %20, align 4, !tbaa !9
  %278 = add nsw i32 %277, 1
  store i32 %278, ptr %20, align 4, !tbaa !9
  br label %134, !llvm.loop !18

279:                                              ; preds = %139
  br label %280

280:                                              ; preds = %279
  %281 = load i32, ptr %17, align 4, !tbaa !9
  %282 = add nsw i32 %281, 1
  store i32 %282, ptr %17, align 4, !tbaa !9
  br label %99, !llvm.loop !19

283:                                              ; preds = %105
  %284 = load ptr, ptr %9, align 8, !tbaa !5
  %285 = icmp eq ptr %284, null
  br i1 %285, label %287, label %286

286:                                              ; preds = %283
  call void @_ZdaPv(ptr noundef %284) #11
  br label %287

287:                                              ; preds = %286, %283
  %288 = load ptr, ptr %11, align 8, !tbaa !5
  %289 = icmp eq ptr %288, null
  br i1 %289, label %291, label %290

290:                                              ; preds = %287
  call void @_ZdaPv(ptr noundef %288) #11
  br label %291

291:                                              ; preds = %290, %287
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #9
  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 4, 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
  ret void
}

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

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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !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}


; 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 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 @_ZN6R2Grid4BlurEid(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %1, double noundef %2) local_unnamed_addr #6 align 2 {
  %4 = tail call double @llvm.fmuladd.f64(double %2, double 3.000000e+00, double 5.000000e-01)
  %5 = fptosi double %4 to i32
  %6 = add i32 %5, 1
  %7 = sext i32 %6 to i64
  %8 = icmp slt i32 %5, -1
  %9 = shl nsw i64 %7, 3
  %10 = select i1 %8, i64 -1, i64 %9
  %11 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %10) #8
  %12 = tail call noundef i32 @_ZNK6R2Grid10ResolutionEi(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %1)
  %13 = zext nneg i32 %12 to i64
  %14 = icmp slt i32 %12, 0
  %15 = shl nuw nsw i64 %13, 3
  %16 = select i1 %14, i64 -1, i64 %15
  %17 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %16) #8
  %18 = load double, ptr @RN_TWO_PI, align 8, !tbaa !5
  %19 = tail call double @sqrt(double noundef %18) #9
  %20 = fmul double %19, %2
  %21 = fmul double %20, %20
  %22 = fmul double %20, %21
  %23 = fdiv double 1.000000e+00, %22
  %24 = fmul double %2, 2.000000e+00
  %25 = fmul double %24, %2
  %.not120 = icmp slt i32 %5, 0
  br i1 %.not120, label %.preheader119, label %.lr.ph.preheader

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

.preheader119:                                    ; preds = %.lr.ph, %3
  %26 = sub nsw i32 1, %1
  %27 = tail call noundef i32 @_ZNK6R2Grid10ResolutionEi(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %26)
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %.preheader118.lr.ph, label %._crit_edge144

.preheader118.lr.ph:                              ; preds = %.preheader119
  %29 = icmp eq i32 %1, 0
  br label %.preheader118

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %30 = trunc nuw nsw i64 %indvars.iv to i32
  %31 = mul i32 %30, %30
  %32 = sub i32 0, %31
  %33 = sitofp i32 %32 to double
  %34 = fdiv double %33, %25
  %35 = tail call double @exp(double noundef %34) #9
  %36 = fmul double %23, %35
  %37 = getelementptr inbounds double, ptr %11, i64 %indvars.iv
  store double %36, ptr %37, 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 %.preheader119, label %.lr.ph, !llvm.loop !9

.preheader118:                                    ; preds = %.preheader118.lr.ph, %._crit_edge141
  %.097142 = phi i32 [ 0, %.preheader118.lr.ph ], [ %54, %._crit_edge141 ]
  %38 = tail call noundef i32 @_ZNK6R2Grid10ResolutionEi(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %1)
  %39 = icmp sgt i32 %38, 0
  br i1 %39, label %.lr.ph123, label %.preheader

.lr.ph123:                                        ; preds = %.preheader118
  br i1 %29, label %.lr.ph123.split.us, label %.lr.ph123.split

.lr.ph123.split.us:                               ; preds = %.lr.ph123, %.lr.ph123.split.us
  %indvars.iv150 = phi i64 [ %indvars.iv.next151, %.lr.ph123.split.us ], [ 0, %.lr.ph123 ]
  %40 = trunc nuw nsw i64 %indvars.iv150 to i32
  %41 = tail call noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %40, i32 noundef %.097142)
  %42 = getelementptr inbounds double, ptr %17, i64 %indvars.iv150
  store double %41, ptr %42, align 8, !tbaa !5
  %indvars.iv.next151 = add nuw nsw i64 %indvars.iv150, 1
  %43 = tail call noundef i32 @_ZNK6R2Grid10ResolutionEi(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef 0)
  %44 = sext i32 %43 to i64
  %45 = icmp slt i64 %indvars.iv.next151, %44
  br i1 %45, label %.lr.ph123.split.us, label %.preheader, !llvm.loop !11

.preheader:                                       ; preds = %.lr.ph123.split, %.lr.ph123.split.us, %.preheader118
  %46 = tail call noundef i32 @_ZNK6R2Grid10ResolutionEi(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %1)
  %47 = icmp sgt i32 %46, 0
  br i1 %47, label %.lr.ph140, label %._crit_edge141

.lr.ph123.split:                                  ; preds = %.lr.ph123, %.lr.ph123.split
  %indvars.iv147 = phi i64 [ %indvars.iv.next148, %.lr.ph123.split ], [ 0, %.lr.ph123 ]
  %48 = trunc nuw nsw i64 %indvars.iv147 to i32
  %49 = tail call noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %.097142, i32 noundef %48)
  %50 = getelementptr inbounds double, ptr %17, i64 %indvars.iv147
  store double %49, ptr %50, align 8, !tbaa !5
  %indvars.iv.next148 = add nuw nsw i64 %indvars.iv147, 1
  %51 = tail call noundef i32 @_ZNK6R2Grid10ResolutionEi(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %1)
  %52 = sext i32 %51 to i64
  %53 = icmp slt i64 %indvars.iv.next148, %52
  br i1 %53, label %.lr.ph123.split, label %.preheader, !llvm.loop !11

._crit_edge141:                                   ; preds = %131, %.preheader
  %54 = add nuw nsw i32 %.097142, 1
  %55 = tail call noundef i32 @_ZNK6R2Grid10ResolutionEi(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %26)
  %56 = icmp slt i32 %54, %55
  br i1 %56, label %.preheader118, label %._crit_edge144, !llvm.loop !12

.lr.ph140:                                        ; preds = %.preheader, %131
  %indvars.iv161 = phi i64 [ %indvars.iv.next162, %131 ], [ 0, %.preheader ]
  %57 = trunc i64 %indvars.iv161 to i32
  %smin168 = tail call i32 @llvm.smin.i32(i32 %5, i32 %57)
  %58 = add nsw i32 %smin168, 1
  %59 = zext i32 %58 to i64
  %60 = add nsw i64 %59, -1
  %61 = trunc nuw nsw i64 %indvars.iv161 to i32
  %62 = getelementptr inbounds double, ptr %17, i64 %indvars.iv161
  %63 = load double, ptr %62, align 8, !tbaa !5
  %64 = fcmp oeq double %63, -3.210000e+02
  br i1 %64, label %131, label %65

65:                                               ; preds = %.lr.ph140
  %smin = tail call i32 @llvm.smin.i32(i32 %5, i32 %61)
  %66 = load double, ptr %11, align 8, !tbaa !5
  %67 = tail call double @llvm.fmuladd.f64(double %66, double %63, double 0.000000e+00)
  %68 = fadd double %66, 0.000000e+00
  %.not115124 = icmp slt i32 %smin, 1
  br i1 %.not115124, label %._crit_edge, label %.lr.ph128.preheader

.lr.ph128.preheader:                              ; preds = %65
  %xtraiter = and i64 %60, 1
  %69 = icmp eq i32 %58, 2
  br i1 %69, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph128.preheader.new

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

._crit_edge.loopexit.unr-lcssa:                   ; preds = %103, %.lr.ph128.preheader
  %.2106.lcssa.ph = phi double [ poison, %.lr.ph128.preheader ], [ %.2106.1, %103 ]
  %.2.lcssa.ph = phi double [ poison, %.lr.ph128.preheader ], [ %.2.1, %103 ]
  %indvars.iv153.unr = phi i64 [ 1, %.lr.ph128.preheader ], [ %indvars.iv.next154.1, %103 ]
  %.1103126.unr = phi double [ %68, %.lr.ph128.preheader ], [ %.2.1, %103 ]
  %.1105125.unr = phi double [ %67, %.lr.ph128.preheader ], [ %.2106.1, %103 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph128.epil

.lr.ph128.epil:                                   ; preds = %._crit_edge.loopexit.unr-lcssa
  %70 = sub nsw i64 %indvars.iv161, %indvars.iv153.unr
  %71 = getelementptr inbounds double, ptr %17, i64 %70
  %72 = load double, ptr %71, align 8, !tbaa !5
  %73 = fcmp une double %72, -3.210000e+02
  br i1 %73, label %74, label %._crit_edge

74:                                               ; preds = %.lr.ph128.epil
  %75 = getelementptr inbounds double, ptr %11, i64 %indvars.iv153.unr
  %76 = load double, ptr %75, align 8, !tbaa !5
  %77 = tail call double @llvm.fmuladd.f64(double %76, double %72, double %.1105125.unr)
  %78 = fadd double %.1103126.unr, %76
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %74, %.lr.ph128.epil, %65
  %.1105.lcssa = phi double [ %67, %65 ], [ %.2106.lcssa.ph, %._crit_edge.loopexit.unr-lcssa ], [ %77, %74 ], [ %.1105125.unr, %.lr.ph128.epil ]
  %.1103.lcssa = phi double [ %68, %65 ], [ %.2.lcssa.ph, %._crit_edge.loopexit.unr-lcssa ], [ %78, %74 ], [ %.1103126.unr, %.lr.ph128.epil ]
  %79 = tail call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %80 = trunc i64 %indvars.iv161 to i32
  %81 = xor i32 %80, -1
  %82 = add i32 %79, %81
  %spec.select117 = tail call i32 @llvm.smin.i32(i32 %82, i32 %5)
  %.not116130 = icmp slt i32 %spec.select117, 1
  br i1 %.not116130, label %._crit_edge136, label %.lr.ph135.preheader

.lr.ph135.preheader:                              ; preds = %._crit_edge
  %83 = zext nneg i32 %spec.select117 to i64
  %invariant.gep = getelementptr inbounds double, ptr %17, i64 %indvars.iv161
  %xtraiter171 = and i64 %83, 1
  %84 = icmp eq i32 %spec.select117, 1
  br i1 %84, label %._crit_edge136.loopexit.unr-lcssa, label %.lr.ph135.preheader.new

.lr.ph135.preheader.new:                          ; preds = %.lr.ph135.preheader
  %unroll_iter175 = and i64 %83, 2147483646
  br label %.lr.ph135

.lr.ph128:                                        ; preds = %103, %.lr.ph128.preheader.new
  %indvars.iv153 = phi i64 [ 1, %.lr.ph128.preheader.new ], [ %indvars.iv.next154.1, %103 ]
  %.1103126 = phi double [ %68, %.lr.ph128.preheader.new ], [ %.2.1, %103 ]
  %.1105125 = phi double [ %67, %.lr.ph128.preheader.new ], [ %.2106.1, %103 ]
  %niter = phi i64 [ 0, %.lr.ph128.preheader.new ], [ %niter.next.1, %103 ]
  %85 = sub nsw i64 %indvars.iv161, %indvars.iv153
  %86 = getelementptr inbounds double, ptr %17, i64 %85
  %87 = load double, ptr %86, align 8, !tbaa !5
  %88 = fcmp une double %87, -3.210000e+02
  br i1 %88, label %89, label %.lr.ph128.1

89:                                               ; preds = %.lr.ph128
  %90 = getelementptr inbounds double, ptr %11, i64 %indvars.iv153
  %91 = load double, ptr %90, align 8, !tbaa !5
  %92 = tail call double @llvm.fmuladd.f64(double %91, double %87, double %.1105125)
  %93 = fadd double %.1103126, %91
  br label %.lr.ph128.1

.lr.ph128.1:                                      ; preds = %89, %.lr.ph128
  %.2106 = phi double [ %92, %89 ], [ %.1105125, %.lr.ph128 ]
  %.2 = phi double [ %93, %89 ], [ %.1103126, %.lr.ph128 ]
  %indvars.iv.next154 = add nuw nsw i64 %indvars.iv153, 1
  %94 = sub nsw i64 %indvars.iv161, %indvars.iv.next154
  %95 = getelementptr inbounds double, ptr %17, i64 %94
  %96 = load double, ptr %95, align 8, !tbaa !5
  %97 = fcmp une double %96, -3.210000e+02
  br i1 %97, label %98, label %103

98:                                               ; preds = %.lr.ph128.1
  %99 = getelementptr inbounds double, ptr %11, i64 %indvars.iv.next154
  %100 = load double, ptr %99, align 8, !tbaa !5
  %101 = tail call double @llvm.fmuladd.f64(double %100, double %96, double %.2106)
  %102 = fadd double %.2, %100
  br label %103

103:                                              ; preds = %98, %.lr.ph128.1
  %.2106.1 = phi double [ %101, %98 ], [ %.2106, %.lr.ph128.1 ]
  %.2.1 = phi double [ %102, %98 ], [ %.2, %.lr.ph128.1 ]
  %indvars.iv.next154.1 = add nuw nsw i64 %indvars.iv153, 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.ph128, !llvm.loop !13

._crit_edge136.loopexit.unr-lcssa:                ; preds = %126, %.lr.ph135.preheader
  %.4108.lcssa.ph = phi double [ poison, %.lr.ph135.preheader ], [ %.4108.1, %126 ]
  %.4.lcssa.ph = phi double [ poison, %.lr.ph135.preheader ], [ %.4.1, %126 ]
  %indvars.iv158.unr = phi i64 [ 1, %.lr.ph135.preheader ], [ %indvars.iv.next159.1, %126 ]
  %.3132.unr = phi double [ %.1103.lcssa, %.lr.ph135.preheader ], [ %.4.1, %126 ]
  %.3107131.unr = phi double [ %.1105.lcssa, %.lr.ph135.preheader ], [ %.4108.1, %126 ]
  %lcmp.mod172.not = icmp eq i64 %xtraiter171, 0
  br i1 %lcmp.mod172.not, label %._crit_edge136, label %.lr.ph135.epil

.lr.ph135.epil:                                   ; preds = %._crit_edge136.loopexit.unr-lcssa
  %gep.epil = getelementptr inbounds double, ptr %invariant.gep, i64 %indvars.iv158.unr
  %104 = load double, ptr %gep.epil, align 8, !tbaa !5
  %105 = fcmp une double %104, -3.210000e+02
  br i1 %105, label %106, label %._crit_edge136

106:                                              ; preds = %.lr.ph135.epil
  %107 = getelementptr inbounds double, ptr %11, i64 %indvars.iv158.unr
  %108 = load double, ptr %107, align 8, !tbaa !5
  %109 = tail call double @llvm.fmuladd.f64(double %108, double %104, double %.3107131.unr)
  %110 = fadd double %.3132.unr, %108
  br label %._crit_edge136

._crit_edge136:                                   ; preds = %._crit_edge136.loopexit.unr-lcssa, %106, %.lr.ph135.epil, %._crit_edge
  %.3107.lcssa = phi double [ %.1105.lcssa, %._crit_edge ], [ %.4108.lcssa.ph, %._crit_edge136.loopexit.unr-lcssa ], [ %109, %106 ], [ %.3107131.unr, %.lr.ph135.epil ]
  %.3.lcssa = phi double [ %.1103.lcssa, %._crit_edge ], [ %.4.lcssa.ph, %._crit_edge136.loopexit.unr-lcssa ], [ %110, %106 ], [ %.3132.unr, %.lr.ph135.epil ]
  %111 = fcmp ogt double %.3.lcssa, 0.000000e+00
  br i1 %111, label %127, label %131

.lr.ph135:                                        ; preds = %126, %.lr.ph135.preheader.new
  %indvars.iv158 = phi i64 [ 1, %.lr.ph135.preheader.new ], [ %indvars.iv.next159.1, %126 ]
  %.3132 = phi double [ %.1103.lcssa, %.lr.ph135.preheader.new ], [ %.4.1, %126 ]
  %.3107131 = phi double [ %.1105.lcssa, %.lr.ph135.preheader.new ], [ %.4108.1, %126 ]
  %niter176 = phi i64 [ 0, %.lr.ph135.preheader.new ], [ %niter176.next.1, %126 ]
  %gep = getelementptr inbounds double, ptr %invariant.gep, i64 %indvars.iv158
  %112 = load double, ptr %gep, align 8, !tbaa !5
  %113 = fcmp une double %112, -3.210000e+02
  br i1 %113, label %114, label %.lr.ph135.1

114:                                              ; preds = %.lr.ph135
  %115 = getelementptr inbounds double, ptr %11, i64 %indvars.iv158
  %116 = load double, ptr %115, align 8, !tbaa !5
  %117 = tail call double @llvm.fmuladd.f64(double %116, double %112, double %.3107131)
  %118 = fadd double %.3132, %116
  br label %.lr.ph135.1

.lr.ph135.1:                                      ; preds = %114, %.lr.ph135
  %.4108 = phi double [ %117, %114 ], [ %.3107131, %.lr.ph135 ]
  %.4 = phi double [ %118, %114 ], [ %.3132, %.lr.ph135 ]
  %indvars.iv.next159 = add nuw nsw i64 %indvars.iv158, 1
  %gep.1 = getelementptr inbounds double, ptr %invariant.gep, i64 %indvars.iv.next159
  %119 = load double, ptr %gep.1, align 8, !tbaa !5
  %120 = fcmp une double %119, -3.210000e+02
  br i1 %120, label %121, label %126

121:                                              ; preds = %.lr.ph135.1
  %122 = getelementptr inbounds double, ptr %11, i64 %indvars.iv.next159
  %123 = load double, ptr %122, align 8, !tbaa !5
  %124 = tail call double @llvm.fmuladd.f64(double %123, double %119, double %.4108)
  %125 = fadd double %.4, %123
  br label %126

126:                                              ; preds = %121, %.lr.ph135.1
  %.4108.1 = phi double [ %124, %121 ], [ %.4108, %.lr.ph135.1 ]
  %.4.1 = phi double [ %125, %121 ], [ %.4, %.lr.ph135.1 ]
  %indvars.iv.next159.1 = add nuw nsw i64 %indvars.iv158, 2
  %niter176.next.1 = add i64 %niter176, 2
  %niter176.ncmp.1.not = icmp eq i64 %niter176.next.1, %unroll_iter175
  br i1 %niter176.ncmp.1.not, label %._crit_edge136.loopexit.unr-lcssa, label %.lr.ph135, !llvm.loop !14

127:                                              ; preds = %._crit_edge136
  %128 = fdiv double %.3107.lcssa, %.3.lcssa
  br i1 %29, label %129, label %130

129:                                              ; preds = %127
  tail call void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %61, i32 noundef %.097142, double noundef %128)
  br label %131

130:                                              ; preds = %127
  tail call void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %.097142, i32 noundef %61, double noundef %128)
  br label %131

131:                                              ; preds = %._crit_edge136, %130, %129, %.lr.ph140
  %indvars.iv.next162 = add nuw nsw i64 %indvars.iv161, 1
  %132 = tail call noundef i32 @_ZNK6R2Grid10ResolutionEi(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %1)
  %133 = sext i32 %132 to i64
  %134 = icmp slt i64 %indvars.iv.next162, %133
  br i1 %134, label %.lr.ph140, label %._crit_edge141, !llvm.loop !15

._crit_edge144:                                   ; preds = %._crit_edge141, %.preheader119
  tail call void @_ZdaPv(ptr noundef nonnull %11) #10
  tail call void @_ZdaPv(ptr noundef nonnull %17) #10
  ret void
}

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

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


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