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

; 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.R2Diad = type { [2 x %class.R2Vector] }
%class.R2Vector = type { [2 x double] }
%class.R2Point = type { [2 x double] }
%class.R2Grid = type { %class.R2Affine, %class.R2Affine, double, ptr, [2 x i32], i32, i32 }
%class.R2Affine = type <{ %class.R2Transformation, %class.R3Matrix, i32, [4 x i8] }>
%class.R2Transformation = type { ptr }
%class.R3Matrix = type { [3 x [3 x double]] }

@.str = external hidden unnamed_addr constant [41 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [88 x i8], align 1
@R2xy_diad = external global %class.R2Diad, align 8
@RN_PI_OVER_TWO = external constant double, align 8
@RN_BIG_EPSILON = external global double, align 8
@.str.3 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [47 x i8], align 1

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6R2Grid12GridCentroidEv(ptr dead_on_unwind noalias writable sret(%class.R2Point) align 8, ptr noundef nonnull align 8 dereferenceable(208)) #4 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK6R2Grid17GridPrincipleAxesEPK7R2PointPd(ptr dead_on_unwind noalias writable sret(%class.R2Diad) align 8 %0, ptr noundef nonnull align 8 dereferenceable(208) %1, ptr noundef %2, ptr noundef %3) #4 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %class.R2Point, align 8
  %10 = alloca [4 x double], align 16
  %11 = alloca double, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %class.R2Point, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca i32, align 4
  %21 = alloca [4 x double], align 16
  %22 = alloca [2 x double], align 16
  %23 = alloca [4 x double], align 16
  %24 = alloca [3 x %class.R2Vector], align 16
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca double, align 8
  %28 = alloca double, align 8
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca %class.R2Point, align 8
  %32 = alloca double, align 8
  %33 = alloca %class.R2Vector, align 8
  %34 = alloca double, align 8
  store ptr %0, ptr %5, align 8
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  %35 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #6
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = icmp ne ptr %36, null
  br i1 %37, label %38, label %40

38:                                               ; preds = %4
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN7R2PointC1ERKS_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %39)
  br label %41

40:                                               ; preds = %4
  call void @_ZNK6R2Grid12GridCentroidEv(ptr dead_on_unwind writable sret(%class.R2Point) align 8 %9, ptr noundef nonnull align 8 dereferenceable(208) %35)
  br label %41

41:                                               ; preds = %40, %38
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #6
  call void @llvm.memset.p0.i64(ptr align 16 %10, i8 0, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store double 0.000000e+00, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %42 = getelementptr inbounds %class.R2Grid, ptr %35, i32 0, i32 3
  %43 = load ptr, ptr %42, align 8, !tbaa !11
  store ptr %43, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !17
  br label %44

44:                                               ; preds = %112, %41
  %45 = load i32, ptr %13, align 4, !tbaa !17
  %46 = getelementptr inbounds %class.R2Grid, ptr %35, i32 0, i32 4
  %47 = getelementptr inbounds [2 x i32], ptr %46, i64 0, i64 1
  %48 = load i32, ptr %47, align 4, !tbaa !17
  %49 = icmp slt i32 %45, %48
  br i1 %49, label %51, label %50

50:                                               ; preds = %44
  store i32 2, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %115

51:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !17
  br label %52

52:                                               ; preds = %108, %51
  %53 = load i32, ptr %15, align 4, !tbaa !17
  %54 = getelementptr inbounds %class.R2Grid, ptr %35, i32 0, i32 4
  %55 = getelementptr inbounds [2 x i32], ptr %54, i64 0, i64 0
  %56 = load i32, ptr %55, align 8, !tbaa !17
  %57 = icmp slt i32 %53, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %52
  store i32 5, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %111

59:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #6
  %60 = load i32, ptr %15, align 4, !tbaa !17
  %61 = sitofp i32 %60 to double
  %62 = load i32, ptr %13, align 4, !tbaa !17
  %63 = sitofp i32 %62 to double
  call void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %16, double noundef %61, double noundef %63)
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %64 = load ptr, ptr %12, align 8, !tbaa !5
  %65 = getelementptr inbounds double, ptr %64, i32 1
  store ptr %65, ptr %12, align 8, !tbaa !5
  %66 = load double, ptr %64, align 8, !tbaa !9
  store double %66, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %16, i32 noundef 0)
  %68 = load double, ptr %67, align 8, !tbaa !9
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %9, i32 noundef 0)
  %70 = load double, ptr %69, align 8, !tbaa !9
  %71 = fsub double %68, %70
  store double %71, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %16, i32 noundef 1)
  %73 = load double, ptr %72, align 8, !tbaa !9
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %9, i32 noundef 1)
  %75 = load double, ptr %74, align 8, !tbaa !9
  %76 = fsub double %73, %75
  store double %76, ptr %19, align 8, !tbaa !9
  %77 = load double, ptr %17, align 8, !tbaa !9
  %78 = load double, ptr %18, align 8, !tbaa !9
  %79 = fmul double %77, %78
  %80 = load double, ptr %18, align 8, !tbaa !9
  %81 = getelementptr inbounds [4 x double], ptr %10, i64 0, i64 0
  %82 = load double, ptr %81, align 16, !tbaa !9
  %83 = call double @llvm.fmuladd.f64(double %79, double %80, double %82)
  store double %83, ptr %81, align 16, !tbaa !9
  %84 = load double, ptr %17, align 8, !tbaa !9
  %85 = load double, ptr %18, align 8, !tbaa !9
  %86 = fmul double %84, %85
  %87 = load double, ptr %19, align 8, !tbaa !9
  %88 = getelementptr inbounds [4 x double], ptr %10, i64 0, i64 1
  %89 = load double, ptr %88, align 8, !tbaa !9
  %90 = call double @llvm.fmuladd.f64(double %86, double %87, double %89)
  store double %90, ptr %88, align 8, !tbaa !9
  %91 = load double, ptr %17, align 8, !tbaa !9
  %92 = load double, ptr %18, align 8, !tbaa !9
  %93 = fmul double %91, %92
  %94 = load double, ptr %19, align 8, !tbaa !9
  %95 = getelementptr inbounds [4 x double], ptr %10, i64 0, i64 2
  %96 = load double, ptr %95, align 16, !tbaa !9
  %97 = call double @llvm.fmuladd.f64(double %93, double %94, double %96)
  store double %97, ptr %95, align 16, !tbaa !9
  %98 = load double, ptr %17, align 8, !tbaa !9
  %99 = load double, ptr %19, align 8, !tbaa !9
  %100 = fmul double %98, %99
  %101 = load double, ptr %19, align 8, !tbaa !9
  %102 = getelementptr inbounds [4 x double], ptr %10, i64 0, i64 3
  %103 = load double, ptr %102, align 8, !tbaa !9
  %104 = call double @llvm.fmuladd.f64(double %100, double %101, double %103)
  store double %104, ptr %102, align 8, !tbaa !9
  %105 = load double, ptr %17, align 8, !tbaa !9
  %106 = load double, ptr %11, align 8, !tbaa !9
  %107 = fadd double %106, %105
  store double %107, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #6
  br label %108

108:                                              ; preds = %59
  %109 = load i32, ptr %15, align 4, !tbaa !17
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %15, align 4, !tbaa !17
  br label %52, !llvm.loop !18

111:                                              ; preds = %58
  br label %112

112:                                              ; preds = %111
  %113 = load i32, ptr %13, align 4, !tbaa !17
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %13, align 4, !tbaa !17
  br label %44, !llvm.loop !20

115:                                              ; preds = %50
  %116 = load double, ptr %11, align 8, !tbaa !9
  %117 = fcmp oeq double %116, 0.000000e+00
  br i1 %117, label %118, label %119

118:                                              ; preds = %115
  call void @_ZN6R2DiadC1ERKS_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) @R2xy_diad)
  store i32 1, ptr %14, align 4
  br label %269

119:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  store i32 0, ptr %20, align 4, !tbaa !17
  br label %120

120:                                              ; preds = %131, %119
  %121 = load i32, ptr %20, align 4, !tbaa !17
  %122 = icmp slt i32 %121, 4
  br i1 %122, label %124, label %123

123:                                              ; preds = %120
  store i32 8, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %134

124:                                              ; preds = %120
  %125 = load double, ptr %11, align 8, !tbaa !9
  %126 = load i32, ptr %20, align 4, !tbaa !17
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [4 x double], ptr %10, i64 0, i64 %127
  %129 = load double, ptr %128, align 8, !tbaa !9
  %130 = fdiv double %129, %125
  store double %130, ptr %128, align 8, !tbaa !9
  br label %131

131:                                              ; preds = %124
  %132 = load i32, ptr %20, align 4, !tbaa !17
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %20, align 4, !tbaa !17
  br label %120, !llvm.loop !21

134:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 32, ptr %21) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %23) #6
  %135 = getelementptr inbounds [4 x double], ptr %10, i64 0, i64 0
  %136 = getelementptr inbounds [4 x double], ptr %21, i64 0, i64 0
  %137 = getelementptr inbounds [2 x double], ptr %22, i64 0, i64 0
  %138 = getelementptr inbounds [4 x double], ptr %23, i64 0, i64 0
  call void @_Z14RNSvdDecomposeiiPKdPdS1_S1_(i32 noundef 2, i32 noundef 2, ptr noundef %135, ptr noundef %136, ptr noundef %137, ptr noundef %138)
  call void @llvm.lifetime.start.p0(i64 48, ptr %24) #6
  %139 = getelementptr inbounds [3 x %class.R2Vector], ptr %24, i32 0, i32 0
  %140 = getelementptr inbounds %class.R2Vector, ptr %139, i64 3
  br label %141

141:                                              ; preds = %141, %134
  %142 = phi ptr [ %139, %134 ], [ %143, %141 ]
  call void @_ZN8R2VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %142)
  %143 = getelementptr inbounds %class.R2Vector, ptr %142, i64 1
  %144 = icmp eq ptr %143, %140
  br i1 %144, label %145, label %141

145:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  store i32 0, ptr %25, align 4, !tbaa !17
  br label %146

146:                                              ; preds = %172, %145
  %147 = load i32, ptr %25, align 4, !tbaa !17
  %148 = icmp slt i32 %147, 2
  br i1 %148, label %150, label %149

149:                                              ; preds = %146
  store i32 11, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  br label %175

150:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #6
  store i32 0, ptr %26, align 4, !tbaa !17
  br label %151

151:                                              ; preds = %168, %150
  %152 = load i32, ptr %26, align 4, !tbaa !17
  %153 = icmp slt i32 %152, 2
  br i1 %153, label %155, label %154

154:                                              ; preds = %151
  store i32 14, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  br label %171

155:                                              ; preds = %151
  %156 = load i32, ptr %25, align 4, !tbaa !17
  %157 = mul nsw i32 2, %156
  %158 = load i32, ptr %26, align 4, !tbaa !17
  %159 = add nsw i32 %157, %158
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [4 x double], ptr %23, i64 0, i64 %160
  %162 = load double, ptr %161, align 8, !tbaa !9
  %163 = load i32, ptr %25, align 4, !tbaa !17
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [3 x %class.R2Vector], ptr %24, i64 0, i64 %164
  %166 = load i32, ptr %26, align 4, !tbaa !17
  %167 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %165, i32 noundef %166)
  store double %162, ptr %167, align 8, !tbaa !9
  br label %168

168:                                              ; preds = %155
  %169 = load i32, ptr %26, align 4, !tbaa !17
  %170 = add nsw i32 %169, 1
  store i32 %170, ptr %26, align 4, !tbaa !17
  br label %151, !llvm.loop !22

171:                                              ; preds = %154
  br label %172

172:                                              ; preds = %171
  %173 = load i32, ptr %25, align 4, !tbaa !17
  %174 = add nsw i32 %173, 1
  store i32 %174, ptr %25, align 4, !tbaa !17
  br label %146, !llvm.loop !23

175:                                              ; preds = %149
  %176 = getelementptr inbounds %class.R2Grid, ptr %35, i32 0, i32 3
  %177 = load ptr, ptr %176, align 8, !tbaa !11
  store ptr %177, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #6
  store double 0.000000e+00, ptr %27, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #6
  store double 0.000000e+00, ptr %28, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #6
  store i32 0, ptr %29, align 4, !tbaa !17
  br label %178

178:                                              ; preds = %218, %175
  %179 = load i32, ptr %29, align 4, !tbaa !17
  %180 = getelementptr inbounds %class.R2Grid, ptr %35, i32 0, i32 4
  %181 = getelementptr inbounds [2 x i32], ptr %180, i64 0, i64 1
  %182 = load i32, ptr %181, align 4, !tbaa !17
  %183 = icmp slt i32 %179, %182
  br i1 %183, label %185, label %184

184:                                              ; preds = %178
  store i32 17, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #6
  br label %221

185:                                              ; preds = %178
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #6
  store i32 0, ptr %30, align 4, !tbaa !17
  br label %186

186:                                              ; preds = %214, %185
  %187 = load i32, ptr %30, align 4, !tbaa !17
  %188 = getelementptr inbounds %class.R2Grid, ptr %35, i32 0, i32 4
  %189 = getelementptr inbounds [2 x i32], ptr %188, i64 0, i64 0
  %190 = load i32, ptr %189, align 8, !tbaa !17
  %191 = icmp slt i32 %187, %190
  br i1 %191, label %193, label %192

192:                                              ; preds = %186
  store i32 20, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #6
  br label %217

193:                                              ; preds = %186
  call void @llvm.lifetime.start.p0(i64 16, ptr %31) #6
  %194 = load i32, ptr %30, align 4, !tbaa !17
  %195 = sitofp i32 %194 to double
  %196 = load i32, ptr %29, align 4, !tbaa !17
  %197 = sitofp i32 %196 to double
  call void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %31, double noundef %195, double noundef %197)
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #6
  %198 = load ptr, ptr %12, align 8, !tbaa !5
  %199 = getelementptr inbounds double, ptr %198, i32 1
  store ptr %199, ptr %12, align 8, !tbaa !5
  %200 = load double, ptr %198, align 8, !tbaa !9
  store double %200, ptr %32, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %33) #6
  call void @_ZmiRK7R2PointS1_(ptr dead_on_unwind writable sret(%class.R2Vector) align 8 %33, ptr noundef nonnull align 8 dereferenceable(16) %31, ptr noundef nonnull align 8 dereferenceable(16) %9)
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #6
  %201 = getelementptr inbounds [3 x %class.R2Vector], ptr %24, i64 0, i64 0
  %202 = call noundef double @_ZNK8R2Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(16) %201, ptr noundef nonnull align 8 dereferenceable(16) %33)
  store double %202, ptr %34, align 8, !tbaa !9
  %203 = load double, ptr %34, align 8, !tbaa !9
  %204 = fcmp ogt double %203, 0.000000e+00
  br i1 %204, label %205, label %209

205:                                              ; preds = %193
  %206 = load double, ptr %32, align 8, !tbaa !9
  %207 = load double, ptr %27, align 8, !tbaa !9
  %208 = fadd double %207, %206
  store double %208, ptr %27, align 8, !tbaa !9
  br label %213

209:                                              ; preds = %193
  %210 = load double, ptr %32, align 8, !tbaa !9
  %211 = load double, ptr %28, align 8, !tbaa !9
  %212 = fadd double %211, %210
  store double %212, ptr %28, align 8, !tbaa !9
  br label %213

213:                                              ; preds = %209, %205
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %33) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %31) #6
  br label %214

214:                                              ; preds = %213
  %215 = load i32, ptr %30, align 4, !tbaa !17
  %216 = add nsw i32 %215, 1
  store i32 %216, ptr %30, align 4, !tbaa !17
  br label %186, !llvm.loop !24

217:                                              ; preds = %192
  br label %218

218:                                              ; preds = %217
  %219 = load i32, ptr %29, align 4, !tbaa !17
  %220 = add nsw i32 %219, 1
  store i32 %220, ptr %29, align 4, !tbaa !17
  br label %178, !llvm.loop !25

221:                                              ; preds = %184
  %222 = load double, ptr %27, align 8, !tbaa !9
  %223 = load double, ptr %28, align 8, !tbaa !9
  %224 = fcmp olt double %222, %223
  br i1 %224, label %225, label %227

225:                                              ; preds = %221
  %226 = getelementptr inbounds [3 x %class.R2Vector], ptr %24, i64 0, i64 0
  call void @_ZN8R2Vector4FlipEv(ptr noundef nonnull align 8 dereferenceable(16) %226)
  br label %227

227:                                              ; preds = %225, %221
  %228 = getelementptr inbounds [3 x %class.R2Vector], ptr %24, i64 0, i64 0
  %229 = getelementptr inbounds [3 x %class.R2Vector], ptr %24, i64 0, i64 1
  %230 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN8R2VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %229, ptr noundef nonnull align 8 dereferenceable(16) %228)
  %231 = getelementptr inbounds [3 x %class.R2Vector], ptr %24, i64 0, i64 1
  %232 = load double, ptr @RN_PI_OVER_TWO, align 8, !tbaa !9
  call void @_ZN8R2Vector6RotateEd(ptr noundef nonnull align 8 dereferenceable(16) %231, double noundef %232)
  %233 = getelementptr inbounds [3 x %class.R2Vector], ptr %24, i64 0, i64 0
  %234 = call noundef double @_ZNK8R2Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(16) %233)
  %235 = load double, ptr @RN_BIG_EPSILON, align 8, !tbaa !9
  %236 = call noundef i32 @_Z9RNIsEqualddd(double noundef %234, double noundef 1.000000e+00, double noundef %235)
  %237 = icmp ne i32 %236, 0
  br i1 %237, label %239, label %238

238:                                              ; preds = %227
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.3, i32 noundef 416, ptr noundef @.str.2)
  br label %239

239:                                              ; preds = %238, %227
  %240 = getelementptr inbounds [3 x %class.R2Vector], ptr %24, i64 0, i64 1
  %241 = call noundef double @_ZNK8R2Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(16) %240)
  %242 = load double, ptr @RN_BIG_EPSILON, align 8, !tbaa !9
  %243 = call noundef i32 @_Z9RNIsEqualddd(double noundef %241, double noundef 1.000000e+00, double noundef %242)
  %244 = icmp ne i32 %243, 0
  br i1 %244, label %246, label %245

245:                                              ; preds = %239
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.4, i32 noundef 417, ptr noundef @.str.2)
  br label %246

246:                                              ; preds = %245, %239
  %247 = getelementptr inbounds [3 x %class.R2Vector], ptr %24, i64 0, i64 0
  %248 = getelementptr inbounds [3 x %class.R2Vector], ptr %24, i64 0, i64 1
  %249 = call noundef double @_ZNK8R2Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(16) %247, ptr noundef nonnull align 8 dereferenceable(16) %248)
  %250 = load double, ptr @RN_BIG_EPSILON, align 8, !tbaa !9
  %251 = call noundef i32 @_Z8RNIsZerodd(double noundef %249, double noundef %250)
  %252 = icmp ne i32 %251, 0
  br i1 %252, label %254, label %253

253:                                              ; preds = %246
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.5, i32 noundef 418, ptr noundef @.str.2)
  br label %254

254:                                              ; preds = %253, %246
  %255 = load ptr, ptr %8, align 8, !tbaa !5
  %256 = icmp ne ptr %255, null
  br i1 %256, label %257, label %266

257:                                              ; preds = %254
  %258 = getelementptr inbounds [2 x double], ptr %22, i64 0, i64 0
  %259 = load double, ptr %258, align 16, !tbaa !9
  %260 = load ptr, ptr %8, align 8, !tbaa !5
  %261 = getelementptr inbounds double, ptr %260, i64 0
  store double %259, ptr %261, align 8, !tbaa !9
  %262 = getelementptr inbounds [2 x double], ptr %22, i64 0, i64 1
  %263 = load double, ptr %262, align 8, !tbaa !9
  %264 = load ptr, ptr %8, align 8, !tbaa !5
  %265 = getelementptr inbounds double, ptr %264, i64 1
  store double %263, ptr %265, align 8, !tbaa !9
  br label %266

266:                                              ; preds = %257, %254
  %267 = getelementptr inbounds [3 x %class.R2Vector], ptr %24, i64 0, i64 0
  %268 = getelementptr inbounds [3 x %class.R2Vector], ptr %24, i64 0, i64 1
  call void @_ZN6R2DiadC1ERK8R2VectorS2_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(16) %267, ptr noundef nonnull align 8 dereferenceable(16) %268)
  store i32 1, ptr %14, align 4
  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 48, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #6
  br label %269

269:                                              ; preds = %266, %118
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #6
  ret void
}

declare void @_ZN7R2PointC1ERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

; 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

declare void @_ZN6R2DiadC1ERKS_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0

declare void @_Z14RNSvdDecomposeiiPKdPdS1_S1_(i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

declare void @_ZN8R2VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #0

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

declare void @_ZmiRK7R2PointS1_(ptr dead_on_unwind writable sret(%class.R2Vector) align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #0

declare noundef double @_ZNK8R2Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #0

declare void @_ZN8R2Vector4FlipEv(ptr noundef nonnull align 8 dereferenceable(16)) #0

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZN8R2VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #0

declare void @_ZN8R2Vector6RotateEd(ptr noundef nonnull align 8 dereferenceable(16), double noundef) #0

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

declare noundef double @_ZNK8R2Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(16)) #0

declare void @_ZN6R2DiadC1ERK8R2VectorS2_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #0

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !6, i64 184}
!12 = !{!"_ZTS6R2Grid", !13, i64 0, !13, i64 88, !10, i64 176, !6, i64 184, !7, i64 192, !16, i64 200, !16, i64 204}
!13 = !{!"_ZTS8R2Affine", !14, i64 0, !15, i64 8, !16, i64 80}
!14 = !{!"_ZTS16R2Transformation"}
!15 = !{!"_ZTS8R3Matrix", !7, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{!16, !16, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = distinct !{!21, !19}
!22 = distinct !{!22, !19}
!23 = distinct !{!23, !19}
!24 = distinct !{!24, !19}
!25 = distinct !{!25, !19}


; 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.R2Diad = type { [2 x %class.R2Vector] }
%class.R2Vector = type { [2 x double] }
%class.R2Point = type { [2 x double] }

@.str = external hidden unnamed_addr constant [41 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [88 x i8], align 1
@R2xy_diad = external global %class.R2Diad, align 8
@RN_PI_OVER_TWO = external local_unnamed_addr constant double, align 8
@RN_BIG_EPSILON = external local_unnamed_addr global double, align 8
@.str.3 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [47 x i8], align 1

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6R2Grid12GridCentroidEv(ptr dead_on_unwind noalias writable sret(%class.R2Point) align 8, ptr noundef nonnull align 8 dereferenceable(208)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK6R2Grid17GridPrincipleAxesEPK7R2PointPd(ptr dead_on_unwind noalias writable sret(%class.R2Diad) align 8 %0, ptr noundef nonnull align 8 dereferenceable(208) %1, ptr noundef %2, ptr noundef writeonly %3) local_unnamed_addr #3 align 2 {
  %5 = alloca %class.R2Point, align 8
  %6 = alloca [4 x double], align 16
  %7 = alloca %class.R2Point, align 8
  %8 = alloca [4 x double], align 16
  %9 = alloca [2 x double], align 16
  %10 = alloca [4 x double], align 16
  %11 = alloca [3 x %class.R2Vector], align 16
  %12 = alloca %class.R2Point, align 8
  %13 = alloca %class.R2Vector, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #6
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %15, label %14

14:                                               ; preds = %4
  call void @_ZN7R2PointC1ERKS_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %2)
  br label %16

15:                                               ; preds = %4
  call void @_ZNK6R2Grid12GridCentroidEv(ptr dead_on_unwind nonnull writable sret(%class.R2Point) align 8 %5, ptr noundef nonnull align 8 dereferenceable(208) %1)
  br label %16

16:                                               ; preds = %15, %14
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %6, i8 0, i64 32, i1 false)
  %17 = getelementptr inbounds i8, ptr %1, i64 184
  %18 = getelementptr inbounds i8, ptr %1, i64 192
  %19 = getelementptr inbounds i8, ptr %1, i64 196
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.preheader78.lr.ph, label %._crit_edge87.thread

.preheader78.lr.ph:                               ; preds = %16
  %22 = getelementptr inbounds i8, ptr %6, i64 16
  %23 = load i32, ptr %18, align 8, !tbaa !5
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %.preheader78.preheader, label %._crit_edge87.thread

.preheader78.preheader:                           ; preds = %.preheader78.lr.ph
  %25 = load ptr, ptr %17, align 8, !tbaa !9
  br label %.preheader78

.preheader78:                                     ; preds = %.preheader78.preheader, %._crit_edge
  %26 = phi i32 [ %51, %._crit_edge ], [ %20, %.preheader78.preheader ]
  %27 = phi i32 [ %52, %._crit_edge ], [ %23, %.preheader78.preheader ]
  %.086 = phi double [ %.1.lcssa, %._crit_edge ], [ 0.000000e+00, %.preheader78.preheader ]
  %.05385 = phi ptr [ %.154.lcssa, %._crit_edge ], [ %25, %.preheader78.preheader ]
  %.06684 = phi i32 [ %55, %._crit_edge ], [ 0, %.preheader78.preheader ]
  %28 = phi <2 x double> [ %53, %._crit_edge ], [ zeroinitializer, %.preheader78.preheader ]
  %29 = phi <2 x double> [ %54, %._crit_edge ], [ zeroinitializer, %.preheader78.preheader ]
  %30 = icmp sgt i32 %27, 0
  br i1 %30, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader78
  %31 = uitofp nneg i32 %.06684 to double
  br label %57

._crit_edge87:                                    ; preds = %._crit_edge
  %32 = fcmp oeq double %.1.lcssa, 0.000000e+00
  br i1 %32, label %._crit_edge87.thread, label %.preheader77.preheader

.preheader77.preheader:                           ; preds = %._crit_edge87
  %33 = insertelement <2 x double> poison, double %.1.lcssa, i64 0
  %34 = shufflevector <2 x double> %33, <2 x double> poison, <2 x i32> zeroinitializer
  %35 = fdiv <2 x double> %53, %34
  store <2 x double> %35, ptr %6, align 16, !tbaa !16
  %36 = getelementptr inbounds i8, ptr %6, i64 16
  %37 = fdiv <2 x double> %54, %34
  store <2 x double> %37, ptr %36, align 16, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #6
  call void @_Z14RNSvdDecomposeiiPKdPdS1_S1_(i32 noundef 2, i32 noundef 2, ptr noundef nonnull %6, ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %10)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %11) #6
  call void @_ZN8R2VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %11)
  %.ptr.1 = getelementptr inbounds i8, ptr %11, i64 16
  call void @_ZN8R2VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %.ptr.1)
  %.ptr.2 = getelementptr inbounds i8, ptr %11, i64 32
  call void @_ZN8R2VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %.ptr.2)
  %38 = load double, ptr %10, align 16, !tbaa !16
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %11, i32 noundef 0)
  store double %38, ptr %39, align 8, !tbaa !16
  %40 = getelementptr inbounds i8, ptr %10, i64 8
  %41 = load double, ptr %40, align 8, !tbaa !16
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %11, i32 noundef 1)
  store double %41, ptr %42, align 8, !tbaa !16
  %43 = getelementptr inbounds i8, ptr %10, i64 16
  %44 = load double, ptr %43, align 16, !tbaa !16
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %.ptr.1, i32 noundef 0)
  store double %44, ptr %45, align 8, !tbaa !16
  %46 = getelementptr inbounds i8, ptr %10, i64 24
  %47 = load double, ptr %46, align 8, !tbaa !16
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %.ptr.1, i32 noundef 1)
  store double %47, ptr %48, align 8, !tbaa !16
  %49 = load i32, ptr %19, align 4, !tbaa !5
  %50 = icmp sgt i32 %49, 0
  br i1 %50, label %.preheader.lr.ph, label %._crit_edge107.thread

._crit_edge.loopexit:                             ; preds = %57
  %.pre = load i32, ptr %19, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader78
  %51 = phi i32 [ %26, %.preheader78 ], [ %.pre, %._crit_edge.loopexit ]
  %52 = phi i32 [ %27, %.preheader78 ], [ %85, %._crit_edge.loopexit ]
  %.154.lcssa = phi ptr [ %.05385, %.preheader78 ], [ %61, %._crit_edge.loopexit ]
  %.1.lcssa = phi double [ %.086, %.preheader78 ], [ %83, %._crit_edge.loopexit ]
  %53 = phi <2 x double> [ %28, %.preheader78 ], [ %80, %._crit_edge.loopexit ]
  %54 = phi <2 x double> [ %29, %.preheader78 ], [ %82, %._crit_edge.loopexit ]
  %55 = add nuw nsw i32 %.06684, 1
  %56 = icmp slt i32 %55, %51
  br i1 %56, label %.preheader78, label %._crit_edge87, !llvm.loop !17

57:                                               ; preds = %.lr.ph, %57
  %.182 = phi double [ %.086, %.lr.ph ], [ %83, %57 ]
  %.15481 = phi ptr [ %.05385, %.lr.ph ], [ %61, %57 ]
  %.06780 = phi i32 [ 0, %.lr.ph ], [ %84, %57 ]
  %58 = phi <2 x double> [ %28, %.lr.ph ], [ %80, %57 ]
  %59 = phi <2 x double> [ %29, %.lr.ph ], [ %82, %57 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #6
  %60 = uitofp nneg i32 %.06780 to double
  call void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %7, double noundef %60, double noundef %31)
  %61 = getelementptr inbounds i8, ptr %.15481, i64 8
  %62 = load double, ptr %.15481, align 8, !tbaa !16
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef 0)
  %64 = load double, ptr %63, align 8, !tbaa !16
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %5, i32 noundef 0)
  %66 = load double, ptr %65, align 8, !tbaa !16
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef 1)
  %68 = load double, ptr %67, align 8, !tbaa !16
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %5, i32 noundef 1)
  %70 = load double, ptr %69, align 8, !tbaa !16
  %71 = insertelement <2 x double> poison, double %64, i64 0
  %72 = insertelement <2 x double> %71, double %68, i64 1
  %73 = insertelement <2 x double> poison, double %66, i64 0
  %74 = insertelement <2 x double> %73, double %70, i64 1
  %75 = fsub <2 x double> %72, %74
  %76 = insertelement <2 x double> poison, double %62, i64 0
  %77 = shufflevector <2 x double> %76, <2 x double> poison, <2 x i32> zeroinitializer
  %78 = fmul <2 x double> %77, %75
  %79 = shufflevector <2 x double> %78, <2 x double> poison, <2 x i32> zeroinitializer
  %80 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %79, <2 x double> %75, <2 x double> %58)
  store <2 x double> %80, ptr %6, align 16, !tbaa !16
  %81 = shufflevector <2 x double> %75, <2 x double> poison, <2 x i32> <i32 1, i32 1>
  %82 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %78, <2 x double> %81, <2 x double> %59)
  store <2 x double> %82, ptr %22, align 16, !tbaa !16
  %83 = fadd double %.182, %62
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  %84 = add nuw nsw i32 %.06780, 1
  %85 = load i32, ptr %18, align 8, !tbaa !5
  %86 = icmp slt i32 %84, %85
  br i1 %86, label %57, label %._crit_edge.loopexit, !llvm.loop !20

._crit_edge87.thread:                             ; preds = %.preheader78.lr.ph, %16, %._crit_edge87
  call void @_ZN6R2DiadC1ERKS_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) @R2xy_diad)
  br label %131

.preheader.lr.ph:                                 ; preds = %.preheader77.preheader
  %87 = load i32, ptr %18, align 8, !tbaa !5
  %88 = icmp sgt i32 %87, 0
  br i1 %88, label %.preheader.preheader, label %._crit_edge107.thread

.preheader.preheader:                             ; preds = %.preheader.lr.ph
  %89 = load ptr, ptr %17, align 8, !tbaa !9
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge99
  %90 = phi i32 [ %95, %._crit_edge99 ], [ %49, %.preheader.preheader ]
  %91 = phi i32 [ %96, %._crit_edge99 ], [ %87, %.preheader.preheader ]
  %.2106 = phi ptr [ %.3.lcssa, %._crit_edge99 ], [ %89, %.preheader.preheader ]
  %.056105 = phi i32 [ %97, %._crit_edge99 ], [ 0, %.preheader.preheader ]
  %.057104 = phi double [ %.158.lcssa, %._crit_edge99 ], [ 0.000000e+00, %.preheader.preheader ]
  %.060103 = phi double [ %.161.lcssa, %._crit_edge99 ], [ 0.000000e+00, %.preheader.preheader ]
  %92 = icmp sgt i32 %91, 0
  br i1 %92, label %.lr.ph98, label %._crit_edge99

.lr.ph98:                                         ; preds = %.preheader
  %93 = uitofp nneg i32 %.056105 to double
  br label %99

._crit_edge107:                                   ; preds = %._crit_edge99
  %94 = fcmp olt double %.161.lcssa, %.158.lcssa
  br i1 %94, label %110, label %._crit_edge107.thread

._crit_edge99.loopexit:                           ; preds = %99
  %.pre119 = load i32, ptr %19, align 4, !tbaa !5
  br label %._crit_edge99

._crit_edge99:                                    ; preds = %._crit_edge99.loopexit, %.preheader
  %95 = phi i32 [ %90, %.preheader ], [ %.pre119, %._crit_edge99.loopexit ]
  %96 = phi i32 [ %91, %.preheader ], [ %108, %._crit_edge99.loopexit ]
  %.161.lcssa = phi double [ %.060103, %.preheader ], [ %.262, %._crit_edge99.loopexit ]
  %.158.lcssa = phi double [ %.057104, %.preheader ], [ %.259, %._crit_edge99.loopexit ]
  %.3.lcssa = phi ptr [ %.2106, %.preheader ], [ %101, %._crit_edge99.loopexit ]
  %97 = add nuw nsw i32 %.056105, 1
  %98 = icmp slt i32 %97, %95
  br i1 %98, label %.preheader, label %._crit_edge107, !llvm.loop !21

99:                                               ; preds = %.lr.ph98, %99
  %.397 = phi ptr [ %.2106, %.lr.ph98 ], [ %101, %99 ]
  %.05596 = phi i32 [ 0, %.lr.ph98 ], [ %107, %99 ]
  %.15895 = phi double [ %.057104, %.lr.ph98 ], [ %.259, %99 ]
  %.16194 = phi double [ %.060103, %.lr.ph98 ], [ %.262, %99 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #6
  %100 = uitofp nneg i32 %.05596 to double
  call void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %12, double noundef %100, double noundef %93)
  %101 = getelementptr inbounds i8, ptr %.397, i64 8
  %102 = load double, ptr %.397, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #6
  call void @_ZmiRK7R2PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R2Vector) align 8 %13, ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(16) %5)
  %103 = call noundef double @_ZNK8R2Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(16) %13)
  %104 = fcmp ogt double %103, 0.000000e+00
  %105 = fadd double %.16194, %102
  %106 = fadd double %.15895, %102
  %.262 = select i1 %104, double %105, double %.16194
  %.259 = select i1 %104, double %.15895, double %106
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #6
  %107 = add nuw nsw i32 %.05596, 1
  %108 = load i32, ptr %18, align 8, !tbaa !5
  %109 = icmp slt i32 %107, %108
  br i1 %109, label %99, label %._crit_edge99.loopexit, !llvm.loop !22

110:                                              ; preds = %._crit_edge107
  call void @_ZN8R2Vector4FlipEv(ptr noundef nonnull align 8 dereferenceable(16) %11)
  br label %._crit_edge107.thread

._crit_edge107.thread:                            ; preds = %.preheader.lr.ph, %.preheader77.preheader, %110, %._crit_edge107
  %111 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN8R2VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %.ptr.1, ptr noundef nonnull align 8 dereferenceable(16) %11)
  %112 = load double, ptr @RN_PI_OVER_TWO, align 8, !tbaa !16
  call void @_ZN8R2Vector6RotateEd(ptr noundef nonnull align 8 dereferenceable(16) %.ptr.1, double noundef %112)
  %113 = call noundef double @_ZNK8R2Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(16) %11)
  %114 = load double, ptr @RN_BIG_EPSILON, align 8, !tbaa !16
  %115 = call noundef i32 @_Z9RNIsEqualddd(double noundef %113, double noundef 1.000000e+00, double noundef %114)
  %.not71 = icmp eq i32 %115, 0
  br i1 %.not71, label %116, label %117

116:                                              ; preds = %._crit_edge107.thread
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.3, i32 noundef 416, ptr noundef nonnull @.str.2)
  br label %117

117:                                              ; preds = %116, %._crit_edge107.thread
  %118 = call noundef double @_ZNK8R2Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(16) %.ptr.1)
  %119 = load double, ptr @RN_BIG_EPSILON, align 8, !tbaa !16
  %120 = call noundef i32 @_Z9RNIsEqualddd(double noundef %118, double noundef 1.000000e+00, double noundef %119)
  %.not72 = icmp eq i32 %120, 0
  br i1 %.not72, label %121, label %122

121:                                              ; preds = %117
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.4, i32 noundef 417, ptr noundef nonnull @.str.2)
  br label %122

122:                                              ; preds = %121, %117
  %123 = call noundef double @_ZNK8R2Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(16) %.ptr.1)
  %124 = load double, ptr @RN_BIG_EPSILON, align 8, !tbaa !16
  %125 = call noundef i32 @_Z8RNIsZerodd(double noundef %123, double noundef %124)
  %.not73 = icmp eq i32 %125, 0
  br i1 %.not73, label %126, label %127

126:                                              ; preds = %122
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.5, i32 noundef 418, ptr noundef nonnull @.str.2)
  br label %127

127:                                              ; preds = %126, %122
  %.not74 = icmp eq ptr %3, null
  br i1 %.not74, label %130, label %128

128:                                              ; preds = %127
  %129 = load <2 x double>, ptr %9, align 16, !tbaa !16
  store <2 x double> %129, ptr %3, align 8, !tbaa !16
  br label %130

130:                                              ; preds = %128, %127
  call void @_ZN6R2DiadC1ERK8R2VectorS2_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(16) %.ptr.1)
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #6
  br label %131

131:                                              ; preds = %130, %._crit_edge87.thread
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #6
  ret void
}

declare void @_ZN7R2PointC1ERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

; 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 #2 align 2

declare void @_ZN6R2DiadC1ERKS_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0

declare void @_Z14RNSvdDecomposeiiPKdPdS1_S1_(i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @_ZN8R2VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #0

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

declare void @_ZmiRK7R2PointS1_(ptr dead_on_unwind writable sret(%class.R2Vector) align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

declare noundef double @_ZNK8R2Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

declare void @_ZN8R2Vector4FlipEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZN8R2VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

declare void @_ZN8R2Vector6RotateEd(ptr noundef nonnull align 8 dereferenceable(16), double noundef) local_unnamed_addr #0

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

declare noundef double @_ZNK8R2Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

declare void @_ZN6R2DiadC1ERK8R2VectorS2_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #0

; 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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, !15, i64 184}
!10 = !{!"_ZTS6R2Grid", !11, i64 0, !11, i64 88, !14, i64 176, !15, i64 184, !7, i64 192, !6, i64 200, !6, i64 204}
!11 = !{!"_ZTS8R2Affine", !12, i64 0, !13, i64 8, !6, i64 80}
!12 = !{!"_ZTS16R2Transformation"}
!13 = !{!"_ZTS8R3Matrix", !7, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!14, !14, i64 0}
!17 = distinct !{!17, !18, !19}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!"llvm.loop.unswitch.partial.disable"}
!20 = distinct !{!20, !18}
!21 = distinct !{!21, !18, !19}
!22 = distinct !{!22, !18}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalDCEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass