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

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

@RN_EPSILON = external global double, align 8

declare noundef i32 @_Z10R3ContainsRK6R3LineRK7R3Point(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(24)) #0

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

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

declare noundef double @_ZNK8R3Vector3DotERKS_(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) #3

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK7R3Point6VectorEv(ptr dead_on_unwind noalias writable sret(%class.R3Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24)) #4 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)) #0

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z12R3IntersectsRK6R3LineRK5R3RayP7R3PointPd(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef %2, ptr noundef %3) #5 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca i32, align 4
  %17 = alloca %class.R3Vector, align 8
  %18 = alloca %class.R3Vector, align 8
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca double, align 8
  %23 = alloca double, align 8
  %24 = alloca %class.R3Point, align 8
  %25 = alloca %class.R3Vector, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK5R3Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(48) %26)
  store ptr %27, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Line6VectorEv(ptr noundef nonnull align 8 dereferenceable(48) %28)
  store ptr %29, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store double 1.000000e+00, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  store double 1.000000e+00, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %30 = load ptr, ptr %10, align 8, !tbaa !5
  %31 = load ptr, ptr %11, align 8, !tbaa !5
  %32 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %30, ptr noundef nonnull align 8 dereferenceable(24) %31)
  store double %32, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %33 = load double, ptr %14, align 8, !tbaa !9
  %34 = load double, ptr %14, align 8, !tbaa !9
  %35 = call double @llvm.fmuladd.f64(double %33, double %34, double -1.000000e+00)
  store double %35, ptr %15, align 8, !tbaa !9
  %36 = load double, ptr %15, align 8, !tbaa !9
  %37 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %38 = call noundef i32 @_Z8RNIsZerodd(double noundef %36, double noundef %37)
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %40, label %48

40:                                               ; preds = %4
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK5R3Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(48) %42)
  %44 = call noundef i32 @_Z10R3ContainsRK6R3LineRK7R3Point(ptr noundef nonnull align 8 dereferenceable(48) %41, ptr noundef nonnull align 8 dereferenceable(24) %43)
  %45 = icmp ne i32 %44, 0
  br i1 %45, label %46, label %47

46:                                               ; preds = %40
  store i32 3, ptr %5, align 4
  store i32 1, ptr %16, align 4
  br label %97

47:                                               ; preds = %40
  store i32 0, ptr %5, align 4
  store i32 1, ptr %16, align 4
  br label %97

48:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #6
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK5R3Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(48) %49)
  call void @_ZNK7R3Point6VectorEv(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %17, ptr noundef nonnull align 8 dereferenceable(24) %50)
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #6
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Line5PointEv(ptr noundef nonnull align 8 dereferenceable(48) %51)
  call void @_ZNK7R3Point6VectorEv(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %18, ptr noundef nonnull align 8 dereferenceable(24) %52)
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %53 = load ptr, ptr %10, align 8, !tbaa !5
  %54 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %53, ptr noundef nonnull align 8 dereferenceable(24) %17)
  store double %54, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %55 = load ptr, ptr %11, align 8, !tbaa !5
  %56 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %55, ptr noundef nonnull align 8 dereferenceable(24) %18)
  store double %56, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %57 = load ptr, ptr %11, align 8, !tbaa !5
  %58 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %57, ptr noundef nonnull align 8 dereferenceable(24) %17)
  store double %58, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %59 = load ptr, ptr %10, align 8, !tbaa !5
  %60 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %59, ptr noundef nonnull align 8 dereferenceable(24) %18)
  store double %60, ptr %22, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %61 = load double, ptr %14, align 8, !tbaa !9
  %62 = load double, ptr %20, align 8, !tbaa !9
  %63 = load double, ptr %19, align 8, !tbaa !9
  %64 = fmul double 1.000000e+00, %63
  %65 = call double @llvm.fmuladd.f64(double %61, double %62, double %64)
  %66 = load double, ptr %14, align 8, !tbaa !9
  %67 = load double, ptr %21, align 8, !tbaa !9
  %68 = fneg double %66
  %69 = call double @llvm.fmuladd.f64(double %68, double %67, double %65)
  %70 = load double, ptr %22, align 8, !tbaa !9
  %71 = call double @llvm.fmuladd.f64(double -1.000000e+00, double %70, double %69)
  %72 = load double, ptr %15, align 8, !tbaa !9
  %73 = fdiv double %71, %72
  store double %73, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %24) #6
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK5R3Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(48) %74)
  call void @llvm.lifetime.start.p0(i64 24, ptr %25) #6
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  %77 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK5R3Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(48) %76)
  %78 = load double, ptr %23, align 8, !tbaa !9
  call void @_ZmlRK8R3Vectord(ptr dead_on_unwind writable sret(%class.R3Vector) align 8 %25, ptr noundef nonnull align 8 dereferenceable(24) %77, double noundef %78)
  call void @_ZplRK7R3PointRK8R3Vector(ptr dead_on_unwind writable sret(%class.R3Point) align 8 %24, ptr noundef nonnull align 8 dereferenceable(24) %75, ptr noundef nonnull align 8 dereferenceable(24) %25)
  call void @llvm.lifetime.end.p0(i64 24, ptr %25) #6
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = call noundef i32 @_Z10R3ContainsRK6R3LineRK7R3Point(ptr noundef nonnull align 8 dereferenceable(48) %79, ptr noundef nonnull align 8 dereferenceable(24) %24)
  %81 = icmp ne i32 %80, 0
  br i1 %81, label %82, label %95

82:                                               ; preds = %48
  %83 = load ptr, ptr %8, align 8, !tbaa !5
  %84 = icmp ne ptr %83, null
  br i1 %84, label %85, label %88

85:                                               ; preds = %82
  %86 = load ptr, ptr %8, align 8, !tbaa !5
  %87 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %86, ptr noundef nonnull align 8 dereferenceable(24) %24)
  br label %88

88:                                               ; preds = %85, %82
  %89 = load ptr, ptr %9, align 8, !tbaa !5
  %90 = icmp ne ptr %89, null
  br i1 %90, label %91, label %94

91:                                               ; preds = %88
  %92 = load double, ptr %23, align 8, !tbaa !9
  %93 = load ptr, ptr %9, align 8, !tbaa !5
  store double %92, ptr %93, align 8, !tbaa !9
  br label %94

94:                                               ; preds = %91, %88
  store i32 1, ptr %5, align 4
  store i32 1, ptr %16, align 4
  br label %96

95:                                               ; preds = %48
  store i32 0, ptr %5, align 4
  store i32 1, ptr %16, align 4
  br label %96

96:                                               ; preds = %95, %94
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #6
  br label %97

97:                                               ; preds = %96, %47, %46
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  %98 = load i32, ptr %5, align 4
  ret i32 %98
}

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

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

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


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

@RN_EPSILON = external local_unnamed_addr global double, align 8

declare noundef i32 @_Z10R3ContainsRK6R3LineRK7R3Point(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0

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

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

declare noundef double @_ZNK8R3Vector3DotERKS_(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) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z8RNIsZerodd(double noundef, double noundef) local_unnamed_addr #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK7R3Point6VectorEv(ptr dead_on_unwind noalias writable sret(%class.R3Vector) align 8, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 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 #0

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 4) i32 @_Z12R3IntersectsRK6R3LineRK5R3RayP7R3PointPd(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef %2, ptr noundef writeonly %3) local_unnamed_addr #5 {
  %5 = alloca %class.R3Vector, align 8
  %6 = alloca %class.R3Vector, align 8
  %7 = alloca %class.R3Point, align 8
  %8 = alloca %class.R3Vector, align 8
  %9 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK5R3Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  %10 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Line6VectorEv(ptr noundef nonnull align 8 dereferenceable(48) %0)
  %11 = tail call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(24) %10)
  %12 = tail call double @llvm.fmuladd.f64(double %11, double %11, double -1.000000e+00)
  %13 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %14 = tail call noundef i32 @_Z8RNIsZerodd(double noundef %12, double noundef %13)
  %.not = icmp eq i32 %14, 0
  br i1 %.not, label %18, label %15

15:                                               ; preds = %4
  %16 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK5R3Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  %17 = tail call noundef i32 @_Z10R3ContainsRK6R3LineRK7R3Point(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(24) %16)
  %.not36 = icmp eq i32 %17, 0
  %. = select i1 %.not36, i32 0, i32 3
  br label %39

18:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  %19 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK5R3Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  call void @_ZNK7R3Point6VectorEv(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %5, ptr noundef nonnull align 8 dereferenceable(24) %19)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #6
  %20 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK6R3Line5PointEv(ptr noundef nonnull align 8 dereferenceable(48) %0)
  call void @_ZNK7R3Point6VectorEv(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %6, ptr noundef nonnull align 8 dereferenceable(24) %20)
  %21 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(24) %5)
  %22 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %6)
  %23 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(24) %5)
  %24 = call noundef double @_ZNK8R3Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(24) %6)
  %25 = call double @llvm.fmuladd.f64(double %11, double %22, double %21)
  %26 = fneg double %11
  %27 = call double @llvm.fmuladd.f64(double %26, double %23, double %25)
  %28 = call double @llvm.fmuladd.f64(double %24, double -1.000000e+00, double %27)
  %29 = fdiv double %28, %12
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #6
  %30 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK5R3Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #6
  %31 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK5R3Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  call void @_ZmlRK8R3Vectord(ptr dead_on_unwind nonnull writable sret(%class.R3Vector) align 8 %8, ptr noundef nonnull align 8 dereferenceable(24) %31, double noundef %29)
  call void @_ZplRK7R3PointRK8R3Vector(ptr dead_on_unwind nonnull writable sret(%class.R3Point) align 8 %7, ptr noundef nonnull align 8 dereferenceable(24) %30, ptr noundef nonnull align 8 dereferenceable(24) %8)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #6
  %32 = call noundef i32 @_Z10R3ContainsRK6R3LineRK7R3Point(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(24) %7)
  %.not33 = icmp eq i32 %32, 0
  br i1 %.not33, label %38, label %33

33:                                               ; preds = %18
  %.not34 = icmp eq ptr %2, null
  br i1 %.not34, label %36, label %34

34:                                               ; preds = %33
  %35 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN7R3PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %7)
  br label %36

36:                                               ; preds = %34, %33
  %.not35 = icmp eq ptr %3, null
  br i1 %.not35, label %38, label %37

37:                                               ; preds = %36
  store double %29, ptr %3, align 8, !tbaa !5
  br label %38

38:                                               ; preds = %18, %36, %37
  %.0 = phi i32 [ 1, %37 ], [ 1, %36 ], [ 0, %18 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  br label %39

39:                                               ; preds = %15, %38
  %.1 = phi i32 [ %.0, %38 ], [ %., %15 ]
  ret i32 %.1
}

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

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

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress 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 #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 #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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass