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

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

@.str = external hidden unnamed_addr constant [41 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [11 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6R2Grid28SetWorldToGridTransformationERK8R2Affine(ptr noundef nonnull align 8 dereferenceable(208), ptr noundef nonnull align 8 dereferenceable(84)) #4 align 2

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

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

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

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

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

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

27:                                               ; preds = %2
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %28, ptr %11, align 8, !tbaa !5
  br label %40

29:                                               ; preds = %2
  %30 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 208) #9
  %31 = invoke noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %24)
          to label %32 unwind label %36

32:                                               ; preds = %29
  %33 = invoke noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %24)
          to label %34 unwind label %36

34:                                               ; preds = %32
  invoke void @_ZN6R2GridC1Eii(ptr noundef nonnull align 8 dereferenceable(208) %30, i32 noundef %31, i32 noundef %33)
          to label %35 unwind label %36

35:                                               ; preds = %34
  store ptr %30, ptr %11, align 8, !tbaa !5
  br label %40

36:                                               ; preds = %34, %32, %29
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %21, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %22, align 4
  call void @_ZdlPvm(ptr noundef %30, i64 noundef 208) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  br label %443

40:                                               ; preds = %35, %27
  %41 = load ptr, ptr %11, align 8, !tbaa !5
  %42 = icmp ne ptr %41, null
  br i1 %42, label %44, label %43

43:                                               ; preds = %40
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.20, i32 noundef 1881, ptr noundef @.str.2)
  br label %44

44:                                               ; preds = %43, %40
  %45 = load ptr, ptr %11, align 8, !tbaa !5
  %46 = call noundef nonnull align 8 dereferenceable(84) ptr @_ZNK6R2Grid25WorldToGridTransformationEv(ptr noundef nonnull align 8 dereferenceable(208) %24)
  call void @_ZN6R2Grid28SetWorldToGridTransformationERK8R2Affine(ptr noundef nonnull align 8 dereferenceable(208) %45, ptr noundef nonnull align 8 dereferenceable(84) %46)
  %47 = call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %24)
  store i32 %47, ptr %12, align 4, !tbaa !9
  %48 = load i32, ptr %12, align 4, !tbaa !9
  %49 = call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %24)
  %50 = icmp slt i32 %48, %49
  br i1 %50, label %51, label %53

51:                                               ; preds = %44
  %52 = call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %24)
  store i32 %52, ptr %12, align 4, !tbaa !9
  br label %53

53:                                               ; preds = %51, %44
  %54 = load i32, ptr %12, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %55, i64 4)
  %57 = extractvalue { i64, i1 } %56, 1
  %58 = extractvalue { i64, i1 } %56, 0
  %59 = select i1 %57, i64 -1, i64 %58
  %60 = call noalias noundef nonnull ptr @_Znam(i64 noundef %59) #9
  store ptr %60, ptr %6, align 8, !tbaa !5
  %61 = load i32, ptr %12, align 4, !tbaa !9
  %62 = sext i32 %61 to i64
  %63 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %62, i64 4)
  %64 = extractvalue { i64, i1 } %63, 1
  %65 = extractvalue { i64, i1 } %63, 0
  %66 = select i1 %64, i64 -1, i64 %65
  %67 = call noalias noundef nonnull ptr @_Znam(i64 noundef %66) #9
  store ptr %67, ptr %7, align 8, !tbaa !5
  %68 = load i32, ptr %12, align 4, !tbaa !9
  %69 = sext i32 %68 to i64
  %70 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %69, i64 8)
  %71 = extractvalue { i64, i1 } %70, 1
  %72 = extractvalue { i64, i1 } %70, 0
  %73 = select i1 %71, i64 -1, i64 %72
  %74 = call noalias noundef nonnull ptr @_Znam(i64 noundef %73) #9
  store ptr %74, ptr %9, align 8, !tbaa !5
  %75 = load i32, ptr %12, align 4, !tbaa !9
  %76 = sext i32 %75 to i64
  %77 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %76, i64 8)
  %78 = extractvalue { i64, i1 } %77, 1
  %79 = extractvalue { i64, i1 } %77, 0
  %80 = select i1 %78, i64 -1, i64 %79
  %81 = call noalias noundef nonnull ptr @_Znam(i64 noundef %80) #9
  store ptr %81, ptr %10, align 8, !tbaa !5
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = icmp ne ptr %82, null
  br i1 %83, label %84, label %93

84:                                               ; preds = %53
  %85 = load ptr, ptr %7, align 8, !tbaa !5
  %86 = icmp ne ptr %85, null
  br i1 %86, label %87, label %93

87:                                               ; preds = %84
  %88 = load ptr, ptr %9, align 8, !tbaa !5
  %89 = icmp ne ptr %88, null
  br i1 %89, label %90, label %93

90:                                               ; preds = %87
  %91 = load ptr, ptr %10, align 8, !tbaa !5
  %92 = icmp ne ptr %91, null
  br i1 %92, label %94, label %93

93:                                               ; preds = %90, %87, %84, %53
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.21, i32 noundef 1891, ptr noundef @.str.2)
  br label %94

94:                                               ; preds = %93, %90
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  %95 = load i32, ptr %12, align 4, !tbaa !9
  %96 = add nsw i32 %95, 1
  %97 = mul nsw i32 3, %96
  %98 = load i32, ptr %12, align 4, !tbaa !9
  %99 = add nsw i32 %98, 1
  %100 = mul nsw i32 %97, %99
  %101 = sitofp i32 %100 to double
  store double %101, ptr %23, align 8, !tbaa !11
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %102

102:                                              ; preds = %131, %94
  %103 = load i32, ptr %20, align 4, !tbaa !9
  %104 = getelementptr inbounds %class.R2Grid, ptr %24, i32 0, i32 6
  %105 = load i32, ptr %104, align 4, !tbaa !13
  %106 = icmp slt i32 %103, %105
  br i1 %106, label %107, label %134

107:                                              ; preds = %102
  %108 = getelementptr inbounds %class.R2Grid, ptr %24, i32 0, i32 3
  %109 = load ptr, ptr %108, align 8, !tbaa !18
  %110 = load i32, ptr %20, align 4, !tbaa !9
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds double, ptr %109, i64 %111
  %113 = load double, ptr %112, align 8, !tbaa !11
  %114 = fcmp oeq double %113, 0.000000e+00
  br i1 %114, label %115, label %123

115:                                              ; preds = %107
  %116 = load double, ptr %23, align 8, !tbaa !11
  %117 = load ptr, ptr %11, align 8, !tbaa !5
  %118 = getelementptr inbounds %class.R2Grid, ptr %117, i32 0, i32 3
  %119 = load ptr, ptr %118, align 8, !tbaa !18
  %120 = load i32, ptr %20, align 4, !tbaa !9
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds double, ptr %119, i64 %121
  store double %116, ptr %122, align 8, !tbaa !11
  br label %130

123:                                              ; preds = %107
  %124 = load ptr, ptr %11, align 8, !tbaa !5
  %125 = getelementptr inbounds %class.R2Grid, ptr %124, i32 0, i32 3
  %126 = load ptr, ptr %125, align 8, !tbaa !18
  %127 = load i32, ptr %20, align 4, !tbaa !9
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds double, ptr %126, i64 %128
  store double 0.000000e+00, ptr %129, align 8, !tbaa !11
  br label %130

130:                                              ; preds = %123, %115
  br label %131

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

134:                                              ; preds = %102
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %135

135:                                              ; preds = %240, %134
  %136 = load i32, ptr %17, align 4, !tbaa !9
  %137 = call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %24)
  %138 = icmp slt i32 %136, %137
  br i1 %138, label %139, label %243

139:                                              ; preds = %135
  store i32 1, ptr %15, align 4, !tbaa !9
  store double 0.000000e+00, ptr %8, align 8, !tbaa !11
  store i32 0, ptr %5, align 4, !tbaa !9
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %140

140:                                              ; preds = %181, %139
  %141 = load i32, ptr %16, align 4, !tbaa !9
  %142 = call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %24)
  %143 = icmp slt i32 %141, %142
  br i1 %143, label %144, label %184

144:                                              ; preds = %140
  %145 = load ptr, ptr %11, align 8, !tbaa !5
  %146 = load i32, ptr %16, align 4, !tbaa !9
  %147 = load i32, ptr %17, align 4, !tbaa !9
  %148 = call noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %145, i32 noundef %146, i32 noundef %147)
  %149 = fcmp oeq double %148, 0.000000e+00
  br i1 %149, label %150, label %158

150:                                              ; preds = %144
  store i32 0, ptr %15, align 4, !tbaa !9
  store i32 0, ptr %5, align 4, !tbaa !9
  %151 = load i32, ptr %16, align 4, !tbaa !9
  %152 = load i32, ptr %17, align 4, !tbaa !9
  %153 = call noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %24, i32 noundef %151, i32 noundef %152)
  store double %153, ptr %8, align 8, !tbaa !11
  %154 = load double, ptr %8, align 8, !tbaa !11
  %155 = fcmp une double %154, 0.000000e+00
  br i1 %155, label %157, label %156

156:                                              ; preds = %150
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.22, i32 noundef 1910, ptr noundef @.str.2)
  br label %157

157:                                              ; preds = %156, %150
  br label %180

158:                                              ; preds = %144
  %159 = load i32, ptr %15, align 4, !tbaa !9
  %160 = icmp eq i32 %159, 0
  br i1 %160, label %161, label %179

161:                                              ; preds = %158
  %162 = load i32, ptr %5, align 4, !tbaa !9
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %5, align 4, !tbaa !9
  %164 = load i32, ptr %5, align 4, !tbaa !9
  %165 = load i32, ptr %5, align 4, !tbaa !9
  %166 = mul nsw i32 %164, %165
  store i32 %166, ptr %13, align 4, !tbaa !9
  %167 = load ptr, ptr %11, align 8, !tbaa !5
  %168 = load i32, ptr %16, align 4, !tbaa !9
  %169 = load i32, ptr %17, align 4, !tbaa !9
  %170 = load i32, ptr %13, align 4, !tbaa !9
  %171 = sitofp i32 %170 to double
  call void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %167, i32 noundef %168, i32 noundef %169, double noundef %171)
  %172 = load i32, ptr %16, align 4, !tbaa !9
  %173 = load i32, ptr %17, align 4, !tbaa !9
  %174 = load double, ptr %8, align 8, !tbaa !11
  call void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %24, i32 noundef %172, i32 noundef %173, double noundef %174)
  %175 = load double, ptr %8, align 8, !tbaa !11
  %176 = fcmp une double %175, 0.000000e+00
  br i1 %176, label %178, label %177

177:                                              ; preds = %161
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.22, i32 noundef 1917, ptr noundef @.str.2)
  br label %178

178:                                              ; preds = %177, %161
  br label %179

179:                                              ; preds = %178, %158
  br label %180

180:                                              ; preds = %179, %157
  br label %181

181:                                              ; preds = %180
  %182 = load i32, ptr %16, align 4, !tbaa !9
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %16, align 4, !tbaa !9
  br label %140, !llvm.loop !21

184:                                              ; preds = %140
  store i32 0, ptr %5, align 4, !tbaa !9
  store i32 1, ptr %15, align 4, !tbaa !9
  %185 = call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %24)
  %186 = sub nsw i32 %185, 1
  store i32 %186, ptr %16, align 4, !tbaa !9
  br label %187

187:                                              ; preds = %236, %184
  %188 = load i32, ptr %16, align 4, !tbaa !9
  %189 = icmp sge i32 %188, 0
  br i1 %189, label %190, label %239

190:                                              ; preds = %187
  %191 = load ptr, ptr %11, align 8, !tbaa !5
  %192 = load i32, ptr %16, align 4, !tbaa !9
  %193 = load i32, ptr %17, align 4, !tbaa !9
  %194 = call noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %191, i32 noundef %192, i32 noundef %193)
  %195 = fcmp oeq double %194, 0.000000e+00
  br i1 %195, label %196, label %204

196:                                              ; preds = %190
  store i32 0, ptr %5, align 4, !tbaa !9
  store i32 0, ptr %15, align 4, !tbaa !9
  %197 = load i32, ptr %16, align 4, !tbaa !9
  %198 = load i32, ptr %17, align 4, !tbaa !9
  %199 = call noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %24, i32 noundef %197, i32 noundef %198)
  store double %199, ptr %8, align 8, !tbaa !11
  %200 = load double, ptr %8, align 8, !tbaa !11
  %201 = fcmp une double %200, 0.000000e+00
  br i1 %201, label %203, label %202

202:                                              ; preds = %196
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.22, i32 noundef 1929, ptr noundef @.str.2)
  br label %203

203:                                              ; preds = %202, %196
  br label %235

204:                                              ; preds = %190
  %205 = load i32, ptr %15, align 4, !tbaa !9
  %206 = icmp eq i32 %205, 0
  br i1 %206, label %207, label %234

207:                                              ; preds = %204
  %208 = load i32, ptr %5, align 4, !tbaa !9
  %209 = add nsw i32 %208, 1
  store i32 %209, ptr %5, align 4, !tbaa !9
  %210 = load i32, ptr %5, align 4, !tbaa !9
  %211 = load i32, ptr %5, align 4, !tbaa !9
  %212 = mul nsw i32 %210, %211
  store i32 %212, ptr %13, align 4, !tbaa !9
  %213 = load i32, ptr %13, align 4, !tbaa !9
  %214 = sitofp i32 %213 to double
  %215 = load ptr, ptr %11, align 8, !tbaa !5
  %216 = load i32, ptr %16, align 4, !tbaa !9
  %217 = load i32, ptr %17, align 4, !tbaa !9
  %218 = call noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %215, i32 noundef %216, i32 noundef %217)
  %219 = fcmp olt double %214, %218
  br i1 %219, label %220, label %233

220:                                              ; preds = %207
  %221 = load ptr, ptr %11, align 8, !tbaa !5
  %222 = load i32, ptr %16, align 4, !tbaa !9
  %223 = load i32, ptr %17, align 4, !tbaa !9
  %224 = load i32, ptr %13, align 4, !tbaa !9
  %225 = sitofp i32 %224 to double
  call void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %221, i32 noundef %222, i32 noundef %223, double noundef %225)
  %226 = load i32, ptr %16, align 4, !tbaa !9
  %227 = load i32, ptr %17, align 4, !tbaa !9
  %228 = load double, ptr %8, align 8, !tbaa !11
  call void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %24, i32 noundef %226, i32 noundef %227, double noundef %228)
  %229 = load double, ptr %8, align 8, !tbaa !11
  %230 = fcmp une double %229, 0.000000e+00
  br i1 %230, label %232, label %231

231:                                              ; preds = %220
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.22, i32 noundef 1937, ptr noundef @.str.2)
  br label %232

232:                                              ; preds = %231, %220
  br label %233

233:                                              ; preds = %232, %207
  br label %234

234:                                              ; preds = %233, %204
  br label %235

235:                                              ; preds = %234, %203
  br label %236

236:                                              ; preds = %235
  %237 = load i32, ptr %16, align 4, !tbaa !9
  %238 = add nsw i32 %237, -1
  store i32 %238, ptr %16, align 4, !tbaa !9
  br label %187, !llvm.loop !22

239:                                              ; preds = %187
  br label %240

240:                                              ; preds = %239
  %241 = load i32, ptr %17, align 4, !tbaa !9
  %242 = add nsw i32 %241, 1
  store i32 %242, ptr %17, align 4, !tbaa !9
  br label %135, !llvm.loop !23

243:                                              ; preds = %135
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %244

244:                                              ; preds = %415, %243
  %245 = load i32, ptr %16, align 4, !tbaa !9
  %246 = call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %24)
  %247 = icmp slt i32 %245, %246
  br i1 %247, label %248, label %418

248:                                              ; preds = %244
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %249

249:                                              ; preds = %270, %248
  %250 = load i32, ptr %17, align 4, !tbaa !9
  %251 = call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %24)
  %252 = icmp slt i32 %250, %251
  br i1 %252, label %253, label %273

253:                                              ; preds = %249
  %254 = load ptr, ptr %11, align 8, !tbaa !5
  %255 = load i32, ptr %16, align 4, !tbaa !9
  %256 = load i32, ptr %17, align 4, !tbaa !9
  %257 = call noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %254, i32 noundef %255, i32 noundef %256)
  %258 = fptosi double %257 to i32
  %259 = load ptr, ptr %6, align 8, !tbaa !5
  %260 = load i32, ptr %17, align 4, !tbaa !9
  %261 = sext i32 %260 to i64
  %262 = getelementptr inbounds i32, ptr %259, i64 %261
  store i32 %258, ptr %262, align 4, !tbaa !9
  %263 = load i32, ptr %16, align 4, !tbaa !9
  %264 = load i32, ptr %17, align 4, !tbaa !9
  %265 = call noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %24, i32 noundef %263, i32 noundef %264)
  %266 = load ptr, ptr %9, align 8, !tbaa !5
  %267 = load i32, ptr %17, align 4, !tbaa !9
  %268 = sext i32 %267 to i64
  %269 = getelementptr inbounds double, ptr %266, i64 %268
  store double %265, ptr %269, align 8, !tbaa !11
  br label %270

270:                                              ; preds = %253
  %271 = load i32, ptr %17, align 4, !tbaa !9
  %272 = add nsw i32 %271, 1
  store i32 %272, ptr %17, align 4, !tbaa !9
  br label %249, !llvm.loop !24

273:                                              ; preds = %249
  store i32 0, ptr %18, align 4, !tbaa !9
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %274

274:                                              ; preds = %340, %273
  %275 = load i32, ptr %17, align 4, !tbaa !9
  %276 = call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %24)
  %277 = icmp slt i32 %275, %276
  br i1 %277, label %278, label %343

278:                                              ; preds = %274
  %279 = load ptr, ptr %6, align 8, !tbaa !5
  %280 = load i32, ptr %17, align 4, !tbaa !9
  %281 = sext i32 %280 to i64
  %282 = getelementptr inbounds i32, ptr %279, i64 %281
  %283 = load i32, ptr %282, align 4, !tbaa !9
  store i32 %283, ptr %5, align 4, !tbaa !9
  %284 = load ptr, ptr %9, align 8, !tbaa !5
  %285 = load i32, ptr %17, align 4, !tbaa !9
  %286 = sext i32 %285 to i64
  %287 = getelementptr inbounds double, ptr %284, i64 %286
  %288 = load double, ptr %287, align 8, !tbaa !11
  store double %288, ptr %8, align 8, !tbaa !11
  %289 = load i32, ptr %5, align 4, !tbaa !9
  %290 = icmp ne i32 %289, 0
  br i1 %290, label %291, label %327

291:                                              ; preds = %278
  %292 = load i32, ptr %18, align 4, !tbaa !9
  store i32 %292, ptr %19, align 4, !tbaa !9
  br label %293

293:                                              ; preds = %323, %291
  %294 = load i32, ptr %19, align 4, !tbaa !9
  %295 = load i32, ptr %17, align 4, !tbaa !9
  %296 = icmp sle i32 %294, %295
  br i1 %296, label %297, label %326

297:                                              ; preds = %293
  %298 = load ptr, ptr %6, align 8, !tbaa !5
  %299 = load i32, ptr %19, align 4, !tbaa !9
  %300 = sext i32 %299 to i64
  %301 = getelementptr inbounds i32, ptr %298, i64 %300
  %302 = load i32, ptr %301, align 4, !tbaa !9
  %303 = load i32, ptr %17, align 4, !tbaa !9
  %304 = load i32, ptr %19, align 4, !tbaa !9
  %305 = sub nsw i32 %303, %304
  %306 = load i32, ptr %17, align 4, !tbaa !9
  %307 = load i32, ptr %19, align 4, !tbaa !9
  %308 = sub nsw i32 %306, %307
  %309 = mul nsw i32 %305, %308
  %310 = add nsw i32 %302, %309
  store i32 %310, ptr %14, align 4, !tbaa !9
  %311 = load i32, ptr %14, align 4, !tbaa !9
  %312 = load i32, ptr %5, align 4, !tbaa !9
  %313 = icmp sle i32 %311, %312
  br i1 %313, label %314, label %322

314:                                              ; preds = %297
  %315 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %315, ptr %5, align 4, !tbaa !9
  %316 = load ptr, ptr %9, align 8, !tbaa !5
  %317 = load i32, ptr %19, align 4, !tbaa !9
  %318 = sext i32 %317 to i64
  %319 = getelementptr inbounds double, ptr %316, i64 %318
  %320 = load double, ptr %319, align 8, !tbaa !11
  store double %320, ptr %8, align 8, !tbaa !11
  %321 = load i32, ptr %19, align 4, !tbaa !9
  store i32 %321, ptr %18, align 4, !tbaa !9
  br label %322

322:                                              ; preds = %314, %297
  br label %323

323:                                              ; preds = %322
  %324 = load i32, ptr %19, align 4, !tbaa !9
  %325 = add nsw i32 %324, 1
  store i32 %325, ptr %19, align 4, !tbaa !9
  br label %293, !llvm.loop !25

326:                                              ; preds = %293
  br label %329

327:                                              ; preds = %278
  %328 = load i32, ptr %17, align 4, !tbaa !9
  store i32 %328, ptr %18, align 4, !tbaa !9
  br label %329

329:                                              ; preds = %327, %326
  %330 = load i32, ptr %5, align 4, !tbaa !9
  %331 = load ptr, ptr %7, align 8, !tbaa !5
  %332 = load i32, ptr %17, align 4, !tbaa !9
  %333 = sext i32 %332 to i64
  %334 = getelementptr inbounds i32, ptr %331, i64 %333
  store i32 %330, ptr %334, align 4, !tbaa !9
  %335 = load double, ptr %8, align 8, !tbaa !11
  %336 = load ptr, ptr %10, align 8, !tbaa !5
  %337 = load i32, ptr %17, align 4, !tbaa !9
  %338 = sext i32 %337 to i64
  %339 = getelementptr inbounds double, ptr %336, i64 %338
  store double %335, ptr %339, align 8, !tbaa !11
  br label %340

340:                                              ; preds = %329
  %341 = load i32, ptr %17, align 4, !tbaa !9
  %342 = add nsw i32 %341, 1
  store i32 %342, ptr %17, align 4, !tbaa !9
  br label %274, !llvm.loop !26

343:                                              ; preds = %274
  %344 = call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %24)
  %345 = sub nsw i32 %344, 1
  store i32 %345, ptr %18, align 4, !tbaa !9
  %346 = call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %24)
  %347 = sub nsw i32 %346, 1
  store i32 %347, ptr %17, align 4, !tbaa !9
  br label %348

348:                                              ; preds = %411, %343
  %349 = load i32, ptr %17, align 4, !tbaa !9
  %350 = icmp sge i32 %349, 0
  br i1 %350, label %351, label %414

351:                                              ; preds = %348
  %352 = load ptr, ptr %7, align 8, !tbaa !5
  %353 = load i32, ptr %17, align 4, !tbaa !9
  %354 = sext i32 %353 to i64
  %355 = getelementptr inbounds i32, ptr %352, i64 %354
  %356 = load i32, ptr %355, align 4, !tbaa !9
  store i32 %356, ptr %5, align 4, !tbaa !9
  %357 = load ptr, ptr %10, align 8, !tbaa !5
  %358 = load i32, ptr %17, align 4, !tbaa !9
  %359 = sext i32 %358 to i64
  %360 = getelementptr inbounds double, ptr %357, i64 %359
  %361 = load double, ptr %360, align 8, !tbaa !11
  store double %361, ptr %8, align 8, !tbaa !11
  %362 = load i32, ptr %5, align 4, !tbaa !9
  %363 = icmp ne i32 %362, 0
  br i1 %363, label %364, label %408

364:                                              ; preds = %351
  %365 = load i32, ptr %18, align 4, !tbaa !9
  store i32 %365, ptr %19, align 4, !tbaa !9
  br label %366

366:                                              ; preds = %396, %364
  %367 = load i32, ptr %19, align 4, !tbaa !9
  %368 = load i32, ptr %17, align 4, !tbaa !9
  %369 = icmp sgt i32 %367, %368
  br i1 %369, label %370, label %399

370:                                              ; preds = %366
  %371 = load ptr, ptr %6, align 8, !tbaa !5
  %372 = load i32, ptr %19, align 4, !tbaa !9
  %373 = sext i32 %372 to i64
  %374 = getelementptr inbounds i32, ptr %371, i64 %373
  %375 = load i32, ptr %374, align 4, !tbaa !9
  %376 = load i32, ptr %17, align 4, !tbaa !9
  %377 = load i32, ptr %19, align 4, !tbaa !9
  %378 = sub nsw i32 %376, %377
  %379 = load i32, ptr %17, align 4, !tbaa !9
  %380 = load i32, ptr %19, align 4, !tbaa !9
  %381 = sub nsw i32 %379, %380
  %382 = mul nsw i32 %378, %381
  %383 = add nsw i32 %375, %382
  store i32 %383, ptr %14, align 4, !tbaa !9
  %384 = load i32, ptr %14, align 4, !tbaa !9
  %385 = load i32, ptr %5, align 4, !tbaa !9
  %386 = icmp sle i32 %384, %385
  br i1 %386, label %387, label %395

387:                                              ; preds = %370
  %388 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %388, ptr %5, align 4, !tbaa !9
  %389 = load ptr, ptr %9, align 8, !tbaa !5
  %390 = load i32, ptr %19, align 4, !tbaa !9
  %391 = sext i32 %390 to i64
  %392 = getelementptr inbounds double, ptr %389, i64 %391
  %393 = load double, ptr %392, align 8, !tbaa !11
  store double %393, ptr %8, align 8, !tbaa !11
  %394 = load i32, ptr %19, align 4, !tbaa !9
  store i32 %394, ptr %18, align 4, !tbaa !9
  br label %395

395:                                              ; preds = %387, %370
  br label %396

396:                                              ; preds = %395
  %397 = load i32, ptr %19, align 4, !tbaa !9
  %398 = add nsw i32 %397, -1
  store i32 %398, ptr %19, align 4, !tbaa !9
  br label %366, !llvm.loop !27

399:                                              ; preds = %366
  %400 = load ptr, ptr %11, align 8, !tbaa !5
  %401 = load i32, ptr %16, align 4, !tbaa !9
  %402 = load i32, ptr %17, align 4, !tbaa !9
  %403 = load i32, ptr %5, align 4, !tbaa !9
  %404 = sitofp i32 %403 to double
  call void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %400, i32 noundef %401, i32 noundef %402, double noundef %404)
  %405 = load i32, ptr %16, align 4, !tbaa !9
  %406 = load i32, ptr %17, align 4, !tbaa !9
  %407 = load double, ptr %8, align 8, !tbaa !11
  call void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %24, i32 noundef %405, i32 noundef %406, double noundef %407)
  br label %410

408:                                              ; preds = %351
  %409 = load i32, ptr %17, align 4, !tbaa !9
  store i32 %409, ptr %18, align 4, !tbaa !9
  br label %410

410:                                              ; preds = %408, %399
  br label %411

411:                                              ; preds = %410
  %412 = load i32, ptr %17, align 4, !tbaa !9
  %413 = add nsw i32 %412, -1
  store i32 %413, ptr %17, align 4, !tbaa !9
  br label %348, !llvm.loop !28

414:                                              ; preds = %348
  br label %415

415:                                              ; preds = %414
  %416 = load i32, ptr %16, align 4, !tbaa !9
  %417 = add nsw i32 %416, 1
  store i32 %417, ptr %16, align 4, !tbaa !9
  br label %244, !llvm.loop !29

418:                                              ; preds = %244
  %419 = load ptr, ptr %4, align 8, !tbaa !5
  %420 = icmp ne ptr %419, null
  br i1 %420, label %426, label %421

421:                                              ; preds = %418
  %422 = load ptr, ptr %11, align 8, !tbaa !5
  %423 = icmp eq ptr %422, null
  br i1 %423, label %425, label %424

424:                                              ; preds = %421
  call void @_ZN6R2GridD1Ev(ptr noundef nonnull align 8 dereferenceable(208) %422) #8
  call void @_ZdlPvm(ptr noundef %422, i64 noundef 208) #10
  br label %425

425:                                              ; preds = %424, %421
  br label %426

426:                                              ; preds = %425, %418
  %427 = load ptr, ptr %6, align 8, !tbaa !5
  %428 = icmp eq ptr %427, null
  br i1 %428, label %430, label %429

429:                                              ; preds = %426
  call void @_ZdaPv(ptr noundef %427) #10
  br label %430

430:                                              ; preds = %429, %426
  %431 = load ptr, ptr %7, align 8, !tbaa !5
  %432 = icmp eq ptr %431, null
  br i1 %432, label %434, label %433

433:                                              ; preds = %430
  call void @_ZdaPv(ptr noundef %431) #10
  br label %434

434:                                              ; preds = %433, %430
  %435 = load ptr, ptr %9, align 8, !tbaa !5
  %436 = icmp eq ptr %435, null
  br i1 %436, label %438, label %437

437:                                              ; preds = %434
  call void @_ZdaPv(ptr noundef %435) #10
  br label %438

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

441:                                              ; preds = %438
  call void @_ZdaPv(ptr noundef %439) #10
  br label %442

442:                                              ; preds = %441, %438
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  ret void

443:                                              ; preds = %36
  %444 = load ptr, ptr %21, align 8
  %445 = load i32, ptr %22, align 4
  %446 = insertvalue { ptr, i32 } poison, ptr %444, 0
  %447 = insertvalue { ptr, i32 } %446, i32 %445, 1
  resume { ptr, i32 } %447
}

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

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

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

declare void @_ZN6R2GridC1Eii(ptr, i32, i32)

declare void @_ZN6R2GridD1Ev(ptr)

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

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

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


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

@.str = external hidden unnamed_addr constant [41 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [88 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [11 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

declare void @_Z7RNAbortPKcz(ptr noundef, ...) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6R2Grid28SetWorldToGridTransformationERK8R2Affine(ptr noundef nonnull align 8 dereferenceable(208), ptr noundef nonnull align 8 dereferenceable(84)) local_unnamed_addr #2 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208)) local_unnamed_addr #3 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 #4 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6R2Grid7VoronoiEPS_(ptr noundef nonnull align 8 dereferenceable(208) %0, ptr noundef %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %3, label %9

3:                                                ; preds = %2
  %4 = tail call noalias noundef nonnull dereferenceable(208) ptr @_Znwm(i64 noundef 208) #6
  %5 = tail call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %6 = tail call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  invoke void @_ZN6R2GridC1Eii(ptr noundef nonnull align 8 dereferenceable(208) %4, i32 noundef %5, i32 noundef %6)
          to label %9 unwind label %7

7:                                                ; preds = %3
  %8 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %4, i64 noundef 208) #7
  resume { ptr, i32 } %8

9:                                                ; preds = %2, %3
  %.0165 = phi ptr [ %1, %2 ], [ %4, %3 ]
  %10 = tail call noundef nonnull align 8 dereferenceable(84) ptr @_ZNK6R2Grid25WorldToGridTransformationEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  tail call void @_ZN6R2Grid28SetWorldToGridTransformationERK8R2Affine(ptr noundef nonnull align 8 dereferenceable(208) %.0165, ptr noundef nonnull align 8 dereferenceable(84) %10)
  %11 = tail call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %12 = tail call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %13 = icmp slt i32 %11, %12
  br i1 %13, label %14, label %16

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

16:                                               ; preds = %14, %9
  %.0188 = phi i32 [ %15, %14 ], [ %11, %9 ]
  %17 = sext i32 %.0188 to i64
  %18 = icmp slt i32 %.0188, 0
  %19 = shl nsw i64 %17, 2
  %20 = select i1 %18, i64 -1, i64 %19
  %21 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %20) #6
  %22 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %20) #6
  %23 = shl nsw i64 %17, 3
  %24 = select i1 %18, i64 -1, i64 %23
  %25 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %24) #6
  %26 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %24) #6
  %27 = add nsw i32 %.0188, 1
  %28 = mul nsw i32 %27, 3
  %29 = mul nsw i32 %28, %27
  %30 = sitofp i32 %29 to double
  %31 = getelementptr inbounds i8, ptr %0, i64 204
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = icmp sgt i32 %32, 0
  br i1 %33, label %.lr.ph, label %.preheader211

.lr.ph:                                           ; preds = %16
  %34 = getelementptr inbounds i8, ptr %0, i64 184
  %35 = load ptr, ptr %34, align 8, !tbaa !15
  %36 = getelementptr inbounds i8, ptr %.0165, i64 184
  %wide.trip.count = zext nneg i32 %32 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %37 = icmp eq i32 %32, 1
  br i1 %37, label %.preheader211.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  %38 = load ptr, ptr %36, align 8, !tbaa !15
  br label %46

.preheader211.loopexit.unr-lcssa:                 ; preds = %46, %.lr.ph
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next.1, %46 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader211, label %.preheader211.loopexit.epilog-lcssa

.preheader211.loopexit.epilog-lcssa:              ; preds = %.preheader211.loopexit.unr-lcssa
  %39 = getelementptr inbounds double, ptr %35, i64 %indvars.iv.unr
  %40 = load double, ptr %39, align 8, !tbaa !16
  %41 = fcmp oeq double %40, 0.000000e+00
  %42 = load ptr, ptr %36, align 8, !tbaa !15
  %43 = getelementptr inbounds double, ptr %42, i64 %indvars.iv.unr
  %..epil = select i1 %41, double %30, double 0.000000e+00
  store double %..epil, ptr %43, align 8, !tbaa !16
  br label %.preheader211

.preheader211:                                    ; preds = %.preheader211.loopexit.epilog-lcssa, %.preheader211.loopexit.unr-lcssa, %16
  %44 = tail call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %45 = icmp sgt i32 %44, 0
  br i1 %45, label %.preheader210, label %.preheader209

46:                                               ; preds = %46, %.lr.ph.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.new ], [ %indvars.iv.next.1, %46 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.1, %46 ]
  %47 = getelementptr inbounds double, ptr %35, i64 %indvars.iv
  %48 = load double, ptr %47, align 8, !tbaa !16
  %49 = fcmp oeq double %48, 0.000000e+00
  %50 = getelementptr inbounds double, ptr %38, i64 %indvars.iv
  %. = select i1 %49, double %30, double 0.000000e+00
  store double %., ptr %50, align 8, !tbaa !16
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %51 = getelementptr inbounds double, ptr %35, i64 %indvars.iv.next
  %52 = load double, ptr %51, align 8, !tbaa !16
  %53 = fcmp oeq double %52, 0.000000e+00
  %54 = getelementptr inbounds double, ptr %38, i64 %indvars.iv.next
  %..1 = select i1 %53, double %30, double 0.000000e+00
  store double %..1, ptr %54, align 8, !tbaa !16
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader211.loopexit.unr-lcssa, label %46, !llvm.loop !17

.preheader210:                                    ; preds = %.preheader211, %._crit_edge225
  %.0177226 = phi i32 [ %94, %._crit_edge225 ], [ 0, %.preheader211 ]
  %55 = tail call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %56 = icmp sgt i32 %55, 0
  br i1 %56, label %.lr.ph217, label %._crit_edge

.preheader209:                                    ; preds = %._crit_edge225, %.preheader211
  %57 = tail call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %58 = icmp sgt i32 %57, 0
  br i1 %58, label %.preheader208, label %._crit_edge262

.lr.ph217:                                        ; preds = %.preheader210, %71
  %.0216 = phi i32 [ %.1, %71 ], [ 0, %.preheader210 ]
  %.0156215 = phi double [ %.1157, %71 ], [ 0.000000e+00, %.preheader210 ]
  %.0181214 = phi i32 [ %72, %71 ], [ 0, %.preheader210 ]
  %.0184213 = phi i32 [ %.1185, %71 ], [ 1, %.preheader210 ]
  %59 = tail call noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %.0165, i32 noundef %.0181214, i32 noundef %.0177226)
  %60 = fcmp oeq double %59, 0.000000e+00
  br i1 %60, label %61, label %64

61:                                               ; preds = %.lr.ph217
  %62 = tail call noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %.0181214, i32 noundef %.0177226)
  %63 = fcmp une double %62, 0.000000e+00
  br i1 %63, label %71, label %.sink.split

64:                                               ; preds = %.lr.ph217
  %65 = icmp eq i32 %.0184213, 0
  br i1 %65, label %66, label %71

66:                                               ; preds = %64
  %67 = add nsw i32 %.0216, 1
  %68 = mul nsw i32 %67, %67
  %69 = uitofp nneg i32 %68 to double
  tail call void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %.0165, i32 noundef %.0181214, i32 noundef %.0177226, double noundef %69)
  tail call void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %.0181214, i32 noundef %.0177226, double noundef %.0156215)
  %70 = fcmp une double %.0156215, 0.000000e+00
  br i1 %70, label %71, label %.sink.split

.sink.split:                                      ; preds = %66, %61
  %.sink279 = phi i32 [ 1910, %61 ], [ 1917, %66 ]
  %.1157.ph = phi double [ %62, %61 ], [ %.0156215, %66 ]
  %.1.ph = phi i32 [ 0, %61 ], [ %67, %66 ]
  tail call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.22, i32 noundef %.sink279, ptr noundef nonnull @.str.2)
  br label %71

71:                                               ; preds = %.sink.split, %61, %66, %64
  %.1185 = phi i32 [ 0, %61 ], [ 0, %66 ], [ 1, %64 ], [ 0, %.sink.split ]
  %.1157 = phi double [ %62, %61 ], [ %.0156215, %66 ], [ %.0156215, %64 ], [ %.1157.ph, %.sink.split ]
  %.1 = phi i32 [ 0, %61 ], [ %67, %66 ], [ %.0216, %64 ], [ %.1.ph, %.sink.split ]
  %72 = add nuw nsw i32 %.0181214, 1
  %73 = tail call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %74 = icmp slt i32 %72, %73
  br i1 %74, label %.lr.ph217, label %._crit_edge, !llvm.loop !19

._crit_edge:                                      ; preds = %71, %.preheader210
  %.0156.lcssa = phi double [ 0.000000e+00, %.preheader210 ], [ %.1157, %71 ]
  %75 = tail call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %76 = icmp sgt i32 %75, 0
  br i1 %76, label %.lr.ph224, label %._crit_edge225

.lr.ph224:                                        ; preds = %._crit_edge, %92
  %.1182222.in = phi i32 [ %.1182222, %92 ], [ %75, %._crit_edge ]
  %.2221 = phi i32 [ %.3, %92 ], [ 0, %._crit_edge ]
  %.2158220 = phi double [ %.3159, %92 ], [ %.0156.lcssa, %._crit_edge ]
  %.2186219 = phi i32 [ %.3187, %92 ], [ 1, %._crit_edge ]
  %.1182222 = add nsw i32 %.1182222.in, -1
  %77 = tail call noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %.0165, i32 noundef %.1182222, i32 noundef %.0177226)
  %78 = fcmp oeq double %77, 0.000000e+00
  br i1 %78, label %79, label %82

79:                                               ; preds = %.lr.ph224
  %80 = tail call noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %.1182222, i32 noundef %.0177226)
  %81 = fcmp une double %80, 0.000000e+00
  br i1 %81, label %92, label %.sink.split280

82:                                               ; preds = %.lr.ph224
  %83 = icmp eq i32 %.2186219, 0
  br i1 %83, label %84, label %92

84:                                               ; preds = %82
  %85 = add nsw i32 %.2221, 1
  %86 = mul nsw i32 %85, %85
  %87 = uitofp nneg i32 %86 to double
  %88 = tail call noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %.0165, i32 noundef %.1182222, i32 noundef %.0177226)
  %89 = fcmp ogt double %88, %87
  br i1 %89, label %90, label %92

90:                                               ; preds = %84
  tail call void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %.0165, i32 noundef %.1182222, i32 noundef %.0177226, double noundef %87)
  tail call void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %.1182222, i32 noundef %.0177226, double noundef %.2158220)
  %91 = fcmp une double %.2158220, 0.000000e+00
  br i1 %91, label %92, label %.sink.split280

.sink.split280:                                   ; preds = %90, %79
  %.sink281 = phi i32 [ 1929, %79 ], [ 1937, %90 ]
  %.3159.ph = phi double [ %80, %79 ], [ %.2158220, %90 ]
  %.3.ph = phi i32 [ 0, %79 ], [ %85, %90 ]
  tail call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.22, i32 noundef %.sink281, ptr noundef nonnull @.str.2)
  br label %92

92:                                               ; preds = %.sink.split280, %79, %84, %90, %82
  %.3187 = phi i32 [ 0, %79 ], [ 0, %90 ], [ 0, %84 ], [ 1, %82 ], [ 0, %.sink.split280 ]
  %.3159 = phi double [ %80, %79 ], [ %.2158220, %90 ], [ %.2158220, %84 ], [ %.2158220, %82 ], [ %.3159.ph, %.sink.split280 ]
  %.3 = phi i32 [ 0, %79 ], [ %85, %90 ], [ %85, %84 ], [ %.2221, %82 ], [ %.3.ph, %.sink.split280 ]
  %93 = icmp ugt i32 %.1182222.in, 1
  br i1 %93, label %.lr.ph224, label %._crit_edge225, !llvm.loop !20

._crit_edge225:                                   ; preds = %92, %._crit_edge
  %94 = add nuw nsw i32 %.0177226, 1
  %95 = tail call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %96 = icmp slt i32 %94, %95
  br i1 %96, label %.preheader210, label %.preheader209, !llvm.loop !21

.preheader208:                                    ; preds = %.preheader209, %._crit_edge260
  %.2183261 = phi i32 [ %181, %._crit_edge260 ], [ 0, %.preheader209 ]
  %97 = tail call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %98 = icmp sgt i32 %97, 0
  br i1 %98, label %.lr.ph228, label %.preheader207

.preheader207:                                    ; preds = %.lr.ph228, %.preheader208
  %99 = tail call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %100 = icmp sgt i32 %99, 0
  br i1 %100, label %.lr.ph241, label %._crit_edge242

.lr.ph228:                                        ; preds = %.preheader208, %.lr.ph228
  %indvars.iv264 = phi i64 [ %indvars.iv.next265, %.lr.ph228 ], [ 0, %.preheader208 ]
  %101 = trunc nuw nsw i64 %indvars.iv264 to i32
  %102 = tail call noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %.0165, i32 noundef %.2183261, i32 noundef %101)
  %103 = fptosi double %102 to i32
  %104 = getelementptr inbounds i32, ptr %21, i64 %indvars.iv264
  store i32 %103, ptr %104, align 4, !tbaa !22
  %105 = tail call noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %.2183261, i32 noundef %101)
  %106 = getelementptr inbounds double, ptr %25, i64 %indvars.iv264
  store double %105, ptr %106, align 8, !tbaa !16
  %indvars.iv.next265 = add nuw nsw i64 %indvars.iv264, 1
  %107 = tail call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %108 = sext i32 %107 to i64
  %109 = icmp slt i64 %indvars.iv.next265, %108
  br i1 %109, label %.lr.ph228, label %.preheader207, !llvm.loop !23

.lr.ph241:                                        ; preds = %.preheader207, %.loopexit
  %indvars.iv273 = phi i64 [ %indvars.iv.next274, %.loopexit ], [ 0, %.preheader207 ]
  %indvars.iv270 = phi i32 [ %indvars.iv.next271, %.loopexit ], [ 1, %.preheader207 ]
  %.0169240 = phi i32 [ %.3172, %.loopexit ], [ 0, %.preheader207 ]
  %110 = trunc i64 %indvars.iv273 to i32
  %111 = getelementptr inbounds i32, ptr %21, i64 %indvars.iv273
  %112 = load i32, ptr %111, align 4, !tbaa !22
  %113 = getelementptr inbounds double, ptr %25, i64 %indvars.iv273
  %114 = load double, ptr %113, align 8, !tbaa !16
  %.not204 = icmp eq i32 %112, 0
  %115 = trunc nuw nsw i64 %indvars.iv273 to i32
  br i1 %.not204, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %.lr.ph241
  %116 = sext i32 %.0169240 to i64
  %.not205229 = icmp slt i64 %indvars.iv273, %116
  br i1 %.not205229, label %.loopexit, label %.lr.ph234.preheader

.lr.ph234.preheader:                              ; preds = %.preheader
  %117 = sub i32 %indvars.iv270, %.0169240
  %xtraiter282 = and i32 %117, 1
  %lcmp.mod283.not = icmp eq i32 %xtraiter282, 0
  br i1 %lcmp.mod283.not, label %.lr.ph234.prol.loopexit, label %.lr.ph234.prol

.lr.ph234.prol:                                   ; preds = %.lr.ph234.preheader
  %118 = getelementptr inbounds i32, ptr %21, i64 %116
  %119 = load i32, ptr %118, align 4, !tbaa !22
  %120 = trunc i64 %indvars.iv273 to i32
  %121 = sub i32 %120, %.0169240
  %122 = mul nsw i32 %121, %121
  %123 = add nsw i32 %119, %122
  %.not206.prol = icmp sgt i32 %123, %112
  br i1 %.not206.prol, label %.lr.ph234.prol.loopexit.unr-lcssa, label %124

124:                                              ; preds = %.lr.ph234.prol
  %125 = getelementptr inbounds double, ptr %25, i64 %116
  %126 = load double, ptr %125, align 8, !tbaa !16
  br label %.lr.ph234.prol.loopexit.unr-lcssa

.lr.ph234.prol.loopexit.unr-lcssa:                ; preds = %124, %.lr.ph234.prol
  %.5161.prol = phi double [ %126, %124 ], [ %114, %.lr.ph234.prol ]
  %.5.prol = phi i32 [ %123, %124 ], [ %112, %.lr.ph234.prol ]
  %indvars.iv.next268.prol = add nsw i64 %116, 1
  br label %.lr.ph234.prol.loopexit

.lr.ph234.prol.loopexit:                          ; preds = %.lr.ph234.prol.loopexit.unr-lcssa, %.lr.ph234.preheader
  %.5161.lcssa.unr = phi double [ poison, %.lr.ph234.preheader ], [ %.5161.prol, %.lr.ph234.prol.loopexit.unr-lcssa ]
  %.5.lcssa.unr = phi i32 [ poison, %.lr.ph234.preheader ], [ %.5.prol, %.lr.ph234.prol.loopexit.unr-lcssa ]
  %indvars.iv267.unr = phi i64 [ %116, %.lr.ph234.preheader ], [ %indvars.iv.next268.prol, %.lr.ph234.prol.loopexit.unr-lcssa ]
  %.4233.unr = phi i32 [ %112, %.lr.ph234.preheader ], [ %.5.prol, %.lr.ph234.prol.loopexit.unr-lcssa ]
  %.4160232.unr = phi double [ %114, %.lr.ph234.preheader ], [ %.5161.prol, %.lr.ph234.prol.loopexit.unr-lcssa ]
  %127 = icmp eq i32 %.0169240, %110
  br i1 %127, label %.loopexit, label %.lr.ph234

.lr.ph234:                                        ; preds = %.lr.ph234.prol.loopexit, %148
  %indvars.iv267 = phi i64 [ %indvars.iv.next268.1, %148 ], [ %indvars.iv267.unr, %.lr.ph234.prol.loopexit ]
  %.4233 = phi i32 [ %.5.1, %148 ], [ %.4233.unr, %.lr.ph234.prol.loopexit ]
  %.4160232 = phi double [ %.5161.1, %148 ], [ %.4160232.unr, %.lr.ph234.prol.loopexit ]
  %.1170230 = phi i32 [ %.2171.1, %148 ], [ %.0169240, %.lr.ph234.prol.loopexit ]
  %128 = getelementptr inbounds i32, ptr %21, i64 %indvars.iv267
  %129 = load i32, ptr %128, align 4, !tbaa !22
  %130 = sub nsw i64 %indvars.iv273, %indvars.iv267
  %131 = trunc nsw i64 %130 to i32
  %132 = mul nsw i32 %131, %131
  %133 = add nsw i32 %129, %132
  %.not206 = icmp sgt i32 %133, %.4233
  br i1 %.not206, label %.lr.ph234.1, label %134

134:                                              ; preds = %.lr.ph234
  %135 = getelementptr inbounds double, ptr %25, i64 %indvars.iv267
  %136 = load double, ptr %135, align 8, !tbaa !16
  %137 = trunc nsw i64 %indvars.iv267 to i32
  br label %.lr.ph234.1

.lr.ph234.1:                                      ; preds = %.lr.ph234, %134
  %.2171 = phi i32 [ %137, %134 ], [ %.1170230, %.lr.ph234 ]
  %.5161 = phi double [ %136, %134 ], [ %.4160232, %.lr.ph234 ]
  %.5 = phi i32 [ %133, %134 ], [ %.4233, %.lr.ph234 ]
  %indvars.iv.next268 = add nsw i64 %indvars.iv267, 1
  %138 = getelementptr inbounds i32, ptr %21, i64 %indvars.iv.next268
  %139 = load i32, ptr %138, align 4, !tbaa !22
  %140 = sub nsw i64 %indvars.iv273, %indvars.iv.next268
  %141 = trunc nsw i64 %140 to i32
  %142 = mul nsw i32 %141, %141
  %143 = add nsw i32 %139, %142
  %.not206.1 = icmp sgt i32 %143, %.5
  br i1 %.not206.1, label %148, label %144

144:                                              ; preds = %.lr.ph234.1
  %145 = getelementptr inbounds double, ptr %25, i64 %indvars.iv.next268
  %146 = load double, ptr %145, align 8, !tbaa !16
  %147 = trunc nsw i64 %indvars.iv.next268 to i32
  br label %148

148:                                              ; preds = %144, %.lr.ph234.1
  %.2171.1 = phi i32 [ %147, %144 ], [ %.2171, %.lr.ph234.1 ]
  %.5161.1 = phi double [ %146, %144 ], [ %.5161, %.lr.ph234.1 ]
  %.5.1 = phi i32 [ %143, %144 ], [ %.5, %.lr.ph234.1 ]
  %indvars.iv.next268.1 = add nsw i64 %indvars.iv267, 2
  %lftr.wideiv.1 = trunc i64 %indvars.iv.next268.1 to i32
  %exitcond272.not.1 = icmp eq i32 %indvars.iv270, %lftr.wideiv.1
  br i1 %exitcond272.not.1, label %.loopexit, label %.lr.ph234, !llvm.loop !24

.loopexit:                                        ; preds = %.lr.ph234.prol.loopexit, %148, %.preheader, %.lr.ph241
  %.3172 = phi i32 [ %115, %.lr.ph241 ], [ %.0169240, %.preheader ], [ %.0169240, %.lr.ph234.prol.loopexit ], [ %.2171.1, %148 ]
  %.6162 = phi double [ %114, %.lr.ph241 ], [ %114, %.preheader ], [ %.5161.lcssa.unr, %.lr.ph234.prol.loopexit ], [ %.5161.1, %148 ]
  %.6 = phi i32 [ 0, %.lr.ph241 ], [ %112, %.preheader ], [ %.5.lcssa.unr, %.lr.ph234.prol.loopexit ], [ %.5.1, %148 ]
  %149 = getelementptr inbounds i32, ptr %22, i64 %indvars.iv273
  store i32 %.6, ptr %149, align 4, !tbaa !22
  %150 = getelementptr inbounds double, ptr %26, i64 %indvars.iv273
  store double %.6162, ptr %150, align 8, !tbaa !16
  %indvars.iv.next274 = add nuw nsw i64 %indvars.iv273, 1
  %151 = tail call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %152 = sext i32 %151 to i64
  %153 = icmp slt i64 %indvars.iv.next274, %152
  %indvars.iv.next271 = add nuw i32 %indvars.iv270, 1
  br i1 %153, label %.lr.ph241, label %._crit_edge242, !llvm.loop !25

._crit_edge242:                                   ; preds = %.loopexit, %.preheader207
  %154 = tail call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %155 = tail call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %156 = icmp sgt i32 %155, 0
  br i1 %156, label %.lr.ph259.preheader, label %._crit_edge260

.lr.ph259.preheader:                              ; preds = %._crit_edge242
  %157 = add nsw i32 %154, -1
  %158 = zext nneg i32 %155 to i64
  br label %.lr.ph259

.lr.ph259:                                        ; preds = %.lr.ph259.preheader, %179
  %indvars.iv276 = phi i64 [ %158, %.lr.ph259.preheader ], [ %indvars.iv.next277, %179 ]
  %.4173256 = phi i32 [ %157, %.lr.ph259.preheader ], [ %.7176, %179 ]
  %indvars.iv.next277 = add nsw i64 %indvars.iv276, -1
  %159 = getelementptr inbounds i32, ptr %22, i64 %indvars.iv.next277
  %160 = load i32, ptr %159, align 4, !tbaa !22
  %.not201 = icmp eq i32 %160, 0
  %161 = trunc nuw nsw i64 %indvars.iv.next277 to i32
  br i1 %.not201, label %179, label %162

162:                                              ; preds = %.lr.ph259
  %163 = getelementptr inbounds double, ptr %26, i64 %indvars.iv.next277
  %164 = load double, ptr %163, align 8, !tbaa !16
  %165 = sext i32 %.4173256 to i64
  %.not202243 = icmp sgt i64 %indvars.iv276, %165
  br i1 %.not202243, label %._crit_edge250, label %.lr.ph249

.lr.ph249:                                        ; preds = %162, %175
  %.7247 = phi i32 [ %.8, %175 ], [ %160, %162 ]
  %.7163246 = phi double [ %.8164, %175 ], [ %164, %162 ]
  %.1168245 = phi i32 [ %176, %175 ], [ %.4173256, %162 ]
  %.5174244 = phi i32 [ %.6175, %175 ], [ %.4173256, %162 ]
  %166 = zext nneg i32 %.1168245 to i64
  %167 = getelementptr inbounds i32, ptr %21, i64 %166
  %168 = load i32, ptr %167, align 4, !tbaa !22
  %169 = sub nsw i32 %161, %.1168245
  %170 = mul nsw i32 %169, %169
  %171 = add nsw i32 %168, %170
  %.not203 = icmp sgt i32 %171, %.7247
  br i1 %.not203, label %175, label %172

172:                                              ; preds = %.lr.ph249
  %173 = getelementptr inbounds double, ptr %25, i64 %166
  %174 = load double, ptr %173, align 8, !tbaa !16
  br label %175

175:                                              ; preds = %.lr.ph249, %172
  %.6175 = phi i32 [ %.1168245, %172 ], [ %.5174244, %.lr.ph249 ]
  %.8164 = phi double [ %174, %172 ], [ %.7163246, %.lr.ph249 ]
  %.8 = phi i32 [ %171, %172 ], [ %.7247, %.lr.ph249 ]
  %176 = add nsw i32 %.1168245, -1
  %177 = sext i32 %.1168245 to i64
  %.not202.not = icmp slt i64 %indvars.iv276, %177
  br i1 %.not202.not, label %.lr.ph249, label %._crit_edge250, !llvm.loop !26

._crit_edge250:                                   ; preds = %175, %162
  %.5174.lcssa = phi i32 [ %.4173256, %162 ], [ %.6175, %175 ]
  %.7163.lcssa = phi double [ %164, %162 ], [ %.8164, %175 ]
  %.7.lcssa = phi i32 [ %160, %162 ], [ %.8, %175 ]
  %178 = sitofp i32 %.7.lcssa to double
  tail call void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %.0165, i32 noundef %.2183261, i32 noundef %161, double noundef %178)
  tail call void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %.2183261, i32 noundef %161, double noundef %.7163.lcssa)
  br label %179

179:                                              ; preds = %.lr.ph259, %._crit_edge250
  %.7176 = phi i32 [ %.5174.lcssa, %._crit_edge250 ], [ %161, %.lr.ph259 ]
  %180 = icmp sgt i64 %indvars.iv276, 1
  br i1 %180, label %.lr.ph259, label %._crit_edge260, !llvm.loop !27

._crit_edge260:                                   ; preds = %179, %._crit_edge242
  %181 = add nuw nsw i32 %.2183261, 1
  %182 = tail call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %183 = icmp slt i32 %181, %182
  br i1 %183, label %.preheader208, label %._crit_edge262, !llvm.loop !28

._crit_edge262:                                   ; preds = %._crit_edge260, %.preheader209
  br i1 %.not, label %184, label %185

184:                                              ; preds = %._crit_edge262
  tail call void @_ZN6R2GridD1Ev(ptr noundef nonnull align 8 dereferenceable(208) %.0165) #8
  tail call void @_ZdlPvm(ptr noundef nonnull %.0165, i64 noundef 208) #7
  br label %185

185:                                              ; preds = %._crit_edge262, %184
  tail call void @_ZdaPv(ptr noundef nonnull %21) #7
  tail call void @_ZdaPv(ptr noundef nonnull %22) #7
  tail call void @_ZdaPv(ptr noundef nonnull %25) #7
  tail call void @_ZdaPv(ptr noundef nonnull %26) #7
  ret void
}

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

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

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

declare void @_ZN6R2GridC1Eii(ptr, i32, i32) local_unnamed_addr

declare void @_ZN6R2GridD1Ev(ptr) local_unnamed_addr

attributes #0 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { builtin allocsize(0) }
attributes #7 = { builtin nounwind }
attributes #8 = { 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, !12, i64 204}
!6 = !{!"_ZTS6R2Grid", !7, i64 0, !7, i64 88, !13, i64 176, !14, i64 184, !10, i64 192, !12, i64 200, !12, i64 204}
!7 = !{!"_ZTS8R2Affine", !8, i64 0, !9, i64 8, !12, i64 80}
!8 = !{!"_ZTS16R2Transformation"}
!9 = !{!"_ZTS8R3Matrix", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"int", !10, i64 0}
!13 = !{!"double", !10, i64 0}
!14 = !{!"any pointer", !10, i64 0}
!15 = !{!6, !14, i64 184}
!16 = !{!13, !13, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}
!21 = distinct !{!21, !18}
!22 = !{!12, !12, i64 0}
!23 = distinct !{!23, !18}
!24 = distinct !{!24, !18}
!25 = distinct !{!25, !18}
!26 = distinct !{!26, !18}
!27 = distinct !{!27, !18}
!28 = distinct !{!28, !18}


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