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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2ptC2Eee(ptr noundef nonnull align 16 dereferenceable(32), x86_fp80 noundef, x86_fp80 noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef x86_fp80 @_Z5cross2ptS_(ptr noundef byval(%struct.pt) align 16, ptr noundef byval(%struct.pt) align 16) #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 void @_Zmle2pt(ptr dead_on_unwind noalias writable sret(%struct.pt) align 16, x86_fp80 noundef, 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: mustprogress uwtable
declare dso_local void @_ZNK2ptplES_(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) #2 align 2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z11getCentroidRKSt6vectorI2ptSaIS0_EE(ptr dead_on_unwind noalias writable sret(%struct.pt) align 16 %0, ptr noundef nonnull align 8 dereferenceable(24) %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca x86_fp80, align 16
  %5 = alloca %struct.pt, align 16
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca x86_fp80, align 16
  %9 = alloca %struct.pt, align 16
  %10 = alloca %struct.pt, align 16
  %11 = alloca %struct.pt, align 16
  %12 = alloca %struct.pt, align 16
  %13 = alloca %struct.pt, align 16
  %14 = alloca %struct.pt, align 16
  store ptr %1, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #4
  store x86_fp80 0xK00000000000000000000, ptr %4, align 16, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #4
  call void @_ZN2ptC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %5, x86_fp80 noundef 0xK00000000000000000000, x86_fp80 noundef 0xK00000000000000000000)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = call noundef i64 @_ZNKSt6vectorI2ptSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #4
  %17 = trunc i64 %16 to i32
  store i32 %17, ptr %6, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !11
  br label %18

18:                                               ; preds = %52, %2
  %19 = load i32, ptr %7, align 4, !tbaa !11
  %20 = load i32, ptr %6, align 4, !tbaa !11
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %23, label %22

22:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %55

23:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #4
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = load i32, ptr %7, align 4, !tbaa !11
  %26 = sext i32 %25 to i64
  %27 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef %26) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %9, ptr align 16 %27, i64 32, i1 false), !tbaa.struct !13
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = load i32, ptr %7, align 4, !tbaa !11
  %30 = add nsw i32 %29, 1
  %31 = load i32, ptr %6, align 4, !tbaa !11
  %32 = call noundef i32 @_Z3modii(i32 noundef %30, i32 noundef %31)
  %33 = sext i32 %32 to i64
  %34 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %28, i64 noundef %33) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %10, ptr align 16 %34, i64 32, i1 false), !tbaa.struct !13
  %35 = call noundef x86_fp80 @_Z5cross2ptS_(ptr noundef byval(%struct.pt) align 16 %9, ptr noundef byval(%struct.pt) align 16 %10)
  store x86_fp80 %35, ptr %8, align 16, !tbaa !9
  %36 = load x86_fp80, ptr %8, align 16, !tbaa !9
  %37 = load x86_fp80, ptr %4, align 16, !tbaa !9
  %38 = fadd x86_fp80 %37, %36
  store x86_fp80 %38, ptr %4, align 16, !tbaa !9
  %39 = load x86_fp80, ptr %8, align 16, !tbaa !9
  %40 = load ptr, ptr %3, align 8, !tbaa !5
  %41 = load i32, ptr %7, align 4, !tbaa !11
  %42 = sext i32 %41 to i64
  %43 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %40, i64 noundef %42) #4
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  %45 = load i32, ptr %7, align 4, !tbaa !11
  %46 = add nsw i32 %45, 1
  %47 = load i32, ptr %6, align 4, !tbaa !11
  %48 = call noundef i32 @_Z3modii(i32 noundef %46, i32 noundef %47)
  %49 = sext i32 %48 to i64
  %50 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %44, i64 noundef %49) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %13, ptr align 16 %50, i64 32, i1 false), !tbaa.struct !13
  call void @_ZNK2ptplES_(ptr dead_on_unwind writable sret(%struct.pt) align 16 %12, ptr noundef nonnull align 16 dereferenceable(32) %43, ptr noundef byval(%struct.pt) align 16 %13)
  call void @_Zmle2pt(ptr dead_on_unwind writable sret(%struct.pt) align 16 %11, x86_fp80 noundef %39, ptr noundef byval(%struct.pt) align 16 %12)
  %51 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZN2ptpLES_(ptr noundef nonnull align 16 dereferenceable(32) %5, ptr noundef byval(%struct.pt) align 16 %11)
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #4
  br label %52

52:                                               ; preds = %23
  %53 = load i32, ptr %7, align 4, !tbaa !11
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %7, align 4, !tbaa !11
  br label %18, !llvm.loop !14

55:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #4
  %56 = load x86_fp80, ptr %4, align 16, !tbaa !9
  call void @_ZNK2ptdvEe(ptr dead_on_unwind writable sret(%struct.pt) align 16 %14, ptr noundef nonnull align 16 dereferenceable(32) %5, x86_fp80 noundef %56)
  call void @_ZNK2ptdvEe(ptr dead_on_unwind writable sret(%struct.pt) align 16 %0, ptr noundef nonnull align 16 dereferenceable(32) %14, x86_fp80 noundef 0xK4000C000000000000000)
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #4
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 16 dereferenceable(32) ptr @_ZN2ptpLES_(ptr noundef nonnull align 16 dereferenceable(32), ptr noundef byval(%struct.pt) align 16) #2 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 = { 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 = !{!"long double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{i64 0, i64 16, !9, i64 16, i64 16, !9}
!14 = distinct !{!14, !15}
!15 = !{!"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 }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2ptC2Eee(ptr noundef nonnull align 16 dereferenceable(32), x86_fp80 noundef, x86_fp80 noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef x86_fp80 @_Z5cross2ptS_(ptr noundef byval(%struct.pt) align 16, ptr noundef byval(%struct.pt) align 16) local_unnamed_addr #0

; Function Attrs: mustprogress 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 void @_Zmle2pt(ptr dead_on_unwind noalias writable sret(%struct.pt) align 16, x86_fp80 noundef, ptr noundef byval(%struct.pt) align 16) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK2ptplES_(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 #2 align 2

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

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

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

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

; 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 #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z11getCentroidRKSt6vectorI2ptSaIS0_EE(ptr dead_on_unwind noalias writable sret(%struct.pt) align 16 %0, ptr noundef nonnull align 8 dereferenceable(24) %1) local_unnamed_addr #2 {
  %3 = alloca %struct.pt, align 16
  %4 = alloca %struct.pt, align 16
  %5 = alloca %struct.pt, align 16
  %6 = alloca %struct.pt, align 16
  %7 = alloca %struct.pt, align 16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #4
  call void @_ZN2ptC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %3, x86_fp80 noundef 0xK00000000000000000000, x86_fp80 noundef 0xK00000000000000000000)
  %8 = call noundef i64 @_ZNKSt6vectorI2ptSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #4
  %9 = trunc i64 %8 to i32
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph.preheader, label %._crit_edge

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

._crit_edge:                                      ; preds = %.lr.ph, %2
  %.0.lcssa = phi x86_fp80 [ 0xK00000000000000000000, %2 ], [ %17, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #4
  call void @_ZNK2ptdvEe(ptr dead_on_unwind nonnull writable sret(%struct.pt) align 16 %7, ptr noundef nonnull align 16 dereferenceable(32) %3, x86_fp80 noundef %.0.lcssa)
  call void @_ZNK2ptdvEe(ptr dead_on_unwind writable sret(%struct.pt) align 16 %0, ptr noundef nonnull align 16 dereferenceable(32) %7, x86_fp80 noundef 0xK4000C000000000000000)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #4
  ret void

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %.020 = phi x86_fp80 [ 0xK00000000000000000000, %.lr.ph.preheader ], [ %17, %.lr.ph ]
  %11 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv) #4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %4, ptr noundef nonnull align 16 dereferenceable(32) %11, i64 32, i1 false), !tbaa.struct !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %12 = trunc nuw nsw i64 %indvars.iv.next to i32
  %13 = call noundef i32 @_Z3modii(i32 noundef %12, i32 noundef %9)
  %14 = sext i32 %13 to i64
  %15 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %14) #4
  %16 = call noundef x86_fp80 @_Z5cross2ptS_(ptr noundef nonnull byval(%struct.pt) align 16 %4, ptr noundef nonnull byval(%struct.pt) align 16 %15)
  %17 = fadd x86_fp80 %.020, %16
  %18 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv) #4
  %19 = call noundef i32 @_Z3modii(i32 noundef %12, i32 noundef %9)
  %20 = sext i32 %19 to i64
  %21 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %20) #4
  call void @_ZNK2ptplES_(ptr dead_on_unwind nonnull writable sret(%struct.pt) align 16 %6, ptr noundef nonnull align 16 dereferenceable(32) %18, ptr noundef nonnull byval(%struct.pt) align 16 %21)
  call void @_Zmle2pt(ptr dead_on_unwind nonnull writable sret(%struct.pt) align 16 %5, x86_fp80 noundef %16, ptr noundef nonnull byval(%struct.pt) align 16 %6)
  %22 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZN2ptpLES_(ptr noundef nonnull align 16 dereferenceable(32) %3, ptr noundef nonnull byval(%struct.pt) align 16 %5)
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !10
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 16 dereferenceable(32) ptr @_ZN2ptpLES_(ptr noundef nonnull align 16 dereferenceable(32), ptr noundef byval(%struct.pt) align 16) local_unnamed_addr #2 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 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{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 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}


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