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

; 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
@RN_EPSILON = external global double, align 8
@RN_TWO_PI = external constant double, align 8
@.str.11 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [7 x i8], align 1

; 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 uwtable
declare dso_local noundef i32 @_Z8RNIsZerodd(double noundef, double noundef) #4

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6R3Grid4BlurEd(ptr noundef nonnull align 8 dereferenceable(592) %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 i32, align 4
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca double, align 8
  %30 = alloca double, align 8
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca double, align 8
  %39 = alloca double, align 8
  %40 = alloca i32, align 4
  %41 = alloca i32, align 4
  %42 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store double %1, ptr %4, align 8, !tbaa !9
  %43 = load ptr, ptr %3, align 8
  %44 = load double, ptr %4, align 8, !tbaa !9
  %45 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %46 = call noundef i32 @_Z8RNIsZerodd(double noundef %44, double noundef %45)
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %48, label %49

48:                                               ; preds = %2
  br label %572

49:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #9
  %50 = load double, ptr %4, align 8, !tbaa !9
  store double %50, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #9
  %51 = load double, ptr %5, align 8, !tbaa !9
  %52 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %51, double 5.000000e-01)
  %53 = fptosi double %52 to i32
  store i32 %53, ptr %6, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #9
  %54 = load i32, ptr %6, align 4, !tbaa !11
  %55 = add nsw i32 %54, 1
  %56 = sext i32 %55 to i64
  %57 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %56, i64 8)
  %58 = extractvalue { i64, i1 } %57, 1
  %59 = extractvalue { i64, i1 } %57, 0
  %60 = select i1 %58, i64 -1, i64 %59
  %61 = call noalias noundef nonnull ptr @_Znam(i64 noundef %60) #10
  store ptr %61, ptr %7, align 8, !tbaa !5
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = icmp ne ptr %62, null
  br i1 %63, label %65, label %64

64:                                               ; preds = %49
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.11, i32 noundef 664, ptr noundef @.str.2)
  br label %65

65:                                               ; preds = %64, %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  %66 = call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %43)
  store i32 %66, ptr %8, align 4, !tbaa !11
  %67 = load i32, ptr %8, align 4, !tbaa !11
  %68 = call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %43)
  %69 = icmp slt i32 %67, %68
  br i1 %69, label %70, label %72

70:                                               ; preds = %65
  %71 = call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %43)
  store i32 %71, ptr %8, align 4, !tbaa !11
  br label %72

72:                                               ; preds = %70, %65
  %73 = load i32, ptr %8, align 4, !tbaa !11
  %74 = call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %43)
  %75 = icmp slt i32 %73, %74
  br i1 %75, label %76, label %78

76:                                               ; preds = %72
  %77 = call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %43)
  store i32 %77, ptr %8, align 4, !tbaa !11
  br label %78

78:                                               ; preds = %76, %72
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #9
  %79 = load i32, ptr %8, align 4, !tbaa !11
  %80 = sext i32 %79 to i64
  %81 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %80, i64 8)
  %82 = extractvalue { i64, i1 } %81, 1
  %83 = extractvalue { i64, i1 } %81, 0
  %84 = select i1 %82, i64 -1, i64 %83
  %85 = call noalias noundef nonnull ptr @_Znam(i64 noundef %84) #10
  store ptr %85, ptr %9, align 8, !tbaa !5
  %86 = load ptr, ptr %9, align 8, !tbaa !5
  %87 = icmp ne ptr %86, null
  br i1 %87, label %89, label %88

88:                                               ; preds = %78
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.12, i32 noundef 671, ptr noundef @.str.2)
  br label %89

89:                                               ; preds = %88, %78
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #9
  %90 = load double, ptr @RN_TWO_PI, align 8, !tbaa !9
  %91 = call double @sqrt(double noundef %90) #9
  store double %91, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #9
  %92 = load double, ptr %10, align 8, !tbaa !9
  %93 = load double, ptr %5, align 8, !tbaa !9
  %94 = fmul double %92, %93
  store double %94, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  %95 = load double, ptr %11, align 8, !tbaa !9
  %96 = load double, ptr %11, align 8, !tbaa !9
  %97 = fmul double %95, %96
  %98 = load double, ptr %11, align 8, !tbaa !9
  %99 = fmul double %97, %98
  %100 = fdiv double 1.000000e+00, %99
  store double %100, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #9
  %101 = load double, ptr %5, align 8, !tbaa !9
  %102 = fmul double 2.000000e+00, %101
  %103 = load double, ptr %5, align 8, !tbaa !9
  %104 = fmul double %102, %103
  store double %104, 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 %105

105:                                              ; preds = %125, %89
  %106 = load i32, ptr %14, align 4, !tbaa !11
  %107 = load i32, ptr %6, align 4, !tbaa !11
  %108 = icmp sle i32 %106, %107
  br i1 %108, label %110, label %109

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

110:                                              ; preds = %105
  %111 = load double, ptr %12, align 8, !tbaa !9
  %112 = load i32, ptr %14, align 4, !tbaa !11
  %113 = sub nsw i32 0, %112
  %114 = load i32, ptr %14, align 4, !tbaa !11
  %115 = mul nsw i32 %113, %114
  %116 = sitofp i32 %115 to double
  %117 = load double, ptr %13, align 8, !tbaa !9
  %118 = fdiv double %116, %117
  %119 = call double @exp(double noundef %118) #9
  %120 = fmul double %111, %119
  %121 = load ptr, ptr %7, align 8, !tbaa !5
  %122 = load i32, ptr %14, align 4, !tbaa !11
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds double, ptr %121, i64 %123
  store double %120, ptr %124, align 8, !tbaa !9
  br label %125

125:                                              ; preds = %110
  %126 = load i32, ptr %14, align 4, !tbaa !11
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %14, align 4, !tbaa !11
  br label %105, !llvm.loop !13

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

129:                                              ; preds = %270, %128
  %130 = load i32, ptr %15, align 4, !tbaa !11
  %131 = call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %43)
  %132 = icmp slt i32 %130, %131
  br i1 %132, label %134, label %133

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

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

135:                                              ; preds = %266, %134
  %136 = load i32, ptr %17, align 4, !tbaa !11
  %137 = call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %43)
  %138 = icmp slt i32 %136, %137
  br i1 %138, label %140, label %139

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

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

141:                                              ; preds = %155, %140
  %142 = load i32, ptr %18, align 4, !tbaa !11
  %143 = call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %43)
  %144 = icmp slt i32 %142, %143
  br i1 %144, label %146, label %145

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

146:                                              ; preds = %141
  %147 = load i32, ptr %18, align 4, !tbaa !11
  %148 = load i32, ptr %17, align 4, !tbaa !11
  %149 = load i32, ptr %15, align 4, !tbaa !11
  %150 = call noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %43, i32 noundef %147, i32 noundef %148, i32 noundef %149)
  %151 = load ptr, ptr %9, align 8, !tbaa !5
  %152 = load i32, ptr %18, align 4, !tbaa !11
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds double, ptr %151, i64 %153
  store double %150, ptr %154, align 8, !tbaa !9
  br label %155

155:                                              ; preds = %146
  %156 = load i32, ptr %18, align 4, !tbaa !11
  %157 = add nsw i32 %156, 1
  store i32 %157, ptr %18, align 4, !tbaa !11
  br label %141, !llvm.loop !15

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

159:                                              ; preds = %262, %158
  %160 = load i32, ptr %19, align 4, !tbaa !11
  %161 = call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %43)
  %162 = icmp slt i32 %160, %161
  br i1 %162, label %164, label %163

163:                                              ; preds = %159
  store i32 14, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #9
  br label %265

164:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #9
  %165 = load ptr, ptr %7, align 8, !tbaa !5
  %166 = getelementptr inbounds double, ptr %165, i64 0
  %167 = load double, ptr %166, align 8, !tbaa !9
  %168 = load ptr, ptr %9, align 8, !tbaa !5
  %169 = load i32, ptr %19, align 4, !tbaa !11
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds double, ptr %168, i64 %170
  %172 = load double, ptr %171, align 8, !tbaa !9
  %173 = fmul double %167, %172
  store double %173, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #9
  %174 = load ptr, ptr %7, align 8, !tbaa !5
  %175 = getelementptr inbounds double, ptr %174, i64 0
  %176 = load double, ptr %175, align 8, !tbaa !9
  store double %176, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #9
  %177 = load i32, ptr %19, align 4, !tbaa !11
  store i32 %177, ptr %22, align 4, !tbaa !11
  %178 = load i32, ptr %22, align 4, !tbaa !11
  %179 = load i32, ptr %6, align 4, !tbaa !11
  %180 = icmp sgt i32 %178, %179
  br i1 %180, label %181, label %183

181:                                              ; preds = %164
  %182 = load i32, ptr %6, align 4, !tbaa !11
  store i32 %182, ptr %22, align 4, !tbaa !11
  br label %183

183:                                              ; preds = %181, %164
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #9
  store i32 1, ptr %23, align 4, !tbaa !11
  br label %184

184:                                              ; preds = %211, %183
  %185 = load i32, ptr %23, align 4, !tbaa !11
  %186 = load i32, ptr %22, align 4, !tbaa !11
  %187 = icmp sle i32 %185, %186
  br i1 %187, label %189, label %188

188:                                              ; preds = %184
  store i32 17, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #9
  br label %214

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

211:                                              ; preds = %189
  %212 = load i32, ptr %23, align 4, !tbaa !11
  %213 = add nsw i32 %212, 1
  store i32 %213, ptr %23, align 4, !tbaa !11
  br label %184, !llvm.loop !16

214:                                              ; preds = %188
  %215 = call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %43)
  %216 = sub nsw i32 %215, 1
  %217 = load i32, ptr %19, align 4, !tbaa !11
  %218 = sub nsw i32 %216, %217
  store i32 %218, ptr %22, align 4, !tbaa !11
  %219 = load i32, ptr %22, align 4, !tbaa !11
  %220 = load i32, ptr %6, align 4, !tbaa !11
  %221 = icmp sgt i32 %219, %220
  br i1 %221, label %222, label %224

222:                                              ; preds = %214
  %223 = load i32, ptr %6, align 4, !tbaa !11
  store i32 %223, ptr %22, align 4, !tbaa !11
  br label %224

224:                                              ; preds = %222, %214
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #9
  store i32 1, ptr %24, align 4, !tbaa !11
  br label %225

225:                                              ; preds = %252, %224
  %226 = load i32, ptr %24, align 4, !tbaa !11
  %227 = load i32, ptr %22, align 4, !tbaa !11
  %228 = icmp sle i32 %226, %227
  br i1 %228, label %230, label %229

229:                                              ; preds = %225
  store i32 20, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #9
  br label %255

230:                                              ; preds = %225
  %231 = load ptr, ptr %7, align 8, !tbaa !5
  %232 = load i32, ptr %24, align 4, !tbaa !11
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds double, ptr %231, i64 %233
  %235 = load double, ptr %234, align 8, !tbaa !9
  %236 = load ptr, ptr %9, align 8, !tbaa !5
  %237 = load i32, ptr %19, align 4, !tbaa !11
  %238 = load i32, ptr %24, align 4, !tbaa !11
  %239 = add nsw i32 %237, %238
  %240 = sext i32 %239 to i64
  %241 = getelementptr inbounds double, ptr %236, i64 %240
  %242 = load double, ptr %241, align 8, !tbaa !9
  %243 = load double, ptr %20, align 8, !tbaa !9
  %244 = call double @llvm.fmuladd.f64(double %235, double %242, double %243)
  store double %244, ptr %20, align 8, !tbaa !9
  %245 = load ptr, ptr %7, align 8, !tbaa !5
  %246 = load i32, ptr %24, align 4, !tbaa !11
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds double, ptr %245, i64 %247
  %249 = load double, ptr %248, align 8, !tbaa !9
  %250 = load double, ptr %21, align 8, !tbaa !9
  %251 = fadd double %250, %249
  store double %251, ptr %21, align 8, !tbaa !9
  br label %252

252:                                              ; preds = %230
  %253 = load i32, ptr %24, align 4, !tbaa !11
  %254 = add nsw i32 %253, 1
  store i32 %254, ptr %24, align 4, !tbaa !11
  br label %225, !llvm.loop !17

255:                                              ; preds = %229
  %256 = load i32, ptr %19, align 4, !tbaa !11
  %257 = load i32, ptr %17, align 4, !tbaa !11
  %258 = load i32, ptr %15, align 4, !tbaa !11
  %259 = load double, ptr %20, align 8, !tbaa !9
  %260 = load double, ptr %21, align 8, !tbaa !9
  %261 = fdiv double %259, %260
  call void @_ZN6R3Grid12SetGridValueEiiid(ptr noundef nonnull align 8 dereferenceable(592) %43, i32 noundef %256, i32 noundef %257, i32 noundef %258, double noundef %261)
  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
  br label %262

262:                                              ; preds = %255
  %263 = load i32, ptr %19, align 4, !tbaa !11
  %264 = add nsw i32 %263, 1
  store i32 %264, ptr %19, align 4, !tbaa !11
  br label %159, !llvm.loop !18

265:                                              ; preds = %163
  br label %266

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

269:                                              ; preds = %139
  br label %270

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

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

274:                                              ; preds = %415, %273
  %275 = load i32, ptr %25, align 4, !tbaa !11
  %276 = call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %43)
  %277 = icmp slt i32 %275, %276
  br i1 %277, label %279, label %278

278:                                              ; preds = %274
  store i32 23, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #9
  br label %418

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

280:                                              ; preds = %411, %279
  %281 = load i32, ptr %26, align 4, !tbaa !11
  %282 = call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %43)
  %283 = icmp slt i32 %281, %282
  br i1 %283, label %285, label %284

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

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

286:                                              ; preds = %300, %285
  %287 = load i32, ptr %27, align 4, !tbaa !11
  %288 = call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %43)
  %289 = icmp slt i32 %287, %288
  br i1 %289, label %291, label %290

290:                                              ; preds = %286
  store i32 29, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #9
  br label %303

291:                                              ; preds = %286
  %292 = load i32, ptr %26, align 4, !tbaa !11
  %293 = load i32, ptr %27, align 4, !tbaa !11
  %294 = load i32, ptr %25, align 4, !tbaa !11
  %295 = call noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %43, i32 noundef %292, i32 noundef %293, i32 noundef %294)
  %296 = load ptr, ptr %9, align 8, !tbaa !5
  %297 = load i32, ptr %27, align 4, !tbaa !11
  %298 = sext i32 %297 to i64
  %299 = getelementptr inbounds double, ptr %296, i64 %298
  store double %295, ptr %299, align 8, !tbaa !9
  br label %300

300:                                              ; preds = %291
  %301 = load i32, ptr %27, align 4, !tbaa !11
  %302 = add nsw i32 %301, 1
  store i32 %302, ptr %27, align 4, !tbaa !11
  br label %286, !llvm.loop !21

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

304:                                              ; preds = %407, %303
  %305 = load i32, ptr %28, align 4, !tbaa !11
  %306 = call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %43)
  %307 = icmp slt i32 %305, %306
  br i1 %307, label %309, label %308

308:                                              ; preds = %304
  store i32 32, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #9
  br label %410

309:                                              ; preds = %304
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #9
  %310 = load ptr, ptr %7, align 8, !tbaa !5
  %311 = getelementptr inbounds double, ptr %310, i64 0
  %312 = load double, ptr %311, align 8, !tbaa !9
  %313 = load ptr, ptr %9, align 8, !tbaa !5
  %314 = load i32, ptr %28, align 4, !tbaa !11
  %315 = sext i32 %314 to i64
  %316 = getelementptr inbounds double, ptr %313, i64 %315
  %317 = load double, ptr %316, align 8, !tbaa !9
  %318 = fmul double %312, %317
  store double %318, ptr %29, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #9
  %319 = load ptr, ptr %7, align 8, !tbaa !5
  %320 = getelementptr inbounds double, ptr %319, i64 0
  %321 = load double, ptr %320, align 8, !tbaa !9
  store double %321, ptr %30, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #9
  %322 = load i32, ptr %28, align 4, !tbaa !11
  store i32 %322, ptr %31, align 4, !tbaa !11
  %323 = load i32, ptr %31, align 4, !tbaa !11
  %324 = load i32, ptr %6, align 4, !tbaa !11
  %325 = icmp sgt i32 %323, %324
  br i1 %325, label %326, label %328

326:                                              ; preds = %309
  %327 = load i32, ptr %6, align 4, !tbaa !11
  store i32 %327, ptr %31, align 4, !tbaa !11
  br label %328

328:                                              ; preds = %326, %309
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #9
  store i32 1, ptr %32, align 4, !tbaa !11
  br label %329

329:                                              ; preds = %356, %328
  %330 = load i32, ptr %32, align 4, !tbaa !11
  %331 = load i32, ptr %31, align 4, !tbaa !11
  %332 = icmp sle i32 %330, %331
  br i1 %332, label %334, label %333

333:                                              ; preds = %329
  store i32 35, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #9
  br label %359

334:                                              ; preds = %329
  %335 = load ptr, ptr %7, align 8, !tbaa !5
  %336 = load i32, ptr %32, align 4, !tbaa !11
  %337 = sext i32 %336 to i64
  %338 = getelementptr inbounds double, ptr %335, i64 %337
  %339 = load double, ptr %338, align 8, !tbaa !9
  %340 = load ptr, ptr %9, align 8, !tbaa !5
  %341 = load i32, ptr %28, align 4, !tbaa !11
  %342 = load i32, ptr %32, align 4, !tbaa !11
  %343 = sub nsw i32 %341, %342
  %344 = sext i32 %343 to i64
  %345 = getelementptr inbounds double, ptr %340, i64 %344
  %346 = load double, ptr %345, align 8, !tbaa !9
  %347 = load double, ptr %29, align 8, !tbaa !9
  %348 = call double @llvm.fmuladd.f64(double %339, double %346, double %347)
  store double %348, ptr %29, align 8, !tbaa !9
  %349 = load ptr, ptr %7, align 8, !tbaa !5
  %350 = load i32, ptr %32, align 4, !tbaa !11
  %351 = sext i32 %350 to i64
  %352 = getelementptr inbounds double, ptr %349, i64 %351
  %353 = load double, ptr %352, align 8, !tbaa !9
  %354 = load double, ptr %30, align 8, !tbaa !9
  %355 = fadd double %354, %353
  store double %355, ptr %30, align 8, !tbaa !9
  br label %356

356:                                              ; preds = %334
  %357 = load i32, ptr %32, align 4, !tbaa !11
  %358 = add nsw i32 %357, 1
  store i32 %358, ptr %32, align 4, !tbaa !11
  br label %329, !llvm.loop !22

359:                                              ; preds = %333
  %360 = call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %43)
  %361 = sub nsw i32 %360, 1
  %362 = load i32, ptr %28, align 4, !tbaa !11
  %363 = sub nsw i32 %361, %362
  store i32 %363, ptr %31, align 4, !tbaa !11
  %364 = load i32, ptr %31, align 4, !tbaa !11
  %365 = load i32, ptr %6, align 4, !tbaa !11
  %366 = icmp sgt i32 %364, %365
  br i1 %366, label %367, label %369

367:                                              ; preds = %359
  %368 = load i32, ptr %6, align 4, !tbaa !11
  store i32 %368, ptr %31, align 4, !tbaa !11
  br label %369

369:                                              ; preds = %367, %359
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #9
  store i32 1, ptr %33, align 4, !tbaa !11
  br label %370

370:                                              ; preds = %397, %369
  %371 = load i32, ptr %33, align 4, !tbaa !11
  %372 = load i32, ptr %31, align 4, !tbaa !11
  %373 = icmp sle i32 %371, %372
  br i1 %373, label %375, label %374

374:                                              ; preds = %370
  store i32 38, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #9
  br label %400

375:                                              ; preds = %370
  %376 = load ptr, ptr %7, align 8, !tbaa !5
  %377 = load i32, ptr %33, align 4, !tbaa !11
  %378 = sext i32 %377 to i64
  %379 = getelementptr inbounds double, ptr %376, i64 %378
  %380 = load double, ptr %379, align 8, !tbaa !9
  %381 = load ptr, ptr %9, align 8, !tbaa !5
  %382 = load i32, ptr %28, align 4, !tbaa !11
  %383 = load i32, ptr %33, align 4, !tbaa !11
  %384 = add nsw i32 %382, %383
  %385 = sext i32 %384 to i64
  %386 = getelementptr inbounds double, ptr %381, i64 %385
  %387 = load double, ptr %386, align 8, !tbaa !9
  %388 = load double, ptr %29, align 8, !tbaa !9
  %389 = call double @llvm.fmuladd.f64(double %380, double %387, double %388)
  store double %389, ptr %29, align 8, !tbaa !9
  %390 = load ptr, ptr %7, align 8, !tbaa !5
  %391 = load i32, ptr %33, align 4, !tbaa !11
  %392 = sext i32 %391 to i64
  %393 = getelementptr inbounds double, ptr %390, i64 %392
  %394 = load double, ptr %393, align 8, !tbaa !9
  %395 = load double, ptr %30, align 8, !tbaa !9
  %396 = fadd double %395, %394
  store double %396, ptr %30, align 8, !tbaa !9
  br label %397

397:                                              ; preds = %375
  %398 = load i32, ptr %33, align 4, !tbaa !11
  %399 = add nsw i32 %398, 1
  store i32 %399, ptr %33, align 4, !tbaa !11
  br label %370, !llvm.loop !23

400:                                              ; preds = %374
  %401 = load i32, ptr %26, align 4, !tbaa !11
  %402 = load i32, ptr %28, align 4, !tbaa !11
  %403 = load i32, ptr %25, align 4, !tbaa !11
  %404 = load double, ptr %29, align 8, !tbaa !9
  %405 = load double, ptr %30, align 8, !tbaa !9
  %406 = fdiv double %404, %405
  call void @_ZN6R3Grid12SetGridValueEiiid(ptr noundef nonnull align 8 dereferenceable(592) %43, i32 noundef %401, i32 noundef %402, i32 noundef %403, double noundef %406)
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #9
  br label %407

407:                                              ; preds = %400
  %408 = load i32, ptr %28, align 4, !tbaa !11
  %409 = add nsw i32 %408, 1
  store i32 %409, ptr %28, align 4, !tbaa !11
  br label %304, !llvm.loop !24

410:                                              ; preds = %308
  br label %411

411:                                              ; preds = %410
  %412 = load i32, ptr %26, align 4, !tbaa !11
  %413 = add nsw i32 %412, 1
  store i32 %413, ptr %26, align 4, !tbaa !11
  br label %280, !llvm.loop !25

414:                                              ; preds = %284
  br label %415

415:                                              ; preds = %414
  %416 = load i32, ptr %25, align 4, !tbaa !11
  %417 = add nsw i32 %416, 1
  store i32 %417, ptr %25, align 4, !tbaa !11
  br label %274, !llvm.loop !26

418:                                              ; preds = %278
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #9
  store i32 0, ptr %34, align 4, !tbaa !11
  br label %419

419:                                              ; preds = %560, %418
  %420 = load i32, ptr %34, align 4, !tbaa !11
  %421 = call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %43)
  %422 = icmp slt i32 %420, %421
  br i1 %422, label %424, label %423

423:                                              ; preds = %419
  store i32 41, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #9
  br label %563

424:                                              ; preds = %419
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #9
  store i32 0, ptr %35, align 4, !tbaa !11
  br label %425

425:                                              ; preds = %556, %424
  %426 = load i32, ptr %35, align 4, !tbaa !11
  %427 = call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %43)
  %428 = icmp slt i32 %426, %427
  br i1 %428, label %430, label %429

429:                                              ; preds = %425
  store i32 44, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #9
  br label %559

430:                                              ; preds = %425
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #9
  store i32 0, ptr %36, align 4, !tbaa !11
  br label %431

431:                                              ; preds = %445, %430
  %432 = load i32, ptr %36, align 4, !tbaa !11
  %433 = call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %43)
  %434 = icmp slt i32 %432, %433
  br i1 %434, label %436, label %435

435:                                              ; preds = %431
  store i32 47, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #9
  br label %448

436:                                              ; preds = %431
  %437 = load i32, ptr %35, align 4, !tbaa !11
  %438 = load i32, ptr %34, align 4, !tbaa !11
  %439 = load i32, ptr %36, align 4, !tbaa !11
  %440 = call noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %43, i32 noundef %437, i32 noundef %438, i32 noundef %439)
  %441 = load ptr, ptr %9, align 8, !tbaa !5
  %442 = load i32, ptr %36, align 4, !tbaa !11
  %443 = sext i32 %442 to i64
  %444 = getelementptr inbounds double, ptr %441, i64 %443
  store double %440, ptr %444, align 8, !tbaa !9
  br label %445

445:                                              ; preds = %436
  %446 = load i32, ptr %36, align 4, !tbaa !11
  %447 = add nsw i32 %446, 1
  store i32 %447, ptr %36, align 4, !tbaa !11
  br label %431, !llvm.loop !27

448:                                              ; preds = %435
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #9
  store i32 0, ptr %37, align 4, !tbaa !11
  br label %449

449:                                              ; preds = %552, %448
  %450 = load i32, ptr %37, align 4, !tbaa !11
  %451 = call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %43)
  %452 = icmp slt i32 %450, %451
  br i1 %452, label %454, label %453

453:                                              ; preds = %449
  store i32 50, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #9
  br label %555

454:                                              ; preds = %449
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #9
  %455 = load ptr, ptr %7, align 8, !tbaa !5
  %456 = getelementptr inbounds double, ptr %455, i64 0
  %457 = load double, ptr %456, align 8, !tbaa !9
  %458 = load ptr, ptr %9, align 8, !tbaa !5
  %459 = load i32, ptr %37, align 4, !tbaa !11
  %460 = sext i32 %459 to i64
  %461 = getelementptr inbounds double, ptr %458, i64 %460
  %462 = load double, ptr %461, align 8, !tbaa !9
  %463 = fmul double %457, %462
  store double %463, ptr %38, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #9
  %464 = load ptr, ptr %7, align 8, !tbaa !5
  %465 = getelementptr inbounds double, ptr %464, i64 0
  %466 = load double, ptr %465, align 8, !tbaa !9
  store double %466, ptr %39, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #9
  %467 = load i32, ptr %37, align 4, !tbaa !11
  store i32 %467, ptr %40, align 4, !tbaa !11
  %468 = load i32, ptr %40, align 4, !tbaa !11
  %469 = load i32, ptr %6, align 4, !tbaa !11
  %470 = icmp sgt i32 %468, %469
  br i1 %470, label %471, label %473

471:                                              ; preds = %454
  %472 = load i32, ptr %6, align 4, !tbaa !11
  store i32 %472, ptr %40, align 4, !tbaa !11
  br label %473

473:                                              ; preds = %471, %454
  call void @llvm.lifetime.start.p0(i64 4, ptr %41) #9
  store i32 1, ptr %41, align 4, !tbaa !11
  br label %474

474:                                              ; preds = %501, %473
  %475 = load i32, ptr %41, align 4, !tbaa !11
  %476 = load i32, ptr %40, align 4, !tbaa !11
  %477 = icmp sle i32 %475, %476
  br i1 %477, label %479, label %478

478:                                              ; preds = %474
  store i32 53, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #9
  br label %504

479:                                              ; preds = %474
  %480 = load ptr, ptr %7, align 8, !tbaa !5
  %481 = load i32, ptr %41, align 4, !tbaa !11
  %482 = sext i32 %481 to i64
  %483 = getelementptr inbounds double, ptr %480, i64 %482
  %484 = load double, ptr %483, align 8, !tbaa !9
  %485 = load ptr, ptr %9, align 8, !tbaa !5
  %486 = load i32, ptr %37, align 4, !tbaa !11
  %487 = load i32, ptr %41, align 4, !tbaa !11
  %488 = sub nsw i32 %486, %487
  %489 = sext i32 %488 to i64
  %490 = getelementptr inbounds double, ptr %485, i64 %489
  %491 = load double, ptr %490, align 8, !tbaa !9
  %492 = load double, ptr %38, align 8, !tbaa !9
  %493 = call double @llvm.fmuladd.f64(double %484, double %491, double %492)
  store double %493, ptr %38, align 8, !tbaa !9
  %494 = load ptr, ptr %7, align 8, !tbaa !5
  %495 = load i32, ptr %41, align 4, !tbaa !11
  %496 = sext i32 %495 to i64
  %497 = getelementptr inbounds double, ptr %494, i64 %496
  %498 = load double, ptr %497, align 8, !tbaa !9
  %499 = load double, ptr %39, align 8, !tbaa !9
  %500 = fadd double %499, %498
  store double %500, ptr %39, align 8, !tbaa !9
  br label %501

501:                                              ; preds = %479
  %502 = load i32, ptr %41, align 4, !tbaa !11
  %503 = add nsw i32 %502, 1
  store i32 %503, ptr %41, align 4, !tbaa !11
  br label %474, !llvm.loop !28

504:                                              ; preds = %478
  %505 = call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %43)
  %506 = sub nsw i32 %505, 1
  %507 = load i32, ptr %37, align 4, !tbaa !11
  %508 = sub nsw i32 %506, %507
  store i32 %508, ptr %40, align 4, !tbaa !11
  %509 = load i32, ptr %40, align 4, !tbaa !11
  %510 = load i32, ptr %6, align 4, !tbaa !11
  %511 = icmp sgt i32 %509, %510
  br i1 %511, label %512, label %514

512:                                              ; preds = %504
  %513 = load i32, ptr %6, align 4, !tbaa !11
  store i32 %513, ptr %40, align 4, !tbaa !11
  br label %514

514:                                              ; preds = %512, %504
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #9
  store i32 1, ptr %42, align 4, !tbaa !11
  br label %515

515:                                              ; preds = %542, %514
  %516 = load i32, ptr %42, align 4, !tbaa !11
  %517 = load i32, ptr %40, align 4, !tbaa !11
  %518 = icmp sle i32 %516, %517
  br i1 %518, label %520, label %519

519:                                              ; preds = %515
  store i32 56, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #9
  br label %545

520:                                              ; preds = %515
  %521 = load ptr, ptr %7, align 8, !tbaa !5
  %522 = load i32, ptr %42, align 4, !tbaa !11
  %523 = sext i32 %522 to i64
  %524 = getelementptr inbounds double, ptr %521, i64 %523
  %525 = load double, ptr %524, align 8, !tbaa !9
  %526 = load ptr, ptr %9, align 8, !tbaa !5
  %527 = load i32, ptr %37, align 4, !tbaa !11
  %528 = load i32, ptr %42, align 4, !tbaa !11
  %529 = add nsw i32 %527, %528
  %530 = sext i32 %529 to i64
  %531 = getelementptr inbounds double, ptr %526, i64 %530
  %532 = load double, ptr %531, align 8, !tbaa !9
  %533 = load double, ptr %38, align 8, !tbaa !9
  %534 = call double @llvm.fmuladd.f64(double %525, double %532, double %533)
  store double %534, ptr %38, align 8, !tbaa !9
  %535 = load ptr, ptr %7, align 8, !tbaa !5
  %536 = load i32, ptr %42, align 4, !tbaa !11
  %537 = sext i32 %536 to i64
  %538 = getelementptr inbounds double, ptr %535, i64 %537
  %539 = load double, ptr %538, align 8, !tbaa !9
  %540 = load double, ptr %39, align 8, !tbaa !9
  %541 = fadd double %540, %539
  store double %541, ptr %39, align 8, !tbaa !9
  br label %542

542:                                              ; preds = %520
  %543 = load i32, ptr %42, align 4, !tbaa !11
  %544 = add nsw i32 %543, 1
  store i32 %544, ptr %42, align 4, !tbaa !11
  br label %515, !llvm.loop !29

545:                                              ; preds = %519
  %546 = load i32, ptr %35, align 4, !tbaa !11
  %547 = load i32, ptr %34, align 4, !tbaa !11
  %548 = load i32, ptr %37, align 4, !tbaa !11
  %549 = load double, ptr %38, align 8, !tbaa !9
  %550 = load double, ptr %39, align 8, !tbaa !9
  %551 = fdiv double %549, %550
  call void @_ZN6R3Grid12SetGridValueEiiid(ptr noundef nonnull align 8 dereferenceable(592) %43, i32 noundef %546, i32 noundef %547, i32 noundef %548, double noundef %551)
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #9
  br label %552

552:                                              ; preds = %545
  %553 = load i32, ptr %37, align 4, !tbaa !11
  %554 = add nsw i32 %553, 1
  store i32 %554, ptr %37, align 4, !tbaa !11
  br label %449, !llvm.loop !30

555:                                              ; preds = %453
  br label %556

556:                                              ; preds = %555
  %557 = load i32, ptr %35, align 4, !tbaa !11
  %558 = add nsw i32 %557, 1
  store i32 %558, ptr %35, align 4, !tbaa !11
  br label %425, !llvm.loop !31

559:                                              ; preds = %429
  br label %560

560:                                              ; preds = %559
  %561 = load i32, ptr %34, align 4, !tbaa !11
  %562 = add nsw i32 %561, 1
  store i32 %562, ptr %34, align 4, !tbaa !11
  br label %419, !llvm.loop !32

563:                                              ; preds = %423
  %564 = load ptr, ptr %7, align 8, !tbaa !5
  %565 = icmp eq ptr %564, null
  br i1 %565, label %567, label %566

566:                                              ; preds = %563
  call void @_ZdaPv(ptr noundef %564) #11
  br label %567

567:                                              ; preds = %566, %563
  %568 = load ptr, ptr %9, align 8, !tbaa !5
  %569 = icmp eq ptr %568, null
  br i1 %569, label %571, label %570

570:                                              ; preds = %567
  call void @_ZdaPv(ptr noundef %568) #11
  br label %571

571:                                              ; preds = %570, %567
  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
  br label %572

572:                                              ; preds = %571, %48
  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 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 = { 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 #6 = { 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 #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}
!25 = distinct !{!25, !14}
!26 = distinct !{!26, !14}
!27 = distinct !{!27, !14}
!28 = distinct !{!28, !14}
!29 = distinct !{!29, !14}
!30 = distinct !{!30, !14}
!31 = distinct !{!31, !14}
!32 = distinct !{!32, !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_EPSILON = external local_unnamed_addr global double, align 8
@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 uwtable
declare dso_local noundef i32 @_Z8RNIsZerodd(double noundef, double noundef) local_unnamed_addr #1

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

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

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

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

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

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

; 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: inlinehint mustprogress uwtable
declare dso_local void @_ZN6R3Grid12SetGridValueEiiid(ptr noundef nonnull align 8 dereferenceable(592), i32 noundef, i32 noundef, i32 noundef, double noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6R3Grid4BlurEd(ptr noundef nonnull align 8 dereferenceable(592) %0, double noundef %1) local_unnamed_addr #6 align 2 {
  %3 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %4 = tail call noundef i32 @_Z8RNIsZerodd(double noundef %1, double noundef %3)
  %.not = icmp eq i32 %4, 0
  br i1 %.not, label %5, label %301

5:                                                ; preds = %2
  %6 = tail call double @llvm.fmuladd.f64(double %1, double 3.000000e+00, double 5.000000e-01)
  %7 = fptosi double %6 to i32
  %8 = add i32 %7, 1
  %9 = sext i32 %8 to i64
  %10 = icmp slt i32 %7, -1
  %11 = shl nsw i64 %9, 3
  %12 = select i1 %10, i64 -1, i64 %11
  %13 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %12) #8
  %14 = tail call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %15 = tail call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %16 = icmp slt i32 %14, %15
  br i1 %16, label %17, label %19

17:                                               ; preds = %5
  %18 = tail call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  br label %19

19:                                               ; preds = %17, %5
  %.0224 = phi i32 [ %18, %17 ], [ %14, %5 ]
  %20 = tail call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %21 = icmp slt i32 %.0224, %20
  br i1 %21, label %22, label %24

22:                                               ; preds = %19
  %23 = tail call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  br label %24

24:                                               ; preds = %22, %19
  %.1225 = phi i32 [ %23, %22 ], [ %.0224, %19 ]
  %25 = zext nneg i32 %.1225 to i64
  %26 = icmp slt i32 %.1225, 0
  %27 = shl nuw nsw i64 %25, 3
  %28 = select i1 %26, i64 -1, i64 %27
  %29 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %28) #8
  %30 = load double, ptr @RN_TWO_PI, align 8, !tbaa !5
  %31 = tail call double @sqrt(double noundef %30) #9
  %32 = fmul double %31, %1
  %33 = fmul double %32, %32
  %34 = fmul double %32, %33
  %35 = fdiv double 1.000000e+00, %34
  %36 = fmul double %1, 2.000000e+00
  %37 = fmul double %36, %1
  %.not231254 = icmp slt i32 %7, 0
  br i1 %.not231254, label %.preheader253, label %.lr.ph.preheader

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

.preheader253:                                    ; preds = %.lr.ph, %24
  %38 = tail call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %39 = icmp sgt i32 %38, 0
  br i1 %39, label %.preheader252, label %.preheader249

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %40 = trunc nuw nsw i64 %indvars.iv to i32
  %41 = mul i32 %40, %40
  %42 = sub i32 0, %41
  %43 = sitofp i32 %42 to double
  %44 = fdiv double %43, %37
  %45 = tail call double @exp(double noundef %44) #9
  %46 = fmul double %35, %45
  %47 = getelementptr inbounds double, ptr %13, i64 %indvars.iv
  store double %46, ptr %47, 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 %.preheader253, label %.lr.ph, !llvm.loop !9

.preheader252:                                    ; preds = %.preheader253, %._crit_edge277
  %.0222278 = phi i32 [ %54, %._crit_edge277 ], [ 0, %.preheader253 ]
  %48 = tail call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %49 = icmp sgt i32 %48, 0
  br i1 %49, label %.preheader251, label %._crit_edge277

.preheader249:                                    ; preds = %._crit_edge277, %.preheader253
  %50 = tail call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %51 = icmp sgt i32 %50, 0
  br i1 %51, label %.preheader248, label %.preheader245

.preheader251:                                    ; preds = %.preheader252, %._crit_edge275
  %.0221276 = phi i32 [ %65, %._crit_edge275 ], [ 0, %.preheader252 ]
  %52 = tail call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %53 = icmp sgt i32 %52, 0
  br i1 %53, label %.lr.ph257, label %.preheader250

._crit_edge277:                                   ; preds = %._crit_edge275, %.preheader252
  %54 = add nuw nsw i32 %.0222278, 1
  %55 = tail call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %56 = icmp slt i32 %54, %55
  br i1 %56, label %.preheader252, label %.preheader249, !llvm.loop !11

.preheader250:                                    ; preds = %.lr.ph257, %.preheader251
  %57 = tail call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %58 = icmp sgt i32 %57, 0
  br i1 %58, label %.lr.ph274.preheader, label %._crit_edge275

.lr.ph274.preheader:                              ; preds = %.preheader250
  %.pre = load double, ptr %13, align 8, !tbaa !5
  br label %.lr.ph274

.lr.ph257:                                        ; preds = %.preheader251, %.lr.ph257
  %indvars.iv344 = phi i64 [ %indvars.iv.next345, %.lr.ph257 ], [ 0, %.preheader251 ]
  %59 = trunc nuw nsw i64 %indvars.iv344 to i32
  %60 = tail call noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %0, i32 noundef %59, i32 noundef %.0221276, i32 noundef %.0222278)
  %61 = getelementptr inbounds double, ptr %29, i64 %indvars.iv344
  store double %60, ptr %61, align 8, !tbaa !5
  %indvars.iv.next345 = add nuw nsw i64 %indvars.iv344, 1
  %62 = tail call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %63 = sext i32 %62 to i64
  %64 = icmp slt i64 %indvars.iv.next345, %63
  br i1 %64, label %.lr.ph257, label %.preheader250, !llvm.loop !12

._crit_edge275:                                   ; preds = %._crit_edge270, %.preheader250
  %65 = add nuw nsw i32 %.0221276, 1
  %66 = tail call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %67 = icmp slt i32 %65, %66
  br i1 %67, label %.preheader251, label %._crit_edge277, !llvm.loop !13

.lr.ph274:                                        ; preds = %.lr.ph274.preheader, %._crit_edge270
  %indvars.iv355 = phi i64 [ 0, %.lr.ph274.preheader ], [ %indvars.iv.next356, %._crit_edge270 ]
  %68 = trunc i64 %indvars.iv355 to i32
  %smin427 = tail call i32 @llvm.smin.i32(i32 %7, i32 %68)
  %69 = add nsw i32 %smin427, 1
  %70 = zext i32 %69 to i64
  %71 = add nsw i64 %70, -1
  %72 = trunc nuw nsw i64 %indvars.iv355 to i32
  %smin = tail call i32 @llvm.smin.i32(i32 %7, i32 %72)
  %73 = getelementptr inbounds double, ptr %29, i64 %indvars.iv355
  %74 = load double, ptr %73, align 8, !tbaa !5
  %75 = fmul double %.pre, %74
  %.not236258 = icmp slt i32 %smin, 1
  br i1 %.not236258, label %._crit_edge, label %.lr.ph262.preheader

.lr.ph262.preheader:                              ; preds = %.lr.ph274
  %xtraiter = and i64 %71, 1
  %76 = icmp eq i32 %69, 2
  br i1 %76, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph262.preheader.new

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

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph262, %.lr.ph262.preheader
  %.lcssa424.ph = phi double [ poison, %.lr.ph262.preheader ], [ %102, %.lr.ph262 ]
  %.lcssa423.ph = phi double [ poison, %.lr.ph262.preheader ], [ %103, %.lr.ph262 ]
  %indvars.iv347.unr = phi i64 [ 1, %.lr.ph262.preheader ], [ %indvars.iv.next348.1, %.lr.ph262 ]
  %.0215260.unr = phi double [ %.pre, %.lr.ph262.preheader ], [ %103, %.lr.ph262 ]
  %.0217259.unr = phi double [ %75, %.lr.ph262.preheader ], [ %102, %.lr.ph262 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph262.epil

.lr.ph262.epil:                                   ; preds = %._crit_edge.loopexit.unr-lcssa
  %77 = getelementptr inbounds double, ptr %13, i64 %indvars.iv347.unr
  %78 = load double, ptr %77, align 8, !tbaa !5
  %79 = sub nsw i64 %indvars.iv355, %indvars.iv347.unr
  %80 = getelementptr inbounds double, ptr %29, i64 %79
  %81 = load double, ptr %80, align 8, !tbaa !5
  %82 = tail call double @llvm.fmuladd.f64(double %78, double %81, double %.0217259.unr)
  %83 = fadd double %.0215260.unr, %78
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph262.epil, %._crit_edge.loopexit.unr-lcssa, %.lr.ph274
  %.0217.lcssa = phi double [ %75, %.lr.ph274 ], [ %.lcssa424.ph, %._crit_edge.loopexit.unr-lcssa ], [ %82, %.lr.ph262.epil ]
  %.0215.lcssa = phi double [ %.pre, %.lr.ph274 ], [ %.lcssa423.ph, %._crit_edge.loopexit.unr-lcssa ], [ %83, %.lr.ph262.epil ]
  %84 = tail call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %85 = trunc i64 %indvars.iv355 to i32
  %86 = xor i32 %85, -1
  %87 = add i32 %84, %86
  %spec.select238 = tail call i32 @llvm.smin.i32(i32 %87, i32 %7)
  %.not237264 = icmp slt i32 %spec.select238, 1
  br i1 %.not237264, label %._crit_edge270, label %.lr.ph269.preheader

.lr.ph269.preheader:                              ; preds = %._crit_edge
  %88 = zext nneg i32 %spec.select238 to i64
  %invariant.gep = getelementptr inbounds double, ptr %29, i64 %indvars.iv355
  %xtraiter430 = and i64 %88, 3
  %89 = icmp ult i32 %spec.select238, 4
  br i1 %89, label %._crit_edge270.loopexit.unr-lcssa, label %.lr.ph269.preheader.new

.lr.ph269.preheader.new:                          ; preds = %.lr.ph269.preheader
  %unroll_iter434 = and i64 %88, 2147483644
  br label %.lr.ph269

.lr.ph262:                                        ; preds = %.lr.ph262, %.lr.ph262.preheader.new
  %indvars.iv347 = phi i64 [ 1, %.lr.ph262.preheader.new ], [ %indvars.iv.next348.1, %.lr.ph262 ]
  %.0215260 = phi double [ %.pre, %.lr.ph262.preheader.new ], [ %103, %.lr.ph262 ]
  %.0217259 = phi double [ %75, %.lr.ph262.preheader.new ], [ %102, %.lr.ph262 ]
  %niter = phi i64 [ 0, %.lr.ph262.preheader.new ], [ %niter.next.1, %.lr.ph262 ]
  %90 = getelementptr inbounds double, ptr %13, i64 %indvars.iv347
  %91 = load double, ptr %90, align 8, !tbaa !5
  %92 = sub nsw i64 %indvars.iv355, %indvars.iv347
  %93 = getelementptr inbounds double, ptr %29, i64 %92
  %94 = load double, ptr %93, align 8, !tbaa !5
  %95 = tail call double @llvm.fmuladd.f64(double %91, double %94, double %.0217259)
  %96 = fadd double %.0215260, %91
  %indvars.iv.next348 = add nuw nsw i64 %indvars.iv347, 1
  %97 = getelementptr inbounds double, ptr %13, i64 %indvars.iv.next348
  %98 = load double, ptr %97, align 8, !tbaa !5
  %99 = sub nsw i64 %indvars.iv355, %indvars.iv.next348
  %100 = getelementptr inbounds double, ptr %29, i64 %99
  %101 = load double, ptr %100, align 8, !tbaa !5
  %102 = tail call double @llvm.fmuladd.f64(double %98, double %101, double %95)
  %103 = fadd double %96, %98
  %indvars.iv.next348.1 = add nuw nsw i64 %indvars.iv347, 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.ph262, !llvm.loop !14

._crit_edge270.loopexit.unr-lcssa:                ; preds = %.lr.ph269, %.lr.ph269.preheader
  %.lcssa426.ph = phi double [ poison, %.lr.ph269.preheader ], [ %131, %.lr.ph269 ]
  %.lcssa425.ph = phi double [ poison, %.lr.ph269.preheader ], [ %132, %.lr.ph269 ]
  %indvars.iv352.unr = phi i64 [ 1, %.lr.ph269.preheader ], [ %indvars.iv.next353.3, %.lr.ph269 ]
  %.1216266.unr = phi double [ %.0215.lcssa, %.lr.ph269.preheader ], [ %132, %.lr.ph269 ]
  %.1218265.unr = phi double [ %.0217.lcssa, %.lr.ph269.preheader ], [ %131, %.lr.ph269 ]
  %lcmp.mod431.not = icmp eq i64 %xtraiter430, 0
  br i1 %lcmp.mod431.not, label %._crit_edge270, label %.lr.ph269.epil

.lr.ph269.epil:                                   ; preds = %._crit_edge270.loopexit.unr-lcssa, %.lr.ph269.epil
  %indvars.iv352.epil = phi i64 [ %indvars.iv.next353.epil, %.lr.ph269.epil ], [ %indvars.iv352.unr, %._crit_edge270.loopexit.unr-lcssa ]
  %.1216266.epil = phi double [ %108, %.lr.ph269.epil ], [ %.1216266.unr, %._crit_edge270.loopexit.unr-lcssa ]
  %.1218265.epil = phi double [ %107, %.lr.ph269.epil ], [ %.1218265.unr, %._crit_edge270.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph269.epil ], [ 0, %._crit_edge270.loopexit.unr-lcssa ]
  %104 = getelementptr inbounds double, ptr %13, i64 %indvars.iv352.epil
  %105 = load double, ptr %104, align 8, !tbaa !5
  %gep.epil = getelementptr inbounds double, ptr %invariant.gep, i64 %indvars.iv352.epil
  %106 = load double, ptr %gep.epil, align 8, !tbaa !5
  %107 = tail call double @llvm.fmuladd.f64(double %105, double %106, double %.1218265.epil)
  %108 = fadd double %.1216266.epil, %105
  %indvars.iv.next353.epil = add nuw nsw i64 %indvars.iv352.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter430
  br i1 %epil.iter.cmp.not, label %._crit_edge270, label %.lr.ph269.epil, !llvm.loop !15

._crit_edge270:                                   ; preds = %._crit_edge270.loopexit.unr-lcssa, %.lr.ph269.epil, %._crit_edge
  %.1218.lcssa = phi double [ %.0217.lcssa, %._crit_edge ], [ %.lcssa426.ph, %._crit_edge270.loopexit.unr-lcssa ], [ %107, %.lr.ph269.epil ]
  %.1216.lcssa = phi double [ %.0215.lcssa, %._crit_edge ], [ %.lcssa425.ph, %._crit_edge270.loopexit.unr-lcssa ], [ %108, %.lr.ph269.epil ]
  %109 = fdiv double %.1218.lcssa, %.1216.lcssa
  tail call void @_ZN6R3Grid12SetGridValueEiiid(ptr noundef nonnull align 8 dereferenceable(592) %0, i32 noundef %72, i32 noundef %.0221276, i32 noundef %.0222278, double noundef %109)
  %indvars.iv.next356 = add nuw nsw i64 %indvars.iv355, 1
  %110 = tail call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %111 = sext i32 %110 to i64
  %112 = icmp slt i64 %indvars.iv.next356, %111
  br i1 %112, label %.lr.ph274, label %._crit_edge275, !llvm.loop !17

.lr.ph269:                                        ; preds = %.lr.ph269, %.lr.ph269.preheader.new
  %indvars.iv352 = phi i64 [ 1, %.lr.ph269.preheader.new ], [ %indvars.iv.next353.3, %.lr.ph269 ]
  %.1216266 = phi double [ %.0215.lcssa, %.lr.ph269.preheader.new ], [ %132, %.lr.ph269 ]
  %.1218265 = phi double [ %.0217.lcssa, %.lr.ph269.preheader.new ], [ %131, %.lr.ph269 ]
  %niter435 = phi i64 [ 0, %.lr.ph269.preheader.new ], [ %niter435.next.3, %.lr.ph269 ]
  %113 = getelementptr inbounds double, ptr %13, i64 %indvars.iv352
  %114 = load double, ptr %113, align 8, !tbaa !5
  %gep = getelementptr inbounds double, ptr %invariant.gep, i64 %indvars.iv352
  %115 = load double, ptr %gep, align 8, !tbaa !5
  %116 = tail call double @llvm.fmuladd.f64(double %114, double %115, double %.1218265)
  %117 = fadd double %.1216266, %114
  %indvars.iv.next353 = add nuw nsw i64 %indvars.iv352, 1
  %118 = getelementptr inbounds double, ptr %13, i64 %indvars.iv.next353
  %119 = load double, ptr %118, align 8, !tbaa !5
  %gep.1 = getelementptr inbounds double, ptr %invariant.gep, i64 %indvars.iv.next353
  %120 = load double, ptr %gep.1, align 8, !tbaa !5
  %121 = tail call double @llvm.fmuladd.f64(double %119, double %120, double %116)
  %122 = fadd double %117, %119
  %indvars.iv.next353.1 = add nuw nsw i64 %indvars.iv352, 2
  %123 = getelementptr inbounds double, ptr %13, i64 %indvars.iv.next353.1
  %124 = load double, ptr %123, align 8, !tbaa !5
  %gep.2 = getelementptr inbounds double, ptr %invariant.gep, i64 %indvars.iv.next353.1
  %125 = load double, ptr %gep.2, align 8, !tbaa !5
  %126 = tail call double @llvm.fmuladd.f64(double %124, double %125, double %121)
  %127 = fadd double %122, %124
  %indvars.iv.next353.2 = add nuw nsw i64 %indvars.iv352, 3
  %128 = getelementptr inbounds double, ptr %13, i64 %indvars.iv.next353.2
  %129 = load double, ptr %128, align 8, !tbaa !5
  %gep.3 = getelementptr inbounds double, ptr %invariant.gep, i64 %indvars.iv.next353.2
  %130 = load double, ptr %gep.3, align 8, !tbaa !5
  %131 = tail call double @llvm.fmuladd.f64(double %129, double %130, double %126)
  %132 = fadd double %127, %129
  %indvars.iv.next353.3 = add nuw nsw i64 %indvars.iv352, 4
  %niter435.next.3 = add i64 %niter435, 4
  %niter435.ncmp.3.not = icmp eq i64 %niter435.next.3, %unroll_iter434
  br i1 %niter435.ncmp.3.not, label %._crit_edge270.loopexit.unr-lcssa, label %.lr.ph269, !llvm.loop !18

.preheader248:                                    ; preds = %.preheader249, %._crit_edge303
  %.0210304 = phi i32 [ %139, %._crit_edge303 ], [ 0, %.preheader249 ]
  %133 = tail call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %134 = icmp sgt i32 %133, 0
  br i1 %134, label %.preheader247, label %._crit_edge303

.preheader245:                                    ; preds = %._crit_edge303, %.preheader249
  %135 = tail call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %136 = icmp sgt i32 %135, 0
  br i1 %136, label %.preheader244, label %._crit_edge331

.preheader247:                                    ; preds = %.preheader248, %._crit_edge301
  %.0209302 = phi i32 [ %150, %._crit_edge301 ], [ 0, %.preheader248 ]
  %137 = tail call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %138 = icmp sgt i32 %137, 0
  br i1 %138, label %.lr.ph280, label %.preheader246

._crit_edge303:                                   ; preds = %._crit_edge301, %.preheader248
  %139 = add nuw nsw i32 %.0210304, 1
  %140 = tail call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %141 = icmp slt i32 %139, %140
  br i1 %141, label %.preheader248, label %.preheader245, !llvm.loop !19

.preheader246:                                    ; preds = %.lr.ph280, %.preheader247
  %142 = tail call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %143 = icmp sgt i32 %142, 0
  br i1 %143, label %.lr.ph300.preheader, label %._crit_edge301

.lr.ph300.preheader:                              ; preds = %.preheader246
  %.pre388 = load double, ptr %13, align 8, !tbaa !5
  br label %.lr.ph300

.lr.ph280:                                        ; preds = %.preheader247, %.lr.ph280
  %indvars.iv358 = phi i64 [ %indvars.iv.next359, %.lr.ph280 ], [ 0, %.preheader247 ]
  %144 = trunc nuw nsw i64 %indvars.iv358 to i32
  %145 = tail call noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %0, i32 noundef %.0209302, i32 noundef %144, i32 noundef %.0210304)
  %146 = getelementptr inbounds double, ptr %29, i64 %indvars.iv358
  store double %145, ptr %146, align 8, !tbaa !5
  %indvars.iv.next359 = add nuw nsw i64 %indvars.iv358, 1
  %147 = tail call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %148 = sext i32 %147 to i64
  %149 = icmp slt i64 %indvars.iv.next359, %148
  br i1 %149, label %.lr.ph280, label %.preheader246, !llvm.loop !20

._crit_edge301:                                   ; preds = %._crit_edge296, %.preheader246
  %150 = add nuw nsw i32 %.0209302, 1
  %151 = tail call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %152 = icmp slt i32 %150, %151
  br i1 %152, label %.preheader247, label %._crit_edge303, !llvm.loop !21

.lr.ph300:                                        ; preds = %.lr.ph300.preheader, %._crit_edge296
  %indvars.iv370 = phi i64 [ 0, %.lr.ph300.preheader ], [ %indvars.iv.next371, %._crit_edge296 ]
  %153 = trunc i64 %indvars.iv370 to i32
  %smin436 = tail call i32 @llvm.smin.i32(i32 %7, i32 %153)
  %154 = add nsw i32 %smin436, 1
  %155 = zext i32 %154 to i64
  %156 = add nsw i64 %155, -1
  %157 = trunc nuw nsw i64 %indvars.iv370 to i32
  %smin364 = tail call i32 @llvm.smin.i32(i32 %7, i32 %157)
  %158 = getelementptr inbounds double, ptr %29, i64 %indvars.iv370
  %159 = load double, ptr %158, align 8, !tbaa !5
  %160 = fmul double %.pre388, %159
  %.not234281 = icmp slt i32 %smin364, 1
  br i1 %.not234281, label %._crit_edge287, label %.lr.ph286.preheader

.lr.ph286.preheader:                              ; preds = %.lr.ph300
  %xtraiter437 = and i64 %156, 1
  %161 = icmp eq i32 %154, 2
  br i1 %161, label %._crit_edge287.loopexit.unr-lcssa, label %.lr.ph286.preheader.new

.lr.ph286.preheader.new:                          ; preds = %.lr.ph286.preheader
  %unroll_iter442 = and i64 %156, -2
  br label %.lr.ph286

._crit_edge287.loopexit.unr-lcssa:                ; preds = %.lr.ph286, %.lr.ph286.preheader
  %.lcssa420.ph = phi double [ poison, %.lr.ph286.preheader ], [ %187, %.lr.ph286 ]
  %.lcssa419.ph = phi double [ poison, %.lr.ph286.preheader ], [ %188, %.lr.ph286 ]
  %indvars.iv361.unr = phi i64 [ 1, %.lr.ph286.preheader ], [ %indvars.iv.next362.1, %.lr.ph286 ]
  %.0203283.unr = phi double [ %.pre388, %.lr.ph286.preheader ], [ %188, %.lr.ph286 ]
  %.0205282.unr = phi double [ %160, %.lr.ph286.preheader ], [ %187, %.lr.ph286 ]
  %lcmp.mod439.not = icmp eq i64 %xtraiter437, 0
  br i1 %lcmp.mod439.not, label %._crit_edge287, label %.lr.ph286.epil

.lr.ph286.epil:                                   ; preds = %._crit_edge287.loopexit.unr-lcssa
  %162 = getelementptr inbounds double, ptr %13, i64 %indvars.iv361.unr
  %163 = load double, ptr %162, align 8, !tbaa !5
  %164 = sub nsw i64 %indvars.iv370, %indvars.iv361.unr
  %165 = getelementptr inbounds double, ptr %29, i64 %164
  %166 = load double, ptr %165, align 8, !tbaa !5
  %167 = tail call double @llvm.fmuladd.f64(double %163, double %166, double %.0205282.unr)
  %168 = fadd double %.0203283.unr, %163
  br label %._crit_edge287

._crit_edge287:                                   ; preds = %.lr.ph286.epil, %._crit_edge287.loopexit.unr-lcssa, %.lr.ph300
  %.0205.lcssa = phi double [ %160, %.lr.ph300 ], [ %.lcssa420.ph, %._crit_edge287.loopexit.unr-lcssa ], [ %167, %.lr.ph286.epil ]
  %.0203.lcssa = phi double [ %.pre388, %.lr.ph300 ], [ %.lcssa419.ph, %._crit_edge287.loopexit.unr-lcssa ], [ %168, %.lr.ph286.epil ]
  %169 = tail call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %170 = trunc i64 %indvars.iv370 to i32
  %171 = xor i32 %170, -1
  %172 = add i32 %169, %171
  %spec.select240 = tail call i32 @llvm.smin.i32(i32 %172, i32 %7)
  %.not235290 = icmp slt i32 %spec.select240, 1
  br i1 %.not235290, label %._crit_edge296, label %.lr.ph295.preheader

.lr.ph295.preheader:                              ; preds = %._crit_edge287
  %173 = zext nneg i32 %spec.select240 to i64
  %invariant.gep401 = getelementptr inbounds double, ptr %29, i64 %indvars.iv370
  %xtraiter444 = and i64 %173, 3
  %174 = icmp ult i32 %spec.select240, 4
  br i1 %174, label %._crit_edge296.loopexit.unr-lcssa, label %.lr.ph295.preheader.new

.lr.ph295.preheader.new:                          ; preds = %.lr.ph295.preheader
  %unroll_iter449 = and i64 %173, 2147483644
  br label %.lr.ph295

.lr.ph286:                                        ; preds = %.lr.ph286, %.lr.ph286.preheader.new
  %indvars.iv361 = phi i64 [ 1, %.lr.ph286.preheader.new ], [ %indvars.iv.next362.1, %.lr.ph286 ]
  %.0203283 = phi double [ %.pre388, %.lr.ph286.preheader.new ], [ %188, %.lr.ph286 ]
  %.0205282 = phi double [ %160, %.lr.ph286.preheader.new ], [ %187, %.lr.ph286 ]
  %niter443 = phi i64 [ 0, %.lr.ph286.preheader.new ], [ %niter443.next.1, %.lr.ph286 ]
  %175 = getelementptr inbounds double, ptr %13, i64 %indvars.iv361
  %176 = load double, ptr %175, align 8, !tbaa !5
  %177 = sub nsw i64 %indvars.iv370, %indvars.iv361
  %178 = getelementptr inbounds double, ptr %29, i64 %177
  %179 = load double, ptr %178, align 8, !tbaa !5
  %180 = tail call double @llvm.fmuladd.f64(double %176, double %179, double %.0205282)
  %181 = fadd double %.0203283, %176
  %indvars.iv.next362 = add nuw nsw i64 %indvars.iv361, 1
  %182 = getelementptr inbounds double, ptr %13, i64 %indvars.iv.next362
  %183 = load double, ptr %182, align 8, !tbaa !5
  %184 = sub nsw i64 %indvars.iv370, %indvars.iv.next362
  %185 = getelementptr inbounds double, ptr %29, i64 %184
  %186 = load double, ptr %185, align 8, !tbaa !5
  %187 = tail call double @llvm.fmuladd.f64(double %183, double %186, double %180)
  %188 = fadd double %181, %183
  %indvars.iv.next362.1 = add nuw nsw i64 %indvars.iv361, 2
  %niter443.next.1 = add i64 %niter443, 2
  %niter443.ncmp.1 = icmp eq i64 %niter443.next.1, %unroll_iter442
  br i1 %niter443.ncmp.1, label %._crit_edge287.loopexit.unr-lcssa, label %.lr.ph286, !llvm.loop !22

._crit_edge296.loopexit.unr-lcssa:                ; preds = %.lr.ph295, %.lr.ph295.preheader
  %.lcssa422.ph = phi double [ poison, %.lr.ph295.preheader ], [ %216, %.lr.ph295 ]
  %.lcssa421.ph = phi double [ poison, %.lr.ph295.preheader ], [ %217, %.lr.ph295 ]
  %indvars.iv367.unr = phi i64 [ 1, %.lr.ph295.preheader ], [ %indvars.iv.next368.3, %.lr.ph295 ]
  %.1204292.unr = phi double [ %.0203.lcssa, %.lr.ph295.preheader ], [ %217, %.lr.ph295 ]
  %.1206291.unr = phi double [ %.0205.lcssa, %.lr.ph295.preheader ], [ %216, %.lr.ph295 ]
  %lcmp.mod446.not = icmp eq i64 %xtraiter444, 0
  br i1 %lcmp.mod446.not, label %._crit_edge296, label %.lr.ph295.epil

.lr.ph295.epil:                                   ; preds = %._crit_edge296.loopexit.unr-lcssa, %.lr.ph295.epil
  %indvars.iv367.epil = phi i64 [ %indvars.iv.next368.epil, %.lr.ph295.epil ], [ %indvars.iv367.unr, %._crit_edge296.loopexit.unr-lcssa ]
  %.1204292.epil = phi double [ %193, %.lr.ph295.epil ], [ %.1204292.unr, %._crit_edge296.loopexit.unr-lcssa ]
  %.1206291.epil = phi double [ %192, %.lr.ph295.epil ], [ %.1206291.unr, %._crit_edge296.loopexit.unr-lcssa ]
  %epil.iter445 = phi i64 [ %epil.iter445.next, %.lr.ph295.epil ], [ 0, %._crit_edge296.loopexit.unr-lcssa ]
  %189 = getelementptr inbounds double, ptr %13, i64 %indvars.iv367.epil
  %190 = load double, ptr %189, align 8, !tbaa !5
  %gep402.epil = getelementptr inbounds double, ptr %invariant.gep401, i64 %indvars.iv367.epil
  %191 = load double, ptr %gep402.epil, align 8, !tbaa !5
  %192 = tail call double @llvm.fmuladd.f64(double %190, double %191, double %.1206291.epil)
  %193 = fadd double %.1204292.epil, %190
  %indvars.iv.next368.epil = add nuw nsw i64 %indvars.iv367.epil, 1
  %epil.iter445.next = add i64 %epil.iter445, 1
  %epil.iter445.cmp.not = icmp eq i64 %epil.iter445.next, %xtraiter444
  br i1 %epil.iter445.cmp.not, label %._crit_edge296, label %.lr.ph295.epil, !llvm.loop !23

._crit_edge296:                                   ; preds = %._crit_edge296.loopexit.unr-lcssa, %.lr.ph295.epil, %._crit_edge287
  %.1206.lcssa = phi double [ %.0205.lcssa, %._crit_edge287 ], [ %.lcssa422.ph, %._crit_edge296.loopexit.unr-lcssa ], [ %192, %.lr.ph295.epil ]
  %.1204.lcssa = phi double [ %.0203.lcssa, %._crit_edge287 ], [ %.lcssa421.ph, %._crit_edge296.loopexit.unr-lcssa ], [ %193, %.lr.ph295.epil ]
  %194 = fdiv double %.1206.lcssa, %.1204.lcssa
  tail call void @_ZN6R3Grid12SetGridValueEiiid(ptr noundef nonnull align 8 dereferenceable(592) %0, i32 noundef %.0209302, i32 noundef %157, i32 noundef %.0210304, double noundef %194)
  %indvars.iv.next371 = add nuw nsw i64 %indvars.iv370, 1
  %195 = tail call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %196 = sext i32 %195 to i64
  %197 = icmp slt i64 %indvars.iv.next371, %196
  br i1 %197, label %.lr.ph300, label %._crit_edge301, !llvm.loop !24

.lr.ph295:                                        ; preds = %.lr.ph295, %.lr.ph295.preheader.new
  %indvars.iv367 = phi i64 [ 1, %.lr.ph295.preheader.new ], [ %indvars.iv.next368.3, %.lr.ph295 ]
  %.1204292 = phi double [ %.0203.lcssa, %.lr.ph295.preheader.new ], [ %217, %.lr.ph295 ]
  %.1206291 = phi double [ %.0205.lcssa, %.lr.ph295.preheader.new ], [ %216, %.lr.ph295 ]
  %niter450 = phi i64 [ 0, %.lr.ph295.preheader.new ], [ %niter450.next.3, %.lr.ph295 ]
  %198 = getelementptr inbounds double, ptr %13, i64 %indvars.iv367
  %199 = load double, ptr %198, align 8, !tbaa !5
  %gep402 = getelementptr inbounds double, ptr %invariant.gep401, i64 %indvars.iv367
  %200 = load double, ptr %gep402, align 8, !tbaa !5
  %201 = tail call double @llvm.fmuladd.f64(double %199, double %200, double %.1206291)
  %202 = fadd double %.1204292, %199
  %indvars.iv.next368 = add nuw nsw i64 %indvars.iv367, 1
  %203 = getelementptr inbounds double, ptr %13, i64 %indvars.iv.next368
  %204 = load double, ptr %203, align 8, !tbaa !5
  %gep402.1 = getelementptr inbounds double, ptr %invariant.gep401, i64 %indvars.iv.next368
  %205 = load double, ptr %gep402.1, align 8, !tbaa !5
  %206 = tail call double @llvm.fmuladd.f64(double %204, double %205, double %201)
  %207 = fadd double %202, %204
  %indvars.iv.next368.1 = add nuw nsw i64 %indvars.iv367, 2
  %208 = getelementptr inbounds double, ptr %13, i64 %indvars.iv.next368.1
  %209 = load double, ptr %208, align 8, !tbaa !5
  %gep402.2 = getelementptr inbounds double, ptr %invariant.gep401, i64 %indvars.iv.next368.1
  %210 = load double, ptr %gep402.2, align 8, !tbaa !5
  %211 = tail call double @llvm.fmuladd.f64(double %209, double %210, double %206)
  %212 = fadd double %207, %209
  %indvars.iv.next368.2 = add nuw nsw i64 %indvars.iv367, 3
  %213 = getelementptr inbounds double, ptr %13, i64 %indvars.iv.next368.2
  %214 = load double, ptr %213, align 8, !tbaa !5
  %gep402.3 = getelementptr inbounds double, ptr %invariant.gep401, i64 %indvars.iv.next368.2
  %215 = load double, ptr %gep402.3, align 8, !tbaa !5
  %216 = tail call double @llvm.fmuladd.f64(double %214, double %215, double %211)
  %217 = fadd double %212, %214
  %indvars.iv.next368.3 = add nuw nsw i64 %indvars.iv367, 4
  %niter450.next.3 = add i64 %niter450, 4
  %niter450.ncmp.3.not = icmp eq i64 %niter450.next.3, %unroll_iter449
  br i1 %niter450.ncmp.3.not, label %._crit_edge296.loopexit.unr-lcssa, label %.lr.ph295, !llvm.loop !25

.preheader244:                                    ; preds = %.preheader245, %._crit_edge329
  %.0198330 = phi i32 [ %222, %._crit_edge329 ], [ 0, %.preheader245 ]
  %218 = tail call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %219 = icmp sgt i32 %218, 0
  br i1 %219, label %.preheader243, label %._crit_edge329

.preheader243:                                    ; preds = %.preheader244, %._crit_edge327
  %.0197328 = phi i32 [ %233, %._crit_edge327 ], [ 0, %.preheader244 ]
  %220 = tail call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %221 = icmp sgt i32 %220, 0
  br i1 %221, label %.lr.ph306, label %.preheader

._crit_edge329:                                   ; preds = %._crit_edge327, %.preheader244
  %222 = add nuw nsw i32 %.0198330, 1
  %223 = tail call noundef i32 @_ZNK6R3Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %224 = icmp slt i32 %222, %223
  br i1 %224, label %.preheader244, label %._crit_edge331, !llvm.loop !26

.preheader:                                       ; preds = %.lr.ph306, %.preheader243
  %225 = tail call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %226 = icmp sgt i32 %225, 0
  br i1 %226, label %.lr.ph326.preheader, label %._crit_edge327

.lr.ph326.preheader:                              ; preds = %.preheader
  %.pre389 = load double, ptr %13, align 8, !tbaa !5
  br label %.lr.ph326

.lr.ph306:                                        ; preds = %.preheader243, %.lr.ph306
  %indvars.iv373 = phi i64 [ %indvars.iv.next374, %.lr.ph306 ], [ 0, %.preheader243 ]
  %227 = trunc nuw nsw i64 %indvars.iv373 to i32
  %228 = tail call noundef double @_ZNK6R3Grid9GridValueEiii(ptr noundef nonnull align 8 dereferenceable(592) %0, i32 noundef %.0197328, i32 noundef %.0198330, i32 noundef %227)
  %229 = getelementptr inbounds double, ptr %29, i64 %indvars.iv373
  store double %228, ptr %229, align 8, !tbaa !5
  %indvars.iv.next374 = add nuw nsw i64 %indvars.iv373, 1
  %230 = tail call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %231 = sext i32 %230 to i64
  %232 = icmp slt i64 %indvars.iv.next374, %231
  br i1 %232, label %.lr.ph306, label %.preheader, !llvm.loop !27

._crit_edge327:                                   ; preds = %._crit_edge322, %.preheader
  %233 = add nuw nsw i32 %.0197328, 1
  %234 = tail call noundef i32 @_ZNK6R3Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %235 = icmp slt i32 %233, %234
  br i1 %235, label %.preheader243, label %._crit_edge329, !llvm.loop !28

.lr.ph326:                                        ; preds = %.lr.ph326.preheader, %._crit_edge322
  %indvars.iv385 = phi i64 [ 0, %.lr.ph326.preheader ], [ %indvars.iv.next386, %._crit_edge322 ]
  %236 = trunc i64 %indvars.iv385 to i32
  %smin451 = tail call i32 @llvm.smin.i32(i32 %7, i32 %236)
  %237 = add nsw i32 %smin451, 1
  %238 = zext i32 %237 to i64
  %239 = add nsw i64 %238, -1
  %240 = trunc nuw nsw i64 %indvars.iv385 to i32
  %smin379 = tail call i32 @llvm.smin.i32(i32 %7, i32 %240)
  %241 = getelementptr inbounds double, ptr %29, i64 %indvars.iv385
  %242 = load double, ptr %241, align 8, !tbaa !5
  %243 = fmul double %.pre389, %242
  %.not232307 = icmp slt i32 %smin379, 1
  br i1 %.not232307, label %._crit_edge313, label %.lr.ph312.preheader

.lr.ph312.preheader:                              ; preds = %.lr.ph326
  %xtraiter452 = and i64 %239, 1
  %244 = icmp eq i32 %237, 2
  br i1 %244, label %._crit_edge313.loopexit.unr-lcssa, label %.lr.ph312.preheader.new

.lr.ph312.preheader.new:                          ; preds = %.lr.ph312.preheader
  %unroll_iter457 = and i64 %239, -2
  br label %.lr.ph312

._crit_edge313.loopexit.unr-lcssa:                ; preds = %.lr.ph312, %.lr.ph312.preheader
  %.lcssa416.ph = phi double [ poison, %.lr.ph312.preheader ], [ %270, %.lr.ph312 ]
  %.lcssa.ph = phi double [ poison, %.lr.ph312.preheader ], [ %271, %.lr.ph312 ]
  %indvars.iv376.unr = phi i64 [ 1, %.lr.ph312.preheader ], [ %indvars.iv.next377.1, %.lr.ph312 ]
  %.0191309.unr = phi double [ %.pre389, %.lr.ph312.preheader ], [ %271, %.lr.ph312 ]
  %.0193308.unr = phi double [ %243, %.lr.ph312.preheader ], [ %270, %.lr.ph312 ]
  %lcmp.mod454.not = icmp eq i64 %xtraiter452, 0
  br i1 %lcmp.mod454.not, label %._crit_edge313, label %.lr.ph312.epil

.lr.ph312.epil:                                   ; preds = %._crit_edge313.loopexit.unr-lcssa
  %245 = getelementptr inbounds double, ptr %13, i64 %indvars.iv376.unr
  %246 = load double, ptr %245, align 8, !tbaa !5
  %247 = sub nsw i64 %indvars.iv385, %indvars.iv376.unr
  %248 = getelementptr inbounds double, ptr %29, i64 %247
  %249 = load double, ptr %248, align 8, !tbaa !5
  %250 = tail call double @llvm.fmuladd.f64(double %246, double %249, double %.0193308.unr)
  %251 = fadd double %.0191309.unr, %246
  br label %._crit_edge313

._crit_edge313:                                   ; preds = %.lr.ph312.epil, %._crit_edge313.loopexit.unr-lcssa, %.lr.ph326
  %.0193.lcssa = phi double [ %243, %.lr.ph326 ], [ %.lcssa416.ph, %._crit_edge313.loopexit.unr-lcssa ], [ %250, %.lr.ph312.epil ]
  %.0191.lcssa = phi double [ %.pre389, %.lr.ph326 ], [ %.lcssa.ph, %._crit_edge313.loopexit.unr-lcssa ], [ %251, %.lr.ph312.epil ]
  %252 = tail call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %253 = trunc i64 %indvars.iv385 to i32
  %254 = xor i32 %253, -1
  %255 = add i32 %252, %254
  %spec.select242 = tail call i32 @llvm.smin.i32(i32 %255, i32 %7)
  %.not233316 = icmp slt i32 %spec.select242, 1
  br i1 %.not233316, label %._crit_edge322, label %.lr.ph321.preheader

.lr.ph321.preheader:                              ; preds = %._crit_edge313
  %256 = zext nneg i32 %spec.select242 to i64
  %invariant.gep403 = getelementptr inbounds double, ptr %29, i64 %indvars.iv385
  %xtraiter459 = and i64 %256, 3
  %257 = icmp ult i32 %spec.select242, 4
  br i1 %257, label %._crit_edge322.loopexit.unr-lcssa, label %.lr.ph321.preheader.new

.lr.ph321.preheader.new:                          ; preds = %.lr.ph321.preheader
  %unroll_iter464 = and i64 %256, 2147483644
  br label %.lr.ph321

.lr.ph312:                                        ; preds = %.lr.ph312, %.lr.ph312.preheader.new
  %indvars.iv376 = phi i64 [ 1, %.lr.ph312.preheader.new ], [ %indvars.iv.next377.1, %.lr.ph312 ]
  %.0191309 = phi double [ %.pre389, %.lr.ph312.preheader.new ], [ %271, %.lr.ph312 ]
  %.0193308 = phi double [ %243, %.lr.ph312.preheader.new ], [ %270, %.lr.ph312 ]
  %niter458 = phi i64 [ 0, %.lr.ph312.preheader.new ], [ %niter458.next.1, %.lr.ph312 ]
  %258 = getelementptr inbounds double, ptr %13, i64 %indvars.iv376
  %259 = load double, ptr %258, align 8, !tbaa !5
  %260 = sub nsw i64 %indvars.iv385, %indvars.iv376
  %261 = getelementptr inbounds double, ptr %29, i64 %260
  %262 = load double, ptr %261, align 8, !tbaa !5
  %263 = tail call double @llvm.fmuladd.f64(double %259, double %262, double %.0193308)
  %264 = fadd double %.0191309, %259
  %indvars.iv.next377 = add nuw nsw i64 %indvars.iv376, 1
  %265 = getelementptr inbounds double, ptr %13, i64 %indvars.iv.next377
  %266 = load double, ptr %265, align 8, !tbaa !5
  %267 = sub nsw i64 %indvars.iv385, %indvars.iv.next377
  %268 = getelementptr inbounds double, ptr %29, i64 %267
  %269 = load double, ptr %268, align 8, !tbaa !5
  %270 = tail call double @llvm.fmuladd.f64(double %266, double %269, double %263)
  %271 = fadd double %264, %266
  %indvars.iv.next377.1 = add nuw nsw i64 %indvars.iv376, 2
  %niter458.next.1 = add i64 %niter458, 2
  %niter458.ncmp.1 = icmp eq i64 %niter458.next.1, %unroll_iter457
  br i1 %niter458.ncmp.1, label %._crit_edge313.loopexit.unr-lcssa, label %.lr.ph312, !llvm.loop !29

._crit_edge322.loopexit.unr-lcssa:                ; preds = %.lr.ph321, %.lr.ph321.preheader
  %.lcssa418.ph = phi double [ poison, %.lr.ph321.preheader ], [ %299, %.lr.ph321 ]
  %.lcssa417.ph = phi double [ poison, %.lr.ph321.preheader ], [ %300, %.lr.ph321 ]
  %indvars.iv382.unr = phi i64 [ 1, %.lr.ph321.preheader ], [ %indvars.iv.next383.3, %.lr.ph321 ]
  %.1192318.unr = phi double [ %.0191.lcssa, %.lr.ph321.preheader ], [ %300, %.lr.ph321 ]
  %.1194317.unr = phi double [ %.0193.lcssa, %.lr.ph321.preheader ], [ %299, %.lr.ph321 ]
  %lcmp.mod461.not = icmp eq i64 %xtraiter459, 0
  br i1 %lcmp.mod461.not, label %._crit_edge322, label %.lr.ph321.epil

.lr.ph321.epil:                                   ; preds = %._crit_edge322.loopexit.unr-lcssa, %.lr.ph321.epil
  %indvars.iv382.epil = phi i64 [ %indvars.iv.next383.epil, %.lr.ph321.epil ], [ %indvars.iv382.unr, %._crit_edge322.loopexit.unr-lcssa ]
  %.1192318.epil = phi double [ %276, %.lr.ph321.epil ], [ %.1192318.unr, %._crit_edge322.loopexit.unr-lcssa ]
  %.1194317.epil = phi double [ %275, %.lr.ph321.epil ], [ %.1194317.unr, %._crit_edge322.loopexit.unr-lcssa ]
  %epil.iter460 = phi i64 [ %epil.iter460.next, %.lr.ph321.epil ], [ 0, %._crit_edge322.loopexit.unr-lcssa ]
  %272 = getelementptr inbounds double, ptr %13, i64 %indvars.iv382.epil
  %273 = load double, ptr %272, align 8, !tbaa !5
  %gep404.epil = getelementptr inbounds double, ptr %invariant.gep403, i64 %indvars.iv382.epil
  %274 = load double, ptr %gep404.epil, align 8, !tbaa !5
  %275 = tail call double @llvm.fmuladd.f64(double %273, double %274, double %.1194317.epil)
  %276 = fadd double %.1192318.epil, %273
  %indvars.iv.next383.epil = add nuw nsw i64 %indvars.iv382.epil, 1
  %epil.iter460.next = add i64 %epil.iter460, 1
  %epil.iter460.cmp.not = icmp eq i64 %epil.iter460.next, %xtraiter459
  br i1 %epil.iter460.cmp.not, label %._crit_edge322, label %.lr.ph321.epil, !llvm.loop !30

._crit_edge322:                                   ; preds = %._crit_edge322.loopexit.unr-lcssa, %.lr.ph321.epil, %._crit_edge313
  %.1194.lcssa = phi double [ %.0193.lcssa, %._crit_edge313 ], [ %.lcssa418.ph, %._crit_edge322.loopexit.unr-lcssa ], [ %275, %.lr.ph321.epil ]
  %.1192.lcssa = phi double [ %.0191.lcssa, %._crit_edge313 ], [ %.lcssa417.ph, %._crit_edge322.loopexit.unr-lcssa ], [ %276, %.lr.ph321.epil ]
  %277 = fdiv double %.1194.lcssa, %.1192.lcssa
  tail call void @_ZN6R3Grid12SetGridValueEiiid(ptr noundef nonnull align 8 dereferenceable(592) %0, i32 noundef %.0197328, i32 noundef %.0198330, i32 noundef %240, double noundef %277)
  %indvars.iv.next386 = add nuw nsw i64 %indvars.iv385, 1
  %278 = tail call noundef i32 @_ZNK6R3Grid11ZResolutionEv(ptr noundef nonnull align 8 dereferenceable(592) %0)
  %279 = sext i32 %278 to i64
  %280 = icmp slt i64 %indvars.iv.next386, %279
  br i1 %280, label %.lr.ph326, label %._crit_edge327, !llvm.loop !31

.lr.ph321:                                        ; preds = %.lr.ph321, %.lr.ph321.preheader.new
  %indvars.iv382 = phi i64 [ 1, %.lr.ph321.preheader.new ], [ %indvars.iv.next383.3, %.lr.ph321 ]
  %.1192318 = phi double [ %.0191.lcssa, %.lr.ph321.preheader.new ], [ %300, %.lr.ph321 ]
  %.1194317 = phi double [ %.0193.lcssa, %.lr.ph321.preheader.new ], [ %299, %.lr.ph321 ]
  %niter465 = phi i64 [ 0, %.lr.ph321.preheader.new ], [ %niter465.next.3, %.lr.ph321 ]
  %281 = getelementptr inbounds double, ptr %13, i64 %indvars.iv382
  %282 = load double, ptr %281, align 8, !tbaa !5
  %gep404 = getelementptr inbounds double, ptr %invariant.gep403, i64 %indvars.iv382
  %283 = load double, ptr %gep404, align 8, !tbaa !5
  %284 = tail call double @llvm.fmuladd.f64(double %282, double %283, double %.1194317)
  %285 = fadd double %.1192318, %282
  %indvars.iv.next383 = add nuw nsw i64 %indvars.iv382, 1
  %286 = getelementptr inbounds double, ptr %13, i64 %indvars.iv.next383
  %287 = load double, ptr %286, align 8, !tbaa !5
  %gep404.1 = getelementptr inbounds double, ptr %invariant.gep403, i64 %indvars.iv.next383
  %288 = load double, ptr %gep404.1, align 8, !tbaa !5
  %289 = tail call double @llvm.fmuladd.f64(double %287, double %288, double %284)
  %290 = fadd double %285, %287
  %indvars.iv.next383.1 = add nuw nsw i64 %indvars.iv382, 2
  %291 = getelementptr inbounds double, ptr %13, i64 %indvars.iv.next383.1
  %292 = load double, ptr %291, align 8, !tbaa !5
  %gep404.2 = getelementptr inbounds double, ptr %invariant.gep403, i64 %indvars.iv.next383.1
  %293 = load double, ptr %gep404.2, align 8, !tbaa !5
  %294 = tail call double @llvm.fmuladd.f64(double %292, double %293, double %289)
  %295 = fadd double %290, %292
  %indvars.iv.next383.2 = add nuw nsw i64 %indvars.iv382, 3
  %296 = getelementptr inbounds double, ptr %13, i64 %indvars.iv.next383.2
  %297 = load double, ptr %296, align 8, !tbaa !5
  %gep404.3 = getelementptr inbounds double, ptr %invariant.gep403, i64 %indvars.iv.next383.2
  %298 = load double, ptr %gep404.3, align 8, !tbaa !5
  %299 = tail call double @llvm.fmuladd.f64(double %297, double %298, double %294)
  %300 = fadd double %295, %297
  %indvars.iv.next383.3 = add nuw nsw i64 %indvars.iv382, 4
  %niter465.next.3 = add i64 %niter465, 4
  %niter465.ncmp.3.not = icmp eq i64 %niter465.next.3, %unroll_iter464
  br i1 %niter465.ncmp.3.not, label %._crit_edge322.loopexit.unr-lcssa, label %.lr.ph321, !llvm.loop !32

._crit_edge331:                                   ; preds = %._crit_edge329, %.preheader245
  tail call void @_ZdaPv(ptr noundef nonnull %13) #10
  tail call void @_ZdaPv(ptr noundef nonnull %29) #10
  br label %301

301:                                              ; preds = %2, %._crit_edge331
  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 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 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { 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, !16}
!16 = !{!"llvm.loop.unroll.disable"}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !16}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !10}
!28 = distinct !{!28, !10}
!29 = distinct !{!29, !10}
!30 = distinct !{!30, !16}
!31 = distinct !{!31, !10}
!32 = distinct !{!32, !10}


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