; LLVM IR from wesley-a-leung/Resources :: Tests/C++/geometry/2d/ConvexPolygonFuzzTest.ll (Z12isCcwPolygonRKSt6vectorI2ptSaIS0_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 }
%"class.__gnu_cxx::__normal_iterator.0" = type { 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 noundef i32 @_Z3ccw2ptS_S_(ptr noundef byval(%struct.pt) align 16, ptr noundef byval(%struct.pt) align 16, ptr noundef byval(%struct.pt) align 16) #1

; 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 i32 @_Z12isCcwPolygonRKSt6vectorI2ptSaIS0_EE(ptr noundef nonnull align 8 dereferenceable(24) %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.__gnu_cxx::__normal_iterator.0", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator.0", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator.0", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator.0", align 8
  %9 = alloca %struct.pt, align 16
  %10 = alloca %struct.pt, align 16
  %11 = alloca %struct.pt, align 16
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %12 = load ptr, ptr %2, align 8, !tbaa !5
  %13 = call noundef i64 @_ZNKSt6vectorI2ptSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #6
  %14 = trunc i64 %13 to i32
  store i32 %14, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  %16 = call ptr @_ZNKSt6vectorI2ptSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #6
  %17 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.0", ptr %6, i32 0, i32 0
  store ptr %16, ptr %17, align 8
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = call ptr @_ZNKSt6vectorI2ptSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #6
  %20 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.0", ptr %7, i32 0, i32 0
  store ptr %19, ptr %20, align 8
  %21 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.0", ptr %6, i32 0, i32 0
  %22 = load ptr, ptr %21, align 8
  %23 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.0", ptr %7, i32 0, i32 0
  %24 = load ptr, ptr %23, align 8
  %25 = call ptr @_ZSt11min_elementIN9__gnu_cxx17__normal_iteratorIPK2ptSt6vectorIS2_SaIS2_EEEEET_S9_S9_(ptr %22, ptr %24)
  %26 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.0", ptr %5, i32 0, i32 0
  store ptr %25, ptr %26, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = call ptr @_ZNKSt6vectorI2ptSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %27) #6
  %29 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.0", ptr %8, i32 0, i32 0
  store ptr %28, ptr %29, align 8
  %30 = call noundef i64 @_ZN9__gnu_cxxmiIPK2ptSt6vectorIS1_SaIS1_EEEENS_17__normal_iteratorIT_T0_E15difference_typeERKSA_SD_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  %31 = trunc i64 %30 to i32
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  store i32 %31, ptr %4, align 4, !tbaa !9
  %32 = load ptr, ptr %2, align 8, !tbaa !5
  %33 = load i32, ptr %4, align 4, !tbaa !9
  %34 = load i32, ptr %3, align 4, !tbaa !9
  %35 = add nsw i32 %33, %34
  %36 = sub nsw i32 %35, 1
  %37 = load i32, ptr %3, align 4, !tbaa !9
  %38 = call noundef i32 @_Z3modii(i32 noundef %36, i32 noundef %37)
  %39 = sext i32 %38 to i64
  %40 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %32, i64 noundef %39) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %9, ptr align 16 %40, i64 32, i1 false), !tbaa.struct !11
  %41 = load ptr, ptr %2, align 8, !tbaa !5
  %42 = load i32, ptr %4, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %41, i64 noundef %43) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %10, ptr align 16 %44, i64 32, i1 false), !tbaa.struct !11
  %45 = load ptr, ptr %2, align 8, !tbaa !5
  %46 = load i32, ptr %4, align 4, !tbaa !9
  %47 = add nsw i32 %46, 1
  %48 = load i32, ptr %3, align 4, !tbaa !9
  %49 = call noundef i32 @_Z3modii(i32 noundef %47, i32 noundef %48)
  %50 = sext i32 %49 to i64
  %51 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %45, i64 noundef %50) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %11, ptr align 16 %51, i64 32, i1 false), !tbaa.struct !11
  %52 = call noundef i32 @_Z3ccw2ptS_S_(ptr noundef byval(%struct.pt) align 16 %9, ptr noundef byval(%struct.pt) align 16 %10, ptr noundef byval(%struct.pt) align 16 %11)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  ret i32 %52
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN9__gnu_cxxmiIPK2ptSt6vectorIS1_SaIS1_EEEENS_17__normal_iteratorIT_T0_E15difference_typeERKSA_SD_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt11min_elementIN9__gnu_cxx17__normal_iteratorIPK2ptSt6vectorIS2_SaIS2_EEEEET_S9_S9_(ptr, ptr) #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt6vectorI2ptSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 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 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 = { 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 #6 = { 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}


; 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.__gnu_cxx::__normal_iterator.0" = type { ptr }

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z3ccw2ptS_S_(ptr noundef byval(%struct.pt) align 16, 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: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorI2ptSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3modii(i32 noundef, i32 noundef) local_unnamed_addr #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) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z12isCcwPolygonRKSt6vectorI2ptSaIS0_EE(ptr noundef nonnull align 8 dereferenceable(24) %0) local_unnamed_addr #1 {
  %2 = alloca %"class.__gnu_cxx::__normal_iterator.0", align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator.0", align 8
  %4 = alloca %struct.pt, align 16
  %5 = alloca %struct.pt, align 16
  %6 = tail call noundef i64 @_ZNKSt6vectorI2ptSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  %7 = trunc i64 %6 to i32
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %8 = tail call ptr @_ZNKSt6vectorI2ptSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  %9 = tail call ptr @_ZNKSt6vectorI2ptSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  %10 = tail call ptr @_ZSt11min_elementIN9__gnu_cxx17__normal_iteratorIPK2ptSt6vectorIS2_SaIS2_EEEEET_S9_S9_(ptr %8, ptr %9)
  store ptr %10, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %11 = tail call ptr @_ZNKSt6vectorI2ptSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  store ptr %11, ptr %3, align 8
  %12 = call noundef i64 @_ZN9__gnu_cxxmiIPK2ptSt6vectorIS1_SaIS1_EEEENS_17__normal_iteratorIT_T0_E15difference_typeERKSA_SD_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %13 = trunc i64 %12 to i32
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  %14 = add i32 %7, -1
  %15 = add i32 %14, %13
  %16 = call noundef i32 @_Z3modii(i32 noundef %15, i32 noundef %7)
  %17 = sext i32 %16 to i64
  %18 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %17) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %4, ptr noundef nonnull align 16 dereferenceable(32) %18, i64 32, i1 false), !tbaa.struct !5
  %sext = shl i64 %12, 32
  %19 = ashr exact i64 %sext, 32
  %20 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %19) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %5, ptr noundef nonnull align 16 dereferenceable(32) %20, i64 32, i1 false), !tbaa.struct !5
  %21 = add nsw i32 %13, 1
  %22 = call noundef i32 @_Z3modii(i32 noundef %21, i32 noundef %7)
  %23 = sext i32 %22 to i64
  %24 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %23) #6
  %25 = call noundef i32 @_Z3ccw2ptS_S_(ptr noundef nonnull byval(%struct.pt) align 16 %4, ptr noundef nonnull byval(%struct.pt) align 16 %5, ptr noundef nonnull byval(%struct.pt) align 16 %24)
  ret i32 %25
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN9__gnu_cxxmiIPK2ptSt6vectorIS1_SaIS1_EEEENS_17__normal_iteratorIT_T0_E15difference_typeERKSA_SD_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt11min_elementIN9__gnu_cxx17__normal_iteratorIPK2ptSt6vectorIS2_SaIS2_EEEEET_S9_S9_(ptr, ptr) local_unnamed_addr #5

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

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

attributes #0 = { mustprogress 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 = { 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 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 = { 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 #6 = { 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"}


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