; LLVM IR from niessner/Matterport :: code/gaps/pkgs/R2Shapes/R2Align.ll (Z13R2AlignPointsRK7RNArrayIP7R2PointES4_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.R3Matrix = type { [3 x [3 x double]] }
%class.R2Point = type { [2 x double] }
%class.R2Vector = type { [2 x double] }

@R3identity_matrix = external global %class.R3Matrix, align 8

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

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

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

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

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

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

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

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

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

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

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

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZN7R2PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z13R2AlignPointsRK7RNArrayIP7R2PointES4_PKdiii(ptr dead_on_unwind noalias writable sret(%class.R3Matrix) 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) #0 {
  %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 %class.R2Point, align 8
  %17 = alloca %class.R2Point, align 8
  %18 = alloca %class.R2Point, align 8
  %19 = alloca %class.R2Point, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca %class.R3Matrix, align 8
  %23 = alloca [4 x double], align 16
  %24 = alloca double, align 8
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca %class.R2Vector, align 8
  %30 = alloca %class.R2Vector, align 8
  %31 = alloca %class.R2Vector, align 8
  %32 = alloca %class.R2Vector, align 8
  %33 = alloca double, align 8
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca i32, align 4
  %37 = alloca [4 x double], align 16
  %38 = alloca [2 x double], align 16
  %39 = alloca [4 x double], align 16
  %40 = alloca %class.R3Matrix, align 8
  %41 = alloca %class.R3Matrix, align 8
  %42 = alloca %class.R3Matrix, align 8
  %43 = alloca %class.R3Matrix, align 8
  %44 = alloca %class.R3Matrix, align 8
  %45 = alloca %class.R3Matrix, align 8
  %46 = alloca %class.R2Vector, align 8
  %47 = alloca %class.R2Vector, align 8
  %48 = alloca %class.R2Vector, 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) #7
  %49 = load ptr, ptr %9, align 8, !tbaa !5
  %50 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %49)
  store i32 %50, ptr %15, align 4, !tbaa !9
  %51 = load ptr, ptr %10, align 8, !tbaa !5
  %52 = call noundef i32 @_ZNK8RNVArray8NEntriesEv(ptr noundef nonnull align 8 dereferenceable(16) %51)
  %53 = load i32, ptr %15, align 4, !tbaa !9
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %55, label %58

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

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

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

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

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

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

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

70:                                               ; preds = %69, %66
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #7
  call void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %16, double noundef 0.000000e+00, double noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #7
  call void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %17, double noundef 0.000000e+00, double noundef 0.000000e+00)
  %71 = load i32, ptr %12, align 4, !tbaa !9
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %73, label %80

73:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #7
  %74 = load ptr, ptr %9, align 8, !tbaa !5
  %75 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_Z10R2CentroidRK7RNArrayIP7R2PointEPKd(ptr dead_on_unwind writable sret(%class.R2Point) align 8 %18, ptr noundef nonnull align 8 dereferenceable(16) %74, ptr noundef %75)
  %76 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN7R2PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(16) %18)
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #7
  %77 = load ptr, ptr %10, align 8, !tbaa !5
  %78 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_Z10R2CentroidRK7RNArrayIP7R2PointEPKd(ptr dead_on_unwind writable sret(%class.R2Point) align 8 %19, ptr noundef nonnull align 8 dereferenceable(16) %77, ptr noundef %78)
  %79 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN7R2PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(16) %19)
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #7
  br label %80

80:                                               ; preds = %73, %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  store double 1.000000e+00, ptr %20, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  store double 1.000000e+00, ptr %21, align 8, !tbaa !11
  %81 = load i32, ptr %14, align 4, !tbaa !9
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %83, label %90

83:                                               ; preds = %80
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  %85 = load ptr, ptr %11, align 8, !tbaa !5
  %86 = call noundef double @_Z17R2AverageDistanceRK7R2PointRK7RNArrayIPS_EPKd(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(16) %84, ptr noundef %85)
  store double %86, ptr %20, align 8, !tbaa !11
  %87 = load ptr, ptr %10, align 8, !tbaa !5
  %88 = load ptr, ptr %11, align 8, !tbaa !5
  %89 = call noundef double @_Z17R2AverageDistanceRK7R2PointRK7RNArrayIPS_EPKd(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(16) %87, ptr noundef %88)
  store double %89, ptr %21, align 8, !tbaa !11
  br label %90

90:                                               ; preds = %83, %80
  call void @llvm.lifetime.start.p0(i64 72, ptr %22) #7
  call void @_ZN8R3MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(72) %22, ptr noundef nonnull align 8 dereferenceable(72) @R3identity_matrix)
  %91 = load i32, ptr %13, align 4, !tbaa !9
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %220

93:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 32, ptr %23) #7
  call void @llvm.memset.p0.i64(ptr align 16 %23, i8 0, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  store double 0.000000e+00, ptr %24, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  store i32 0, ptr %25, align 4, !tbaa !9
  br label %94

94:                                               ; preds = %158, %93
  %95 = load i32, ptr %25, align 4, !tbaa !9
  %96 = load i32, ptr %15, align 4, !tbaa !9
  %97 = icmp slt i32 %95, %96
  br i1 %97, label %99, label %98

98:                                               ; preds = %94
  store i32 2, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %161

99:                                               ; preds = %94
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %100 = load ptr, ptr %9, align 8, !tbaa !5
  %101 = load i32, ptr %25, align 4, !tbaa !9
  %102 = call noundef ptr @_ZNK7RNArrayIP7R2PointEixEi(ptr noundef nonnull align 8 dereferenceable(16) %100, i32 noundef %101)
  store ptr %102, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  %103 = load ptr, ptr %10, align 8, !tbaa !5
  %104 = load i32, ptr %25, align 4, !tbaa !9
  %105 = call noundef ptr @_ZNK7RNArrayIP7R2PointEixEi(ptr noundef nonnull align 8 dereferenceable(16) %103, i32 noundef %104)
  store ptr %105, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %29) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %30) #7
  %106 = load ptr, ptr %27, align 8, !tbaa !5
  call void @_ZmiRK7R2PointS1_(ptr dead_on_unwind writable sret(%class.R2Vector) align 8 %30, ptr noundef nonnull align 8 dereferenceable(16) %106, ptr noundef nonnull align 8 dereferenceable(16) %16)
  %107 = load double, ptr %20, align 8, !tbaa !11
  call void @_ZdvRK8R2Vectord(ptr dead_on_unwind writable sret(%class.R2Vector) align 8 %29, ptr noundef nonnull align 8 dereferenceable(16) %30, double noundef %107)
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %31) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %32) #7
  %108 = load ptr, ptr %28, align 8, !tbaa !5
  call void @_ZmiRK7R2PointS1_(ptr dead_on_unwind writable sret(%class.R2Vector) align 8 %32, ptr noundef nonnull align 8 dereferenceable(16) %108, ptr noundef nonnull align 8 dereferenceable(16) %17)
  %109 = load double, ptr %21, align 8, !tbaa !11
  call void @_ZdvRK8R2Vectord(ptr dead_on_unwind writable sret(%class.R2Vector) align 8 %31, ptr noundef nonnull align 8 dereferenceable(16) %32, double noundef %109)
  call void @llvm.lifetime.end.p0(i64 16, ptr %32) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #7
  %110 = load ptr, ptr %11, align 8, !tbaa !5
  %111 = icmp ne ptr %110, null
  br i1 %111, label %112, label %118

112:                                              ; preds = %99
  %113 = load ptr, ptr %11, align 8, !tbaa !5
  %114 = load i32, ptr %25, align 4, !tbaa !9
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds double, ptr %113, i64 %115
  %117 = load double, ptr %116, align 8, !tbaa !11
  br label %119

118:                                              ; preds = %99
  br label %119

119:                                              ; preds = %118, %112
  %120 = phi double [ %117, %112 ], [ 1.000000e+00, %118 ]
  store double %120, ptr %33, align 8, !tbaa !11
  %121 = load double, ptr %33, align 8, !tbaa !11
  %122 = load double, ptr %24, align 8, !tbaa !11
  %123 = fadd double %122, %121
  store double %123, ptr %24, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #7
  store i32 0, ptr %34, align 4, !tbaa !9
  br label %124

124:                                              ; preds = %154, %119
  %125 = load i32, ptr %34, align 4, !tbaa !9
  %126 = icmp slt i32 %125, 2
  br i1 %126, label %128, label %127

127:                                              ; preds = %124
  store i32 5, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #7
  br label %157

128:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #7
  store i32 0, ptr %35, align 4, !tbaa !9
  br label %129

129:                                              ; preds = %150, %128
  %130 = load i32, ptr %35, align 4, !tbaa !9
  %131 = icmp slt i32 %130, 2
  br i1 %131, label %133, label %132

132:                                              ; preds = %129
  store i32 8, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #7
  br label %153

133:                                              ; preds = %129
  %134 = load double, ptr %33, align 8, !tbaa !11
  %135 = load i32, ptr %34, align 4, !tbaa !9
  %136 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %29, i32 noundef %135)
  %137 = load double, ptr %136, align 8, !tbaa !11
  %138 = fmul double %134, %137
  %139 = load i32, ptr %35, align 4, !tbaa !9
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %31, i32 noundef %139)
  %141 = load double, ptr %140, align 8, !tbaa !11
  %142 = load i32, ptr %35, align 4, !tbaa !9
  %143 = mul nsw i32 %142, 2
  %144 = load i32, ptr %34, align 4, !tbaa !9
  %145 = add nsw i32 %143, %144
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [4 x double], ptr %23, i64 0, i64 %146
  %148 = load double, ptr %147, align 8, !tbaa !11
  %149 = call double @llvm.fmuladd.f64(double %138, double %141, double %148)
  store double %149, ptr %147, align 8, !tbaa !11
  br label %150

150:                                              ; preds = %133
  %151 = load i32, ptr %35, align 4, !tbaa !9
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %35, align 4, !tbaa !9
  br label %129, !llvm.loop !13

153:                                              ; preds = %132
  br label %154

154:                                              ; preds = %153
  %155 = load i32, ptr %34, align 4, !tbaa !9
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %34, align 4, !tbaa !9
  br label %124, !llvm.loop !15

157:                                              ; preds = %127
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  br label %158

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

161:                                              ; preds = %98
  %162 = load double, ptr %24, align 8, !tbaa !11
  %163 = fcmp oeq double %162, 0.000000e+00
  br i1 %163, label %164, label %165

164:                                              ; preds = %161
  call void @_ZN8R3MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(72) @R3identity_matrix)
  store i32 1, ptr %26, align 4
  br label %217

165:                                              ; preds = %161
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #7
  store i32 0, ptr %36, align 4, !tbaa !9
  br label %166

166:                                              ; preds = %177, %165
  %167 = load i32, ptr %36, align 4, !tbaa !9
  %168 = icmp slt i32 %167, 4
  br i1 %168, label %170, label %169

169:                                              ; preds = %166
  store i32 11, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #7
  br label %180

170:                                              ; preds = %166
  %171 = load double, ptr %24, align 8, !tbaa !11
  %172 = load i32, ptr %36, align 4, !tbaa !9
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [4 x double], ptr %23, i64 0, i64 %173
  %175 = load double, ptr %174, align 8, !tbaa !11
  %176 = fdiv double %175, %171
  store double %176, ptr %174, align 8, !tbaa !11
  br label %177

177:                                              ; preds = %170
  %178 = load i32, ptr %36, align 4, !tbaa !9
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %36, align 4, !tbaa !9
  br label %166, !llvm.loop !17

180:                                              ; preds = %169
  call void @llvm.lifetime.start.p0(i64 32, ptr %37) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %38) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %39) #7
  %181 = getelementptr inbounds [4 x double], ptr %23, i64 0, i64 0
  %182 = getelementptr inbounds [4 x double], ptr %37, i64 0, i64 0
  %183 = getelementptr inbounds [2 x double], ptr %38, i64 0, i64 0
  %184 = getelementptr inbounds [4 x double], ptr %39, i64 0, i64 0
  call void @_Z14RNSvdDecomposeiiPKdPdS1_S1_(i32 noundef 2, i32 noundef 2, ptr noundef %181, ptr noundef %182, ptr noundef %183, ptr noundef %184)
  call void @llvm.lifetime.start.p0(i64 72, ptr %40) #7
  %185 = getelementptr inbounds [4 x double], ptr %37, i64 0, i64 0
  %186 = load double, ptr %185, align 16, !tbaa !11
  %187 = getelementptr inbounds [4 x double], ptr %37, i64 0, i64 2
  %188 = load double, ptr %187, align 16, !tbaa !11
  %189 = getelementptr inbounds [4 x double], ptr %37, i64 0, i64 1
  %190 = load double, ptr %189, align 8, !tbaa !11
  %191 = getelementptr inbounds [4 x double], ptr %37, i64 0, i64 3
  %192 = load double, ptr %191, align 8, !tbaa !11
  call void @_ZN8R3MatrixC1Eddddddddd(ptr noundef nonnull align 8 dereferenceable(72) %40, double noundef %186, double noundef %188, double noundef 0.000000e+00, double noundef %190, double noundef %192, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef 1.000000e+00)
  call void @llvm.lifetime.start.p0(i64 72, ptr %41) #7
  %193 = getelementptr inbounds [4 x double], ptr %39, i64 0, i64 0
  %194 = load double, ptr %193, align 16, !tbaa !11
  %195 = getelementptr inbounds [4 x double], ptr %39, i64 0, i64 2
  %196 = load double, ptr %195, align 16, !tbaa !11
  %197 = getelementptr inbounds [4 x double], ptr %39, i64 0, i64 1
  %198 = load double, ptr %197, align 8, !tbaa !11
  %199 = getelementptr inbounds [4 x double], ptr %39, i64 0, i64 3
  %200 = load double, ptr %199, align 8, !tbaa !11
  call void @_ZN8R3MatrixC1Eddddddddd(ptr noundef nonnull align 8 dereferenceable(72) %41, double noundef %194, double noundef %196, double noundef 0.000000e+00, double noundef %198, double noundef %200, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef 1.000000e+00)
  call void @llvm.lifetime.start.p0(i64 72, ptr %42) #7
  call void @_ZmlRK8R3MatrixS1_(ptr dead_on_unwind writable sret(%class.R3Matrix) align 8 %42, ptr noundef nonnull align 8 dereferenceable(72) %41, ptr noundef nonnull align 8 dereferenceable(72) %40)
  call void @llvm.lifetime.start.p0(i64 72, ptr %43) #7
  call void @_ZN8R3MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(72) %43, ptr noundef nonnull align 8 dereferenceable(72) @R3identity_matrix)
  %201 = call noundef ptr @_ZN8R3MatrixixEi(ptr noundef nonnull align 8 dereferenceable(72) %42, i32 noundef 0)
  %202 = getelementptr inbounds double, ptr %201, i64 0
  %203 = load double, ptr %202, align 8, !tbaa !11
  %204 = call noundef ptr @_ZN8R3MatrixixEi(ptr noundef nonnull align 8 dereferenceable(72) %42, i32 noundef 0)
  %205 = getelementptr inbounds double, ptr %204, i64 1
  %206 = load double, ptr %205, align 8, !tbaa !11
  %207 = call noundef ptr @_ZN8R3MatrixixEi(ptr noundef nonnull align 8 dereferenceable(72) %42, i32 noundef 1)
  %208 = getelementptr inbounds double, ptr %207, i64 0
  %209 = load double, ptr %208, align 8, !tbaa !11
  %210 = call noundef ptr @_ZN8R3MatrixixEi(ptr noundef nonnull align 8 dereferenceable(72) %42, i32 noundef 1)
  %211 = getelementptr inbounds double, ptr %210, i64 1
  %212 = load double, ptr %211, align 8, !tbaa !11
  %213 = call noundef double @_Z12R3MatrixDet2dddd(double noundef %203, double noundef %206, double noundef %209, double noundef %212)
  %214 = call noundef ptr @_ZN8R3MatrixixEi(ptr noundef nonnull align 8 dereferenceable(72) %43, i32 noundef 1)
  %215 = getelementptr inbounds double, ptr %214, i64 1
  store double %213, ptr %215, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 72, ptr %44) #7
  call void @llvm.lifetime.start.p0(i64 72, ptr %45) #7
  call void @_ZmlRK8R3MatrixS1_(ptr dead_on_unwind writable sret(%class.R3Matrix) align 8 %45, ptr noundef nonnull align 8 dereferenceable(72) %41, ptr noundef nonnull align 8 dereferenceable(72) %43)
  call void @_ZmlRK8R3MatrixS1_(ptr dead_on_unwind writable sret(%class.R3Matrix) align 8 %44, ptr noundef nonnull align 8 dereferenceable(72) %45, ptr noundef nonnull align 8 dereferenceable(72) %40)
  %216 = call noundef nonnull align 8 dereferenceable(72) ptr @_ZN8R3MatrixaSERKS_(ptr noundef nonnull align 8 dereferenceable(72) %22, ptr noundef nonnull align 8 dereferenceable(72) %44)
  call void @llvm.lifetime.end.p0(i64 72, ptr %45) #7
  call void @llvm.lifetime.end.p0(i64 72, ptr %44) #7
  call void @llvm.lifetime.end.p0(i64 72, ptr %43) #7
  call void @llvm.lifetime.end.p0(i64 72, ptr %42) #7
  call void @llvm.lifetime.end.p0(i64 72, ptr %41) #7
  call void @llvm.lifetime.end.p0(i64 72, ptr %40) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %39) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %38) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %37) #7
  store i32 0, ptr %26, align 4
  br label %217

217:                                              ; preds = %180, %164
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %23) #7
  %218 = load i32, ptr %26, align 4
  switch i32 %218, label %240 [
    i32 0, label %219
  ]

219:                                              ; preds = %217
  br label %220

220:                                              ; preds = %219, %90
  call void @_ZN8R3MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(72) @R3identity_matrix)
  %221 = load i32, ptr %12, align 4, !tbaa !9
  %222 = icmp ne i32 %221, 0
  br i1 %222, label %223, label %224

223:                                              ; preds = %220
  call void @llvm.lifetime.start.p0(i64 16, ptr %46) #7
  call void @_ZNK7R2Point6VectorEv(ptr dead_on_unwind writable sret(%class.R2Vector) align 8 %46, ptr noundef nonnull align 8 dereferenceable(16) %16)
  call void @_ZN8R3Matrix9TranslateERK8R2Vector(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(16) %46)
  call void @llvm.lifetime.end.p0(i64 16, ptr %46) #7
  br label %224

224:                                              ; preds = %223, %220
  %225 = load i32, ptr %14, align 4, !tbaa !9
  %226 = icmp ne i32 %225, 0
  br i1 %226, label %227, label %231

227:                                              ; preds = %224
  %228 = load double, ptr %20, align 8, !tbaa !11
  %229 = load double, ptr %21, align 8, !tbaa !11
  %230 = fdiv double %228, %229
  call void @_ZN8R3Matrix5ScaleEd(ptr noundef nonnull align 8 dereferenceable(72) %0, double noundef %230)
  br label %231

231:                                              ; preds = %227, %224
  %232 = load i32, ptr %13, align 4, !tbaa !9
  %233 = icmp ne i32 %232, 0
  br i1 %233, label %234, label %235

234:                                              ; preds = %231
  call void @_ZN8R3Matrix9TransformERKS_(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(72) %22)
  br label %235

235:                                              ; preds = %234, %231
  %236 = load i32, ptr %12, align 4, !tbaa !9
  %237 = icmp ne i32 %236, 0
  br i1 %237, label %238, label %239

238:                                              ; preds = %235
  call void @llvm.lifetime.start.p0(i64 16, ptr %47) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %48) #7
  call void @_ZNK7R2Point6VectorEv(ptr dead_on_unwind writable sret(%class.R2Vector) align 8 %48, ptr noundef nonnull align 8 dereferenceable(16) %17)
  call void @_ZngRK8R2Vector(ptr dead_on_unwind writable sret(%class.R2Vector) align 8 %47, ptr noundef nonnull align 8 dereferenceable(16) %48)
  call void @_ZN8R3Matrix9TranslateERK8R2Vector(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(16) %47)
  call void @llvm.lifetime.end.p0(i64 16, ptr %48) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %47) #7
  br label %239

239:                                              ; preds = %238, %235
  store i32 1, ptr %26, align 4
  br label %240

240:                                              ; preds = %239, %217
  call void @llvm.lifetime.end.p0(i64 72, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  ret void
}

declare void @_ZN8R3MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(72)) unnamed_addr #1

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

declare void @_ZN8R3MatrixC1Eddddddddd(ptr noundef nonnull align 8 dereferenceable(72), double noundef, double noundef, double noundef, double noundef, double noundef, double noundef, double noundef, double noundef, double noundef) unnamed_addr #1

declare void @_ZmlRK8R3MatrixS1_(ptr dead_on_unwind writable sret(%class.R3Matrix) align 8, ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(72)) #1

declare noundef double @_Z12R3MatrixDet2dddd(double noundef, double noundef, double noundef, double noundef) #1

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

declare noundef nonnull align 8 dereferenceable(72) ptr @_ZN8R3MatrixaSERKS_(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(72)) #1

declare void @_ZN8R3Matrix9TranslateERK8R2Vector(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(16)) #1

declare void @_ZN8R3Matrix5ScaleEd(ptr noundef nonnull align 8 dereferenceable(72), double noundef) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8R3Matrix9TransformERKS_(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(72)) #6 align 2

attributes #0 = { 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 #1 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 #7 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"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}


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

@R3identity_matrix = external global %class.R3Matrix, align 8

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

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

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

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

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

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

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

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

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

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

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZN7R2PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z13R2AlignPointsRK7RNArrayIP7R2PointES4_PKdiii(ptr dead_on_unwind noalias writable sret(%class.R3Matrix) 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 #0 {
  %8 = alloca %class.R2Point, align 8
  %9 = alloca %class.R2Point, align 8
  %10 = alloca %class.R2Point, align 8
  %11 = alloca %class.R2Point, align 8
  %12 = alloca %class.R3Matrix, align 8
  %13 = alloca [4 x double], align 16
  %14 = alloca %class.R2Vector, align 8
  %15 = alloca %class.R2Vector, align 8
  %16 = alloca %class.R2Vector, align 8
  %17 = alloca %class.R2Vector, align 8
  %18 = alloca [4 x double], align 16
  %19 = alloca [2 x double], align 16
  %20 = alloca [4 x double], align 16
  %21 = alloca %class.R3Matrix, align 8
  %22 = alloca %class.R3Matrix, align 8
  %23 = alloca %class.R3Matrix, align 8
  %24 = alloca %class.R3Matrix, align 8
  %25 = alloca %class.R3Matrix, align 8
  %26 = alloca %class.R3Matrix, align 8
  %27 = alloca %class.R2Vector, align 8
  %28 = alloca %class.R2Vector, align 8
  %29 = alloca %class.R2Vector, 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
  %.064 = phi i32 [ %34, %33 ], [ %30, %7 ]
  %.inv = icmp slt i32 %.064, 1
  %36 = icmp slt i32 %.064, 2
  %37 = icmp slt i32 %.064, 3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #7
  call void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %8, double noundef 0.000000e+00, double noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #7
  call void @_ZN7R2PointC1Edd(ptr noundef nonnull align 8 dereferenceable(16) %9, double noundef 0.000000e+00, double noundef 0.000000e+00)
  %.not70 = icmp eq i32 %4, 0
  %.not = or i1 %.not70, %.inv
  br i1 %.not, label %41, label %38

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

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

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

45:                                               ; preds = %42, %41
  %.063 = phi double [ %43, %42 ], [ 1.000000e+00, %41 ]
  %.062 = phi double [ %44, %42 ], [ 1.000000e+00, %41 ]
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %12) #7
  call void @_ZN8R3MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(72) %12, ptr noundef nonnull align 8 dereferenceable(72) @R3identity_matrix)
  %.not6872 = icmp eq i32 %5, 0
  %.not68 = or i1 %.not6872, %37
  br i1 %.not68, label %123, label %46

46:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %13) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %13, i8 0, i64 32, i1 false)
  %.not69 = icmp eq ptr %3, null
  %wide.trip.count = zext nneg i32 %.064 to i64
  br label %82

47:                                               ; preds = %.preheader73
  %48 = fcmp une double %122, 0.000000e+00
  br i1 %48, label %.preheader.preheader, label %.thread

.preheader.preheader:                             ; preds = %47
  %49 = getelementptr inbounds i8, ptr %13, i64 16
  %50 = insertelement <2 x double> poison, double %122, i64 0
  %51 = shufflevector <2 x double> %50, <2 x double> poison, <2 x i32> zeroinitializer
  %52 = fdiv <2 x double> %111, %51
  store <2 x double> %52, ptr %13, align 16, !tbaa !5
  %53 = fdiv <2 x double> %121, %51
  store <2 x double> %53, ptr %49, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %18) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %19) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %20) #7
  call void @_Z14RNSvdDecomposeiiPKdPdS1_S1_(i32 noundef 2, i32 noundef 2, ptr noundef nonnull %13, ptr noundef nonnull %18, ptr noundef nonnull %19, ptr noundef nonnull %20)
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %21) #7
  %54 = load double, ptr %18, align 16, !tbaa !5
  %55 = getelementptr inbounds i8, ptr %18, i64 16
  %56 = load double, ptr %55, align 16, !tbaa !5
  %57 = getelementptr inbounds i8, ptr %18, i64 8
  %58 = load double, ptr %57, align 8, !tbaa !5
  %59 = getelementptr inbounds i8, ptr %18, i64 24
  %60 = load double, ptr %59, align 8, !tbaa !5
  call void @_ZN8R3MatrixC1Eddddddddd(ptr noundef nonnull align 8 dereferenceable(72) %21, double noundef %54, double noundef %56, double noundef 0.000000e+00, double noundef %58, double noundef %60, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef 1.000000e+00)
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %22) #7
  %61 = load double, ptr %20, align 16, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %20, i64 16
  %63 = load double, ptr %62, align 16, !tbaa !5
  %64 = getelementptr inbounds i8, ptr %20, i64 8
  %65 = load double, ptr %64, align 8, !tbaa !5
  %66 = getelementptr inbounds i8, ptr %20, i64 24
  %67 = load double, ptr %66, align 8, !tbaa !5
  call void @_ZN8R3MatrixC1Eddddddddd(ptr noundef nonnull align 8 dereferenceable(72) %22, double noundef %61, double noundef %63, double noundef 0.000000e+00, double noundef %65, double noundef %67, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef 0.000000e+00, double noundef 1.000000e+00)
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %23) #7
  call void @_ZmlRK8R3MatrixS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Matrix) align 8 %23, ptr noundef nonnull align 8 dereferenceable(72) %22, ptr noundef nonnull align 8 dereferenceable(72) %21)
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %24) #7
  call void @_ZN8R3MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(72) %24, ptr noundef nonnull align 8 dereferenceable(72) @R3identity_matrix)
  %68 = call noundef ptr @_ZN8R3MatrixixEi(ptr noundef nonnull align 8 dereferenceable(72) %23, i32 noundef 0)
  %69 = load double, ptr %68, align 8, !tbaa !5
  %70 = call noundef ptr @_ZN8R3MatrixixEi(ptr noundef nonnull align 8 dereferenceable(72) %23, i32 noundef 0)
  %71 = getelementptr inbounds i8, ptr %70, i64 8
  %72 = load double, ptr %71, align 8, !tbaa !5
  %73 = call noundef ptr @_ZN8R3MatrixixEi(ptr noundef nonnull align 8 dereferenceable(72) %23, i32 noundef 1)
  %74 = load double, ptr %73, align 8, !tbaa !5
  %75 = call noundef ptr @_ZN8R3MatrixixEi(ptr noundef nonnull align 8 dereferenceable(72) %23, i32 noundef 1)
  %76 = getelementptr inbounds i8, ptr %75, i64 8
  %77 = load double, ptr %76, align 8, !tbaa !5
  %78 = call noundef double @_Z12R3MatrixDet2dddd(double noundef %69, double noundef %72, double noundef %74, double noundef %77)
  %79 = call noundef ptr @_ZN8R3MatrixixEi(ptr noundef nonnull align 8 dereferenceable(72) %24, i32 noundef 1)
  %80 = getelementptr inbounds i8, ptr %79, i64 8
  store double %78, ptr %80, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %25) #7
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %26) #7
  call void @_ZmlRK8R3MatrixS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Matrix) align 8 %26, ptr noundef nonnull align 8 dereferenceable(72) %22, ptr noundef nonnull align 8 dereferenceable(72) %24)
  call void @_ZmlRK8R3MatrixS1_(ptr dead_on_unwind nonnull writable sret(%class.R3Matrix) align 8 %25, ptr noundef nonnull align 8 dereferenceable(72) %26, ptr noundef nonnull align 8 dereferenceable(72) %21)
  %81 = call noundef nonnull align 8 dereferenceable(72) ptr @_ZN8R3MatrixaSERKS_(ptr noundef nonnull align 8 dereferenceable(72) %12, ptr noundef nonnull align 8 dereferenceable(72) %25)
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %26) #7
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %25) #7
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %24) #7
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %23) #7
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %22) #7
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %21) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %20) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %19) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %18) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #7
  br label %123

82:                                               ; preds = %46, %.preheader73
  %indvars.iv = phi i64 [ 0, %46 ], [ %indvars.iv.next, %.preheader73 ]
  %.06176 = phi double [ 0.000000e+00, %46 ], [ %122, %.preheader73 ]
  %83 = phi <2 x double> [ zeroinitializer, %46 ], [ %111, %.preheader73 ]
  %84 = phi <2 x double> [ zeroinitializer, %46 ], [ %121, %.preheader73 ]
  %85 = trunc nuw nsw i64 %indvars.iv to i32
  %86 = call noundef ptr @_ZNK7RNArrayIP7R2PointEixEi(ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %85)
  %87 = call noundef ptr @_ZNK7RNArrayIP7R2PointEixEi(ptr noundef nonnull align 8 dereferenceable(16) %2, i32 noundef %85)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %15) #7
  call void @_ZmiRK7R2PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R2Vector) align 8 %15, ptr noundef nonnull align 8 dereferenceable(16) %86, ptr noundef nonnull align 8 dereferenceable(16) %8)
  call void @_ZdvRK8R2Vectord(ptr dead_on_unwind nonnull writable sret(%class.R2Vector) align 8 %14, ptr noundef nonnull align 8 dereferenceable(16) %15, double noundef %.063)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %16) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %17) #7
  call void @_ZmiRK7R2PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R2Vector) align 8 %17, ptr noundef nonnull align 8 dereferenceable(16) %87, ptr noundef nonnull align 8 dereferenceable(16) %9)
  call void @_ZdvRK8R2Vectord(ptr dead_on_unwind nonnull writable sret(%class.R2Vector) align 8 %16, ptr noundef nonnull align 8 dereferenceable(16) %17, double noundef %.062)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %17) #7
  br i1 %.not69, label %.preheader73, label %88

88:                                               ; preds = %82
  %89 = getelementptr inbounds double, ptr %3, i64 %indvars.iv
  %90 = load double, ptr %89, align 8, !tbaa !5
  br label %.preheader73

.preheader73:                                     ; preds = %82, %88
  %91 = phi double [ %90, %88 ], [ 1.000000e+00, %82 ]
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %14, i32 noundef 0)
  %93 = load double, ptr %92, align 8, !tbaa !5
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %16, i32 noundef 0)
  %95 = load double, ptr %94, align 8, !tbaa !5
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %14, i32 noundef 0)
  %97 = load double, ptr %96, align 8, !tbaa !5
  %98 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %16, i32 noundef 1)
  %99 = load double, ptr %98, align 8, !tbaa !5
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %14, i32 noundef 1)
  %101 = load double, ptr %100, align 8, !tbaa !5
  %102 = insertelement <2 x double> poison, double %91, i64 0
  %103 = shufflevector <2 x double> %102, <2 x double> poison, <2 x i32> zeroinitializer
  %104 = insertelement <2 x double> poison, double %93, i64 0
  %105 = insertelement <2 x double> %104, double %101, i64 1
  %106 = fmul <2 x double> %103, %105
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %16, i32 noundef 0)
  %108 = load double, ptr %107, align 8, !tbaa !5
  %109 = insertelement <2 x double> poison, double %95, i64 0
  %110 = insertelement <2 x double> %109, double %108, i64 1
  %111 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %106, <2 x double> %110, <2 x double> %83)
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %14, i32 noundef 1)
  %113 = load double, ptr %112, align 8, !tbaa !5
  %114 = insertelement <2 x double> poison, double %97, i64 0
  %115 = insertelement <2 x double> %114, double %113, i64 1
  %116 = fmul <2 x double> %103, %115
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R2VectorixEi(ptr noundef nonnull align 8 dereferenceable(16) %16, i32 noundef 1)
  %118 = load double, ptr %117, align 8, !tbaa !5
  %119 = insertelement <2 x double> poison, double %99, i64 0
  %120 = insertelement <2 x double> %119, double %118, i64 1
  %121 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %116, <2 x double> %120, <2 x double> %84)
  %122 = fadd double %.06176, %91
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #7
  %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 %47, label %82, !llvm.loop !9

.thread:                                          ; preds = %47
  call void @_ZN8R3MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(72) @R3identity_matrix)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #7
  br label %132

123:                                              ; preds = %.preheader.preheader, %45
  call void @_ZN8R3MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(72) @R3identity_matrix)
  br i1 %.not, label %125, label %124

124:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %27) #7
  call void @_ZNK7R2Point6VectorEv(ptr dead_on_unwind nonnull writable sret(%class.R2Vector) align 8 %27, ptr noundef nonnull align 8 dereferenceable(16) %8)
  call void @_ZN8R3Matrix9TranslateERK8R2Vector(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(16) %27)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %27) #7
  br label %125

125:                                              ; preds = %124, %123
  br i1 %.not67, label %128, label %126

126:                                              ; preds = %125
  %127 = fdiv double %.063, %.062
  call void @_ZN8R3Matrix5ScaleEd(ptr noundef nonnull align 8 dereferenceable(72) %0, double noundef %127)
  br label %128

128:                                              ; preds = %126, %125
  br i1 %.not68, label %130, label %129

129:                                              ; preds = %128
  call void @_ZN8R3Matrix9TransformERKS_(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(72) %12)
  br label %130

130:                                              ; preds = %129, %128
  br i1 %.not, label %132, label %131

131:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %28) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %29) #7
  call void @_ZNK7R2Point6VectorEv(ptr dead_on_unwind nonnull writable sret(%class.R2Vector) align 8 %29, ptr noundef nonnull align 8 dereferenceable(16) %9)
  call void @_ZngRK8R2Vector(ptr dead_on_unwind nonnull writable sret(%class.R2Vector) align 8 %28, ptr noundef nonnull align 8 dereferenceable(16) %29)
  call void @_ZN8R3Matrix9TranslateERK8R2Vector(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(16) %28)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %29) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %28) #7
  br label %132

132:                                              ; preds = %.thread, %130, %131
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #7
  ret void
}

declare void @_ZN8R3MatrixC1ERKS_(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(72)) unnamed_addr #1

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

declare void @_ZN8R3MatrixC1Eddddddddd(ptr noundef nonnull align 8 dereferenceable(72), double noundef, double noundef, double noundef, double noundef, double noundef, double noundef, double noundef, double noundef, double noundef) unnamed_addr #1

declare void @_ZmlRK8R3MatrixS1_(ptr dead_on_unwind writable sret(%class.R3Matrix) align 8, ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #1

declare noundef double @_Z12R3MatrixDet2dddd(double noundef, double noundef, double noundef, double noundef) local_unnamed_addr #1

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

declare noundef nonnull align 8 dereferenceable(72) ptr @_ZN8R3MatrixaSERKS_(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #1

declare void @_ZN8R3Matrix9TranslateERK8R2Vector(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1

declare void @_ZN8R3Matrix5ScaleEd(ptr noundef nonnull align 8 dereferenceable(72), double noundef) local_unnamed_addr #1

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

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

attributes #0 = { 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 #1 = { "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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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,GlobalDCEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass