; LLVM IR from PaddlePaddle/Serving :: core/predictor/tools/ocrtools (clipper)

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

%"class.__gnu_cxx::__normal_iterator.48" = type { ptr }
%"class.ClipperLib::Clipper" = type <{ ptr, %"class.std::vector.33", %"class.std::vector.33", %"class.std::vector.38", i32, [4 x i8], %"class.std::__cxx11::list", ptr, i8, [3 x i8], i32, i32, i8, i8, i8, i8, %"class.ClipperLib::ClipperBase" }>
%"class.std::vector.33" = type { %"struct.std::_Vector_base.34" }
%"struct.std::_Vector_base.34" = type { %"struct.std::_Vector_base<ClipperLib::Join *, std::allocator<ClipperLib::Join *>>::_Vector_impl" }
%"struct.std::_Vector_base<ClipperLib::Join *, std::allocator<ClipperLib::Join *>>::_Vector_impl" = type { %"struct.std::_Vector_base<ClipperLib::Join *, std::allocator<ClipperLib::Join *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<ClipperLib::Join *, std::allocator<ClipperLib::Join *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.38" = type { %"struct.std::_Vector_base.39" }
%"struct.std::_Vector_base.39" = type { %"struct.std::_Vector_base<ClipperLib::IntersectNode *, std::allocator<ClipperLib::IntersectNode *>>::_Vector_impl" }
%"struct.std::_Vector_base<ClipperLib::IntersectNode *, std::allocator<ClipperLib::IntersectNode *>>::_Vector_impl" = type { %"struct.std::_Vector_base<ClipperLib::IntersectNode *, std::allocator<ClipperLib::IntersectNode *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<ClipperLib::IntersectNode *, std::allocator<ClipperLib::IntersectNode *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::__cxx11::list" = type { %"class.std::__cxx11::_List_base" }
%"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<long long, std::allocator<long long>>::_List_impl" }
%"struct.std::__cxx11::_List_base<long long, std::allocator<long long>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" }
%"struct.std::__detail::_List_node_header" = type { %"struct.std::__detail::_List_node_base", i64 }
%"struct.std::__detail::_List_node_base" = type { ptr, ptr }
%"class.ClipperLib::ClipperBase" = type { ptr, %"class.__gnu_cxx::__normal_iterator", %"class.std::vector.5", i8, %"class.std::vector.10", i8, i8, %"class.std::vector.15", ptr, %"class.std::priority_queue" }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<ClipperLib::LocalMinimum, std::allocator<ClipperLib::LocalMinimum>>::_Vector_impl" }
%"struct.std::_Vector_base<ClipperLib::LocalMinimum, std::allocator<ClipperLib::LocalMinimum>>::_Vector_impl" = type { %"struct.std::_Vector_base<ClipperLib::LocalMinimum, std::allocator<ClipperLib::LocalMinimum>>::_Vector_impl_data" }
%"struct.std::_Vector_base<ClipperLib::LocalMinimum, std::allocator<ClipperLib::LocalMinimum>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<ClipperLib::TEdge *, std::allocator<ClipperLib::TEdge *>>::_Vector_impl" }
%"struct.std::_Vector_base<ClipperLib::TEdge *, std::allocator<ClipperLib::TEdge *>>::_Vector_impl" = type { %"struct.std::_Vector_base<ClipperLib::TEdge *, std::allocator<ClipperLib::TEdge *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<ClipperLib::TEdge *, std::allocator<ClipperLib::TEdge *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.15" = type { %"struct.std::_Vector_base.16" }
%"struct.std::_Vector_base.16" = type { %"struct.std::_Vector_base<ClipperLib::OutRec *, std::allocator<ClipperLib::OutRec *>>::_Vector_impl" }
%"struct.std::_Vector_base<ClipperLib::OutRec *, std::allocator<ClipperLib::OutRec *>>::_Vector_impl" = type { %"struct.std::_Vector_base<ClipperLib::OutRec *, std::allocator<ClipperLib::OutRec *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<ClipperLib::OutRec *, std::allocator<ClipperLib::OutRec *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::priority_queue" = type <{ %"class.std::vector.20", [8 x i8] }>
%"class.std::vector.20" = type { %"struct.std::_Vector_base.21" }
%"struct.std::_Vector_base.21" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.ClipperLib::IntersectNode" = type { ptr, ptr, %"struct.ClipperLib::IntPoint" }
%"struct.ClipperLib::IntPoint" = type { i64, i64 }

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10ClipperLib7Clipper12CopyAELToSELEv(ptr noundef nonnull align 8 dereferenceable(135)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10ClipperLib7Clipper18SwapPositionsInSELEPNS_5TEdgeES2_(ptr noundef nonnull align 8 dereferenceable(135), ptr noundef, ptr noundef) #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN10ClipperLib7Clipper22FixupIntersectionOrderEv(ptr noundef nonnull align 8 dereferenceable(135) %0) #2 align 2 {
  %2 = alloca i1, align 1
  %3 = alloca ptr, align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator.48", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator.48", align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %10 = load ptr, ptr %3, align 8
  call void @_ZN10ClipperLib7Clipper12CopyAELToSELEv(ptr noundef nonnull align 8 dereferenceable(135) %10)
  %11 = getelementptr inbounds %"class.ClipperLib::Clipper", ptr %10, i32 0, i32 3
  %12 = call ptr @_ZNSt6vectorIPN10ClipperLib13IntersectNodeESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  %13 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.48", ptr %4, i32 0, i32 0
  store ptr %12, ptr %13, align 8
  %14 = getelementptr inbounds %"class.ClipperLib::Clipper", ptr %10, i32 0, i32 3
  %15 = call ptr @_ZNSt6vectorIPN10ClipperLib13IntersectNodeESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #5
  %16 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.48", ptr %5, i32 0, i32 0
  store ptr %15, ptr %16, align 8
  %17 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.48", ptr %4, i32 0, i32 0
  %18 = load ptr, ptr %17, align 8
  %19 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.48", ptr %5, i32 0, i32 0
  %20 = load ptr, ptr %19, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPPN10ClipperLib13IntersectNodeESt6vectorIS4_SaIS4_EEEEPFbS4_S4_EEvT_SC_T0_(ptr %18, ptr %20, ptr noundef @_ZN10ClipperLib17IntersectListSortEPNS_13IntersectNodeES1_)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %21 = getelementptr inbounds %"class.ClipperLib::Clipper", ptr %10, i32 0, i32 3
  %22 = call noundef i64 @_ZNKSt6vectorIPN10ClipperLib13IntersectNodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #5
  store i64 %22, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store i64 0, ptr %7, align 8, !tbaa !9
  br label %23

23:                                               ; preds = %81, %1
  %24 = load i64, ptr %7, align 8, !tbaa !9
  %25 = load i64, ptr %6, align 8, !tbaa !9
  %26 = icmp ult i64 %24, %25
  br i1 %26, label %28, label %27

27:                                               ; preds = %23
  store i32 2, ptr %8, align 4
  br label %84

28:                                               ; preds = %23
  %29 = getelementptr inbounds %"class.ClipperLib::Clipper", ptr %10, i32 0, i32 3
  %30 = load i64, ptr %7, align 8, !tbaa !9
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10ClipperLib13IntersectNodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %29, i64 noundef %30) #5
  %32 = load ptr, ptr %31, align 8, !tbaa !5
  %33 = call noundef zeroext i1 @_ZN10ClipperLib13EdgesAdjacentERKNS_13IntersectNodeE(ptr noundef nonnull align 8 dereferenceable(32) %32)
  br i1 %33, label %68, label %34

34:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %35 = load i64, ptr %7, align 8, !tbaa !9
  %36 = add i64 %35, 1
  store i64 %36, ptr %9, align 8, !tbaa !9
  br label %37

37:                                               ; preds = %50, %34
  %38 = load i64, ptr %9, align 8, !tbaa !9
  %39 = load i64, ptr %6, align 8, !tbaa !9
  %40 = icmp ult i64 %38, %39
  br i1 %40, label %41, label %48

41:                                               ; preds = %37
  %42 = getelementptr inbounds %"class.ClipperLib::Clipper", ptr %10, i32 0, i32 3
  %43 = load i64, ptr %9, align 8, !tbaa !9
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10ClipperLib13IntersectNodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %42, i64 noundef %43) #5
  %45 = load ptr, ptr %44, align 8, !tbaa !5
  %46 = call noundef zeroext i1 @_ZN10ClipperLib13EdgesAdjacentERKNS_13IntersectNodeE(ptr noundef nonnull align 8 dereferenceable(32) %45)
  %47 = xor i1 %46, true
  br label %48

48:                                               ; preds = %41, %37
  %49 = phi i1 [ false, %37 ], [ %47, %41 ]
  br i1 %49, label %50, label %53

50:                                               ; preds = %48
  %51 = load i64, ptr %9, align 8, !tbaa !9
  %52 = add i64 %51, 1
  store i64 %52, ptr %9, align 8, !tbaa !9
  br label %37, !llvm.loop !11

53:                                               ; preds = %48
  %54 = load i64, ptr %9, align 8, !tbaa !9
  %55 = load i64, ptr %6, align 8, !tbaa !9
  %56 = icmp eq i64 %54, %55
  br i1 %56, label %57, label %58

57:                                               ; preds = %53
  store i1 false, ptr %2, align 1
  store i32 1, ptr %8, align 4
  br label %65

58:                                               ; preds = %53
  %59 = getelementptr inbounds %"class.ClipperLib::Clipper", ptr %10, i32 0, i32 3
  %60 = load i64, ptr %7, align 8, !tbaa !9
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10ClipperLib13IntersectNodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %59, i64 noundef %60) #5
  %62 = getelementptr inbounds %"class.ClipperLib::Clipper", ptr %10, i32 0, i32 3
  %63 = load i64, ptr %9, align 8, !tbaa !9
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10ClipperLib13IntersectNodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %62, i64 noundef %63) #5
  call void @_ZSt4swapIPN10ClipperLib13IntersectNodeEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS6_ESt18is_move_assignableIS6_EEE5valueEvE4typeERS6_SF_(ptr noundef nonnull align 8 dereferenceable(8) %61, ptr noundef nonnull align 8 dereferenceable(8) %64) #5
  store i32 0, ptr %8, align 4
  br label %65

65:                                               ; preds = %58, %57
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  %66 = load i32, ptr %8, align 4
  switch i32 %66, label %84 [
    i32 0, label %67
  ]

67:                                               ; preds = %65
  br label %68

68:                                               ; preds = %67, %28
  %69 = getelementptr inbounds %"class.ClipperLib::Clipper", ptr %10, i32 0, i32 3
  %70 = load i64, ptr %7, align 8, !tbaa !9
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10ClipperLib13IntersectNodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %69, i64 noundef %70) #5
  %72 = load ptr, ptr %71, align 8, !tbaa !5
  %73 = getelementptr inbounds %"struct.ClipperLib::IntersectNode", ptr %72, i32 0, i32 0
  %74 = load ptr, ptr %73, align 8, !tbaa !13
  %75 = getelementptr inbounds %"class.ClipperLib::Clipper", ptr %10, i32 0, i32 3
  %76 = load i64, ptr %7, align 8, !tbaa !9
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10ClipperLib13IntersectNodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %75, i64 noundef %76) #5
  %78 = load ptr, ptr %77, align 8, !tbaa !5
  %79 = getelementptr inbounds %"struct.ClipperLib::IntersectNode", ptr %78, i32 0, i32 1
  %80 = load ptr, ptr %79, align 8, !tbaa !17
  call void @_ZN10ClipperLib7Clipper18SwapPositionsInSELEPNS_5TEdgeES2_(ptr noundef nonnull align 8 dereferenceable(135) %10, ptr noundef %74, ptr noundef %80)
  br label %81

81:                                               ; preds = %68
  %82 = load i64, ptr %7, align 8, !tbaa !9
  %83 = add i64 %82, 1
  store i64 %83, ptr %7, align 8, !tbaa !9
  br label %23, !llvm.loop !18

84:                                               ; preds = %65, %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  %85 = load i32, ptr %8, align 4
  switch i32 %85, label %87 [
    i32 2, label %86
  ]

86:                                               ; preds = %84
  store i1 true, ptr %2, align 1
  store i32 1, ptr %8, align 4
  br label %87

87:                                               ; preds = %86, %84
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %88 = load i1, ptr %2, align 1
  ret i1 %88
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN10ClipperLib17IntersectListSortEPNS_13IntersectNodeES1_(ptr noundef, ptr noundef) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPPN10ClipperLib13IntersectNodeESt6vectorIS4_SaIS4_EEEEPFbS4_S4_EEvT_SC_T0_(ptr, ptr, ptr noundef) #3

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN10ClipperLib13EdgesAdjacentERKNS_13IntersectNodeE(ptr noundef nonnull align 8 dereferenceable(32)) #4

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 = { 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 = !{!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", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTSN10ClipperLib13IntersectNodeE", !6, i64 0, !6, i64 8, !15, i64 16}
!15 = !{!"_ZTSN10ClipperLib8IntPointE", !16, i64 0, !16, i64 8}
!16 = !{!"long long", !7, i64 0}
!17 = !{!14, !6, i64 8}
!18 = distinct !{!18, !12}


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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10ClipperLib7Clipper12CopyAELToSELEv(ptr noundef nonnull align 8 dereferenceable(135)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10ClipperLib7Clipper18SwapPositionsInSELEPNS_5TEdgeES2_(ptr noundef nonnull align 8 dereferenceable(135), ptr noundef, ptr noundef) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN10ClipperLib7Clipper22FixupIntersectionOrderEv(ptr noundef nonnull align 8 dereferenceable(135) %0) local_unnamed_addr #1 align 2 {
  tail call void @_ZN10ClipperLib7Clipper12CopyAELToSELEv(ptr noundef nonnull align 8 dereferenceable(135) %0)
  %2 = getelementptr inbounds i8, ptr %0, i64 56
  %3 = tail call ptr @_ZNSt6vectorIPN10ClipperLib13IntersectNodeESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %4 = tail call ptr @_ZNSt6vectorIPN10ClipperLib13IntersectNodeESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  tail call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPPN10ClipperLib13IntersectNodeESt6vectorIS4_SaIS4_EEEEPFbS4_S4_EEvT_SC_T0_(ptr %3, ptr %4, ptr noundef nonnull @_ZN10ClipperLib17IntersectListSortEPNS_13IntersectNodeES1_)
  %5 = tail call noundef i64 @_ZNKSt6vectorIPN10ClipperLib13IntersectNodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %.not2529 = icmp eq i64 %5, 0
  br i1 %.not2529, label %.critedge27, label %.lr.ph

.lr.ph:                                           ; preds = %1, %17
  %.not2531 = phi i1 [ %.not25, %17 ], [ false, %1 ]
  %.02130 = phi i64 [ %25, %17 ], [ 0, %1 ]
  %6 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10ClipperLib13IntersectNodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.02130) #4
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = tail call noundef zeroext i1 @_ZN10ClipperLib13EdgesAdjacentERKNS_13IntersectNodeE(ptr noundef nonnull align 8 dereferenceable(32) %7)
  br i1 %8, label %17, label %.preheader

.preheader:                                       ; preds = %.lr.ph, %10
  %.0.in = phi i64 [ %.0, %10 ], [ %.02130, %.lr.ph ]
  %.0 = add nuw i64 %.0.in, 1
  %9 = icmp ult i64 %.0, %5
  br i1 %9, label %10, label %.critedge27

10:                                               ; preds = %.preheader
  %11 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10ClipperLib13IntersectNodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.0) #4
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = tail call noundef zeroext i1 @_ZN10ClipperLib13EdgesAdjacentERKNS_13IntersectNodeE(ptr noundef nonnull align 8 dereferenceable(32) %12)
  br i1 %13, label %.critedge, label %.preheader, !llvm.loop !9

.critedge:                                        ; preds = %10
  %.not = icmp eq i64 %.0, %5
  br i1 %.not, label %.critedge27, label %14

14:                                               ; preds = %.critedge
  %15 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10ClipperLib13IntersectNodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.02130) #4
  %16 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10ClipperLib13IntersectNodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.0) #4
  tail call void @_ZSt4swapIPN10ClipperLib13IntersectNodeEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS6_ESt18is_move_assignableIS6_EEE5valueEvE4typeERS6_SF_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  br label %17

17:                                               ; preds = %14, %.lr.ph
  %18 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10ClipperLib13IntersectNodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.02130) #4
  %19 = load ptr, ptr %18, align 8, !tbaa !5
  %20 = load ptr, ptr %19, align 8, !tbaa !11
  %21 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10ClipperLib13IntersectNodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.02130) #4
  %22 = load ptr, ptr %21, align 8, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %22, i64 8
  %24 = load ptr, ptr %23, align 8, !tbaa !15
  tail call void @_ZN10ClipperLib7Clipper18SwapPositionsInSELEPNS_5TEdgeES2_(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef %20, ptr noundef %24)
  %25 = add nuw i64 %.02130, 1
  %.not25 = icmp uge i64 %25, %5
  %exitcond = icmp eq i64 %25, %5
  br i1 %exitcond, label %.critedge27, label %.lr.ph, !llvm.loop !16

.critedge27:                                      ; preds = %.critedge, %17, %.preheader, %1
  %.not25.lcssa = phi i1 [ true, %1 ], [ %.not2531, %.preheader ], [ %.not25, %17 ], [ %.not2531, %.critedge ]
  ret i1 %.not25.lcssa
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPPN10ClipperLib13IntersectNodeESt6vectorIS4_SaIS4_EEEEPFbS4_S4_EEvT_SC_T0_(ptr, ptr, ptr noundef) local_unnamed_addr #2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN10ClipperLib13EdgesAdjacentERKNS_13IntersectNodeE(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIPN10ClipperLib13IntersectNodeEENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS6_ESt18is_move_assignableIS6_EEE5valueEvE4typeERS6_SF_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

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 = { 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTSN10ClipperLib13IntersectNodeE", !6, i64 0, !6, i64 8, !13, i64 16}
!13 = !{!"_ZTSN10ClipperLib8IntPointE", !14, i64 0, !14, i64 8}
!14 = !{!"long long", !7, i64 0}
!15 = !{!12, !6, i64 8}
!16 = distinct !{!16, !10}


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