; LLVM IR from niessner/Matterport :: code/gaps/pkgs/RGBD (RGBDUtil)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%class.R2Grid = type { %class.R2Affine, %class.R2Affine, double, ptr, [2 x i32], i32, i32 }
%class.R2Affine = type <{ %class.R2Transformation, %class.R3Matrix, i32, [4 x i8] }>
%class.R2Transformation = type { ptr }
%class.R3Matrix = type { [3 x [3 x double]] }
%class.R2Point = type { [2 x double] }
%class.R3Point = type { [3 x double] }
%class.RNArray.0 = type { %class.RNVArray }
%class.RNVArray = type { ptr, i32, i32 }
%class.R3Triad = type { [3 x %class.R3Vector] }
%class.R3Vector = type { [3 x double] }
%class.R3Plane = type { %class.R3Vector, double }

@RN_EPSILON = external global double, align 8

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

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

declare void @_ZN6R2GridC1Eii(ptr noundef nonnull align 8 dereferenceable(208), i32 noundef, i32 noundef) unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z24RGBDCreateNormalChannelsRK6R2GridS1_S1_S1_S1_RS_S2_S2_S2_RK7R3PointRK8R3VectorS8_dii(ptr noundef nonnull align 8 dereferenceable(208) %0, ptr noundef nonnull align 8 dereferenceable(208) %1, ptr noundef nonnull align 8 dereferenceable(208) %2, ptr noundef nonnull align 8 dereferenceable(208) %3, ptr noundef nonnull align 8 dereferenceable(208) %4, ptr noundef nonnull align 8 dereferenceable(208) %5, ptr noundef nonnull align 8 dereferenceable(208) %6, ptr noundef nonnull align 8 dereferenceable(208) %7, ptr noundef nonnull align 8 dereferenceable(208) %8, ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %11, double noundef %12, i32 noundef %13, i32 noundef %14) #2 personality ptr @__gxx_personality_v0 {
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca double, align 8
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca double, align 8
  %34 = alloca ptr, align 8
  %35 = alloca ptr, align 8
  %36 = alloca i32, align 4
  %37 = alloca %class.R2Grid, align 8
  %38 = alloca ptr, align 8
  %39 = alloca i32, align 4
  %40 = alloca i32, align 4
  %41 = alloca i32, align 4
  %42 = alloca i32, align 4
  %43 = alloca double, align 8
  %44 = alloca %class.R2Point, align 8
  %45 = alloca double, align 8
  %46 = alloca double, align 8
  %47 = alloca double, align 8
  %48 = alloca %class.R3Point, align 8
  %49 = alloca i32, align 4
  %50 = alloca %class.RNArray.0, align 8
  %51 = alloca ptr, align 8
  %52 = alloca i32, align 4
  %53 = alloca i32, align 4
  %54 = alloca ptr, align 8
  %55 = alloca i32, align 4
  %56 = alloca double, align 8
  %57 = alloca double, align 8
  %58 = alloca double, align 8
  %59 = alloca %class.R3Point, align 8
  %60 = alloca double, align 8
  %61 = alloca i32, align 4
  %62 = alloca i32, align 4
  %63 = alloca i32, align 4
  %64 = alloca double, align 8
  %65 = alloca double, align 8
  %66 = alloca %class.R2Point, align 8
  %67 = alloca double, align 8
  %68 = alloca double, align 8
  %69 = alloca double, align 8
  %70 = alloca %class.R3Point, align 8
  %71 = alloca i32, align 4
  %72 = alloca i32, align 4
  %73 = alloca ptr, align 8
  %74 = alloca i32, align 4
  %75 = alloca i32, align 4
  %76 = alloca double, align 8
  %77 = alloca double, align 8
  %78 = alloca double, align 8
  %79 = alloca double, align 8
  %80 = alloca %class.R3Point, align 8
  %81 = alloca [3 x double], align 16
  %82 = alloca %class.R3Point, align 8
  %83 = alloca %class.R3Triad, align 8
  %84 = alloca %class.R3Vector, align 8
  %85 = alloca %class.R3Plane, align 8
  %86 = alloca double, align 8
  store ptr %0, ptr %16, align 8, !tbaa !5
  store ptr %1, ptr %17, align 8, !tbaa !5
  store ptr %2, ptr %18, align 8, !tbaa !5
  store ptr %3, ptr %19, align 8, !tbaa !5
  store ptr %4, ptr %20, align 8, !tbaa !5
  store ptr %5, ptr %21, align 8, !tbaa !5
  store ptr %6, ptr %22, align 8, !tbaa !5
  store ptr %7, ptr %23, align 8, !tbaa !5
  store ptr %8, ptr %24, align 8, !tbaa !5
  store ptr %9, ptr %25, align 8, !tbaa !5
  store ptr %10, ptr %26, align 8, !tbaa !5
  store ptr %11, ptr %27, align 8, !tbaa !5
  store double %12, ptr %28, align 8, !tbaa !9
  store i32 %13, ptr %29, align 4, !tbaa !11
  store i32 %14, ptr %30, align 4, !tbaa !11
  %87 = load ptr, ptr %16, align 8, !tbaa !5
  %88 = load ptr, ptr %21, align 8, !tbaa !5
  %89 = call noundef nonnull align 8 dereferenceable(208) ptr @_ZN6R2GridaSERKS_(ptr noundef nonnull align 8 dereferenceable(208) %88, ptr noundef nonnull align 8 dereferenceable(208) %87)
  %90 = load ptr, ptr %21, align 8, !tbaa !5
  call void @_ZN6R2Grid5ClearEd(ptr noundef nonnull align 8 dereferenceable(208) %90, double noundef -3.210000e+02)
  %91 = load ptr, ptr %21, align 8, !tbaa !5
  %92 = load ptr, ptr %22, align 8, !tbaa !5
  %93 = call noundef nonnull align 8 dereferenceable(208) ptr @_ZN6R2GridaSERKS_(ptr noundef nonnull align 8 dereferenceable(208) %92, ptr noundef nonnull align 8 dereferenceable(208) %91)
  %94 = load ptr, ptr %21, align 8, !tbaa !5
  %95 = load ptr, ptr %23, align 8, !tbaa !5
  %96 = call noundef nonnull align 8 dereferenceable(208) ptr @_ZN6R2GridaSERKS_(ptr noundef nonnull align 8 dereferenceable(208) %95, ptr noundef nonnull align 8 dereferenceable(208) %94)
  %97 = load ptr, ptr %21, align 8, !tbaa !5
  %98 = load ptr, ptr %24, align 8, !tbaa !5
  %99 = call noundef nonnull align 8 dereferenceable(208) ptr @_ZN6R2GridaSERKS_(ptr noundef nonnull align 8 dereferenceable(208) %98, ptr noundef nonnull align 8 dereferenceable(208) %97)
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #9
  %100 = load i32, ptr %29, align 4, !tbaa !11
  %101 = load ptr, ptr %16, align 8, !tbaa !5
  %102 = call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %101)
  %103 = mul nsw i32 %100, %102
  %104 = sitofp i32 %103 to double
  %105 = fdiv double %104, 6.400000e+02
  %106 = fadd double %105, 5.000000e-01
  %107 = fptosi double %106 to i32
  store i32 %107, ptr %31, align 4, !tbaa !11
  %108 = load i32, ptr %31, align 4, !tbaa !11
  %109 = icmp eq i32 %108, 0
  br i1 %109, label %110, label %111

110:                                              ; preds = %15
  store i32 1, ptr %31, align 4, !tbaa !11
  br label %111

111:                                              ; preds = %110, %15
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #9
  %112 = load i32, ptr %31, align 4, !tbaa !11
  %113 = load i32, ptr %31, align 4, !tbaa !11
  %114 = mul nsw i32 %112, %113
  store i32 %114, ptr %32, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #9
  %115 = load double, ptr %28, align 8, !tbaa !9
  %116 = load double, ptr %28, align 8, !tbaa !9
  %117 = fmul double %115, %116
  store double %117, ptr %33, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #9
  %118 = load ptr, ptr %16, align 8, !tbaa !5
  %119 = call noundef i32 @_ZNK6R2Grid8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(208) %118)
  %120 = sext i32 %119 to i64
  %121 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %120, i64 24)
  %122 = extractvalue { i64, i1 } %121, 1
  %123 = extractvalue { i64, i1 } %121, 0
  %124 = select i1 %122, i64 -1, i64 %123
  %125 = call noalias noundef nonnull ptr @_Znam(i64 noundef %124) #10
  %126 = icmp eq i64 %120, 0
  br i1 %126, label %134, label %127

127:                                              ; preds = %111
  %128 = getelementptr inbounds %class.R3Point, ptr %125, i64 %120
  br label %129

129:                                              ; preds = %131, %127
  %130 = phi ptr [ %125, %127 ], [ %132, %131 ]
  invoke void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %130)
          to label %131 unwind label %149

131:                                              ; preds = %129
  %132 = getelementptr inbounds %class.R3Point, ptr %130, i64 1
  %133 = icmp eq ptr %132, %128
  br i1 %133, label %134, label %129

134:                                              ; preds = %131, %111
  store ptr %125, ptr %34, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 208, ptr %37) #9
  %135 = load ptr, ptr %16, align 8, !tbaa !5
  %136 = call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %135)
  %137 = load ptr, ptr %16, align 8, !tbaa !5
  %138 = call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %137)
  call void @_ZN6R2GridC1Eii(ptr noundef nonnull align 8 dereferenceable(208) %37, i32 noundef %136, i32 noundef %138)
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #9
  %139 = invoke noundef ptr @_ZNK6R2Grid10GridValuesEv(ptr noundef nonnull align 8 dereferenceable(208) %37)
          to label %140 unwind label %153

140:                                              ; preds = %134
  store ptr %139, ptr %38, align 8, !tbaa !5
  invoke void @_ZN6R2Grid5ClearEd(ptr noundef nonnull align 8 dereferenceable(208) %37, double noundef -1.000000e+00)
          to label %141 unwind label %153

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

142:                                              ; preds = %805, %141
  %143 = load i32, ptr %39, align 4, !tbaa !11
  %144 = load ptr, ptr %16, align 8, !tbaa !5
  %145 = invoke noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %144)
          to label %146 unwind label %157

146:                                              ; preds = %142
  %147 = icmp slt i32 %143, %145
  br i1 %147, label %161, label %148

148:                                              ; preds = %146
  store i32 2, ptr %40, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #9
  br label %809

149:                                              ; preds = %129
  %150 = landingpad { ptr, i32 }
          cleanup
  %151 = extractvalue { ptr, i32 } %150, 0
  store ptr %151, ptr %35, align 8
  %152 = extractvalue { ptr, i32 } %150, 1
  store i32 %152, ptr %36, align 4
  call void @_ZdaPvm(ptr noundef %125, i64 noundef %124) #11
  br label %815

153:                                              ; preds = %140, %134
  %154 = landingpad { ptr, i32 }
          cleanup
  %155 = extractvalue { ptr, i32 } %154, 0
  store ptr %155, ptr %35, align 8
  %156 = extractvalue { ptr, i32 } %154, 1
  store i32 %156, ptr %36, align 4
  br label %814

157:                                              ; preds = %142
  %158 = landingpad { ptr, i32 }
          cleanup
  %159 = extractvalue { ptr, i32 } %158, 0
  store ptr %159, ptr %35, align 8
  %160 = extractvalue { ptr, i32 } %158, 1
  store i32 %160, ptr %36, align 4
  br label %808

161:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 4, ptr %41) #9
  store i32 0, ptr %41, align 4, !tbaa !11
  br label %162

162:                                              ; preds = %786, %161
  %163 = load i32, ptr %41, align 4, !tbaa !11
  %164 = load ptr, ptr %16, align 8, !tbaa !5
  %165 = invoke noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %164)
          to label %166 unwind label %169

166:                                              ; preds = %162
  %167 = icmp slt i32 %163, %165
  br i1 %167, label %173, label %168

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

169:                                              ; preds = %162
  %170 = landingpad { ptr, i32 }
          cleanup
  %171 = extractvalue { ptr, i32 } %170, 0
  store ptr %171, ptr %35, align 8
  %172 = extractvalue { ptr, i32 } %170, 1
  store i32 %172, ptr %36, align 4
  br label %803

173:                                              ; preds = %166
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #9
  store i32 0, ptr %42, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #9
  %174 = load ptr, ptr %16, align 8, !tbaa !5
  %175 = load i32, ptr %39, align 4, !tbaa !11
  %176 = load i32, ptr %41, align 4, !tbaa !11
  %177 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %174, i32 noundef %175, i32 noundef %176)
          to label %178 unwind label %185

178:                                              ; preds = %173
  store double %177, ptr %43, align 8, !tbaa !9
  %179 = load double, ptr %43, align 8, !tbaa !9
  %180 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %181 = invoke noundef i32 @_Z18RNIsNegativeOrZerodd(double noundef %179, double noundef %180)
          to label %182 unwind label %185

182:                                              ; preds = %178
  %183 = icmp ne i32 %181, 0
  br i1 %183, label %184, label %189

184:                                              ; preds = %182
  store i32 7, ptr %40, align 4
  br label %783

185:                                              ; preds = %178, %173
  %186 = landingpad { ptr, i32 }
          cleanup
  %187 = extractvalue { ptr, i32 } %186, 0
  store ptr %187, ptr %35, align 8
  %188 = extractvalue { ptr, i32 } %186, 1
  store i32 %188, ptr %36, align 4
  br label %802

189:                                              ; preds = %182
  call void @llvm.lifetime.start.p0(i64 16, ptr %44) #9
  %190 = load i32, ptr %39, align 4, !tbaa !11
  %191 = sitofp i32 %190 to double
  %192 = load i32, ptr %41, align 4, !tbaa !11
  %193 = sitofp i32 %192 to double
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %44, double noundef %191, double noundef %193)
          to label %194 unwind label %292

194:                                              ; preds = %189
  call void @llvm.lifetime.start.p0(i64 8, ptr %45) #9
  %195 = load ptr, ptr %17, align 8, !tbaa !5
  %196 = load i32, ptr %39, align 4, !tbaa !11
  %197 = load i32, ptr %41, align 4, !tbaa !11
  %198 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %195, i32 noundef %196, i32 noundef %197)
          to label %199 unwind label %296

199:                                              ; preds = %194
  store double %198, ptr %45, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %46) #9
  %200 = load ptr, ptr %18, align 8, !tbaa !5
  %201 = load i32, ptr %39, align 4, !tbaa !11
  %202 = load i32, ptr %41, align 4, !tbaa !11
  %203 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %200, i32 noundef %201, i32 noundef %202)
          to label %204 unwind label %300

204:                                              ; preds = %199
  store double %203, ptr %46, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %47) #9
  %205 = load ptr, ptr %19, align 8, !tbaa !5
  %206 = load i32, ptr %39, align 4, !tbaa !11
  %207 = load i32, ptr %41, align 4, !tbaa !11
  %208 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %205, i32 noundef %206, i32 noundef %207)
          to label %209 unwind label %304

209:                                              ; preds = %204
  store double %208, ptr %47, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %48) #9
  %210 = load double, ptr %45, align 8, !tbaa !9
  %211 = load double, ptr %46, align 8, !tbaa !9
  %212 = load double, ptr %47, align 8, !tbaa !9
  invoke void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %48, double noundef %210, double noundef %211, double noundef %212)
          to label %213 unwind label %308

213:                                              ; preds = %209
  %214 = load i32, ptr %30, align 4, !tbaa !11
  %215 = icmp ne i32 %214, 0
  br i1 %215, label %216, label %572

216:                                              ; preds = %213
  call void @llvm.lifetime.start.p0(i64 4, ptr %49) #9
  call void @llvm.lifetime.start.p0(i64 16, ptr %50) #9
  invoke void @_ZN7RNArrayIPKdEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %50)
          to label %217 unwind label %312

217:                                              ; preds = %216
  %218 = load i32, ptr %39, align 4, !tbaa !11
  %219 = load i32, ptr %41, align 4, !tbaa !11
  invoke void @_ZNK6R2Grid14IndicesToIndexEiiRi(ptr noundef nonnull align 8 dereferenceable(208) %37, i32 noundef %218, i32 noundef %219, ptr noundef nonnull align 4 dereferenceable(4) %49)
          to label %220 unwind label %316

220:                                              ; preds = %217
  call void @llvm.lifetime.start.p0(i64 8, ptr %51) #9
  %221 = load ptr, ptr %38, align 8, !tbaa !5
  %222 = load i32, ptr %49, align 4, !tbaa !11
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds double, ptr %221, i64 %223
  store ptr %224, ptr %51, align 8, !tbaa !5
  %225 = load i32, ptr %49, align 4, !tbaa !11
  %226 = load i32, ptr %49, align 4, !tbaa !11
  %227 = sitofp i32 %226 to double
  invoke void @_ZN6R2Grid12SetGridValueEid(ptr noundef nonnull align 8 dereferenceable(208) %37, i32 noundef %225, double noundef %227)
          to label %228 unwind label %320

228:                                              ; preds = %220
  %229 = load ptr, ptr %51, align 8, !tbaa !5
  %230 = invoke noundef ptr @_ZN7RNArrayIPKdE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %50, ptr noundef %229)
          to label %231 unwind label %320

231:                                              ; preds = %228
  br label %232

232:                                              ; preds = %559, %231
  %233 = invoke noundef i32 @_ZNK8RNVArray7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(16) %50)
          to label %234 unwind label %320

234:                                              ; preds = %232
  %235 = icmp ne i32 %233, 0
  %236 = xor i1 %235, true
  br i1 %236, label %237, label %568

237:                                              ; preds = %234
  call void @llvm.lifetime.start.p0(i64 4, ptr %52) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %53) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %54) #9
  %238 = invoke noundef ptr @_ZNK7RNArrayIPKdE4TailEv(ptr noundef nonnull align 8 dereferenceable(16) %50)
          to label %239 unwind label %324

239:                                              ; preds = %237
  store ptr %238, ptr %54, align 8, !tbaa !5
  invoke void @_ZN8RNVArray10RemoveTailEv(ptr noundef nonnull align 8 dereferenceable(16) %50)
          to label %240 unwind label %324

240:                                              ; preds = %239
  call void @llvm.lifetime.start.p0(i64 4, ptr %55) #9
  %241 = load ptr, ptr %54, align 8, !tbaa !5
  %242 = load ptr, ptr %38, align 8, !tbaa !5
  %243 = ptrtoint ptr %241 to i64
  %244 = ptrtoint ptr %242 to i64
  %245 = sub i64 %243, %244
  %246 = sdiv exact i64 %245, 8
  %247 = trunc i64 %246 to i32
  store i32 %247, ptr %55, align 4, !tbaa !11
  %248 = load i32, ptr %55, align 4, !tbaa !11
  invoke void @_ZNK6R2Grid14IndexToIndicesEiRiS0_(ptr noundef nonnull align 8 dereferenceable(208) %37, i32 noundef %248, ptr noundef nonnull align 4 dereferenceable(4) %52, ptr noundef nonnull align 4 dereferenceable(4) %53)
          to label %249 unwind label %328

249:                                              ; preds = %240
  call void @llvm.lifetime.start.p0(i64 8, ptr %56) #9
  %250 = load ptr, ptr %17, align 8, !tbaa !5
  %251 = load i32, ptr %52, align 4, !tbaa !11
  %252 = load i32, ptr %53, align 4, !tbaa !11
  %253 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %250, i32 noundef %251, i32 noundef %252)
          to label %254 unwind label %332

254:                                              ; preds = %249
  store double %253, ptr %56, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %57) #9
  %255 = load ptr, ptr %18, align 8, !tbaa !5
  %256 = load i32, ptr %52, align 4, !tbaa !11
  %257 = load i32, ptr %53, align 4, !tbaa !11
  %258 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %255, i32 noundef %256, i32 noundef %257)
          to label %259 unwind label %336

259:                                              ; preds = %254
  store double %258, ptr %57, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %58) #9
  %260 = load ptr, ptr %19, align 8, !tbaa !5
  %261 = load i32, ptr %52, align 4, !tbaa !11
  %262 = load i32, ptr %53, align 4, !tbaa !11
  %263 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %260, i32 noundef %261, i32 noundef %262)
          to label %264 unwind label %340

264:                                              ; preds = %259
  store double %263, ptr %58, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %59) #9
  %265 = load double, ptr %56, align 8, !tbaa !9
  %266 = load double, ptr %57, align 8, !tbaa !9
  %267 = load double, ptr %58, align 8, !tbaa !9
  invoke void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %59, double noundef %265, double noundef %266, double noundef %267)
          to label %268 unwind label %344

268:                                              ; preds = %264
  call void @llvm.lifetime.start.p0(i64 8, ptr %60) #9
  %269 = load ptr, ptr %20, align 8, !tbaa !5
  %270 = load i32, ptr %52, align 4, !tbaa !11
  %271 = load i32, ptr %53, align 4, !tbaa !11
  %272 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %269, i32 noundef %270, i32 noundef %271)
          to label %273 unwind label %348

273:                                              ; preds = %268
  store double %272, ptr %60, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %61) #9
  %274 = load double, ptr %60, align 8, !tbaa !9
  %275 = fadd double %274, 5.000000e-01
  %276 = fptosi double %275 to i32
  store i32 %276, ptr %61, align 4, !tbaa !11
  %277 = load ptr, ptr %34, align 8, !tbaa !5
  %278 = load i32, ptr %42, align 4, !tbaa !11
  %279 = add nsw i32 %278, 1
  store i32 %279, ptr %42, align 4, !tbaa !11
  %280 = sext i32 %278 to i64
  %281 = getelementptr inbounds %class.R3Point, ptr %277, i64 %280
  %282 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %281, ptr noundef nonnull align 8 dereferenceable(24) %59)
          to label %283 unwind label %352

283:                                              ; preds = %273
  call void @llvm.lifetime.start.p0(i64 4, ptr %62) #9
  %284 = load i32, ptr %52, align 4, !tbaa !11
  %285 = sub nsw i32 %284, 1
  store i32 %285, ptr %62, align 4, !tbaa !11
  br label %286

286:                                              ; preds = %555, %283
  %287 = load i32, ptr %62, align 4, !tbaa !11
  %288 = load i32, ptr %52, align 4, !tbaa !11
  %289 = add nsw i32 %288, 1
  %290 = icmp sle i32 %287, %289
  br i1 %290, label %356, label %291

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

292:                                              ; preds = %189
  %293 = landingpad { ptr, i32 }
          cleanup
  %294 = extractvalue { ptr, i32 } %293, 0
  store ptr %294, ptr %35, align 8
  %295 = extractvalue { ptr, i32 } %293, 1
  store i32 %295, ptr %36, align 4
  br label %801

296:                                              ; preds = %194
  %297 = landingpad { ptr, i32 }
          cleanup
  %298 = extractvalue { ptr, i32 } %297, 0
  store ptr %298, ptr %35, align 8
  %299 = extractvalue { ptr, i32 } %297, 1
  store i32 %299, ptr %36, align 4
  br label %800

300:                                              ; preds = %199
  %301 = landingpad { ptr, i32 }
          cleanup
  %302 = extractvalue { ptr, i32 } %301, 0
  store ptr %302, ptr %35, align 8
  %303 = extractvalue { ptr, i32 } %301, 1
  store i32 %303, ptr %36, align 4
  br label %799

304:                                              ; preds = %204
  %305 = landingpad { ptr, i32 }
          cleanup
  %306 = extractvalue { ptr, i32 } %305, 0
  store ptr %306, ptr %35, align 8
  %307 = extractvalue { ptr, i32 } %305, 1
  store i32 %307, ptr %36, align 4
  br label %798

308:                                              ; preds = %209
  %309 = landingpad { ptr, i32 }
          cleanup
  %310 = extractvalue { ptr, i32 } %309, 0
  store ptr %310, ptr %35, align 8
  %311 = extractvalue { ptr, i32 } %309, 1
  store i32 %311, ptr %36, align 4
  br label %797

312:                                              ; preds = %216
  %313 = landingpad { ptr, i32 }
          cleanup
  %314 = extractvalue { ptr, i32 } %313, 0
  store ptr %314, ptr %35, align 8
  %315 = extractvalue { ptr, i32 } %313, 1
  store i32 %315, ptr %36, align 4
  br label %571

316:                                              ; preds = %217
  %317 = landingpad { ptr, i32 }
          cleanup
  %318 = extractvalue { ptr, i32 } %317, 0
  store ptr %318, ptr %35, align 8
  %319 = extractvalue { ptr, i32 } %317, 1
  store i32 %319, ptr %36, align 4
  br label %570

320:                                              ; preds = %232, %228, %220
  %321 = landingpad { ptr, i32 }
          cleanup
  %322 = extractvalue { ptr, i32 } %321, 0
  store ptr %322, ptr %35, align 8
  %323 = extractvalue { ptr, i32 } %321, 1
  store i32 %323, ptr %36, align 4
  br label %569

324:                                              ; preds = %239, %237
  %325 = landingpad { ptr, i32 }
          cleanup
  %326 = extractvalue { ptr, i32 } %325, 0
  store ptr %326, ptr %35, align 8
  %327 = extractvalue { ptr, i32 } %325, 1
  store i32 %327, ptr %36, align 4
  br label %567

328:                                              ; preds = %240
  %329 = landingpad { ptr, i32 }
          cleanup
  %330 = extractvalue { ptr, i32 } %329, 0
  store ptr %330, ptr %35, align 8
  %331 = extractvalue { ptr, i32 } %329, 1
  store i32 %331, ptr %36, align 4
  br label %566

332:                                              ; preds = %249
  %333 = landingpad { ptr, i32 }
          cleanup
  %334 = extractvalue { ptr, i32 } %333, 0
  store ptr %334, ptr %35, align 8
  %335 = extractvalue { ptr, i32 } %333, 1
  store i32 %335, ptr %36, align 4
  br label %565

336:                                              ; preds = %254
  %337 = landingpad { ptr, i32 }
          cleanup
  %338 = extractvalue { ptr, i32 } %337, 0
  store ptr %338, ptr %35, align 8
  %339 = extractvalue { ptr, i32 } %337, 1
  store i32 %339, ptr %36, align 4
  br label %564

340:                                              ; preds = %259
  %341 = landingpad { ptr, i32 }
          cleanup
  %342 = extractvalue { ptr, i32 } %341, 0
  store ptr %342, ptr %35, align 8
  %343 = extractvalue { ptr, i32 } %341, 1
  store i32 %343, ptr %36, align 4
  br label %563

344:                                              ; preds = %264
  %345 = landingpad { ptr, i32 }
          cleanup
  %346 = extractvalue { ptr, i32 } %345, 0
  store ptr %346, ptr %35, align 8
  %347 = extractvalue { ptr, i32 } %345, 1
  store i32 %347, ptr %36, align 4
  br label %562

348:                                              ; preds = %268
  %349 = landingpad { ptr, i32 }
          cleanup
  %350 = extractvalue { ptr, i32 } %349, 0
  store ptr %350, ptr %35, align 8
  %351 = extractvalue { ptr, i32 } %349, 1
  store i32 %351, ptr %36, align 4
  br label %561

352:                                              ; preds = %273
  %353 = landingpad { ptr, i32 }
          cleanup
  %354 = extractvalue { ptr, i32 } %353, 0
  store ptr %354, ptr %35, align 8
  %355 = extractvalue { ptr, i32 } %353, 1
  store i32 %355, ptr %36, align 4
  br label %560

356:                                              ; preds = %286
  %357 = load i32, ptr %62, align 4, !tbaa !11
  %358 = icmp slt i32 %357, 0
  br i1 %358, label %364, label %359

359:                                              ; preds = %356
  %360 = load i32, ptr %62, align 4, !tbaa !11
  %361 = invoke noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %37)
          to label %362 unwind label %365

362:                                              ; preds = %359
  %363 = icmp sge i32 %360, %361
  br i1 %363, label %364, label %369

364:                                              ; preds = %362, %356
  br label %555

365:                                              ; preds = %359
  %366 = landingpad { ptr, i32 }
          cleanup
  %367 = extractvalue { ptr, i32 } %366, 0
  store ptr %367, ptr %35, align 8
  %368 = extractvalue { ptr, i32 } %366, 1
  store i32 %368, ptr %36, align 4
  br label %558

369:                                              ; preds = %362
  call void @llvm.lifetime.start.p0(i64 4, ptr %63) #9
  %370 = load i32, ptr %53, align 4, !tbaa !11
  %371 = sub nsw i32 %370, 1
  store i32 %371, ptr %63, align 4, !tbaa !11
  br label %372

372:                                              ; preds = %533, %369
  %373 = load i32, ptr %63, align 4, !tbaa !11
  %374 = load i32, ptr %53, align 4, !tbaa !11
  %375 = add nsw i32 %374, 1
  %376 = icmp sle i32 %373, %375
  br i1 %376, label %378, label %377

377:                                              ; preds = %372
  store i32 13, ptr %40, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %63) #9
  br label %554

378:                                              ; preds = %372
  %379 = load i32, ptr %63, align 4, !tbaa !11
  %380 = icmp slt i32 %379, 0
  br i1 %380, label %386, label %381

381:                                              ; preds = %378
  %382 = load i32, ptr %63, align 4, !tbaa !11
  %383 = invoke noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %37)
          to label %384 unwind label %387

384:                                              ; preds = %381
  %385 = icmp sge i32 %382, %383
  br i1 %385, label %386, label %391

386:                                              ; preds = %384, %378
  br label %533

387:                                              ; preds = %381
  %388 = landingpad { ptr, i32 }
          cleanup
  %389 = extractvalue { ptr, i32 } %388, 0
  store ptr %389, ptr %35, align 8
  %390 = extractvalue { ptr, i32 } %388, 1
  store i32 %390, ptr %36, align 4
  br label %553

391:                                              ; preds = %384
  call void @llvm.lifetime.start.p0(i64 8, ptr %64) #9
  %392 = load i32, ptr %62, align 4, !tbaa !11
  %393 = load i32, ptr %63, align 4, !tbaa !11
  %394 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %37, i32 noundef %392, i32 noundef %393)
          to label %395 unwind label %404

395:                                              ; preds = %391
  store double %394, ptr %64, align 8, !tbaa !9
  %396 = load double, ptr %64, align 8, !tbaa !9
  %397 = load i32, ptr %49, align 4, !tbaa !11
  %398 = sitofp i32 %397 to double
  %399 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %400 = invoke noundef i32 @_Z9RNIsEqualddd(double noundef %396, double noundef %398, double noundef %399)
          to label %401 unwind label %404

401:                                              ; preds = %395
  %402 = icmp ne i32 %400, 0
  br i1 %402, label %403, label %408

403:                                              ; preds = %401
  store i32 15, ptr %40, align 4
  br label %530

404:                                              ; preds = %408, %395, %391
  %405 = landingpad { ptr, i32 }
          cleanup
  %406 = extractvalue { ptr, i32 } %405, 0
  store ptr %406, ptr %35, align 8
  %407 = extractvalue { ptr, i32 } %405, 1
  store i32 %407, ptr %36, align 4
  br label %552

408:                                              ; preds = %401
  %409 = load i32, ptr %62, align 4, !tbaa !11
  %410 = load i32, ptr %63, align 4, !tbaa !11
  %411 = load i32, ptr %49, align 4, !tbaa !11
  %412 = sitofp i32 %411 to double
  invoke void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %37, i32 noundef %409, i32 noundef %410, double noundef %412)
          to label %413 unwind label %404

413:                                              ; preds = %408
  call void @llvm.lifetime.start.p0(i64 8, ptr %65) #9
  %414 = load ptr, ptr %16, align 8, !tbaa !5
  %415 = load i32, ptr %62, align 4, !tbaa !11
  %416 = load i32, ptr %63, align 4, !tbaa !11
  %417 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %414, i32 noundef %415, i32 noundef %416)
          to label %418 unwind label %425

418:                                              ; preds = %413
  store double %417, ptr %65, align 8, !tbaa !9
  %419 = load double, ptr %65, align 8, !tbaa !9
  %420 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %421 = invoke noundef i32 @_Z18RNIsNegativeOrZerodd(double noundef %419, double noundef %420)
          to label %422 unwind label %425

422:                                              ; preds = %418
  %423 = icmp ne i32 %421, 0
  br i1 %423, label %424, label %429

424:                                              ; preds = %422
  store i32 15, ptr %40, align 4
  br label %529

425:                                              ; preds = %418, %413
  %426 = landingpad { ptr, i32 }
          cleanup
  %427 = extractvalue { ptr, i32 } %426, 0
  store ptr %427, ptr %35, align 8
  %428 = extractvalue { ptr, i32 } %426, 1
  store i32 %428, ptr %36, align 4
  br label %551

429:                                              ; preds = %422
  call void @llvm.lifetime.start.p0(i64 16, ptr %66) #9
  %430 = load i32, ptr %62, align 4, !tbaa !11
  %431 = sitofp i32 %430 to double
  %432 = load i32, ptr %63, align 4, !tbaa !11
  %433 = sitofp i32 %432 to double
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %66, double noundef %431, double noundef %433)
          to label %434 unwind label %441

434:                                              ; preds = %429
  %435 = invoke noundef double @_Z17R2SquaredDistanceRK7R2PointS1_(ptr noundef nonnull align 8 dereferenceable(16) %44, ptr noundef nonnull align 8 dereferenceable(16) %66)
          to label %436 unwind label %441

436:                                              ; preds = %434
  %437 = load i32, ptr %32, align 4, !tbaa !11
  %438 = sitofp i32 %437 to double
  %439 = fcmp ogt double %435, %438
  br i1 %439, label %440, label %445

440:                                              ; preds = %436
  store i32 15, ptr %40, align 4
  br label %528

441:                                              ; preds = %434, %429
  %442 = landingpad { ptr, i32 }
          cleanup
  %443 = extractvalue { ptr, i32 } %442, 0
  store ptr %443, ptr %35, align 8
  %444 = extractvalue { ptr, i32 } %442, 1
  store i32 %444, ptr %36, align 4
  br label %550

445:                                              ; preds = %436
  call void @llvm.lifetime.start.p0(i64 8, ptr %67) #9
  %446 = load ptr, ptr %17, align 8, !tbaa !5
  %447 = load i32, ptr %62, align 4, !tbaa !11
  %448 = load i32, ptr %63, align 4, !tbaa !11
  %449 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %446, i32 noundef %447, i32 noundef %448)
          to label %450 unwind label %473

450:                                              ; preds = %445
  store double %449, ptr %67, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %68) #9
  %451 = load ptr, ptr %18, align 8, !tbaa !5
  %452 = load i32, ptr %62, align 4, !tbaa !11
  %453 = load i32, ptr %63, align 4, !tbaa !11
  %454 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %451, i32 noundef %452, i32 noundef %453)
          to label %455 unwind label %477

455:                                              ; preds = %450
  store double %454, ptr %68, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %69) #9
  %456 = load ptr, ptr %19, align 8, !tbaa !5
  %457 = load i32, ptr %62, align 4, !tbaa !11
  %458 = load i32, ptr %63, align 4, !tbaa !11
  %459 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %456, i32 noundef %457, i32 noundef %458)
          to label %460 unwind label %481

460:                                              ; preds = %455
  store double %459, ptr %69, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %70) #9
  %461 = load double, ptr %67, align 8, !tbaa !9
  %462 = load double, ptr %68, align 8, !tbaa !9
  %463 = load double, ptr %69, align 8, !tbaa !9
  invoke void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %70, double noundef %461, double noundef %462, double noundef %463)
          to label %464 unwind label %485

464:                                              ; preds = %460
  %465 = load double, ptr %33, align 8, !tbaa !9
  %466 = fcmp ogt double %465, 0.000000e+00
  br i1 %466, label %467, label %490

467:                                              ; preds = %464
  %468 = invoke noundef double @_Z17R3SquaredDistanceRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24) %48, ptr noundef nonnull align 8 dereferenceable(24) %70)
          to label %469 unwind label %485

469:                                              ; preds = %467
  %470 = load double, ptr %33, align 8, !tbaa !9
  %471 = fcmp ogt double %468, %470
  br i1 %471, label %472, label %489

472:                                              ; preds = %469
  store i32 15, ptr %40, align 4
  br label %527

473:                                              ; preds = %445
  %474 = landingpad { ptr, i32 }
          cleanup
  %475 = extractvalue { ptr, i32 } %474, 0
  store ptr %475, ptr %35, align 8
  %476 = extractvalue { ptr, i32 } %474, 1
  store i32 %476, ptr %36, align 4
  br label %549

477:                                              ; preds = %450
  %478 = landingpad { ptr, i32 }
          cleanup
  %479 = extractvalue { ptr, i32 } %478, 0
  store ptr %479, ptr %35, align 8
  %480 = extractvalue { ptr, i32 } %478, 1
  store i32 %480, ptr %36, align 4
  br label %548

481:                                              ; preds = %455
  %482 = landingpad { ptr, i32 }
          cleanup
  %483 = extractvalue { ptr, i32 } %482, 0
  store ptr %483, ptr %35, align 8
  %484 = extractvalue { ptr, i32 } %482, 1
  store i32 %484, ptr %36, align 4
  br label %547

485:                                              ; preds = %467, %460
  %486 = landingpad { ptr, i32 }
          cleanup
  %487 = extractvalue { ptr, i32 } %486, 0
  store ptr %487, ptr %35, align 8
  %488 = extractvalue { ptr, i32 } %486, 1
  store i32 %488, ptr %36, align 4
  br label %546

489:                                              ; preds = %469
  br label %490

490:                                              ; preds = %489, %464
  call void @llvm.lifetime.start.p0(i64 4, ptr %71) #9
  %491 = load ptr, ptr %20, align 8, !tbaa !5
  %492 = load i32, ptr %62, align 4, !tbaa !11
  %493 = load i32, ptr %63, align 4, !tbaa !11
  %494 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %491, i32 noundef %492, i32 noundef %493)
          to label %495 unwind label %504

495:                                              ; preds = %490
  %496 = fadd double %494, 5.000000e-01
  %497 = fptosi double %496 to i32
  store i32 %497, ptr %71, align 4, !tbaa !11
  %498 = load i32, ptr %61, align 4, !tbaa !11
  %499 = icmp eq i32 %498, 4
  br i1 %499, label %500, label %508

500:                                              ; preds = %495
  %501 = load i32, ptr %71, align 4, !tbaa !11
  %502 = icmp eq i32 %501, 2
  br i1 %502, label %503, label %508

503:                                              ; preds = %500
  store i32 15, ptr %40, align 4
  br label %526

504:                                              ; preds = %490
  %505 = landingpad { ptr, i32 }
          cleanup
  %506 = extractvalue { ptr, i32 } %505, 0
  store ptr %506, ptr %35, align 8
  %507 = extractvalue { ptr, i32 } %505, 1
  store i32 %507, ptr %36, align 4
  br label %545

508:                                              ; preds = %500, %495
  %509 = load i32, ptr %61, align 4, !tbaa !11
  %510 = icmp eq i32 %509, 2
  br i1 %510, label %511, label %515

511:                                              ; preds = %508
  %512 = load i32, ptr %71, align 4, !tbaa !11
  %513 = icmp eq i32 %512, 4
  br i1 %513, label %514, label %515

514:                                              ; preds = %511
  store i32 15, ptr %40, align 4
  br label %526

515:                                              ; preds = %511, %508
  call void @llvm.lifetime.start.p0(i64 4, ptr %72) #9
  %516 = load i32, ptr %62, align 4, !tbaa !11
  %517 = load i32, ptr %63, align 4, !tbaa !11
  invoke void @_ZNK6R2Grid14IndicesToIndexEiiRi(ptr noundef nonnull align 8 dereferenceable(208) %37, i32 noundef %516, i32 noundef %517, ptr noundef nonnull align 4 dereferenceable(4) %72)
          to label %518 unwind label %536

518:                                              ; preds = %515
  call void @llvm.lifetime.start.p0(i64 8, ptr %73) #9
  %519 = load ptr, ptr %38, align 8, !tbaa !5
  %520 = load i32, ptr %72, align 4, !tbaa !11
  %521 = sext i32 %520 to i64
  %522 = getelementptr inbounds double, ptr %519, i64 %521
  store ptr %522, ptr %73, align 8, !tbaa !5
  %523 = load ptr, ptr %73, align 8, !tbaa !5
  %524 = invoke noundef ptr @_ZN7RNArrayIPKdE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %50, ptr noundef %523)
          to label %525 unwind label %540

525:                                              ; preds = %518
  call void @llvm.lifetime.end.p0(i64 8, ptr %73) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %72) #9
  store i32 0, ptr %40, align 4
  br label %526

526:                                              ; preds = %525, %514, %503
  call void @llvm.lifetime.end.p0(i64 4, ptr %71) #9
  br label %527

527:                                              ; preds = %526, %472
  call void @llvm.lifetime.end.p0(i64 24, ptr %70) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %69) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %68) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %67) #9
  br label %528

528:                                              ; preds = %527, %440
  call void @llvm.lifetime.end.p0(i64 16, ptr %66) #9
  br label %529

529:                                              ; preds = %528, %424
  call void @llvm.lifetime.end.p0(i64 8, ptr %65) #9
  br label %530

530:                                              ; preds = %529, %403
  call void @llvm.lifetime.end.p0(i64 8, ptr %64) #9
  %531 = load i32, ptr %40, align 4
  switch i32 %531, label %821 [
    i32 0, label %532
    i32 15, label %533
  ]

532:                                              ; preds = %530
  br label %533

533:                                              ; preds = %532, %530, %386
  %534 = load i32, ptr %63, align 4, !tbaa !11
  %535 = add nsw i32 %534, 1
  store i32 %535, ptr %63, align 4, !tbaa !11
  br label %372, !llvm.loop !13

536:                                              ; preds = %515
  %537 = landingpad { ptr, i32 }
          cleanup
  %538 = extractvalue { ptr, i32 } %537, 0
  store ptr %538, ptr %35, align 8
  %539 = extractvalue { ptr, i32 } %537, 1
  store i32 %539, ptr %36, align 4
  br label %544

540:                                              ; preds = %518
  %541 = landingpad { ptr, i32 }
          cleanup
  %542 = extractvalue { ptr, i32 } %541, 0
  store ptr %542, ptr %35, align 8
  %543 = extractvalue { ptr, i32 } %541, 1
  store i32 %543, ptr %36, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %73) #9
  br label %544

544:                                              ; preds = %540, %536
  call void @llvm.lifetime.end.p0(i64 4, ptr %72) #9
  br label %545

545:                                              ; preds = %544, %504
  call void @llvm.lifetime.end.p0(i64 4, ptr %71) #9
  br label %546

546:                                              ; preds = %545, %485
  call void @llvm.lifetime.end.p0(i64 24, ptr %70) #9
  br label %547

547:                                              ; preds = %546, %481
  call void @llvm.lifetime.end.p0(i64 8, ptr %69) #9
  br label %548

548:                                              ; preds = %547, %477
  call void @llvm.lifetime.end.p0(i64 8, ptr %68) #9
  br label %549

549:                                              ; preds = %548, %473
  call void @llvm.lifetime.end.p0(i64 8, ptr %67) #9
  br label %550

550:                                              ; preds = %549, %441
  call void @llvm.lifetime.end.p0(i64 16, ptr %66) #9
  br label %551

551:                                              ; preds = %550, %425
  call void @llvm.lifetime.end.p0(i64 8, ptr %65) #9
  br label %552

552:                                              ; preds = %551, %404
  call void @llvm.lifetime.end.p0(i64 8, ptr %64) #9
  br label %553

553:                                              ; preds = %552, %387
  call void @llvm.lifetime.end.p0(i64 4, ptr %63) #9
  br label %558

554:                                              ; preds = %377
  br label %555

555:                                              ; preds = %554, %364
  %556 = load i32, ptr %62, align 4, !tbaa !11
  %557 = add nsw i32 %556, 1
  store i32 %557, ptr %62, align 4, !tbaa !11
  br label %286, !llvm.loop !15

558:                                              ; preds = %553, %365
  call void @llvm.lifetime.end.p0(i64 4, ptr %62) #9
  br label %560

559:                                              ; preds = %291
  call void @llvm.lifetime.end.p0(i64 4, ptr %61) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %60) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %59) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %58) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %57) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %56) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %55) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %54) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %53) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %52) #9
  br label %232, !llvm.loop !16

560:                                              ; preds = %558, %352
  call void @llvm.lifetime.end.p0(i64 4, ptr %61) #9
  br label %561

561:                                              ; preds = %560, %348
  call void @llvm.lifetime.end.p0(i64 8, ptr %60) #9
  br label %562

562:                                              ; preds = %561, %344
  call void @llvm.lifetime.end.p0(i64 24, ptr %59) #9
  br label %563

563:                                              ; preds = %562, %340
  call void @llvm.lifetime.end.p0(i64 8, ptr %58) #9
  br label %564

564:                                              ; preds = %563, %336
  call void @llvm.lifetime.end.p0(i64 8, ptr %57) #9
  br label %565

565:                                              ; preds = %564, %332
  call void @llvm.lifetime.end.p0(i64 8, ptr %56) #9
  br label %566

566:                                              ; preds = %565, %328
  call void @llvm.lifetime.end.p0(i64 4, ptr %55) #9
  br label %567

567:                                              ; preds = %566, %324
  call void @llvm.lifetime.end.p0(i64 8, ptr %54) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %53) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %52) #9
  br label %569

568:                                              ; preds = %234
  call void @llvm.lifetime.end.p0(i64 8, ptr %51) #9
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %50) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %50) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %49) #9
  br label %709

569:                                              ; preds = %567, %320
  call void @llvm.lifetime.end.p0(i64 8, ptr %51) #9
  br label %570

570:                                              ; preds = %569, %316
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %50) #9
  br label %571

571:                                              ; preds = %570, %312
  call void @llvm.lifetime.end.p0(i64 16, ptr %50) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %49) #9
  br label %797

572:                                              ; preds = %213
  call void @llvm.lifetime.start.p0(i64 4, ptr %74) #9
  %573 = load i32, ptr %39, align 4, !tbaa !11
  %574 = load i32, ptr %29, align 4, !tbaa !11
  %575 = sub nsw i32 %573, %574
  store i32 %575, ptr %74, align 4, !tbaa !11
  br label %576

576:                                              ; preds = %704, %572
  %577 = load i32, ptr %74, align 4, !tbaa !11
  %578 = load i32, ptr %39, align 4, !tbaa !11
  %579 = load i32, ptr %29, align 4, !tbaa !11
  %580 = add nsw i32 %578, %579
  %581 = icmp sle i32 %577, %580
  br i1 %581, label %583, label %582

582:                                              ; preds = %576
  store i32 16, ptr %40, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %74) #9
  br label %708

583:                                              ; preds = %576
  %584 = load i32, ptr %74, align 4, !tbaa !11
  %585 = icmp slt i32 %584, 0
  br i1 %585, label %592, label %586

586:                                              ; preds = %583
  %587 = load i32, ptr %74, align 4, !tbaa !11
  %588 = load ptr, ptr %16, align 8, !tbaa !5
  %589 = invoke noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %588)
          to label %590 unwind label %593

590:                                              ; preds = %586
  %591 = icmp sge i32 %587, %589
  br i1 %591, label %592, label %597

592:                                              ; preds = %590, %583
  br label %704

593:                                              ; preds = %586
  %594 = landingpad { ptr, i32 }
          cleanup
  %595 = extractvalue { ptr, i32 } %594, 0
  store ptr %595, ptr %35, align 8
  %596 = extractvalue { ptr, i32 } %594, 1
  store i32 %596, ptr %36, align 4
  br label %707

597:                                              ; preds = %590
  call void @llvm.lifetime.start.p0(i64 4, ptr %75) #9
  %598 = load i32, ptr %41, align 4, !tbaa !11
  %599 = load i32, ptr %29, align 4, !tbaa !11
  %600 = sub nsw i32 %598, %599
  store i32 %600, ptr %75, align 4, !tbaa !11
  br label %601

601:                                              ; preds = %695, %597
  %602 = load i32, ptr %75, align 4, !tbaa !11
  %603 = load i32, ptr %41, align 4, !tbaa !11
  %604 = load i32, ptr %29, align 4, !tbaa !11
  %605 = add nsw i32 %603, %604
  %606 = icmp sle i32 %602, %605
  br i1 %606, label %608, label %607

607:                                              ; preds = %601
  store i32 19, ptr %40, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %75) #9
  br label %703

608:                                              ; preds = %601
  %609 = load i32, ptr %75, align 4, !tbaa !11
  %610 = icmp slt i32 %609, 0
  br i1 %610, label %617, label %611

611:                                              ; preds = %608
  %612 = load i32, ptr %75, align 4, !tbaa !11
  %613 = load ptr, ptr %16, align 8, !tbaa !5
  %614 = invoke noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %613)
          to label %615 unwind label %618

615:                                              ; preds = %611
  %616 = icmp sge i32 %612, %614
  br i1 %616, label %617, label %622

617:                                              ; preds = %615, %608
  br label %695

618:                                              ; preds = %611
  %619 = landingpad { ptr, i32 }
          cleanup
  %620 = extractvalue { ptr, i32 } %619, 0
  store ptr %620, ptr %35, align 8
  %621 = extractvalue { ptr, i32 } %619, 1
  store i32 %621, ptr %36, align 4
  br label %702

622:                                              ; preds = %615
  call void @llvm.lifetime.start.p0(i64 8, ptr %76) #9
  %623 = load ptr, ptr %16, align 8, !tbaa !5
  %624 = load i32, ptr %74, align 4, !tbaa !11
  %625 = load i32, ptr %75, align 4, !tbaa !11
  %626 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %623, i32 noundef %624, i32 noundef %625)
          to label %627 unwind label %634

627:                                              ; preds = %622
  store double %626, ptr %76, align 8, !tbaa !9
  %628 = load double, ptr %76, align 8, !tbaa !9
  %629 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %630 = invoke noundef i32 @_Z18RNIsNegativeOrZerodd(double noundef %628, double noundef %629)
          to label %631 unwind label %634

631:                                              ; preds = %627
  %632 = icmp ne i32 %630, 0
  br i1 %632, label %633, label %638

633:                                              ; preds = %631
  store i32 21, ptr %40, align 4
  br label %692

634:                                              ; preds = %627, %622
  %635 = landingpad { ptr, i32 }
          cleanup
  %636 = extractvalue { ptr, i32 } %635, 0
  store ptr %636, ptr %35, align 8
  %637 = extractvalue { ptr, i32 } %635, 1
  store i32 %637, ptr %36, align 4
  br label %701

638:                                              ; preds = %631
  call void @llvm.lifetime.start.p0(i64 8, ptr %77) #9
  %639 = load ptr, ptr %17, align 8, !tbaa !5
  %640 = load i32, ptr %74, align 4, !tbaa !11
  %641 = load i32, ptr %75, align 4, !tbaa !11
  %642 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %639, i32 noundef %640, i32 noundef %641)
          to label %643 unwind label %666

643:                                              ; preds = %638
  store double %642, ptr %77, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %78) #9
  %644 = load ptr, ptr %18, align 8, !tbaa !5
  %645 = load i32, ptr %74, align 4, !tbaa !11
  %646 = load i32, ptr %75, align 4, !tbaa !11
  %647 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %644, i32 noundef %645, i32 noundef %646)
          to label %648 unwind label %670

648:                                              ; preds = %643
  store double %647, ptr %78, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %79) #9
  %649 = load ptr, ptr %19, align 8, !tbaa !5
  %650 = load i32, ptr %74, align 4, !tbaa !11
  %651 = load i32, ptr %75, align 4, !tbaa !11
  %652 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %649, i32 noundef %650, i32 noundef %651)
          to label %653 unwind label %674

653:                                              ; preds = %648
  store double %652, ptr %79, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %80) #9
  %654 = load double, ptr %77, align 8, !tbaa !9
  %655 = load double, ptr %78, align 8, !tbaa !9
  %656 = load double, ptr %79, align 8, !tbaa !9
  invoke void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %80, double noundef %654, double noundef %655, double noundef %656)
          to label %657 unwind label %678

657:                                              ; preds = %653
  %658 = load double, ptr %33, align 8, !tbaa !9
  %659 = fcmp ogt double %658, 0.000000e+00
  br i1 %659, label %660, label %683

660:                                              ; preds = %657
  %661 = invoke noundef double @_Z17R3SquaredDistanceRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24) %48, ptr noundef nonnull align 8 dereferenceable(24) %80)
          to label %662 unwind label %678

662:                                              ; preds = %660
  %663 = load double, ptr %33, align 8, !tbaa !9
  %664 = fcmp ogt double %661, %663
  br i1 %664, label %665, label %682

665:                                              ; preds = %662
  store i32 21, ptr %40, align 4
  br label %691

666:                                              ; preds = %638
  %667 = landingpad { ptr, i32 }
          cleanup
  %668 = extractvalue { ptr, i32 } %667, 0
  store ptr %668, ptr %35, align 8
  %669 = extractvalue { ptr, i32 } %667, 1
  store i32 %669, ptr %36, align 4
  br label %700

670:                                              ; preds = %643
  %671 = landingpad { ptr, i32 }
          cleanup
  %672 = extractvalue { ptr, i32 } %671, 0
  store ptr %672, ptr %35, align 8
  %673 = extractvalue { ptr, i32 } %671, 1
  store i32 %673, ptr %36, align 4
  br label %699

674:                                              ; preds = %648
  %675 = landingpad { ptr, i32 }
          cleanup
  %676 = extractvalue { ptr, i32 } %675, 0
  store ptr %676, ptr %35, align 8
  %677 = extractvalue { ptr, i32 } %675, 1
  store i32 %677, ptr %36, align 4
  br label %698

678:                                              ; preds = %683, %660, %653
  %679 = landingpad { ptr, i32 }
          cleanup
  %680 = extractvalue { ptr, i32 } %679, 0
  store ptr %680, ptr %35, align 8
  %681 = extractvalue { ptr, i32 } %679, 1
  store i32 %681, ptr %36, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %80) #9
  br label %698

682:                                              ; preds = %662
  br label %683

683:                                              ; preds = %682, %657
  %684 = load ptr, ptr %34, align 8, !tbaa !5
  %685 = load i32, ptr %42, align 4, !tbaa !11
  %686 = add nsw i32 %685, 1
  store i32 %686, ptr %42, align 4, !tbaa !11
  %687 = sext i32 %685 to i64
  %688 = getelementptr inbounds %class.R3Point, ptr %684, i64 %687
  %689 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %688, ptr noundef nonnull align 8 dereferenceable(24) %80)
          to label %690 unwind label %678

690:                                              ; preds = %683
  store i32 0, ptr %40, align 4
  br label %691

691:                                              ; preds = %690, %665
  call void @llvm.lifetime.end.p0(i64 24, ptr %80) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %79) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %78) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %77) #9
  br label %692

692:                                              ; preds = %691, %633
  call void @llvm.lifetime.end.p0(i64 8, ptr %76) #9
  %693 = load i32, ptr %40, align 4
  switch i32 %693, label %821 [
    i32 0, label %694
    i32 21, label %695
  ]

694:                                              ; preds = %692
  br label %695

695:                                              ; preds = %694, %692, %617
  %696 = load i32, ptr %75, align 4, !tbaa !11
  %697 = add nsw i32 %696, 1
  store i32 %697, ptr %75, align 4, !tbaa !11
  br label %601, !llvm.loop !17

698:                                              ; preds = %678, %674
  call void @llvm.lifetime.end.p0(i64 8, ptr %79) #9
  br label %699

699:                                              ; preds = %698, %670
  call void @llvm.lifetime.end.p0(i64 8, ptr %78) #9
  br label %700

700:                                              ; preds = %699, %666
  call void @llvm.lifetime.end.p0(i64 8, ptr %77) #9
  br label %701

701:                                              ; preds = %700, %634
  call void @llvm.lifetime.end.p0(i64 8, ptr %76) #9
  br label %702

702:                                              ; preds = %701, %618
  call void @llvm.lifetime.end.p0(i64 4, ptr %75) #9
  br label %707

703:                                              ; preds = %607
  br label %704

704:                                              ; preds = %703, %592
  %705 = load i32, ptr %74, align 4, !tbaa !11
  %706 = add nsw i32 %705, 1
  store i32 %706, ptr %74, align 4, !tbaa !11
  br label %576, !llvm.loop !18

707:                                              ; preds = %702, %593
  call void @llvm.lifetime.end.p0(i64 4, ptr %74) #9
  br label %797

708:                                              ; preds = %582
  br label %709

709:                                              ; preds = %708, %568
  %710 = load i32, ptr %42, align 4, !tbaa !11
  %711 = icmp slt i32 %710, 3
  br i1 %711, label %712, label %713

712:                                              ; preds = %709
  store i32 7, ptr %40, align 4
  br label %782

713:                                              ; preds = %709
  call void @llvm.lifetime.start.p0(i64 24, ptr %81) #9
  call void @llvm.lifetime.start.p0(i64 24, ptr %82) #9
  %714 = load i32, ptr %42, align 4, !tbaa !11
  %715 = load ptr, ptr %34, align 8, !tbaa !5
  invoke void @_Z10R3CentroidiP7R3PointPKd(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %82, i32 noundef %714, ptr noundef %715, ptr noundef null)
          to label %716 unwind label %731

716:                                              ; preds = %713
  call void @llvm.lifetime.start.p0(i64 72, ptr %83) #9
  %717 = load i32, ptr %42, align 4, !tbaa !11
  %718 = load ptr, ptr %34, align 8, !tbaa !5
  %719 = getelementptr inbounds [3 x double], ptr %81, i64 0, i64 0
  invoke void @_Z15R3PrincipleAxesRK7R3PointiPS_PKdPd(ptr dead_on_unwind writable sret(%class.R3Triad) align 8 %83, ptr noundef nonnull align 8 dereferenceable(24) %82, i32 noundef %717, ptr noundef %718, ptr noundef null, ptr noundef %719)
          to label %720 unwind label %735

720:                                              ; preds = %716
  call void @llvm.lifetime.start.p0(i64 24, ptr %84) #9
  %721 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3TriadixEi(ptr noundef nonnull align 8 dereferenceable(72) %83, i32 noundef 2)
          to label %722 unwind label %739

722:                                              ; preds = %720
  invoke void @_ZN8R3VectorC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %84, ptr noundef nonnull align 8 dereferenceable(24) %721)
          to label %723 unwind label %739

723:                                              ; preds = %722
  call void @llvm.lifetime.start.p0(i64 32, ptr %85) #9
  invoke void @_ZN7R3PlaneC1ERK7R3PointRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(32) %85, ptr noundef nonnull align 8 dereferenceable(24) %48, ptr noundef nonnull align 8 dereferenceable(24) %84)
          to label %724 unwind label %743

724:                                              ; preds = %723
  %725 = load ptr, ptr %25, align 8, !tbaa !5
  %726 = invoke noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %85, ptr noundef nonnull align 8 dereferenceable(24) %725)
          to label %727 unwind label %743

727:                                              ; preds = %724
  %728 = fcmp olt double %726, 0.000000e+00
  br i1 %728, label %729, label %747

729:                                              ; preds = %727
  invoke void @_ZN8R3Vector4FlipEv(ptr noundef nonnull align 8 dereferenceable(24) %84)
          to label %730 unwind label %743

730:                                              ; preds = %729
  br label %747

731:                                              ; preds = %713
  %732 = landingpad { ptr, i32 }
          cleanup
  %733 = extractvalue { ptr, i32 } %732, 0
  store ptr %733, ptr %35, align 8
  %734 = extractvalue { ptr, i32 } %732, 1
  store i32 %734, ptr %36, align 4
  br label %796

735:                                              ; preds = %716
  %736 = landingpad { ptr, i32 }
          cleanup
  %737 = extractvalue { ptr, i32 } %736, 0
  store ptr %737, ptr %35, align 8
  %738 = extractvalue { ptr, i32 } %736, 1
  store i32 %738, ptr %36, align 4
  br label %795

739:                                              ; preds = %722, %720
  %740 = landingpad { ptr, i32 }
          cleanup
  %741 = extractvalue { ptr, i32 } %740, 0
  store ptr %741, ptr %35, align 8
  %742 = extractvalue { ptr, i32 } %740, 1
  store i32 %742, ptr %36, align 4
  br label %794

743:                                              ; preds = %764, %759, %758, %753, %752, %747, %729, %724, %723
  %744 = landingpad { ptr, i32 }
          cleanup
  %745 = extractvalue { ptr, i32 } %744, 0
  store ptr %745, ptr %35, align 8
  %746 = extractvalue { ptr, i32 } %744, 1
  store i32 %746, ptr %36, align 4
  br label %793

747:                                              ; preds = %730, %727
  %748 = load ptr, ptr %21, align 8, !tbaa !5
  %749 = load i32, ptr %39, align 4, !tbaa !11
  %750 = load i32, ptr %41, align 4, !tbaa !11
  %751 = invoke noundef double @_ZNK8R3Vector1XEv(ptr noundef nonnull align 8 dereferenceable(24) %84)
          to label %752 unwind label %743

752:                                              ; preds = %747
  invoke void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %748, i32 noundef %749, i32 noundef %750, double noundef %751)
          to label %753 unwind label %743

753:                                              ; preds = %752
  %754 = load ptr, ptr %22, align 8, !tbaa !5
  %755 = load i32, ptr %39, align 4, !tbaa !11
  %756 = load i32, ptr %41, align 4, !tbaa !11
  %757 = invoke noundef double @_ZNK8R3Vector1YEv(ptr noundef nonnull align 8 dereferenceable(24) %84)
          to label %758 unwind label %743

758:                                              ; preds = %753
  invoke void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %754, i32 noundef %755, i32 noundef %756, double noundef %757)
          to label %759 unwind label %743

759:                                              ; preds = %758
  %760 = load ptr, ptr %23, align 8, !tbaa !5
  %761 = load i32, ptr %39, align 4, !tbaa !11
  %762 = load i32, ptr %41, align 4, !tbaa !11
  %763 = invoke noundef double @_ZNK8R3Vector1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %84)
          to label %764 unwind label %743

764:                                              ; preds = %759
  invoke void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %760, i32 noundef %761, i32 noundef %762, double noundef %763)
          to label %765 unwind label %743

765:                                              ; preds = %764
  call void @llvm.lifetime.start.p0(i64 8, ptr %86) #9
  %766 = getelementptr inbounds [3 x double], ptr %81, i64 0, i64 0
  %767 = load double, ptr %766, align 16, !tbaa !9
  %768 = call double @sqrt(double noundef %767) #9
  store double %768, ptr %86, align 8, !tbaa !9
  %769 = load i32, ptr %29, align 4, !tbaa !11
  %770 = icmp sgt i32 %769, 1
  br i1 %770, label %771, label %776

771:                                              ; preds = %765
  %772 = load i32, ptr %29, align 4, !tbaa !11
  %773 = sitofp i32 %772 to double
  %774 = load double, ptr %86, align 8, !tbaa !9
  %775 = fdiv double %774, %773
  store double %775, ptr %86, align 8, !tbaa !9
  br label %776

776:                                              ; preds = %771, %765
  %777 = load ptr, ptr %24, align 8, !tbaa !5
  %778 = load i32, ptr %39, align 4, !tbaa !11
  %779 = load i32, ptr %41, align 4, !tbaa !11
  %780 = load double, ptr %86, align 8, !tbaa !9
  invoke void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %777, i32 noundef %778, i32 noundef %779, double noundef %780)
          to label %781 unwind label %789

781:                                              ; preds = %776
  call void @llvm.lifetime.end.p0(i64 8, ptr %86) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %85) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %84) #9
  call void @llvm.lifetime.end.p0(i64 72, ptr %83) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %82) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %81) #9
  store i32 0, ptr %40, align 4
  br label %782

782:                                              ; preds = %781, %712
  call void @llvm.lifetime.end.p0(i64 24, ptr %48) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %44) #9
  br label %783

783:                                              ; preds = %782, %184
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #9
  %784 = load i32, ptr %40, align 4
  switch i32 %784, label %821 [
    i32 0, label %785
    i32 7, label %786
  ]

785:                                              ; preds = %783
  br label %786

786:                                              ; preds = %785, %783
  %787 = load i32, ptr %41, align 4, !tbaa !11
  %788 = add nsw i32 %787, 1
  store i32 %788, ptr %41, align 4, !tbaa !11
  br label %162, !llvm.loop !19

789:                                              ; preds = %776
  %790 = landingpad { ptr, i32 }
          cleanup
  %791 = extractvalue { ptr, i32 } %790, 0
  store ptr %791, ptr %35, align 8
  %792 = extractvalue { ptr, i32 } %790, 1
  store i32 %792, ptr %36, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %86) #9
  br label %793

793:                                              ; preds = %789, %743
  call void @llvm.lifetime.end.p0(i64 32, ptr %85) #9
  br label %794

794:                                              ; preds = %793, %739
  call void @llvm.lifetime.end.p0(i64 24, ptr %84) #9
  br label %795

795:                                              ; preds = %794, %735
  call void @llvm.lifetime.end.p0(i64 72, ptr %83) #9
  br label %796

796:                                              ; preds = %795, %731
  call void @llvm.lifetime.end.p0(i64 24, ptr %82) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %81) #9
  br label %797

797:                                              ; preds = %796, %707, %571, %308
  call void @llvm.lifetime.end.p0(i64 24, ptr %48) #9
  br label %798

798:                                              ; preds = %797, %304
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #9
  br label %799

799:                                              ; preds = %798, %300
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #9
  br label %800

800:                                              ; preds = %799, %296
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #9
  br label %801

801:                                              ; preds = %800, %292
  call void @llvm.lifetime.end.p0(i64 16, ptr %44) #9
  br label %802

802:                                              ; preds = %801, %185
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #9
  br label %803

803:                                              ; preds = %802, %169
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #9
  br label %808

804:                                              ; preds = %168
  br label %805

805:                                              ; preds = %804
  %806 = load i32, ptr %39, align 4, !tbaa !11
  %807 = add nsw i32 %806, 1
  store i32 %807, ptr %39, align 4, !tbaa !11
  br label %142, !llvm.loop !20

808:                                              ; preds = %803, %157
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #9
  br label %814

809:                                              ; preds = %148
  %810 = load ptr, ptr %34, align 8, !tbaa !5
  %811 = icmp eq ptr %810, null
  br i1 %811, label %813, label %812

812:                                              ; preds = %809
  call void @_ZdaPv(ptr noundef %810) #11
  br label %813

813:                                              ; preds = %812, %809
  store i32 1, ptr %40, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #9
  call void @_ZN6R2GridD1Ev(ptr noundef nonnull align 8 dereferenceable(208) %37) #9
  call void @llvm.lifetime.end.p0(i64 208, ptr %37) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #9
  ret i32 1

814:                                              ; preds = %808, %153
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #9
  call void @_ZN6R2GridD1Ev(ptr noundef nonnull align 8 dereferenceable(208) %37) #9
  call void @llvm.lifetime.end.p0(i64 208, ptr %37) #9
  br label %815

815:                                              ; preds = %814, %149
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #9
  br label %816

816:                                              ; preds = %815
  %817 = load ptr, ptr %35, align 8
  %818 = load i32, ptr %36, align 4
  %819 = insertvalue { ptr, i32 } poison, ptr %817, 0
  %820 = insertvalue { ptr, i32 } %819, i32 %818, 1
  resume { ptr, i32 } %820

821:                                              ; preds = %783, %692, %530
  unreachable
}

; Function Attrs: nounwind
declare void @_ZN6R2GridD1Ev(ptr noundef nonnull align 8 dereferenceable(208)) unnamed_addr #3

declare noundef nonnull align 8 dereferenceable(208) ptr @_ZN6R2GridaSERKS_(ptr noundef nonnull align 8 dereferenceable(208), ptr noundef nonnull align 8 dereferenceable(208)) #1

declare void @_ZN6R2Grid5ClearEd(ptr noundef nonnull align 8 dereferenceable(208), double noundef) #1

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z18RNIsNegativeOrZerodd(double noundef, double noundef) #4

declare void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24), double noundef, double noundef, double noundef) unnamed_addr #1

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #1

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

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

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

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

declare void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPvm(ptr noundef, i64 noundef) #8

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

declare void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16), double noundef, double noundef) unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7RNArrayIPKdEC2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN7RNArrayIPKdE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK7RNArrayIPKdE4TailEv(ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8RNVArray10RemoveTailEv(ptr noundef nonnull align 8 dereferenceable(16)) #5 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z9RNIsEqualddd(double noundef, double noundef, double noundef) #5

declare noundef double @_Z17R2SquaredDistanceRK7R2PointS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #1

declare noundef double @_Z17R3SquaredDistanceRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #1

; Function Attrs: nounwind
declare void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3

declare void @_Z10R3CentroidiP7R3PointPKd(ptr dead_on_unwind writable sret(%class.R3Point) align 8, i32 noundef, ptr noundef, ptr noundef) #1

declare void @_Z15R3PrincipleAxesRK7R3PointiPS_PKdPd(ptr dead_on_unwind writable sret(%class.R3Triad) align 8, ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, ptr noundef, ptr noundef, ptr noundef) #1

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

declare void @_ZN8R3VectorC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1

declare void @_ZN7R3PlaneC1ERK7R3PointRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1

declare noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24)) #1

declare void @_ZN8R3Vector4FlipEv(ptr noundef nonnull align 8 dereferenceable(24)) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK8R3Vector1XEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK8R3Vector1YEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK8R3Vector1ZEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

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

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%class.R2Grid = type { %class.R2Affine, %class.R2Affine, double, ptr, [2 x i32], i32, i32 }
%class.R2Affine = type <{ %class.R2Transformation, %class.R3Matrix, i32, [4 x i8] }>
%class.R2Transformation = type { ptr }
%class.R3Matrix = type { [3 x [3 x double]] }
%class.R2Point = type { [2 x double] }
%class.R3Point = type { [3 x double] }
%class.RNArray.0 = type { %class.RNVArray }
%class.RNVArray = type { ptr, i32, i32 }
%class.R3Triad = type { [3 x %class.R3Vector] }
%class.R3Vector = type { [3 x double] }
%class.R3Plane = type { %class.R3Vector, double }

@RN_EPSILON = external local_unnamed_addr global double, align 8

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

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

declare void @_ZN6R2GridC1Eii(ptr noundef nonnull align 8 dereferenceable(208), i32 noundef, i32 noundef) unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z24RGBDCreateNormalChannelsRK6R2GridS1_S1_S1_S1_RS_S2_S2_S2_RK7R3PointRK8R3VectorS8_dii(ptr noundef nonnull align 8 dereferenceable(208) %0, ptr noundef nonnull align 8 dereferenceable(208) %1, ptr noundef nonnull align 8 dereferenceable(208) %2, ptr noundef nonnull align 8 dereferenceable(208) %3, ptr noundef nonnull align 8 dereferenceable(208) %4, ptr noundef nonnull align 8 dereferenceable(208) %5, ptr noundef nonnull align 8 dereferenceable(208) %6, ptr noundef nonnull align 8 dereferenceable(208) %7, ptr noundef nonnull align 8 dereferenceable(208) %8, ptr noundef nonnull align 8 dereferenceable(24) %9, ptr nocapture noundef nonnull readnone align 8 dereferenceable(24) %10, ptr nocapture noundef nonnull readnone align 8 dereferenceable(24) %11, double noundef %12, i32 noundef %13, i32 noundef %14) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %16 = alloca %class.R2Grid, align 8
  %17 = alloca %class.R2Point, align 8
  %18 = alloca %class.R3Point, align 8
  %19 = alloca i32, align 4
  %20 = alloca %class.RNArray.0, align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca %class.R3Point, align 8
  %24 = alloca %class.R2Point, align 8
  %25 = alloca %class.R3Point, align 8
  %26 = alloca i32, align 4
  %27 = alloca %class.R3Point, align 8
  %28 = alloca [3 x double], align 16
  %29 = alloca %class.R3Point, align 8
  %30 = alloca %class.R3Triad, align 8
  %31 = alloca %class.R3Vector, align 8
  %32 = alloca %class.R3Plane, align 8
  %33 = tail call noundef nonnull align 8 dereferenceable(208) ptr @_ZN6R2GridaSERKS_(ptr noundef nonnull align 8 dereferenceable(208) %5, ptr noundef nonnull align 8 dereferenceable(208) %0)
  tail call void @_ZN6R2Grid5ClearEd(ptr noundef nonnull align 8 dereferenceable(208) %5, double noundef -3.210000e+02)
  %34 = tail call noundef nonnull align 8 dereferenceable(208) ptr @_ZN6R2GridaSERKS_(ptr noundef nonnull align 8 dereferenceable(208) %6, ptr noundef nonnull align 8 dereferenceable(208) %5)
  %35 = tail call noundef nonnull align 8 dereferenceable(208) ptr @_ZN6R2GridaSERKS_(ptr noundef nonnull align 8 dereferenceable(208) %7, ptr noundef nonnull align 8 dereferenceable(208) %5)
  %36 = tail call noundef nonnull align 8 dereferenceable(208) ptr @_ZN6R2GridaSERKS_(ptr noundef nonnull align 8 dereferenceable(208) %8, ptr noundef nonnull align 8 dereferenceable(208) %5)
  %37 = tail call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %38 = mul nsw i32 %37, %13
  %39 = sitofp i32 %38 to double
  %40 = fdiv double %39, 6.400000e+02
  %41 = fadd double %40, 5.000000e-01
  %42 = fptosi double %41 to i32
  %spec.store.select = tail call i32 @llvm.umax.i32(i32 %42, i32 1)
  %43 = mul nsw i32 %spec.store.select, %spec.store.select
  %44 = fmul double %12, %12
  %45 = tail call noundef i32 @_ZNK6R2Grid8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %46 = sext i32 %45 to i64
  %47 = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %46, i64 24)
  %48 = extractvalue { i64, i1 } %47, 1
  %49 = extractvalue { i64, i1 } %47, 0
  %50 = select i1 %48, i64 -1, i64 %49
  %51 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %50) #11
  %52 = icmp eq i32 %45, 0
  br i1 %52, label %.loopexit276, label %53

53:                                               ; preds = %15
  %54 = getelementptr inbounds %class.R3Point, ptr %51, i64 %46
  br label %55

55:                                               ; preds = %57, %53
  %56 = phi ptr [ %51, %53 ], [ %58, %57 ]
  invoke void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %56)
          to label %57 unwind label %75

57:                                               ; preds = %55
  %58 = getelementptr inbounds i8, ptr %56, i64 24
  %59 = icmp eq ptr %58, %54
  br i1 %59, label %.loopexit276, label %55

.loopexit276:                                     ; preds = %57, %15
  call void @llvm.lifetime.start.p0(i64 208, ptr nonnull %16) #12
  %60 = tail call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %61 = tail call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  call void @_ZN6R2GridC1Eii(ptr noundef nonnull align 8 dereferenceable(208) %16, i32 noundef %60, i32 noundef %61)
  %62 = call noundef ptr @_ZNK6R2Grid10GridValuesEv(ptr noundef nonnull align 8 dereferenceable(208) %16)
  invoke void @_ZN6R2Grid5ClearEd(ptr noundef nonnull align 8 dereferenceable(208) %16, double noundef -1.000000e+00)
          to label %.preheader275 unwind label %77

.preheader275:                                    ; preds = %.loopexit276
  %63 = call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %64 = icmp sgt i32 %63, 0
  br i1 %64, label %.preheader274.lr.ph, label %._crit_edge359

.preheader274.lr.ph:                              ; preds = %.preheader275
  %.not224 = icmp eq i32 %14, 0
  %65 = ptrtoint ptr %62 to i64
  %66 = uitofp nneg i32 %43 to double
  %67 = fcmp ogt double %44, 0.000000e+00
  %68 = icmp sgt i32 %13, 1
  %69 = uitofp nneg i32 %13 to double
  br label %.preheader274

.preheader274:                                    ; preds = %.preheader274.lr.ph, %._crit_edge357
  %indvars.iv374.in = phi i32 [ %13, %.preheader274.lr.ph ], [ %indvars.iv374, %._crit_edge357 ]
  %.0205358 = phi i32 [ 0, %.preheader274.lr.ph ], [ %79, %._crit_edge357 ]
  %indvars.iv374 = add i32 %indvars.iv374.in, 1
  %70 = call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %71 = icmp sgt i32 %70, 0
  br i1 %71, label %.lr.ph356, label %._crit_edge357

.lr.ph356:                                        ; preds = %.preheader274
  %72 = uitofp nneg i32 %.0205358 to double
  %73 = sub nsw i32 %.0205358, %13
  %74 = add nsw i32 %.0205358, %13
  %.not225334 = icmp sgt i32 %73, %74
  br label %82

75:                                               ; preds = %55
  %76 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdaPvm(ptr noundef nonnull %51, i64 noundef %50) #13
  br label %380

77:                                               ; preds = %.loopexit276
  %78 = landingpad { ptr, i32 }
          cleanup
  br label %379

._crit_edge357:                                   ; preds = %367, %.preheader274
  %79 = add nuw nsw i32 %.0205358, 1
  %80 = call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %81 = icmp slt i32 %79, %80
  br i1 %81, label %.preheader274, label %._crit_edge359, !llvm.loop !5

82:                                               ; preds = %.lr.ph356, %367
  %.0208355 = phi i32 [ 0, %.lr.ph356 ], [ %368, %367 ]
  %83 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %.0205358, i32 noundef %.0208355)
          to label %84 unwind label %87

84:                                               ; preds = %82
  %85 = load double, ptr @RN_EPSILON, align 8, !tbaa !7
  %86 = call noundef i32 @_Z18RNIsNegativeOrZerodd(double noundef %83, double noundef %85)
  %.not = icmp eq i32 %86, 0
  br i1 %.not, label %89, label %367

87:                                               ; preds = %82
  %88 = landingpad { ptr, i32 }
          cleanup
  br label %379

89:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %17) #12
  %90 = uitofp nneg i32 %.0208355 to double
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %17, double noundef %72, double noundef %90)
          to label %91 unwind label %141

91:                                               ; preds = %89
  %92 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %1, i32 noundef %.0205358, i32 noundef %.0208355)
          to label %93 unwind label %143

93:                                               ; preds = %91
  %94 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %2, i32 noundef %.0205358, i32 noundef %.0208355)
          to label %95 unwind label %145

95:                                               ; preds = %93
  %96 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %3, i32 noundef %.0205358, i32 noundef %.0208355)
          to label %97 unwind label %147

97:                                               ; preds = %95
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %18) #12
  invoke void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %18, double noundef %92, double noundef %94, double noundef %96)
          to label %98 unwind label %149

98:                                               ; preds = %97
  br i1 %.not224, label %259, label %99

99:                                               ; preds = %98
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %19) #12
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %20) #12
  invoke void @_ZN7RNArrayIPKdEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %20)
          to label %100 unwind label %151

100:                                              ; preds = %99
  call void @_ZNK6R2Grid14IndicesToIndexEiiRi(ptr noundef nonnull align 8 dereferenceable(208) %16, i32 noundef %.0205358, i32 noundef %.0208355, ptr noundef nonnull align 4 dereferenceable(4) %19)
  %101 = load i32, ptr %19, align 4, !tbaa !11
  %102 = sitofp i32 %101 to double
  invoke void @_ZN6R2Grid12SetGridValueEid(ptr noundef nonnull align 8 dereferenceable(208) %16, i32 noundef %101, double noundef %102)
          to label %103 unwind label %153

103:                                              ; preds = %100
  %104 = sext i32 %101 to i64
  %105 = getelementptr inbounds double, ptr %62, i64 %104
  %106 = invoke noundef ptr @_ZN7RNArrayIPKdE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef %105)
          to label %.preheader unwind label %153

.preheader:                                       ; preds = %103
  %107 = call noundef i32 @_ZNK8RNVArray7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(16) %20)
  %.not234311 = icmp eq i32 %107, 0
  br i1 %.not234311, label %.lr.ph313, label %._crit_edge314

.lr.ph313:                                        ; preds = %.preheader, %._crit_edge
  %indvars.iv = phi i64 [ %indvars.iv.next, %._crit_edge ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %21) #12
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %22) #12
  %108 = invoke noundef ptr @_ZNK7RNArrayIPKdE4TailEv(ptr noundef nonnull align 8 dereferenceable(16) %20)
          to label %109 unwind label %155

109:                                              ; preds = %.lr.ph313
  invoke void @_ZN8RNVArray10RemoveTailEv(ptr noundef nonnull align 8 dereferenceable(16) %20)
          to label %110 unwind label %155

110:                                              ; preds = %109
  %111 = ptrtoint ptr %108 to i64
  %112 = sub i64 %111, %65
  %113 = lshr exact i64 %112, 3
  %114 = trunc i64 %113 to i32
  call void @_ZNK6R2Grid14IndexToIndicesEiRiS0_(ptr noundef nonnull align 8 dereferenceable(208) %16, i32 noundef %114, ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(4) %22)
  %115 = load i32, ptr %21, align 4, !tbaa !11
  %116 = load i32, ptr %22, align 4, !tbaa !11
  %117 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %1, i32 noundef %115, i32 noundef %116)
          to label %118 unwind label %157

118:                                              ; preds = %110
  %119 = load i32, ptr %21, align 4, !tbaa !11
  %120 = load i32, ptr %22, align 4, !tbaa !11
  %121 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %2, i32 noundef %119, i32 noundef %120)
          to label %122 unwind label %159

122:                                              ; preds = %118
  %123 = load i32, ptr %21, align 4, !tbaa !11
  %124 = load i32, ptr %22, align 4, !tbaa !11
  %125 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %3, i32 noundef %123, i32 noundef %124)
          to label %126 unwind label %161

126:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %23) #12
  invoke void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %23, double noundef %117, double noundef %121, double noundef %125)
          to label %127 unwind label %163

127:                                              ; preds = %126
  %128 = load i32, ptr %21, align 4, !tbaa !11
  %129 = load i32, ptr %22, align 4, !tbaa !11
  %130 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %4, i32 noundef %128, i32 noundef %129)
          to label %131 unwind label %165

131:                                              ; preds = %127
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %132 = getelementptr inbounds %class.R3Point, ptr %51, i64 %indvars.iv
  %133 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %132, ptr noundef nonnull align 8 dereferenceable(24) %23)
          to label %.lr.ph310 unwind label %167

.lr.ph310:                                        ; preds = %131
  %134 = fadd double %130, 5.000000e-01
  %135 = fptosi double %134 to i32
  %136 = load i32, ptr %21, align 4, !tbaa !11
  %137 = add nsw i32 %136, -1
  %138 = icmp eq i32 %135, 4
  %139 = icmp eq i32 %135, 2
  br label %169

._crit_edge:                                      ; preds = %.loopexit
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %23) #12
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %22) #12
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %21) #12
  %140 = call noundef i32 @_ZNK8RNVArray7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(16) %20)
  %.not234 = icmp eq i32 %140, 0
  br i1 %.not234, label %.lr.ph313, label %._crit_edge314.loopexit, !llvm.loop !13

141:                                              ; preds = %89
  %142 = landingpad { ptr, i32 }
          cleanup
  br label %378

143:                                              ; preds = %91
  %144 = landingpad { ptr, i32 }
          cleanup
  br label %378

145:                                              ; preds = %93
  %146 = landingpad { ptr, i32 }
          cleanup
  br label %378

147:                                              ; preds = %95
  %148 = landingpad { ptr, i32 }
          cleanup
  br label %378

149:                                              ; preds = %97
  %150 = landingpad { ptr, i32 }
          cleanup
  br label %377

151:                                              ; preds = %99
  %152 = landingpad { ptr, i32 }
          cleanup
  br label %258

153:                                              ; preds = %103, %100
  %154 = landingpad { ptr, i32 }
          cleanup
  br label %257

155:                                              ; preds = %109, %.lr.ph313
  %156 = landingpad { ptr, i32 }
          cleanup
  br label %255

157:                                              ; preds = %110
  %158 = landingpad { ptr, i32 }
          cleanup
  br label %255

159:                                              ; preds = %118
  %160 = landingpad { ptr, i32 }
          cleanup
  br label %255

161:                                              ; preds = %122
  %162 = landingpad { ptr, i32 }
          cleanup
  br label %255

163:                                              ; preds = %126
  %164 = landingpad { ptr, i32 }
          cleanup
  br label %254

165:                                              ; preds = %127
  %166 = landingpad { ptr, i32 }
          cleanup
  br label %254

167:                                              ; preds = %131
  %168 = landingpad { ptr, i32 }
          cleanup
  br label %254

169:                                              ; preds = %.lr.ph310, %.loopexit
  %.0217308 = phi i32 [ %137, %.lr.ph310 ], [ %252, %.loopexit ]
  %170 = icmp slt i32 %.0217308, 0
  br i1 %170, label %.loopexit, label %171

171:                                              ; preds = %169
  %172 = call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %16)
  %.not241 = icmp slt i32 %.0217308, %172
  br i1 %.not241, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %171
  %173 = load i32, ptr %22, align 4, !tbaa !11
  %174 = add nsw i32 %173, -1
  %175 = uitofp nneg i32 %.0217308 to double
  br label %176

176:                                              ; preds = %.lr.ph, %245
  %.0218304 = phi i32 [ %174, %.lr.ph ], [ %246, %245 ]
  %177 = icmp slt i32 %.0218304, 0
  br i1 %177, label %245, label %178

178:                                              ; preds = %176
  %179 = call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %16)
  %.not243 = icmp slt i32 %.0218304, %179
  br i1 %.not243, label %180, label %245

180:                                              ; preds = %178
  %181 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %16, i32 noundef %.0217308, i32 noundef %.0218304)
          to label %182 unwind label %188

182:                                              ; preds = %180
  %183 = load i32, ptr %19, align 4, !tbaa !11
  %184 = sitofp i32 %183 to double
  %185 = load double, ptr @RN_EPSILON, align 8, !tbaa !7
  %186 = invoke noundef i32 @_Z9RNIsEqualddd(double noundef %181, double noundef %184, double noundef %185)
          to label %187 unwind label %188

187:                                              ; preds = %182
  %.not244 = icmp eq i32 %186, 0
  br i1 %.not244, label %190, label %245

188:                                              ; preds = %190, %182, %180
  %189 = landingpad { ptr, i32 }
          cleanup
  br label %254

190:                                              ; preds = %187
  %191 = load i32, ptr %19, align 4, !tbaa !11
  %192 = sitofp i32 %191 to double
  invoke void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %16, i32 noundef %.0217308, i32 noundef %.0218304, double noundef %192)
          to label %193 unwind label %188

193:                                              ; preds = %190
  %194 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %.0217308, i32 noundef %.0218304)
          to label %195 unwind label %198

195:                                              ; preds = %193
  %196 = load double, ptr @RN_EPSILON, align 8, !tbaa !7
  %197 = call noundef i32 @_Z18RNIsNegativeOrZerodd(double noundef %194, double noundef %196)
  %.not245 = icmp eq i32 %197, 0
  br i1 %.not245, label %200, label %245

198:                                              ; preds = %193
  %199 = landingpad { ptr, i32 }
          cleanup
  br label %254

200:                                              ; preds = %195
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %24) #12
  %201 = uitofp nneg i32 %.0218304 to double
  invoke void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %24, double noundef %175, double noundef %201)
          to label %202 unwind label %206

202:                                              ; preds = %200
  %203 = invoke noundef double @_Z17R2SquaredDistanceRK7R2PointS1_(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(16) %24)
          to label %204 unwind label %206

204:                                              ; preds = %202
  %205 = fcmp ogt double %203, %66
  br i1 %205, label %244, label %208

206:                                              ; preds = %202, %200
  %207 = landingpad { ptr, i32 }
          cleanup
  br label %251

208:                                              ; preds = %204
  %209 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %1, i32 noundef %.0217308, i32 noundef %.0218304)
          to label %210 unwind label %220

210:                                              ; preds = %208
  %211 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %2, i32 noundef %.0217308, i32 noundef %.0218304)
          to label %212 unwind label %222

212:                                              ; preds = %210
  %213 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %3, i32 noundef %.0217308, i32 noundef %.0218304)
          to label %214 unwind label %224

214:                                              ; preds = %212
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %25) #12
  invoke void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %25, double noundef %209, double noundef %211, double noundef %213)
          to label %215 unwind label %226

215:                                              ; preds = %214
  br i1 %67, label %216, label %228

216:                                              ; preds = %215
  %217 = invoke noundef double @_Z17R3SquaredDistanceRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 8 dereferenceable(24) %25)
          to label %218 unwind label %226

218:                                              ; preds = %216
  %219 = fcmp ogt double %217, %44
  br i1 %219, label %243, label %228

220:                                              ; preds = %208
  %221 = landingpad { ptr, i32 }
          cleanup
  br label %251

222:                                              ; preds = %210
  %223 = landingpad { ptr, i32 }
          cleanup
  br label %251

224:                                              ; preds = %212
  %225 = landingpad { ptr, i32 }
          cleanup
  br label %251

226:                                              ; preds = %216, %214
  %227 = landingpad { ptr, i32 }
          cleanup
  br label %250

228:                                              ; preds = %218, %215
  %229 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %4, i32 noundef %.0217308, i32 noundef %.0218304)
          to label %230 unwind label %235

230:                                              ; preds = %228
  %231 = fadd double %229, 5.000000e-01
  %232 = fptosi double %231 to i32
  %233 = icmp eq i32 %232, 2
  %or.cond = select i1 %138, i1 %233, i1 false
  %234 = icmp eq i32 %232, 4
  %or.cond3 = select i1 %139, i1 %234, i1 false
  %or.cond360 = select i1 %or.cond, i1 true, i1 %or.cond3
  br i1 %or.cond360, label %243, label %237

235:                                              ; preds = %228
  %236 = landingpad { ptr, i32 }
          cleanup
  br label %250

237:                                              ; preds = %230
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %26) #12
  call void @_ZNK6R2Grid14IndicesToIndexEiiRi(ptr noundef nonnull align 8 dereferenceable(208) %16, i32 noundef %.0217308, i32 noundef %.0218304, ptr noundef nonnull align 4 dereferenceable(4) %26)
  %238 = load i32, ptr %26, align 4, !tbaa !11
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds double, ptr %62, i64 %239
  %241 = invoke noundef ptr @_ZN7RNArrayIPKdE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef %240)
          to label %242 unwind label %248

242:                                              ; preds = %237
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %26) #12
  br label %243

243:                                              ; preds = %242, %230, %218
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %25) #12
  br label %244

244:                                              ; preds = %204, %243
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %24) #12
  br label %245

245:                                              ; preds = %187, %195, %244, %176, %178
  %246 = add nsw i32 %.0218304, 1
  %247 = load i32, ptr %22, align 4, !tbaa !11
  %.not242 = icmp sgt i32 %.0218304, %247
  br i1 %.not242, label %.loopexit, label %176, !llvm.loop !14

248:                                              ; preds = %237
  %249 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %26) #12
  br label %250

250:                                              ; preds = %235, %248, %226
  %.pn246.pn = phi { ptr, i32 } [ %227, %226 ], [ %249, %248 ], [ %236, %235 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %25) #12
  br label %251

251:                                              ; preds = %220, %224, %250, %222, %206
  %.pn246.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %207, %206 ], [ %221, %220 ], [ %223, %222 ], [ %.pn246.pn, %250 ], [ %225, %224 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %24) #12
  br label %254

.loopexit:                                        ; preds = %245, %169, %171
  %252 = add nsw i32 %.0217308, 1
  %253 = load i32, ptr %21, align 4, !tbaa !11
  %.not240 = icmp sgt i32 %.0217308, %253
  br i1 %.not240, label %._crit_edge, label %169, !llvm.loop !15

254:                                              ; preds = %165, %188, %251, %198, %167, %163
  %.pn246.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %164, %163 ], [ %166, %165 ], [ %168, %167 ], [ %189, %188 ], [ %.pn246.pn.pn.pn.pn.pn, %251 ], [ %199, %198 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %23) #12
  br label %255

255:                                              ; preds = %157, %161, %254, %159, %155
  %.pn246.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %156, %155 ], [ %158, %157 ], [ %160, %159 ], [ %.pn246.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn, %254 ], [ %162, %161 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %22) #12
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %21) #12
  br label %257

._crit_edge314.loopexit:                          ; preds = %._crit_edge
  %256 = trunc nuw i64 %indvars.iv.next to i32
  br label %._crit_edge314

._crit_edge314:                                   ; preds = %._crit_edge314.loopexit, %.preheader
  %.0209.lcssa = phi i32 [ 0, %.preheader ], [ %256, %._crit_edge314.loopexit ]
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #12
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %20) #12
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %19) #12
  br label %.loopexit273

257:                                              ; preds = %255, %153
  %.pn246.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn246.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn, %255 ], [ %154, %153 ]
  call void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %20) #12
  br label %258

258:                                              ; preds = %257, %151
  %.pn246.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn246.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn, %257 ], [ %152, %151 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %20) #12
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %19) #12
  br label %377

259:                                              ; preds = %98
  br i1 %.not225334, label %.loopexit273.thread, label %.lr.ph340

.lr.ph340:                                        ; preds = %259
  %260 = sub nsw i32 %.0208355, %13
  %261 = add nsw i32 %.0208355, %13
  %.not227315 = icmp sgt i32 %260, %261
  %.not227315.fr = freeze i1 %.not227315
  br i1 %.not227315.fr, label %.lr.ph340.split.us, label %.lr.ph340.split

.lr.ph340.split.us:                               ; preds = %.lr.ph340, %.loopexit272.us
  %.0207336.us = phi i32 [ %265, %.loopexit272.us ], [ %73, %.lr.ph340 ]
  %262 = icmp slt i32 %.0207336.us, 0
  br i1 %262, label %.loopexit272.us, label %263

263:                                              ; preds = %.lr.ph340.split.us
  %264 = call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  br label %.loopexit272.us

.loopexit272.us:                                  ; preds = %263, %.lr.ph340.split.us
  %265 = add i32 %.0207336.us, 1
  %exitcond377.not = icmp eq i32 %.0207336.us, %indvars.iv374.in
  br i1 %exitcond377.not, label %.loopexit273.thread, label %.lr.ph340.split.us, !llvm.loop !16

.lr.ph340.split:                                  ; preds = %.lr.ph340
  br i1 %67, label %.lr.ph340.split.split.us, label %.lr.ph340.split.split

.lr.ph340.split.split.us:                         ; preds = %.lr.ph340.split, %..loopexit272_crit_edge.split.us.us
  %.0207336.us343 = phi i32 [ %269, %..loopexit272_crit_edge.split.us.us ], [ %73, %.lr.ph340.split ]
  %.1210335.us344 = phi i32 [ %.6215.us346, %..loopexit272_crit_edge.split.us.us ], [ 0, %.lr.ph340.split ]
  %266 = icmp slt i32 %.0207336.us343, 0
  br i1 %266, label %..loopexit272_crit_edge.split.us.us, label %267

267:                                              ; preds = %.lr.ph340.split.split.us
  %268 = call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %.not226.us345 = icmp slt i32 %.0207336.us343, %268
  br i1 %.not226.us345, label %.lr.ph319.us, label %..loopexit272_crit_edge.split.us.us

..loopexit272_crit_edge.split.us.us:              ; preds = %296, %267, %.lr.ph340.split.split.us
  %.6215.us346 = phi i32 [ %.1210335.us344, %.lr.ph340.split.split.us ], [ %.1210335.us344, %267 ], [ %.5214.us.us, %296 ]
  %269 = add i32 %.0207336.us343, 1
  %exitcond376.not = icmp eq i32 %.0207336.us343, %indvars.iv374.in
  br i1 %exitcond376.not, label %.loopexit273, label %.lr.ph340.split.split.us, !llvm.loop !16

.lr.ph319.us:                                     ; preds = %267, %296
  %.0206317.us.us = phi i32 [ %297, %296 ], [ %260, %267 ]
  %.2211316.us.us = phi i32 [ %.5214.us.us, %296 ], [ %.1210335.us344, %267 ]
  %270 = icmp slt i32 %.0206317.us.us, 0
  br i1 %270, label %296, label %271

271:                                              ; preds = %.lr.ph319.us
  %272 = call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %.not228.us.us = icmp slt i32 %.0206317.us.us, %272
  br i1 %.not228.us.us, label %273, label %296

273:                                              ; preds = %271
  %274 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %.0207336.us343, i32 noundef %.0206317.us.us)
          to label %275 unwind label %.split.us.split.us

275:                                              ; preds = %273
  %276 = load double, ptr @RN_EPSILON, align 8, !tbaa !7
  %277 = call noundef i32 @_Z18RNIsNegativeOrZerodd(double noundef %274, double noundef %276)
  %.not229.us.us = icmp eq i32 %277, 0
  br i1 %.not229.us.us, label %278, label %296

278:                                              ; preds = %275
  %279 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %1, i32 noundef %.0207336.us343, i32 noundef %.0206317.us.us)
          to label %280 unwind label %.split322.us.split.us

280:                                              ; preds = %278
  %281 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %2, i32 noundef %.0207336.us343, i32 noundef %.0206317.us.us)
          to label %282 unwind label %.split325.us.split.us

282:                                              ; preds = %280
  %283 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %3, i32 noundef %.0207336.us343, i32 noundef %.0206317.us.us)
          to label %284 unwind label %.split328.us.split.us

284:                                              ; preds = %282
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %27) #12
  invoke void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %27, double noundef %279, double noundef %281, double noundef %283)
          to label %285 unwind label %.split331.us.split.us

285:                                              ; preds = %284
  %286 = invoke noundef double @_Z17R3SquaredDistanceRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 8 dereferenceable(24) %27)
          to label %287 unwind label %.split331.us.split.us

287:                                              ; preds = %285
  %288 = fcmp ogt double %286, %44
  br i1 %288, label %295, label %289

289:                                              ; preds = %287
  %290 = sext i32 %.2211316.us.us to i64
  %291 = getelementptr inbounds %class.R3Point, ptr %51, i64 %290
  %292 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %291, ptr noundef nonnull align 8 dereferenceable(24) %27)
          to label %293 unwind label %.split331.us.split.us

293:                                              ; preds = %289
  %294 = add nsw i32 %.2211316.us.us, 1
  br label %295

295:                                              ; preds = %293, %287
  %.3212.us.us = phi i32 [ %294, %293 ], [ %.2211316.us.us, %287 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %27) #12
  br label %296

296:                                              ; preds = %295, %275, %271, %.lr.ph319.us
  %.5214.us.us = phi i32 [ %.2211316.us.us, %.lr.ph319.us ], [ %.2211316.us.us, %271 ], [ %.3212.us.us, %295 ], [ %.2211316.us.us, %275 ]
  %297 = add nsw i32 %.0206317.us.us, 1
  %.not227.us.us.not = icmp slt i32 %.0206317.us.us, %261
  br i1 %.not227.us.us.not, label %.lr.ph319.us, label %..loopexit272_crit_edge.split.us.us, !llvm.loop !17

.split.us.split.us:                               ; preds = %273
  %298 = landingpad { ptr, i32 }
          cleanup
  br label %377

.split322.us.split.us:                            ; preds = %278
  %299 = landingpad { ptr, i32 }
          cleanup
  br label %377

.split325.us.split.us:                            ; preds = %280
  %300 = landingpad { ptr, i32 }
          cleanup
  br label %377

.split328.us.split.us:                            ; preds = %282
  %301 = landingpad { ptr, i32 }
          cleanup
  br label %377

.split331.us.split.us:                            ; preds = %289, %285, %284
  %302 = landingpad { ptr, i32 }
          cleanup
  br label %330

.lr.ph340.split.split:                            ; preds = %.lr.ph340.split, %..loopexit272_crit_edge.split
  %.0207336 = phi i32 [ %335, %..loopexit272_crit_edge.split ], [ %73, %.lr.ph340.split ]
  %.1210335 = phi i32 [ %.6215, %..loopexit272_crit_edge.split ], [ 0, %.lr.ph340.split ]
  %303 = icmp slt i32 %.0207336, 0
  br i1 %303, label %..loopexit272_crit_edge.split, label %304

304:                                              ; preds = %.lr.ph340.split.split
  %305 = call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %.not226 = icmp slt i32 %.0207336, %305
  br i1 %.not226, label %.lr.ph319, label %..loopexit272_crit_edge.split

.lr.ph319:                                        ; preds = %304, %333
  %.0206317 = phi i32 [ %334, %333 ], [ %260, %304 ]
  %.2211316 = phi i32 [ %.5214, %333 ], [ %.1210335, %304 ]
  %306 = icmp slt i32 %.0206317, 0
  br i1 %306, label %333, label %307

307:                                              ; preds = %.lr.ph319
  %308 = call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %.not228 = icmp slt i32 %.0206317, %308
  br i1 %.not228, label %309, label %333

309:                                              ; preds = %307
  %310 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %.0207336, i32 noundef %.0206317)
          to label %311 unwind label %.split

311:                                              ; preds = %309
  %312 = load double, ptr @RN_EPSILON, align 8, !tbaa !7
  %313 = call noundef i32 @_Z18RNIsNegativeOrZerodd(double noundef %310, double noundef %312)
  %.not229 = icmp eq i32 %313, 0
  br i1 %.not229, label %315, label %333

.split:                                           ; preds = %309
  %314 = landingpad { ptr, i32 }
          cleanup
  br label %377

315:                                              ; preds = %311
  %316 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %1, i32 noundef %.0207336, i32 noundef %.0206317)
          to label %317 unwind label %.split322

317:                                              ; preds = %315
  %318 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %2, i32 noundef %.0207336, i32 noundef %.0206317)
          to label %319 unwind label %.split325

319:                                              ; preds = %317
  %320 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %3, i32 noundef %.0207336, i32 noundef %.0206317)
          to label %321 unwind label %.split328

321:                                              ; preds = %319
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %27) #12
  invoke void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %27, double noundef %316, double noundef %318, double noundef %320)
          to label %322 unwind label %.split331

322:                                              ; preds = %321
  %323 = sext i32 %.2211316 to i64
  %324 = getelementptr inbounds %class.R3Point, ptr %51, i64 %323
  %325 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %324, ptr noundef nonnull align 8 dereferenceable(24) %27)
          to label %331 unwind label %.split331

.split322:                                        ; preds = %315
  %326 = landingpad { ptr, i32 }
          cleanup
  br label %377

.split325:                                        ; preds = %317
  %327 = landingpad { ptr, i32 }
          cleanup
  br label %377

.split328:                                        ; preds = %319
  %328 = landingpad { ptr, i32 }
          cleanup
  br label %377

.split331:                                        ; preds = %322, %321
  %329 = landingpad { ptr, i32 }
          cleanup
  br label %330

330:                                              ; preds = %.split331.us.split.us, %.split331
  %.us-phi332 = phi { ptr, i32 } [ %329, %.split331 ], [ %302, %.split331.us.split.us ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %27) #12
  br label %377

331:                                              ; preds = %322
  %332 = add nsw i32 %.2211316, 1
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %27) #12
  br label %333

333:                                              ; preds = %331, %311, %.lr.ph319, %307
  %.5214 = phi i32 [ %.2211316, %.lr.ph319 ], [ %.2211316, %307 ], [ %332, %331 ], [ %.2211316, %311 ]
  %334 = add nsw i32 %.0206317, 1
  %.not227.not = icmp slt i32 %.0206317, %261
  br i1 %.not227.not, label %.lr.ph319, label %..loopexit272_crit_edge.split, !llvm.loop !17

..loopexit272_crit_edge.split:                    ; preds = %333, %.lr.ph340.split.split, %304
  %.6215 = phi i32 [ %.1210335, %.lr.ph340.split.split ], [ %.1210335, %304 ], [ %.5214, %333 ]
  %335 = add i32 %.0207336, 1
  %exitcond.not = icmp eq i32 %.0207336, %indvars.iv374.in
  br i1 %exitcond.not, label %.loopexit273, label %.lr.ph340.split.split, !llvm.loop !16

.loopexit273:                                     ; preds = %..loopexit272_crit_edge.split, %..loopexit272_crit_edge.split.us.us, %._crit_edge314
  %.7216 = phi i32 [ %.0209.lcssa, %._crit_edge314 ], [ %.6215.us346, %..loopexit272_crit_edge.split.us.us ], [ %.6215, %..loopexit272_crit_edge.split ]
  %336 = icmp slt i32 %.7216, 3
  br i1 %336, label %.loopexit273.thread, label %337

337:                                              ; preds = %.loopexit273
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %28) #12
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %29) #12
  invoke void @_Z10R3CentroidiP7R3PointPKd(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %29, i32 noundef %.7216, ptr noundef nonnull %51, ptr noundef null)
          to label %338 unwind label %348

338:                                              ; preds = %337
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %30) #12
  invoke void @_Z15R3PrincipleAxesRK7R3PointiPS_PKdPd(ptr dead_on_unwind nonnull writable sret(%class.R3Triad) align 8 %30, ptr noundef nonnull align 8 dereferenceable(24) %29, i32 noundef %.7216, ptr noundef nonnull %51, ptr noundef null, ptr noundef nonnull %28)
          to label %339 unwind label %350

339:                                              ; preds = %338
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %31) #12
  %340 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3TriadixEi(ptr noundef nonnull align 8 dereferenceable(72) %30, i32 noundef 2)
          to label %341 unwind label %352

341:                                              ; preds = %339
  invoke void @_ZN8R3VectorC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %31, ptr noundef nonnull align 8 dereferenceable(24) %340)
          to label %342 unwind label %352

342:                                              ; preds = %341
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %32) #12
  invoke void @_ZN7R3PlaneC1ERK7R3PointRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(32) %32, ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 8 dereferenceable(24) %31)
          to label %343 unwind label %354

343:                                              ; preds = %342
  %344 = invoke noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %32, ptr noundef nonnull align 8 dereferenceable(24) %9)
          to label %345 unwind label %354

345:                                              ; preds = %343
  %346 = fcmp olt double %344, 0.000000e+00
  br i1 %346, label %347, label %356

347:                                              ; preds = %345
  invoke void @_ZN8R3Vector4FlipEv(ptr noundef nonnull align 8 dereferenceable(24) %31)
          to label %356 unwind label %354

348:                                              ; preds = %337
  %349 = landingpad { ptr, i32 }
          cleanup
  br label %376

350:                                              ; preds = %338
  %351 = landingpad { ptr, i32 }
          cleanup
  br label %375

352:                                              ; preds = %341, %339
  %353 = landingpad { ptr, i32 }
          cleanup
  br label %374

354:                                              ; preds = %360, %358, %356, %347, %343, %342
  %355 = landingpad { ptr, i32 }
          cleanup
  br label %373

356:                                              ; preds = %347, %345
  %357 = call noundef double @_ZNK8R3Vector1XEv(ptr noundef nonnull align 8 dereferenceable(24) %31)
  invoke void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %5, i32 noundef %.0205358, i32 noundef %.0208355, double noundef %357)
          to label %358 unwind label %354

358:                                              ; preds = %356
  %359 = call noundef double @_ZNK8R3Vector1YEv(ptr noundef nonnull align 8 dereferenceable(24) %31)
  invoke void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %6, i32 noundef %.0205358, i32 noundef %.0208355, double noundef %359)
          to label %360 unwind label %354

360:                                              ; preds = %358
  %361 = call noundef double @_ZNK8R3Vector1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %31)
  invoke void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %7, i32 noundef %.0205358, i32 noundef %.0208355, double noundef %361)
          to label %362 unwind label %354

362:                                              ; preds = %360
  %363 = load double, ptr %28, align 16, !tbaa !7
  %364 = call double @sqrt(double noundef %363) #12
  %365 = fdiv double %364, %69
  %.0 = select i1 %68, double %365, double %364
  invoke void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %8, i32 noundef %.0205358, i32 noundef %.0208355, double noundef %.0)
          to label %366 unwind label %371

366:                                              ; preds = %362
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %32) #12
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %31) #12
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %30) #12
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %29) #12
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %28) #12
  br label %.loopexit273.thread

.loopexit273.thread:                              ; preds = %.loopexit272.us, %259, %.loopexit273, %366
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %18) #12
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %17) #12
  br label %367

367:                                              ; preds = %84, %.loopexit273.thread
  %368 = add nuw nsw i32 %.0208355, 1
  %369 = call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %370 = icmp slt i32 %368, %369
  br i1 %370, label %82, label %._crit_edge357, !llvm.loop !18

371:                                              ; preds = %362
  %372 = landingpad { ptr, i32 }
          cleanup
  br label %373

373:                                              ; preds = %371, %354
  %.pn235 = phi { ptr, i32 } [ %372, %371 ], [ %355, %354 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %32) #12
  br label %374

374:                                              ; preds = %373, %352
  %.pn235.pn = phi { ptr, i32 } [ %.pn235, %373 ], [ %353, %352 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %31) #12
  br label %375

375:                                              ; preds = %374, %350
  %.pn235.pn.pn = phi { ptr, i32 } [ %.pn235.pn, %374 ], [ %351, %350 ]
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %30) #12
  br label %376

376:                                              ; preds = %375, %348
  %.pn235.pn.pn.pn = phi { ptr, i32 } [ %.pn235.pn.pn, %375 ], [ %349, %348 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %29) #12
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %28) #12
  br label %377

377:                                              ; preds = %.split328, %.split328.us.split.us, %.split325, %.split325.us.split.us, %.split322, %.split322.us.split.us, %.split, %.split.us.split.us, %330, %376, %258, %149
  %.pn246.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn246.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn, %258 ], [ %.pn235.pn.pn.pn, %376 ], [ %150, %149 ], [ %.us-phi332, %330 ], [ %314, %.split ], [ %298, %.split.us.split.us ], [ %326, %.split322 ], [ %299, %.split322.us.split.us ], [ %327, %.split325 ], [ %300, %.split325.us.split.us ], [ %328, %.split328 ], [ %301, %.split328.us.split.us ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %18) #12
  br label %378

378:                                              ; preds = %143, %147, %377, %145, %141
  %.pn246.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %142, %141 ], [ %144, %143 ], [ %146, %145 ], [ %.pn246.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn, %377 ], [ %148, %147 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %17) #12
  br label %379

._crit_edge359:                                   ; preds = %._crit_edge357, %.preheader275
  call void @_ZdaPv(ptr noundef nonnull %51) #13
  call void @_ZN6R2GridD1Ev(ptr noundef nonnull align 8 dereferenceable(208) %16) #12
  call void @llvm.lifetime.end.p0(i64 208, ptr nonnull %16) #12
  ret i32 1

379:                                              ; preds = %87, %378, %77
  %.pn246.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %78, %77 ], [ %.pn246.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn, %378 ], [ %88, %87 ]
  call void @_ZN6R2GridD1Ev(ptr noundef nonnull align 8 dereferenceable(208) %16) #12
  call void @llvm.lifetime.end.p0(i64 208, ptr nonnull %16) #12
  br label %380

380:                                              ; preds = %379, %75
  %.pn246.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn246.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn, %379 ], [ %76, %75 ]
  resume { ptr, i32 } %.pn246.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn
}

; Function Attrs: nounwind
declare void @_ZN6R2GridD1Ev(ptr noundef nonnull align 8 dereferenceable(208)) unnamed_addr #3

declare noundef nonnull align 8 dereferenceable(208) ptr @_ZN6R2GridaSERKS_(ptr noundef nonnull align 8 dereferenceable(208), ptr noundef nonnull align 8 dereferenceable(208)) local_unnamed_addr #1

declare void @_ZN6R2Grid5ClearEd(ptr noundef nonnull align 8 dereferenceable(208), double noundef) local_unnamed_addr #1

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z18RNIsNegativeOrZerodd(double noundef, double noundef) local_unnamed_addr #4

declare void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24), double noundef, double noundef, double noundef) unnamed_addr #1

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

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

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

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

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

declare void @_ZN7R3PointC1Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPvm(ptr noundef, i64 noundef) local_unnamed_addr #8

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

declare void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16), double noundef, double noundef) unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7RNArrayIPKdEC2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN7RNArrayIPKdE6InsertES1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK7RNArrayIPKdE4TailEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8RNVArray10RemoveTailEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #5 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z9RNIsEqualddd(double noundef, double noundef, double noundef) local_unnamed_addr #5

declare noundef double @_Z17R2SquaredDistanceRK7R2PointS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1

declare noundef double @_Z17R3SquaredDistanceRK7R3PointS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

; Function Attrs: nounwind
declare void @_ZN8RNVArrayD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3

declare void @_Z10R3CentroidiP7R3PointPKd(ptr dead_on_unwind writable sret(%class.R3Point) align 8, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @_Z15R3PrincipleAxesRK7R3PointiPS_PKdPd(ptr dead_on_unwind writable sret(%class.R3Triad) align 8, ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3TriadixEi(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) local_unnamed_addr #5 align 2

declare void @_ZN8R3VectorC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1

declare void @_ZN7R3PlaneC1ERK7R3PointRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1

declare noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

declare void @_ZN8R3Vector4FlipEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK8R3Vector1XEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK8R3Vector1YEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK8R3Vector1ZEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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 #8 = { 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 #9 = { 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 #10 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #11 = { builtin allocsize(0) }
attributes #12 = { nounwind }
attributes #13 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"double", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !9, i64 0}
!13 = distinct !{!13, !6}
!14 = distinct !{!14, !6}
!15 = distinct !{!15, !6}
!16 = distinct !{!16, !6}
!17 = distinct !{!17, !6}
!18 = distinct !{!18, !6}


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