; LLVM IR from niessner/Matterport :: code/gaps/pkgs/R3Shapes/R3Grid.ll (ZNK6R3Grid17GridPrincipleAxesEPK7R3PointPd)

; 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.R3Triad = type { [3 x %class.R3Vector] }
%class.R3Vector = type { [3 x double] }
%class.R3Point = type { [3 x double] }
%class.R3Grid = type { %class.R3Affine, %class.R3Affine, double, double, ptr, [3 x i32], i32, i32, i32 }
%class.R3Affine = type { %class.R3Transformation, %class.R4Matrix, %class.R4Matrix, %class.RNFlags }
%class.R3Transformation = type { ptr }
%class.R4Matrix = type { [4 x [4 x double]] }
%class.RNFlags = type { i64 }

@.str = external hidden unnamed_addr constant [41 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [88 x i8], align 1
@R3xyz_triad = external global %class.R3Triad, 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 [49 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.8 = 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: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #2 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK6R3Grid17GridPrincipleAxesEPK7R3PointPd(ptr dead_on_unwind noalias writable sret(%class.R3Triad) align 8 %0, ptr noundef nonnull align 8 dereferenceable(592) %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.R3Point, align 8
  %10 = alloca [9 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 i32, align 4
  %17 = alloca %class.R3Point, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca i32, align 4
  %23 = alloca [9 x double], align 16
  %24 = alloca [3 x double], align 16
  %25 = alloca [9 x double], align 16
  %26 = alloca [3 x %class.R3Vector], align 16
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca [2 x double], align 16
  %30 = alloca [2 x double], align 16
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca %class.R3Point, align 8
  %35 = alloca double, align 8
  %36 = alloca %class.R3Vector, align 8
  %37 = alloca i32, align 4
  %38 = alloca double, align 8
  %39 = alloca i32, align 4
  %40 = alloca %class.R3Vector, 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
  %41 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #6
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = icmp ne ptr %42, null
  br i1 %43, label %44, label %46

44:                                               ; preds = %4
  %45 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN7R3PointC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(24) %45)
  br label %47

46:                                               ; preds = %4
  call void @_ZNK6R3Grid12GridCentroidEv(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %9, ptr noundef nonnull align 8 dereferenceable(592) %41)
  br label %47

47:                                               ; preds = %46, %44
  call void @llvm.lifetime.start.p0(i64 72, ptr %10) #6
  call void @llvm.memset.p0.i64(ptr align 16 %10, i8 0, i64 72, 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
  %48 = getelementptr inbounds %class.R3Grid, ptr %41, i32 0, i32 4
  %49 = load ptr, ptr %48, align 8, !tbaa !11
  store ptr %49, 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 !19
  br label %50

50:                                               ; preds = %172, %47
  %51 = load i32, ptr %13, align 4, !tbaa !19
  %52 = getelementptr inbounds %class.R3Grid, ptr %41, i32 0, i32 5
  %53 = getelementptr inbounds [3 x i32], ptr %52, i64 0, i64 2
  %54 = load i32, ptr %53, align 8, !tbaa !19
  %55 = icmp slt i32 %51, %54
  br i1 %55, label %57, label %56

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

57:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !19
  br label %58

58:                                               ; preds = %168, %57
  %59 = load i32, ptr %15, align 4, !tbaa !19
  %60 = getelementptr inbounds %class.R3Grid, ptr %41, i32 0, i32 5
  %61 = getelementptr inbounds [3 x i32], ptr %60, i64 0, i64 1
  %62 = load i32, ptr %61, align 4, !tbaa !19
  %63 = icmp slt i32 %59, %62
  br i1 %63, label %65, label %64

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

65:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !19
  br label %66

66:                                               ; preds = %164, %65
  %67 = load i32, ptr %16, align 4, !tbaa !19
  %68 = getelementptr inbounds %class.R3Grid, ptr %41, i32 0, i32 5
  %69 = getelementptr inbounds [3 x i32], ptr %68, i64 0, i64 0
  %70 = load i32, ptr %69, align 8, !tbaa !19
  %71 = icmp slt i32 %67, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %66
  store i32 8, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %167

73:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #6
  %74 = load i32, ptr %16, align 4, !tbaa !19
  %75 = sitofp i32 %74 to double
  %76 = load i32, ptr %15, align 4, !tbaa !19
  %77 = sitofp i32 %76 to double
  %78 = load i32, ptr %13, align 4, !tbaa !19
  %79 = sitofp i32 %78 to double
  call void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %17, double noundef %75, double noundef %77, double noundef %79)
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %80 = load ptr, ptr %12, align 8, !tbaa !5
  %81 = getelementptr inbounds double, ptr %80, i32 1
  store ptr %81, ptr %12, align 8, !tbaa !5
  %82 = load double, ptr %80, align 8, !tbaa !9
  store double %82, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %17, i32 noundef 0)
  %84 = load double, ptr %83, align 8, !tbaa !9
  %85 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %9, i32 noundef 0)
  %86 = load double, ptr %85, align 8, !tbaa !9
  %87 = fsub double %84, %86
  store double %87, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %17, i32 noundef 1)
  %89 = load double, ptr %88, align 8, !tbaa !9
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %9, i32 noundef 1)
  %91 = load double, ptr %90, align 8, !tbaa !9
  %92 = fsub double %89, %91
  store double %92, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %17, i32 noundef 2)
  %94 = load double, ptr %93, align 8, !tbaa !9
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %9, i32 noundef 2)
  %96 = load double, ptr %95, align 8, !tbaa !9
  %97 = fsub double %94, %96
  store double %97, ptr %21, align 8, !tbaa !9
  %98 = load double, ptr %18, 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 [9 x double], ptr %10, i64 0, i64 0
  %103 = load double, ptr %102, align 16, !tbaa !9
  %104 = call double @llvm.fmuladd.f64(double %100, double %101, double %103)
  store double %104, ptr %102, align 16, !tbaa !9
  %105 = load double, ptr %18, align 8, !tbaa !9
  %106 = load double, ptr %20, align 8, !tbaa !9
  %107 = fmul double %105, %106
  %108 = load double, ptr %20, align 8, !tbaa !9
  %109 = getelementptr inbounds [9 x double], ptr %10, i64 0, i64 4
  %110 = load double, ptr %109, align 16, !tbaa !9
  %111 = call double @llvm.fmuladd.f64(double %107, double %108, double %110)
  store double %111, ptr %109, align 16, !tbaa !9
  %112 = load double, ptr %18, align 8, !tbaa !9
  %113 = load double, ptr %21, align 8, !tbaa !9
  %114 = fmul double %112, %113
  %115 = load double, ptr %21, align 8, !tbaa !9
  %116 = getelementptr inbounds [9 x double], ptr %10, i64 0, i64 8
  %117 = load double, ptr %116, align 16, !tbaa !9
  %118 = call double @llvm.fmuladd.f64(double %114, double %115, double %117)
  store double %118, ptr %116, align 16, !tbaa !9
  %119 = load double, ptr %18, align 8, !tbaa !9
  %120 = load double, ptr %19, align 8, !tbaa !9
  %121 = fmul double %119, %120
  %122 = load double, ptr %20, align 8, !tbaa !9
  %123 = getelementptr inbounds [9 x double], ptr %10, i64 0, i64 1
  %124 = load double, ptr %123, align 8, !tbaa !9
  %125 = call double @llvm.fmuladd.f64(double %121, double %122, double %124)
  store double %125, ptr %123, align 8, !tbaa !9
  %126 = load double, ptr %18, align 8, !tbaa !9
  %127 = load double, ptr %19, align 8, !tbaa !9
  %128 = fmul double %126, %127
  %129 = load double, ptr %20, align 8, !tbaa !9
  %130 = getelementptr inbounds [9 x double], ptr %10, i64 0, i64 3
  %131 = load double, ptr %130, align 8, !tbaa !9
  %132 = call double @llvm.fmuladd.f64(double %128, double %129, double %131)
  store double %132, ptr %130, align 8, !tbaa !9
  %133 = load double, ptr %18, align 8, !tbaa !9
  %134 = load double, ptr %19, align 8, !tbaa !9
  %135 = fmul double %133, %134
  %136 = load double, ptr %21, align 8, !tbaa !9
  %137 = getelementptr inbounds [9 x double], ptr %10, i64 0, i64 2
  %138 = load double, ptr %137, align 16, !tbaa !9
  %139 = call double @llvm.fmuladd.f64(double %135, double %136, double %138)
  store double %139, ptr %137, align 16, !tbaa !9
  %140 = load double, ptr %18, align 8, !tbaa !9
  %141 = load double, ptr %19, align 8, !tbaa !9
  %142 = fmul double %140, %141
  %143 = load double, ptr %21, align 8, !tbaa !9
  %144 = getelementptr inbounds [9 x double], ptr %10, i64 0, i64 6
  %145 = load double, ptr %144, align 16, !tbaa !9
  %146 = call double @llvm.fmuladd.f64(double %142, double %143, double %145)
  store double %146, ptr %144, align 16, !tbaa !9
  %147 = load double, ptr %18, align 8, !tbaa !9
  %148 = load double, ptr %20, align 8, !tbaa !9
  %149 = fmul double %147, %148
  %150 = load double, ptr %21, align 8, !tbaa !9
  %151 = getelementptr inbounds [9 x double], ptr %10, i64 0, i64 5
  %152 = load double, ptr %151, align 8, !tbaa !9
  %153 = call double @llvm.fmuladd.f64(double %149, double %150, double %152)
  store double %153, ptr %151, align 8, !tbaa !9
  %154 = load double, ptr %18, align 8, !tbaa !9
  %155 = load double, ptr %20, align 8, !tbaa !9
  %156 = fmul double %154, %155
  %157 = load double, ptr %21, align 8, !tbaa !9
  %158 = getelementptr inbounds [9 x double], ptr %10, i64 0, i64 7
  %159 = load double, ptr %158, align 8, !tbaa !9
  %160 = call double @llvm.fmuladd.f64(double %156, double %157, double %159)
  store double %160, ptr %158, align 8, !tbaa !9
  %161 = load double, ptr %18, align 8, !tbaa !9
  %162 = load double, ptr %11, align 8, !tbaa !9
  %163 = fadd double %162, %161
  store double %163, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  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 24, ptr %17) #6
  br label %164

164:                                              ; preds = %73
  %165 = load i32, ptr %16, align 4, !tbaa !19
  %166 = add nsw i32 %165, 1
  store i32 %166, ptr %16, align 4, !tbaa !19
  br label %66, !llvm.loop !20

167:                                              ; preds = %72
  br label %168

168:                                              ; preds = %167
  %169 = load i32, ptr %15, align 4, !tbaa !19
  %170 = add nsw i32 %169, 1
  store i32 %170, ptr %15, align 4, !tbaa !19
  br label %58, !llvm.loop !22

171:                                              ; preds = %64
  br label %172

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

175:                                              ; preds = %56
  %176 = load double, ptr %11, align 8, !tbaa !9
  %177 = fcmp oeq double %176, 0.000000e+00
  br i1 %177, label %178, label %179

178:                                              ; preds = %175
  call void @_ZN7R3TriadC1ERKS_(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(72) @R3xyz_triad)
  store i32 1, ptr %14, align 4
  br label %404

179:                                              ; preds = %175
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  store i32 0, ptr %22, align 4, !tbaa !19
  br label %180

180:                                              ; preds = %191, %179
  %181 = load i32, ptr %22, align 4, !tbaa !19
  %182 = icmp slt i32 %181, 9
  br i1 %182, label %184, label %183

183:                                              ; preds = %180
  store i32 11, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  br label %194

184:                                              ; preds = %180
  %185 = load double, ptr %11, align 8, !tbaa !9
  %186 = load i32, ptr %22, align 4, !tbaa !19
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [9 x double], ptr %10, i64 0, i64 %187
  %189 = load double, ptr %188, align 8, !tbaa !9
  %190 = fdiv double %189, %185
  store double %190, ptr %188, align 8, !tbaa !9
  br label %191

191:                                              ; preds = %184
  %192 = load i32, ptr %22, align 4, !tbaa !19
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %22, align 4, !tbaa !19
  br label %180, !llvm.loop !24

194:                                              ; preds = %183
  call void @llvm.lifetime.start.p0(i64 72, ptr %23) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %24) #6
  call void @llvm.lifetime.start.p0(i64 72, ptr %25) #6
  %195 = getelementptr inbounds [9 x double], ptr %10, i64 0, i64 0
  %196 = getelementptr inbounds [9 x double], ptr %23, i64 0, i64 0
  %197 = getelementptr inbounds [3 x double], ptr %24, i64 0, i64 0
  %198 = getelementptr inbounds [9 x double], ptr %25, i64 0, i64 0
  call void @_Z14RNSvdDecomposeiiPKdPdS1_S1_(i32 noundef 3, i32 noundef 3, ptr noundef %195, ptr noundef %196, ptr noundef %197, ptr noundef %198)
  call void @llvm.lifetime.start.p0(i64 72, ptr %26) #6
  %199 = getelementptr inbounds [3 x %class.R3Vector], ptr %26, i32 0, i32 0
  %200 = getelementptr inbounds %class.R3Vector, ptr %199, i64 3
  br label %201

201:                                              ; preds = %201, %194
  %202 = phi ptr [ %199, %194 ], [ %203, %201 ]
  call void @_ZN8R3VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %202)
  %203 = getelementptr inbounds %class.R3Vector, ptr %202, i64 1
  %204 = icmp eq ptr %203, %200
  br i1 %204, label %205, label %201

205:                                              ; preds = %201
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #6
  store i32 0, ptr %27, align 4, !tbaa !19
  br label %206

206:                                              ; preds = %232, %205
  %207 = load i32, ptr %27, align 4, !tbaa !19
  %208 = icmp slt i32 %207, 3
  br i1 %208, label %210, label %209

209:                                              ; preds = %206
  store i32 14, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  br label %235

210:                                              ; preds = %206
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #6
  store i32 0, ptr %28, align 4, !tbaa !19
  br label %211

211:                                              ; preds = %228, %210
  %212 = load i32, ptr %28, align 4, !tbaa !19
  %213 = icmp slt i32 %212, 3
  br i1 %213, label %215, label %214

214:                                              ; preds = %211
  store i32 17, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #6
  br label %231

215:                                              ; preds = %211
  %216 = load i32, ptr %27, align 4, !tbaa !19
  %217 = mul nsw i32 3, %216
  %218 = load i32, ptr %28, align 4, !tbaa !19
  %219 = add nsw i32 %217, %218
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds [9 x double], ptr %25, i64 0, i64 %220
  %222 = load double, ptr %221, align 8, !tbaa !9
  %223 = load i32, ptr %27, align 4, !tbaa !19
  %224 = sext i32 %223 to i64
  %225 = getelementptr inbounds [3 x %class.R3Vector], ptr %26, i64 0, i64 %224
  %226 = load i32, ptr %28, align 4, !tbaa !19
  %227 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %225, i32 noundef %226)
  store double %222, ptr %227, align 8, !tbaa !9
  br label %228

228:                                              ; preds = %215
  %229 = load i32, ptr %28, align 4, !tbaa !19
  %230 = add nsw i32 %229, 1
  store i32 %230, ptr %28, align 4, !tbaa !19
  br label %211, !llvm.loop !25

231:                                              ; preds = %214
  br label %232

232:                                              ; preds = %231
  %233 = load i32, ptr %27, align 4, !tbaa !19
  %234 = add nsw i32 %233, 1
  store i32 %234, ptr %27, align 4, !tbaa !19
  br label %206, !llvm.loop !26

235:                                              ; preds = %209
  %236 = getelementptr inbounds %class.R3Grid, ptr %41, i32 0, i32 4
  %237 = load ptr, ptr %236, align 8, !tbaa !11
  store ptr %237, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %29) #6
  call void @llvm.memset.p0.i64(ptr align 16 %29, i8 0, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr %30) #6
  call void @llvm.memset.p0.i64(ptr align 16 %30, i8 0, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #6
  store i32 0, ptr %31, align 4, !tbaa !19
  br label %238

238:                                              ; preds = %309, %235
  %239 = load i32, ptr %31, align 4, !tbaa !19
  %240 = getelementptr inbounds %class.R3Grid, ptr %41, i32 0, i32 5
  %241 = getelementptr inbounds [3 x i32], ptr %240, i64 0, i64 2
  %242 = load i32, ptr %241, align 8, !tbaa !19
  %243 = icmp slt i32 %239, %242
  br i1 %243, label %245, label %244

244:                                              ; preds = %238
  store i32 20, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #6
  br label %312

245:                                              ; preds = %238
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #6
  store i32 0, ptr %32, align 4, !tbaa !19
  br label %246

246:                                              ; preds = %305, %245
  %247 = load i32, ptr %32, align 4, !tbaa !19
  %248 = getelementptr inbounds %class.R3Grid, ptr %41, i32 0, i32 5
  %249 = getelementptr inbounds [3 x i32], ptr %248, i64 0, i64 1
  %250 = load i32, ptr %249, align 4, !tbaa !19
  %251 = icmp slt i32 %247, %250
  br i1 %251, label %253, label %252

252:                                              ; preds = %246
  store i32 23, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #6
  br label %308

253:                                              ; preds = %246
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #6
  store i32 0, ptr %33, align 4, !tbaa !19
  br label %254

254:                                              ; preds = %301, %253
  %255 = load i32, ptr %33, align 4, !tbaa !19
  %256 = getelementptr inbounds %class.R3Grid, ptr %41, i32 0, i32 5
  %257 = getelementptr inbounds [3 x i32], ptr %256, i64 0, i64 0
  %258 = load i32, ptr %257, align 8, !tbaa !19
  %259 = icmp slt i32 %255, %258
  br i1 %259, label %261, label %260

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

261:                                              ; preds = %254
  call void @llvm.lifetime.start.p0(i64 24, ptr %34) #6
  %262 = load i32, ptr %33, align 4, !tbaa !19
  %263 = sitofp i32 %262 to double
  %264 = load i32, ptr %32, align 4, !tbaa !19
  %265 = sitofp i32 %264 to double
  %266 = load i32, ptr %31, align 4, !tbaa !19
  %267 = sitofp i32 %266 to double
  call void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %34, double noundef %263, double noundef %265, double noundef %267)
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #6
  %268 = load ptr, ptr %12, align 8, !tbaa !5
  %269 = getelementptr inbounds double, ptr %268, i32 1
  store ptr %269, ptr %12, align 8, !tbaa !5
  %270 = load double, ptr %268, align 8, !tbaa !9
  store double %270, ptr %35, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %36) #6
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %36, ptr noundef nonnull align 8 dereferenceable(24) %34, ptr noundef nonnull align 8 dereferenceable(24) %9)
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #6
  store i32 0, ptr %37, align 4, !tbaa !19
  br label %271

271:                                              ; preds = %297, %261
  %272 = load i32, ptr %37, align 4, !tbaa !19
  %273 = icmp slt i32 %272, 2
  br i1 %273, label %275, label %274

274:                                              ; preds = %271
  store i32 29, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #6
  br label %300

275:                                              ; preds = %271
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #6
  %276 = load i32, ptr %37, align 4, !tbaa !19
  %277 = sext i32 %276 to i64
  %278 = getelementptr inbounds [3 x %class.R3Vector], ptr %26, i64 0, i64 %277
  %279 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %278, ptr noundef nonnull align 8 dereferenceable(24) %36)
  store double %279, ptr %38, align 8, !tbaa !9
  %280 = load double, ptr %38, align 8, !tbaa !9
  %281 = fcmp ogt double %280, 0.000000e+00
  br i1 %281, label %282, label %289

282:                                              ; preds = %275
  %283 = load double, ptr %35, align 8, !tbaa !9
  %284 = load i32, ptr %37, align 4, !tbaa !19
  %285 = sext i32 %284 to i64
  %286 = getelementptr inbounds [2 x double], ptr %29, i64 0, i64 %285
  %287 = load double, ptr %286, align 8, !tbaa !9
  %288 = fadd double %287, %283
  store double %288, ptr %286, align 8, !tbaa !9
  br label %296

289:                                              ; preds = %275
  %290 = load double, ptr %35, align 8, !tbaa !9
  %291 = load i32, ptr %37, align 4, !tbaa !19
  %292 = sext i32 %291 to i64
  %293 = getelementptr inbounds [2 x double], ptr %30, i64 0, i64 %292
  %294 = load double, ptr %293, align 8, !tbaa !9
  %295 = fadd double %294, %290
  store double %295, ptr %293, align 8, !tbaa !9
  br label %296

296:                                              ; preds = %289, %282
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #6
  br label %297

297:                                              ; preds = %296
  %298 = load i32, ptr %37, align 4, !tbaa !19
  %299 = add nsw i32 %298, 1
  store i32 %299, ptr %37, align 4, !tbaa !19
  br label %271, !llvm.loop !27

300:                                              ; preds = %274
  call void @llvm.lifetime.end.p0(i64 24, ptr %36) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %34) #6
  br label %301

301:                                              ; preds = %300
  %302 = load i32, ptr %33, align 4, !tbaa !19
  %303 = add nsw i32 %302, 1
  store i32 %303, ptr %33, align 4, !tbaa !19
  br label %254, !llvm.loop !28

304:                                              ; preds = %260
  br label %305

305:                                              ; preds = %304
  %306 = load i32, ptr %32, align 4, !tbaa !19
  %307 = add nsw i32 %306, 1
  store i32 %307, ptr %32, align 4, !tbaa !19
  br label %246, !llvm.loop !29

308:                                              ; preds = %252
  br label %309

309:                                              ; preds = %308
  %310 = load i32, ptr %31, align 4, !tbaa !19
  %311 = add nsw i32 %310, 1
  store i32 %311, ptr %31, align 4, !tbaa !19
  br label %238, !llvm.loop !30

312:                                              ; preds = %244
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #6
  store i32 0, ptr %39, align 4, !tbaa !19
  br label %313

313:                                              ; preds = %332, %312
  %314 = load i32, ptr %39, align 4, !tbaa !19
  %315 = icmp slt i32 %314, 2
  br i1 %315, label %317, label %316

316:                                              ; preds = %313
  store i32 32, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #6
  br label %335

317:                                              ; preds = %313
  %318 = load i32, ptr %39, align 4, !tbaa !19
  %319 = sext i32 %318 to i64
  %320 = getelementptr inbounds [2 x double], ptr %29, i64 0, i64 %319
  %321 = load double, ptr %320, align 8, !tbaa !9
  %322 = load i32, ptr %39, align 4, !tbaa !19
  %323 = sext i32 %322 to i64
  %324 = getelementptr inbounds [2 x double], ptr %30, i64 0, i64 %323
  %325 = load double, ptr %324, align 8, !tbaa !9
  %326 = fcmp olt double %321, %325
  br i1 %326, label %327, label %331

327:                                              ; preds = %317
  %328 = load i32, ptr %39, align 4, !tbaa !19
  %329 = sext i32 %328 to i64
  %330 = getelementptr inbounds [3 x %class.R3Vector], ptr %26, i64 0, i64 %329
  call void @_ZN8R3Vector4FlipEv(ptr noundef nonnull align 8 dereferenceable(24) %330)
  br label %331

331:                                              ; preds = %327, %317
  br label %332

332:                                              ; preds = %331
  %333 = load i32, ptr %39, align 4, !tbaa !19
  %334 = add nsw i32 %333, 1
  store i32 %334, ptr %39, align 4, !tbaa !19
  br label %313, !llvm.loop !31

335:                                              ; preds = %316
  call void @llvm.lifetime.start.p0(i64 24, ptr %40) #6
  %336 = getelementptr inbounds [3 x %class.R3Vector], ptr %26, i64 0, i64 0
  %337 = getelementptr inbounds [3 x %class.R3Vector], ptr %26, i64 0, i64 1
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %40, ptr noundef nonnull align 8 dereferenceable(24) %336, ptr noundef nonnull align 8 dereferenceable(24) %337)
  %338 = getelementptr inbounds [3 x %class.R3Vector], ptr %26, i64 0, i64 2
  %339 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %338, ptr noundef nonnull align 8 dereferenceable(24) %40)
  call void @llvm.lifetime.end.p0(i64 24, ptr %40) #6
  %340 = getelementptr inbounds [3 x %class.R3Vector], ptr %26, i64 0, i64 0
  %341 = call noundef double @_ZNK8R3Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(24) %340)
  %342 = load double, ptr @RN_BIG_EPSILON, align 8, !tbaa !9
  %343 = call noundef i32 @_Z9RNIsEqualddd(double noundef %341, double noundef 1.000000e+00, double noundef %342)
  %344 = icmp ne i32 %343, 0
  br i1 %344, label %346, label %345

345:                                              ; preds = %335
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.3, i32 noundef 442, ptr noundef @.str.2)
  br label %346

346:                                              ; preds = %345, %335
  %347 = getelementptr inbounds [3 x %class.R3Vector], ptr %26, i64 0, i64 1
  %348 = call noundef double @_ZNK8R3Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(24) %347)
  %349 = load double, ptr @RN_BIG_EPSILON, align 8, !tbaa !9
  %350 = call noundef i32 @_Z9RNIsEqualddd(double noundef %348, double noundef 1.000000e+00, double noundef %349)
  %351 = icmp ne i32 %350, 0
  br i1 %351, label %353, label %352

352:                                              ; preds = %346
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.4, i32 noundef 443, ptr noundef @.str.2)
  br label %353

353:                                              ; preds = %352, %346
  %354 = getelementptr inbounds [3 x %class.R3Vector], ptr %26, i64 0, i64 2
  %355 = call noundef double @_ZNK8R3Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(24) %354)
  %356 = load double, ptr @RN_BIG_EPSILON, align 8, !tbaa !9
  %357 = call noundef i32 @_Z9RNIsEqualddd(double noundef %355, double noundef 1.000000e+00, double noundef %356)
  %358 = icmp ne i32 %357, 0
  br i1 %358, label %360, label %359

359:                                              ; preds = %353
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.5, i32 noundef 444, ptr noundef @.str.2)
  br label %360

360:                                              ; preds = %359, %353
  %361 = getelementptr inbounds [3 x %class.R3Vector], ptr %26, i64 0, i64 0
  %362 = getelementptr inbounds [3 x %class.R3Vector], ptr %26, i64 0, i64 1
  %363 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %361, ptr noundef nonnull align 8 dereferenceable(24) %362)
  %364 = load double, ptr @RN_BIG_EPSILON, align 8, !tbaa !9
  %365 = call noundef i32 @_Z8RNIsZerodd(double noundef %363, double noundef %364)
  %366 = icmp ne i32 %365, 0
  br i1 %366, label %368, label %367

367:                                              ; preds = %360
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.6, i32 noundef 445, ptr noundef @.str.2)
  br label %368

368:                                              ; preds = %367, %360
  %369 = getelementptr inbounds [3 x %class.R3Vector], ptr %26, i64 0, i64 1
  %370 = getelementptr inbounds [3 x %class.R3Vector], ptr %26, i64 0, i64 2
  %371 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %369, ptr noundef nonnull align 8 dereferenceable(24) %370)
  %372 = load double, ptr @RN_BIG_EPSILON, align 8, !tbaa !9
  %373 = call noundef i32 @_Z8RNIsZerodd(double noundef %371, double noundef %372)
  %374 = icmp ne i32 %373, 0
  br i1 %374, label %376, label %375

375:                                              ; preds = %368
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.7, i32 noundef 446, ptr noundef @.str.2)
  br label %376

376:                                              ; preds = %375, %368
  %377 = getelementptr inbounds [3 x %class.R3Vector], ptr %26, i64 0, i64 0
  %378 = getelementptr inbounds [3 x %class.R3Vector], ptr %26, i64 0, i64 2
  %379 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %377, ptr noundef nonnull align 8 dereferenceable(24) %378)
  %380 = load double, ptr @RN_BIG_EPSILON, align 8, !tbaa !9
  %381 = call noundef i32 @_Z8RNIsZerodd(double noundef %379, double noundef %380)
  %382 = icmp ne i32 %381, 0
  br i1 %382, label %384, label %383

383:                                              ; preds = %376
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef @.str, ptr noundef @.str.8, i32 noundef 447, ptr noundef @.str.2)
  br label %384

384:                                              ; preds = %383, %376
  %385 = load ptr, ptr %8, align 8, !tbaa !5
  %386 = icmp ne ptr %385, null
  br i1 %386, label %387, label %400

387:                                              ; preds = %384
  %388 = getelementptr inbounds [3 x double], ptr %24, i64 0, i64 0
  %389 = load double, ptr %388, align 16, !tbaa !9
  %390 = load ptr, ptr %8, align 8, !tbaa !5
  %391 = getelementptr inbounds double, ptr %390, i64 0
  store double %389, ptr %391, align 8, !tbaa !9
  %392 = getelementptr inbounds [3 x double], ptr %24, i64 0, i64 1
  %393 = load double, ptr %392, align 8, !tbaa !9
  %394 = load ptr, ptr %8, align 8, !tbaa !5
  %395 = getelementptr inbounds double, ptr %394, i64 1
  store double %393, ptr %395, align 8, !tbaa !9
  %396 = getelementptr inbounds [3 x double], ptr %24, i64 0, i64 2
  %397 = load double, ptr %396, align 16, !tbaa !9
  %398 = load ptr, ptr %8, align 8, !tbaa !5
  %399 = getelementptr inbounds double, ptr %398, i64 2
  store double %397, ptr %399, align 8, !tbaa !9
  br label %400

400:                                              ; preds = %387, %384
  %401 = getelementptr inbounds [3 x %class.R3Vector], ptr %26, i64 0, i64 0
  %402 = getelementptr inbounds [3 x %class.R3Vector], ptr %26, i64 0, i64 1
  %403 = getelementptr inbounds [3 x %class.R3Vector], ptr %26, i64 0, i64 2
  call void @_ZN7R3TriadC1ERK8R3VectorS2_S2_(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(24) %401, ptr noundef nonnull align 8 dereferenceable(24) %402, ptr noundef nonnull align 8 dereferenceable(24) %403)
  store i32 1, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr %23) #6
  br label %404

404:                                              ; preds = %400, %178
  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 72, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #6
  ret void
}

declare void @_ZN7R3PointC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) 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

declare void @_ZN7R3TriadC1ERKS_(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(72)) unnamed_addr #0

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

declare void @_ZN8R3VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0

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

declare void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #0

declare noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #0

declare void @_ZN8R3Vector4FlipEv(ptr noundef nonnull align 8 dereferenceable(24)) #0

declare void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #0

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #0

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

declare noundef double @_ZNK8R3Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(24)) #0

declare void @_ZN7R3TriadC1ERK8R3VectorS2_S2_(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) 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 560}
!12 = !{!"_ZTS6R3Grid", !13, i64 0, !13, i64 272, !10, i64 544, !10, i64 552, !6, i64 560, !7, i64 568, !18, i64 580, !18, i64 584, !18, i64 588}
!13 = !{!"_ZTS8R3Affine", !14, i64 0, !15, i64 8, !15, i64 136, !16, i64 264}
!14 = !{!"_ZTS16R3Transformation"}
!15 = !{!"_ZTS8R4Matrix", !7, i64 0}
!16 = !{!"_ZTS7RNFlags", !17, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!"int", !7, i64 0}
!19 = !{!18, !18, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}
!23 = distinct !{!23, !21}
!24 = distinct !{!24, !21}
!25 = distinct !{!25, !21}
!26 = distinct !{!26, !21}
!27 = distinct !{!27, !21}
!28 = distinct !{!28, !21}
!29 = distinct !{!29, !21}
!30 = distinct !{!30, !21}
!31 = distinct !{!31, !21}


; 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.R3Triad = type { [3 x %class.R3Vector] }
%class.R3Vector = type { [3 x double] }
%class.R3Point = type { [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
@R3xyz_triad = external global %class.R3Triad, 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 [49 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.8 = 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 nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3

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

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

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

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

15:                                               ; preds = %4
  call void @_ZN7R3PointC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %2)
  br label %17

16:                                               ; preds = %4
  call void @_ZNK6R3Grid12GridCentroidEv(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %5, ptr noundef nonnull align 8 dereferenceable(592) %1)
  br label %17

17:                                               ; preds = %16, %15
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %6) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(72) %6, i8 0, i64 72, i1 false)
  %18 = getelementptr inbounds i8, ptr %1, i64 560
  %19 = getelementptr inbounds i8, ptr %1, i64 568
  %20 = getelementptr inbounds i8, ptr %1, i64 576
  %21 = load i32, ptr %20, align 8, !tbaa !5
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.preheader111.lr.ph, label %._crit_edge127.thread

.preheader111.lr.ph:                              ; preds = %17
  %23 = getelementptr inbounds i8, ptr %1, i64 572
  %24 = getelementptr inbounds i8, ptr %6, i64 32
  %25 = getelementptr inbounds i8, ptr %6, i64 64
  %26 = getelementptr inbounds i8, ptr %6, i64 16
  %27 = getelementptr inbounds i8, ptr %6, i64 48
  %28 = load i32, ptr %23, align 4, !tbaa !5
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %.preheader111.preheader, label %._crit_edge127.thread

.preheader111.preheader:                          ; preds = %.preheader111.lr.ph
  %30 = load ptr, ptr %18, align 8, !tbaa !9
  br label %.preheader111

.preheader111:                                    ; preds = %.preheader111.preheader, %._crit_edge120
  %31 = phi double [ %92, %._crit_edge120 ], [ 0.000000e+00, %.preheader111.preheader ]
  %32 = phi i32 [ %93, %._crit_edge120 ], [ %21, %.preheader111.preheader ]
  %33 = phi i32 [ %94, %._crit_edge120 ], [ %28, %.preheader111.preheader ]
  %34 = phi i32 [ %95, %._crit_edge120 ], [ %28, %.preheader111.preheader ]
  %.081126 = phi double [ %.1.lcssa, %._crit_edge120 ], [ 0.000000e+00, %.preheader111.preheader ]
  %.083125 = phi ptr [ %.184.lcssa, %._crit_edge120 ], [ %30, %.preheader111.preheader ]
  %.092124 = phi i32 [ %100, %._crit_edge120 ], [ 0, %.preheader111.preheader ]
  %35 = phi <2 x double> [ %96, %._crit_edge120 ], [ zeroinitializer, %.preheader111.preheader ]
  %36 = phi <2 x double> [ %97, %._crit_edge120 ], [ zeroinitializer, %.preheader111.preheader ]
  %37 = phi <2 x double> [ %98, %._crit_edge120 ], [ zeroinitializer, %.preheader111.preheader ]
  %38 = phi <2 x double> [ %99, %._crit_edge120 ], [ zeroinitializer, %.preheader111.preheader ]
  %39 = icmp sgt i32 %34, 0
  br i1 %39, label %.preheader110.lr.ph, label %._crit_edge120

.preheader110.lr.ph:                              ; preds = %.preheader111
  %40 = uitofp nneg i32 %.092124 to double
  %41 = load i32, ptr %19, align 8, !tbaa !5
  %42 = icmp sgt i32 %41, 0
  br i1 %42, label %.preheader110, label %._crit_edge120

._crit_edge127:                                   ; preds = %._crit_edge120
  %43 = fcmp oeq double %.1.lcssa, 0.000000e+00
  br i1 %43, label %._crit_edge127.thread, label %.preheader109.preheader

.preheader109.preheader:                          ; preds = %._crit_edge127
  %44 = insertelement <2 x double> poison, double %.1.lcssa, i64 0
  %45 = shufflevector <2 x double> %44, <2 x double> poison, <2 x i32> zeroinitializer
  %46 = fdiv <2 x double> %96, %45
  store <2 x double> %46, ptr %6, align 16, !tbaa !18
  %47 = getelementptr inbounds i8, ptr %6, i64 16
  %48 = fdiv <2 x double> %97, %45
  store <2 x double> %48, ptr %47, align 16, !tbaa !18
  %49 = getelementptr inbounds i8, ptr %6, i64 32
  %50 = fdiv <2 x double> %98, %45
  store <2 x double> %50, ptr %49, align 16, !tbaa !18
  %51 = getelementptr inbounds i8, ptr %6, i64 48
  %52 = fdiv <2 x double> %99, %45
  store <2 x double> %52, ptr %51, align 16, !tbaa !18
  %53 = getelementptr inbounds i8, ptr %6, i64 64
  %54 = fdiv double %92, %.1.lcssa
  store double %54, ptr %53, align 16, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %10) #7
  call void @_Z14RNSvdDecomposeiiPKdPdS1_S1_(i32 noundef 3, i32 noundef 3, ptr noundef nonnull %6, ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %10)
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %11) #7
  call void @_ZN8R3VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %11)
  %.ptr.1 = getelementptr inbounds i8, ptr %11, i64 24
  call void @_ZN8R3VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1)
  %.ptr.2 = getelementptr inbounds i8, ptr %11, i64 48
  call void @_ZN8R3VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.2)
  %55 = load double, ptr %10, align 16, !tbaa !18
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %11, i32 noundef 0)
  store double %55, ptr %56, align 8, !tbaa !18
  %57 = getelementptr inbounds i8, ptr %10, i64 8
  %58 = load double, ptr %57, align 8, !tbaa !18
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %11, i32 noundef 1)
  store double %58, ptr %59, align 8, !tbaa !18
  %60 = getelementptr inbounds i8, ptr %10, i64 16
  %61 = load double, ptr %60, align 16, !tbaa !18
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %11, i32 noundef 2)
  store double %61, ptr %62, align 8, !tbaa !18
  %63 = getelementptr inbounds i8, ptr %10, i64 24
  %64 = load double, ptr %63, align 8, !tbaa !18
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1, i32 noundef 0)
  store double %64, ptr %65, align 8, !tbaa !18
  %66 = getelementptr inbounds i8, ptr %10, i64 32
  %67 = load double, ptr %66, align 16, !tbaa !18
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1, i32 noundef 1)
  store double %67, ptr %68, align 8, !tbaa !18
  %69 = getelementptr inbounds i8, ptr %10, i64 40
  %70 = load double, ptr %69, align 8, !tbaa !18
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1, i32 noundef 2)
  store double %70, ptr %71, align 8, !tbaa !18
  %72 = getelementptr inbounds i8, ptr %10, i64 48
  %73 = load double, ptr %72, align 16, !tbaa !18
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.2, i32 noundef 0)
  store double %73, ptr %74, align 8, !tbaa !18
  %75 = getelementptr inbounds i8, ptr %10, i64 56
  %76 = load double, ptr %75, align 8, !tbaa !18
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.2, i32 noundef 1)
  store double %76, ptr %77, align 8, !tbaa !18
  %78 = getelementptr inbounds i8, ptr %10, i64 64
  %79 = load double, ptr %78, align 16, !tbaa !18
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.2, i32 noundef 2)
  store double %79, ptr %80, align 8, !tbaa !18
  %81 = load i32, ptr %20, align 8, !tbaa !5
  %82 = icmp sgt i32 %81, 0
  br i1 %82, label %.preheader106.lr.ph, label %.thread

.preheader110:                                    ; preds = %.preheader110.lr.ph, %._crit_edge
  %83 = phi double [ %102, %._crit_edge ], [ %31, %.preheader110.lr.ph ]
  %84 = phi i32 [ %103, %._crit_edge ], [ %33, %.preheader110.lr.ph ]
  %85 = phi i32 [ %104, %._crit_edge ], [ %41, %.preheader110.lr.ph ]
  %.1119 = phi double [ %.2.lcssa, %._crit_edge ], [ %.081126, %.preheader110.lr.ph ]
  %.184118 = phi ptr [ %.285.lcssa, %._crit_edge ], [ %.083125, %.preheader110.lr.ph ]
  %.093117 = phi i32 [ %109, %._crit_edge ], [ 0, %.preheader110.lr.ph ]
  %86 = phi <2 x double> [ %105, %._crit_edge ], [ %35, %.preheader110.lr.ph ]
  %87 = phi <2 x double> [ %106, %._crit_edge ], [ %36, %.preheader110.lr.ph ]
  %88 = phi <2 x double> [ %107, %._crit_edge ], [ %37, %.preheader110.lr.ph ]
  %89 = phi <2 x double> [ %108, %._crit_edge ], [ %38, %.preheader110.lr.ph ]
  %90 = icmp sgt i32 %85, 0
  br i1 %90, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader110
  %91 = uitofp nneg i32 %.093117 to double
  br label %111

._crit_edge120.loopexit:                          ; preds = %._crit_edge
  %.pre166 = load i32, ptr %20, align 8, !tbaa !5
  br label %._crit_edge120

._crit_edge120:                                   ; preds = %.preheader110.lr.ph, %._crit_edge120.loopexit, %.preheader111
  %92 = phi double [ %31, %.preheader111 ], [ %102, %._crit_edge120.loopexit ], [ %31, %.preheader110.lr.ph ]
  %93 = phi i32 [ %32, %.preheader111 ], [ %.pre166, %._crit_edge120.loopexit ], [ %32, %.preheader110.lr.ph ]
  %94 = phi i32 [ %33, %.preheader111 ], [ %103, %._crit_edge120.loopexit ], [ %33, %.preheader110.lr.ph ]
  %95 = phi i32 [ %34, %.preheader111 ], [ %103, %._crit_edge120.loopexit ], [ %34, %.preheader110.lr.ph ]
  %.184.lcssa = phi ptr [ %.083125, %.preheader111 ], [ %.285.lcssa, %._crit_edge120.loopexit ], [ %.083125, %.preheader110.lr.ph ]
  %.1.lcssa = phi double [ %.081126, %.preheader111 ], [ %.2.lcssa, %._crit_edge120.loopexit ], [ %.081126, %.preheader110.lr.ph ]
  %96 = phi <2 x double> [ %35, %.preheader111 ], [ %105, %._crit_edge120.loopexit ], [ %35, %.preheader110.lr.ph ]
  %97 = phi <2 x double> [ %36, %.preheader111 ], [ %106, %._crit_edge120.loopexit ], [ %36, %.preheader110.lr.ph ]
  %98 = phi <2 x double> [ %37, %.preheader111 ], [ %107, %._crit_edge120.loopexit ], [ %37, %.preheader110.lr.ph ]
  %99 = phi <2 x double> [ %38, %.preheader111 ], [ %108, %._crit_edge120.loopexit ], [ %38, %.preheader110.lr.ph ]
  %100 = add nuw nsw i32 %.092124, 1
  %101 = icmp slt i32 %100, %93
  br i1 %101, label %.preheader111, label %._crit_edge127, !llvm.loop !19

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

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader110
  %102 = phi double [ %83, %.preheader110 ], [ %130, %._crit_edge.loopexit ]
  %103 = phi i32 [ %84, %.preheader110 ], [ %.pre, %._crit_edge.loopexit ]
  %104 = phi i32 [ %85, %.preheader110 ], [ %156, %._crit_edge.loopexit ]
  %.285.lcssa = phi ptr [ %.184118, %.preheader110 ], [ %113, %._crit_edge.loopexit ]
  %.2.lcssa = phi double [ %.1119, %.preheader110 ], [ %154, %._crit_edge.loopexit ]
  %105 = phi <2 x double> [ %86, %.preheader110 ], [ %146, %._crit_edge.loopexit ]
  %106 = phi <2 x double> [ %87, %.preheader110 ], [ %147, %._crit_edge.loopexit ]
  %107 = phi <2 x double> [ %88, %.preheader110 ], [ %153, %._crit_edge.loopexit ]
  %108 = phi <2 x double> [ %89, %.preheader110 ], [ %151, %._crit_edge.loopexit ]
  %109 = add nuw nsw i32 %.093117, 1
  %110 = icmp slt i32 %109, %103
  br i1 %110, label %.preheader110, label %._crit_edge120.loopexit, !llvm.loop !22

111:                                              ; preds = %.lr.ph, %111
  %.2115 = phi double [ %.1119, %.lr.ph ], [ %154, %111 ]
  %.285114 = phi ptr [ %.184118, %.lr.ph ], [ %113, %111 ]
  %.094113 = phi i32 [ 0, %.lr.ph ], [ %155, %111 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #7
  %112 = uitofp nneg i32 %.094113 to double
  call void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %7, double noundef %112, double noundef %91, double noundef %40)
  %113 = getelementptr inbounds i8, ptr %.285114, i64 8
  %114 = load double, ptr %.285114, align 8, !tbaa !18
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %7, i32 noundef 0)
  %116 = load double, ptr %115, align 8, !tbaa !18
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef 0)
  %118 = load double, ptr %117, align 8, !tbaa !18
  %119 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %7, i32 noundef 1)
  %120 = load double, ptr %119, align 8, !tbaa !18
  %121 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef 1)
  %122 = load double, ptr %121, align 8, !tbaa !18
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %7, i32 noundef 2)
  %124 = load double, ptr %123, align 8, !tbaa !18
  %125 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef 2)
  %126 = load double, ptr %125, align 8, !tbaa !18
  %127 = fsub double %124, %126
  %128 = fmul double %114, %127
  %129 = load double, ptr %25, align 16, !tbaa !18
  %130 = call double @llvm.fmuladd.f64(double %128, double %127, double %129)
  store double %130, ptr %25, align 16, !tbaa !18
  %131 = insertelement <2 x double> poison, double %116, i64 0
  %132 = insertelement <2 x double> %131, double %120, i64 1
  %133 = insertelement <2 x double> poison, double %118, i64 0
  %134 = insertelement <2 x double> %133, double %122, i64 1
  %135 = fsub <2 x double> %132, %134
  %136 = load <2 x double>, ptr %6, align 16, !tbaa !18
  %137 = load <2 x double>, ptr %26, align 16, !tbaa !18
  %138 = insertelement <2 x double> %135, double %127, i64 0
  %139 = load <2 x double>, ptr %24, align 16, !tbaa !18
  %140 = shufflevector <2 x double> %135, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %141 = insertelement <2 x double> %140, double %127, i64 1
  %142 = insertelement <2 x double> poison, double %114, i64 0
  %143 = shufflevector <2 x double> %142, <2 x double> poison, <2 x i32> zeroinitializer
  %144 = fmul <2 x double> %143, %135
  %145 = shufflevector <2 x double> %144, <2 x double> poison, <2 x i32> zeroinitializer
  %146 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %145, <2 x double> %135, <2 x double> %136)
  store <2 x double> %146, ptr %6, align 16, !tbaa !18
  %147 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %145, <2 x double> %138, <2 x double> %137)
  store <2 x double> %147, ptr %26, align 16, !tbaa !18
  %148 = load <2 x double>, ptr %27, align 16, !tbaa !18
  %149 = insertelement <2 x double> poison, double %127, i64 0
  %150 = shufflevector <2 x double> %149, <2 x double> poison, <2 x i32> zeroinitializer
  %151 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %144, <2 x double> %150, <2 x double> %148)
  %152 = shufflevector <2 x double> %144, <2 x double> poison, <2 x i32> <i32 1, i32 1>
  %153 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %152, <2 x double> %141, <2 x double> %139)
  store <2 x double> %153, ptr %24, align 16, !tbaa !18
  store <2 x double> %151, ptr %27, align 16, !tbaa !18
  %154 = fadd double %.2115, %114
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #7
  %155 = add nuw nsw i32 %.094113, 1
  %156 = load i32, ptr %19, align 8, !tbaa !5
  %157 = icmp slt i32 %155, %156
  br i1 %157, label %111, label %._crit_edge.loopexit, !llvm.loop !23

._crit_edge127.thread:                            ; preds = %.preheader111.lr.ph, %17, %._crit_edge127
  call void @_ZN7R3TriadC1ERKS_(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(72) @R3xyz_triad)
  br label %239

.preheader106.lr.ph:                              ; preds = %.preheader109.preheader
  %158 = getelementptr inbounds i8, ptr %1, i64 572
  %159 = load i32, ptr %158, align 4, !tbaa !5
  %160 = icmp sgt i32 %159, 0
  br i1 %160, label %.preheader106.preheader, label %.thread

.preheader106.preheader:                          ; preds = %.preheader106.lr.ph
  %161 = load ptr, ptr %18, align 8, !tbaa !9
  br label %.preheader106

.preheader106:                                    ; preds = %.preheader106.preheader, %._crit_edge143
  %162 = phi i32 [ %174, %._crit_edge143 ], [ %81, %.preheader106.preheader ]
  %163 = phi i32 [ %175, %._crit_edge143 ], [ %159, %.preheader106.preheader ]
  %164 = phi i32 [ %176, %._crit_edge143 ], [ %159, %.preheader106.preheader ]
  %.sroa.0162.0 = phi double [ %.sroa.0162.3, %._crit_edge143 ], [ 0.000000e+00, %.preheader106.preheader ]
  %.sroa.6164.0 = phi double [ %.sroa.6164.3, %._crit_edge143 ], [ 0.000000e+00, %.preheader106.preheader ]
  %.sroa.0.0 = phi double [ %.sroa.0.3, %._crit_edge143 ], [ 0.000000e+00, %.preheader106.preheader ]
  %.sroa.6.0 = phi double [ %.sroa.6.3, %._crit_edge143 ], [ 0.000000e+00, %.preheader106.preheader ]
  %.3147 = phi ptr [ %.4.lcssa, %._crit_edge143 ], [ %161, %.preheader106.preheader ]
  %.088146 = phi i32 [ %177, %._crit_edge143 ], [ 0, %.preheader106.preheader ]
  %165 = icmp sgt i32 %164, 0
  br i1 %165, label %.preheader105.lr.ph, label %._crit_edge143

.preheader105.lr.ph:                              ; preds = %.preheader106
  %166 = uitofp nneg i32 %.088146 to double
  %167 = load i32, ptr %19, align 8, !tbaa !5
  %168 = icmp sgt i32 %167, 0
  br i1 %168, label %.preheader105, label %._crit_edge143

.preheader:                                       ; preds = %._crit_edge143
  %169 = fcmp olt double %.sroa.0162.3, %.sroa.0.3
  br i1 %169, label %198, label %199

.preheader105:                                    ; preds = %.preheader105.lr.ph, %._crit_edge139
  %170 = phi i32 [ %179, %._crit_edge139 ], [ %163, %.preheader105.lr.ph ]
  %171 = phi i32 [ %180, %._crit_edge139 ], [ %167, %.preheader105.lr.ph ]
  %.sroa.0162.2 = phi double [ %.sroa.0162.4, %._crit_edge139 ], [ %.sroa.0162.0, %.preheader105.lr.ph ]
  %.sroa.6164.2 = phi double [ %.sroa.6164.4, %._crit_edge139 ], [ %.sroa.6164.0, %.preheader105.lr.ph ]
  %.sroa.0.2 = phi double [ %.sroa.0.4, %._crit_edge139 ], [ %.sroa.0.0, %.preheader105.lr.ph ]
  %.sroa.6.2 = phi double [ %.sroa.6.4, %._crit_edge139 ], [ %.sroa.6.0, %.preheader105.lr.ph ]
  %.4142 = phi ptr [ %.5.lcssa, %._crit_edge139 ], [ %.3147, %.preheader105.lr.ph ]
  %.087141 = phi i32 [ %181, %._crit_edge139 ], [ 0, %.preheader105.lr.ph ]
  %172 = icmp sgt i32 %171, 0
  br i1 %172, label %.lr.ph138, label %._crit_edge139

.lr.ph138:                                        ; preds = %.preheader105
  %173 = uitofp nneg i32 %.087141 to double
  br label %183

._crit_edge143.loopexit:                          ; preds = %._crit_edge139
  %.pre168 = load i32, ptr %20, align 8, !tbaa !5
  br label %._crit_edge143

._crit_edge143:                                   ; preds = %.preheader105.lr.ph, %._crit_edge143.loopexit, %.preheader106
  %174 = phi i32 [ %.pre168, %._crit_edge143.loopexit ], [ %162, %.preheader106 ], [ %162, %.preheader105.lr.ph ]
  %175 = phi i32 [ %179, %._crit_edge143.loopexit ], [ %163, %.preheader106 ], [ %163, %.preheader105.lr.ph ]
  %176 = phi i32 [ %179, %._crit_edge143.loopexit ], [ %164, %.preheader106 ], [ %164, %.preheader105.lr.ph ]
  %.sroa.0162.3 = phi double [ %.sroa.0162.4, %._crit_edge143.loopexit ], [ %.sroa.0162.0, %.preheader106 ], [ %.sroa.0162.0, %.preheader105.lr.ph ]
  %.sroa.6164.3 = phi double [ %.sroa.6164.4, %._crit_edge143.loopexit ], [ %.sroa.6164.0, %.preheader106 ], [ %.sroa.6164.0, %.preheader105.lr.ph ]
  %.sroa.0.3 = phi double [ %.sroa.0.4, %._crit_edge143.loopexit ], [ %.sroa.0.0, %.preheader106 ], [ %.sroa.0.0, %.preheader105.lr.ph ]
  %.sroa.6.3 = phi double [ %.sroa.6.4, %._crit_edge143.loopexit ], [ %.sroa.6.0, %.preheader106 ], [ %.sroa.6.0, %.preheader105.lr.ph ]
  %.4.lcssa = phi ptr [ %.5.lcssa, %._crit_edge143.loopexit ], [ %.3147, %.preheader106 ], [ %.3147, %.preheader105.lr.ph ]
  %177 = add nuw nsw i32 %.088146, 1
  %178 = icmp slt i32 %177, %174
  br i1 %178, label %.preheader106, label %.preheader, !llvm.loop !24

._crit_edge139.loopexit:                          ; preds = %183
  %.pre167 = load i32, ptr %158, align 4, !tbaa !5
  br label %._crit_edge139

._crit_edge139:                                   ; preds = %._crit_edge139.loopexit, %.preheader105
  %179 = phi i32 [ %.pre167, %._crit_edge139.loopexit ], [ %170, %.preheader105 ]
  %180 = phi i32 [ %196, %._crit_edge139.loopexit ], [ %171, %.preheader105 ]
  %.sroa.0162.4 = phi double [ %.sroa.0162.6, %._crit_edge139.loopexit ], [ %.sroa.0162.2, %.preheader105 ]
  %.sroa.6164.4 = phi double [ %.sroa.6164.6, %._crit_edge139.loopexit ], [ %.sroa.6164.2, %.preheader105 ]
  %.sroa.0.4 = phi double [ %.sroa.0.6, %._crit_edge139.loopexit ], [ %.sroa.0.2, %.preheader105 ]
  %.sroa.6.4 = phi double [ %.sroa.6.6, %._crit_edge139.loopexit ], [ %.sroa.6.2, %.preheader105 ]
  %.5.lcssa = phi ptr [ %194, %._crit_edge139.loopexit ], [ %.4142, %.preheader105 ]
  %181 = add nuw nsw i32 %.087141, 1
  %182 = icmp slt i32 %181, %179
  br i1 %182, label %.preheader105, label %._crit_edge143.loopexit, !llvm.loop !25

183:                                              ; preds = %.lr.ph138, %183
  %.sroa.0162.5 = phi double [ %.sroa.0162.2, %.lr.ph138 ], [ %.sroa.0162.6, %183 ]
  %.sroa.6164.5 = phi double [ %.sroa.6164.2, %.lr.ph138 ], [ %.sroa.6164.6, %183 ]
  %.sroa.0.5 = phi double [ %.sroa.0.2, %.lr.ph138 ], [ %.sroa.0.6, %183 ]
  %.sroa.6.5 = phi double [ %.sroa.6.2, %.lr.ph138 ], [ %.sroa.6.6, %183 ]
  %.5137 = phi ptr [ %.4142, %.lr.ph138 ], [ %194, %183 ]
  %.086136 = phi i32 [ 0, %.lr.ph138 ], [ %195, %183 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #7
  %184 = uitofp nneg i32 %.086136 to double
  call void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %12, double noundef %184, double noundef %173, double noundef %166)
  %185 = load double, ptr %.5137, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #7
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %13, ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(24) %5)
  %186 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(24) %13)
  %187 = fcmp ogt double %186, 0.000000e+00
  %188 = fadd double %185, %.sroa.0162.5
  %189 = fadd double %185, %.sroa.0.5
  %.sroa.0162.6 = select i1 %187, double %188, double %.sroa.0162.5
  %.sroa.0.6 = select i1 %187, double %.sroa.0.5, double %189
  %190 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1, ptr noundef nonnull align 8 dereferenceable(24) %13)
  %191 = fcmp ogt double %190, 0.000000e+00
  %192 = fadd double %185, %.sroa.6164.5
  %193 = fadd double %185, %.sroa.6.5
  %.sroa.6164.6 = select i1 %191, double %192, double %.sroa.6164.5
  %.sroa.6.6 = select i1 %191, double %.sroa.6.5, double %193
  %194 = getelementptr inbounds i8, ptr %.5137, i64 8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #7
  %195 = add nuw nsw i32 %.086136, 1
  %196 = load i32, ptr %19, align 8, !tbaa !5
  %197 = icmp slt i32 %195, %196
  br i1 %197, label %183, label %._crit_edge139.loopexit, !llvm.loop !26

198:                                              ; preds = %.preheader
  call void @_ZN8R3Vector4FlipEv(ptr noundef nonnull align 8 dereferenceable(24) %11)
  br label %199

199:                                              ; preds = %.preheader, %198
  %200 = fcmp olt double %.sroa.6164.3, %.sroa.6.3
  br i1 %200, label %201, label %.thread

201:                                              ; preds = %199
  call void @_ZN8R3Vector4FlipEv(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1)
  br label %.thread

.thread:                                          ; preds = %.preheader109.preheader, %.preheader106.lr.ph, %201, %199
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %14) #7
  call void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %14, ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1)
  %202 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.2, ptr noundef nonnull align 8 dereferenceable(24) %14)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #7
  %203 = call noundef double @_ZNK8R3Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(24) %11)
  %204 = load double, ptr @RN_BIG_EPSILON, align 8, !tbaa !18
  %205 = call noundef i32 @_Z9RNIsEqualddd(double noundef %203, double noundef 1.000000e+00, double noundef %204)
  %.not98 = icmp eq i32 %205, 0
  br i1 %.not98, label %206, label %207

206:                                              ; preds = %.thread
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.3, i32 noundef 442, ptr noundef nonnull @.str.2)
  br label %207

207:                                              ; preds = %206, %.thread
  %208 = call noundef double @_ZNK8R3Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1)
  %209 = load double, ptr @RN_BIG_EPSILON, align 8, !tbaa !18
  %210 = call noundef i32 @_Z9RNIsEqualddd(double noundef %208, double noundef 1.000000e+00, double noundef %209)
  %.not99 = icmp eq i32 %210, 0
  br i1 %.not99, label %211, label %212

211:                                              ; preds = %207
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.4, i32 noundef 443, ptr noundef nonnull @.str.2)
  br label %212

212:                                              ; preds = %211, %207
  %213 = call noundef double @_ZNK8R3Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.2)
  %214 = load double, ptr @RN_BIG_EPSILON, align 8, !tbaa !18
  %215 = call noundef i32 @_Z9RNIsEqualddd(double noundef %213, double noundef 1.000000e+00, double noundef %214)
  %.not100 = icmp eq i32 %215, 0
  br i1 %.not100, label %216, label %217

216:                                              ; preds = %212
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.5, i32 noundef 444, ptr noundef nonnull @.str.2)
  br label %217

217:                                              ; preds = %216, %212
  %218 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1)
  %219 = load double, ptr @RN_BIG_EPSILON, align 8, !tbaa !18
  %220 = call noundef i32 @_Z8RNIsZerodd(double noundef %218, double noundef %219)
  %.not101 = icmp eq i32 %220, 0
  br i1 %.not101, label %221, label %222

221:                                              ; preds = %217
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.6, i32 noundef 445, ptr noundef nonnull @.str.2)
  br label %222

222:                                              ; preds = %221, %217
  %223 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1, ptr noundef nonnull align 8 dereferenceable(24) %.ptr.2)
  %224 = load double, ptr @RN_BIG_EPSILON, align 8, !tbaa !18
  %225 = call noundef i32 @_Z8RNIsZerodd(double noundef %223, double noundef %224)
  %.not102 = icmp eq i32 %225, 0
  br i1 %.not102, label %226, label %227

226:                                              ; preds = %222
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.7, i32 noundef 446, ptr noundef nonnull @.str.2)
  br label %227

227:                                              ; preds = %226, %222
  %228 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(24) %.ptr.2)
  %229 = load double, ptr @RN_BIG_EPSILON, align 8, !tbaa !18
  %230 = call noundef i32 @_Z8RNIsZerodd(double noundef %228, double noundef %229)
  %.not103 = icmp eq i32 %230, 0
  br i1 %.not103, label %231, label %232

231:                                              ; preds = %227
  call void (ptr, ...) @_Z7RNAbortPKcz(ptr noundef nonnull @.str, ptr noundef nonnull @.str.8, i32 noundef 447, ptr noundef nonnull @.str.2)
  br label %232

232:                                              ; preds = %231, %227
  %.not104 = icmp eq ptr %3, null
  br i1 %.not104, label %238, label %233

233:                                              ; preds = %232
  %234 = load <2 x double>, ptr %9, align 16, !tbaa !18
  store <2 x double> %234, ptr %3, align 8, !tbaa !18
  %235 = getelementptr inbounds i8, ptr %9, i64 16
  %236 = load double, ptr %235, align 16, !tbaa !18
  %237 = getelementptr inbounds i8, ptr %3, i64 16
  store double %236, ptr %237, align 8, !tbaa !18
  br label %238

238:                                              ; preds = %233, %232
  call void @_ZN7R3TriadC1ERK8R3VectorS2_S2_(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(24) %.ptr.1, ptr noundef nonnull align 8 dereferenceable(24) %.ptr.2)
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %8) #7
  br label %239

239:                                              ; preds = %238, %._crit_edge127.thread
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #7
  ret void
}

declare void @_ZN7R3PointC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) 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) #5

declare void @_ZN7R3TriadC1ERKS_(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(72)) 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 @_ZN8R3VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0

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

declare void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0

declare noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0

declare void @_ZN8R3Vector4FlipEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0

declare void @_ZrmRK8R3VectorS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) 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 @_ZNK8R3Vector6LengthEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0

declare void @_ZN7R3TriadC1ERK8R3VectorS2_S2_(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) 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>) #6

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 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !17, i64 560}
!10 = !{!"_ZTS6R3Grid", !11, i64 0, !11, i64 272, !16, i64 544, !16, i64 552, !17, i64 560, !7, i64 568, !6, i64 580, !6, i64 584, !6, i64 588}
!11 = !{!"_ZTS8R3Affine", !12, i64 0, !13, i64 8, !13, i64 136, !14, i64 264}
!12 = !{!"_ZTS16R3Transformation"}
!13 = !{!"_ZTS8R4Matrix", !7, i64 0}
!14 = !{!"_ZTS7RNFlags", !15, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = !{!"any pointer", !7, i64 0}
!18 = !{!16, !16, i64 0}
!19 = distinct !{!19, !20, !21}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!"llvm.loop.unswitch.partial.disable"}
!22 = distinct !{!22, !20, !21}
!23 = distinct !{!23, !20}
!24 = distinct !{!24, !20, !21}
!25 = distinct !{!25, !20, !21}
!26 = distinct !{!26, !20}


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