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

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

; 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: nounwind
declare void @_ZN6R2GridD1Ev(ptr noundef nonnull align 8 dereferenceable(208)) unnamed_addr #2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z22RGBDResampleDepthImageR6R2GridR8R3Matrixii(ptr noundef nonnull align 8 dereferenceable(208) %0, ptr noundef nonnull align 8 dereferenceable(72) %1, i32 noundef %2, i32 noundef %3) #6 personality ptr @__gxx_personality_v0 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca %class.R2Grid, align 8
  %13 = alloca %class.R2Grid, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca double, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca double, align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca double, align 8
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca double, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i32 %2, ptr %8, align 4, !tbaa !9
  store i32 %3, ptr %9, align 4, !tbaa !9
  %29 = load i32, ptr %8, align 4, !tbaa !9
  %30 = icmp eq i32 %29, 0
  br i1 %30, label %34, label %31

31:                                               ; preds = %4
  %32 = load i32, ptr %9, align 4, !tbaa !9
  %33 = icmp eq i32 %32, 0
  br i1 %33, label %34, label %35

34:                                               ; preds = %31, %4
  store i32 0, ptr %5, align 4
  br label %300

35:                                               ; preds = %31
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %36)
  %38 = icmp eq i32 %37, 0
  br i1 %38, label %43, label %39

39:                                               ; preds = %35
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %40)
  %42 = icmp eq i32 %41, 0
  br i1 %42, label %43, label %44

43:                                               ; preds = %39, %35
  store i32 0, ptr %5, align 4
  br label %300

44:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %45)
  %47 = sitofp i32 %46 to double
  %48 = load i32, ptr %8, align 4, !tbaa !9
  %49 = sitofp i32 %48 to double
  %50 = fdiv double %47, %49
  store double %50, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %51)
  %53 = sitofp i32 %52 to double
  %54 = load i32, ptr %9, align 4, !tbaa !9
  %55 = sitofp i32 %54 to double
  %56 = fdiv double %53, %55
  store double %56, ptr %11, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 208, ptr %12) #7
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN6R2GridC1ERKS_(ptr noundef nonnull align 8 dereferenceable(208) %12, ptr noundef nonnull align 8 dereferenceable(208) %57)
  call void @llvm.lifetime.start.p0(i64 208, ptr %13) #7
  %58 = load i32, ptr %8, align 4, !tbaa !9
  %59 = load i32, ptr %9, align 4, !tbaa !9
  invoke void @_ZN6R2GridC1Eii(ptr noundef nonnull align 8 dereferenceable(208) %13, i32 noundef %58, i32 noundef %59)
          to label %60 unwind label %69

60:                                               ; preds = %44
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = invoke noundef nonnull align 8 dereferenceable(208) ptr @_ZN6R2GridaSERKS_(ptr noundef nonnull align 8 dereferenceable(208) %61, ptr noundef nonnull align 8 dereferenceable(208) %13)
          to label %63 unwind label %73

63:                                               ; preds = %60
  call void @_ZN6R2GridD1Ev(ptr noundef nonnull align 8 dereferenceable(208) %13) #7
  call void @llvm.lifetime.end.p0(i64 208, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %64

64:                                               ; preds = %261, %63
  %65 = load i32, ptr %16, align 4, !tbaa !9
  %66 = load i32, ptr %9, align 4, !tbaa !9
  %67 = icmp slt i32 %65, %66
  br i1 %67, label %78, label %68

68:                                               ; preds = %64
  store i32 2, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %266

69:                                               ; preds = %44
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %14, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %15, align 4
  br label %77

73:                                               ; preds = %60
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %14, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %15, align 4
  call void @_ZN6R2GridD1Ev(ptr noundef nonnull align 8 dereferenceable(208) %13) #7
  br label %77

77:                                               ; preds = %73, %69
  call void @llvm.lifetime.end.p0(i64 208, ptr %13) #7
  br label %299

78:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %79 = load double, ptr %11, align 8, !tbaa !11
  %80 = load i32, ptr %16, align 4, !tbaa !9
  %81 = sitofp i32 %80 to double
  %82 = fmul double %79, %81
  store double %82, ptr %18, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %83 = load double, ptr %18, align 8, !tbaa !11
  %84 = load double, ptr %11, align 8, !tbaa !11
  %85 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %84, double %83)
  %86 = fadd double %85, 5.000000e-01
  %87 = fptosi double %86 to i32
  store i32 %87, ptr %19, align 4, !tbaa !9
  %88 = load i32, ptr %19, align 4, !tbaa !9
  %89 = invoke noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %12)
          to label %90 unwind label %93

90:                                               ; preds = %78
  %91 = icmp sge i32 %88, %89
  br i1 %91, label %92, label %97

92:                                               ; preds = %90
  store i32 4, ptr %17, align 4
  br label %258

93:                                               ; preds = %78
  %94 = landingpad { ptr, i32 }
          cleanup
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %14, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %15, align 4
  br label %265

97:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %98 = load double, ptr %18, align 8, !tbaa !11
  %99 = load double, ptr %11, align 8, !tbaa !11
  %100 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %99, double %98)
  %101 = fadd double %100, 5.000000e-01
  %102 = fptosi double %101 to i32
  store i32 %102, ptr %20, align 4, !tbaa !9
  %103 = load i32, ptr %20, align 4, !tbaa !9
  %104 = icmp slt i32 %103, 0
  br i1 %104, label %105, label %106

105:                                              ; preds = %97
  store i32 4, ptr %17, align 4
  br label %257

106:                                              ; preds = %97
  %107 = load i32, ptr %19, align 4, !tbaa !9
  %108 = icmp slt i32 %107, 0
  br i1 %108, label %109, label %110

109:                                              ; preds = %106
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %110

110:                                              ; preds = %109, %106
  %111 = load i32, ptr %20, align 4, !tbaa !9
  %112 = invoke noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %12)
          to label %113 unwind label %119

113:                                              ; preds = %110
  %114 = icmp sge i32 %111, %112
  br i1 %114, label %115, label %123

115:                                              ; preds = %113
  %116 = invoke noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %12)
          to label %117 unwind label %119

117:                                              ; preds = %115
  %118 = sub nsw i32 %116, 1
  store i32 %118, ptr %20, align 4, !tbaa !9
  br label %123

119:                                              ; preds = %115, %110
  %120 = landingpad { ptr, i32 }
          cleanup
  %121 = extractvalue { ptr, i32 } %120, 0
  store ptr %121, ptr %14, align 8
  %122 = extractvalue { ptr, i32 } %120, 1
  store i32 %122, ptr %15, align 4
  br label %264

123:                                              ; preds = %117, %113
  %124 = load i32, ptr %20, align 4, !tbaa !9
  %125 = load i32, ptr %19, align 4, !tbaa !9
  %126 = icmp slt i32 %124, %125
  br i1 %126, label %127, label %129

127:                                              ; preds = %123
  %128 = load i32, ptr %19, align 4, !tbaa !9
  store i32 %128, ptr %20, align 4, !tbaa !9
  br label %129

129:                                              ; preds = %127, %123
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  store i32 0, ptr %21, align 4, !tbaa !9
  br label %130

130:                                              ; preds = %250, %129
  %131 = load i32, ptr %21, align 4, !tbaa !9
  %132 = load i32, ptr %8, align 4, !tbaa !9
  %133 = icmp slt i32 %131, %132
  br i1 %133, label %135, label %134

134:                                              ; preds = %130
  store i32 5, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %256

135:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %136 = load double, ptr %10, align 8, !tbaa !11
  %137 = load i32, ptr %21, align 4, !tbaa !9
  %138 = sitofp i32 %137 to double
  %139 = fmul double %136, %138
  store double %139, ptr %22, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  %140 = load double, ptr %22, align 8, !tbaa !11
  %141 = load double, ptr %10, align 8, !tbaa !11
  %142 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %141, double %140)
  %143 = fadd double %142, 5.000000e-01
  %144 = fptosi double %143 to i32
  store i32 %144, ptr %23, align 4, !tbaa !9
  %145 = load i32, ptr %23, align 4, !tbaa !9
  %146 = invoke noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %12)
          to label %147 unwind label %150

147:                                              ; preds = %135
  %148 = icmp sge i32 %145, %146
  br i1 %148, label %149, label %154

149:                                              ; preds = %147
  store i32 7, ptr %17, align 4
  br label %247

150:                                              ; preds = %135
  %151 = landingpad { ptr, i32 }
          cleanup
  %152 = extractvalue { ptr, i32 } %151, 0
  store ptr %152, ptr %14, align 8
  %153 = extractvalue { ptr, i32 } %151, 1
  store i32 %153, ptr %15, align 4
  br label %255

154:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  %155 = load double, ptr %22, align 8, !tbaa !11
  %156 = load double, ptr %10, align 8, !tbaa !11
  %157 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %156, double %155)
  %158 = fadd double %157, 5.000000e-01
  %159 = fptosi double %158 to i32
  store i32 %159, ptr %24, align 4, !tbaa !9
  %160 = load i32, ptr %24, align 4, !tbaa !9
  %161 = icmp slt i32 %160, 0
  br i1 %161, label %162, label %163

162:                                              ; preds = %154
  store i32 7, ptr %17, align 4
  br label %246

163:                                              ; preds = %154
  %164 = load i32, ptr %23, align 4, !tbaa !9
  %165 = icmp slt i32 %164, 0
  br i1 %165, label %166, label %167

166:                                              ; preds = %163
  store i32 0, ptr %23, align 4, !tbaa !9
  br label %167

167:                                              ; preds = %166, %163
  %168 = load i32, ptr %24, align 4, !tbaa !9
  %169 = invoke noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %12)
          to label %170 unwind label %176

170:                                              ; preds = %167
  %171 = icmp sge i32 %168, %169
  br i1 %171, label %172, label %180

172:                                              ; preds = %170
  %173 = invoke noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %12)
          to label %174 unwind label %176

174:                                              ; preds = %172
  %175 = sub nsw i32 %173, 1
  store i32 %175, ptr %24, align 4, !tbaa !9
  br label %180

176:                                              ; preds = %172, %167
  %177 = landingpad { ptr, i32 }
          cleanup
  %178 = extractvalue { ptr, i32 } %177, 0
  store ptr %178, ptr %14, align 8
  %179 = extractvalue { ptr, i32 } %177, 1
  store i32 %179, ptr %15, align 4
  br label %254

180:                                              ; preds = %174, %170
  %181 = load i32, ptr %24, align 4, !tbaa !9
  %182 = load i32, ptr %23, align 4, !tbaa !9
  %183 = icmp slt i32 %181, %182
  br i1 %183, label %184, label %186

184:                                              ; preds = %180
  %185 = load i32, ptr %23, align 4, !tbaa !9
  store i32 %185, ptr %24, align 4, !tbaa !9
  br label %186

186:                                              ; preds = %184, %180
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  store double 0x47EFFFFFE0000000, ptr %25, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  %187 = load i32, ptr %19, align 4, !tbaa !9
  store i32 %187, ptr %26, align 4, !tbaa !9
  br label %188

188:                                              ; preds = %229, %186
  %189 = load i32, ptr %26, align 4, !tbaa !9
  %190 = load i32, ptr %20, align 4, !tbaa !9
  %191 = icmp sle i32 %189, %190
  br i1 %191, label %193, label %192

192:                                              ; preds = %188
  store i32 8, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  br label %232

193:                                              ; preds = %188
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  %194 = load i32, ptr %23, align 4, !tbaa !9
  store i32 %194, ptr %27, align 4, !tbaa !9
  br label %195

195:                                              ; preds = %225, %193
  %196 = load i32, ptr %27, align 4, !tbaa !9
  %197 = load i32, ptr %24, align 4, !tbaa !9
  %198 = icmp sle i32 %196, %197
  br i1 %198, label %200, label %199

199:                                              ; preds = %195
  store i32 11, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  br label %228

200:                                              ; preds = %195
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  %201 = load i32, ptr %27, align 4, !tbaa !9
  %202 = load i32, ptr %26, align 4, !tbaa !9
  %203 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %12, i32 noundef %201, i32 noundef %202)
          to label %204 unwind label %211

204:                                              ; preds = %200
  store double %203, ptr %28, align 8, !tbaa !11
  %205 = load double, ptr %28, align 8, !tbaa !11
  %206 = fcmp ole double %205, 0.000000e+00
  br i1 %206, label %210, label %207

207:                                              ; preds = %204
  %208 = load double, ptr %28, align 8, !tbaa !11
  %209 = fcmp oeq double %208, -3.210000e+02
  br i1 %209, label %210, label %215

210:                                              ; preds = %207, %204
  store i32 13, ptr %17, align 4
  br label %222

211:                                              ; preds = %200
  %212 = landingpad { ptr, i32 }
          cleanup
  %213 = extractvalue { ptr, i32 } %212, 0
  store ptr %213, ptr %14, align 8
  %214 = extractvalue { ptr, i32 } %212, 1
  store i32 %214, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  br label %253

215:                                              ; preds = %207
  %216 = load double, ptr %28, align 8, !tbaa !11
  %217 = load double, ptr %25, align 8, !tbaa !11
  %218 = fcmp olt double %216, %217
  br i1 %218, label %219, label %221

219:                                              ; preds = %215
  %220 = load double, ptr %28, align 8, !tbaa !11
  store double %220, ptr %25, align 8, !tbaa !11
  br label %221

221:                                              ; preds = %219, %215
  store i32 0, ptr %17, align 4
  br label %222

222:                                              ; preds = %221, %210
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  %223 = load i32, ptr %17, align 4
  switch i32 %223, label %307 [
    i32 0, label %224
    i32 13, label %225
  ]

224:                                              ; preds = %222
  br label %225

225:                                              ; preds = %224, %222
  %226 = load i32, ptr %27, align 4, !tbaa !9
  %227 = add nsw i32 %226, 1
  store i32 %227, ptr %27, align 4, !tbaa !9
  br label %195, !llvm.loop !13

228:                                              ; preds = %199
  br label %229

229:                                              ; preds = %228
  %230 = load i32, ptr %26, align 4, !tbaa !9
  %231 = add nsw i32 %230, 1
  store i32 %231, ptr %26, align 4, !tbaa !9
  br label %188, !llvm.loop !15

232:                                              ; preds = %192
  %233 = load double, ptr %25, align 8, !tbaa !11
  %234 = fcmp olt double %233, 0x47EFFFFFE0000000
  br i1 %234, label %235, label %245

235:                                              ; preds = %232
  %236 = load ptr, ptr %6, align 8, !tbaa !5
  %237 = load i32, ptr %21, align 4, !tbaa !9
  %238 = load i32, ptr %16, align 4, !tbaa !9
  %239 = load double, ptr %25, align 8, !tbaa !11
  invoke void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %236, i32 noundef %237, i32 noundef %238, double noundef %239)
          to label %240 unwind label %241

240:                                              ; preds = %235
  br label %245

241:                                              ; preds = %235
  %242 = landingpad { ptr, i32 }
          cleanup
  %243 = extractvalue { ptr, i32 } %242, 0
  store ptr %243, ptr %14, align 8
  %244 = extractvalue { ptr, i32 } %242, 1
  store i32 %244, ptr %15, align 4
  br label %253

245:                                              ; preds = %240, %232
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  store i32 0, ptr %17, align 4
  br label %246

246:                                              ; preds = %245, %162
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %247

247:                                              ; preds = %246, %149
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  %248 = load i32, ptr %17, align 4
  switch i32 %248, label %307 [
    i32 0, label %249
    i32 7, label %250
  ]

249:                                              ; preds = %247
  br label %250

250:                                              ; preds = %249, %247
  %251 = load i32, ptr %21, align 4, !tbaa !9
  %252 = add nsw i32 %251, 1
  store i32 %252, ptr %21, align 4, !tbaa !9
  br label %130, !llvm.loop !16

253:                                              ; preds = %241, %211
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  br label %254

254:                                              ; preds = %253, %176
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %255

255:                                              ; preds = %254, %150
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %264

256:                                              ; preds = %134
  store i32 0, ptr %17, align 4
  br label %257

257:                                              ; preds = %256, %105
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %258

258:                                              ; preds = %257, %92
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  %259 = load i32, ptr %17, align 4
  switch i32 %259, label %307 [
    i32 0, label %260
    i32 4, label %261
  ]

260:                                              ; preds = %258
  br label %261

261:                                              ; preds = %260, %258
  %262 = load i32, ptr %16, align 4, !tbaa !9
  %263 = add nsw i32 %262, 1
  store i32 %263, ptr %16, align 4, !tbaa !9
  br label %64, !llvm.loop !17

264:                                              ; preds = %255, %119
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %265

265:                                              ; preds = %264, %93
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %299

266:                                              ; preds = %68
  %267 = load double, ptr %10, align 8, !tbaa !11
  %268 = load ptr, ptr %7, align 8, !tbaa !5
  %269 = invoke noundef ptr @_ZN8R3MatrixixEi(ptr noundef nonnull align 8 dereferenceable(72) %268, i32 noundef 0)
          to label %270 unwind label %295

270:                                              ; preds = %266
  %271 = getelementptr inbounds double, ptr %269, i64 0
  %272 = load double, ptr %271, align 8, !tbaa !11
  %273 = fdiv double %272, %267
  store double %273, ptr %271, align 8, !tbaa !11
  %274 = load double, ptr %10, align 8, !tbaa !11
  %275 = load ptr, ptr %7, align 8, !tbaa !5
  %276 = invoke noundef ptr @_ZN8R3MatrixixEi(ptr noundef nonnull align 8 dereferenceable(72) %275, i32 noundef 0)
          to label %277 unwind label %295

277:                                              ; preds = %270
  %278 = getelementptr inbounds double, ptr %276, i64 2
  %279 = load double, ptr %278, align 8, !tbaa !11
  %280 = fdiv double %279, %274
  store double %280, ptr %278, align 8, !tbaa !11
  %281 = load double, ptr %11, align 8, !tbaa !11
  %282 = load ptr, ptr %7, align 8, !tbaa !5
  %283 = invoke noundef ptr @_ZN8R3MatrixixEi(ptr noundef nonnull align 8 dereferenceable(72) %282, i32 noundef 1)
          to label %284 unwind label %295

284:                                              ; preds = %277
  %285 = getelementptr inbounds double, ptr %283, i64 1
  %286 = load double, ptr %285, align 8, !tbaa !11
  %287 = fdiv double %286, %281
  store double %287, ptr %285, align 8, !tbaa !11
  %288 = load double, ptr %11, align 8, !tbaa !11
  %289 = load ptr, ptr %7, align 8, !tbaa !5
  %290 = invoke noundef ptr @_ZN8R3MatrixixEi(ptr noundef nonnull align 8 dereferenceable(72) %289, i32 noundef 1)
          to label %291 unwind label %295

291:                                              ; preds = %284
  %292 = getelementptr inbounds double, ptr %290, i64 2
  %293 = load double, ptr %292, align 8, !tbaa !11
  %294 = fdiv double %293, %288
  store double %294, ptr %292, align 8, !tbaa !11
  store i32 1, ptr %5, align 4
  store i32 1, ptr %17, align 4
  call void @_ZN6R2GridD1Ev(ptr noundef nonnull align 8 dereferenceable(208) %12) #7
  call void @llvm.lifetime.end.p0(i64 208, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %300

295:                                              ; preds = %284, %277, %270, %266
  %296 = landingpad { ptr, i32 }
          cleanup
  %297 = extractvalue { ptr, i32 } %296, 0
  store ptr %297, ptr %14, align 8
  %298 = extractvalue { ptr, i32 } %296, 1
  store i32 %298, ptr %15, align 4
  br label %299

299:                                              ; preds = %295, %265, %77
  call void @_ZN6R2GridD1Ev(ptr noundef nonnull align 8 dereferenceable(208) %12) #7
  call void @llvm.lifetime.end.p0(i64 208, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %302

300:                                              ; preds = %291, %43, %34
  %301 = load i32, ptr %5, align 4
  ret i32 %301

302:                                              ; preds = %299
  %303 = load ptr, ptr %14, align 8
  %304 = load i32, ptr %15, align 4
  %305 = insertvalue { ptr, i32 } poison, ptr %303, 0
  %306 = insertvalue { ptr, i32 } %305, i32 %304, 1
  resume { ptr, i32 } %306

307:                                              ; preds = %258, %247, %222
  unreachable
}

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

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

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

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


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

; 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: nounwind
declare void @_ZN6R2GridD1Ev(ptr noundef nonnull align 8 dereferenceable(208)) unnamed_addr #2

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

; 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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 2) i32 @_Z22RGBDResampleDepthImageR6R2GridR8R3Matrixii(ptr noundef nonnull align 8 dereferenceable(208) %0, ptr noundef nonnull align 8 dereferenceable(72) %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #6 personality ptr @__gxx_personality_v0 {
  %5 = alloca %class.R2Grid, align 8
  %6 = alloca %class.R2Grid, align 8
  %7 = icmp eq i32 %2, 0
  %8 = icmp eq i32 %3, 0
  %or.cond = or i1 %7, %8
  br i1 %or.cond, label %118, label %9

9:                                                ; preds = %4
  %10 = tail call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %11 = icmp eq i32 %10, 0
  br i1 %11, label %118, label %12

12:                                               ; preds = %9
  %13 = tail call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %14 = icmp eq i32 %13, 0
  br i1 %14, label %118, label %15

15:                                               ; preds = %12
  %16 = tail call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %17 = sitofp i32 %16 to double
  %18 = sitofp i32 %2 to double
  %19 = fdiv double %17, %18
  %20 = tail call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %0)
  %21 = sitofp i32 %20 to double
  %22 = sitofp i32 %3 to double
  %23 = fdiv double %21, %22
  call void @llvm.lifetime.start.p0(i64 208, ptr nonnull %5) #8
  call void @_ZN6R2GridC1ERKS_(ptr noundef nonnull align 8 dereferenceable(208) %5, ptr noundef nonnull align 8 dereferenceable(208) %0)
  call void @llvm.lifetime.start.p0(i64 208, ptr nonnull %6) #8
  invoke void @_ZN6R2GridC1Eii(ptr noundef nonnull align 8 dereferenceable(208) %6, i32 noundef %2, i32 noundef %3)
          to label %24 unwind label %76

24:                                               ; preds = %15
  %25 = invoke noundef nonnull align 8 dereferenceable(208) ptr @_ZN6R2GridaSERKS_(ptr noundef nonnull align 8 dereferenceable(208) %0, ptr noundef nonnull align 8 dereferenceable(208) %6)
          to label %.split123 unwind label %78

.split123:                                        ; preds = %24
  call void @_ZN6R2GridD1Ev(ptr noundef nonnull align 8 dereferenceable(208) %6) #8
  call void @llvm.lifetime.end.p0(i64 208, ptr nonnull %6) #8
  %26 = icmp sgt i32 %3, 0
  br i1 %26, label %.lr.ph125, label %._crit_edge126

.lr.ph125:                                        ; preds = %.split123
  %27 = icmp sgt i32 %2, 0
  br i1 %27, label %.lr.ph125.split.us, label %.lr.ph125.split

.lr.ph125.split.us:                               ; preds = %.lr.ph125, %..loopexit_crit_edge.us
  %.092124.us = phi i32 [ %70, %..loopexit_crit_edge.us ], [ 0, %.lr.ph125 ]
  %28 = uitofp nneg i32 %.092124.us to double
  %29 = fmul double %23, %28
  %30 = call double @llvm.fmuladd.f64(double %23, double -5.000000e-01, double %29)
  %31 = fadd double %30, 5.000000e-01
  %32 = fptosi double %31 to i32
  %33 = call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %5)
  %.not.us = icmp sgt i32 %33, %32
  br i1 %.not.us, label %34, label %..loopexit_crit_edge.us

34:                                               ; preds = %.lr.ph125.split.us
  %35 = call double @llvm.fmuladd.f64(double %23, double 5.000000e-01, double %29)
  %36 = fadd double %35, 5.000000e-01
  %37 = fptosi double %36 to i32
  %38 = icmp slt i32 %37, 0
  br i1 %38, label %..loopexit_crit_edge.us, label %39

39:                                               ; preds = %34
  %spec.store.select.us = call i32 @llvm.smax.i32(i32 %32, i32 0)
  %40 = call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %5)
  %.not101.us = icmp sgt i32 %40, %37
  br i1 %.not101.us, label %.lr.ph.split.us136.preheader, label %41

41:                                               ; preds = %39
  %42 = call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %5)
  %43 = add nsw i32 %42, -1
  br label %.lr.ph.split.us136.preheader

.lr.ph.split.us136.preheader:                     ; preds = %39, %41
  %.087.us = phi i32 [ %43, %41 ], [ %37, %39 ]
  %spec.select.us = call i32 @llvm.smax.i32(i32 %.087.us, i32 %spec.store.select.us)
  %umax145 = call i32 @llvm.umax.i32(i32 %spec.select.us, i32 %spec.store.select.us)
  br label %.lr.ph.split.us136

.lr.ph.split.us136:                               ; preds = %.lr.ph.split.us136.preheader, %68
  %.086120.us127 = phi i32 [ %69, %68 ], [ 0, %.lr.ph.split.us136.preheader ]
  %44 = uitofp nneg i32 %.086120.us127 to double
  %45 = fmul double %19, %44
  %46 = call double @llvm.fmuladd.f64(double %19, double -5.000000e-01, double %45)
  %47 = fadd double %46, 5.000000e-01
  %48 = fptosi double %47 to i32
  %49 = call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %5)
  %.not102.us128 = icmp sgt i32 %49, %48
  br i1 %.not102.us128, label %50, label %68

50:                                               ; preds = %.lr.ph.split.us136
  %51 = call double @llvm.fmuladd.f64(double %19, double 5.000000e-01, double %45)
  %52 = fadd double %51, 5.000000e-01
  %53 = fptosi double %52 to i32
  %54 = icmp slt i32 %53, 0
  br i1 %54, label %68, label %55

55:                                               ; preds = %50
  %spec.store.select2.us = call i32 @llvm.smax.i32(i32 %48, i32 0)
  %56 = call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %5)
  %.not103.us129 = icmp sgt i32 %56, %53
  br i1 %.not103.us129, label %.preheader.us130.preheader, label %57

57:                                               ; preds = %55
  %58 = call noundef i32 @_ZNK6R2Grid11XResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %5)
  %59 = add nsw i32 %58, -1
  br label %.preheader.us130.preheader

.preheader.us130.preheader:                       ; preds = %55, %57
  %.081.us = phi i32 [ %59, %57 ], [ %53, %55 ]
  %spec.select109.us = call i32 @llvm.smax.i32(i32 %.081.us, i32 %spec.store.select2.us)
  %umax = call i32 @llvm.umax.i32(i32 %spec.select109.us, i32 %spec.store.select2.us)
  br label %.preheader.us130

60:                                               ; preds = %.preheader.us130, %62
  %.078114.us = phi i32 [ %spec.store.select2.us, %.preheader.us130 ], [ %66, %62 ]
  %.1113.us = phi double [ %.080116.us, %.preheader.us130 ], [ %.3.us, %62 ]
  %61 = invoke noundef double @_ZNK6R2Grid9GridValueEii(ptr noundef nonnull align 8 dereferenceable(208) %5, i32 noundef %.078114.us, i32 noundef %.079117.us131)
          to label %62 unwind label %.split138.us

62:                                               ; preds = %60
  %63 = fcmp ole double %61, 0.000000e+00
  %64 = fcmp oeq double %61, -3.210000e+02
  %or.cond4.us = or i1 %63, %64
  %65 = fcmp olt double %61, %.1113.us
  %.2.us = select i1 %65, double %61, double %.1113.us
  %.3.us = select i1 %or.cond4.us, double %.1113.us, double %.2.us
  %66 = add nuw i32 %.078114.us, 1
  %exitcond144.not = icmp eq i32 %.078114.us, %umax
  br i1 %exitcond144.not, label %._crit_edge.us, label %60, !llvm.loop !5

67:                                               ; preds = %._crit_edge118.us
  invoke void @_ZN6R2Grid12SetGridValueEiid(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %.086120.us127, i32 noundef %.092124.us, double noundef %.3.us)
          to label %68 unwind label %.split.split.us

68:                                               ; preds = %._crit_edge118.us, %67, %50, %.lr.ph.split.us136
  %69 = add nuw nsw i32 %.086120.us127, 1
  %exitcond147.not = icmp eq i32 %69, %2
  br i1 %exitcond147.not, label %..loopexit_crit_edge.us, label %.lr.ph.split.us136, !llvm.loop !7

..loopexit_crit_edge.us:                          ; preds = %68, %34, %.lr.ph125.split.us
  %70 = add nuw nsw i32 %.092124.us, 1
  %exitcond148.not = icmp eq i32 %70, %3
  br i1 %exitcond148.not, label %._crit_edge126, label %.lr.ph125.split.us, !llvm.loop !8

.preheader.us130:                                 ; preds = %.preheader.us130.preheader, %._crit_edge.us
  %.079117.us131 = phi i32 [ %71, %._crit_edge.us ], [ %spec.store.select.us, %.preheader.us130.preheader ]
  %.080116.us = phi double [ %.3.us, %._crit_edge.us ], [ 0x47EFFFFFE0000000, %.preheader.us130.preheader ]
  br label %60

._crit_edge.us:                                   ; preds = %62
  %71 = add nuw i32 %.079117.us131, 1
  %exitcond146.not = icmp eq i32 %.079117.us131, %umax145
  br i1 %exitcond146.not, label %._crit_edge118.us, label %.preheader.us130, !llvm.loop !9

._crit_edge118.us:                                ; preds = %._crit_edge.us
  %72 = fcmp olt double %.3.us, 0x47EFFFFFE0000000
  br i1 %72, label %67, label %68

.split138.us:                                     ; preds = %60
  %73 = landingpad { ptr, i32 }
          cleanup
  br label %117

.split.split.us:                                  ; preds = %67
  %74 = landingpad { ptr, i32 }
          cleanup
  br label %117

._crit_edge126:                                   ; preds = %.loopexit, %..loopexit_crit_edge.us, %.split123
  %75 = invoke noundef ptr @_ZN8R3MatrixixEi(ptr noundef nonnull align 8 dereferenceable(72) %1, i32 noundef 0)
          to label %97 unwind label %115

76:                                               ; preds = %15
  %77 = landingpad { ptr, i32 }
          cleanup
  br label %80

78:                                               ; preds = %24
  %79 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6R2GridD1Ev(ptr noundef nonnull align 8 dereferenceable(208) %6) #8
  br label %80

80:                                               ; preds = %78, %76
  %.pn = phi { ptr, i32 } [ %79, %78 ], [ %77, %76 ]
  call void @llvm.lifetime.end.p0(i64 208, ptr nonnull %6) #8
  br label %117

.lr.ph125.split:                                  ; preds = %.lr.ph125, %.loopexit
  %.092124 = phi i32 [ %96, %.loopexit ], [ 0, %.lr.ph125 ]
  %81 = uitofp nneg i32 %.092124 to double
  %82 = fmul double %23, %81
  %83 = call double @llvm.fmuladd.f64(double %23, double -5.000000e-01, double %82)
  %84 = fadd double %83, 5.000000e-01
  %85 = fptosi double %84 to i32
  %86 = call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %5)
  %.not = icmp sgt i32 %86, %85
  br i1 %.not, label %87, label %.loopexit

87:                                               ; preds = %.lr.ph125.split
  %88 = call double @llvm.fmuladd.f64(double %23, double 5.000000e-01, double %82)
  %89 = fadd double %88, 5.000000e-01
  %90 = fptosi double %89 to i32
  %91 = icmp slt i32 %90, 0
  br i1 %91, label %.loopexit, label %92

92:                                               ; preds = %87
  %93 = call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %5)
  %.not101 = icmp sgt i32 %93, %90
  br i1 %.not101, label %.loopexit, label %94

94:                                               ; preds = %92
  %95 = call noundef i32 @_ZNK6R2Grid11YResolutionEv(ptr noundef nonnull align 8 dereferenceable(208) %5)
  br label %.loopexit

.loopexit:                                        ; preds = %92, %94, %87, %.lr.ph125.split
  %96 = add nuw nsw i32 %.092124, 1
  %exitcond.not = icmp eq i32 %96, %3
  br i1 %exitcond.not, label %._crit_edge126, label %.lr.ph125.split, !llvm.loop !8

97:                                               ; preds = %._crit_edge126
  %98 = load double, ptr %75, align 8, !tbaa !10
  %99 = fdiv double %98, %19
  store double %99, ptr %75, align 8, !tbaa !10
  %100 = invoke noundef ptr @_ZN8R3MatrixixEi(ptr noundef nonnull align 8 dereferenceable(72) %1, i32 noundef 0)
          to label %101 unwind label %115

101:                                              ; preds = %97
  %102 = getelementptr inbounds i8, ptr %100, i64 16
  %103 = load double, ptr %102, align 8, !tbaa !10
  %104 = fdiv double %103, %19
  store double %104, ptr %102, align 8, !tbaa !10
  %105 = invoke noundef ptr @_ZN8R3MatrixixEi(ptr noundef nonnull align 8 dereferenceable(72) %1, i32 noundef 1)
          to label %106 unwind label %115

106:                                              ; preds = %101
  %107 = getelementptr inbounds i8, ptr %105, i64 8
  %108 = load double, ptr %107, align 8, !tbaa !10
  %109 = fdiv double %108, %23
  store double %109, ptr %107, align 8, !tbaa !10
  %110 = invoke noundef ptr @_ZN8R3MatrixixEi(ptr noundef nonnull align 8 dereferenceable(72) %1, i32 noundef 1)
          to label %111 unwind label %115

111:                                              ; preds = %106
  %112 = getelementptr inbounds i8, ptr %110, i64 16
  %113 = load double, ptr %112, align 8, !tbaa !10
  %114 = fdiv double %113, %23
  store double %114, ptr %112, align 8, !tbaa !10
  call void @_ZN6R2GridD1Ev(ptr noundef nonnull align 8 dereferenceable(208) %5) #8
  call void @llvm.lifetime.end.p0(i64 208, ptr nonnull %5) #8
  br label %118

115:                                              ; preds = %106, %101, %97, %._crit_edge126
  %116 = landingpad { ptr, i32 }
          cleanup
  br label %117

117:                                              ; preds = %.split138.us, %.split.split.us, %115, %80
  %.pn106.pn = phi { ptr, i32 } [ %116, %115 ], [ %.pn, %80 ], [ %73, %.split138.us ], [ %74, %.split.split.us ]
  call void @_ZN6R2GridD1Ev(ptr noundef nonnull align 8 dereferenceable(208) %5) #8
  call void @llvm.lifetime.end.p0(i64 208, ptr nonnull %5) #8
  resume { ptr, i32 } %.pn106.pn

118:                                              ; preds = %9, %12, %4, %111
  %.0 = phi i32 [ 1, %111 ], [ 0, %4 ], [ 0, %12 ], [ 0, %9 ]
  ret i32 %.0
}

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

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

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

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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { 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 = distinct !{!7, !6}
!8 = distinct !{!8, !6}
!9 = distinct !{!9, !6}
!10 = !{!11, !11, i64 0}
!11 = !{!"double", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}


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