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

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

@R3null_plane = external dso_local global %class.R3Plane, align 8
@R3null_vector = external global %class.R3Vector, align 8

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN7R3PlaneaSERKS_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7R3PlaneC2EP7R3Pointii(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) unnamed_addr #5 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %class.R3Point, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca %class.R3Triad, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !9
  %14 = load ptr, ptr %5, align 8
  %15 = getelementptr inbounds %class.R3Plane, ptr %14, i32 0, i32 0
  call void @_ZN8R3VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %15)
  %16 = getelementptr inbounds %class.R3Plane, ptr %14, i32 0, i32 0
  %17 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 8 dereferenceable(24) @R3null_vector)
  %18 = getelementptr inbounds %class.R3Plane, ptr %14, i32 0, i32 1
  store double 0.000000e+00, ptr %18, align 8, !tbaa !11
  %19 = load i32, ptr %7, align 4, !tbaa !9
  %20 = icmp slt i32 %19, 3
  br i1 %20, label %21, label %23

21:                                               ; preds = %4
  %22 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN7R3PlaneaSERKS_(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef nonnull align 8 dereferenceable(32) @R3null_plane)
  br label %119

23:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #6
  %24 = load i32, ptr %7, align 4, !tbaa !9
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_Z10R3CentroidiP7R3PointPKd(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %9, i32 noundef %24, ptr noundef %25, ptr noundef null)
  %26 = load i32, ptr %8, align 4, !tbaa !9
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %28, label %92

28:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = load i32, ptr %7, align 4, !tbaa !9
  %31 = sub nsw i32 %30, 1
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds %class.R3Point, ptr %29, i64 %32
  store ptr %33, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %34

34:                                               ; preds = %87, %28
  %35 = load i32, ptr %11, align 4, !tbaa !9
  %36 = load i32, ptr %7, align 4, !tbaa !9
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %90

39:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = load i32, ptr %11, align 4, !tbaa !9
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds %class.R3Point, ptr %40, i64 %42
  store ptr %43, ptr %12, align 8, !tbaa !5
  %44 = load ptr, ptr %10, align 8, !tbaa !5
  %45 = call noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24) %44)
  %46 = load ptr, ptr %12, align 8, !tbaa !5
  %47 = call noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24) %46)
  %48 = fsub double %45, %47
  %49 = load ptr, ptr %10, align 8, !tbaa !5
  %50 = call noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %49)
  %51 = load ptr, ptr %12, align 8, !tbaa !5
  %52 = call noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %51)
  %53 = fadd double %50, %52
  %54 = getelementptr inbounds %class.R3Plane, ptr %14, i32 0, i32 0
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %54, i32 noundef 0)
  %56 = load double, ptr %55, align 8, !tbaa !15
  %57 = call double @llvm.fmuladd.f64(double %48, double %53, double %56)
  store double %57, ptr %55, align 8, !tbaa !15
  %58 = load ptr, ptr %10, align 8, !tbaa !5
  %59 = call noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %58)
  %60 = load ptr, ptr %12, align 8, !tbaa !5
  %61 = call noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %60)
  %62 = fsub double %59, %61
  %63 = load ptr, ptr %10, align 8, !tbaa !5
  %64 = call noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24) %63)
  %65 = load ptr, ptr %12, align 8, !tbaa !5
  %66 = call noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24) %65)
  %67 = fadd double %64, %66
  %68 = getelementptr inbounds %class.R3Plane, ptr %14, i32 0, i32 0
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %68, i32 noundef 1)
  %70 = load double, ptr %69, align 8, !tbaa !15
  %71 = call double @llvm.fmuladd.f64(double %62, double %67, double %70)
  store double %71, ptr %69, align 8, !tbaa !15
  %72 = load ptr, ptr %10, align 8, !tbaa !5
  %73 = call noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24) %72)
  %74 = load ptr, ptr %12, align 8, !tbaa !5
  %75 = call noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24) %74)
  %76 = fsub double %73, %75
  %77 = load ptr, ptr %10, align 8, !tbaa !5
  %78 = call noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24) %77)
  %79 = load ptr, ptr %12, align 8, !tbaa !5
  %80 = call noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24) %79)
  %81 = fadd double %78, %80
  %82 = getelementptr inbounds %class.R3Plane, ptr %14, i32 0, i32 0
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %82, i32 noundef 2)
  %84 = load double, ptr %83, align 8, !tbaa !15
  %85 = call double @llvm.fmuladd.f64(double %76, double %81, double %84)
  store double %85, ptr %83, align 8, !tbaa !15
  %86 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %86, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %87

87:                                               ; preds = %39
  %88 = load i32, ptr %11, align 4, !tbaa !9
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %11, align 4, !tbaa !9
  br label %34, !llvm.loop !16

90:                                               ; preds = %38
  %91 = getelementptr inbounds %class.R3Plane, ptr %14, i32 0, i32 0
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %91)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %98

92:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 72, ptr %13) #6
  %93 = load i32, ptr %7, align 4, !tbaa !9
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_Z15R3PrincipleAxesRK7R3PointiPS_PKdPd(ptr dead_on_unwind writable sret(%class.R3Triad) align 8 %13, ptr noundef nonnull align 8 dereferenceable(24) %9, i32 noundef %93, ptr noundef %94, ptr noundef null, ptr noundef null)
  %95 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3TriadixEi(ptr noundef nonnull align 8 dereferenceable(72) %13, i32 noundef 2)
  %96 = getelementptr inbounds %class.R3Plane, ptr %14, i32 0, i32 0
  %97 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %96, ptr noundef nonnull align 8 dereferenceable(24) %95)
  call void @llvm.lifetime.end.p0(i64 72, ptr %13) #6
  br label %98

98:                                               ; preds = %92, %90
  %99 = getelementptr inbounds %class.R3Plane, ptr %14, i32 0, i32 0
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %99, i32 noundef 0)
  %101 = load double, ptr %100, align 8, !tbaa !15
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %9, i32 noundef 0)
  %103 = load double, ptr %102, align 8, !tbaa !15
  %104 = getelementptr inbounds %class.R3Plane, ptr %14, i32 0, i32 0
  %105 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %104, i32 noundef 1)
  %106 = load double, ptr %105, align 8, !tbaa !15
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %9, i32 noundef 1)
  %108 = load double, ptr %107, align 8, !tbaa !15
  %109 = fmul double %106, %108
  %110 = call double @llvm.fmuladd.f64(double %101, double %103, double %109)
  %111 = getelementptr inbounds %class.R3Plane, ptr %14, i32 0, i32 0
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %111, i32 noundef 2)
  %113 = load double, ptr %112, align 8, !tbaa !15
  %114 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %9, i32 noundef 2)
  %115 = load double, ptr %114, align 8, !tbaa !15
  %116 = call double @llvm.fmuladd.f64(double %113, double %115, double %110)
  %117 = fneg double %116
  %118 = getelementptr inbounds %class.R3Plane, ptr %14, i32 0, i32 1
  store double %117, ptr %118, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #6
  br label %119

119:                                              ; preds = %98, %21
  ret void
}

declare void @_Z10R3CentroidiP7R3PointPKd(ptr dead_on_unwind writable sret(%class.R3Point) align 8, i32 noundef, ptr noundef, ptr noundef) #0

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

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { 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, !14, i64 24}
!12 = !{!"_ZTS7R3Plane", !13, i64 0, !14, i64 24}
!13 = !{!"_ZTS8R3Vector", !7, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!14, !14, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


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

@R3null_plane = external dso_local global %class.R3Plane, align 8
@R3null_vector = external global %class.R3Vector, align 8

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN7R3PlaneaSERKS_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7R3PlaneC2EP7R3Pointii(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) unnamed_addr #5 align 2 {
  %5 = alloca %class.R3Point, align 8
  %6 = alloca %class.R3Triad, align 8
  tail call void @_ZN8R3VectorC1Ev(ptr noundef nonnull align 8 dereferenceable(24) %0)
  %7 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) @R3null_vector)
  %8 = getelementptr inbounds i8, ptr %0, i64 24
  store double 0.000000e+00, ptr %8, align 8, !tbaa !5
  %9 = icmp slt i32 %2, 3
  br i1 %9, label %10, label %12

10:                                               ; preds = %4
  %11 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZN7R3PlaneaSERKS_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) @R3null_plane)
  br label %64

12:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  call void @_Z10R3CentroidiP7R3PointPKd(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %5, i32 noundef %2, ptr noundef %1, ptr noundef null)
  %.not = icmp eq i32 %3, 0
  br i1 %.not, label %44, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %12
  %13 = zext nneg i32 %2 to i64
  %14 = getelementptr %class.R3Point, ptr %1, i64 %13
  %15 = getelementptr i8, ptr %14, i64 -24
  br label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph
  call void @_ZN8R3Vector9NormalizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0)
  br label %47

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %.029 = phi ptr [ %15, %.lr.ph.preheader ], [ %16, %.lr.ph ]
  %16 = getelementptr inbounds %class.R3Point, ptr %1, i64 %indvars.iv
  %17 = call noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24) %.029)
  %18 = call noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
  %19 = fsub double %17, %18
  %20 = call noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %.029)
  %21 = call noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
  %22 = fadd double %20, %21
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef 0)
  %24 = load double, ptr %23, align 8, !tbaa !11
  %25 = call double @llvm.fmuladd.f64(double %19, double %22, double %24)
  store double %25, ptr %23, align 8, !tbaa !11
  %26 = call noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %.029)
  %27 = call noundef double @_ZNK7R3Point1ZEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
  %28 = fsub double %26, %27
  %29 = call noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24) %.029)
  %30 = call noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
  %31 = fadd double %29, %30
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef 1)
  %33 = load double, ptr %32, align 8, !tbaa !11
  %34 = call double @llvm.fmuladd.f64(double %28, double %31, double %33)
  store double %34, ptr %32, align 8, !tbaa !11
  %35 = call noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24) %.029)
  %36 = call noundef double @_ZNK7R3Point1XEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
  %37 = fsub double %35, %36
  %38 = call noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24) %.029)
  %39 = call noundef double @_ZNK7R3Point1YEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
  %40 = fadd double %38, %39
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef 2)
  %42 = load double, ptr %41, align 8, !tbaa !11
  %43 = call double @llvm.fmuladd.f64(double %37, double %40, double %42)
  store double %43, ptr %41, align 8, !tbaa !11
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %13
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !12

44:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %6) #6
  call void @_Z15R3PrincipleAxesRK7R3PointiPS_PKdPd(ptr dead_on_unwind nonnull writable sret(%class.R3Triad) align 8 %6, ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef %2, ptr noundef %1, ptr noundef null, ptr noundef null)
  %45 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3TriadixEi(ptr noundef nonnull align 8 dereferenceable(72) %6, i32 noundef 2)
  %46 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN8R3VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %45)
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %6) #6
  br label %47

47:                                               ; preds = %44, %._crit_edge
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef 0)
  %49 = load double, ptr %48, align 8, !tbaa !11
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef 0)
  %51 = load double, ptr %50, align 8, !tbaa !11
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef 1)
  %53 = load double, ptr %52, align 8, !tbaa !11
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef 1)
  %55 = load double, ptr %54, align 8, !tbaa !11
  %56 = fmul double %53, %55
  %57 = call double @llvm.fmuladd.f64(double %49, double %51, double %56)
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8R3VectorixEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef 2)
  %59 = load double, ptr %58, align 8, !tbaa !11
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN7R3PointixEi(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef 2)
  %61 = load double, ptr %60, align 8, !tbaa !11
  %62 = call double @llvm.fmuladd.f64(double %59, double %61, double %57)
  %63 = fneg double %62
  store double %63, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  br label %64

64:                                               ; preds = %47, %10
  ret void
}

declare void @_Z10R3CentroidiP7R3PointPKd(ptr dead_on_unwind writable sret(%class.R3Point) align 8, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

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

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { 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, !10, i64 24}
!6 = !{!"_ZTS7R3Plane", !7, i64 0, !10, i64 24}
!7 = !{!"_ZTS8R3Vector", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!10, !10, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass