; LLVM IR from ShahjalalShohag/code-library :: Geometry/Geometry 2D.ll (Z29_triangle_circle_intersection2PTdS_S_)

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

; Function Attrs: nounwind
declare double @acos(double noundef) #0

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4swapI2PTENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS4_ESt18is_move_assignableIS4_EEE5valueEvE4typeERS4_SD_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #4

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_Z29_triangle_circle_intersection2PTdS_S_(ptr noundef %0, double noundef %1, ptr noundef %2, ptr noundef %3) #5 {
  %5 = alloca double, align 8
  %6 = alloca ptr, align 8
  %7 = alloca double, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca double, align 8
  %11 = alloca %struct.PT, align 8
  %12 = alloca %struct.PT, align 8
  %13 = alloca double, align 8
  %14 = alloca %struct.PT, align 8
  %15 = alloca %struct.PT, align 8
  %16 = alloca double, align 8
  %17 = alloca %struct.PT, align 8
  %18 = alloca %struct.PT, 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 i32, align 4
  %25 = alloca double, align 8
  %26 = alloca double, align 8
  %27 = alloca double, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store double %1, ptr %7, align 8, !tbaa !9
  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) #7
  call void @_ZN2PTC2ERKS_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(16) %0)
  call void @_ZN2PTC2ERKS_(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(16) %2)
  %28 = call noundef double @_Z5dist22PTS_(ptr noundef %11, ptr noundef %12)
  store double %28, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  call void @_ZN2PTC2ERKS_(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(16) %0)
  call void @_ZN2PTC2ERKS_(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(16) %3)
  %29 = call noundef double @_Z5dist22PTS_(ptr noundef %14, ptr noundef %15)
  store double %29, ptr %13, align 8, !tbaa !9
  %30 = load double, ptr %10, align 8, !tbaa !9
  %31 = load double, ptr %13, align 8, !tbaa !9
  %32 = fcmp ogt double %30, %31
  br i1 %32, label %33, label %34

33:                                               ; preds = %4
  call void @_ZSt4swapI2PTENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS4_ESt18is_move_assignableIS4_EEE5valueEvE4typeERS4_SD_(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(16) %3)
  call void @_ZSt4swapIdENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  br label %34

34:                                               ; preds = %33, %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  call void @_ZN2PTC2ERKS_(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(16) %2)
  call void @_ZN2PTC2ERKS_(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(16) %3)
  %35 = call noundef double @_Z5dist22PTS_(ptr noundef %17, ptr noundef %18)
  store double %35, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %36 = load double, ptr %10, align 8, !tbaa !9
  %37 = fpext double %36 to x86_fp80
  %38 = call x86_fp80 @sqrtl(x86_fp80 noundef %37) #7
  %39 = fptrunc x86_fp80 %38 to double
  store double %39, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %40 = load double, ptr %13, align 8, !tbaa !9
  %41 = fpext double %40 to x86_fp80
  %42 = call x86_fp80 @sqrtl(x86_fp80 noundef %41) #7
  %43 = fptrunc x86_fp80 %42 to double
  store double %43, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %44 = load double, ptr %16, align 8, !tbaa !9
  %45 = call double @sqrt(double noundef %44) #7
  store double %45, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %46 = load double, ptr %13, align 8, !tbaa !9
  %47 = load double, ptr %16, align 8, !tbaa !9
  %48 = fsub double %46, %47
  %49 = load double, ptr %10, align 8, !tbaa !9
  %50 = fsub double %48, %49
  %51 = call noundef double @_ZSt3absd(double noundef %50)
  %52 = load double, ptr %21, align 8, !tbaa !9
  %53 = fmul double 2.000000e+00, %52
  %54 = fdiv double %51, %53
  store double %54, ptr %22, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %55 = load double, ptr %10, align 8, !tbaa !9
  %56 = load double, ptr %22, align 8, !tbaa !9
  %57 = load double, ptr %22, align 8, !tbaa !9
  %58 = fneg double %56
  %59 = call double @llvm.fmuladd.f64(double %58, double %57, double %55)
  %60 = fpext double %59 to x86_fp80
  %61 = call x86_fp80 @sqrtl(x86_fp80 noundef %60) #7
  %62 = fptrunc x86_fp80 %61 to double
  store double %62, ptr %23, align 8, !tbaa !9
  %63 = load double, ptr %7, align 8, !tbaa !9
  %64 = load double, ptr %20, align 8, !tbaa !9
  %65 = fcmp oge double %63, %64
  br i1 %65, label %66, label %71

66:                                               ; preds = %34
  %67 = load double, ptr %23, align 8, !tbaa !9
  %68 = load double, ptr %21, align 8, !tbaa !9
  %69 = fmul double %67, %68
  %70 = fdiv double %69, 2.000000e+00
  store double %70, ptr %5, align 8
  store i32 1, ptr %24, align 4
  br label %219

71:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  store double 0.000000e+00, ptr %25, align 8, !tbaa !9
  %72 = load double, ptr %16, align 8, !tbaa !9
  %73 = load double, ptr %10, align 8, !tbaa !9
  %74 = fadd double %72, %73
  %75 = load double, ptr %13, align 8, !tbaa !9
  %76 = fcmp olt double %74, %75
  br i1 %76, label %77, label %130

77:                                               ; preds = %71
  %78 = load double, ptr %7, align 8, !tbaa !9
  %79 = load double, ptr %19, align 8, !tbaa !9
  %80 = fcmp olt double %78, %79
  br i1 %80, label %81, label %96

81:                                               ; preds = %77
  %82 = load double, ptr %7, align 8, !tbaa !9
  %83 = load double, ptr %7, align 8, !tbaa !9
  %84 = fmul double %82, %83
  %85 = load double, ptr %23, align 8, !tbaa !9
  %86 = load double, ptr %20, align 8, !tbaa !9
  %87 = fdiv double %85, %86
  %88 = call double @acos(double noundef %87) #7
  %89 = load double, ptr %23, align 8, !tbaa !9
  %90 = load double, ptr %19, align 8, !tbaa !9
  %91 = fdiv double %89, %90
  %92 = call double @acos(double noundef %91) #7
  %93 = fsub double %88, %92
  %94 = fmul double %84, %93
  %95 = fdiv double %94, 2.000000e+00
  store double %95, ptr %25, align 8, !tbaa !9
  br label %129

96:                                               ; preds = %77
  %97 = load double, ptr %7, align 8, !tbaa !9
  %98 = load double, ptr %7, align 8, !tbaa !9
  %99 = fmul double %97, %98
  %100 = load double, ptr %23, align 8, !tbaa !9
  %101 = load double, ptr %20, align 8, !tbaa !9
  %102 = fdiv double %100, %101
  %103 = call double @acos(double noundef %102) #7
  %104 = load double, ptr %23, align 8, !tbaa !9
  %105 = load double, ptr %7, align 8, !tbaa !9
  %106 = fdiv double %104, %105
  %107 = call double @acos(double noundef %106) #7
  %108 = fsub double %103, %107
  %109 = fmul double %99, %108
  %110 = fdiv double %109, 2.000000e+00
  store double %110, ptr %25, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  %111 = load double, ptr %7, align 8, !tbaa !9
  %112 = load double, ptr %7, align 8, !tbaa !9
  %113 = load double, ptr %23, align 8, !tbaa !9
  %114 = load double, ptr %23, align 8, !tbaa !9
  %115 = fmul double %113, %114
  %116 = fneg double %115
  %117 = call double @llvm.fmuladd.f64(double %111, double %112, double %116)
  %118 = fpext double %117 to x86_fp80
  %119 = call x86_fp80 @sqrtl(x86_fp80 noundef %118) #7
  %120 = fptrunc x86_fp80 %119 to double
  store double %120, ptr %26, align 8, !tbaa !9
  %121 = load double, ptr %23, align 8, !tbaa !9
  %122 = load double, ptr %26, align 8, !tbaa !9
  %123 = load double, ptr %22, align 8, !tbaa !9
  %124 = fsub double %122, %123
  %125 = fmul double %121, %124
  %126 = fdiv double %125, 2.000000e+00
  %127 = load double, ptr %25, align 8, !tbaa !9
  %128 = fadd double %127, %126
  store double %128, ptr %25, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  br label %129

129:                                              ; preds = %96, %81
  br label %217

130:                                              ; preds = %71
  %131 = load double, ptr %7, align 8, !tbaa !9
  %132 = load double, ptr %23, align 8, !tbaa !9
  %133 = fcmp olt double %131, %132
  br i1 %133, label %134, label %149

134:                                              ; preds = %130
  %135 = load double, ptr %7, align 8, !tbaa !9
  %136 = load double, ptr %7, align 8, !tbaa !9
  %137 = fmul double %135, %136
  %138 = load double, ptr %23, align 8, !tbaa !9
  %139 = load double, ptr %20, align 8, !tbaa !9
  %140 = fdiv double %138, %139
  %141 = call double @acos(double noundef %140) #7
  %142 = load double, ptr %23, align 8, !tbaa !9
  %143 = load double, ptr %19, align 8, !tbaa !9
  %144 = fdiv double %142, %143
  %145 = call double @acos(double noundef %144) #7
  %146 = fadd double %141, %145
  %147 = fmul double %137, %146
  %148 = fdiv double %147, 2.000000e+00
  store double %148, ptr %25, align 8, !tbaa !9
  br label %216

149:                                              ; preds = %130
  %150 = load double, ptr %7, align 8, !tbaa !9
  %151 = load double, ptr %7, align 8, !tbaa !9
  %152 = fmul double %150, %151
  %153 = load double, ptr %23, align 8, !tbaa !9
  %154 = load double, ptr %20, align 8, !tbaa !9
  %155 = fdiv double %153, %154
  %156 = call double @acos(double noundef %155) #7
  %157 = load double, ptr %23, align 8, !tbaa !9
  %158 = load double, ptr %7, align 8, !tbaa !9
  %159 = fdiv double %157, %158
  %160 = call double @acos(double noundef %159) #7
  %161 = fsub double %156, %160
  %162 = fmul double %152, %161
  %163 = fdiv double %162, 2.000000e+00
  %164 = load double, ptr %25, align 8, !tbaa !9
  %165 = fadd double %164, %163
  store double %165, ptr %25, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %166 = load double, ptr %7, align 8, !tbaa !9
  %167 = load double, ptr %7, align 8, !tbaa !9
  %168 = load double, ptr %23, align 8, !tbaa !9
  %169 = load double, ptr %23, align 8, !tbaa !9
  %170 = fmul double %168, %169
  %171 = fneg double %170
  %172 = call double @llvm.fmuladd.f64(double %166, double %167, double %171)
  %173 = fpext double %172 to x86_fp80
  %174 = call x86_fp80 @sqrtl(x86_fp80 noundef %173) #7
  %175 = fptrunc x86_fp80 %174 to double
  store double %175, ptr %27, align 8, !tbaa !9
  %176 = load double, ptr %23, align 8, !tbaa !9
  %177 = load double, ptr %27, align 8, !tbaa !9
  %178 = fmul double %176, %177
  %179 = fdiv double %178, 2.000000e+00
  %180 = load double, ptr %25, align 8, !tbaa !9
  %181 = fadd double %180, %179
  store double %181, ptr %25, align 8, !tbaa !9
  %182 = load double, ptr %7, align 8, !tbaa !9
  %183 = load double, ptr %19, align 8, !tbaa !9
  %184 = fcmp olt double %182, %183
  br i1 %184, label %185, label %208

185:                                              ; preds = %149
  %186 = load double, ptr %7, align 8, !tbaa !9
  %187 = load double, ptr %7, align 8, !tbaa !9
  %188 = fmul double %186, %187
  %189 = load double, ptr %23, align 8, !tbaa !9
  %190 = load double, ptr %19, align 8, !tbaa !9
  %191 = fdiv double %189, %190
  %192 = call double @acos(double noundef %191) #7
  %193 = load double, ptr %23, align 8, !tbaa !9
  %194 = load double, ptr %7, align 8, !tbaa !9
  %195 = fdiv double %193, %194
  %196 = call double @acos(double noundef %195) #7
  %197 = fsub double %192, %196
  %198 = fmul double %188, %197
  %199 = fdiv double %198, 2.000000e+00
  %200 = load double, ptr %25, align 8, !tbaa !9
  %201 = fadd double %200, %199
  store double %201, ptr %25, align 8, !tbaa !9
  %202 = load double, ptr %23, align 8, !tbaa !9
  %203 = load double, ptr %27, align 8, !tbaa !9
  %204 = fmul double %202, %203
  %205 = fdiv double %204, 2.000000e+00
  %206 = load double, ptr %25, align 8, !tbaa !9
  %207 = fadd double %206, %205
  store double %207, ptr %25, align 8, !tbaa !9
  br label %215

208:                                              ; preds = %149
  %209 = load double, ptr %23, align 8, !tbaa !9
  %210 = load double, ptr %22, align 8, !tbaa !9
  %211 = fmul double %209, %210
  %212 = fdiv double %211, 2.000000e+00
  %213 = load double, ptr %25, align 8, !tbaa !9
  %214 = fadd double %213, %212
  store double %214, ptr %25, align 8, !tbaa !9
  br label %215

215:                                              ; preds = %208, %185
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  br label %216

216:                                              ; preds = %215, %134
  br label %217

217:                                              ; preds = %216, %129
  %218 = load double, ptr %25, align 8, !tbaa !9
  store double %218, ptr %5, align 8
  store i32 1, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  br label %219

219:                                              ; preds = %217, %66
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  %220 = load double, ptr %5, align 8
  ret double %220
}

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

; Function Attrs: nounwind
declare x86_fp80 @sqrtl(x86_fp80 noundef) #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3absd(double noundef) #6

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { 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 = { 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 #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}


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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4swapI2PTENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS4_ESt18is_move_assignableIS4_EEE5valueEvE4typeERS4_SD_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_Z29_triangle_circle_intersection2PTdS_S_(ptr noundef nonnull %0, double noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #5 {
  %5 = alloca double, align 8
  %6 = alloca %struct.PT, align 8
  %7 = alloca %struct.PT, align 8
  %8 = alloca double, 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
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  call void @_ZN2PTC2ERKS_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(16) %0)
  call void @_ZN2PTC2ERKS_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(16) %2)
  %13 = call noundef double @_Z5dist22PTS_(ptr noundef nonnull %6, ptr noundef nonnull %7)
  store double %13, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  call void @_ZN2PTC2ERKS_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %0)
  call void @_ZN2PTC2ERKS_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(16) %3)
  %14 = call noundef double @_Z5dist22PTS_(ptr noundef nonnull %9, ptr noundef nonnull %10)
  store double %14, ptr %8, align 8, !tbaa !5
  %15 = fcmp ogt double %13, %14
  br i1 %15, label %16, label %17

16:                                               ; preds = %4
  call void @_ZSt4swapI2PTENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS4_ESt18is_move_assignableIS4_EEE5valueEvE4typeERS4_SD_(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(16) %3)
  call void @_ZSt4swapIdENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  br label %17

17:                                               ; preds = %16, %4
  call void @_ZN2PTC2ERKS_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(16) %2)
  call void @_ZN2PTC2ERKS_(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(16) %3)
  %18 = call noundef double @_Z5dist22PTS_(ptr noundef nonnull %11, ptr noundef nonnull %12)
  %19 = load double, ptr %5, align 8, !tbaa !5
  %20 = fpext double %19 to x86_fp80
  %21 = call x86_fp80 @sqrtl(x86_fp80 noundef %20) #7
  %22 = fptrunc x86_fp80 %21 to double
  %23 = load double, ptr %8, align 8, !tbaa !5
  %24 = fpext double %23 to x86_fp80
  %25 = call x86_fp80 @sqrtl(x86_fp80 noundef %24) #7
  %26 = fptrunc x86_fp80 %25 to double
  %27 = call double @sqrt(double noundef %18) #7
  %28 = load double, ptr %8, align 8, !tbaa !5
  %29 = fsub double %28, %18
  %30 = load double, ptr %5, align 8, !tbaa !5
  %31 = fsub double %29, %30
  %32 = call noundef double @_ZSt3absd(double noundef %31)
  %33 = fmul double %27, 2.000000e+00
  %34 = fdiv double %32, %33
  %35 = load double, ptr %5, align 8, !tbaa !5
  %36 = fneg double %34
  %37 = call double @llvm.fmuladd.f64(double %36, double %34, double %35)
  %38 = fpext double %37 to x86_fp80
  %39 = call x86_fp80 @sqrtl(x86_fp80 noundef %38) #7
  %40 = fptrunc x86_fp80 %39 to double
  %41 = fcmp ugt double %26, %1
  br i1 %41, label %45, label %42

42:                                               ; preds = %17
  %43 = fmul double %27, %40
  %44 = fmul double %43, 5.000000e-01
  br label %119

45:                                               ; preds = %17
  %46 = load double, ptr %5, align 8, !tbaa !5
  %47 = fadd double %18, %46
  %48 = load double, ptr %8, align 8, !tbaa !5
  %49 = fcmp olt double %47, %48
  %50 = fmul double %1, %1
  %51 = fdiv double %40, %26
  %52 = call double @acos(double noundef %51) #7
  br i1 %49, label %53, label %81

53:                                               ; preds = %45
  %54 = fcmp ogt double %22, %1
  br i1 %54, label %55, label %61

55:                                               ; preds = %53
  %56 = fdiv double %40, %22
  %57 = call double @acos(double noundef %56) #7
  %58 = fsub double %52, %57
  %59 = fmul double %50, %58
  %60 = fmul double %59, 5.000000e-01
  br label %119

61:                                               ; preds = %53
  %62 = fdiv double %40, %1
  %63 = call double @acos(double noundef %62) #7
  %64 = fneg double %40
  %65 = fmul double %64, %40
  %66 = call double @llvm.fmuladd.f64(double %1, double %1, double %65)
  %67 = fpext double %66 to x86_fp80
  %68 = call x86_fp80 @sqrtl(x86_fp80 noundef %67) #7
  %69 = fptrunc x86_fp80 %68 to double
  %70 = insertelement <2 x double> poison, double %52, i64 0
  %71 = insertelement <2 x double> %70, double %69, i64 1
  %72 = insertelement <2 x double> poison, double %63, i64 0
  %73 = insertelement <2 x double> %72, double %34, i64 1
  %74 = fsub <2 x double> %71, %73
  %75 = insertelement <2 x double> poison, double %50, i64 0
  %76 = insertelement <2 x double> %75, double %40, i64 1
  %77 = fmul <2 x double> %76, %74
  %78 = fmul <2 x double> %77, <double 5.000000e-01, double 5.000000e-01>
  %shift = shufflevector <2 x double> %78, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %79 = fadd <2 x double> %78, %shift
  %80 = extractelement <2 x double> %79, i64 0
  br label %119

81:                                               ; preds = %45
  %82 = fcmp ogt double %40, %1
  br i1 %82, label %83, label %89

83:                                               ; preds = %81
  %84 = fdiv double %40, %22
  %85 = call double @acos(double noundef %84) #7
  %86 = fadd double %52, %85
  %87 = fmul double %50, %86
  %88 = fmul double %87, 5.000000e-01
  br label %119

89:                                               ; preds = %81
  %90 = fdiv double %40, %1
  %91 = call double @acos(double noundef %90) #7
  %92 = fsub double %52, %91
  %93 = fmul double %50, %92
  %94 = fmul double %93, 5.000000e-01
  %95 = fadd double %94, 0.000000e+00
  %96 = fneg double %40
  %97 = fmul double %96, %40
  %98 = call double @llvm.fmuladd.f64(double %1, double %1, double %97)
  %99 = fpext double %98 to x86_fp80
  %100 = call x86_fp80 @sqrtl(x86_fp80 noundef %99) #7
  %101 = fptrunc x86_fp80 %100 to double
  %102 = fmul double %40, %101
  %103 = fmul double %102, 5.000000e-01
  %104 = fadd double %95, %103
  %105 = fcmp ogt double %22, %1
  br i1 %105, label %106, label %115

106:                                              ; preds = %89
  %107 = fdiv double %40, %22
  %108 = call double @acos(double noundef %107) #7
  %109 = call double @acos(double noundef %90) #7
  %110 = fsub double %108, %109
  %111 = fmul double %50, %110
  %112 = fmul double %111, 5.000000e-01
  %113 = fadd double %104, %112
  %114 = fadd double %103, %113
  br label %119

115:                                              ; preds = %89
  %116 = fmul double %34, %40
  %117 = fmul double %116, 5.000000e-01
  %118 = fadd double %117, %104
  br label %119

119:                                              ; preds = %61, %55, %83, %115, %106, %42
  %.0 = phi double [ %44, %42 ], [ %60, %55 ], [ %80, %61 ], [ %88, %83 ], [ %114, %106 ], [ %118, %115 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  ret double %.0
}

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare x86_fp80 @sqrtl(x86_fp80 noundef) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3absd(double noundef) local_unnamed_addr #6

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { 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 = { 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 #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"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,VectorCombinePass