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

; 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.R2Point = type { [2 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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6R2Grid21RasterizeGridTriangleEPKiS1_S1_dddi(ptr noundef nonnull align 8 dereferenceable(208) %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, double noundef %4, double noundef %5, double noundef %6, i32 noundef %7) #3 align 2 {
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca i32, align 4
  %17 = alloca [3 x %class.R2Point], align 16
  %18 = alloca [3 x double], align 16
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca double, align 8
  %23 = alloca double, align 8
  %24 = alloca double, align 8
  %25 = alloca double, align 8
  %26 = alloca double, align 8
  %27 = alloca double, align 8
  %28 = alloca double, align 8
  %29 = alloca double, align 8
  %30 = alloca double, align 8
  %31 = alloca double, align 8
  %32 = alloca double, align 8
  %33 = alloca double, align 8
  %34 = alloca double, align 8
  %35 = alloca double, align 8
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  %39 = alloca double, align 8
  %40 = alloca double, align 8
  %41 = alloca double, align 8
  %42 = alloca double, align 8
  %43 = alloca double, align 8
  %44 = alloca double, align 8
  %45 = alloca double, align 8
  %46 = alloca double, align 8
  %47 = alloca i32, align 4
  %48 = alloca i32, align 4
  %49 = alloca i32, align 4
  %50 = alloca i32, align 4
  %51 = alloca i32, align 4
  %52 = alloca double, align 8
  %53 = alloca double, align 8
  %54 = alloca i32, align 4
  %55 = alloca i32, align 4
  %56 = alloca i32, align 4
  %57 = alloca i32, align 4
  %58 = alloca i32, align 4
  %59 = alloca i32, align 4
  %60 = alloca double, align 8
  %61 = alloca double, align 8
  %62 = alloca i32, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !5
  store ptr %3, ptr %12, align 8, !tbaa !5
  store double %4, ptr %13, align 8, !tbaa !9
  store double %5, ptr %14, align 8, !tbaa !9
  store double %6, ptr %15, align 8, !tbaa !9
  store i32 %7, ptr %16, align 4, !tbaa !11
  %63 = load ptr, ptr %9, align 8
  %64 = load double, ptr %13, align 8, !tbaa !9
  %65 = fcmp oeq double %64, -3.210000e+02
  br i1 %65, label %66, label %67

66:                                               ; preds = %8
  br label %441

67:                                               ; preds = %8
  %68 = load double, ptr %14, align 8, !tbaa !9
  %69 = fcmp oeq double %68, -3.210000e+02
  br i1 %69, label %70, label %71

70:                                               ; preds = %67
  br label %441

71:                                               ; preds = %67
  %72 = load double, ptr %15, align 8, !tbaa !9
  %73 = fcmp oeq double %72, -3.210000e+02
  br i1 %73, label %74, label %75

74:                                               ; preds = %71
  br label %441

75:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 48, ptr %17) #6
  %76 = getelementptr inbounds [3 x %class.R2Point], ptr %17, i32 0, i32 0
  %77 = getelementptr inbounds %class.R2Point, ptr %76, i64 3
  br label %78

78:                                               ; preds = %78, %75
  %79 = phi ptr [ %76, %75 ], [ %80, %78 ]
  call void @_ZN7R2PointC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %79)
  %80 = getelementptr inbounds %class.R2Point, ptr %79, i64 1
  %81 = icmp eq ptr %80, %77
  br i1 %81, label %82, label %78

82:                                               ; preds = %78
  %83 = load ptr, ptr %10, align 8, !tbaa !5
  %84 = getelementptr inbounds i32, ptr %83, i64 0
  %85 = load i32, ptr %84, align 4, !tbaa !11
  %86 = sitofp i32 %85 to double
  %87 = getelementptr inbounds [3 x %class.R2Point], ptr %17, i64 0, i64 0
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %87, i32 noundef 0)
  store double %86, ptr %88, align 8, !tbaa !9
  %89 = load ptr, ptr %10, align 8, !tbaa !5
  %90 = getelementptr inbounds i32, ptr %89, i64 1
  %91 = load i32, ptr %90, align 4, !tbaa !11
  %92 = sitofp i32 %91 to double
  %93 = getelementptr inbounds [3 x %class.R2Point], ptr %17, i64 0, i64 0
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %93, i32 noundef 1)
  store double %92, ptr %94, align 8, !tbaa !9
  %95 = load ptr, ptr %11, align 8, !tbaa !5
  %96 = getelementptr inbounds i32, ptr %95, i64 0
  %97 = load i32, ptr %96, align 4, !tbaa !11
  %98 = sitofp i32 %97 to double
  %99 = getelementptr inbounds [3 x %class.R2Point], ptr %17, i64 0, i64 1
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %99, i32 noundef 0)
  store double %98, ptr %100, align 8, !tbaa !9
  %101 = load ptr, ptr %11, align 8, !tbaa !5
  %102 = getelementptr inbounds i32, ptr %101, i64 1
  %103 = load i32, ptr %102, align 4, !tbaa !11
  %104 = sitofp i32 %103 to double
  %105 = getelementptr inbounds [3 x %class.R2Point], ptr %17, i64 0, i64 1
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %105, i32 noundef 1)
  store double %104, ptr %106, align 8, !tbaa !9
  %107 = load ptr, ptr %12, align 8, !tbaa !5
  %108 = getelementptr inbounds i32, ptr %107, i64 0
  %109 = load i32, ptr %108, align 4, !tbaa !11
  %110 = sitofp i32 %109 to double
  %111 = getelementptr inbounds [3 x %class.R2Point], ptr %17, i64 0, i64 2
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %111, i32 noundef 0)
  store double %110, ptr %112, align 8, !tbaa !9
  %113 = load ptr, ptr %12, align 8, !tbaa !5
  %114 = getelementptr inbounds i32, ptr %113, i64 1
  %115 = load i32, ptr %114, align 4, !tbaa !11
  %116 = sitofp i32 %115 to double
  %117 = getelementptr inbounds [3 x %class.R2Point], ptr %17, i64 0, i64 2
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %117, i32 noundef 1)
  store double %116, ptr %118, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #6
  %119 = load double, ptr %13, align 8, !tbaa !9
  %120 = getelementptr inbounds [3 x double], ptr %18, i64 0, i64 0
  store double %119, ptr %120, align 16, !tbaa !9
  %121 = load double, ptr %14, align 8, !tbaa !9
  %122 = getelementptr inbounds [3 x double], ptr %18, i64 0, i64 1
  store double %121, ptr %122, align 8, !tbaa !9
  %123 = load double, ptr %15, align 8, !tbaa !9
  %124 = getelementptr inbounds [3 x double], ptr %18, i64 0, i64 2
  store double %123, ptr %124, align 16, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %125 = getelementptr inbounds [3 x %class.R2Point], ptr %17, i64 0, i64 0
  %126 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %125)
  %127 = getelementptr inbounds [3 x %class.R2Point], ptr %17, i64 0, i64 1
  %128 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %127)
  %129 = fcmp olt double %126, %128
  br i1 %129, label %130, label %147

130:                                              ; preds = %82
  %131 = getelementptr inbounds [3 x %class.R2Point], ptr %17, i64 0, i64 0
  %132 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %131)
  %133 = getelementptr inbounds [3 x %class.R2Point], ptr %17, i64 0, i64 2
  %134 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %133)
  %135 = fcmp olt double %132, %134
  br i1 %135, label %136, label %145

136:                                              ; preds = %130
  %137 = getelementptr inbounds [3 x %class.R2Point], ptr %17, i64 0, i64 1
  %138 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %137)
  %139 = getelementptr inbounds [3 x %class.R2Point], ptr %17, i64 0, i64 2
  %140 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %139)
  %141 = fcmp olt double %138, %140
  br i1 %141, label %142, label %143

142:                                              ; preds = %136
  store i32 0, ptr %19, align 4, !tbaa !11
  store i32 1, ptr %20, align 4, !tbaa !11
  store i32 2, ptr %21, align 4, !tbaa !11
  br label %144

143:                                              ; preds = %136
  store i32 0, ptr %19, align 4, !tbaa !11
  store i32 2, ptr %20, align 4, !tbaa !11
  store i32 1, ptr %21, align 4, !tbaa !11
  br label %144

144:                                              ; preds = %143, %142
  br label %146

145:                                              ; preds = %130
  store i32 2, ptr %19, align 4, !tbaa !11
  store i32 0, ptr %20, align 4, !tbaa !11
  store i32 1, ptr %21, align 4, !tbaa !11
  br label %146

146:                                              ; preds = %145, %144
  br label %164

147:                                              ; preds = %82
  %148 = getelementptr inbounds [3 x %class.R2Point], ptr %17, i64 0, i64 1
  %149 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %148)
  %150 = getelementptr inbounds [3 x %class.R2Point], ptr %17, i64 0, i64 2
  %151 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %150)
  %152 = fcmp olt double %149, %151
  br i1 %152, label %153, label %162

153:                                              ; preds = %147
  %154 = getelementptr inbounds [3 x %class.R2Point], ptr %17, i64 0, i64 0
  %155 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %154)
  %156 = getelementptr inbounds [3 x %class.R2Point], ptr %17, i64 0, i64 2
  %157 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %156)
  %158 = fcmp olt double %155, %157
  br i1 %158, label %159, label %160

159:                                              ; preds = %153
  store i32 1, ptr %19, align 4, !tbaa !11
  store i32 0, ptr %20, align 4, !tbaa !11
  store i32 2, ptr %21, align 4, !tbaa !11
  br label %161

160:                                              ; preds = %153
  store i32 1, ptr %19, align 4, !tbaa !11
  store i32 2, ptr %20, align 4, !tbaa !11
  store i32 0, ptr %21, align 4, !tbaa !11
  br label %161

161:                                              ; preds = %160, %159
  br label %163

162:                                              ; preds = %147
  store i32 2, ptr %19, align 4, !tbaa !11
  store i32 1, ptr %20, align 4, !tbaa !11
  store i32 0, ptr %21, align 4, !tbaa !11
  br label %163

163:                                              ; preds = %162, %161
  br label %164

164:                                              ; preds = %163, %146
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %165 = load i32, ptr %21, align 4, !tbaa !11
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [3 x %class.R2Point], ptr %17, i64 0, i64 %166
  %168 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %167)
  %169 = load i32, ptr %19, align 4, !tbaa !11
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [3 x %class.R2Point], ptr %17, i64 0, i64 %170
  %172 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %171)
  %173 = fsub double %168, %172
  store double %173, ptr %22, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %174 = load double, ptr %22, align 8, !tbaa !9
  %175 = fcmp ogt double %174, 0.000000e+00
  br i1 %175, label %176, label %188

176:                                              ; preds = %164
  %177 = load i32, ptr %20, align 4, !tbaa !11
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [3 x %class.R2Point], ptr %17, i64 0, i64 %178
  %180 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %179)
  %181 = load i32, ptr %19, align 4, !tbaa !11
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [3 x %class.R2Point], ptr %17, i64 0, i64 %182
  %184 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %183)
  %185 = fsub double %180, %184
  %186 = load double, ptr %22, align 8, !tbaa !9
  %187 = fdiv double %185, %186
  br label %189

188:                                              ; preds = %164
  br label %189

189:                                              ; preds = %188, %176
  %190 = phi double [ %187, %176 ], [ 0.000000e+00, %188 ]
  store double %190, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %191 = load i32, ptr %19, align 4, !tbaa !11
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [3 x %class.R2Point], ptr %17, i64 0, i64 %192
  %194 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %193)
  store double %194, ptr %24, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %195 = load i32, ptr %20, align 4, !tbaa !11
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [3 x %class.R2Point], ptr %17, i64 0, i64 %196
  %198 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %197)
  store double %198, ptr %25, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  %199 = load i32, ptr %21, align 4, !tbaa !11
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [3 x %class.R2Point], ptr %17, i64 0, i64 %200
  %202 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %201)
  store double %202, ptr %26, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #6
  %203 = load i32, ptr %19, align 4, !tbaa !11
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [3 x %class.R2Point], ptr %17, i64 0, i64 %204
  %206 = call noundef double @_ZNK7R2Point1XEv(ptr noundef nonnull align 8 dereferenceable(16) %205)
  store double %206, ptr %27, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #6
  %207 = load i32, ptr %21, align 4, !tbaa !11
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [3 x %class.R2Point], ptr %17, i64 0, i64 %208
  %210 = call noundef double @_ZNK7R2Point1XEv(ptr noundef nonnull align 8 dereferenceable(16) %209)
  store double %210, ptr %28, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #6
  %211 = load i32, ptr %20, align 4, !tbaa !11
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds [3 x %class.R2Point], ptr %17, i64 0, i64 %212
  %214 = call noundef double @_ZNK7R2Point1XEv(ptr noundef nonnull align 8 dereferenceable(16) %213)
  store double %214, ptr %29, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #6
  %215 = load double, ptr %23, align 8, !tbaa !9
  %216 = fsub double 1.000000e+00, %215
  %217 = load double, ptr %27, align 8, !tbaa !9
  %218 = load double, ptr %23, align 8, !tbaa !9
  %219 = load double, ptr %28, align 8, !tbaa !9
  %220 = fmul double %218, %219
  %221 = call double @llvm.fmuladd.f64(double %216, double %217, double %220)
  store double %221, ptr %30, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #6
  %222 = load i32, ptr %19, align 4, !tbaa !11
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [3 x double], ptr %18, i64 0, i64 %223
  %225 = load double, ptr %224, align 8, !tbaa !9
  store double %225, ptr %31, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #6
  %226 = load i32, ptr %21, align 4, !tbaa !11
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [3 x double], ptr %18, i64 0, i64 %227
  %229 = load double, ptr %228, align 8, !tbaa !9
  store double %229, ptr %32, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #6
  %230 = load i32, ptr %20, align 4, !tbaa !11
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [3 x double], ptr %18, i64 0, i64 %231
  %233 = load double, ptr %232, align 8, !tbaa !9
  store double %233, ptr %33, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #6
  %234 = load double, ptr %23, align 8, !tbaa !9
  %235 = fsub double 1.000000e+00, %234
  %236 = load double, ptr %31, align 8, !tbaa !9
  %237 = load double, ptr %23, align 8, !tbaa !9
  %238 = load double, ptr %32, align 8, !tbaa !9
  %239 = fmul double %237, %238
  %240 = call double @llvm.fmuladd.f64(double %235, double %236, double %239)
  store double %240, ptr %34, align 8, !tbaa !9
  %241 = load double, ptr %29, align 8, !tbaa !9
  %242 = load double, ptr %30, align 8, !tbaa !9
  %243 = fcmp ogt double %241, %242
  br i1 %243, label %244, label %251

244:                                              ; preds = %189
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #6
  %245 = load double, ptr %29, align 8, !tbaa !9
  store double %245, ptr %35, align 8, !tbaa !9
  %246 = load double, ptr %30, align 8, !tbaa !9
  store double %246, ptr %29, align 8, !tbaa !9
  %247 = load double, ptr %35, align 8, !tbaa !9
  store double %247, ptr %30, align 8, !tbaa !9
  %248 = load double, ptr %33, align 8, !tbaa !9
  store double %248, ptr %35, align 8, !tbaa !9
  %249 = load double, ptr %34, align 8, !tbaa !9
  store double %249, ptr %33, align 8, !tbaa !9
  %250 = load double, ptr %35, align 8, !tbaa !9
  store double %250, ptr %34, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #6
  br label %251

251:                                              ; preds = %244, %189
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #6
  %252 = load double, ptr %24, align 8, !tbaa !9
  %253 = fadd double %252, 5.000000e-01
  %254 = fptosi double %253 to i32
  store i32 %254, ptr %36, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #6
  %255 = load double, ptr %25, align 8, !tbaa !9
  %256 = fadd double %255, 5.000000e-01
  %257 = fptosi double %256 to i32
  store i32 %257, ptr %37, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #6
  %258 = load i32, ptr %37, align 4, !tbaa !11
  %259 = load i32, ptr %36, align 4, !tbaa !11
  %260 = sub nsw i32 %258, %259
  %261 = add nsw i32 %260, 1
  store i32 %261, ptr %38, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #6
  %262 = load double, ptr %29, align 8, !tbaa !9
  %263 = load double, ptr %27, align 8, !tbaa !9
  %264 = fsub double %262, %263
  %265 = load i32, ptr %38, align 4, !tbaa !11
  %266 = sitofp i32 %265 to double
  %267 = fdiv double %264, %266
  store double %267, ptr %39, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #6
  %268 = load double, ptr %30, align 8, !tbaa !9
  %269 = load double, ptr %27, align 8, !tbaa !9
  %270 = fsub double %268, %269
  %271 = load i32, ptr %38, align 4, !tbaa !11
  %272 = sitofp i32 %271 to double
  %273 = fdiv double %270, %272
  store double %273, ptr %40, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #6
  %274 = load double, ptr %33, align 8, !tbaa !9
  %275 = load double, ptr %31, align 8, !tbaa !9
  %276 = fsub double %274, %275
  %277 = load i32, ptr %38, align 4, !tbaa !11
  %278 = sitofp i32 %277 to double
  %279 = fdiv double %276, %278
  store double %279, ptr %41, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #6
  %280 = load double, ptr %34, align 8, !tbaa !9
  %281 = load double, ptr %31, align 8, !tbaa !9
  %282 = fsub double %280, %281
  %283 = load i32, ptr %38, align 4, !tbaa !11
  %284 = sitofp i32 %283 to double
  %285 = fdiv double %282, %284
  store double %285, ptr %42, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #6
  %286 = load double, ptr %27, align 8, !tbaa !9
  store double %286, ptr %43, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %44) #6
  %287 = load double, ptr %27, align 8, !tbaa !9
  store double %287, ptr %44, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %45) #6
  %288 = load double, ptr %31, align 8, !tbaa !9
  store double %288, ptr %45, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %46) #6
  %289 = load double, ptr %31, align 8, !tbaa !9
  store double %289, ptr %46, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %47) #6
  %290 = load i32, ptr %36, align 4, !tbaa !11
  store i32 %290, ptr %47, align 4, !tbaa !11
  br label %291

291:                                              ; preds = %344, %251
  %292 = load i32, ptr %47, align 4, !tbaa !11
  %293 = load i32, ptr %37, align 4, !tbaa !11
  %294 = icmp sle i32 %292, %293
  br i1 %294, label %296, label %295

295:                                              ; preds = %291
  store i32 2, ptr %48, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %47) #6
  br label %347

296:                                              ; preds = %291
  call void @llvm.lifetime.start.p0(i64 4, ptr %49) #6
  %297 = load double, ptr %43, align 8, !tbaa !9
  %298 = fadd double %297, 5.000000e-01
  %299 = fptosi double %298 to i32
  store i32 %299, ptr %49, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %50) #6
  %300 = load double, ptr %44, align 8, !tbaa !9
  %301 = fadd double %300, 5.000000e-01
  %302 = fptosi double %301 to i32
  store i32 %302, ptr %50, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %51) #6
  %303 = load i32, ptr %50, align 4, !tbaa !11
  %304 = load i32, ptr %49, align 4, !tbaa !11
  %305 = sub nsw i32 %303, %304
  %306 = add nsw i32 %305, 1
  store i32 %306, ptr %51, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %52) #6
  %307 = load double, ptr %46, align 8, !tbaa !9
  %308 = load double, ptr %45, align 8, !tbaa !9
  %309 = fsub double %307, %308
  %310 = load i32, ptr %51, align 4, !tbaa !11
  %311 = sitofp i32 %310 to double
  %312 = fdiv double %309, %311
  store double %312, ptr %52, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %53) #6
  %313 = load double, ptr %45, align 8, !tbaa !9
  store double %313, ptr %53, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %54) #6
  %314 = load i32, ptr %49, align 4, !tbaa !11
  store i32 %314, ptr %54, align 4, !tbaa !11
  br label %315

315:                                              ; preds = %328, %296
  %316 = load i32, ptr %54, align 4, !tbaa !11
  %317 = load i32, ptr %50, align 4, !tbaa !11
  %318 = icmp sle i32 %316, %317
  br i1 %318, label %320, label %319

319:                                              ; preds = %315
  store i32 5, ptr %48, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %54) #6
  br label %331

320:                                              ; preds = %315
  %321 = load i32, ptr %54, align 4, !tbaa !11
  %322 = load i32, ptr %47, align 4, !tbaa !11
  %323 = load double, ptr %53, align 8, !tbaa !9
  %324 = load i32, ptr %16, align 4, !tbaa !11
  call void @_ZN6R2Grid18RasterizeGridValueEiidi(ptr noundef nonnull align 8 dereferenceable(208) %63, i32 noundef %321, i32 noundef %322, double noundef %323, i32 noundef %324)
  %325 = load double, ptr %52, align 8, !tbaa !9
  %326 = load double, ptr %53, align 8, !tbaa !9
  %327 = fadd double %326, %325
  store double %327, ptr %53, align 8, !tbaa !9
  br label %328

328:                                              ; preds = %320
  %329 = load i32, ptr %54, align 4, !tbaa !11
  %330 = add nsw i32 %329, 1
  store i32 %330, ptr %54, align 4, !tbaa !11
  br label %315, !llvm.loop !13

331:                                              ; preds = %319
  %332 = load double, ptr %41, align 8, !tbaa !9
  %333 = load double, ptr %45, align 8, !tbaa !9
  %334 = fadd double %333, %332
  store double %334, ptr %45, align 8, !tbaa !9
  %335 = load double, ptr %42, align 8, !tbaa !9
  %336 = load double, ptr %46, align 8, !tbaa !9
  %337 = fadd double %336, %335
  store double %337, ptr %46, align 8, !tbaa !9
  %338 = load double, ptr %39, align 8, !tbaa !9
  %339 = load double, ptr %43, align 8, !tbaa !9
  %340 = fadd double %339, %338
  store double %340, ptr %43, align 8, !tbaa !9
  %341 = load double, ptr %40, align 8, !tbaa !9
  %342 = load double, ptr %44, align 8, !tbaa !9
  %343 = fadd double %342, %341
  store double %343, ptr %44, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %53) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %52) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %51) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %50) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %49) #6
  br label %344

344:                                              ; preds = %331
  %345 = load i32, ptr %47, align 4, !tbaa !11
  %346 = add nsw i32 %345, 1
  store i32 %346, ptr %47, align 4, !tbaa !11
  br label %291, !llvm.loop !15

347:                                              ; preds = %295
  call void @llvm.lifetime.start.p0(i64 4, ptr %55) #6
  %348 = load double, ptr %26, align 8, !tbaa !9
  %349 = fadd double %348, 5.000000e-01
  %350 = fptosi double %349 to i32
  store i32 %350, ptr %55, align 4, !tbaa !11
  %351 = load i32, ptr %55, align 4, !tbaa !11
  %352 = load i32, ptr %37, align 4, !tbaa !11
  %353 = sub nsw i32 %351, %352
  %354 = add nsw i32 %353, 1
  store i32 %354, ptr %38, align 4, !tbaa !11
  %355 = load double, ptr %28, align 8, !tbaa !9
  %356 = load double, ptr %29, align 8, !tbaa !9
  %357 = fsub double %355, %356
  %358 = load i32, ptr %38, align 4, !tbaa !11
  %359 = sitofp i32 %358 to double
  %360 = fdiv double %357, %359
  store double %360, ptr %39, align 8, !tbaa !9
  %361 = load double, ptr %28, align 8, !tbaa !9
  %362 = load double, ptr %30, align 8, !tbaa !9
  %363 = fsub double %361, %362
  %364 = load i32, ptr %38, align 4, !tbaa !11
  %365 = sitofp i32 %364 to double
  %366 = fdiv double %363, %365
  store double %366, ptr %40, align 8, !tbaa !9
  %367 = load double, ptr %32, align 8, !tbaa !9
  %368 = load double, ptr %33, align 8, !tbaa !9
  %369 = fsub double %367, %368
  %370 = load i32, ptr %38, align 4, !tbaa !11
  %371 = sitofp i32 %370 to double
  %372 = fdiv double %369, %371
  store double %372, ptr %41, align 8, !tbaa !9
  %373 = load double, ptr %32, align 8, !tbaa !9
  %374 = load double, ptr %34, align 8, !tbaa !9
  %375 = fsub double %373, %374
  %376 = load i32, ptr %38, align 4, !tbaa !11
  %377 = sitofp i32 %376 to double
  %378 = fdiv double %375, %377
  store double %378, ptr %42, align 8, !tbaa !9
  %379 = load double, ptr %29, align 8, !tbaa !9
  store double %379, ptr %43, align 8, !tbaa !9
  %380 = load double, ptr %30, align 8, !tbaa !9
  store double %380, ptr %44, align 8, !tbaa !9
  %381 = load double, ptr %33, align 8, !tbaa !9
  store double %381, ptr %45, align 8, !tbaa !9
  %382 = load double, ptr %34, align 8, !tbaa !9
  store double %382, ptr %46, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %56) #6
  %383 = load i32, ptr %37, align 4, !tbaa !11
  store i32 %383, ptr %56, align 4, !tbaa !11
  br label %384

384:                                              ; preds = %437, %347
  %385 = load i32, ptr %56, align 4, !tbaa !11
  %386 = load i32, ptr %55, align 4, !tbaa !11
  %387 = icmp sle i32 %385, %386
  br i1 %387, label %389, label %388

388:                                              ; preds = %384
  store i32 8, ptr %48, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %56) #6
  br label %440

389:                                              ; preds = %384
  call void @llvm.lifetime.start.p0(i64 4, ptr %57) #6
  %390 = load double, ptr %43, align 8, !tbaa !9
  %391 = fadd double %390, 5.000000e-01
  %392 = fptosi double %391 to i32
  store i32 %392, ptr %57, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %58) #6
  %393 = load double, ptr %44, align 8, !tbaa !9
  %394 = fadd double %393, 5.000000e-01
  %395 = fptosi double %394 to i32
  store i32 %395, ptr %58, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %59) #6
  %396 = load i32, ptr %58, align 4, !tbaa !11
  %397 = load i32, ptr %57, align 4, !tbaa !11
  %398 = sub nsw i32 %396, %397
  %399 = add nsw i32 %398, 1
  store i32 %399, ptr %59, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %60) #6
  %400 = load double, ptr %46, align 8, !tbaa !9
  %401 = load double, ptr %45, align 8, !tbaa !9
  %402 = fsub double %400, %401
  %403 = load i32, ptr %59, align 4, !tbaa !11
  %404 = sitofp i32 %403 to double
  %405 = fdiv double %402, %404
  store double %405, ptr %60, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %61) #6
  %406 = load double, ptr %45, align 8, !tbaa !9
  store double %406, ptr %61, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %62) #6
  %407 = load i32, ptr %57, align 4, !tbaa !11
  store i32 %407, ptr %62, align 4, !tbaa !11
  br label %408

408:                                              ; preds = %421, %389
  %409 = load i32, ptr %62, align 4, !tbaa !11
  %410 = load i32, ptr %58, align 4, !tbaa !11
  %411 = icmp sle i32 %409, %410
  br i1 %411, label %413, label %412

412:                                              ; preds = %408
  store i32 11, ptr %48, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %62) #6
  br label %424

413:                                              ; preds = %408
  %414 = load i32, ptr %62, align 4, !tbaa !11
  %415 = load i32, ptr %56, align 4, !tbaa !11
  %416 = load double, ptr %61, align 8, !tbaa !9
  %417 = load i32, ptr %16, align 4, !tbaa !11
  call void @_ZN6R2Grid18RasterizeGridValueEiidi(ptr noundef nonnull align 8 dereferenceable(208) %63, i32 noundef %414, i32 noundef %415, double noundef %416, i32 noundef %417)
  %418 = load double, ptr %60, align 8, !tbaa !9
  %419 = load double, ptr %61, align 8, !tbaa !9
  %420 = fadd double %419, %418
  store double %420, ptr %61, align 8, !tbaa !9
  br label %421

421:                                              ; preds = %413
  %422 = load i32, ptr %62, align 4, !tbaa !11
  %423 = add nsw i32 %422, 1
  store i32 %423, ptr %62, align 4, !tbaa !11
  br label %408, !llvm.loop !16

424:                                              ; preds = %412
  %425 = load double, ptr %41, align 8, !tbaa !9
  %426 = load double, ptr %45, align 8, !tbaa !9
  %427 = fadd double %426, %425
  store double %427, ptr %45, align 8, !tbaa !9
  %428 = load double, ptr %42, align 8, !tbaa !9
  %429 = load double, ptr %46, align 8, !tbaa !9
  %430 = fadd double %429, %428
  store double %430, ptr %46, align 8, !tbaa !9
  %431 = load double, ptr %39, align 8, !tbaa !9
  %432 = load double, ptr %43, align 8, !tbaa !9
  %433 = fadd double %432, %431
  store double %433, ptr %43, align 8, !tbaa !9
  %434 = load double, ptr %40, align 8, !tbaa !9
  %435 = load double, ptr %44, align 8, !tbaa !9
  %436 = fadd double %435, %434
  store double %436, ptr %44, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %61) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %60) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %59) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %58) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %57) #6
  br label %437

437:                                              ; preds = %424
  %438 = load i32, ptr %56, align 4, !tbaa !11
  %439 = add nsw i32 %438, 1
  store i32 %439, ptr %56, align 4, !tbaa !11
  br label %384, !llvm.loop !17

440:                                              ; preds = %388
  call void @llvm.lifetime.end.p0(i64 4, ptr %55) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %17) #6
  br label %441

441:                                              ; preds = %440, %74, %70, %66
  ret void
}

declare void @_ZN7R2PointC1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4

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

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

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

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

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


; 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.R2Point = type { [2 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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6R2Grid21RasterizeGridTriangleEPKiS1_S1_dddi(ptr noundef nonnull align 8 dereferenceable(208) %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, ptr nocapture noundef readonly %3, double noundef %4, double noundef %5, double noundef %6, i32 noundef %7) local_unnamed_addr #2 align 2 {
  %9 = alloca [3 x %class.R2Point], align 16
  %10 = alloca [3 x double], align 16
  %11 = fcmp oeq double %4, -3.210000e+02
  %12 = fcmp oeq double %5, -3.210000e+02
  %or.cond = or i1 %11, %12
  %13 = fcmp oeq double %6, -3.210000e+02
  %or.cond3 = or i1 %or.cond, %13
  %.0146.sroa.gep180 = getelementptr inbounds i8, ptr %10, i64 16
  %.0146.sroa.gep181 = getelementptr inbounds i8, ptr %10, i64 8
  %.0146.sroa.gep185 = getelementptr inbounds i8, ptr %9, i64 32
  %.0146.sroa.gep186 = getelementptr inbounds i8, ptr %9, i64 16
  br i1 %or.cond3, label %158, label %14

14:                                               ; preds = %8
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %9) #6
  call void @_ZN7R2PointC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %9)
  call void @_ZN7R2PointC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %.0146.sroa.gep186)
  call void @_ZN7R2PointC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %.0146.sroa.gep185)
  %15 = load i32, ptr %1, align 4, !tbaa !5
  %16 = sitofp i32 %15 to double
  %17 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %9, i32 noundef 0)
  store double %16, ptr %17, align 8, !tbaa !9
  %18 = getelementptr inbounds i8, ptr %1, i64 4
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %20 = sitofp i32 %19 to double
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %9, i32 noundef 1)
  store double %20, ptr %21, align 8, !tbaa !9
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sitofp i32 %22 to double
  %24 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %.0146.sroa.gep186, i32 noundef 0)
  store double %23, ptr %24, align 8, !tbaa !9
  %25 = getelementptr inbounds i8, ptr %2, i64 4
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = sitofp i32 %26 to double
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %.0146.sroa.gep186, i32 noundef 1)
  store double %27, ptr %28, align 8, !tbaa !9
  %29 = load i32, ptr %3, align 4, !tbaa !5
  %30 = sitofp i32 %29 to double
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %.0146.sroa.gep185, i32 noundef 0)
  store double %30, ptr %31, align 8, !tbaa !9
  %32 = getelementptr inbounds i8, ptr %3, i64 4
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = sitofp i32 %33 to double
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %.0146.sroa.gep185, i32 noundef 1)
  store double %34, ptr %35, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #6
  store double %4, ptr %10, align 16, !tbaa !9
  store double %5, ptr %.0146.sroa.gep181, align 8, !tbaa !9
  store double %6, ptr %.0146.sroa.gep180, align 16, !tbaa !9
  %36 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
  %37 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %.0146.sroa.gep186)
  %38 = fcmp olt double %36, %37
  br i1 %38, label %39, label %43

39:                                               ; preds = %14
  %40 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
  %41 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %.0146.sroa.gep185)
  %42 = fcmp olt double %40, %41
  br i1 %42, label %.sink.split, label %50

43:                                               ; preds = %14
  %44 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %.0146.sroa.gep186)
  %45 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %.0146.sroa.gep185)
  %46 = fcmp olt double %44, %45
  br i1 %46, label %.sink.split, label %50

.sink.split:                                      ; preds = %43, %39
  %.sink = phi ptr [ %.0146.sroa.gep186, %39 ], [ %9, %43 ]
  %.sink226 = phi i64 [ 1, %39 ], [ 0, %43 ]
  %.0146.sroa.phi.ph = phi ptr [ %10, %39 ], [ %.0146.sroa.gep181, %43 ]
  %.0146.sroa.phi183.ph = phi ptr [ %9, %39 ], [ %.0146.sroa.gep186, %43 ]
  %47 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %.sink)
  %48 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %.0146.sroa.gep185)
  %49 = fcmp olt double %47, %48
  %.178 = select i1 %49, i64 2, i64 %.sink226
  %.179 = select i1 %49, i64 %.sink226, i64 2
  br label %50

50:                                               ; preds = %.sink.split, %43, %39
  %.0148 = phi i64 [ 1, %39 ], [ 0, %43 ], [ %.178, %.sink.split ]
  %.0147 = phi i64 [ 0, %39 ], [ 1, %43 ], [ %.179, %.sink.split ]
  %.0146.sroa.phi = phi ptr [ %.0146.sroa.gep180, %39 ], [ %.0146.sroa.gep180, %43 ], [ %.0146.sroa.phi.ph, %.sink.split ]
  %.0146.sroa.phi183 = phi ptr [ %.0146.sroa.gep185, %39 ], [ %.0146.sroa.gep185, %43 ], [ %.0146.sroa.phi183.ph, %.sink.split ]
  %51 = getelementptr inbounds [3 x %class.R2Point], ptr %9, i64 0, i64 %.0148
  %52 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %51)
  %53 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %.0146.sroa.phi183)
  %54 = fsub double %52, %53
  %55 = fcmp ogt double %54, 0.000000e+00
  br i1 %55, label %56, label %62

56:                                               ; preds = %50
  %57 = getelementptr inbounds [3 x %class.R2Point], ptr %9, i64 0, i64 %.0147
  %58 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %57)
  %59 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %.0146.sroa.phi183)
  %60 = fsub double %58, %59
  %61 = fdiv double %60, %54
  br label %62

62:                                               ; preds = %50, %56
  %63 = phi double [ %61, %56 ], [ 0.000000e+00, %50 ]
  %64 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %.0146.sroa.phi183)
  %65 = getelementptr inbounds [3 x %class.R2Point], ptr %9, i64 0, i64 %.0147
  %66 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %65)
  %67 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %51)
  %68 = call noundef double @_ZNK7R2Point1XEv(ptr noundef nonnull align 8 dereferenceable(16) %.0146.sroa.phi183)
  %69 = call noundef double @_ZNK7R2Point1XEv(ptr noundef nonnull align 8 dereferenceable(16) %51)
  %70 = call noundef double @_ZNK7R2Point1XEv(ptr noundef nonnull align 8 dereferenceable(16) %65)
  %71 = fsub double 1.000000e+00, %63
  %72 = load double, ptr %.0146.sroa.phi, align 8, !tbaa !9
  %73 = getelementptr inbounds [3 x double], ptr %10, i64 0, i64 %.0148
  %74 = load double, ptr %73, align 8, !tbaa !9
  %75 = getelementptr inbounds [3 x double], ptr %10, i64 0, i64 %.0147
  %76 = load double, ptr %75, align 8, !tbaa !9
  %77 = insertelement <2 x double> poison, double %63, i64 0
  %78 = shufflevector <2 x double> %77, <2 x double> poison, <2 x i32> zeroinitializer
  %79 = insertelement <2 x double> poison, double %69, i64 0
  %80 = insertelement <2 x double> %79, double %74, i64 1
  %81 = fmul <2 x double> %78, %80
  %82 = insertelement <2 x double> poison, double %71, i64 0
  %83 = shufflevector <2 x double> %82, <2 x double> poison, <2 x i32> zeroinitializer
  %84 = insertelement <2 x double> poison, double %68, i64 0
  %85 = insertelement <2 x double> %84, double %72, i64 1
  %86 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %83, <2 x double> %85, <2 x double> %81)
  %87 = extractelement <2 x double> %86, i64 0
  %88 = fcmp ogt double %70, %87
  %89 = shufflevector <2 x double> %86, <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
  %90 = insertelement <4 x double> %89, double %76, i64 2
  %91 = insertelement <4 x double> %90, double %70, i64 3
  %92 = shufflevector <4 x double> %91, <4 x double> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %93 = select i1 %88, <4 x double> %92, <4 x double> %91
  %94 = shufflevector <4 x double> %93, <4 x double> poison, <4 x i32> <i32 1, i32 0, i32 3, i32 2>
  %95 = insertelement <2 x double> poison, double %66, i64 0
  %96 = insertelement <2 x double> %95, double %64, i64 1
  %97 = fadd <2 x double> %96, <double 5.000000e-01, double 5.000000e-01>
  %98 = fptosi <2 x double> %97 to <2 x i32>
  %99 = extractelement <2 x i32> %98, i64 0
  %100 = extractelement <2 x i32> %98, i64 1
  %reass.sub = sub i32 %99, %100
  %101 = add i32 %reass.sub, 1
  %102 = sitofp i32 %101 to double
  %103 = shufflevector <4 x double> %93, <4 x double> poison, <2 x i32> <i32 0, i32 3>
  %104 = shufflevector <2 x double> %84, <2 x double> poison, <2 x i32> zeroinitializer
  %105 = fsub <2 x double> %103, %104
  %106 = insertelement <2 x double> poison, double %102, i64 0
  %107 = shufflevector <2 x double> %106, <2 x double> poison, <2 x i32> zeroinitializer
  %108 = fdiv <2 x double> %105, %107
  %109 = shufflevector <4 x double> %93, <4 x double> poison, <2 x i32> <i32 1, i32 2>
  %110 = insertelement <2 x double> poison, double %72, i64 0
  %111 = shufflevector <2 x double> %110, <2 x double> poison, <2 x i32> zeroinitializer
  %112 = fsub <2 x double> %109, %111
  %113 = fdiv <2 x double> %112, %107
  %.not194 = icmp sgt i32 %100, %99
  br i1 %.not194, label %._crit_edge202, label %.lr.ph201

._crit_edge202:                                   ; preds = %._crit_edge, %62
  %114 = fadd double %67, 5.000000e-01
  %115 = fptosi double %114 to i32
  %reass.sub219 = sub i32 %115, %99
  %116 = add i32 %reass.sub219, 1
  %117 = insertelement <4 x double> poison, double %74, i64 0
  %118 = insertelement <4 x double> %117, double %69, i64 1
  %119 = shufflevector <4 x double> %118, <4 x double> poison, <4 x i32> <i32 0, i32 1, i32 1, i32 0>
  %120 = fsub <4 x double> %119, %94
  %121 = sitofp i32 %116 to double
  %122 = insertelement <4 x double> poison, double %121, i64 0
  %123 = shufflevector <4 x double> %122, <4 x double> poison, <4 x i32> zeroinitializer
  %124 = fdiv <4 x double> %120, %123
  %.not174209 = icmp sgt i32 %99, %115
  br i1 %.not174209, label %._crit_edge217, label %.lr.ph216

.lr.ph201:                                        ; preds = %62, %._crit_edge
  %.0156199 = phi i32 [ %139, %._crit_edge ], [ %100, %62 ]
  %125 = phi <2 x double> [ %137, %._crit_edge ], [ %111, %62 ]
  %126 = phi <2 x double> [ %138, %._crit_edge ], [ %104, %62 ]
  %127 = fadd <2 x double> %126, <double 5.000000e-01, double 5.000000e-01>
  %128 = fptosi <2 x double> %127 to <2 x i32>
  %129 = extractelement <2 x i32> %128, i64 0
  %130 = extractelement <2 x i32> %128, i64 1
  %reass.sub218 = sub i32 %129, %130
  %131 = add i32 %reass.sub218, 1
  %132 = extractelement <2 x double> %125, i64 0
  %133 = extractelement <2 x double> %125, i64 1
  %134 = fsub double %132, %133
  %135 = sitofp i32 %131 to double
  %136 = fdiv double %134, %135
  %.not176191 = icmp sgt i32 %130, %129
  br i1 %.not176191, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph201
  %137 = fadd <2 x double> %113, %125
  %138 = fadd <2 x double> %108, %126
  %139 = add i32 %.0156199, 1
  %exitcond221.not = icmp eq i32 %.0156199, %99
  br i1 %exitcond221.not, label %._crit_edge202, label %.lr.ph201, !llvm.loop !11

.lr.ph:                                           ; preds = %.lr.ph201, %.lr.ph
  %.0152193 = phi i32 [ %141, %.lr.ph ], [ %130, %.lr.ph201 ]
  %.0153192 = phi double [ %140, %.lr.ph ], [ %133, %.lr.ph201 ]
  call void @_ZN6R2Grid18RasterizeGridValueEiidi(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %.0152193, i32 noundef %.0156199, double noundef %.0153192, i32 noundef %7)
  %140 = fadd double %136, %.0153192
  %141 = add i32 %.0152193, 1
  %exitcond.not = icmp eq i32 %.0152193, %129
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !13

._crit_edge217:                                   ; preds = %._crit_edge208, %._crit_edge202
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %9) #6
  br label %158

.lr.ph216:                                        ; preds = %._crit_edge202, %._crit_edge208
  %.0150214 = phi i32 [ %155, %._crit_edge208 ], [ %99, %._crit_edge202 ]
  %142 = phi <4 x double> [ %154, %._crit_edge208 ], [ %94, %._crit_edge202 ]
  %143 = shufflevector <4 x double> %142, <4 x double> poison, <2 x i32> <i32 1, i32 2>
  %144 = fadd <2 x double> %143, <double 5.000000e-01, double 5.000000e-01>
  %145 = fptosi <2 x double> %144 to <2 x i32>
  %146 = extractelement <2 x i32> %145, i64 0
  %147 = extractelement <2 x i32> %145, i64 1
  %reass.sub220 = sub i32 %146, %147
  %148 = add i32 %reass.sub220, 1
  %149 = extractelement <4 x double> %142, i64 0
  %150 = extractelement <4 x double> %142, i64 3
  %151 = fsub double %149, %150
  %152 = sitofp i32 %148 to double
  %153 = fdiv double %151, %152
  %.not175203 = icmp sgt i32 %147, %146
  br i1 %.not175203, label %._crit_edge208, label %.lr.ph207

._crit_edge208:                                   ; preds = %.lr.ph207, %.lr.ph216
  %154 = fadd <4 x double> %124, %142
  %155 = add i32 %.0150214, 1
  %exitcond223.not = icmp eq i32 %.0150214, %115
  br i1 %exitcond223.not, label %._crit_edge217, label %.lr.ph216, !llvm.loop !14

.lr.ph207:                                        ; preds = %.lr.ph216, %.lr.ph207
  %.0205 = phi i32 [ %157, %.lr.ph207 ], [ %147, %.lr.ph216 ]
  %.0145204 = phi double [ %156, %.lr.ph207 ], [ %150, %.lr.ph216 ]
  call void @_ZN6R2Grid18RasterizeGridValueEiidi(ptr noundef nonnull align 8 dereferenceable(208) %0, i32 noundef %.0205, i32 noundef %.0150214, double noundef %.0145204, i32 noundef %7)
  %156 = fadd double %153, %.0145204
  %157 = add i32 %.0205, 1
  %exitcond222.not = icmp eq i32 %.0205, %146
  br i1 %exitcond222.not, label %._crit_edge208, label %.lr.ph207, !llvm.loop !15

158:                                              ; preds = %8, %._crit_edge217
  ret void
}

declare void @_ZN7R2PointC1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #5

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalDCEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass