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

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

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

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

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

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

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

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

35:                                               ; preds = %98, %5
  %36 = load i32, ptr %13, align 4, !tbaa !11
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  %38 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %37)
  %39 = icmp slt i32 %36, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %101

41:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %42 = load ptr, ptr %9, align 8, !tbaa !5
  %43 = icmp ne ptr %42, null
  br i1 %43, label %44, label %50

44:                                               ; preds = %41
  %45 = load ptr, ptr %9, align 8, !tbaa !5
  %46 = load i32, ptr %13, align 4, !tbaa !11
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds double, ptr %45, i64 %47
  %49 = load double, ptr %48, align 8, !tbaa !9
  br label %51

50:                                               ; preds = %41
  br label %51

51:                                               ; preds = %50, %44
  %52 = phi double [ %49, %44 ], [ 1.000000e+00, %50 ]
  store double %52, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %53 = load ptr, ptr %8, align 8, !tbaa !5
  %54 = load i32, ptr %13, align 4, !tbaa !11
  %55 = call noundef ptr @_ZNK7RNArrayIP7R2PointEixEi(ptr noundef nonnull align 8 dereferenceable(16) %53, i32 noundef %54)
  %56 = call noundef double @_ZNK7R2Point1XEv(ptr noundef nonnull align 8 dereferenceable(16) %55)
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = call noundef double @_ZNK7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %57, i32 noundef 0)
  %59 = fsub double %56, %58
  store double %59, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %60 = load ptr, ptr %8, align 8, !tbaa !5
  %61 = load i32, ptr %13, align 4, !tbaa !11
  %62 = call noundef ptr @_ZNK7RNArrayIP7R2PointEixEi(ptr noundef nonnull align 8 dereferenceable(16) %60, i32 noundef %61)
  %63 = call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %62)
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  %65 = call noundef double @_ZNK7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %64, i32 noundef 1)
  %66 = fsub double %63, %65
  store double %66, ptr %16, align 8, !tbaa !9
  %67 = load double, ptr %14, align 8, !tbaa !9
  %68 = load double, ptr %15, align 8, !tbaa !9
  %69 = fmul double %67, %68
  %70 = load double, ptr %15, align 8, !tbaa !9
  %71 = getelementptr inbounds [4 x double], ptr %11, i64 0, i64 0
  %72 = load double, ptr %71, align 16, !tbaa !9
  %73 = call double @llvm.fmuladd.f64(double %69, double %70, double %72)
  store double %73, ptr %71, align 16, !tbaa !9
  %74 = load double, ptr %14, align 8, !tbaa !9
  %75 = load double, ptr %15, align 8, !tbaa !9
  %76 = fmul double %74, %75
  %77 = load double, ptr %16, align 8, !tbaa !9
  %78 = getelementptr inbounds [4 x double], ptr %11, i64 0, i64 1
  %79 = load double, ptr %78, align 8, !tbaa !9
  %80 = call double @llvm.fmuladd.f64(double %76, double %77, double %79)
  store double %80, ptr %78, align 8, !tbaa !9
  %81 = load double, ptr %14, align 8, !tbaa !9
  %82 = load double, ptr %16, align 8, !tbaa !9
  %83 = fmul double %81, %82
  %84 = load double, ptr %15, align 8, !tbaa !9
  %85 = getelementptr inbounds [4 x double], ptr %11, i64 0, i64 2
  %86 = load double, ptr %85, align 16, !tbaa !9
  %87 = call double @llvm.fmuladd.f64(double %83, double %84, double %86)
  store double %87, ptr %85, align 16, !tbaa !9
  %88 = load double, ptr %14, align 8, !tbaa !9
  %89 = load double, ptr %16, align 8, !tbaa !9
  %90 = fmul double %88, %89
  %91 = load double, ptr %16, align 8, !tbaa !9
  %92 = getelementptr inbounds [4 x double], ptr %11, i64 0, i64 3
  %93 = load double, ptr %92, align 8, !tbaa !9
  %94 = call double @llvm.fmuladd.f64(double %90, double %91, double %93)
  store double %94, ptr %92, align 8, !tbaa !9
  %95 = load double, ptr %14, align 8, !tbaa !9
  %96 = load double, ptr %12, align 8, !tbaa !9
  %97 = fadd double %96, %95
  store double %97, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %98

98:                                               ; preds = %51
  %99 = load i32, ptr %13, align 4, !tbaa !11
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %13, align 4, !tbaa !11
  br label %35, !llvm.loop !13

101:                                              ; preds = %40
  %102 = load double, ptr %12, align 8, !tbaa !9
  %103 = fcmp oeq double %102, 0.000000e+00
  br i1 %103, label %104, label %105

104:                                              ; preds = %101
  call void @_ZN6R2DiadC1ERKS_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) @R2xy_diad)
  store i32 1, ptr %17, align 4
  br label %286

105:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !11
  br label %106

106:                                              ; preds = %117, %105
  %107 = load i32, ptr %18, align 4, !tbaa !11
  %108 = icmp slt i32 %107, 4
  br i1 %108, label %110, label %109

109:                                              ; preds = %106
  store i32 5, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %120

110:                                              ; preds = %106
  %111 = load double, ptr %12, align 8, !tbaa !9
  %112 = load i32, ptr %18, align 4, !tbaa !11
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [4 x double], ptr %11, i64 0, i64 %113
  %115 = load double, ptr %114, align 8, !tbaa !9
  %116 = fdiv double %115, %111
  store double %116, ptr %114, align 8, !tbaa !9
  br label %117

117:                                              ; preds = %110
  %118 = load i32, ptr %18, align 4, !tbaa !11
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %18, align 4, !tbaa !11
  br label %106, !llvm.loop !15

120:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %21) #7
  %121 = getelementptr inbounds [4 x double], ptr %11, i64 0, i64 0
  %122 = getelementptr inbounds [4 x double], ptr %19, i64 0, i64 0
  %123 = getelementptr inbounds [2 x double], ptr %20, i64 0, i64 0
  %124 = getelementptr inbounds [4 x double], ptr %21, i64 0, i64 0
  call void @_Z14RNSvdDecomposeiiPKdPdS1_S1_(i32 noundef 2, i32 noundef 2, ptr noundef %121, ptr noundef %122, ptr noundef %123, ptr noundef %124)
  call void @llvm.lifetime.start.p0(i64 32, ptr %22) #7
  %125 = getelementptr inbounds [2 x %class.R2Vector], ptr %22, i32 0, i32 0
  %126 = getelementptr inbounds %class.R2Vector, ptr %125, i64 2
  br label %127

127:                                              ; preds = %127, %120
  %128 = phi ptr [ %125, %120 ], [ %129, %127 ]
  call void @_ZN8R2VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %128)
  %129 = getelementptr inbounds %class.R2Vector, ptr %128, i64 1
  %130 = icmp eq ptr %129, %126
  br i1 %130, label %131, label %127

131:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  store i32 0, ptr %23, align 4, !tbaa !11
  br label %132

132:                                              ; preds = %158, %131
  %133 = load i32, ptr %23, align 4, !tbaa !11
  %134 = icmp slt i32 %133, 2
  br i1 %134, label %136, label %135

135:                                              ; preds = %132
  store i32 8, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  br label %161

136:                                              ; preds = %132
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  store i32 0, ptr %24, align 4, !tbaa !11
  br label %137

137:                                              ; preds = %154, %136
  %138 = load i32, ptr %24, align 4, !tbaa !11
  %139 = icmp slt i32 %138, 2
  br i1 %139, label %141, label %140

140:                                              ; preds = %137
  store i32 11, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %157

141:                                              ; preds = %137
  %142 = load i32, ptr %23, align 4, !tbaa !11
  %143 = mul nsw i32 2, %142
  %144 = load i32, ptr %24, align 4, !tbaa !11
  %145 = add nsw i32 %143, %144
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [4 x double], ptr %21, i64 0, i64 %146
  %148 = load double, ptr %147, align 8, !tbaa !9
  %149 = load i32, ptr %23, align 4, !tbaa !11
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [2 x %class.R2Vector], ptr %22, i64 0, i64 %150
  %152 = load i32, ptr %24, align 4, !tbaa !11
  %153 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %151, i32 noundef %152)
  store double %148, ptr %153, align 8, !tbaa !9
  br label %154

154:                                              ; preds = %141
  %155 = load i32, ptr %24, align 4, !tbaa !11
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %24, align 4, !tbaa !11
  br label %137, !llvm.loop !16

157:                                              ; preds = %140
  br label %158

158:                                              ; preds = %157
  %159 = load i32, ptr %23, align 4, !tbaa !11
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %23, align 4, !tbaa !11
  br label %132, !llvm.loop !17

161:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %162 = getelementptr inbounds [2 x %class.R2Vector], ptr %22, i64 0, i64 0
  %163 = call noundef double @_ZNK8R2Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(16) %162)
  store double %163, ptr %25, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  %164 = getelementptr inbounds [2 x %class.R2Vector], ptr %22, i64 0, i64 1
  %165 = call noundef double @_ZNK8R2Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(16) %164)
  store double %165, ptr %26, align 8, !tbaa !9
  %166 = load double, ptr %25, align 8, !tbaa !9
  %167 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %168 = call noundef i32 @_Z12RNIsPositivedd(double noundef %166, double noundef %167)
  %169 = icmp ne i32 %168, 0
  br i1 %169, label %170, label %174

170:                                              ; preds = %161
  %171 = load double, ptr %25, align 8, !tbaa !9
  %172 = getelementptr inbounds [2 x %class.R2Vector], ptr %22, i64 0, i64 0
  %173 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN8R2VectordVEd(ptr noundef nonnull align 8 dereferenceable(16) %172, double noundef %171)
  br label %174

174:                                              ; preds = %170, %161
  %175 = load double, ptr %26, align 8, !tbaa !9
  %176 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %177 = call noundef i32 @_Z12RNIsPositivedd(double noundef %175, double noundef %176)
  %178 = icmp ne i32 %177, 0
  br i1 %178, label %179, label %183

179:                                              ; preds = %174
  %180 = load double, ptr %26, align 8, !tbaa !9
  %181 = getelementptr inbounds [2 x %class.R2Vector], ptr %22, i64 0, i64 1
  %182 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN8R2VectordVEd(ptr noundef nonnull align 8 dereferenceable(16) %181, double noundef %180)
  br label %183

183:                                              ; preds = %179, %174
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  call void @llvm.memset.p0.i64(ptr align 4 %27, i8 0, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  call void @llvm.memset.p0.i64(ptr align 4 %28, i8 0, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #7
  store i32 0, ptr %29, align 4, !tbaa !11
  br label %184

184:                                              ; preds = %223, %183
  %185 = load i32, ptr %29, align 4, !tbaa !11
  %186 = load ptr, ptr %8, align 8, !tbaa !5
  %187 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %186)
  %188 = icmp slt i32 %185, %187
  br i1 %188, label %190, label %189

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

190:                                              ; preds = %184
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #7
  %191 = load ptr, ptr %8, align 8, !tbaa !5
  %192 = load i32, ptr %29, align 4, !tbaa !11
  %193 = call noundef ptr @_ZNK7RNArrayIP7R2PointEixEi(ptr noundef nonnull align 8 dereferenceable(16) %191, i32 noundef %192)
  store ptr %193, ptr %30, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #7
  store i32 0, ptr %31, align 4, !tbaa !11
  br label %194

194:                                              ; preds = %219, %190
  %195 = load i32, ptr %31, align 4, !tbaa !11
  %196 = icmp slt i32 %195, 2
  br i1 %196, label %198, label %197

197:                                              ; preds = %194
  store i32 17, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  br label %222

198:                                              ; preds = %194
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #7
  %199 = load i32, ptr %31, align 4, !tbaa !11
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [2 x %class.R2Vector], ptr %22, i64 0, i64 %200
  call void @llvm.lifetime.start.p0(i64 16, ptr %33) #7
  %202 = load ptr, ptr %30, align 8, !tbaa !5
  call void @_ZNK7R2Point6VectorEv(ptr dead_on_unwind writable sret(%class.R2Vector) align 8 %33, ptr noundef nonnull align 8 dereferenceable(16) %202)
  %203 = call noundef double @_ZNK8R2Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(16) %201, ptr noundef nonnull align 8 dereferenceable(16) %33)
  call void @llvm.lifetime.end.p0(i64 16, ptr %33) #7
  store double %203, ptr %32, align 8, !tbaa !9
  %204 = load double, ptr %32, align 8, !tbaa !9
  %205 = fcmp ogt double %204, 0.000000e+00
  br i1 %205, label %206, label %212

206:                                              ; preds = %198
  %207 = load i32, ptr %31, align 4, !tbaa !11
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [2 x i32], ptr %27, i64 0, i64 %208
  %210 = load i32, ptr %209, align 4, !tbaa !11
  %211 = add nsw i32 %210, 1
  store i32 %211, ptr %209, align 4, !tbaa !11
  br label %218

212:                                              ; preds = %198
  %213 = load i32, ptr %31, align 4, !tbaa !11
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [2 x i32], ptr %28, i64 0, i64 %214
  %216 = load i32, ptr %215, align 4, !tbaa !11
  %217 = add nsw i32 %216, 1
  store i32 %217, ptr %215, align 4, !tbaa !11
  br label %218

218:                                              ; preds = %212, %206
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  br label %219

219:                                              ; preds = %218
  %220 = load i32, ptr %31, align 4, !tbaa !11
  %221 = add nsw i32 %220, 1
  store i32 %221, ptr %31, align 4, !tbaa !11
  br label %194, !llvm.loop !18

222:                                              ; preds = %197
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  br label %223

223:                                              ; preds = %222
  %224 = load i32, ptr %29, align 4, !tbaa !11
  %225 = add nsw i32 %224, 1
  store i32 %225, ptr %29, align 4, !tbaa !11
  br label %184, !llvm.loop !19

226:                                              ; preds = %189
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #7
  store i32 0, ptr %34, align 4, !tbaa !11
  br label %227

227:                                              ; preds = %246, %226
  %228 = load i32, ptr %34, align 4, !tbaa !11
  %229 = icmp slt i32 %228, 2
  br i1 %229, label %231, label %230

230:                                              ; preds = %227
  store i32 20, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #7
  br label %249

231:                                              ; preds = %227
  %232 = load i32, ptr %34, align 4, !tbaa !11
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds [2 x i32], ptr %27, i64 0, i64 %233
  %235 = load i32, ptr %234, align 4, !tbaa !11
  %236 = load i32, ptr %34, align 4, !tbaa !11
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [2 x i32], ptr %28, i64 0, i64 %237
  %239 = load i32, ptr %238, align 4, !tbaa !11
  %240 = icmp slt i32 %235, %239
  br i1 %240, label %241, label %245

241:                                              ; preds = %231
  %242 = load i32, ptr %34, align 4, !tbaa !11
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds [2 x %class.R2Vector], ptr %22, i64 0, i64 %243
  call void @_ZN8R2Vector4FlipEv(ptr noundef nonnull align 8 dereferenceable(16) %244)
  br label %245

245:                                              ; preds = %241, %231
  br label %246

246:                                              ; preds = %245
  %247 = load i32, ptr %34, align 4, !tbaa !11
  %248 = add nsw i32 %247, 1
  store i32 %248, ptr %34, align 4, !tbaa !11
  br label %227, !llvm.loop !20

249:                                              ; preds = %230
  %250 = getelementptr inbounds [2 x %class.R2Vector], ptr %22, i64 0, i64 0
  %251 = call noundef double @_ZNK8R2Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(16) %250)
  %252 = load double, ptr @RN_BIG_EPSILON, align 8, !tbaa !9
  %253 = call noundef i32 @_Z9RNIsEqualddd(double noundef %251, double noundef 1.000000e+00, double noundef %252)
  %254 = icmp ne i32 %253, 0
  br i1 %254, label %256, label %255

255:                                              ; preds = %249
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 94, ptr noundef @.str.2)
  br label %256

256:                                              ; preds = %255, %249
  %257 = getelementptr inbounds [2 x %class.R2Vector], ptr %22, i64 0, i64 1
  %258 = call noundef double @_ZNK8R2Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(16) %257)
  %259 = load double, ptr @RN_BIG_EPSILON, align 8, !tbaa !9
  %260 = call noundef i32 @_Z9RNIsEqualddd(double noundef %258, double noundef 1.000000e+00, double noundef %259)
  %261 = icmp ne i32 %260, 0
  br i1 %261, label %263, label %262

262:                                              ; preds = %256
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.3, i32 noundef 95, ptr noundef @.str.2)
  br label %263

263:                                              ; preds = %262, %256
  %264 = getelementptr inbounds [2 x %class.R2Vector], ptr %22, i64 0, i64 0
  %265 = getelementptr inbounds [2 x %class.R2Vector], ptr %22, i64 0, i64 1
  %266 = call noundef double @_ZNK8R2Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(16) %264, ptr noundef nonnull align 8 dereferenceable(16) %265)
  %267 = load double, ptr @RN_BIG_EPSILON, align 8, !tbaa !9
  %268 = call noundef i32 @_Z8RNIsZerodd(double noundef %266, double noundef %267)
  %269 = icmp ne i32 %268, 0
  br i1 %269, label %271, label %270

270:                                              ; preds = %263
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.4, i32 noundef 96, ptr noundef @.str.2)
  br label %271

271:                                              ; preds = %270, %263
  %272 = load ptr, ptr %10, align 8, !tbaa !5
  %273 = icmp ne ptr %272, null
  br i1 %273, label %274, label %283

274:                                              ; preds = %271
  %275 = getelementptr inbounds [2 x double], ptr %20, i64 0, i64 0
  %276 = load double, ptr %275, align 16, !tbaa !9
  %277 = load ptr, ptr %10, align 8, !tbaa !5
  %278 = getelementptr inbounds double, ptr %277, i64 0
  store double %276, ptr %278, align 8, !tbaa !9
  %279 = getelementptr inbounds [2 x double], ptr %20, i64 0, i64 1
  %280 = load double, ptr %279, align 8, !tbaa !9
  %281 = load ptr, ptr %10, align 8, !tbaa !5
  %282 = getelementptr inbounds double, ptr %281, i64 1
  store double %280, ptr %282, align 8, !tbaa !9
  br label %283

283:                                              ; preds = %274, %271
  %284 = getelementptr inbounds [2 x %class.R2Vector], ptr %22, i64 0, i64 0
  %285 = getelementptr inbounds [2 x %class.R2Vector], ptr %22, i64 0, i64 1
  call void @_ZN6R2DiadC1ERK8R2VectorS2_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(16) %284, ptr noundef nonnull align 8 dereferenceable(16) %285)
  store i32 1, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #7
  br label %286

286:                                              ; preds = %283, %104
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #7
  ret void
}

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

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

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

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

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

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

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

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

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

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZN8R2VectordVEd(ptr noundef nonnull align 8 dereferenceable(16), double noundef) #6

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

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

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

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

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

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

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 #6

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

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

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


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

%class.R2Diad = type { [2 x %class.R2Vector] }
%class.R2Vector = type { [2 x double] }

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z15R2PrincipleAxesRK7R2PointRK7RNArrayIPS_EPKdPd(ptr dead_on_unwind noalias writable sret(%class.R2Diad) align 8 %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef readonly %3, ptr noundef writeonly %4) local_unnamed_addr #2 {
  %6 = alloca [4 x double], align 16
  %7 = alloca [4 x double], align 16
  %8 = alloca [2 x double], align 16
  %9 = alloca [4 x double], align 16
  %10 = alloca [2 x %class.R2Vector], align 16
  %11 = alloca %class.R2Vector, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #6
  %12 = tail call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %2)
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph, label %.thread

.lr.ph:                                           ; preds = %5
  %.not77 = icmp eq ptr %3, null
  br label %36

14:                                               ; preds = %42
  %15 = fcmp oeq double %66, 0.000000e+00
  br i1 %15, label %.thread, label %.preheader80.preheader

.preheader80.preheader:                           ; preds = %14
  %16 = insertelement <2 x double> poison, double %66, i64 0
  %17 = shufflevector <2 x double> %16, <2 x double> poison, <2 x i32> zeroinitializer
  %18 = fdiv <2 x double> %60, %17
  store <2 x double> %18, ptr %6, align 16, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %6, i64 16
  %20 = fdiv <2 x double> %65, %17
  store <2 x double> %20, ptr %19, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #6
  call void @_Z14RNSvdDecomposeiiPKdPdS1_S1_(i32 noundef 2, i32 noundef 2, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #6
  call void @_ZN8R2VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %10)
  %.ptr.1 = getelementptr inbounds i8, ptr %10, i64 16
  call void @_ZN8R2VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %.ptr.1)
  %21 = load double, ptr %9, align 16, !tbaa !5
  %22 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %10, i32 noundef 0)
  store double %21, ptr %22, align 8, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %9, i64 8
  %24 = load double, ptr %23, align 8, !tbaa !5
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %10, i32 noundef 1)
  store double %24, ptr %25, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %9, i64 16
  %27 = load double, ptr %26, align 16, !tbaa !5
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %.ptr.1, i32 noundef 0)
  store double %27, ptr %28, align 8, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %9, i64 24
  %30 = load double, ptr %29, align 8, !tbaa !5
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %.ptr.1, i32 noundef 1)
  store double %30, ptr %31, align 8, !tbaa !5
  %32 = call noundef double @_ZNK8R2Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  %33 = call noundef double @_ZNK8R2Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(16) %.ptr.1)
  %34 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %35 = call noundef i32 @_Z12RNIsPositivedd(double noundef %32, double noundef %34)
  %.not = icmp eq i32 %35, 0
  br i1 %.not, label %72, label %70

36:                                               ; preds = %.lr.ph, %42
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %42 ]
  %.06282 = phi double [ 0.000000e+00, %.lr.ph ], [ %66, %42 ]
  %37 = phi <2 x double> [ zeroinitializer, %.lr.ph ], [ %60, %42 ]
  %38 = phi <2 x double> [ zeroinitializer, %.lr.ph ], [ %65, %42 ]
  br i1 %.not77, label %42, label %39

39:                                               ; preds = %36
  %40 = getelementptr inbounds double, ptr %3, i64 %indvars.iv
  %41 = load double, ptr %40, align 8, !tbaa !5
  br label %42

42:                                               ; preds = %36, %39
  %43 = phi double [ %41, %39 ], [ 1.000000e+00, %36 ]
  %44 = trunc nuw nsw i64 %indvars.iv to i32
  %45 = tail call noundef ptr @_ZNK7RNArrayIP7R2PointEixEi(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef %44)
  %46 = tail call noundef double @_ZNK7R2Point1XEv(ptr noundef nonnull align 8 dereferenceable(16) %45)
  %47 = tail call noundef double @_ZNK7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 0)
  %48 = tail call noundef ptr @_ZNK7RNArrayIP7R2PointEixEi(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef %44)
  %49 = tail call noundef double @_ZNK7R2Point1YEv(ptr noundef nonnull align 8 dereferenceable(16) %48)
  %50 = tail call noundef double @_ZNK7R2PointixEi(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef 1)
  %51 = insertelement <2 x double> poison, double %46, i64 0
  %52 = insertelement <2 x double> %51, double %49, i64 1
  %53 = insertelement <2 x double> poison, double %47, i64 0
  %54 = insertelement <2 x double> %53, double %50, i64 1
  %55 = fsub <2 x double> %52, %54
  %56 = extractelement <2 x double> %55, i64 0
  %57 = fmul double %43, %56
  %58 = insertelement <2 x double> poison, double %57, i64 0
  %59 = shufflevector <2 x double> %58, <2 x double> poison, <2 x i32> zeroinitializer
  %60 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %59, <2 x double> %55, <2 x double> %37)
  %61 = extractelement <2 x double> %55, i64 1
  %62 = fmul double %43, %61
  %63 = insertelement <2 x double> poison, double %62, i64 0
  %64 = shufflevector <2 x double> %63, <2 x double> poison, <2 x i32> zeroinitializer
  %65 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %64, <2 x double> %55, <2 x double> %38)
  %66 = fadd double %.06282, %43
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %67 = tail call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %2)
  %68 = sext i32 %67 to i64
  %69 = icmp slt i64 %indvars.iv.next, %68
  br i1 %69, label %36, label %14, !llvm.loop !9

.thread:                                          ; preds = %5, %14
  tail call void @_ZN6R2DiadC1ERKS_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) @R2xy_diad)
  br label %115

70:                                               ; preds = %.preheader80.preheader
  %71 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN8R2VectordVEd(ptr noundef nonnull align 8 dereferenceable(16) %10, double noundef %32)
  br label %72

72:                                               ; preds = %70, %.preheader80.preheader
  %73 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %74 = call noundef i32 @_Z12RNIsPositivedd(double noundef %33, double noundef %73)
  %.not72 = icmp eq i32 %74, 0
  br i1 %.not72, label %77, label %75

75:                                               ; preds = %72
  %76 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN8R2VectordVEd(ptr noundef nonnull align 8 dereferenceable(16) %.ptr.1, double noundef %33)
  br label %77

77:                                               ; preds = %75, %72
  %78 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %2)
  %79 = icmp sgt i32 %78, 0
  br i1 %79, label %.lr.ph96, label %.thread131

.preheader:                                       ; preds = %.lr.ph96
  %80 = icmp ult i32 %.sroa.0120.2, %.sroa.0.2
  br i1 %80, label %93, label %94

.lr.ph96:                                         ; preds = %77, %.lr.ph96
  %.sroa.6122.1 = phi i32 [ %.sroa.6122.2, %.lr.ph96 ], [ 0, %77 ]
  %.sroa.0120.1 = phi i32 [ %.sroa.0120.2, %.lr.ph96 ], [ 0, %77 ]
  %.sroa.6.1 = phi i32 [ %.sroa.6.2, %.lr.ph96 ], [ 0, %77 ]
  %.sroa.0.1 = phi i32 [ %.sroa.0.2, %.lr.ph96 ], [ 0, %77 ]
  %.06594 = phi i32 [ %90, %.lr.ph96 ], [ 0, %77 ]
  %81 = call noundef ptr @_ZNK7RNArrayIP7R2PointEixEi(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef %.06594)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #6
  call void @_ZNK7R2Point6VectorEv(ptr dead_on_unwind nonnull writable sret(%class.R2Vector) align 8 %11, ptr noundef nonnull align 8 dereferenceable(16) %81)
  %82 = call noundef double @_ZNK8R2Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(16) %11)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #6
  %83 = fcmp ogt double %82, 0.000000e+00
  %84 = zext i1 %83 to i32
  %.sroa.0120.2 = add nuw nsw i32 %.sroa.0120.1, %84
  %not. = xor i1 %83, true
  %85 = zext i1 %not. to i32
  %.sroa.0.2 = add nuw nsw i32 %.sroa.0.1, %85
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #6
  call void @_ZNK7R2Point6VectorEv(ptr dead_on_unwind nonnull writable sret(%class.R2Vector) align 8 %11, ptr noundef nonnull align 8 dereferenceable(16) %81)
  %86 = call noundef double @_ZNK8R2Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(16) %.ptr.1, ptr noundef nonnull align 8 dereferenceable(16) %11)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #6
  %87 = fcmp ogt double %86, 0.000000e+00
  %88 = zext i1 %87 to i32
  %.sroa.6122.2 = add nuw nsw i32 %.sroa.6122.1, %88
  %not.138 = xor i1 %87, true
  %89 = zext i1 %not.138 to i32
  %.sroa.6.2 = add nuw nsw i32 %.sroa.6.1, %89
  %90 = add nuw nsw i32 %.06594, 1
  %91 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %2)
  %92 = icmp slt i32 %90, %91
  br i1 %92, label %.lr.ph96, label %.preheader, !llvm.loop !11

93:                                               ; preds = %.preheader
  call void @_ZN8R2Vector4FlipEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  br label %94

94:                                               ; preds = %.preheader, %93
  %95 = icmp ult i32 %.sroa.6122.2, %.sroa.6.2
  br i1 %95, label %96, label %.thread131

96:                                               ; preds = %94
  call void @_ZN8R2Vector4FlipEv(ptr noundef nonnull align 8 dereferenceable(16) %.ptr.1)
  br label %.thread131

.thread131:                                       ; preds = %77, %96, %94
  %97 = call noundef double @_ZNK8R2Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  %98 = load double, ptr @RN_BIG_EPSILON, align 8, !tbaa !5
  %99 = call noundef i32 @_Z9RNIsEqualddd(double noundef %97, double noundef 1.000000e+00, double noundef %98)
  %.not73 = icmp eq i32 %99, 0
  br i1 %.not73, label %100, label %101

100:                                              ; preds = %.thread131
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 94, ptr noundef nonnull @.str.2)
  br label %101

101:                                              ; preds = %100, %.thread131
  %102 = call noundef double @_ZNK8R2Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(16) %.ptr.1)
  %103 = load double, ptr @RN_BIG_EPSILON, align 8, !tbaa !5
  %104 = call noundef i32 @_Z9RNIsEqualddd(double noundef %102, double noundef 1.000000e+00, double noundef %103)
  %.not74 = icmp eq i32 %104, 0
  br i1 %.not74, label %105, label %106

105:                                              ; preds = %101
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.3, i32 noundef 95, ptr noundef nonnull @.str.2)
  br label %106

106:                                              ; preds = %105, %101
  %107 = call noundef double @_ZNK8R2Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(16) %.ptr.1)
  %108 = load double, ptr @RN_BIG_EPSILON, align 8, !tbaa !5
  %109 = call noundef i32 @_Z8RNIsZerodd(double noundef %107, double noundef %108)
  %.not75 = icmp eq i32 %109, 0
  br i1 %.not75, label %110, label %111

110:                                              ; preds = %106
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.4, i32 noundef 96, ptr noundef nonnull @.str.2)
  br label %111

111:                                              ; preds = %110, %106
  %.not76 = icmp eq ptr %4, null
  br i1 %.not76, label %114, label %112

112:                                              ; preds = %111
  %113 = load <2 x double>, ptr %8, align 16, !tbaa !5
  store <2 x double> %113, ptr %4, align 8, !tbaa !5
  br label %114

114:                                              ; preds = %112, %111
  call void @_ZN6R2DiadC1ERK8R2VectorS2_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(16) %.ptr.1)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #6
  br label %115

115:                                              ; preds = %114, %.thread
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #6
  ret void
}

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

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

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

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

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

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

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

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZN8R2VectordVEd(ptr noundef nonnull align 8 dereferenceable(16), double noundef) local_unnamed_addr #4

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

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

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

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

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

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

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 #4

; 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 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 #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress 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 = { 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}


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