; LLVM IR from wesley-a-leung/Resources :: Tests/C++/geometry/2d/ConvexPolygonFuzzTest.ll (Z28circleCircleIntersectionArea6CircleS_)

; 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 { x86_fp80, x86_fp80 }
%struct.Circle = type { %struct.pt, x86_fp80 }
%class.anon = type { ptr }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z2ltee(x86_fp80 noundef, x86_fp80 noundef) #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef x86_fp80 @_Z4dist2ptS_(ptr noundef byval(%struct.pt) align 16, ptr noundef byval(%struct.pt) align 16) #2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef x86_fp80 @_ZSt4acose(x86_fp80 noundef) #4

; Function Attrs: mustprogress uwtable
define dso_local noundef x86_fp80 @_Z28circleCircleIntersectionArea6CircleS_(ptr noundef byval(%struct.Circle) align 16 %0, ptr noundef byval(%struct.Circle) align 16 %1) #2 {
  %3 = alloca x86_fp80, align 16
  %4 = alloca x86_fp80, align 16
  %5 = alloca %struct.pt, align 16
  %6 = alloca %struct.pt, align 16
  %7 = alloca i32, align 4
  %8 = alloca %class.anon, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #5
  %9 = getelementptr inbounds %struct.Circle, ptr %0, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %5, ptr align 16 %9, i64 32, i1 false), !tbaa.struct !5
  %10 = getelementptr inbounds %struct.Circle, ptr %1, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %6, ptr align 16 %10, i64 32, i1 false), !tbaa.struct !5
  %11 = call noundef x86_fp80 @_Z4dist2ptS_(ptr noundef byval(%struct.pt) align 16 %5, ptr noundef byval(%struct.pt) align 16 %6)
  store x86_fp80 %11, ptr %4, align 16, !tbaa !6
  %12 = load x86_fp80, ptr %4, align 16, !tbaa !6
  %13 = getelementptr inbounds %struct.Circle, ptr %0, i32 0, i32 1
  %14 = load x86_fp80, ptr %13, align 16, !tbaa !10
  %15 = getelementptr inbounds %struct.Circle, ptr %1, i32 0, i32 1
  %16 = load x86_fp80, ptr %15, align 16, !tbaa !10
  %17 = fadd x86_fp80 %14, %16
  %18 = call noundef zeroext i1 @_Z2ltee(x86_fp80 noundef %12, x86_fp80 noundef %17)
  br i1 %18, label %20, label %19

19:                                               ; preds = %2
  store x86_fp80 0xK00000000000000000000, ptr %3, align 16
  store i32 1, ptr %7, align 4
  br label %65

20:                                               ; preds = %2
  %21 = getelementptr inbounds %struct.Circle, ptr %1, i32 0, i32 1
  %22 = load x86_fp80, ptr %21, align 16, !tbaa !10
  %23 = load x86_fp80, ptr %4, align 16, !tbaa !6
  %24 = getelementptr inbounds %struct.Circle, ptr %0, i32 0, i32 1
  %25 = load x86_fp80, ptr %24, align 16, !tbaa !10
  %26 = fadd x86_fp80 %23, %25
  %27 = call noundef zeroext i1 @_Z2ltee(x86_fp80 noundef %22, x86_fp80 noundef %26)
  br i1 %27, label %36, label %28

28:                                               ; preds = %20
  %29 = call noundef x86_fp80 @_ZSt4acose(x86_fp80 noundef 0xKBFFF8000000000000000)
  %30 = getelementptr inbounds %struct.Circle, ptr %0, i32 0, i32 1
  %31 = load x86_fp80, ptr %30, align 16, !tbaa !10
  %32 = fmul x86_fp80 %29, %31
  %33 = getelementptr inbounds %struct.Circle, ptr %0, i32 0, i32 1
  %34 = load x86_fp80, ptr %33, align 16, !tbaa !10
  %35 = fmul x86_fp80 %32, %34
  store x86_fp80 %35, ptr %3, align 16
  store i32 1, ptr %7, align 4
  br label %65

36:                                               ; preds = %20
  %37 = getelementptr inbounds %struct.Circle, ptr %0, i32 0, i32 1
  %38 = load x86_fp80, ptr %37, align 16, !tbaa !10
  %39 = load x86_fp80, ptr %4, align 16, !tbaa !6
  %40 = getelementptr inbounds %struct.Circle, ptr %1, i32 0, i32 1
  %41 = load x86_fp80, ptr %40, align 16, !tbaa !10
  %42 = fadd x86_fp80 %39, %41
  %43 = call noundef zeroext i1 @_Z2ltee(x86_fp80 noundef %38, x86_fp80 noundef %42)
  br i1 %43, label %52, label %44

44:                                               ; preds = %36
  %45 = call noundef x86_fp80 @_ZSt4acose(x86_fp80 noundef 0xKBFFF8000000000000000)
  %46 = getelementptr inbounds %struct.Circle, ptr %1, i32 0, i32 1
  %47 = load x86_fp80, ptr %46, align 16, !tbaa !10
  %48 = fmul x86_fp80 %45, %47
  %49 = getelementptr inbounds %struct.Circle, ptr %1, i32 0, i32 1
  %50 = load x86_fp80, ptr %49, align 16, !tbaa !10
  %51 = fmul x86_fp80 %48, %50
  store x86_fp80 %51, ptr %3, align 16
  store i32 1, ptr %7, align 4
  br label %65

52:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %53 = getelementptr inbounds %class.anon, ptr %8, i32 0, i32 0
  store ptr %4, ptr %53, align 8, !tbaa !13
  %54 = getelementptr inbounds %struct.Circle, ptr %0, i32 0, i32 1
  %55 = load x86_fp80, ptr %54, align 16, !tbaa !10
  %56 = getelementptr inbounds %struct.Circle, ptr %1, i32 0, i32 1
  %57 = load x86_fp80, ptr %56, align 16, !tbaa !10
  %58 = call noundef x86_fp80 @"_ZZ28circleCircleIntersectionArea6CircleS_ENK3$_0clEee"(ptr noundef nonnull align 8 dereferenceable(8) %8, x86_fp80 noundef %55, x86_fp80 noundef %57)
  %59 = getelementptr inbounds %struct.Circle, ptr %1, i32 0, i32 1
  %60 = load x86_fp80, ptr %59, align 16, !tbaa !10
  %61 = getelementptr inbounds %struct.Circle, ptr %0, i32 0, i32 1
  %62 = load x86_fp80, ptr %61, align 16, !tbaa !10
  %63 = call noundef x86_fp80 @"_ZZ28circleCircleIntersectionArea6CircleS_ENK3$_0clEee"(ptr noundef nonnull align 8 dereferenceable(8) %8, x86_fp80 noundef %60, x86_fp80 noundef %62)
  %64 = fadd x86_fp80 %58, %63
  store x86_fp80 %64, ptr %3, align 16
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %65

65:                                               ; preds = %52, %44, %28, %19
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #5
  %66 = load x86_fp80, ptr %3, align 16
  ret x86_fp80 %66
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef x86_fp80 @"_ZZ28circleCircleIntersectionArea6CircleS_ENK3$_0clEee"(ptr noundef nonnull align 8 dereferenceable(8), x86_fp80 noundef, x86_fp80 noundef) #4 align 2

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{i64 0, i64 16, !6, i64 16, i64 16, !6}
!6 = !{!7, !7, i64 0}
!7 = !{!"long double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !7, i64 32}
!11 = !{!"_ZTS6Circle", !12, i64 0, !7, i64 32}
!12 = !{!"_ZTS2pt", !7, i64 0, !7, i64 16}
!13 = !{!14, !14, i64 0}
!14 = !{!"any 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"

%struct.pt = type { x86_fp80, x86_fp80 }
%struct.Circle = type { %struct.pt, x86_fp80 }
%class.anon = type { ptr }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z2ltee(x86_fp80 noundef, x86_fp80 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef x86_fp80 @_Z4dist2ptS_(ptr noundef byval(%struct.pt) align 16, ptr noundef byval(%struct.pt) align 16) local_unnamed_addr #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef x86_fp80 @_ZSt4acose(x86_fp80 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local noundef x86_fp80 @_Z28circleCircleIntersectionArea6CircleS_(ptr nocapture noundef readonly byval(%struct.Circle) align 16 %0, ptr nocapture noundef readonly byval(%struct.Circle) align 16 %1) local_unnamed_addr #1 {
  %3 = alloca x86_fp80, align 16
  %4 = alloca %class.anon, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #4
  %5 = tail call noundef x86_fp80 @_Z4dist2ptS_(ptr noundef nonnull byval(%struct.pt) align 16 %0, ptr noundef nonnull byval(%struct.pt) align 16 %1)
  store x86_fp80 %5, ptr %3, align 16, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 32
  %7 = load x86_fp80, ptr %6, align 16, !tbaa !9
  %8 = getelementptr inbounds i8, ptr %1, i64 32
  %9 = load x86_fp80, ptr %8, align 16, !tbaa !9
  %10 = fadd x86_fp80 %7, %9
  %11 = tail call noundef zeroext i1 @_Z2ltee(x86_fp80 noundef %5, x86_fp80 noundef %10)
  br i1 %11, label %12, label %30

12:                                               ; preds = %2
  %13 = fadd x86_fp80 %7, %5
  %14 = tail call noundef zeroext i1 @_Z2ltee(x86_fp80 noundef %9, x86_fp80 noundef %13)
  br i1 %14, label %19, label %15

15:                                               ; preds = %12
  %16 = tail call noundef x86_fp80 @_ZSt4acose(x86_fp80 noundef 0xKBFFF8000000000000000)
  %17 = fmul x86_fp80 %7, %16
  %18 = fmul x86_fp80 %7, %17
  br label %30

19:                                               ; preds = %12
  %20 = fadd x86_fp80 %9, %5
  %21 = tail call noundef zeroext i1 @_Z2ltee(x86_fp80 noundef %7, x86_fp80 noundef %20)
  br i1 %21, label %26, label %22

22:                                               ; preds = %19
  %23 = tail call noundef x86_fp80 @_ZSt4acose(x86_fp80 noundef 0xKBFFF8000000000000000)
  %24 = fmul x86_fp80 %9, %23
  %25 = fmul x86_fp80 %9, %24
  br label %30

26:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  store ptr %3, ptr %4, align 8, !tbaa !12
  %27 = call noundef x86_fp80 @"_ZZ28circleCircleIntersectionArea6CircleS_ENK3$_0clEee"(ptr noundef nonnull align 8 dereferenceable(8) %4, x86_fp80 noundef %7, x86_fp80 noundef %9)
  %28 = call noundef x86_fp80 @"_ZZ28circleCircleIntersectionArea6CircleS_ENK3$_0clEee"(ptr noundef nonnull align 8 dereferenceable(8) %4, x86_fp80 noundef %9, x86_fp80 noundef %7)
  %29 = fadd x86_fp80 %27, %28
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  br label %30

30:                                               ; preds = %2, %26, %22, %15
  %.0 = phi x86_fp80 [ %29, %26 ], [ %25, %22 ], [ %18, %15 ], [ 0xK00000000000000000000, %2 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #4
  ret x86_fp80 %.0
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef x86_fp80 @"_ZZ28circleCircleIntersectionArea6CircleS_ENK3$_0clEee"(ptr noundef nonnull align 8 dereferenceable(8), x86_fp80 noundef, x86_fp80 noundef) local_unnamed_addr #3 align 2

attributes #0 = { 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 #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 = { 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 #4 = { 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 = !{!"long double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 32}
!10 = !{!"_ZTS6Circle", !11, i64 0, !6, i64 32}
!11 = !{!"_ZTS2pt", !6, i64 0, !6, i64 16}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !7, i64 0}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass