; LLVM IR from ayush-tulsyan/ACM-ICPC-Handbook :: code/Geometry.ll (Z24CircleCircleIntersection2PTS_dd)

; 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"

%struct.PT = type { double, double }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<PT, std::allocator<PT>>::_Vector_impl" }
%"struct.std::_Vector_base<PT, std::allocator<PT>>::_Vector_impl" = type { %"struct.std::_Vector_base<PT, std::allocator<PT>>::_Vector_impl_data" }
%"struct.std::_Vector_base<PT, std::allocator<PT>>::_Vector_impl_data" = type { ptr, ptr, ptr }

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_Z5dist22PTS_(ptr noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK2PTmiERKS_(ptr dead_on_unwind noalias writable sret(%struct.PT) align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11RotateCCW902PT(ptr dead_on_unwind noalias writable sret(%struct.PT) align 8, ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK2PTplERKS_(ptr dead_on_unwind noalias writable sret(%struct.PT) align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK2PTmlEd(ptr dead_on_unwind noalias writable sret(%struct.PT) align 8, ptr noundef nonnull align 8 dereferenceable(16), double noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK2PTdvEd(ptr dead_on_unwind noalias writable sret(%struct.PT) align 8, ptr noundef nonnull align 8 dereferenceable(16), double noundef) #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2PTC2ERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorI2PTSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI2PTSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorI2PTSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z24CircleCircleIntersection2PTS_dd(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8 %0, ptr noundef %1, ptr noundef %2, double noundef %3, double noundef %4) #1 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca i1, align 1
  %12 = alloca double, align 8
  %13 = alloca %struct.PT, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca %struct.PT, align 8
  %17 = alloca i32, align 4
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca %struct.PT, align 8
  %21 = alloca %struct.PT, align 8
  %22 = alloca %struct.PT, align 8
  %23 = alloca %struct.PT, align 8
  %24 = alloca %struct.PT, align 8
  %25 = alloca %struct.PT, align 8
  %26 = alloca %struct.PT, align 8
  %27 = alloca %struct.PT, align 8
  %28 = alloca %struct.PT, align 8
  %29 = alloca %struct.PT, align 8
  %30 = alloca %struct.PT, align 8
  %31 = alloca %struct.PT, align 8
  %32 = alloca %struct.PT, align 8
  %33 = alloca %struct.PT, align 8
  store ptr %0, ptr %6, align 8
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store double %3, ptr %9, align 8, !tbaa !9
  store double %4, ptr %10, align 8, !tbaa !9
  store i1 false, ptr %11, align 1
  call void @_ZNSt6vectorI2PTSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  invoke void @_ZN2PTC2ERKS_(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(16) %1)
          to label %34 unwind label %55

34:                                               ; preds = %5
  invoke void @_ZN2PTC2ERKS_(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(16) %2)
          to label %35 unwind label %55

35:                                               ; preds = %34
  %36 = invoke noundef double @_Z5dist22PTS_(ptr noundef %13, ptr noundef %16)
          to label %37 unwind label %55

37:                                               ; preds = %35
  %38 = call double @sqrt(double noundef %36) #6
  store double %38, ptr %12, align 8, !tbaa !9
  %39 = load double, ptr %12, align 8, !tbaa !9
  %40 = load double, ptr %9, align 8, !tbaa !9
  %41 = load double, ptr %10, align 8, !tbaa !9
  %42 = fadd double %40, %41
  %43 = fcmp ogt double %39, %42
  br i1 %43, label %54, label %44

44:                                               ; preds = %37
  %45 = load double, ptr %12, align 8, !tbaa !9
  %46 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %47 unwind label %55

47:                                               ; preds = %44
  %48 = load double, ptr %46, align 8, !tbaa !9
  %49 = fadd double %45, %48
  %50 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %51 unwind label %55

51:                                               ; preds = %47
  %52 = load double, ptr %50, align 8, !tbaa !9
  %53 = fcmp olt double %49, %52
  br i1 %53, label %54, label %59

54:                                               ; preds = %51, %37
  store i1 true, ptr %11, align 1
  store i32 1, ptr %17, align 4
  br label %129

55:                                               ; preds = %47, %44, %35, %34, %5
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %14, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %15, align 4
  br label %131

59:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %60 = load double, ptr %12, align 8, !tbaa !9
  %61 = load double, ptr %12, align 8, !tbaa !9
  %62 = load double, ptr %10, align 8, !tbaa !9
  %63 = load double, ptr %10, align 8, !tbaa !9
  %64 = fmul double %62, %63
  %65 = fneg double %64
  %66 = call double @llvm.fmuladd.f64(double %60, double %61, double %65)
  %67 = load double, ptr %9, align 8, !tbaa !9
  %68 = load double, ptr %9, align 8, !tbaa !9
  %69 = call double @llvm.fmuladd.f64(double %67, double %68, double %66)
  %70 = load double, ptr %12, align 8, !tbaa !9
  %71 = fmul double 2.000000e+00, %70
  %72 = fdiv double %69, %71
  store double %72, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %73 = load double, ptr %9, align 8, !tbaa !9
  %74 = load double, ptr %9, align 8, !tbaa !9
  %75 = load double, ptr %18, align 8, !tbaa !9
  %76 = load double, ptr %18, align 8, !tbaa !9
  %77 = fmul double %75, %76
  %78 = fneg double %77
  %79 = call double @llvm.fmuladd.f64(double %73, double %74, double %78)
  %80 = call double @sqrt(double noundef %79) #6
  store double %80, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #6
  invoke void @_ZNK2PTmiERKS_(ptr dead_on_unwind writable sret(%struct.PT) align 8 %21, ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(16) %1)
          to label %81 unwind label %105

81:                                               ; preds = %59
  %82 = load double, ptr %12, align 8, !tbaa !9
  invoke void @_ZNK2PTdvEd(ptr dead_on_unwind writable sret(%struct.PT) align 8 %20, ptr noundef nonnull align 8 dereferenceable(16) %21, double noundef %82)
          to label %83 unwind label %105

83:                                               ; preds = %81
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #6
  %84 = load double, ptr %18, align 8, !tbaa !9
  invoke void @_ZNK2PTmlEd(ptr dead_on_unwind writable sret(%struct.PT) align 8 %24, ptr noundef nonnull align 8 dereferenceable(16) %20, double noundef %84)
          to label %85 unwind label %109

85:                                               ; preds = %83
  invoke void @_ZNK2PTplERKS_(ptr dead_on_unwind writable sret(%struct.PT) align 8 %23, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(16) %24)
          to label %86 unwind label %109

86:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 16, ptr %25) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #6
  invoke void @_ZN2PTC2ERKS_(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 8 dereferenceable(16) %20)
          to label %87 unwind label %113

87:                                               ; preds = %86
  invoke void @_Z11RotateCCW902PT(ptr dead_on_unwind writable sret(%struct.PT) align 8 %26, ptr noundef %27)
          to label %88 unwind label %113

88:                                               ; preds = %87
  %89 = load double, ptr %19, align 8, !tbaa !9
  invoke void @_ZNK2PTmlEd(ptr dead_on_unwind writable sret(%struct.PT) align 8 %25, ptr noundef nonnull align 8 dereferenceable(16) %26, double noundef %89)
          to label %90 unwind label %113

90:                                               ; preds = %88
  invoke void @_ZNK2PTplERKS_(ptr dead_on_unwind writable sret(%struct.PT) align 8 %22, ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 8 dereferenceable(16) %25)
          to label %91 unwind label %113

91:                                               ; preds = %90
  invoke void @_ZNSt6vectorI2PTSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(16) %22)
          to label %92 unwind label %113

92:                                               ; preds = %91
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #6
  %93 = load double, ptr %19, align 8, !tbaa !9
  %94 = fcmp ogt double %93, 0.000000e+00
  br i1 %94, label %95, label %127

95:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 16, ptr %28) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %29) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %30) #6
  %96 = load double, ptr %18, align 8, !tbaa !9
  invoke void @_ZNK2PTmlEd(ptr dead_on_unwind writable sret(%struct.PT) align 8 %30, ptr noundef nonnull align 8 dereferenceable(16) %20, double noundef %96)
          to label %97 unwind label %118

97:                                               ; preds = %95
  invoke void @_ZNK2PTplERKS_(ptr dead_on_unwind writable sret(%struct.PT) align 8 %29, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(16) %30)
          to label %98 unwind label %118

98:                                               ; preds = %97
  call void @llvm.lifetime.start.p0(i64 16, ptr %31) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %32) #6
  invoke void @_ZN2PTC2ERKS_(ptr noundef nonnull align 8 dereferenceable(16) %33, ptr noundef nonnull align 8 dereferenceable(16) %20)
          to label %99 unwind label %122

99:                                               ; preds = %98
  invoke void @_Z11RotateCCW902PT(ptr dead_on_unwind writable sret(%struct.PT) align 8 %32, ptr noundef %33)
          to label %100 unwind label %122

100:                                              ; preds = %99
  %101 = load double, ptr %19, align 8, !tbaa !9
  invoke void @_ZNK2PTmlEd(ptr dead_on_unwind writable sret(%struct.PT) align 8 %31, ptr noundef nonnull align 8 dereferenceable(16) %32, double noundef %101)
          to label %102 unwind label %122

102:                                              ; preds = %100
  invoke void @_ZNK2PTmiERKS_(ptr dead_on_unwind writable sret(%struct.PT) align 8 %28, ptr noundef nonnull align 8 dereferenceable(16) %29, ptr noundef nonnull align 8 dereferenceable(16) %31)
          to label %103 unwind label %122

103:                                              ; preds = %102
  invoke void @_ZNSt6vectorI2PTSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(16) %28)
          to label %104 unwind label %122

104:                                              ; preds = %103
  call void @llvm.lifetime.end.p0(i64 16, ptr %32) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %31) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #6
  br label %127

105:                                              ; preds = %81, %59
  %106 = landingpad { ptr, i32 }
          cleanup
  %107 = extractvalue { ptr, i32 } %106, 0
  store ptr %107, ptr %14, align 8
  %108 = extractvalue { ptr, i32 } %106, 1
  store i32 %108, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #6
  br label %128

109:                                              ; preds = %85, %83
  %110 = landingpad { ptr, i32 }
          cleanup
  %111 = extractvalue { ptr, i32 } %110, 0
  store ptr %111, ptr %14, align 8
  %112 = extractvalue { ptr, i32 } %110, 1
  store i32 %112, ptr %15, align 4
  br label %117

113:                                              ; preds = %91, %90, %88, %87, %86
  %114 = landingpad { ptr, i32 }
          cleanup
  %115 = extractvalue { ptr, i32 } %114, 0
  store ptr %115, ptr %14, align 8
  %116 = extractvalue { ptr, i32 } %114, 1
  store i32 %116, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #6
  br label %117

117:                                              ; preds = %113, %109
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #6
  br label %128

118:                                              ; preds = %97, %95
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %14, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %15, align 4
  br label %126

122:                                              ; preds = %103, %102, %100, %99, %98
  %123 = landingpad { ptr, i32 }
          cleanup
  %124 = extractvalue { ptr, i32 } %123, 0
  store ptr %124, ptr %14, align 8
  %125 = extractvalue { ptr, i32 } %123, 1
  store i32 %125, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %32) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %31) #6
  br label %126

126:                                              ; preds = %122, %118
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #6
  br label %128

127:                                              ; preds = %104, %92
  store i1 true, ptr %11, align 1
  store i32 1, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %129

128:                                              ; preds = %126, %117, %105
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %131

129:                                              ; preds = %127, %54
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  %130 = load i1, ptr %11, align 1
  br i1 %130, label %133, label %132

131:                                              ; preds = %128, %55
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @_ZNSt6vectorI2PTSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  br label %134

132:                                              ; preds = %129
  call void @_ZNSt6vectorI2PTSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  br label %133

133:                                              ; preds = %132, %129
  ret void

134:                                              ; preds = %131
  %135 = load ptr, ptr %14, align 8
  %136 = load i32, ptr %15, align 4
  %137 = insertvalue { ptr, i32 } poison, ptr %135, 0
  %138 = insertvalue { ptr, i32 } %137, i32 %136, 1
  resume { ptr, i32 } %138
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

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

%struct.PT = type { double, double }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<PT, std::allocator<PT>>::_Vector_impl" }
%"struct.std::_Vector_base<PT, std::allocator<PT>>::_Vector_impl" = type { %"struct.std::_Vector_base<PT, std::allocator<PT>>::_Vector_impl_data" }
%"struct.std::_Vector_base<PT, std::allocator<PT>>::_Vector_impl_data" = type { ptr, ptr, ptr }

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_Z5dist22PTS_(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK2PTmiERKS_(ptr dead_on_unwind noalias writable sret(%struct.PT) align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11RotateCCW902PT(ptr dead_on_unwind noalias writable sret(%struct.PT) align 8, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK2PTplERKS_(ptr dead_on_unwind noalias writable sret(%struct.PT) align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

; 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 uwtable
declare dso_local void @_ZNK2PTmlEd(ptr dead_on_unwind noalias writable sret(%struct.PT) align 8, ptr noundef nonnull align 8 dereferenceable(16), double noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK2PTdvEd(ptr dead_on_unwind noalias writable sret(%struct.PT) align 8, ptr noundef nonnull align 8 dereferenceable(16), double noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2PTC2ERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorI2PTSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI2PTSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorI2PTSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z24CircleCircleIntersection2PTS_dd(ptr dead_on_unwind noalias nonnull writable sret(%"class.std::vector") align 8 %0, ptr noundef %1, ptr noundef %2, double noundef %3, double noundef %4) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca %struct.PT, align 8
  %9 = alloca %struct.PT, align 8
  %10 = alloca %struct.PT, align 8
  %11 = alloca %struct.PT, align 8
  %12 = alloca %struct.PT, align 8
  %13 = alloca %struct.PT, align 8
  %14 = alloca %struct.PT, align 8
  %15 = alloca %struct.PT, align 8
  %16 = alloca %struct.PT, align 8
  %17 = alloca %struct.PT, align 8
  %18 = alloca %struct.PT, align 8
  %19 = alloca %struct.PT, align 8
  %20 = alloca %struct.PT, align 8
  %21 = alloca %struct.PT, align 8
  %22 = alloca %struct.PT, align 8
  %23 = alloca %struct.PT, align 8
  store double %3, ptr %6, align 8, !tbaa !5
  store double %4, ptr %7, align 8, !tbaa !5
  tail call void @_ZNSt6vectorI2PTSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  call void @_ZN2PTC2ERKS_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(16) %1)
  call void @_ZN2PTC2ERKS_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %2)
  %24 = invoke noundef double @_Z5dist22PTS_(ptr noundef nonnull %8, ptr noundef nonnull %9)
          to label %25 unwind label %36

25:                                               ; preds = %5
  %26 = call double @sqrt(double noundef %24) #6
  %27 = fadd double %3, %4
  %28 = fcmp ogt double %26, %27
  br i1 %28, label %82, label %29

29:                                               ; preds = %25
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %31 = load double, ptr %30, align 8, !tbaa !5
  %32 = fadd double %26, %31
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %34 = load double, ptr %33, align 8, !tbaa !5
  %35 = fcmp olt double %32, %34
  br i1 %35, label %82, label %38

36:                                               ; preds = %5
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %81

38:                                               ; preds = %29
  %39 = load double, ptr %7, align 8, !tbaa !5
  %40 = fneg double %39
  %41 = fmul double %39, %40
  %42 = call double @llvm.fmuladd.f64(double %26, double %26, double %41)
  %43 = load double, ptr %6, align 8, !tbaa !5
  %44 = call double @llvm.fmuladd.f64(double %43, double %43, double %42)
  %45 = fmul double %26, 2.000000e+00
  %46 = fdiv double %44, %45
  %47 = fneg double %46
  %48 = fmul double %46, %47
  %49 = call double @llvm.fmuladd.f64(double %43, double %43, double %48)
  %50 = call double @sqrt(double noundef %49) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #6
  invoke void @_ZNK2PTmiERKS_(ptr dead_on_unwind nonnull writable sret(%struct.PT) align 8 %11, ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(16) %1)
          to label %51 unwind label %67

51:                                               ; preds = %38
  invoke void @_ZNK2PTdvEd(ptr dead_on_unwind nonnull writable sret(%struct.PT) align 8 %10, ptr noundef nonnull align 8 dereferenceable(16) %11, double noundef %26)
          to label %52 unwind label %67

52:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #6
  invoke void @_ZNK2PTmlEd(ptr dead_on_unwind nonnull writable sret(%struct.PT) align 8 %14, ptr noundef nonnull align 8 dereferenceable(16) %10, double noundef %46)
          to label %53 unwind label %69

53:                                               ; preds = %52
  invoke void @_ZNK2PTplERKS_(ptr dead_on_unwind nonnull writable sret(%struct.PT) align 8 %13, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(16) %14)
          to label %54 unwind label %69

54:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %15) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %16) #6
  call void @_ZN2PTC2ERKS_(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(16) %10)
  invoke void @_Z11RotateCCW902PT(ptr dead_on_unwind nonnull writable sret(%struct.PT) align 8 %16, ptr noundef nonnull %17)
          to label %55 unwind label %71

55:                                               ; preds = %54
  invoke void @_ZNK2PTmlEd(ptr dead_on_unwind nonnull writable sret(%struct.PT) align 8 %15, ptr noundef nonnull align 8 dereferenceable(16) %16, double noundef %50)
          to label %56 unwind label %71

56:                                               ; preds = %55
  invoke void @_ZNK2PTplERKS_(ptr dead_on_unwind nonnull writable sret(%struct.PT) align 8 %12, ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(16) %15)
          to label %57 unwind label %71

57:                                               ; preds = %56
  invoke void @_ZNSt6vectorI2PTSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(16) %12)
          to label %58 unwind label %71

58:                                               ; preds = %57
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #6
  %59 = fcmp ogt double %50, 0.000000e+00
  br i1 %59, label %60, label %79

60:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %18) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %19) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %20) #6
  invoke void @_ZNK2PTmlEd(ptr dead_on_unwind nonnull writable sret(%struct.PT) align 8 %20, ptr noundef nonnull align 8 dereferenceable(16) %10, double noundef %46)
          to label %61 unwind label %74

61:                                               ; preds = %60
  invoke void @_ZNK2PTplERKS_(ptr dead_on_unwind nonnull writable sret(%struct.PT) align 8 %19, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(16) %20)
          to label %62 unwind label %74

62:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %21) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %22) #6
  call void @_ZN2PTC2ERKS_(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 8 dereferenceable(16) %10)
  invoke void @_Z11RotateCCW902PT(ptr dead_on_unwind nonnull writable sret(%struct.PT) align 8 %22, ptr noundef nonnull %23)
          to label %63 unwind label %76

63:                                               ; preds = %62
  invoke void @_ZNK2PTmlEd(ptr dead_on_unwind nonnull writable sret(%struct.PT) align 8 %21, ptr noundef nonnull align 8 dereferenceable(16) %22, double noundef %50)
          to label %64 unwind label %76

64:                                               ; preds = %63
  invoke void @_ZNK2PTmiERKS_(ptr dead_on_unwind nonnull writable sret(%struct.PT) align 8 %18, ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 8 dereferenceable(16) %21)
          to label %65 unwind label %76

65:                                               ; preds = %64
  invoke void @_ZNSt6vectorI2PTSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(16) %18)
          to label %66 unwind label %76

66:                                               ; preds = %65
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %22) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %21) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %20) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %19) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %18) #6
  br label %79

67:                                               ; preds = %51, %38
  %68 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #6
  br label %80

69:                                               ; preds = %53, %52
  %70 = landingpad { ptr, i32 }
          cleanup
  br label %73

71:                                               ; preds = %57, %56, %55, %54
  %72 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #6
  br label %73

73:                                               ; preds = %71, %69
  %.pn = phi { ptr, i32 } [ %72, %71 ], [ %70, %69 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #6
  br label %80

74:                                               ; preds = %61, %60
  %75 = landingpad { ptr, i32 }
          cleanup
  br label %78

76:                                               ; preds = %65, %64, %63, %62
  %77 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %22) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %21) #6
  br label %78

78:                                               ; preds = %76, %74
  %.pn22 = phi { ptr, i32 } [ %77, %76 ], [ %75, %74 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %20) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %19) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %18) #6
  br label %80

79:                                               ; preds = %66, %58
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #6
  br label %82

80:                                               ; preds = %78, %73, %67
  %.pn22.pn = phi { ptr, i32 } [ %.pn22, %78 ], [ %.pn, %73 ], [ %68, %67 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #6
  br label %81

81:                                               ; preds = %80, %36
  %.pn22.pn.pn = phi { ptr, i32 } [ %.pn22.pn, %80 ], [ %37, %36 ]
  call void @_ZNSt6vectorI2PTSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  resume { ptr, i32 } %.pn22.pn.pn

82:                                               ; preds = %79, %29, %25
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress 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 #5 = { 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 #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,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass