; LLVM IR from niessner/Matterport :: code/gaps/pkgs/R2Shapes (R2Isect)

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

@RN_EPSILON = external global double, align 8

declare noundef i32 @_Z10R2ContainsRK8R2CircleRK7R2Point(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(16)) #0

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(56)) #4 align 2

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

declare noundef double @_ZNK8R2Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #0

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

declare void @_ZN7R2PointC1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #0

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZN8R2VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #0

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z12R2IntersectsRK5R2RayRK8R2CircleP7R2PointP8R2VectorPd(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #5 {
  %6 = alloca i32, align 4
  %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 %class.R2Vector, align 8
  %13 = alloca double, align 8
  %14 = alloca i32, align 4
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca %class.R2Point, align 8
  %19 = alloca %class.R2Vector, align 8
  %20 = alloca %class.R2Point, align 8
  %21 = alloca ptr, align 8
  %22 = alloca %class.R2Point, align 8
  %23 = alloca %class.R2Vector, align 8
  %24 = alloca %class.R2Vector, align 8
  %25 = alloca %class.R2Vector, align 8
  %26 = alloca %class.R2Point, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  %27 = load ptr, ptr %8, align 8, !tbaa !5
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(56) %28)
  %30 = call noundef i32 @_Z10R2ContainsRK8R2CircleRK7R2Point(ptr noundef nonnull align 8 dereferenceable(32) %27, ptr noundef nonnull align 8 dereferenceable(16) %29)
  %31 = icmp ne i32 %30, 0
  br i1 %31, label %32, label %54

32:                                               ; preds = %5
  %33 = load ptr, ptr %9, align 8, !tbaa !5
  %34 = icmp ne ptr %33, null
  br i1 %34, label %35, label %40

35:                                               ; preds = %32
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(56) %36)
  %38 = load ptr, ptr %9, align 8, !tbaa !5
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN7R2PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %38, ptr noundef nonnull align 8 dereferenceable(16) %37)
  br label %40

40:                                               ; preds = %35, %32
  %41 = load ptr, ptr %10, align 8, !tbaa !5
  %42 = icmp ne ptr %41, null
  br i1 %42, label %43, label %48

43:                                               ; preds = %40
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(56) %44)
  %46 = load ptr, ptr %10, align 8, !tbaa !5
  %47 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN8R2VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %46, ptr noundef nonnull align 8 dereferenceable(16) %45)
  br label %48

48:                                               ; preds = %43, %40
  %49 = load ptr, ptr %11, align 8, !tbaa !5
  %50 = icmp ne ptr %49, null
  br i1 %50, label %51, label %53

51:                                               ; preds = %48
  %52 = load ptr, ptr %11, align 8, !tbaa !5
  store double 0.000000e+00, ptr %52, align 8, !tbaa !9
  br label %53

53:                                               ; preds = %51, %48
  store i32 4, ptr %6, align 4
  br label %150

54:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #7
  %55 = load ptr, ptr %8, align 8, !tbaa !5
  %56 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK8R2Circle6CenterEv(ptr noundef nonnull align 8 dereferenceable(32) %55)
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(56) %57)
  call void @_ZmiRK7R2PointS1_(ptr dead_on_unwind writable sret(%class.R2Vector) align 8 %12, ptr noundef nonnull align 8 dereferenceable(16) %56, ptr noundef nonnull align 8 dereferenceable(16) %58)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(56) %59)
  %61 = call noundef double @_ZNK8R2Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(16) %60)
  store double %61, ptr %13, align 8, !tbaa !9
  %62 = load double, ptr %13, align 8, !tbaa !9
  %63 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %64 = call noundef i32 @_Z18RNIsNegativeOrZerodd(double noundef %62, double noundef %63)
  %65 = icmp ne i32 %64, 0
  br i1 %65, label %66, label %67

66:                                               ; preds = %54
  store i32 0, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %149

67:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  %69 = call noundef double @_ZNK8R2Circle6RadiusEv(ptr noundef nonnull align 8 dereferenceable(32) %68)
  %70 = load ptr, ptr %8, align 8, !tbaa !5
  %71 = call noundef double @_ZNK8R2Circle6RadiusEv(ptr noundef nonnull align 8 dereferenceable(32) %70)
  %72 = call noundef double @_ZNK8R2Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(16) %12)
  %73 = load double, ptr %13, align 8, !tbaa !9
  %74 = load double, ptr %13, align 8, !tbaa !9
  %75 = fneg double %73
  %76 = call double @llvm.fmuladd.f64(double %75, double %74, double %72)
  %77 = fneg double %76
  %78 = call double @llvm.fmuladd.f64(double %69, double %71, double %77)
  store double %78, ptr %15, align 8, !tbaa !9
  %79 = load double, ptr %15, align 8, !tbaa !9
  %80 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %81 = call noundef i32 @_Z12RNIsNegativedd(double noundef %79, double noundef %80)
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %83, label %84

83:                                               ; preds = %67
  store i32 0, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %148

84:                                               ; preds = %67
  %85 = load ptr, ptr %11, align 8, !tbaa !5
  %86 = icmp ne ptr %85, null
  br i1 %86, label %93, label %87

87:                                               ; preds = %84
  %88 = load ptr, ptr %9, align 8, !tbaa !5
  %89 = icmp ne ptr %88, null
  br i1 %89, label %93, label %90

90:                                               ; preds = %87
  %91 = load ptr, ptr %10, align 8, !tbaa !5
  %92 = icmp ne ptr %91, null
  br i1 %92, label %93, label %141

93:                                               ; preds = %90, %87, %84
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %94 = load double, ptr %15, align 8, !tbaa !9
  %95 = call double @sqrt(double noundef %94) #7
  store double %95, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %96 = load double, ptr %13, align 8, !tbaa !9
  %97 = load double, ptr %16, align 8, !tbaa !9
  %98 = fsub double %96, %97
  store double %98, ptr %17, align 8, !tbaa !9
  %99 = load ptr, ptr %11, align 8, !tbaa !5
  %100 = icmp ne ptr %99, null
  br i1 %100, label %101, label %104

101:                                              ; preds = %93
  %102 = load double, ptr %17, align 8, !tbaa !9
  %103 = load ptr, ptr %11, align 8, !tbaa !5
  store double %102, ptr %103, align 8, !tbaa !9
  br label %104

104:                                              ; preds = %101, %93
  %105 = load ptr, ptr %9, align 8, !tbaa !5
  %106 = icmp ne ptr %105, null
  br i1 %106, label %107, label %115

107:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #7
  %108 = load ptr, ptr %7, align 8, !tbaa !5
  %109 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(56) %108)
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #7
  %110 = load double, ptr %17, align 8, !tbaa !9
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  %112 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(56) %111)
  call void @_ZmldRK8R2Vector(ptr dead_on_unwind writable sret(%class.R2Vector) align 8 %19, double noundef %110, ptr noundef nonnull align 8 dereferenceable(16) %112)
  call void @_ZplRK7R2PointRK8R2Vector(ptr dead_on_unwind writable sret(%class.R2Point) align 8 %18, ptr noundef nonnull align 8 dereferenceable(16) %109, ptr noundef nonnull align 8 dereferenceable(16) %19)
  %113 = load ptr, ptr %9, align 8, !tbaa !5
  %114 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN7R2PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %113, ptr noundef nonnull align 8 dereferenceable(16) %18)
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #7
  br label %115

115:                                              ; preds = %107, %104
  %116 = load ptr, ptr %10, align 8, !tbaa !5
  %117 = icmp ne ptr %116, null
  br i1 %117, label %118, label %140

118:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #7
  call void @_ZN7R2PointC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %20)
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %119 = load ptr, ptr %9, align 8, !tbaa !5
  %120 = icmp ne ptr %119, null
  br i1 %120, label %121, label %123

121:                                              ; preds = %118
  %122 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %122, ptr %21, align 8, !tbaa !5
  br label %130

123:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #7
  %124 = load ptr, ptr %7, align 8, !tbaa !5
  %125 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(56) %124)
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #7
  %126 = load double, ptr %17, align 8, !tbaa !9
  %127 = load ptr, ptr %7, align 8, !tbaa !5
  %128 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(56) %127)
  call void @_ZmldRK8R2Vector(ptr dead_on_unwind writable sret(%class.R2Vector) align 8 %23, double noundef %126, ptr noundef nonnull align 8 dereferenceable(16) %128)
  call void @_ZplRK7R2PointRK8R2Vector(ptr dead_on_unwind writable sret(%class.R2Point) align 8 %22, ptr noundef nonnull align 8 dereferenceable(16) %125, ptr noundef nonnull align 8 dereferenceable(16) %23)
  %129 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN7R2PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(16) %22)
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #7
  store ptr %20, ptr %21, align 8, !tbaa !5
  br label %130

130:                                              ; preds = %123, %121
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %25) #7
  %131 = load ptr, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #7
  %132 = load ptr, ptr %8, align 8, !tbaa !5
  %133 = load ptr, ptr %132, align 8, !tbaa !11
  %134 = getelementptr inbounds ptr, ptr %133, i64 7
  %135 = load ptr, ptr %134, align 8
  call void %135(ptr dead_on_unwind writable sret(%class.R2Point) align 8 %26, ptr noundef nonnull align 8 dereferenceable(32) %132)
  call void @_ZmiRK7R2PointS1_(ptr dead_on_unwind writable sret(%class.R2Vector) align 8 %25, ptr noundef nonnull align 8 dereferenceable(16) %131, ptr noundef nonnull align 8 dereferenceable(16) %26)
  %136 = load ptr, ptr %8, align 8, !tbaa !5
  %137 = call noundef double @_ZNK8R2Circle6RadiusEv(ptr noundef nonnull align 8 dereferenceable(32) %136)
  call void @_ZdvRK8R2Vectord(ptr dead_on_unwind writable sret(%class.R2Vector) align 8 %24, ptr noundef nonnull align 8 dereferenceable(16) %25, double noundef %137)
  %138 = load ptr, ptr %10, align 8, !tbaa !5
  %139 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN8R2VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %138, ptr noundef nonnull align 8 dereferenceable(16) %24)
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #7
  br label %140

140:                                              ; preds = %130, %115
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %141

141:                                              ; preds = %140, %90
  %142 = load double, ptr %15, align 8, !tbaa !9
  %143 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %144 = call noundef i32 @_Z8RNIsZerodd(double noundef %142, double noundef %143)
  %145 = icmp ne i32 %144, 0
  br i1 %145, label %146, label %147

146:                                              ; preds = %141
  store i32 1, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %148

147:                                              ; preds = %141
  store i32 4, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %148

148:                                              ; preds = %147, %146, %83
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %149

149:                                              ; preds = %148, %66
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #7
  br label %150

150:                                              ; preds = %149, %53
  %151 = load i32, ptr %6, align 4
  ret i32 %151
}

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

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

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

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

; Function Attrs: nounwind
declare double @sqrt(double noundef) #6

declare void @_ZplRK7R2PointRK8R2Vector(ptr dead_on_unwind writable sret(%class.R2Point) align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #0

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

declare void @_ZdvRK8R2Vectord(ptr dead_on_unwind writable sret(%class.R2Vector) align 8, ptr noundef nonnull align 8 dereferenceable(16), double 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 willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 "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 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, 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.R2Vector = type { [2 x double] }
%class.R2Point = type { [2 x double] }

@RN_EPSILON = external local_unnamed_addr global double, align 8

declare noundef i32 @_Z10R2ContainsRK8R2CircleRK7R2Point(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(16)) 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: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #4 align 2

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

declare noundef double @_ZNK8R2Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

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

declare void @_ZN7R2PointC1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #0

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZN8R2VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 5) i32 @_Z12R2IntersectsRK5R2RayRK8R2CircleP7R2PointP8R2VectorPd(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef %2, ptr noundef %3, ptr noundef writeonly %4) local_unnamed_addr #5 {
  %6 = alloca %class.R2Vector, align 8
  %7 = alloca %class.R2Point, align 8
  %8 = alloca %class.R2Vector, align 8
  %9 = alloca %class.R2Point, align 8
  %10 = alloca %class.R2Point, align 8
  %11 = alloca %class.R2Vector, align 8
  %12 = alloca %class.R2Vector, align 8
  %13 = alloca %class.R2Vector, align 8
  %14 = alloca %class.R2Point, align 8
  %15 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %16 = tail call noundef i32 @_Z10R2ContainsRK8R2CircleRK7R2Point(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(16) %15)
  %.not = icmp eq i32 %16, 0
  br i1 %.not, label %27, label %17

17:                                               ; preds = %5
  %.not58 = icmp eq ptr %2, null
  br i1 %.not58, label %21, label %18

18:                                               ; preds = %17
  %19 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %20 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZN7R2PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(16) %19)
  br label %21

21:                                               ; preds = %18, %17
  %.not59 = icmp eq ptr %3, null
  br i1 %.not59, label %25, label %22

22:                                               ; preds = %21
  %23 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %24 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZN8R2VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %23)
  br label %25

25:                                               ; preds = %22, %21
  %.not60 = icmp eq ptr %4, null
  br i1 %.not60, label %72, label %26

26:                                               ; preds = %25
  store double 0.000000e+00, ptr %4, align 8, !tbaa !5
  br label %72

27:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #7
  %28 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK8R2Circle6CenterEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %29 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  call void @_ZmiRK7R2PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R2Vector) align 8 %6, ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 8 dereferenceable(16) %29)
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  %31 = call noundef double @_ZNK8R2Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(16) %30)
  %32 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %33 = call noundef i32 @_Z18RNIsNegativeOrZerodd(double noundef %31, double noundef %32)
  %.not55 = icmp eq i32 %33, 0
  br i1 %.not55, label %34, label %71

34:                                               ; preds = %27
  %35 = call noundef double @_ZNK8R2Circle6RadiusEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %36 = call noundef double @_ZNK8R2Circle6RadiusEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %37 = call noundef double @_ZNK8R2Vector3DotERKS_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(16) %6)
  %38 = fneg double %31
  %39 = call double @llvm.fmuladd.f64(double %38, double %31, double %37)
  %40 = fneg double %39
  %41 = call double @llvm.fmuladd.f64(double %35, double %36, double %40)
  %42 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %43 = call noundef i32 @_Z12RNIsNegativedd(double noundef %41, double noundef %42)
  %.not56 = icmp eq i32 %43, 0
  br i1 %.not56, label %44, label %71

44:                                               ; preds = %34
  %45 = icmp ne ptr %4, null
  %46 = icmp ne ptr %2, null
  %or.cond = or i1 %46, %45
  %47 = icmp ne ptr %3, null
  %or.cond3 = or i1 %47, %or.cond
  br i1 %or.cond3, label %48, label %68

48:                                               ; preds = %44
  %49 = call double @sqrt(double noundef %41) #7
  %50 = fsub double %31, %49
  br i1 %45, label %51, label %52

51:                                               ; preds = %48
  store double %50, ptr %4, align 8, !tbaa !5
  br label %52

52:                                               ; preds = %51, %48
  br i1 %46, label %53, label %.thread

53:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #7
  %54 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #7
  %55 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  call void @_ZmldRK8R2Vector(ptr dead_on_unwind nonnull writable sret(%class.R2Vector) align 8 %8, double noundef %50, ptr noundef nonnull align 8 dereferenceable(16) %55)
  call void @_ZplRK7R2PointRK8R2Vector(ptr dead_on_unwind nonnull writable sret(%class.R2Point) align 8 %7, ptr noundef nonnull align 8 dereferenceable(16) %54, ptr noundef nonnull align 8 dereferenceable(16) %8)
  %56 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN7R2PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(16) %7)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  br i1 %47, label %57, label %68

.thread:                                          ; preds = %52
  br i1 %47, label %58, label %68

57:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #7
  call void @_ZN7R2PointC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %9)
  br label %62

58:                                               ; preds = %.thread
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #7
  call void @_ZN7R2PointC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %9)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #7
  %59 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray5StartEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #7
  %60 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK5R2Ray6VectorEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
  call void @_ZmldRK8R2Vector(ptr dead_on_unwind nonnull writable sret(%class.R2Vector) align 8 %11, double noundef %50, ptr noundef nonnull align 8 dereferenceable(16) %60)
  call void @_ZplRK7R2PointRK8R2Vector(ptr dead_on_unwind nonnull writable sret(%class.R2Point) align 8 %10, ptr noundef nonnull align 8 dereferenceable(16) %59, ptr noundef nonnull align 8 dereferenceable(16) %11)
  %61 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN7R2PointaSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %10)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #7
  br label %62

62:                                               ; preds = %57, %58
  %.0 = phi ptr [ %9, %58 ], [ %2, %57 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #7
  %63 = load ptr, ptr %1, align 8, !tbaa !9
  %64 = getelementptr inbounds i8, ptr %63, i64 56
  %65 = load ptr, ptr %64, align 8
  call void %65(ptr dead_on_unwind nonnull writable sret(%class.R2Point) align 8 %14, ptr noundef nonnull align 8 dereferenceable(32) %1)
  call void @_ZmiRK7R2PointS1_(ptr dead_on_unwind nonnull writable sret(%class.R2Vector) align 8 %13, ptr noundef nonnull align 8 dereferenceable(16) %.0, ptr noundef nonnull align 8 dereferenceable(16) %14)
  %66 = call noundef double @_ZNK8R2Circle6RadiusEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  call void @_ZdvRK8R2Vectord(ptr dead_on_unwind nonnull writable sret(%class.R2Vector) align 8 %12, ptr noundef nonnull align 8 dereferenceable(16) %13, double noundef %66)
  %67 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN8R2VectoraSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %12)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #7
  br label %68

68:                                               ; preds = %.thread, %53, %62, %44
  %69 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %70 = call noundef i32 @_Z8RNIsZerodd(double noundef %41, double noundef %69)
  %.not57 = icmp eq i32 %70, 0
  %. = select i1 %.not57, i32 4, i32 1
  br label %71

71:                                               ; preds = %34, %68, %27
  %.1 = phi i32 [ 0, %27 ], [ 0, %34 ], [ %., %68 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  br label %72

72:                                               ; preds = %25, %26, %71
  %.2 = phi i32 [ %.1, %71 ], [ 4, %26 ], [ 4, %25 ]
  ret i32 %.2
}

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

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #6

declare void @_ZplRK7R2PointRK8R2Vector(ptr dead_on_unwind writable sret(%class.R2Point) align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

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

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 #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 willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { mustprogress nofree nounwind willreturn memory(write) "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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"vtable pointer", !8, i64 0}


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