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

; 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.44 = type { ptr, ptr }

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK2ptmiES_(ptr dead_on_unwind noalias writable sret(%struct.pt) align 16, ptr noundef nonnull align 16 dereferenceable(32), ptr noundef byval(%struct.pt) align 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: 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 noundef i64 @_ZNKSt6vectorI2ptSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3modii(i32 noundef, i32 noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef x86_fp80 @_Z29polygonCircleIntersectionAreaRKSt6vectorI2ptSaIS0_EE6Circle(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef byval(%struct.Circle) align 16 %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca x86_fp80, align 16
  %5 = alloca %class.anon.44, align 8
  %6 = alloca x86_fp80, align 16
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %struct.pt, align 16
  %10 = alloca %struct.pt, align 16
  %11 = alloca %struct.pt, align 16
  %12 = alloca %struct.pt, align 16
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #5
  %13 = getelementptr inbounds %struct.Circle, ptr %1, i32 0, i32 1
  %14 = load x86_fp80, ptr %13, align 16, !tbaa !9
  %15 = getelementptr inbounds %struct.Circle, ptr %1, i32 0, i32 1
  %16 = load x86_fp80, ptr %15, align 16, !tbaa !9
  %17 = fmul x86_fp80 %14, %16
  %18 = fdiv x86_fp80 %17, 0xK40008000000000000000
  store x86_fp80 %18, ptr %4, align 16, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #5
  %19 = getelementptr inbounds %class.anon.44, ptr %5, i32 0, i32 0
  store ptr %1, ptr %19, align 8, !tbaa !5
  %20 = getelementptr inbounds %class.anon.44, ptr %5, i32 0, i32 1
  store ptr %4, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #5
  store x86_fp80 0xK00000000000000000000, ptr %6, align 16, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = call noundef i64 @_ZNKSt6vectorI2ptSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #5
  %23 = trunc i64 %22 to i32
  store i32 %23, ptr %7, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !14
  br label %24

24:                                               ; preds = %46, %2
  %25 = load i32, ptr %8, align 4, !tbaa !14
  %26 = load i32, ptr %7, align 4, !tbaa !14
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %49

29:                                               ; preds = %24
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = load i32, ptr %8, align 4, !tbaa !14
  %32 = sext i32 %31 to i64
  %33 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %30, i64 noundef %32) #5
  %34 = getelementptr inbounds %struct.Circle, ptr %1, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %10, ptr align 16 %34, i64 32, i1 false), !tbaa.struct !16
  call void @_ZNK2ptmiES_(ptr dead_on_unwind writable sret(%struct.pt) align 16 %9, ptr noundef nonnull align 16 dereferenceable(32) %33, ptr noundef byval(%struct.pt) align 16 %10)
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = load i32, ptr %8, align 4, !tbaa !14
  %37 = add nsw i32 %36, 1
  %38 = load i32, ptr %7, align 4, !tbaa !14
  %39 = call noundef i32 @_Z3modii(i32 noundef %37, i32 noundef %38)
  %40 = sext i32 %39 to i64
  %41 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %35, i64 noundef %40) #5
  %42 = getelementptr inbounds %struct.Circle, ptr %1, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %12, ptr align 16 %42, i64 32, i1 false), !tbaa.struct !16
  call void @_ZNK2ptmiES_(ptr dead_on_unwind writable sret(%struct.pt) align 16 %11, ptr noundef nonnull align 16 dereferenceable(32) %41, ptr noundef byval(%struct.pt) align 16 %12)
  %43 = call noundef x86_fp80 @"_ZZ29polygonCircleIntersectionAreaRKSt6vectorI2ptSaIS0_EE6CircleENK3$_0clES0_S0_"(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef byval(%struct.pt) align 16 %9, ptr noundef byval(%struct.pt) align 16 %11)
  %44 = load x86_fp80, ptr %6, align 16, !tbaa !13
  %45 = fadd x86_fp80 %44, %43
  store x86_fp80 %45, ptr %6, align 16, !tbaa !13
  br label %46

46:                                               ; preds = %29
  %47 = load i32, ptr %8, align 4, !tbaa !14
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %8, align 4, !tbaa !14
  br label %24, !llvm.loop !17

49:                                               ; preds = %28
  %50 = load x86_fp80, ptr %6, align 16, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #5
  ret x86_fp80 %50
}

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef x86_fp80 @"_ZZ29polygonCircleIntersectionAreaRKSt6vectorI2ptSaIS0_EE6CircleENK3$_0clES0_S0_"(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef byval(%struct.pt) align 16, ptr noundef byval(%struct.pt) align 16) #4 align 2

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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, !12, i64 32}
!10 = !{!"_ZTS6Circle", !11, i64 0, !12, i64 32}
!11 = !{!"_ZTS2pt", !12, i64 0, !12, i64 16}
!12 = !{!"long double", !7, i64 0}
!13 = !{!12, !12, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{i64 0, i64 16, !13, i64 16, i64 16, !13}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}


; 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.44 = type { ptr, ptr }

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK2ptmiES_(ptr dead_on_unwind noalias writable sret(%struct.pt) align 16, ptr noundef nonnull align 16 dereferenceable(32), ptr noundef byval(%struct.pt) align 16) local_unnamed_addr #0 align 2

; 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 willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3modii(i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef x86_fp80 @_Z29polygonCircleIntersectionAreaRKSt6vectorI2ptSaIS0_EE6Circle(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef byval(%struct.Circle) align 16 %1) local_unnamed_addr #0 {
  %3 = alloca x86_fp80, align 16
  %4 = alloca %class.anon.44, align 8
  %5 = alloca %struct.pt, align 16
  %6 = alloca %struct.pt, align 16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #4
  %7 = getelementptr inbounds i8, ptr %1, i64 32
  %8 = load x86_fp80, ptr %7, align 16, !tbaa !5
  %9 = fmul x86_fp80 %8, %8
  %10 = fmul x86_fp80 %9, 0xK3FFE8000000000000000
  store x86_fp80 %10, ptr %3, align 16, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #4
  store ptr %1, ptr %4, align 8, !tbaa !12
  %11 = getelementptr inbounds i8, ptr %4, i64 8
  store ptr %3, ptr %11, align 8, !tbaa !12
  %12 = call noundef i64 @_ZNKSt6vectorI2ptSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  %13 = trunc i64 %12 to i32
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %2
  %wide.trip.count = and i64 %12, 2147483647
  br label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %2
  %.010.lcssa = phi x86_fp80 [ 0xK00000000000000000000, %2 ], [ %21, %.lr.ph ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #4
  ret x86_fp80 %.010.lcssa

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %.01012 = phi x86_fp80 [ 0xK00000000000000000000, %.lr.ph.preheader ], [ %21, %.lr.ph ]
  %15 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv) #4
  call void @_ZNK2ptmiES_(ptr dead_on_unwind nonnull writable sret(%struct.pt) align 16 %5, ptr noundef nonnull align 16 dereferenceable(32) %15, ptr noundef nonnull byval(%struct.pt) align 16 %1)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %16 = trunc nuw nsw i64 %indvars.iv.next to i32
  %17 = call noundef i32 @_Z3modii(i32 noundef %16, i32 noundef %13)
  %18 = sext i32 %17 to i64
  %19 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %18) #4
  call void @_ZNK2ptmiES_(ptr dead_on_unwind nonnull writable sret(%struct.pt) align 16 %6, ptr noundef nonnull align 16 dereferenceable(32) %19, ptr noundef nonnull byval(%struct.pt) align 16 %1)
  %20 = call noundef x86_fp80 @"_ZZ29polygonCircleIntersectionAreaRKSt6vectorI2ptSaIS0_EE6CircleENK3$_0clES0_S0_"(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull byval(%struct.pt) align 16 %5, ptr noundef nonnull byval(%struct.pt) align 16 %6)
  %21 = fadd x86_fp80 %.01012, %20
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !14
}

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef x86_fp80 @"_ZZ29polygonCircleIntersectionAreaRKSt6vectorI2ptSaIS0_EE6CircleENK3$_0clES0_S0_"(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef byval(%struct.pt) align 16, ptr noundef byval(%struct.pt) align 16) local_unnamed_addr #3 align 2

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { 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, !8, i64 32}
!6 = !{!"_ZTS6Circle", !7, i64 0, !8, i64 32}
!7 = !{!"_ZTS2pt", !8, i64 0, !8, i64 16}
!8 = !{!"long double", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!8, !8, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !9, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,SROAPass,SimplifyCFGPass