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

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

@R3null_point = external global %class.R3Point, 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK11R3Rectangle12ClosestPointERK7R3Point(ptr dead_on_unwind noalias writable sret(%class.R3Point) align 8 %0, ptr noundef nonnull align 8 dereferenceable(120) %1, ptr noundef nonnull align 8 dereferenceable(24) %2) unnamed_addr #1 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %class.R3Plane, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %class.R3Plane, align 8
  %12 = alloca %class.R3Point, align 8
  %13 = alloca %class.R3Vector, align 8
  %14 = alloca %class.R3Vector, align 8
  %15 = alloca double, align 8
  %16 = alloca %class.R3Vector, align 8
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %17 = load ptr, ptr %5, align 8
  %18 = call noundef i32 @_ZNK11R3Rectangle7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(120) %17)
  %19 = icmp ne i32 %18, 0
  br i1 %19, label %20, label %21

20:                                               ; preds = %3
  call void @_ZN7R3PointC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) @R3null_point)
  br label %61

21:                                               ; preds = %3
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN7R3PointC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %22)
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #5
  call void @_ZNK11R3Rectangle5PlaneEv(ptr dead_on_unwind writable sret(%class.R3Plane) align 8 %7, ptr noundef nonnull align 8 dereferenceable(120) %17)
  call void @_ZN7R3Point7ProjectERK7R3Plane(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(32) %7)
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 -1, ptr %8, align 4, !tbaa !9
  br label %23

23:                                               ; preds = %57, %21
  %24 = load i32, ptr %8, align 4, !tbaa !9
  %25 = icmp sle i32 %24, 1
  br i1 %25, label %27, label %26

26:                                               ; preds = %23
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %60

27:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %28

28:                                               ; preds = %53, %27
  %29 = load i32, ptr %10, align 4, !tbaa !9
  %30 = icmp sle i32 %29, 1
  br i1 %30, label %32, label %31

31:                                               ; preds = %28
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %56

32:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #5
  %33 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK11R3Rectangle6CenterEv(ptr noundef nonnull align 8 dereferenceable(120) %17)
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #5
  %34 = load i32, ptr %8, align 4, !tbaa !9
  %35 = sitofp i32 %34 to double
  %36 = load i32, ptr %10, align 4, !tbaa !9
  %37 = call noundef double @_ZNK11R3Rectangle6RadiusEi(ptr noundef nonnull align 8 dereferenceable(120) %17, i32 noundef %36)
  %38 = fmul double %35, %37
  %39 = load i32, ptr %10, align 4, !tbaa !9
  %40 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK11R3Rectangle4AxisEi(ptr noundef nonnull align 8 dereferenceable(120) %17, i32 noundef %39)
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %13, double noundef %38, ptr noundef nonnull align 8 dereferenceable(24) %40)
  call void @_ZplRK7R3PointRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %12, ptr noundef nonnull align 8 dereferenceable(24) %33, ptr noundef nonnull align 8 dereferenceable(24) %13)
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #5
  %41 = load i32, ptr %8, align 4, !tbaa !9
  %42 = sitofp i32 %41 to double
  %43 = load i32, ptr %10, align 4, !tbaa !9
  %44 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK11R3Rectangle4AxisEi(ptr noundef nonnull align 8 dereferenceable(120) %17, i32 noundef %43)
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %14, double noundef %42, ptr noundef nonnull align 8 dereferenceable(24) %44)
  call void @_ZN7R3PlaneC1ERK7R3PointRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(24) %14)
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %45 = call noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 8 dereferenceable(24) %0)
  store double %45, ptr %15, align 8, !tbaa !11
  %46 = load double, ptr %15, align 8, !tbaa !11
  %47 = fcmp ogt double %46, 0.000000e+00
  br i1 %47, label %48, label %52

48:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #5
  %49 = load double, ptr %15, align 8, !tbaa !11
  %50 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3Plane6NormalEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %16, double noundef %49, ptr noundef nonnull align 8 dereferenceable(24) %50)
  %51 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointmIERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %16)
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #5
  br label %52

52:                                               ; preds = %48, %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #5
  br label %53

53:                                               ; preds = %52
  %54 = load i32, ptr %10, align 4, !tbaa !9
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %10, align 4, !tbaa !9
  br label %28, !llvm.loop !13

56:                                               ; preds = %31
  br label %57

57:                                               ; preds = %56
  %58 = load i32, ptr %8, align 4, !tbaa !9
  %59 = add nsw i32 %58, 2
  store i32 %59, ptr %8, align 4, !tbaa !9
  br label %23, !llvm.loop !15

60:                                               ; preds = %26
  br label %61

61:                                               ; preds = %60, %20
  ret void
}

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

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

declare void @_ZN7R3Point7ProjectERK7R3Plane(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(32)) #3

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

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

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

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

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

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

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

declare noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24)) #3

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

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

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


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

@R3null_point = external global %class.R3Point, 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK11R3Rectangle12ClosestPointERK7R3Point(ptr dead_on_unwind noalias writable sret(%class.R3Point) align 8 %0, ptr noundef nonnull align 8 dereferenceable(120) %1, ptr noundef nonnull align 8 dereferenceable(24) %2) unnamed_addr #1 align 2 {
  %4 = alloca %class.R3Plane, align 8
  %5 = alloca %class.R3Plane, align 8
  %6 = alloca %class.R3Point, align 8
  %7 = alloca %class.R3Vector, align 8
  %8 = alloca %class.R3Vector, align 8
  %9 = alloca %class.R3Vector, align 8
  %10 = tail call noundef i32 @_ZNK11R3Rectangle7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(120) %1)
  %.not = icmp eq i32 %10, 0
  br i1 %.not, label %.preheader, label %11

11:                                               ; preds = %3
  tail call void @_ZN7R3PointC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) @R3null_point)
  br label %.loopexit

.preheader:                                       ; preds = %3
  tail call void @_ZN7R3PointC1ERKS_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %2)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #5
  call void @_ZNK11R3Rectangle5PlaneEv(ptr dead_on_unwind nonnull writable sret(%class.R3Plane) align 8 %4, ptr noundef nonnull align 8 dereferenceable(120) %1)
  call void @_ZN7R3Point7ProjectERK7R3Plane(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(32) %4)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  %12 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK11R3Rectangle6CenterEv(ptr noundef nonnull align 8 dereferenceable(120) %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #5
  %13 = call noundef double @_ZNK11R3Rectangle6RadiusEi(ptr noundef nonnull align 8 dereferenceable(120) %1, i32 noundef 0)
  %14 = fneg double %13
  %15 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK11R3Rectangle4AxisEi(ptr noundef nonnull align 8 dereferenceable(120) %1, i32 noundef 0)
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %7, double noundef %14, ptr noundef nonnull align 8 dereferenceable(24) %15)
  call void @_ZplRK7R3PointRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %6, ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(24) %7)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #5
  %16 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK11R3Rectangle4AxisEi(ptr noundef nonnull align 8 dereferenceable(120) %1, i32 noundef 0)
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %8, double noundef -1.000000e+00, ptr noundef nonnull align 8 dereferenceable(24) %16)
  call void @_ZN7R3PlaneC1ERK7R3PointRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) %8)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  %17 = call noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(24) %0)
  %18 = fcmp ogt double %17, 0.000000e+00
  br i1 %18, label %19, label %22

19:                                               ; preds = %.preheader
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #5
  %20 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3Plane6NormalEv(ptr noundef nonnull align 8 dereferenceable(32) %5)
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %9, double noundef %17, ptr noundef nonnull align 8 dereferenceable(24) %20)
  %21 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointmIERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %9)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #5
  br label %22

22:                                               ; preds = %19, %.preheader
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  %23 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK11R3Rectangle6CenterEv(ptr noundef nonnull align 8 dereferenceable(120) %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #5
  %24 = call noundef double @_ZNK11R3Rectangle6RadiusEi(ptr noundef nonnull align 8 dereferenceable(120) %1, i32 noundef 1)
  %25 = fneg double %24
  %26 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK11R3Rectangle4AxisEi(ptr noundef nonnull align 8 dereferenceable(120) %1, i32 noundef 1)
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %7, double noundef %25, ptr noundef nonnull align 8 dereferenceable(24) %26)
  call void @_ZplRK7R3PointRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %6, ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 8 dereferenceable(24) %7)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #5
  %27 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK11R3Rectangle4AxisEi(ptr noundef nonnull align 8 dereferenceable(120) %1, i32 noundef 1)
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %8, double noundef -1.000000e+00, ptr noundef nonnull align 8 dereferenceable(24) %27)
  call void @_ZN7R3PlaneC1ERK7R3PointRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) %8)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  %28 = call noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(24) %0)
  %29 = fcmp ogt double %28, 0.000000e+00
  br i1 %29, label %30, label %.preheader.1

30:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #5
  %31 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3Plane6NormalEv(ptr noundef nonnull align 8 dereferenceable(32) %5)
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %9, double noundef %28, ptr noundef nonnull align 8 dereferenceable(24) %31)
  %32 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointmIERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %9)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #5
  br label %.preheader.1

.preheader.1:                                     ; preds = %30, %22
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  %33 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK11R3Rectangle6CenterEv(ptr noundef nonnull align 8 dereferenceable(120) %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #5
  %34 = call noundef double @_ZNK11R3Rectangle6RadiusEi(ptr noundef nonnull align 8 dereferenceable(120) %1, i32 noundef 0)
  %35 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK11R3Rectangle4AxisEi(ptr noundef nonnull align 8 dereferenceable(120) %1, i32 noundef 0)
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %7, double noundef %34, ptr noundef nonnull align 8 dereferenceable(24) %35)
  call void @_ZplRK7R3PointRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %6, ptr noundef nonnull align 8 dereferenceable(24) %33, ptr noundef nonnull align 8 dereferenceable(24) %7)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #5
  %36 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK11R3Rectangle4AxisEi(ptr noundef nonnull align 8 dereferenceable(120) %1, i32 noundef 0)
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %8, double noundef 1.000000e+00, ptr noundef nonnull align 8 dereferenceable(24) %36)
  call void @_ZN7R3PlaneC1ERK7R3PointRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) %8)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  %37 = call noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(24) %0)
  %38 = fcmp ogt double %37, 0.000000e+00
  br i1 %38, label %39, label %42

39:                                               ; preds = %.preheader.1
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #5
  %40 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3Plane6NormalEv(ptr noundef nonnull align 8 dereferenceable(32) %5)
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %9, double noundef %37, ptr noundef nonnull align 8 dereferenceable(24) %40)
  %41 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointmIERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %9)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #5
  br label %42

42:                                               ; preds = %39, %.preheader.1
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  %43 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK11R3Rectangle6CenterEv(ptr noundef nonnull align 8 dereferenceable(120) %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #5
  %44 = call noundef double @_ZNK11R3Rectangle6RadiusEi(ptr noundef nonnull align 8 dereferenceable(120) %1, i32 noundef 1)
  %45 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK11R3Rectangle4AxisEi(ptr noundef nonnull align 8 dereferenceable(120) %1, i32 noundef 1)
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %7, double noundef %44, ptr noundef nonnull align 8 dereferenceable(24) %45)
  call void @_ZplRK7R3PointRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %6, ptr noundef nonnull align 8 dereferenceable(24) %43, ptr noundef nonnull align 8 dereferenceable(24) %7)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #5
  %46 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK11R3Rectangle4AxisEi(ptr noundef nonnull align 8 dereferenceable(120) %1, i32 noundef 1)
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %8, double noundef 1.000000e+00, ptr noundef nonnull align 8 dereferenceable(24) %46)
  call void @_ZN7R3PlaneC1ERK7R3PointRK8R3Vector(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) %8)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  %47 = call noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(24) %0)
  %48 = fcmp ogt double %47, 0.000000e+00
  br i1 %48, label %49, label %.loopexit.loopexit

49:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #5
  %50 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK7R3Plane6NormalEv(ptr noundef nonnull align 8 dereferenceable(32) %5)
  call void @_ZmldRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %9, double noundef %47, ptr noundef nonnull align 8 dereferenceable(24) %50)
  %51 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointmIERK8R3Vector(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %9)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #5
  br label %.loopexit.loopexit

.loopexit.loopexit:                               ; preds = %49, %42
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %11
  ret void
}

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

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

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

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

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

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

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

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

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

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

declare noundef double @_Z16R3SignedDistanceRK7R3PlaneRK7R3Point(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

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

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

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,LoopSimplifyPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass