; 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 }
%class.anon.18 = type { ptr, ptr, ptr }
%class.anon.19 = 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4perp2pt(ptr dead_on_unwind noalias writable sret(%struct.pt) align 16, ptr noundef byval(%struct.pt) align 16) #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 uwtable
define dso_local noundef i32 @_Z13extremeVertexRKSt6vectorI2ptSaIS0_EES0_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef byval(%struct.pt) align 16 %1) #2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %struct.pt, align 16
  %9 = alloca %struct.pt, align 16
  %10 = alloca %class.anon.18, align 8
  %11 = alloca %class.anon.19, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = call noundef i64 @_ZNKSt6vectorI2ptSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  %18 = trunc i64 %17 to i32
  store i32 %18, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %19 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %19, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %9, ptr align 16 %1, i64 32, i1 false), !tbaa.struct !11
  call void @_Z4perp2pt(ptr dead_on_unwind writable sret(%struct.pt) align 16 %8, ptr noundef byval(%struct.pt) align 16 %9)
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #5
  %20 = getelementptr inbounds %class.anon.18, ptr %10, i32 0, i32 0
  store ptr %8, ptr %20, align 8, !tbaa !5
  %21 = getelementptr inbounds %class.anon.18, ptr %10, i32 0, i32 1
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %22, ptr %21, align 8, !tbaa !5
  %23 = getelementptr inbounds %class.anon.18, ptr %10, i32 0, i32 2
  store ptr %5, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #5
  %24 = getelementptr inbounds %class.anon.19, ptr %11, i32 0, i32 0
  store ptr %10, ptr %24, align 8, !tbaa !5
  %25 = getelementptr inbounds %class.anon.19, ptr %11, i32 0, i32 1
  store ptr %5, ptr %25, align 8, !tbaa !5
  %26 = call noundef zeroext i1 @"_ZZ13extremeVertexRKSt6vectorI2ptSaIS0_EES0_ENK3$_1clEi"(ptr noundef nonnull align 8 dereferenceable(16) %11, i32 noundef 0)
  br i1 %26, label %27, label %28

27:                                               ; preds = %2
  store i32 0, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %77

28:                                               ; preds = %2
  br label %29

29:                                               ; preds = %74, %28
  %30 = load i32, ptr %6, align 4, !tbaa !9
  %31 = add nsw i32 %30, 1
  %32 = load i32, ptr %7, align 4, !tbaa !9
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %34, label %75

34:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %35 = load i32, ptr %6, align 4, !tbaa !9
  %36 = load i32, ptr %7, align 4, !tbaa !9
  %37 = load i32, ptr %6, align 4, !tbaa !9
  %38 = sub nsw i32 %36, %37
  %39 = sdiv i32 %38, 2
  %40 = add nsw i32 %35, %39
  store i32 %40, ptr %13, align 4, !tbaa !9
  %41 = load i32, ptr %13, align 4, !tbaa !9
  %42 = call noundef zeroext i1 @"_ZZ13extremeVertexRKSt6vectorI2ptSaIS0_EES0_ENK3$_1clEi"(ptr noundef nonnull align 8 dereferenceable(16) %11, i32 noundef %41)
  br i1 %42, label %43, label %45

43:                                               ; preds = %34
  %44 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %44, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %72

45:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %46 = load i32, ptr %6, align 4, !tbaa !9
  %47 = add nsw i32 %46, 1
  %48 = load i32, ptr %6, align 4, !tbaa !9
  %49 = call noundef i32 @"_ZZ13extremeVertexRKSt6vectorI2ptSaIS0_EES0_ENK3$_0clEii"(ptr noundef nonnull align 8 dereferenceable(24) %10, i32 noundef %47, i32 noundef %48)
  store i32 %49, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %50 = load i32, ptr %13, align 4, !tbaa !9
  %51 = add nsw i32 %50, 1
  %52 = load i32, ptr %13, align 4, !tbaa !9
  %53 = call noundef i32 @"_ZZ13extremeVertexRKSt6vectorI2ptSaIS0_EES0_ENK3$_0clEii"(ptr noundef nonnull align 8 dereferenceable(24) %10, i32 noundef %51, i32 noundef %52)
  store i32 %53, ptr %15, align 4, !tbaa !9
  %54 = load i32, ptr %13, align 4, !tbaa !9
  %55 = load i32, ptr %14, align 4, !tbaa !9
  %56 = load i32, ptr %15, align 4, !tbaa !9
  %57 = icmp slt i32 %55, %56
  br i1 %57, label %68, label %58

58:                                               ; preds = %45
  %59 = load i32, ptr %14, align 4, !tbaa !9
  %60 = load i32, ptr %15, align 4, !tbaa !9
  %61 = icmp eq i32 %59, %60
  br i1 %61, label %62, label %69

62:                                               ; preds = %58
  %63 = load i32, ptr %14, align 4, !tbaa !9
  %64 = load i32, ptr %6, align 4, !tbaa !9
  %65 = load i32, ptr %13, align 4, !tbaa !9
  %66 = call noundef i32 @"_ZZ13extremeVertexRKSt6vectorI2ptSaIS0_EES0_ENK3$_0clEii"(ptr noundef nonnull align 8 dereferenceable(24) %10, i32 noundef %64, i32 noundef %65)
  %67 = icmp eq i32 %63, %66
  br i1 %67, label %68, label %69

68:                                               ; preds = %62, %45
  br label %70

69:                                               ; preds = %62, %58
  br label %70

70:                                               ; preds = %69, %68
  %71 = phi ptr [ %7, %68 ], [ %6, %69 ]
  store i32 %54, ptr %71, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  store i32 0, ptr %12, align 4
  br label %72

72:                                               ; preds = %70, %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  %73 = load i32, ptr %12, align 4
  switch i32 %73, label %77 [
    i32 0, label %74
  ]

74:                                               ; preds = %72
  br label %29, !llvm.loop !14

75:                                               ; preds = %29
  %76 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %76, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %77

77:                                               ; preds = %75, %72, %27
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  %78 = load i32, ptr %3, align 4
  ret i32 %78
}

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef zeroext i1 @"_ZZ13extremeVertexRKSt6vectorI2ptSaIS0_EES0_ENK3$_1clEi"(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef i32 @"_ZZ13extremeVertexRKSt6vectorI2ptSaIS0_EES0_ENK3$_0clEii"(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef) #4 align 2

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync 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 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{i64 0, i64 16, !12, i64 16, i64 16, !12}
!12 = !{!13, !13, i64 0}
!13 = !{!"long double", !7, i64 0}
!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 }
%class.anon.18 = type { ptr, ptr, ptr }
%class.anon.19 = type { ptr, ptr }

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4perp2pt(ptr dead_on_unwind noalias writable sret(%struct.pt) align 16, ptr noundef byval(%struct.pt) align 16) local_unnamed_addr #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 uwtable
define dso_local noundef i32 @_Z13extremeVertexRKSt6vectorI2ptSaIS0_EES0_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr nocapture noundef readonly byval(%struct.pt) align 16 %1) local_unnamed_addr #1 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %struct.pt, align 16
  %7 = alloca %class.anon.18, align 8
  %8 = alloca %class.anon.19, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  %9 = tail call noundef i64 @_ZNKSt6vectorI2ptSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  %10 = trunc i64 %9 to i32
  store i32 %10, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4)
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5)
  store i32 %10, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #4
  call void @_Z4perp2pt(ptr dead_on_unwind nonnull writable sret(%struct.pt) align 16 %6, ptr noundef nonnull byval(%struct.pt) align 16 %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #4
  store ptr %6, ptr %7, align 8, !tbaa !9
  %11 = getelementptr inbounds i8, ptr %7, i64 8
  store ptr %0, ptr %11, align 8, !tbaa !9
  %12 = getelementptr inbounds i8, ptr %7, i64 16
  store ptr %3, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #4
  store ptr %7, ptr %8, align 8, !tbaa !9
  %13 = getelementptr inbounds i8, ptr %8, i64 8
  store ptr %3, ptr %13, align 8, !tbaa !9
  %14 = call noundef zeroext i1 @"_ZZ13extremeVertexRKSt6vectorI2ptSaIS0_EES0_ENK3$_1clEi"(ptr noundef nonnull align 8 dereferenceable(16) %8, i32 noundef 0)
  %15 = icmp slt i32 %10, 2
  %or.cond.not = or i1 %15, %14
  br i1 %or.cond.not, label %.thread, label %.lr.ph

.lr.ph:                                           ; preds = %2, %32
  %.0..0.30 = phi i32 [ %.0..0..0..0., %32 ], [ %10, %2 ]
  %16 = phi i32 [ %34, %32 ], [ 1, %2 ]
  %.0..0.1329 = phi i32 [ %.0..0..0..0.13, %32 ], [ 0, %2 ]
  %17 = sub nsw i32 %.0..0.30, %.0..0.1329
  %18 = sdiv i32 %17, 2
  %19 = add nsw i32 %18, %.0..0.1329
  %20 = call noundef zeroext i1 @"_ZZ13extremeVertexRKSt6vectorI2ptSaIS0_EES0_ENK3$_1clEi"(ptr noundef nonnull align 8 dereferenceable(16) %8, i32 noundef %19)
  br i1 %20, label %.thread, label %21

21:                                               ; preds = %.lr.ph
  %22 = call noundef i32 @"_ZZ13extremeVertexRKSt6vectorI2ptSaIS0_EES0_ENK3$_0clEii"(ptr noundef nonnull align 8 dereferenceable(24) %7, i32 noundef %16, i32 noundef %.0..0.1329)
  %23 = add nsw i32 %19, 1
  %24 = call noundef i32 @"_ZZ13extremeVertexRKSt6vectorI2ptSaIS0_EES0_ENK3$_0clEii"(ptr noundef nonnull align 8 dereferenceable(24) %7, i32 noundef %23, i32 noundef %19)
  %25 = icmp slt i32 %22, %24
  br i1 %25, label %32, label %26

26:                                               ; preds = %21
  %27 = icmp eq i32 %22, %24
  br i1 %27, label %28, label %31

28:                                               ; preds = %26
  %29 = call noundef i32 @"_ZZ13extremeVertexRKSt6vectorI2ptSaIS0_EES0_ENK3$_0clEii"(ptr noundef nonnull align 8 dereferenceable(24) %7, i32 noundef %.0..0.1329, i32 noundef %19)
  %30 = icmp eq i32 %22, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %28, %26
  br label %32

32:                                               ; preds = %31, %28, %21
  %33 = phi ptr [ %4, %31 ], [ %5, %28 ], [ %5, %21 ]
  store i32 %19, ptr %33, align 4, !tbaa !5
  %.0..0..0..0.13 = load i32, ptr %4, align 4, !tbaa !5
  %34 = add nsw i32 %.0..0..0..0.13, 1
  %.0..0..0..0. = load i32, ptr %5, align 4, !tbaa !5
  %35 = icmp slt i32 %34, %.0..0..0..0.
  br i1 %35, label %.lr.ph, label %.thread

.thread:                                          ; preds = %32, %.lr.ph, %2
  %.2 = phi i32 [ 0, %2 ], [ %.0..0..0..0.13, %32 ], [ %19, %.lr.ph ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  ret i32 %.2
}

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef zeroext i1 @"_ZZ13extremeVertexRKSt6vectorI2ptSaIS0_EES0_ENK3$_1clEi"(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef i32 @"_ZZ13extremeVertexRKSt6vectorI2ptSaIS0_EES0_ENK3$_0clEii"(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef) local_unnamed_addr #3 align 2

attributes #0 = { mustprogress nocallback nofree nosync 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 = { 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, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass