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

; 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.R4Matrix = type { [4 x [4 x double]] }
%class.R3Point = type { [3 x double] }
%class.R3Vector = type { [3 x double] }

@R4identity_matrix = external global %class.R4Matrix, align 8

; 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 @_ZNK7RNArrayIP7R3PointEixEi(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
declare dso_local void @_Z10R3CentroidRK7RNArrayIP7R3PointEPKd(ptr dead_on_unwind noalias writable sret(%class.R3Point) align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) #2

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK7R3Point6VectorEv(ptr dead_on_unwind noalias writable sret(%class.R3Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24)) #5 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_Z12R3AlignErrorRK7RNArrayIP7R3PointES4_RK8R4MatrixRKS0_S9_ddPKd(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), double noundef, double noundef, ptr noundef) #2

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

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)) #3

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_Z13R3AlignPointsRK7RNArrayIP7R3PointES4_PKdiii(ptr dead_on_unwind noalias writable sret(%class.R4Matrix) align 8 %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6) #2 {
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %class.R3Point, align 8
  %20 = alloca %class.R3Point, align 8
  %21 = alloca %class.R3Point, align 8
  %22 = alloca %class.R3Point, align 8
  %23 = alloca double, align 8
  %24 = alloca double, align 8
  %25 = alloca %class.R4Matrix, align 8
  %26 = alloca %class.R4Matrix, align 8
  %27 = alloca double, align 8
  %28 = alloca double, align 8
  %29 = alloca ptr, align 8
  %30 = alloca ptr, align 8
  %31 = alloca %class.R3Vector, align 8
  %32 = alloca %class.R3Vector, align 8
  %33 = alloca %class.R3Vector, align 8
  %34 = alloca %class.R3Vector, align 8
  %35 = alloca i32, align 4
  %36 = alloca %class.R4Matrix, align 8
  %37 = alloca double, align 8
  %38 = alloca [16 x double], align 16
  %39 = alloca [16 x double], align 16
  %40 = alloca [4 x double], align 16
  %41 = alloca [16 x double], align 16
  %42 = alloca i32, align 4
  %43 = alloca [4 x %class.R4Matrix], align 16
  %44 = alloca [4 x double], align 16
  %45 = alloca [4 x double], align 16
  %46 = alloca %class.R4Matrix, align 8
  %47 = alloca %class.R3Vector, align 8
  %48 = alloca %class.R3Vector, align 8
  %49 = alloca %class.R3Vector, align 8
  store ptr %0, ptr %8, align 8
  store ptr %1, ptr %9, align 8, !tbaa !5
  store ptr %2, ptr %10, align 8, !tbaa !5
  store ptr %3, ptr %11, align 8, !tbaa !5
  store i32 %4, ptr %12, align 4, !tbaa !9
  store i32 %5, ptr %13, align 4, !tbaa !9
  store i32 %6, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %50 = load ptr, ptr %9, align 8, !tbaa !5
  %51 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %50)
  store i32 %51, ptr %18, align 4, !tbaa !9
  %52 = load ptr, ptr %10, align 8, !tbaa !5
  %53 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %52)
  %54 = load i32, ptr %18, align 4, !tbaa !9
  %55 = icmp slt i32 %53, %54
  br i1 %55, label %56, label %59

56:                                               ; preds = %7
  %57 = load ptr, ptr %10, align 8, !tbaa !5
  %58 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %57)
  store i32 %58, ptr %18, align 4, !tbaa !9
  br label %59

59:                                               ; preds = %56, %7
  %60 = load i32, ptr %18, align 4, !tbaa !9
  %61 = icmp slt i32 %60, 1
  br i1 %61, label %62, label %63

62:                                               ; preds = %59
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %63

63:                                               ; preds = %62, %59
  %64 = load i32, ptr %18, align 4, !tbaa !9
  %65 = icmp slt i32 %64, 2
  br i1 %65, label %66, label %67

66:                                               ; preds = %63
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %67

67:                                               ; preds = %66, %63
  %68 = load i32, ptr %18, align 4, !tbaa !9
  %69 = icmp slt i32 %68, 3
  br i1 %69, label %70, label %71

70:                                               ; preds = %67
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %71

71:                                               ; preds = %70, %67
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #6
  call void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %19, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #6
  call void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %20, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef 0.000000e+00)
  %72 = load i32, ptr %12, align 4, !tbaa !9
  %73 = icmp ne i32 %72, 0
  br i1 %73, label %74, label %81

74:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #6
  %75 = load ptr, ptr %9, align 8, !tbaa !5
  %76 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_Z10R3CentroidRK7RNArrayIP7R3PointEPKd(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %21, ptr noundef nonnull align 8 dereferenceable(16) %75, ptr noundef %76)
  %77 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 8 dereferenceable(24) %21)
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %22) #6
  %78 = load ptr, ptr %10, align 8, !tbaa !5
  %79 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_Z10R3CentroidRK7RNArrayIP7R3PointEPKd(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %22, ptr noundef nonnull align 8 dereferenceable(16) %78, ptr noundef %79)
  %80 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %20, ptr noundef nonnull align 8 dereferenceable(24) %22)
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #6
  br label %81

81:                                               ; preds = %74, %71
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  store double 1.000000e+00, ptr %23, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  store double 1.000000e+00, ptr %24, align 8, !tbaa !11
  %82 = load i32, ptr %14, align 4, !tbaa !9
  %83 = icmp ne i32 %82, 0
  br i1 %83, label %84, label %91

84:                                               ; preds = %81
  %85 = load ptr, ptr %9, align 8, !tbaa !5
  %86 = load ptr, ptr %11, align 8, !tbaa !5
  %87 = call noundef double @_Z17R3AverageDistanceRK7R3PointRK7RNArrayIPS_EPKd(ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 8 dereferenceable(16) %85, ptr noundef %86)
  store double %87, ptr %23, align 8, !tbaa !11
  %88 = load ptr, ptr %10, align 8, !tbaa !5
  %89 = load ptr, ptr %11, align 8, !tbaa !5
  %90 = call noundef double @_Z17R3AverageDistanceRK7R3PointRK7RNArrayIPS_EPKd(ptr noundef nonnull align 8 dereferenceable(24) %20, ptr noundef nonnull align 8 dereferenceable(16) %88, ptr noundef %89)
  store double %90, ptr %24, align 8, !tbaa !11
  br label %91

91:                                               ; preds = %84, %81
  call void @llvm.lifetime.start.p0(i64 128, ptr %25) #6
  call void @_ZN8R4MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(128) %25, ptr noundef nonnull align 8 dereferenceable(128) @R4identity_matrix)
  %92 = load i32, ptr %13, align 4, !tbaa !9
  %93 = icmp ne i32 %92, 0
  br i1 %93, label %94, label %397

94:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 128, ptr %26) #6
  call void @_ZN8R4MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(128) %26, ptr noundef nonnull align 8 dereferenceable(128) @R4identity_matrix)
  %95 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %26, i32 noundef 2)
  %96 = getelementptr inbounds double, ptr %95, i64 2
  store double 0.000000e+00, ptr %96, align 8, !tbaa !11
  %97 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %26, i32 noundef 1)
  %98 = getelementptr inbounds double, ptr %97, i64 1
  store double 0.000000e+00, ptr %98, align 8, !tbaa !11
  %99 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %26, i32 noundef 0)
  %100 = getelementptr inbounds double, ptr %99, i64 0
  store double 0.000000e+00, ptr %100, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #6
  store double 0.000000e+00, ptr %27, align 8, !tbaa !11
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %101

101:                                              ; preds = %161, %94
  %102 = load i32, ptr %15, align 4, !tbaa !9
  %103 = load i32, ptr %18, align 4, !tbaa !9
  %104 = icmp slt i32 %102, %103
  br i1 %104, label %105, label %164

105:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #6
  %106 = load ptr, ptr %11, align 8, !tbaa !5
  %107 = icmp ne ptr %106, null
  br i1 %107, label %108, label %114

108:                                              ; preds = %105
  %109 = load ptr, ptr %11, align 8, !tbaa !5
  %110 = load i32, ptr %15, align 4, !tbaa !9
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds double, ptr %109, i64 %111
  %113 = load double, ptr %112, align 8, !tbaa !11
  br label %115

114:                                              ; preds = %105
  br label %115

115:                                              ; preds = %114, %108
  %116 = phi double [ %113, %108 ], [ 1.000000e+00, %114 ]
  store double %116, ptr %28, align 8, !tbaa !11
  %117 = load double, ptr %28, align 8, !tbaa !11
  %118 = load double, ptr %27, align 8, !tbaa !11
  %119 = fadd double %118, %117
  store double %119, ptr %27, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #6
  %120 = load ptr, ptr %9, align 8, !tbaa !5
  %121 = load i32, ptr %15, align 4, !tbaa !9
  %122 = call noundef ptr @_ZNK7RNArrayIP7R3PointEixEi(ptr noundef nonnull align 8 dereferenceable(16) %120, i32 noundef %121)
  store ptr %122, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #6
  %123 = load ptr, ptr %10, align 8, !tbaa !5
  %124 = load i32, ptr %15, align 4, !tbaa !9
  %125 = call noundef ptr @_ZNK7RNArrayIP7R3PointEixEi(ptr noundef nonnull align 8 dereferenceable(16) %123, i32 noundef %124)
  store ptr %125, ptr %30, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %31) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %32) #6
  %126 = load ptr, ptr %29, align 8, !tbaa !5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %32, ptr noundef nonnull align 8 dereferenceable(24) %126, ptr noundef nonnull align 8 dereferenceable(24) %19)
  %127 = load double, ptr %23, align 8, !tbaa !11
  call void @_ZdvRK8R3Vectord(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %31, ptr noundef nonnull align 8 dereferenceable(24) %32, double noundef %127)
  call void @llvm.lifetime.end.p0(i64 24, ptr %32) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %33) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %34) #6
  %128 = load ptr, ptr %30, align 8, !tbaa !5
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %34, ptr noundef nonnull align 8 dereferenceable(24) %128, ptr noundef nonnull align 8 dereferenceable(24) %20)
  %129 = load double, ptr %24, align 8, !tbaa !11
  call void @_ZdvRK8R3Vectord(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %33, ptr noundef nonnull align 8 dereferenceable(24) %34, double noundef %129)
  call void @llvm.lifetime.end.p0(i64 24, ptr %34) #6
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %130

130:                                              ; preds = %157, %115
  %131 = load i32, ptr %16, align 4, !tbaa !9
  %132 = icmp slt i32 %131, 3
  br i1 %132, label %133, label %160

133:                                              ; preds = %130
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %134

134:                                              ; preds = %153, %133
  %135 = load i32, ptr %17, align 4, !tbaa !9
  %136 = icmp slt i32 %135, 3
  br i1 %136, label %137, label %156

137:                                              ; preds = %134
  %138 = load double, ptr %28, align 8, !tbaa !11
  %139 = load i32, ptr %16, align 4, !tbaa !9
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %31, i32 noundef %139)
  %141 = load double, ptr %140, align 8, !tbaa !11
  %142 = fmul double %138, %141
  %143 = load i32, ptr %17, align 4, !tbaa !9
  %144 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %33, i32 noundef %143)
  %145 = load double, ptr %144, align 8, !tbaa !11
  %146 = load i32, ptr %16, align 4, !tbaa !9
  %147 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %26, i32 noundef %146)
  %148 = load i32, ptr %17, align 4, !tbaa !9
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds double, ptr %147, i64 %149
  %151 = load double, ptr %150, align 8, !tbaa !11
  %152 = call double @llvm.fmuladd.f64(double %142, double %145, double %151)
  store double %152, ptr %150, align 8, !tbaa !11
  br label %153

153:                                              ; preds = %137
  %154 = load i32, ptr %17, align 4, !tbaa !9
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %17, align 4, !tbaa !9
  br label %134, !llvm.loop !13

156:                                              ; preds = %134
  br label %157

157:                                              ; preds = %156
  %158 = load i32, ptr %16, align 4, !tbaa !9
  %159 = add nsw i32 %158, 1
  store i32 %159, ptr %16, align 4, !tbaa !9
  br label %130, !llvm.loop !15

160:                                              ; preds = %130
  call void @llvm.lifetime.end.p0(i64 24, ptr %33) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %31) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  br label %161

161:                                              ; preds = %160
  %162 = load i32, ptr %15, align 4, !tbaa !9
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %15, align 4, !tbaa !9
  br label %101, !llvm.loop !16

164:                                              ; preds = %101
  %165 = load double, ptr %27, align 8, !tbaa !11
  %166 = fcmp oeq double %165, 0.000000e+00
  br i1 %166, label %167, label %168

167:                                              ; preds = %164
  call void @_ZN8R4MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef nonnull align 8 dereferenceable(128) @R4identity_matrix)
  store i32 1, ptr %35, align 4
  br label %394

168:                                              ; preds = %164
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %169

169:                                              ; preds = %189, %168
  %170 = load i32, ptr %16, align 4, !tbaa !9
  %171 = icmp slt i32 %170, 3
  br i1 %171, label %172, label %192

172:                                              ; preds = %169
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %173

173:                                              ; preds = %185, %172
  %174 = load i32, ptr %17, align 4, !tbaa !9
  %175 = icmp slt i32 %174, 3
  br i1 %175, label %176, label %188

176:                                              ; preds = %173
  %177 = load double, ptr %27, align 8, !tbaa !11
  %178 = load i32, ptr %16, align 4, !tbaa !9
  %179 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %26, i32 noundef %178)
  %180 = load i32, ptr %17, align 4, !tbaa !9
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds double, ptr %179, i64 %181
  %183 = load double, ptr %182, align 8, !tbaa !11
  %184 = fdiv double %183, %177
  store double %184, ptr %182, align 8, !tbaa !11
  br label %185

185:                                              ; preds = %176
  %186 = load i32, ptr %17, align 4, !tbaa !9
  %187 = add nsw i32 %186, 1
  store i32 %187, ptr %17, align 4, !tbaa !9
  br label %173, !llvm.loop !17

188:                                              ; preds = %173
  br label %189

189:                                              ; preds = %188
  %190 = load i32, ptr %16, align 4, !tbaa !9
  %191 = add nsw i32 %190, 1
  store i32 %191, ptr %16, align 4, !tbaa !9
  br label %169, !llvm.loop !18

192:                                              ; preds = %169
  call void @llvm.lifetime.start.p0(i64 128, ptr %36) #6
  call void @_ZN8R4MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(128) %36, ptr noundef nonnull align 8 dereferenceable(128) @R4identity_matrix)
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %193

193:                                              ; preds = %223, %192
  %194 = load i32, ptr %16, align 4, !tbaa !9
  %195 = icmp slt i32 %194, 3
  br i1 %195, label %196, label %226

196:                                              ; preds = %193
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %197

197:                                              ; preds = %219, %196
  %198 = load i32, ptr %17, align 4, !tbaa !9
  %199 = icmp slt i32 %198, 3
  br i1 %199, label %200, label %222

200:                                              ; preds = %197
  %201 = load i32, ptr %16, align 4, !tbaa !9
  %202 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %26, i32 noundef %201)
  %203 = load i32, ptr %17, align 4, !tbaa !9
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds double, ptr %202, i64 %204
  %206 = load double, ptr %205, align 8, !tbaa !11
  %207 = load i32, ptr %17, align 4, !tbaa !9
  %208 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %26, i32 noundef %207)
  %209 = load i32, ptr %16, align 4, !tbaa !9
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds double, ptr %208, i64 %210
  %212 = load double, ptr %211, align 8, !tbaa !11
  %213 = fsub double %206, %212
  %214 = load i32, ptr %16, align 4, !tbaa !9
  %215 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %36, i32 noundef %214)
  %216 = load i32, ptr %17, align 4, !tbaa !9
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds double, ptr %215, i64 %217
  store double %213, ptr %218, align 8, !tbaa !11
  br label %219

219:                                              ; preds = %200
  %220 = load i32, ptr %17, align 4, !tbaa !9
  %221 = add nsw i32 %220, 1
  store i32 %221, ptr %17, align 4, !tbaa !9
  br label %197, !llvm.loop !19

222:                                              ; preds = %197
  br label %223

223:                                              ; preds = %222
  %224 = load i32, ptr %16, align 4, !tbaa !9
  %225 = add nsw i32 %224, 1
  store i32 %225, ptr %16, align 4, !tbaa !9
  br label %193, !llvm.loop !20

226:                                              ; preds = %193
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #6
  %227 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %26, i32 noundef 0)
  %228 = getelementptr inbounds double, ptr %227, i64 0
  %229 = load double, ptr %228, align 8, !tbaa !11
  %230 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %26, i32 noundef 1)
  %231 = getelementptr inbounds double, ptr %230, i64 1
  %232 = load double, ptr %231, align 8, !tbaa !11
  %233 = fadd double %229, %232
  %234 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %26, i32 noundef 2)
  %235 = getelementptr inbounds double, ptr %234, i64 2
  %236 = load double, ptr %235, align 8, !tbaa !11
  %237 = fadd double %233, %236
  store double %237, ptr %37, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 128, ptr %38) #6
  %238 = load double, ptr %37, align 8, !tbaa !11
  %239 = getelementptr inbounds [16 x double], ptr %38, i64 0, i64 0
  store double %238, ptr %239, align 16, !tbaa !11
  %240 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %36, i32 noundef 1)
  %241 = getelementptr inbounds double, ptr %240, i64 2
  %242 = load double, ptr %241, align 8, !tbaa !11
  %243 = getelementptr inbounds [16 x double], ptr %38, i64 0, i64 4
  store double %242, ptr %243, align 16, !tbaa !11
  %244 = getelementptr inbounds [16 x double], ptr %38, i64 0, i64 1
  store double %242, ptr %244, align 8, !tbaa !11
  %245 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %36, i32 noundef 2)
  %246 = getelementptr inbounds double, ptr %245, i64 0
  %247 = load double, ptr %246, align 8, !tbaa !11
  %248 = getelementptr inbounds [16 x double], ptr %38, i64 0, i64 8
  store double %247, ptr %248, align 16, !tbaa !11
  %249 = getelementptr inbounds [16 x double], ptr %38, i64 0, i64 2
  store double %247, ptr %249, align 16, !tbaa !11
  %250 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %36, i32 noundef 0)
  %251 = getelementptr inbounds double, ptr %250, i64 1
  %252 = load double, ptr %251, align 8, !tbaa !11
  %253 = getelementptr inbounds [16 x double], ptr %38, i64 0, i64 12
  store double %252, ptr %253, align 16, !tbaa !11
  %254 = getelementptr inbounds [16 x double], ptr %38, i64 0, i64 3
  store double %252, ptr %254, align 8, !tbaa !11
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %255

255:                                              ; preds = %299, %226
  %256 = load i32, ptr %16, align 4, !tbaa !9
  %257 = icmp slt i32 %256, 3
  br i1 %257, label %258, label %302

258:                                              ; preds = %255
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %259

259:                                              ; preds = %284, %258
  %260 = load i32, ptr %17, align 4, !tbaa !9
  %261 = icmp slt i32 %260, 3
  br i1 %261, label %262, label %287

262:                                              ; preds = %259
  %263 = load i32, ptr %16, align 4, !tbaa !9
  %264 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %26, i32 noundef %263)
  %265 = load i32, ptr %17, align 4, !tbaa !9
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds double, ptr %264, i64 %266
  %268 = load double, ptr %267, align 8, !tbaa !11
  %269 = load i32, ptr %17, align 4, !tbaa !9
  %270 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %26, i32 noundef %269)
  %271 = load i32, ptr %16, align 4, !tbaa !9
  %272 = sext i32 %271 to i64
  %273 = getelementptr inbounds double, ptr %270, i64 %272
  %274 = load double, ptr %273, align 8, !tbaa !11
  %275 = fadd double %268, %274
  %276 = load i32, ptr %16, align 4, !tbaa !9
  %277 = add nsw i32 %276, 1
  %278 = mul nsw i32 4, %277
  %279 = load i32, ptr %17, align 4, !tbaa !9
  %280 = add nsw i32 %279, 1
  %281 = add nsw i32 %278, %280
  %282 = sext i32 %281 to i64
  %283 = getelementptr inbounds [16 x double], ptr %38, i64 0, i64 %282
  store double %275, ptr %283, align 8, !tbaa !11
  br label %284

284:                                              ; preds = %262
  %285 = load i32, ptr %17, align 4, !tbaa !9
  %286 = add nsw i32 %285, 1
  store i32 %286, ptr %17, align 4, !tbaa !9
  br label %259, !llvm.loop !21

287:                                              ; preds = %259
  %288 = load double, ptr %37, align 8, !tbaa !11
  %289 = load i32, ptr %16, align 4, !tbaa !9
  %290 = add nsw i32 %289, 1
  %291 = mul nsw i32 4, %290
  %292 = load i32, ptr %16, align 4, !tbaa !9
  %293 = add nsw i32 %292, 1
  %294 = add nsw i32 %291, %293
  %295 = sext i32 %294 to i64
  %296 = getelementptr inbounds [16 x double], ptr %38, i64 0, i64 %295
  %297 = load double, ptr %296, align 8, !tbaa !11
  %298 = fsub double %297, %288
  store double %298, ptr %296, align 8, !tbaa !11
  br label %299

299:                                              ; preds = %287
  %300 = load i32, ptr %16, align 4, !tbaa !9
  %301 = add nsw i32 %300, 1
  store i32 %301, ptr %16, align 4, !tbaa !9
  br label %255, !llvm.loop !22

302:                                              ; preds = %255
  call void @llvm.lifetime.start.p0(i64 128, ptr %39) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %40) #6
  call void @llvm.lifetime.start.p0(i64 128, ptr %41) #6
  %303 = getelementptr inbounds [16 x double], ptr %38, i64 0, i64 0
  %304 = getelementptr inbounds [16 x double], ptr %39, i64 0, i64 0
  %305 = getelementptr inbounds [4 x double], ptr %40, i64 0, i64 0
  %306 = getelementptr inbounds [16 x double], ptr %41, i64 0, i64 0
  call void @_Z14RNSvdDecomposeiiPKdPdS1_S1_(i32 noundef 4, i32 noundef 4, ptr noundef %303, ptr noundef %304, ptr noundef %305, ptr noundef %306)
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #6
  store i32 0, ptr %42, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 512, ptr %43) #6
  %307 = getelementptr inbounds [4 x %class.R4Matrix], ptr %43, i32 0, i32 0
  %308 = getelementptr inbounds %class.R4Matrix, ptr %307, i64 4
  br label %309

309:                                              ; preds = %309, %302
  %310 = phi ptr [ %307, %302 ], [ %311, %309 ]
  call void @_ZN8R4MatrixC1Ev(ptr noundef nonnull align 8 dereferenceable(128) %310)
  %311 = getelementptr inbounds %class.R4Matrix, ptr %310, i64 1
  %312 = icmp eq ptr %311, %308
  br i1 %312, label %313, label %309

313:                                              ; preds = %309
  call void @llvm.lifetime.start.p0(i64 32, ptr %44) #6
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %314

314:                                              ; preds = %386, %313
  %315 = load i32, ptr %15, align 4, !tbaa !9
  %316 = icmp slt i32 %315, 4
  br i1 %316, label %317, label %389

317:                                              ; preds = %314
  call void @llvm.lifetime.start.p0(i64 32, ptr %45) #6
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %318

318:                                              ; preds = %332, %317
  %319 = load i32, ptr %16, align 4, !tbaa !9
  %320 = icmp slt i32 %319, 4
  br i1 %320, label %321, label %335

321:                                              ; preds = %318
  %322 = load i32, ptr %16, align 4, !tbaa !9
  %323 = mul nsw i32 4, %322
  %324 = load i32, ptr %15, align 4, !tbaa !9
  %325 = add nsw i32 %323, %324
  %326 = sext i32 %325 to i64
  %327 = getelementptr inbounds [16 x double], ptr %39, i64 0, i64 %326
  %328 = load double, ptr %327, align 8, !tbaa !11
  %329 = load i32, ptr %16, align 4, !tbaa !9
  %330 = sext i32 %329 to i64
  %331 = getelementptr inbounds [4 x double], ptr %45, i64 0, i64 %330
  store double %328, ptr %331, align 8, !tbaa !11
  br label %332

332:                                              ; preds = %321
  %333 = load i32, ptr %16, align 4, !tbaa !9
  %334 = add nsw i32 %333, 1
  store i32 %334, ptr %16, align 4, !tbaa !9
  br label %318, !llvm.loop !23

335:                                              ; preds = %318
  %336 = getelementptr inbounds [4 x double], ptr %45, i64 0, i64 0
  %337 = load double, ptr %336, align 16, !tbaa !11
  %338 = fcmp olt double %337, 0.000000e+00
  br i1 %338, label %339, label %356

339:                                              ; preds = %335
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %340

340:                                              ; preds = %352, %339
  %341 = load i32, ptr %16, align 4, !tbaa !9
  %342 = icmp slt i32 %341, 4
  br i1 %342, label %343, label %355

343:                                              ; preds = %340
  %344 = load i32, ptr %16, align 4, !tbaa !9
  %345 = sext i32 %344 to i64
  %346 = getelementptr inbounds [4 x double], ptr %45, i64 0, i64 %345
  %347 = load double, ptr %346, align 8, !tbaa !11
  %348 = fneg double %347
  %349 = load i32, ptr %16, align 4, !tbaa !9
  %350 = sext i32 %349 to i64
  %351 = getelementptr inbounds [4 x double], ptr %45, i64 0, i64 %350
  store double %348, ptr %351, align 8, !tbaa !11
  br label %352

352:                                              ; preds = %343
  %353 = load i32, ptr %16, align 4, !tbaa !9
  %354 = add nsw i32 %353, 1
  store i32 %354, ptr %16, align 4, !tbaa !9
  br label %340, !llvm.loop !24

355:                                              ; preds = %340
  br label %356

356:                                              ; preds = %355, %335
  call void @llvm.lifetime.start.p0(i64 128, ptr %46) #6
  %357 = getelementptr inbounds [4 x double], ptr %45, i64 0, i64 0
  call void @_ZL13SetQuaternionPd(ptr dead_on_unwind writable sret(%class.R4Matrix) align 8 %46, ptr noundef %357)
  %358 = load i32, ptr %15, align 4, !tbaa !9
  %359 = sext i32 %358 to i64
  %360 = getelementptr inbounds [4 x %class.R4Matrix], ptr %43, i64 0, i64 %359
  %361 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZN8R4MatrixaSERKS_(ptr noundef nonnull align 8 dereferenceable(128) %360, ptr noundef nonnull align 8 dereferenceable(128) %46)
  call void @llvm.lifetime.end.p0(i64 128, ptr %46) #6
  %362 = load ptr, ptr %9, align 8, !tbaa !5
  %363 = load ptr, ptr %10, align 8, !tbaa !5
  %364 = load i32, ptr %15, align 4, !tbaa !9
  %365 = sext i32 %364 to i64
  %366 = getelementptr inbounds [4 x %class.R4Matrix], ptr %43, i64 0, i64 %365
  %367 = load double, ptr %23, align 8, !tbaa !11
  %368 = load double, ptr %24, align 8, !tbaa !11
  %369 = load ptr, ptr %11, align 8, !tbaa !5
  %370 = call noundef double @_Z12R3AlignErrorRK7RNArrayIP7R3PointES4_RK8R4MatrixRKS0_S9_ddPKd(ptr noundef nonnull align 8 dereferenceable(16) %362, ptr noundef nonnull align 8 dereferenceable(16) %363, ptr noundef nonnull align 8 dereferenceable(128) %366, ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 8 dereferenceable(24) %20, double noundef %367, double noundef %368, ptr noundef %369)
  %371 = load i32, ptr %15, align 4, !tbaa !9
  %372 = sext i32 %371 to i64
  %373 = getelementptr inbounds [4 x double], ptr %44, i64 0, i64 %372
  store double %370, ptr %373, align 8, !tbaa !11
  %374 = load i32, ptr %15, align 4, !tbaa !9
  %375 = sext i32 %374 to i64
  %376 = getelementptr inbounds [4 x double], ptr %44, i64 0, i64 %375
  %377 = load double, ptr %376, align 8, !tbaa !11
  %378 = load i32, ptr %42, align 4, !tbaa !9
  %379 = sext i32 %378 to i64
  %380 = getelementptr inbounds [4 x double], ptr %44, i64 0, i64 %379
  %381 = load double, ptr %380, align 8, !tbaa !11
  %382 = fcmp olt double %377, %381
  br i1 %382, label %383, label %385

383:                                              ; preds = %356
  %384 = load i32, ptr %15, align 4, !tbaa !9
  store i32 %384, ptr %42, align 4, !tbaa !9
  br label %385

385:                                              ; preds = %383, %356
  call void @llvm.lifetime.end.p0(i64 32, ptr %45) #6
  br label %386

386:                                              ; preds = %385
  %387 = load i32, ptr %15, align 4, !tbaa !9
  %388 = add nsw i32 %387, 1
  store i32 %388, ptr %15, align 4, !tbaa !9
  br label %314, !llvm.loop !25

389:                                              ; preds = %314
  %390 = load i32, ptr %42, align 4, !tbaa !9
  %391 = sext i32 %390 to i64
  %392 = getelementptr inbounds [4 x %class.R4Matrix], ptr %43, i64 0, i64 %391
  %393 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZN8R4MatrixaSERKS_(ptr noundef nonnull align 8 dereferenceable(128) %25, ptr noundef nonnull align 8 dereferenceable(128) %392)
  call void @llvm.lifetime.end.p0(i64 32, ptr %44) #6
  call void @llvm.lifetime.end.p0(i64 512, ptr %43) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr %41) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %40) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr %39) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr %38) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr %36) #6
  store i32 0, ptr %35, align 4
  br label %394

394:                                              ; preds = %389, %167
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr %26) #6
  %395 = load i32, ptr %35, align 4
  switch i32 %395, label %417 [
    i32 0, label %396
  ]

396:                                              ; preds = %394
  br label %397

397:                                              ; preds = %396, %91
  call void @_ZN8R4MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef nonnull align 8 dereferenceable(128) @R4identity_matrix)
  %398 = load i32, ptr %12, align 4, !tbaa !9
  %399 = icmp ne i32 %398, 0
  br i1 %399, label %400, label %401

400:                                              ; preds = %397
  call void @llvm.lifetime.start.p0(i64 24, ptr %47) #6
  call void @_ZNK7R3Point6VectorEv(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %47, ptr noundef nonnull align 8 dereferenceable(24) %19)
  call void @_ZN8R4Matrix9TranslateERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef nonnull align 8 dereferenceable(24) %47)
  call void @llvm.lifetime.end.p0(i64 24, ptr %47) #6
  br label %401

401:                                              ; preds = %400, %397
  %402 = load i32, ptr %14, align 4, !tbaa !9
  %403 = icmp ne i32 %402, 0
  br i1 %403, label %404, label %408

404:                                              ; preds = %401
  %405 = load double, ptr %23, align 8, !tbaa !11
  %406 = load double, ptr %24, align 8, !tbaa !11
  %407 = fdiv double %405, %406
  call void @_ZN8R4Matrix5ScaleEd(ptr noundef nonnull align 8 dereferenceable(128) %0, double noundef %407)
  br label %408

408:                                              ; preds = %404, %401
  %409 = load i32, ptr %13, align 4, !tbaa !9
  %410 = icmp ne i32 %409, 0
  br i1 %410, label %411, label %412

411:                                              ; preds = %408
  call void @_ZN8R4Matrix9TransformERKS_(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef nonnull align 8 dereferenceable(128) %25)
  br label %412

412:                                              ; preds = %411, %408
  %413 = load i32, ptr %12, align 4, !tbaa !9
  %414 = icmp ne i32 %413, 0
  br i1 %414, label %415, label %416

415:                                              ; preds = %412
  call void @llvm.lifetime.start.p0(i64 24, ptr %48) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %49) #6
  call void @_ZNK7R3Point6VectorEv(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %49, ptr noundef nonnull align 8 dereferenceable(24) %20)
  call void @_ZngRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %48, ptr noundef nonnull align 8 dereferenceable(24) %49)
  call void @_ZN8R4Matrix9TranslateERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef nonnull align 8 dereferenceable(24) %48)
  call void @llvm.lifetime.end.p0(i64 24, ptr %49) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %48) #6
  br label %416

416:                                              ; preds = %415, %412
  store i32 1, ptr %35, align 4
  br label %417

417:                                              ; preds = %416, %394
  call void @llvm.lifetime.end.p0(i64 128, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  ret void
}

declare void @_ZN8R4MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(128)) unnamed_addr #3

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

declare void @_ZN8R4MatrixC1Ev(ptr noundef nonnull align 8 dereferenceable(128)) unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL13SetQuaternionPd(ptr dead_on_unwind noalias writable sret(%class.R4Matrix) align 8, ptr noundef) #2

declare noundef nonnull align 8 dereferenceable(128) ptr @_ZN8R4MatrixaSERKS_(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(128)) #3

declare void @_ZN8R4Matrix9TranslateERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(24)) #3

declare void @_ZN8R4Matrix5ScaleEd(ptr noundef nonnull align 8 dereferenceable(128), double noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8R4Matrix9TransformERKS_(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(128)) #5 align 2

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 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 #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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !14}
!23 = distinct !{!23, !14}
!24 = distinct !{!24, !14}
!25 = distinct !{!25, !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.R4Matrix = type { [4 x [4 x double]] }
%class.R3Point = type { [3 x double] }
%class.R3Vector = type { [3 x double] }

@R4identity_matrix = external global %class.R4Matrix, align 8

; 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 @_ZNK7RNArrayIP7R3PointEixEi(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
declare dso_local void @_Z10R3CentroidRK7RNArrayIP7R3PointEPKd(ptr dead_on_unwind noalias writable sret(%class.R3Point) align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) local_unnamed_addr #2

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK7R3Point6VectorEv(ptr dead_on_unwind noalias writable sret(%class.R3Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #5 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_Z12R3AlignErrorRK7RNArrayIP7R3PointES4_RK8R4MatrixRKS0_S9_ddPKd(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), double noundef, double noundef, ptr noundef) local_unnamed_addr #2

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

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

declare noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_Z13R3AlignPointsRK7RNArrayIP7R3PointES4_PKdiii(ptr dead_on_unwind noalias writable sret(%class.R4Matrix) align 8 %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6) local_unnamed_addr #2 {
  %8 = alloca %class.R3Point, align 8
  %9 = alloca %class.R3Point, align 8
  %10 = alloca %class.R3Point, align 8
  %11 = alloca %class.R3Point, align 8
  %12 = alloca %class.R4Matrix, align 8
  %13 = alloca %class.R4Matrix, align 8
  %14 = alloca %class.R3Vector, align 8
  %15 = alloca %class.R3Vector, align 8
  %16 = alloca %class.R3Vector, align 8
  %17 = alloca %class.R3Vector, align 8
  %18 = alloca %class.R4Matrix, align 8
  %19 = alloca [16 x double], align 16
  %20 = alloca [16 x double], align 16
  %21 = alloca [4 x double], align 16
  %22 = alloca [16 x double], align 16
  %23 = alloca [4 x %class.R4Matrix], align 16
  %24 = alloca [4 x double], align 16
  %25 = alloca [4 x double], align 16
  %26 = alloca %class.R4Matrix, align 8
  %27 = alloca %class.R3Vector, align 8
  %28 = alloca %class.R3Vector, align 8
  %29 = alloca %class.R3Vector, align 8
  %30 = tail call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %31 = tail call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %2)
  %32 = icmp slt i32 %31, %30
  br i1 %32, label %33, label %35

33:                                               ; preds = %7
  %34 = tail call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %2)
  br label %35

35:                                               ; preds = %33, %7
  %.0113 = phi i32 [ %34, %33 ], [ %30, %7 ]
  %.inv = icmp slt i32 %.0113, 1
  %36 = icmp slt i32 %.0113, 2
  %37 = icmp slt i32 %.0113, 3
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #6
  call void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %8, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #6
  call void @_ZN7R3PointC1Eddd(ptr noundef nonnull align 8 dereferenceable(24) %9, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef 0.000000e+00)
  %.not126 = icmp eq i32 %4, 0
  %.not = or i1 %.not126, %.inv
  br i1 %.not, label %41, label %38

38:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #6
  call void @_Z10R3CentroidRK7RNArrayIP7R3PointEPKd(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %10, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef %3)
  %39 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %10)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #6
  call void @_Z10R3CentroidRK7RNArrayIP7R3PointEPKd(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %11, ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef %3)
  %40 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(24) %11)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #6
  br label %41

41:                                               ; preds = %38, %35
  %.not122127 = icmp eq i32 %6, 0
  %.not122 = or i1 %.not122127, %36
  br i1 %.not122, label %45, label %42

42:                                               ; preds = %41
  %43 = call noundef double @_Z17R3AverageDistanceRK7R3PointRK7RNArrayIPS_EPKd(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef %3)
  %44 = call noundef double @_Z17R3AverageDistanceRK7R3PointRK7RNArrayIPS_EPKd(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef %3)
  br label %45

45:                                               ; preds = %42, %41
  %.0112 = phi double [ %43, %42 ], [ 1.000000e+00, %41 ]
  %.0111 = phi double [ %44, %42 ], [ 1.000000e+00, %41 ]
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %12) #6
  call void @_ZN8R4MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(128) %12, ptr noundef nonnull align 8 dereferenceable(128) @R4identity_matrix)
  %.not123128 = icmp eq i32 %5, 0
  %.not123 = or i1 %.not123128, %37
  br i1 %.not123, label %425, label %46

46:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %13) #6
  call void @_ZN8R4MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(128) %13, ptr noundef nonnull align 8 dereferenceable(128) @R4identity_matrix)
  %47 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 2)
  %48 = getelementptr inbounds i8, ptr %47, i64 16
  store double 0.000000e+00, ptr %48, align 8, !tbaa !5
  %49 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 1)
  %50 = getelementptr inbounds i8, ptr %49, i64 8
  store double 0.000000e+00, ptr %50, align 8, !tbaa !5
  %51 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 0)
  store double 0.000000e+00, ptr %51, align 8, !tbaa !5
  %.not125 = icmp eq ptr %3, null
  %wide.trip.count = zext nneg i32 %.0113 to i64
  br label %52

52:                                               ; preds = %46, %.preheader133
  %indvars.iv = phi i64 [ 0, %46 ], [ %indvars.iv.next, %.preheader133 ]
  %.0110136 = phi double [ 0.000000e+00, %46 ], [ %138, %.preheader133 ]
  br i1 %.not125, label %.preheader133, label %53

53:                                               ; preds = %52
  %54 = getelementptr inbounds double, ptr %3, i64 %indvars.iv
  %55 = load double, ptr %54, align 8, !tbaa !5
  br label %.preheader133

.preheader133:                                    ; preds = %52, %53
  %56 = phi double [ %55, %53 ], [ 1.000000e+00, %52 ]
  %57 = trunc nuw nsw i64 %indvars.iv to i32
  %58 = call noundef ptr @_ZNK7RNArrayIP7R3PointEixEi(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %57)
  %59 = call noundef ptr @_ZNK7RNArrayIP7R3PointEixEi(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef %57)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %14) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %15) #6
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %15, ptr noundef nonnull align 8 dereferenceable(24) %58, ptr noundef nonnull align 8 dereferenceable(24) %8)
  call void @_ZdvRK8R3Vectord(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %14, ptr noundef nonnull align 8 dereferenceable(24) %15, double noundef %.0112)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %15) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %16) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %17) #6
  call void @_ZmiRK7R3PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %17, ptr noundef nonnull align 8 dereferenceable(24) %59, ptr noundef nonnull align 8 dereferenceable(24) %9)
  call void @_ZdvRK8R3Vectord(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %16, ptr noundef nonnull align 8 dereferenceable(24) %17, double noundef %.0111)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %17) #6
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %14, i32 noundef 0)
  %61 = load double, ptr %60, align 8, !tbaa !5
  %62 = fmul double %56, %61
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %16, i32 noundef 0)
  %64 = load double, ptr %63, align 8, !tbaa !5
  %65 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 0)
  %66 = load double, ptr %65, align 8, !tbaa !5
  %67 = call double @llvm.fmuladd.f64(double %62, double %64, double %66)
  store double %67, ptr %65, align 8, !tbaa !5
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %14, i32 noundef 0)
  %69 = load double, ptr %68, align 8, !tbaa !5
  %70 = fmul double %56, %69
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %16, i32 noundef 1)
  %72 = load double, ptr %71, align 8, !tbaa !5
  %73 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 0)
  %74 = getelementptr inbounds i8, ptr %73, i64 8
  %75 = load double, ptr %74, align 8, !tbaa !5
  %76 = call double @llvm.fmuladd.f64(double %70, double %72, double %75)
  store double %76, ptr %74, align 8, !tbaa !5
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %14, i32 noundef 0)
  %78 = load double, ptr %77, align 8, !tbaa !5
  %79 = fmul double %56, %78
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %16, i32 noundef 2)
  %81 = load double, ptr %80, align 8, !tbaa !5
  %82 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 0)
  %83 = getelementptr inbounds i8, ptr %82, i64 16
  %84 = load double, ptr %83, align 8, !tbaa !5
  %85 = call double @llvm.fmuladd.f64(double %79, double %81, double %84)
  store double %85, ptr %83, align 8, !tbaa !5
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %14, i32 noundef 1)
  %87 = load double, ptr %86, align 8, !tbaa !5
  %88 = fmul double %56, %87
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %16, i32 noundef 0)
  %90 = load double, ptr %89, align 8, !tbaa !5
  %91 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 1)
  %92 = load double, ptr %91, align 8, !tbaa !5
  %93 = call double @llvm.fmuladd.f64(double %88, double %90, double %92)
  store double %93, ptr %91, align 8, !tbaa !5
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %14, i32 noundef 1)
  %95 = load double, ptr %94, align 8, !tbaa !5
  %96 = fmul double %56, %95
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %16, i32 noundef 1)
  %98 = load double, ptr %97, align 8, !tbaa !5
  %99 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 1)
  %100 = getelementptr inbounds i8, ptr %99, i64 8
  %101 = load double, ptr %100, align 8, !tbaa !5
  %102 = call double @llvm.fmuladd.f64(double %96, double %98, double %101)
  store double %102, ptr %100, align 8, !tbaa !5
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %14, i32 noundef 1)
  %104 = load double, ptr %103, align 8, !tbaa !5
  %105 = fmul double %56, %104
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %16, i32 noundef 2)
  %107 = load double, ptr %106, align 8, !tbaa !5
  %108 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 1)
  %109 = getelementptr inbounds i8, ptr %108, i64 16
  %110 = load double, ptr %109, align 8, !tbaa !5
  %111 = call double @llvm.fmuladd.f64(double %105, double %107, double %110)
  store double %111, ptr %109, align 8, !tbaa !5
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %14, i32 noundef 2)
  %113 = load double, ptr %112, align 8, !tbaa !5
  %114 = fmul double %56, %113
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %16, i32 noundef 0)
  %116 = load double, ptr %115, align 8, !tbaa !5
  %117 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 2)
  %118 = load double, ptr %117, align 8, !tbaa !5
  %119 = call double @llvm.fmuladd.f64(double %114, double %116, double %118)
  store double %119, ptr %117, align 8, !tbaa !5
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %14, i32 noundef 2)
  %121 = load double, ptr %120, align 8, !tbaa !5
  %122 = fmul double %56, %121
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %16, i32 noundef 1)
  %124 = load double, ptr %123, align 8, !tbaa !5
  %125 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 2)
  %126 = getelementptr inbounds i8, ptr %125, i64 8
  %127 = load double, ptr %126, align 8, !tbaa !5
  %128 = call double @llvm.fmuladd.f64(double %122, double %124, double %127)
  store double %128, ptr %126, align 8, !tbaa !5
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %14, i32 noundef 2)
  %130 = load double, ptr %129, align 8, !tbaa !5
  %131 = fmul double %56, %130
  %132 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %16, i32 noundef 2)
  %133 = load double, ptr %132, align 8, !tbaa !5
  %134 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 2)
  %135 = getelementptr inbounds i8, ptr %134, i64 16
  %136 = load double, ptr %135, align 8, !tbaa !5
  %137 = call double @llvm.fmuladd.f64(double %131, double %133, double %136)
  store double %137, ptr %135, align 8, !tbaa !5
  %138 = fadd double %.0110136, %56
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %139, label %52, !llvm.loop !9

139:                                              ; preds = %.preheader133
  %140 = fcmp une double %138, 0.000000e+00
  br i1 %140, label %.preheader131.preheader, label %.thread

.preheader131.preheader:                          ; preds = %139
  %141 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 0)
  %142 = load double, ptr %141, align 8, !tbaa !5
  %143 = fdiv double %142, %138
  store double %143, ptr %141, align 8, !tbaa !5
  %144 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 0)
  %145 = getelementptr inbounds i8, ptr %144, i64 8
  %146 = load double, ptr %145, align 8, !tbaa !5
  %147 = fdiv double %146, %138
  store double %147, ptr %145, align 8, !tbaa !5
  %148 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 0)
  %149 = getelementptr inbounds i8, ptr %148, i64 16
  %150 = load double, ptr %149, align 8, !tbaa !5
  %151 = fdiv double %150, %138
  store double %151, ptr %149, align 8, !tbaa !5
  %152 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 1)
  %153 = load double, ptr %152, align 8, !tbaa !5
  %154 = fdiv double %153, %138
  store double %154, ptr %152, align 8, !tbaa !5
  %155 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 1)
  %156 = getelementptr inbounds i8, ptr %155, i64 8
  %157 = load double, ptr %156, align 8, !tbaa !5
  %158 = fdiv double %157, %138
  store double %158, ptr %156, align 8, !tbaa !5
  %159 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 1)
  %160 = getelementptr inbounds i8, ptr %159, i64 16
  %161 = load double, ptr %160, align 8, !tbaa !5
  %162 = fdiv double %161, %138
  store double %162, ptr %160, align 8, !tbaa !5
  %163 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 2)
  %164 = load double, ptr %163, align 8, !tbaa !5
  %165 = fdiv double %164, %138
  store double %165, ptr %163, align 8, !tbaa !5
  %166 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 2)
  %167 = getelementptr inbounds i8, ptr %166, i64 8
  %168 = load double, ptr %167, align 8, !tbaa !5
  %169 = fdiv double %168, %138
  store double %169, ptr %167, align 8, !tbaa !5
  %170 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 2)
  %171 = getelementptr inbounds i8, ptr %170, i64 16
  %172 = load double, ptr %171, align 8, !tbaa !5
  %173 = fdiv double %172, %138
  store double %173, ptr %171, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %18) #6
  call void @_ZN8R4MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(128) %18, ptr noundef nonnull align 8 dereferenceable(128) @R4identity_matrix)
  %174 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 0)
  %175 = load double, ptr %174, align 8, !tbaa !5
  %176 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 0)
  %177 = load double, ptr %176, align 8, !tbaa !5
  %178 = fsub double %175, %177
  %179 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %18, i32 noundef 0)
  store double %178, ptr %179, align 8, !tbaa !5
  %180 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 0)
  %181 = getelementptr inbounds i8, ptr %180, i64 8
  %182 = load double, ptr %181, align 8, !tbaa !5
  %183 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 1)
  %184 = load double, ptr %183, align 8, !tbaa !5
  %185 = fsub double %182, %184
  %186 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %18, i32 noundef 0)
  %187 = getelementptr inbounds i8, ptr %186, i64 8
  store double %185, ptr %187, align 8, !tbaa !5
  %188 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 0)
  %189 = getelementptr inbounds i8, ptr %188, i64 16
  %190 = load double, ptr %189, align 8, !tbaa !5
  %191 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 2)
  %192 = load double, ptr %191, align 8, !tbaa !5
  %193 = fsub double %190, %192
  %194 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %18, i32 noundef 0)
  %195 = getelementptr inbounds i8, ptr %194, i64 16
  store double %193, ptr %195, align 8, !tbaa !5
  %196 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 1)
  %197 = load double, ptr %196, align 8, !tbaa !5
  %198 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 0)
  %199 = getelementptr inbounds i8, ptr %198, i64 8
  %200 = load double, ptr %199, align 8, !tbaa !5
  %201 = fsub double %197, %200
  %202 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %18, i32 noundef 1)
  store double %201, ptr %202, align 8, !tbaa !5
  %203 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 1)
  %204 = getelementptr inbounds i8, ptr %203, i64 8
  %205 = load double, ptr %204, align 8, !tbaa !5
  %206 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 1)
  %207 = getelementptr inbounds i8, ptr %206, i64 8
  %208 = load double, ptr %207, align 8, !tbaa !5
  %209 = fsub double %205, %208
  %210 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %18, i32 noundef 1)
  %211 = getelementptr inbounds i8, ptr %210, i64 8
  store double %209, ptr %211, align 8, !tbaa !5
  %212 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 1)
  %213 = getelementptr inbounds i8, ptr %212, i64 16
  %214 = load double, ptr %213, align 8, !tbaa !5
  %215 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 2)
  %216 = getelementptr inbounds i8, ptr %215, i64 8
  %217 = load double, ptr %216, align 8, !tbaa !5
  %218 = fsub double %214, %217
  %219 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %18, i32 noundef 1)
  %220 = getelementptr inbounds i8, ptr %219, i64 16
  store double %218, ptr %220, align 8, !tbaa !5
  %221 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 2)
  %222 = load double, ptr %221, align 8, !tbaa !5
  %223 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 0)
  %224 = getelementptr inbounds i8, ptr %223, i64 16
  %225 = load double, ptr %224, align 8, !tbaa !5
  %226 = fsub double %222, %225
  %227 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %18, i32 noundef 2)
  store double %226, ptr %227, align 8, !tbaa !5
  %228 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 2)
  %229 = getelementptr inbounds i8, ptr %228, i64 8
  %230 = load double, ptr %229, align 8, !tbaa !5
  %231 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 1)
  %232 = getelementptr inbounds i8, ptr %231, i64 16
  %233 = load double, ptr %232, align 8, !tbaa !5
  %234 = fsub double %230, %233
  %235 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %18, i32 noundef 2)
  %236 = getelementptr inbounds i8, ptr %235, i64 8
  store double %234, ptr %236, align 8, !tbaa !5
  %237 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 2)
  %238 = getelementptr inbounds i8, ptr %237, i64 16
  %239 = load double, ptr %238, align 8, !tbaa !5
  %240 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 2)
  %241 = getelementptr inbounds i8, ptr %240, i64 16
  %242 = load double, ptr %241, align 8, !tbaa !5
  %243 = fsub double %239, %242
  %244 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %18, i32 noundef 2)
  %245 = getelementptr inbounds i8, ptr %244, i64 16
  store double %243, ptr %245, align 8, !tbaa !5
  %246 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 0)
  %247 = load double, ptr %246, align 8, !tbaa !5
  %248 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 1)
  %249 = getelementptr inbounds i8, ptr %248, i64 8
  %250 = load double, ptr %249, align 8, !tbaa !5
  %251 = fadd double %247, %250
  %252 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 2)
  %253 = getelementptr inbounds i8, ptr %252, i64 16
  %254 = load double, ptr %253, align 8, !tbaa !5
  %255 = fadd double %251, %254
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %19) #6
  store double %255, ptr %19, align 16, !tbaa !5
  %256 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %18, i32 noundef 1)
  %257 = getelementptr inbounds i8, ptr %256, i64 16
  %258 = load double, ptr %257, align 8, !tbaa !5
  %259 = getelementptr inbounds i8, ptr %19, i64 32
  store double %258, ptr %259, align 16, !tbaa !5
  %260 = getelementptr inbounds i8, ptr %19, i64 8
  store double %258, ptr %260, align 8, !tbaa !5
  %261 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %18, i32 noundef 2)
  %262 = load double, ptr %261, align 8, !tbaa !5
  %263 = getelementptr inbounds i8, ptr %19, i64 64
  store double %262, ptr %263, align 16, !tbaa !5
  %264 = getelementptr inbounds i8, ptr %19, i64 16
  store double %262, ptr %264, align 16, !tbaa !5
  %265 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %18, i32 noundef 0)
  %266 = getelementptr inbounds i8, ptr %265, i64 8
  %267 = load double, ptr %266, align 8, !tbaa !5
  %268 = getelementptr inbounds i8, ptr %19, i64 96
  store double %267, ptr %268, align 16, !tbaa !5
  %269 = getelementptr inbounds i8, ptr %19, i64 24
  store double %267, ptr %269, align 8, !tbaa !5
  %270 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 0)
  %271 = load double, ptr %270, align 8, !tbaa !5
  %272 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 0)
  %273 = load double, ptr %272, align 8, !tbaa !5
  %274 = fadd double %271, %273
  %275 = getelementptr inbounds i8, ptr %19, i64 40
  %276 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 0)
  %277 = getelementptr inbounds i8, ptr %276, i64 8
  %278 = load double, ptr %277, align 8, !tbaa !5
  %279 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 1)
  %280 = load double, ptr %279, align 8, !tbaa !5
  %281 = fadd double %278, %280
  %282 = getelementptr inbounds i8, ptr %19, i64 48
  store double %281, ptr %282, align 16, !tbaa !5
  %283 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 0)
  %284 = getelementptr inbounds i8, ptr %283, i64 16
  %285 = load double, ptr %284, align 8, !tbaa !5
  %286 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 2)
  %287 = load double, ptr %286, align 8, !tbaa !5
  %288 = fadd double %285, %287
  %289 = getelementptr inbounds i8, ptr %19, i64 56
  store double %288, ptr %289, align 8, !tbaa !5
  %290 = fsub double %274, %255
  store double %290, ptr %275, align 8, !tbaa !5
  %291 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 1)
  %292 = load double, ptr %291, align 8, !tbaa !5
  %293 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 0)
  %294 = getelementptr inbounds i8, ptr %293, i64 8
  %295 = load double, ptr %294, align 8, !tbaa !5
  %296 = fadd double %292, %295
  %297 = getelementptr inbounds i8, ptr %19, i64 72
  store double %296, ptr %297, align 8, !tbaa !5
  %298 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 1)
  %299 = getelementptr inbounds i8, ptr %298, i64 8
  %300 = load double, ptr %299, align 8, !tbaa !5
  %301 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 1)
  %302 = getelementptr inbounds i8, ptr %301, i64 8
  %303 = load double, ptr %302, align 8, !tbaa !5
  %304 = fadd double %300, %303
  %305 = getelementptr inbounds i8, ptr %19, i64 80
  %306 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 1)
  %307 = getelementptr inbounds i8, ptr %306, i64 16
  %308 = load double, ptr %307, align 8, !tbaa !5
  %309 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 2)
  %310 = getelementptr inbounds i8, ptr %309, i64 8
  %311 = load double, ptr %310, align 8, !tbaa !5
  %312 = fadd double %308, %311
  %313 = getelementptr inbounds i8, ptr %19, i64 88
  store double %312, ptr %313, align 8, !tbaa !5
  %314 = fsub double %304, %255
  store double %314, ptr %305, align 16, !tbaa !5
  %315 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 2)
  %316 = load double, ptr %315, align 8, !tbaa !5
  %317 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 0)
  %318 = getelementptr inbounds i8, ptr %317, i64 16
  %319 = load double, ptr %318, align 8, !tbaa !5
  %320 = fadd double %316, %319
  %321 = getelementptr inbounds i8, ptr %19, i64 104
  store double %320, ptr %321, align 8, !tbaa !5
  %322 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 2)
  %323 = getelementptr inbounds i8, ptr %322, i64 8
  %324 = load double, ptr %323, align 8, !tbaa !5
  %325 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 1)
  %326 = getelementptr inbounds i8, ptr %325, i64 16
  %327 = load double, ptr %326, align 8, !tbaa !5
  %328 = fadd double %324, %327
  %329 = getelementptr inbounds i8, ptr %19, i64 112
  store double %328, ptr %329, align 16, !tbaa !5
  %330 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 2)
  %331 = getelementptr inbounds i8, ptr %330, i64 16
  %332 = load double, ptr %331, align 8, !tbaa !5
  %333 = call noundef ptr @_ZN8R4MatrixixEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 2)
  %334 = getelementptr inbounds i8, ptr %333, i64 16
  %335 = load double, ptr %334, align 8, !tbaa !5
  %336 = fadd double %332, %335
  %337 = getelementptr inbounds i8, ptr %19, i64 120
  %338 = fsub double %336, %255
  store double %338, ptr %337, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %20) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %21) #6
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %22) #6
  call void @_Z14RNSvdDecomposeiiPKdPdS1_S1_(i32 noundef 4, i32 noundef 4, ptr noundef nonnull %19, ptr noundef nonnull %20, ptr noundef nonnull %21, ptr noundef nonnull %22)
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %23) #6
  call void @_ZN8R4MatrixC1Ev(ptr noundef nonnull align 8 dereferenceable(128) %23)
  %.ptr.1 = getelementptr inbounds i8, ptr %23, i64 128
  call void @_ZN8R4MatrixC1Ev(ptr noundef nonnull align 8 dereferenceable(128) %.ptr.1)
  %.ptr.2 = getelementptr inbounds i8, ptr %23, i64 256
  call void @_ZN8R4MatrixC1Ev(ptr noundef nonnull align 8 dereferenceable(128) %.ptr.2)
  %.ptr.3 = getelementptr inbounds i8, ptr %23, i64 384
  call void @_ZN8R4MatrixC1Ev(ptr noundef nonnull align 8 dereferenceable(128) %.ptr.3)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %24) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %25) #6
  %339 = load double, ptr %20, align 16, !tbaa !5
  store double %339, ptr %25, align 16, !tbaa !5
  %340 = getelementptr inbounds i8, ptr %20, i64 32
  %341 = load double, ptr %340, align 16, !tbaa !5
  %342 = getelementptr inbounds i8, ptr %25, i64 8
  store double %341, ptr %342, align 8, !tbaa !5
  %343 = getelementptr inbounds i8, ptr %20, i64 64
  %344 = load double, ptr %343, align 16, !tbaa !5
  %345 = getelementptr inbounds i8, ptr %25, i64 16
  store double %344, ptr %345, align 16, !tbaa !5
  %346 = getelementptr inbounds i8, ptr %20, i64 96
  %347 = load double, ptr %346, align 16, !tbaa !5
  %348 = getelementptr inbounds i8, ptr %25, i64 24
  store double %347, ptr %348, align 8, !tbaa !5
  %349 = fcmp olt double %339, 0.000000e+00
  br i1 %349, label %.preheader.preheader, label %.loopexit

.thread:                                          ; preds = %139
  call void @_ZN8R4MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef nonnull align 8 dereferenceable(128) @R4identity_matrix)
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %13) #6
  br label %434

.preheader.preheader:                             ; preds = %.preheader131.preheader
  %350 = insertelement <2 x double> poison, double %339, i64 0
  %351 = insertelement <2 x double> %350, double %341, i64 1
  %352 = fneg <2 x double> %351
  store <2 x double> %352, ptr %25, align 16, !tbaa !5
  %353 = insertelement <2 x double> poison, double %344, i64 0
  %354 = insertelement <2 x double> %353, double %347, i64 1
  %355 = fneg <2 x double> %354
  store <2 x double> %355, ptr %345, align 16, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %.preheader.preheader, %.preheader131.preheader
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %26) #6
  call void @_ZL13SetQuaternionPd(ptr dead_on_unwind nonnull writable sret(%class.R4Matrix) align 8 %26, ptr noundef nonnull %25)
  %356 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZN8R4MatrixaSERKS_(ptr noundef nonnull align 8 dereferenceable(128) %23, ptr noundef nonnull align 8 dereferenceable(128) %26)
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %26) #6
  %357 = call noundef double @_Z12R3AlignErrorRK7RNArrayIP7R3PointES4_RK8R4MatrixRKS0_S9_ddPKd(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(128) %23, ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %9, double noundef %.0112, double noundef %.0111, ptr noundef %3)
  store double %357, ptr %24, align 16, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %25) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %25) #6
  %358 = getelementptr inbounds i8, ptr %20, i64 8
  %359 = load double, ptr %358, align 8, !tbaa !5
  store double %359, ptr %25, align 16, !tbaa !5
  %360 = getelementptr inbounds i8, ptr %20, i64 40
  %361 = load double, ptr %360, align 8, !tbaa !5
  store double %361, ptr %342, align 8, !tbaa !5
  %362 = getelementptr inbounds i8, ptr %20, i64 72
  %363 = load double, ptr %362, align 8, !tbaa !5
  store double %363, ptr %345, align 16, !tbaa !5
  %364 = getelementptr inbounds i8, ptr %20, i64 104
  %365 = load double, ptr %364, align 8, !tbaa !5
  store double %365, ptr %348, align 8, !tbaa !5
  %366 = fcmp olt double %359, 0.000000e+00
  br i1 %366, label %.preheader.preheader.1, label %.loopexit.1

.preheader.preheader.1:                           ; preds = %.loopexit
  %367 = insertelement <2 x double> poison, double %359, i64 0
  %368 = insertelement <2 x double> %367, double %361, i64 1
  %369 = fneg <2 x double> %368
  store <2 x double> %369, ptr %25, align 16, !tbaa !5
  %370 = insertelement <2 x double> poison, double %363, i64 0
  %371 = insertelement <2 x double> %370, double %365, i64 1
  %372 = fneg <2 x double> %371
  store <2 x double> %372, ptr %345, align 16, !tbaa !5
  br label %.loopexit.1

.loopexit.1:                                      ; preds = %.preheader.preheader.1, %.loopexit
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %26) #6
  call void @_ZL13SetQuaternionPd(ptr dead_on_unwind nonnull writable sret(%class.R4Matrix) align 8 %26, ptr noundef nonnull %25)
  %373 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZN8R4MatrixaSERKS_(ptr noundef nonnull align 8 dereferenceable(128) %.ptr.1, ptr noundef nonnull align 8 dereferenceable(128) %26)
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %26) #6
  %374 = call noundef double @_Z12R3AlignErrorRK7RNArrayIP7R3PointES4_RK8R4MatrixRKS0_S9_ddPKd(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(128) %.ptr.1, ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %9, double noundef %.0112, double noundef %.0111, ptr noundef %3)
  %375 = getelementptr inbounds i8, ptr %24, i64 8
  store double %374, ptr %375, align 8, !tbaa !5
  %376 = fcmp olt double %374, %357
  %.1.1 = zext i1 %376 to i32
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %25) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %25) #6
  %377 = getelementptr inbounds i8, ptr %20, i64 16
  %378 = load double, ptr %377, align 16, !tbaa !5
  store double %378, ptr %25, align 16, !tbaa !5
  %379 = getelementptr inbounds i8, ptr %20, i64 48
  %380 = load double, ptr %379, align 16, !tbaa !5
  store double %380, ptr %342, align 8, !tbaa !5
  %381 = getelementptr inbounds i8, ptr %20, i64 80
  %382 = load double, ptr %381, align 16, !tbaa !5
  store double %382, ptr %345, align 16, !tbaa !5
  %383 = getelementptr inbounds i8, ptr %20, i64 112
  %384 = load double, ptr %383, align 16, !tbaa !5
  store double %384, ptr %348, align 8, !tbaa !5
  %385 = fcmp olt double %378, 0.000000e+00
  br i1 %385, label %.preheader.preheader.2, label %.loopexit.2

.preheader.preheader.2:                           ; preds = %.loopexit.1
  %386 = insertelement <2 x double> poison, double %378, i64 0
  %387 = insertelement <2 x double> %386, double %380, i64 1
  %388 = fneg <2 x double> %387
  store <2 x double> %388, ptr %25, align 16, !tbaa !5
  %389 = insertelement <2 x double> poison, double %382, i64 0
  %390 = insertelement <2 x double> %389, double %384, i64 1
  %391 = fneg <2 x double> %390
  store <2 x double> %391, ptr %345, align 16, !tbaa !5
  br label %.loopexit.2

.loopexit.2:                                      ; preds = %.preheader.preheader.2, %.loopexit.1
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %26) #6
  call void @_ZL13SetQuaternionPd(ptr dead_on_unwind nonnull writable sret(%class.R4Matrix) align 8 %26, ptr noundef nonnull %25)
  %392 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZN8R4MatrixaSERKS_(ptr noundef nonnull align 8 dereferenceable(128) %.ptr.2, ptr noundef nonnull align 8 dereferenceable(128) %26)
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %26) #6
  %393 = call noundef double @_Z12R3AlignErrorRK7RNArrayIP7R3PointES4_RK8R4MatrixRKS0_S9_ddPKd(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(128) %.ptr.2, ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %9, double noundef %.0112, double noundef %.0111, ptr noundef %3)
  %394 = getelementptr inbounds i8, ptr %24, i64 16
  store double %393, ptr %394, align 16, !tbaa !5
  %395 = zext i1 %376 to i64
  %396 = getelementptr inbounds [4 x double], ptr %24, i64 0, i64 %395
  %397 = load double, ptr %396, align 8, !tbaa !5
  %398 = fcmp olt double %393, %397
  %.1.2 = select i1 %398, i32 2, i32 %.1.1
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %25) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %25) #6
  %399 = getelementptr inbounds i8, ptr %20, i64 24
  %400 = load double, ptr %399, align 8, !tbaa !5
  store double %400, ptr %25, align 16, !tbaa !5
  %401 = getelementptr inbounds i8, ptr %20, i64 56
  %402 = load double, ptr %401, align 8, !tbaa !5
  store double %402, ptr %342, align 8, !tbaa !5
  %403 = getelementptr inbounds i8, ptr %20, i64 88
  %404 = load double, ptr %403, align 8, !tbaa !5
  store double %404, ptr %345, align 16, !tbaa !5
  %405 = getelementptr inbounds i8, ptr %20, i64 120
  %406 = load double, ptr %405, align 8, !tbaa !5
  store double %406, ptr %348, align 8, !tbaa !5
  %407 = fcmp olt double %400, 0.000000e+00
  br i1 %407, label %.preheader.preheader.3, label %.loopexit.3

.preheader.preheader.3:                           ; preds = %.loopexit.2
  %408 = insertelement <2 x double> poison, double %400, i64 0
  %409 = insertelement <2 x double> %408, double %402, i64 1
  %410 = fneg <2 x double> %409
  store <2 x double> %410, ptr %25, align 16, !tbaa !5
  %411 = insertelement <2 x double> poison, double %404, i64 0
  %412 = insertelement <2 x double> %411, double %406, i64 1
  %413 = fneg <2 x double> %412
  store <2 x double> %413, ptr %345, align 16, !tbaa !5
  br label %.loopexit.3

.loopexit.3:                                      ; preds = %.preheader.preheader.3, %.loopexit.2
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %26) #6
  call void @_ZL13SetQuaternionPd(ptr dead_on_unwind nonnull writable sret(%class.R4Matrix) align 8 %26, ptr noundef nonnull %25)
  %414 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZN8R4MatrixaSERKS_(ptr noundef nonnull align 8 dereferenceable(128) %.ptr.3, ptr noundef nonnull align 8 dereferenceable(128) %26)
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %26) #6
  %415 = call noundef double @_Z12R3AlignErrorRK7RNArrayIP7R3PointES4_RK8R4MatrixRKS0_S9_ddPKd(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(128) %.ptr.3, ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %9, double noundef %.0112, double noundef %.0111, ptr noundef %3)
  %416 = getelementptr inbounds i8, ptr %24, i64 24
  store double %415, ptr %416, align 8, !tbaa !5
  %417 = zext nneg i32 %.1.2 to i64
  %418 = getelementptr inbounds [4 x double], ptr %24, i64 0, i64 %417
  %419 = load double, ptr %418, align 8, !tbaa !5
  %420 = fcmp olt double %415, %419
  %421 = zext nneg i32 %.1.2 to i64
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %25) #6
  %422 = select i1 %420, i64 3, i64 %421
  %423 = getelementptr inbounds [4 x %class.R4Matrix], ptr %23, i64 0, i64 %422
  %424 = call noundef nonnull align 8 dereferenceable(128) ptr @_ZN8R4MatrixaSERKS_(ptr noundef nonnull align 8 dereferenceable(128) %12, ptr noundef nonnull align 8 dereferenceable(128) %423)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %24) #6
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %23) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %22) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %21) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %20) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %19) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %18) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %13) #6
  br label %425

425:                                              ; preds = %.loopexit.3, %45
  call void @_ZN8R4MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef nonnull align 8 dereferenceable(128) @R4identity_matrix)
  br i1 %.not, label %427, label %426

426:                                              ; preds = %425
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %27) #6
  call void @_ZNK7R3Point6VectorEv(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %27, ptr noundef nonnull align 8 dereferenceable(24) %8)
  call void @_ZN8R4Matrix9TranslateERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef nonnull align 8 dereferenceable(24) %27)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %27) #6
  br label %427

427:                                              ; preds = %426, %425
  br i1 %.not122, label %430, label %428

428:                                              ; preds = %427
  %429 = fdiv double %.0112, %.0111
  call void @_ZN8R4Matrix5ScaleEd(ptr noundef nonnull align 8 dereferenceable(128) %0, double noundef %429)
  br label %430

430:                                              ; preds = %428, %427
  br i1 %.not123, label %432, label %431

431:                                              ; preds = %430
  call void @_ZN8R4Matrix9TransformERKS_(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef nonnull align 8 dereferenceable(128) %12)
  br label %432

432:                                              ; preds = %431, %430
  br i1 %.not, label %434, label %433

433:                                              ; preds = %432
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %28) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %29) #6
  call void @_ZNK7R3Point6VectorEv(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %29, ptr noundef nonnull align 8 dereferenceable(24) %9)
  call void @_ZngRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %28, ptr noundef nonnull align 8 dereferenceable(24) %29)
  call void @_ZN8R4Matrix9TranslateERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef nonnull align 8 dereferenceable(24) %28)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %29) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %28) #6
  br label %434

434:                                              ; preds = %.thread, %432, %433
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #6
  ret void
}

declare void @_ZN8R4MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(128)) unnamed_addr #3

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

declare void @_ZN8R4MatrixC1Ev(ptr noundef nonnull align 8 dereferenceable(128)) unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL13SetQuaternionPd(ptr dead_on_unwind noalias writable sret(%class.R4Matrix) align 8, ptr noundef) local_unnamed_addr #2

declare noundef nonnull align 8 dereferenceable(128) ptr @_ZN8R4MatrixaSERKS_(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #3

declare void @_ZN8R4Matrix9TranslateERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

declare void @_ZN8R4Matrix5ScaleEd(ptr noundef nonnull align 8 dereferenceable(128), double noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8R4Matrix9TransformERKS_(ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #5 align 2

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


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