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

%"struct.ClipperLib::IntPoint" = type { i64, i64 }
%"struct.ClipperLib::LocalMinimum" = type { i64, ptr, ptr }
%"struct.ClipperLib::TEdge" = type { %"struct.ClipperLib::IntPoint", %"struct.ClipperLib::IntPoint", %"struct.ClipperLib::IntPoint", double, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, 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::Join" = type { ptr, ptr, %"struct.ClipperLib::IntPoint" }
%"struct.ClipperLib::OutPt" = type { i32, %"struct.ClipperLib::IntPoint", ptr, ptr }

; 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: 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 noundef zeroext i1 @_ZN10ClipperLib11SlopesEqualENS_8IntPointES0_S0_S0_b(i64, i64, i64, i64, i64, i64, ptr noundef byval(%"struct.ClipperLib::IntPoint") align 8, i1 noundef zeroext) #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN10ClipperLib19HorzSegmentsOverlapExxxx(i64 noundef, i64 noundef, i64 noundef, i64 noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10ClipperLib11ClipperBase14InsertScanbeamEx(ptr noundef nonnull align 8 dereferenceable(144), i64 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN10ClipperLib11ClipperBase14PopLocalMinimaExRPKNS_12LocalMinimumE(ptr noundef nonnull align 8 dereferenceable(144), i64 noundef, ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10ClipperLib7Clipper24InsertLocalMinimaIntoAELEx(ptr noundef nonnull align 8 dereferenceable(135) %0, i64 noundef %1) #2 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca %"struct.ClipperLib::IntPoint", align 8
  %13 = alloca %"struct.ClipperLib::IntPoint", align 8
  %14 = alloca %"struct.ClipperLib::IntPoint", align 8
  %15 = alloca %"struct.ClipperLib::IntPoint", align 8
  %16 = alloca %"struct.ClipperLib::IntPoint", align 8
  %17 = alloca ptr, align 8
  %18 = alloca %"struct.ClipperLib::IntPoint", align 8
  %19 = alloca %"struct.ClipperLib::IntPoint", align 8
  %20 = alloca %"struct.ClipperLib::IntPoint", align 8
  %21 = alloca %"struct.ClipperLib::IntPoint", align 8
  %22 = alloca %"struct.ClipperLib::IntPoint", align 8
  %23 = alloca ptr, align 8
  %24 = alloca %"struct.ClipperLib::IntPoint", align 8
  %25 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i64 %1, ptr %4, align 8, !tbaa !9
  %26 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  br label %27

27:                                               ; preds = %403, %401, %2
  %28 = load ptr, ptr %26, align 8, !tbaa !11
  %29 = getelementptr i8, ptr %28, i64 -24
  %30 = load i64, ptr %29, align 8
  %31 = getelementptr inbounds i8, ptr %26, i64 %30
  %32 = load i64, ptr %4, align 8, !tbaa !9
  %33 = call noundef zeroext i1 @_ZN10ClipperLib11ClipperBase14PopLocalMinimaExRPKNS_12LocalMinimumE(ptr noundef nonnull align 8 dereferenceable(144) %31, i64 noundef %32, ptr noundef nonnull align 8 dereferenceable(8) %5)
  br i1 %33, label %34, label %404

34:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = getelementptr inbounds %"struct.ClipperLib::LocalMinimum", ptr %35, i32 0, i32 1
  %37 = load ptr, ptr %36, align 8, !tbaa !13
  store ptr %37, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds %"struct.ClipperLib::LocalMinimum", ptr %38, i32 0, i32 2
  %40 = load ptr, ptr %39, align 8, !tbaa !15
  store ptr %40, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store ptr null, ptr %8, align 8, !tbaa !5
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = icmp ne ptr %41, null
  br i1 %42, label %54, label %43

43:                                               ; preds = %34
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN10ClipperLib7Clipper17InsertEdgeIntoAELEPNS_5TEdgeES2_(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef %44, ptr noundef null)
  %45 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN10ClipperLib7Clipper15SetWindingCountERNS_5TEdgeE(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef nonnull align 8 dereferenceable(136) %45)
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = call noundef zeroext i1 @_ZNK10ClipperLib7Clipper14IsContributingERKNS_5TEdgeE(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef nonnull align 8 dereferenceable(136) %46)
  br i1 %47, label %48, label %53

48:                                               ; preds = %43
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %50, i32 0, i32 0
  %52 = call noundef ptr @_ZN10ClipperLib7Clipper8AddOutPtEPNS_5TEdgeERKNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef %49, ptr noundef nonnull align 8 dereferenceable(16) %51)
  store ptr %52, ptr %8, align 8, !tbaa !5
  br label %53

53:                                               ; preds = %48, %43
  br label %109

54:                                               ; preds = %34
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  %56 = icmp ne ptr %55, null
  br i1 %56, label %76, label %57

57:                                               ; preds = %54
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN10ClipperLib7Clipper17InsertEdgeIntoAELEPNS_5TEdgeES2_(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef %58, ptr noundef null)
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN10ClipperLib7Clipper15SetWindingCountERNS_5TEdgeE(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef nonnull align 8 dereferenceable(136) %59)
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = call noundef zeroext i1 @_ZNK10ClipperLib7Clipper14IsContributingERKNS_5TEdgeE(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef nonnull align 8 dereferenceable(136) %60)
  br i1 %61, label %62, label %67

62:                                               ; preds = %57
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  %64 = load ptr, ptr %6, align 8, !tbaa !5
  %65 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %64, i32 0, i32 0
  %66 = call noundef ptr @_ZN10ClipperLib7Clipper8AddOutPtEPNS_5TEdgeERKNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef %63, ptr noundef nonnull align 8 dereferenceable(16) %65)
  store ptr %66, ptr %8, align 8, !tbaa !5
  br label %67

67:                                               ; preds = %62, %57
  %68 = load ptr, ptr %26, align 8, !tbaa !11
  %69 = getelementptr i8, ptr %68, i64 -24
  %70 = load i64, ptr %69, align 8
  %71 = getelementptr inbounds i8, ptr %26, i64 %70
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  %73 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %72, i32 0, i32 2
  %74 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %73, i32 0, i32 1
  %75 = load i64, ptr %74, align 8, !tbaa !16
  call void @_ZN10ClipperLib11ClipperBase14InsertScanbeamEx(ptr noundef nonnull align 8 dereferenceable(144) %71, i64 noundef %75)
  br label %108

76:                                               ; preds = %54
  %77 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN10ClipperLib7Clipper17InsertEdgeIntoAELEPNS_5TEdgeES2_(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef %77, ptr noundef null)
  %78 = load ptr, ptr %7, align 8, !tbaa !5
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN10ClipperLib7Clipper17InsertEdgeIntoAELEPNS_5TEdgeES2_(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef %78, ptr noundef %79)
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN10ClipperLib7Clipper15SetWindingCountERNS_5TEdgeE(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef nonnull align 8 dereferenceable(136) %80)
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %81, i32 0, i32 7
  %83 = load i32, ptr %82, align 4, !tbaa !23
  %84 = load ptr, ptr %7, align 8, !tbaa !5
  %85 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %84, i32 0, i32 7
  store i32 %83, ptr %85, align 4, !tbaa !23
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %86, i32 0, i32 8
  %88 = load i32, ptr %87, align 8, !tbaa !24
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %89, i32 0, i32 8
  store i32 %88, ptr %90, align 8, !tbaa !24
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = call noundef zeroext i1 @_ZNK10ClipperLib7Clipper14IsContributingERKNS_5TEdgeE(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef nonnull align 8 dereferenceable(136) %91)
  br i1 %92, label %93, label %99

93:                                               ; preds = %76
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = load ptr, ptr %7, align 8, !tbaa !5
  %96 = load ptr, ptr %6, align 8, !tbaa !5
  %97 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %96, i32 0, i32 0
  %98 = call noundef ptr @_ZN10ClipperLib7Clipper15AddLocalMinPolyEPNS_5TEdgeES2_RKNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef %94, ptr noundef %95, ptr noundef nonnull align 8 dereferenceable(16) %97)
  store ptr %98, ptr %8, align 8, !tbaa !5
  br label %99

99:                                               ; preds = %93, %76
  %100 = load ptr, ptr %26, align 8, !tbaa !11
  %101 = getelementptr i8, ptr %100, i64 -24
  %102 = load i64, ptr %101, align 8
  %103 = getelementptr inbounds i8, ptr %26, i64 %102
  %104 = load ptr, ptr %6, align 8, !tbaa !5
  %105 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %104, i32 0, i32 2
  %106 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %105, i32 0, i32 1
  %107 = load i64, ptr %106, align 8, !tbaa !16
  call void @_ZN10ClipperLib11ClipperBase14InsertScanbeamEx(ptr noundef nonnull align 8 dereferenceable(144) %103, i64 noundef %107)
  br label %108

108:                                              ; preds = %99, %67
  br label %109

109:                                              ; preds = %108, %53
  %110 = load ptr, ptr %7, align 8, !tbaa !5
  %111 = icmp ne ptr %110, null
  br i1 %111, label %112, label %143

112:                                              ; preds = %109
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = call noundef zeroext i1 @_ZN10ClipperLib12IsHorizontalERNS_5TEdgeE(ptr noundef nonnull align 8 dereferenceable(136) %113)
  br i1 %114, label %115, label %133

115:                                              ; preds = %112
  %116 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN10ClipperLib7Clipper12AddEdgeToSELEPNS_5TEdgeE(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef %116)
  %117 = load ptr, ptr %7, align 8, !tbaa !5
  %118 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %117, i32 0, i32 12
  %119 = load ptr, ptr %118, align 8, !tbaa !25
  %120 = icmp ne ptr %119, null
  br i1 %120, label %121, label %132

121:                                              ; preds = %115
  %122 = load ptr, ptr %26, align 8, !tbaa !11
  %123 = getelementptr i8, ptr %122, i64 -24
  %124 = load i64, ptr %123, align 8
  %125 = getelementptr inbounds i8, ptr %26, i64 %124
  %126 = load ptr, ptr %7, align 8, !tbaa !5
  %127 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %126, i32 0, i32 12
  %128 = load ptr, ptr %127, align 8, !tbaa !25
  %129 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %128, i32 0, i32 2
  %130 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %129, i32 0, i32 1
  %131 = load i64, ptr %130, align 8, !tbaa !16
  call void @_ZN10ClipperLib11ClipperBase14InsertScanbeamEx(ptr noundef nonnull align 8 dereferenceable(144) %125, i64 noundef %131)
  br label %132

132:                                              ; preds = %121, %115
  br label %142

133:                                              ; preds = %112
  %134 = load ptr, ptr %26, align 8, !tbaa !11
  %135 = getelementptr i8, ptr %134, i64 -24
  %136 = load i64, ptr %135, align 8
  %137 = getelementptr inbounds i8, ptr %26, i64 %136
  %138 = load ptr, ptr %7, align 8, !tbaa !5
  %139 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %138, i32 0, i32 2
  %140 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %139, i32 0, i32 1
  %141 = load i64, ptr %140, align 8, !tbaa !16
  call void @_ZN10ClipperLib11ClipperBase14InsertScanbeamEx(ptr noundef nonnull align 8 dereferenceable(144) %137, i64 noundef %141)
  br label %142

142:                                              ; preds = %133, %132
  br label %143

143:                                              ; preds = %142, %109
  %144 = load ptr, ptr %6, align 8, !tbaa !5
  %145 = icmp ne ptr %144, null
  br i1 %145, label %146, label %149

146:                                              ; preds = %143
  %147 = load ptr, ptr %7, align 8, !tbaa !5
  %148 = icmp ne ptr %147, null
  br i1 %148, label %150, label %149

149:                                              ; preds = %146, %143
  store i32 2, ptr %9, align 4
  br label %401, !llvm.loop !26

150:                                              ; preds = %146
  %151 = load ptr, ptr %8, align 8, !tbaa !5
  %152 = icmp ne ptr %151, null
  br i1 %152, label %153, label %212

153:                                              ; preds = %150
  %154 = load ptr, ptr %7, align 8, !tbaa !5
  %155 = call noundef zeroext i1 @_ZN10ClipperLib12IsHorizontalERNS_5TEdgeE(ptr noundef nonnull align 8 dereferenceable(136) %154)
  br i1 %155, label %156, label %212

156:                                              ; preds = %153
  %157 = getelementptr inbounds %"class.ClipperLib::Clipper", ptr %26, i32 0, i32 2
  %158 = call noundef i64 @_ZNKSt6vectorIPN10ClipperLib4JoinESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %157) #5
  %159 = icmp ugt i64 %158, 0
  br i1 %159, label %160, label %212

160:                                              ; preds = %156
  %161 = load ptr, ptr %7, align 8, !tbaa !5
  %162 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %161, i32 0, i32 6
  %163 = load i32, ptr %162, align 8, !tbaa !28
  %164 = icmp ne i32 %163, 0
  br i1 %164, label %165, label %212

165:                                              ; preds = %160
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store i64 0, ptr %10, align 8, !tbaa !29
  br label %166

166:                                              ; preds = %208, %165
  %167 = load i64, ptr %10, align 8, !tbaa !29
  %168 = getelementptr inbounds %"class.ClipperLib::Clipper", ptr %26, i32 0, i32 2
  %169 = call noundef i64 @_ZNKSt6vectorIPN10ClipperLib4JoinESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %168) #5
  %170 = icmp ult i64 %167, %169
  br i1 %170, label %172, label %171

171:                                              ; preds = %166
  store i32 4, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %211

172:                                              ; preds = %166
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %173 = getelementptr inbounds %"class.ClipperLib::Clipper", ptr %26, i32 0, i32 2
  %174 = load i64, ptr %10, align 8, !tbaa !29
  %175 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10ClipperLib4JoinESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %173, i64 noundef %174) #5
  %176 = load ptr, ptr %175, align 8, !tbaa !5
  store ptr %176, ptr %11, align 8, !tbaa !5
  %177 = load ptr, ptr %11, align 8, !tbaa !5
  %178 = getelementptr inbounds %"struct.ClipperLib::Join", ptr %177, i32 0, i32 0
  %179 = load ptr, ptr %178, align 8, !tbaa !31
  %180 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %179, i32 0, i32 1
  %181 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %180, i32 0, i32 0
  %182 = load i64, ptr %181, align 8, !tbaa !33
  %183 = load ptr, ptr %11, align 8, !tbaa !5
  %184 = getelementptr inbounds %"struct.ClipperLib::Join", ptr %183, i32 0, i32 2
  %185 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %184, i32 0, i32 0
  %186 = load i64, ptr %185, align 8, !tbaa !35
  %187 = load ptr, ptr %7, align 8, !tbaa !5
  %188 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %187, i32 0, i32 0
  %189 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %188, i32 0, i32 0
  %190 = load i64, ptr %189, align 8, !tbaa !36
  %191 = load ptr, ptr %7, align 8, !tbaa !5
  %192 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %191, i32 0, i32 2
  %193 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %192, i32 0, i32 0
  %194 = load i64, ptr %193, align 8, !tbaa !37
  %195 = call noundef zeroext i1 @_ZN10ClipperLib19HorzSegmentsOverlapExxxx(i64 noundef %182, i64 noundef %186, i64 noundef %190, i64 noundef %194)
  br i1 %195, label %196, label %207

196:                                              ; preds = %172
  %197 = load ptr, ptr %11, align 8, !tbaa !5
  %198 = getelementptr inbounds %"struct.ClipperLib::Join", ptr %197, i32 0, i32 0
  %199 = load ptr, ptr %198, align 8, !tbaa !31
  %200 = load ptr, ptr %8, align 8, !tbaa !5
  %201 = load ptr, ptr %11, align 8, !tbaa !5
  %202 = getelementptr inbounds %"struct.ClipperLib::Join", ptr %201, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %202, i64 16, i1 false), !tbaa.struct !38
  %203 = getelementptr inbounds { i64, i64 }, ptr %12, i32 0, i32 0
  %204 = load i64, ptr %203, align 8
  %205 = getelementptr inbounds { i64, i64 }, ptr %12, i32 0, i32 1
  %206 = load i64, ptr %205, align 8
  call void @_ZN10ClipperLib7Clipper7AddJoinEPNS_5OutPtES2_NS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef %199, ptr noundef %200, i64 %204, i64 %206)
  br label %207

207:                                              ; preds = %196, %172
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %208

208:                                              ; preds = %207
  %209 = load i64, ptr %10, align 8, !tbaa !29
  %210 = add i64 %209, 1
  store i64 %210, ptr %10, align 8, !tbaa !29
  br label %166, !llvm.loop !39

211:                                              ; preds = %171
  br label %212

212:                                              ; preds = %211, %160, %156, %153, %150
  %213 = load ptr, ptr %6, align 8, !tbaa !5
  %214 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %213, i32 0, i32 9
  %215 = load i32, ptr %214, align 4, !tbaa !40
  %216 = icmp sge i32 %215, 0
  br i1 %216, label %217, label %301

217:                                              ; preds = %212
  %218 = load ptr, ptr %6, align 8, !tbaa !5
  %219 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %218, i32 0, i32 14
  %220 = load ptr, ptr %219, align 8, !tbaa !41
  %221 = icmp ne ptr %220, null
  br i1 %221, label %222, label %301

222:                                              ; preds = %217
  %223 = load ptr, ptr %6, align 8, !tbaa !5
  %224 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %223, i32 0, i32 14
  %225 = load ptr, ptr %224, align 8, !tbaa !41
  %226 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %225, i32 0, i32 1
  %227 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %226, i32 0, i32 0
  %228 = load i64, ptr %227, align 8, !tbaa !42
  %229 = load ptr, ptr %6, align 8, !tbaa !5
  %230 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %229, i32 0, i32 0
  %231 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %230, i32 0, i32 0
  %232 = load i64, ptr %231, align 8, !tbaa !36
  %233 = icmp eq i64 %228, %232
  br i1 %233, label %234, label %301

234:                                              ; preds = %222
  %235 = load ptr, ptr %6, align 8, !tbaa !5
  %236 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %235, i32 0, i32 14
  %237 = load ptr, ptr %236, align 8, !tbaa !41
  %238 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %237, i32 0, i32 9
  %239 = load i32, ptr %238, align 4, !tbaa !40
  %240 = icmp sge i32 %239, 0
  br i1 %240, label %241, label %301

241:                                              ; preds = %234
  %242 = load ptr, ptr %6, align 8, !tbaa !5
  %243 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %242, i32 0, i32 14
  %244 = load ptr, ptr %243, align 8, !tbaa !41
  %245 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %244, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 %245, i64 16, i1 false), !tbaa.struct !38
  %246 = load ptr, ptr %6, align 8, !tbaa !5
  %247 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %246, i32 0, i32 14
  %248 = load ptr, ptr %247, align 8, !tbaa !41
  %249 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %248, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 8 %249, i64 16, i1 false), !tbaa.struct !38
  %250 = load ptr, ptr %6, align 8, !tbaa !5
  %251 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %250, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %251, i64 16, i1 false), !tbaa.struct !38
  %252 = load ptr, ptr %6, align 8, !tbaa !5
  %253 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %252, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 %253, i64 16, i1 false), !tbaa.struct !38
  %254 = load ptr, ptr %26, align 8, !tbaa !11
  %255 = getelementptr i8, ptr %254, i64 -24
  %256 = load i64, ptr %255, align 8
  %257 = getelementptr inbounds i8, ptr %26, i64 %256
  %258 = getelementptr inbounds %"class.ClipperLib::ClipperBase", ptr %257, i32 0, i32 3
  %259 = load i8, ptr %258, align 8, !tbaa !43, !range !65, !noundef !66
  %260 = trunc i8 %259 to i1
  %261 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 0
  %262 = load i64, ptr %261, align 8
  %263 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 1
  %264 = load i64, ptr %263, align 8
  %265 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 0
  %266 = load i64, ptr %265, align 8
  %267 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 1
  %268 = load i64, ptr %267, align 8
  %269 = getelementptr inbounds { i64, i64 }, ptr %15, i32 0, i32 0
  %270 = load i64, ptr %269, align 8
  %271 = getelementptr inbounds { i64, i64 }, ptr %15, i32 0, i32 1
  %272 = load i64, ptr %271, align 8
  %273 = call noundef zeroext i1 @_ZN10ClipperLib11SlopesEqualENS_8IntPointES0_S0_S0_b(i64 %262, i64 %264, i64 %266, i64 %268, i64 %270, i64 %272, ptr noundef byval(%"struct.ClipperLib::IntPoint") align 8 %16, i1 noundef zeroext %260)
  br i1 %273, label %274, label %301

274:                                              ; preds = %241
  %275 = load ptr, ptr %6, align 8, !tbaa !5
  %276 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %275, i32 0, i32 6
  %277 = load i32, ptr %276, align 8, !tbaa !28
  %278 = icmp ne i32 %277, 0
  br i1 %278, label %279, label %301

279:                                              ; preds = %274
  %280 = load ptr, ptr %6, align 8, !tbaa !5
  %281 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %280, i32 0, i32 14
  %282 = load ptr, ptr %281, align 8, !tbaa !41
  %283 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %282, i32 0, i32 6
  %284 = load i32, ptr %283, align 8, !tbaa !28
  %285 = icmp ne i32 %284, 0
  br i1 %285, label %286, label %301

286:                                              ; preds = %279
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %287 = load ptr, ptr %6, align 8, !tbaa !5
  %288 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %287, i32 0, i32 14
  %289 = load ptr, ptr %288, align 8, !tbaa !41
  %290 = load ptr, ptr %6, align 8, !tbaa !5
  %291 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %290, i32 0, i32 0
  %292 = call noundef ptr @_ZN10ClipperLib7Clipper8AddOutPtEPNS_5TEdgeERKNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef %289, ptr noundef nonnull align 8 dereferenceable(16) %291)
  store ptr %292, ptr %17, align 8, !tbaa !5
  %293 = load ptr, ptr %8, align 8, !tbaa !5
  %294 = load ptr, ptr %17, align 8, !tbaa !5
  %295 = load ptr, ptr %6, align 8, !tbaa !5
  %296 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %295, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 8 %296, i64 16, i1 false), !tbaa.struct !38
  %297 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 0
  %298 = load i64, ptr %297, align 8
  %299 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 1
  %300 = load i64, ptr %299, align 8
  call void @_ZN10ClipperLib7Clipper7AddJoinEPNS_5OutPtES2_NS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef %293, ptr noundef %294, i64 %298, i64 %300)
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %301

301:                                              ; preds = %286, %279, %274, %241, %234, %222, %217, %212
  %302 = load ptr, ptr %6, align 8, !tbaa !5
  %303 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %302, i32 0, i32 13
  %304 = load ptr, ptr %303, align 8, !tbaa !67
  %305 = load ptr, ptr %7, align 8, !tbaa !5
  %306 = icmp ne ptr %304, %305
  br i1 %306, label %307, label %400

307:                                              ; preds = %301
  %308 = load ptr, ptr %7, align 8, !tbaa !5
  %309 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %308, i32 0, i32 9
  %310 = load i32, ptr %309, align 4, !tbaa !40
  %311 = icmp sge i32 %310, 0
  br i1 %311, label %312, label %379

312:                                              ; preds = %307
  %313 = load ptr, ptr %7, align 8, !tbaa !5
  %314 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %313, i32 0, i32 14
  %315 = load ptr, ptr %314, align 8, !tbaa !41
  %316 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %315, i32 0, i32 9
  %317 = load i32, ptr %316, align 4, !tbaa !40
  %318 = icmp sge i32 %317, 0
  br i1 %318, label %319, label %379

319:                                              ; preds = %312
  %320 = load ptr, ptr %7, align 8, !tbaa !5
  %321 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %320, i32 0, i32 14
  %322 = load ptr, ptr %321, align 8, !tbaa !41
  %323 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %322, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %323, i64 16, i1 false), !tbaa.struct !38
  %324 = load ptr, ptr %7, align 8, !tbaa !5
  %325 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %324, i32 0, i32 14
  %326 = load ptr, ptr %325, align 8, !tbaa !41
  %327 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %326, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %327, i64 16, i1 false), !tbaa.struct !38
  %328 = load ptr, ptr %7, align 8, !tbaa !5
  %329 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %328, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %329, i64 16, i1 false), !tbaa.struct !38
  %330 = load ptr, ptr %7, align 8, !tbaa !5
  %331 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %330, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %22, ptr align 8 %331, i64 16, i1 false), !tbaa.struct !38
  %332 = load ptr, ptr %26, align 8, !tbaa !11
  %333 = getelementptr i8, ptr %332, i64 -24
  %334 = load i64, ptr %333, align 8
  %335 = getelementptr inbounds i8, ptr %26, i64 %334
  %336 = getelementptr inbounds %"class.ClipperLib::ClipperBase", ptr %335, i32 0, i32 3
  %337 = load i8, ptr %336, align 8, !tbaa !43, !range !65, !noundef !66
  %338 = trunc i8 %337 to i1
  %339 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 0
  %340 = load i64, ptr %339, align 8
  %341 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 1
  %342 = load i64, ptr %341, align 8
  %343 = getelementptr inbounds { i64, i64 }, ptr %20, i32 0, i32 0
  %344 = load i64, ptr %343, align 8
  %345 = getelementptr inbounds { i64, i64 }, ptr %20, i32 0, i32 1
  %346 = load i64, ptr %345, align 8
  %347 = getelementptr inbounds { i64, i64 }, ptr %21, i32 0, i32 0
  %348 = load i64, ptr %347, align 8
  %349 = getelementptr inbounds { i64, i64 }, ptr %21, i32 0, i32 1
  %350 = load i64, ptr %349, align 8
  %351 = call noundef zeroext i1 @_ZN10ClipperLib11SlopesEqualENS_8IntPointES0_S0_S0_b(i64 %340, i64 %342, i64 %344, i64 %346, i64 %348, i64 %350, ptr noundef byval(%"struct.ClipperLib::IntPoint") align 8 %22, i1 noundef zeroext %338)
  br i1 %351, label %352, label %379

352:                                              ; preds = %319
  %353 = load ptr, ptr %7, align 8, !tbaa !5
  %354 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %353, i32 0, i32 6
  %355 = load i32, ptr %354, align 8, !tbaa !28
  %356 = icmp ne i32 %355, 0
  br i1 %356, label %357, label %379

357:                                              ; preds = %352
  %358 = load ptr, ptr %7, align 8, !tbaa !5
  %359 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %358, i32 0, i32 14
  %360 = load ptr, ptr %359, align 8, !tbaa !41
  %361 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %360, i32 0, i32 6
  %362 = load i32, ptr %361, align 8, !tbaa !28
  %363 = icmp ne i32 %362, 0
  br i1 %363, label %364, label %379

364:                                              ; preds = %357
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %365 = load ptr, ptr %7, align 8, !tbaa !5
  %366 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %365, i32 0, i32 14
  %367 = load ptr, ptr %366, align 8, !tbaa !41
  %368 = load ptr, ptr %7, align 8, !tbaa !5
  %369 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %368, i32 0, i32 0
  %370 = call noundef ptr @_ZN10ClipperLib7Clipper8AddOutPtEPNS_5TEdgeERKNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef %367, ptr noundef nonnull align 8 dereferenceable(16) %369)
  store ptr %370, ptr %23, align 8, !tbaa !5
  %371 = load ptr, ptr %8, align 8, !tbaa !5
  %372 = load ptr, ptr %23, align 8, !tbaa !5
  %373 = load ptr, ptr %7, align 8, !tbaa !5
  %374 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %373, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %24, ptr align 8 %374, i64 16, i1 false), !tbaa.struct !38
  %375 = getelementptr inbounds { i64, i64 }, ptr %24, i32 0, i32 0
  %376 = load i64, ptr %375, align 8
  %377 = getelementptr inbounds { i64, i64 }, ptr %24, i32 0, i32 1
  %378 = load i64, ptr %377, align 8
  call void @_ZN10ClipperLib7Clipper7AddJoinEPNS_5OutPtES2_NS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef %371, ptr noundef %372, i64 %376, i64 %378)
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  br label %379

379:                                              ; preds = %364, %357, %352, %319, %312, %307
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %380 = load ptr, ptr %6, align 8, !tbaa !5
  %381 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %380, i32 0, i32 13
  %382 = load ptr, ptr %381, align 8, !tbaa !67
  store ptr %382, ptr %25, align 8, !tbaa !5
  %383 = load ptr, ptr %25, align 8, !tbaa !5
  %384 = icmp ne ptr %383, null
  br i1 %384, label %385, label %399

385:                                              ; preds = %379
  br label %386

386:                                              ; preds = %390, %385
  %387 = load ptr, ptr %25, align 8, !tbaa !5
  %388 = load ptr, ptr %7, align 8, !tbaa !5
  %389 = icmp ne ptr %387, %388
  br i1 %389, label %390, label %398

390:                                              ; preds = %386
  %391 = load ptr, ptr %7, align 8, !tbaa !5
  %392 = load ptr, ptr %25, align 8, !tbaa !5
  %393 = load ptr, ptr %6, align 8, !tbaa !5
  %394 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %393, i32 0, i32 1
  call void @_ZN10ClipperLib7Clipper14IntersectEdgesEPNS_5TEdgeES2_RNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef %391, ptr noundef %392, ptr noundef nonnull align 8 dereferenceable(16) %394)
  %395 = load ptr, ptr %25, align 8, !tbaa !5
  %396 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %395, i32 0, i32 13
  %397 = load ptr, ptr %396, align 8, !tbaa !67
  store ptr %397, ptr %25, align 8, !tbaa !5
  br label %386, !llvm.loop !68

398:                                              ; preds = %386
  br label %399

399:                                              ; preds = %398, %379
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  br label %400

400:                                              ; preds = %399, %301
  store i32 0, ptr %9, align 4
  br label %401

401:                                              ; preds = %400, %149
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %402 = load i32, ptr %9, align 4
  switch i32 %402, label %405 [
    i32 0, label %403
    i32 2, label %27
  ]

403:                                              ; preds = %401
  br label %27, !llvm.loop !26

404:                                              ; preds = %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret void

405:                                              ; preds = %401
  unreachable
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK10ClipperLib7Clipper14IsContributingERKNS_5TEdgeE(ptr noundef nonnull align 8 dereferenceable(135), ptr noundef nonnull align 8 dereferenceable(136)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN10ClipperLib7Clipper15AddLocalMinPolyEPNS_5TEdgeES2_RKNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135), ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN10ClipperLib7Clipper8AddOutPtEPNS_5TEdgeERKNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135), ptr noundef, ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

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

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

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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 long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = !{!14, !6, i64 8}
!14 = !{!"_ZTSN10ClipperLib12LocalMinimumE", !10, i64 0, !6, i64 8, !6, i64 16}
!15 = !{!14, !6, i64 16}
!16 = !{!17, !10, i64 40}
!17 = !{!"_ZTSN10ClipperLib5TEdgeE", !18, i64 0, !18, i64 16, !18, i64 32, !19, i64 48, !20, i64 56, !21, i64 60, !22, i64 64, !22, i64 68, !22, i64 72, !22, i64 76, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128}
!18 = !{!"_ZTSN10ClipperLib8IntPointE", !10, i64 0, !10, i64 8}
!19 = !{!"double", !7, i64 0}
!20 = !{!"_ZTSN10ClipperLib8PolyTypeE", !7, i64 0}
!21 = !{!"_ZTSN10ClipperLib8EdgeSideE", !7, i64 0}
!22 = !{!"int", !7, i64 0}
!23 = !{!17, !22, i64 68}
!24 = !{!17, !22, i64 72}
!25 = !{!17, !6, i64 96}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!17, !22, i64 64}
!29 = !{!30, !30, i64 0}
!30 = !{!"long", !7, i64 0}
!31 = !{!32, !6, i64 0}
!32 = !{!"_ZTSN10ClipperLib4JoinE", !6, i64 0, !6, i64 8, !18, i64 16}
!33 = !{!34, !10, i64 8}
!34 = !{!"_ZTSN10ClipperLib5OutPtE", !22, i64 0, !18, i64 8, !6, i64 24, !6, i64 32}
!35 = !{!32, !10, i64 16}
!36 = !{!17, !10, i64 0}
!37 = !{!17, !10, i64 32}
!38 = !{i64 0, i64 8, !9, i64 8, i64 8, !9}
!39 = distinct !{!39, !27}
!40 = !{!17, !22, i64 76}
!41 = !{!17, !6, i64 112}
!42 = !{!17, !10, i64 16}
!43 = !{!44, !50, i64 40}
!44 = !{!"_ZTSN10ClipperLib11ClipperBaseE", !45, i64 8, !46, i64 16, !50, i64 40, !51, i64 48, !50, i64 72, !50, i64 73, !55, i64 80, !6, i64 104, !59, i64 112}
!45 = !{!"_ZTSN9__gnu_cxx17__normal_iteratorIPN10ClipperLib12LocalMinimumESt6vectorIS2_SaIS2_EEEE", !6, i64 0}
!46 = !{!"_ZTSSt6vectorIN10ClipperLib12LocalMinimumESaIS1_EE", !47, i64 0}
!47 = !{!"_ZTSSt12_Vector_baseIN10ClipperLib12LocalMinimumESaIS1_EE", !48, i64 0}
!48 = !{!"_ZTSNSt12_Vector_baseIN10ClipperLib12LocalMinimumESaIS1_EE12_Vector_implE", !49, i64 0}
!49 = !{!"_ZTSNSt12_Vector_baseIN10ClipperLib12LocalMinimumESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!50 = !{!"bool", !7, i64 0}
!51 = !{!"_ZTSSt6vectorIPN10ClipperLib5TEdgeESaIS2_EE", !52, i64 0}
!52 = !{!"_ZTSSt12_Vector_baseIPN10ClipperLib5TEdgeESaIS2_EE", !53, i64 0}
!53 = !{!"_ZTSNSt12_Vector_baseIPN10ClipperLib5TEdgeESaIS2_EE12_Vector_implE", !54, i64 0}
!54 = !{!"_ZTSNSt12_Vector_baseIPN10ClipperLib5TEdgeESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!55 = !{!"_ZTSSt6vectorIPN10ClipperLib6OutRecESaIS2_EE", !56, i64 0}
!56 = !{!"_ZTSSt12_Vector_baseIPN10ClipperLib6OutRecESaIS2_EE", !57, i64 0}
!57 = !{!"_ZTSNSt12_Vector_baseIPN10ClipperLib6OutRecESaIS2_EE12_Vector_implE", !58, i64 0}
!58 = !{!"_ZTSNSt12_Vector_baseIPN10ClipperLib6OutRecESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!59 = !{!"_ZTSSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE", !60, i64 0, !64, i64 24}
!60 = !{!"_ZTSSt6vectorIxSaIxEE", !61, i64 0}
!61 = !{!"_ZTSSt12_Vector_baseIxSaIxEE", !62, i64 0}
!62 = !{!"_ZTSNSt12_Vector_baseIxSaIxEE12_Vector_implE", !63, i64 0}
!63 = !{!"_ZTSNSt12_Vector_baseIxSaIxEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!64 = !{!"_ZTSSt4lessIxE"}
!65 = !{i8 0, i8 2}
!66 = !{}
!67 = !{!17, !6, i64 104}
!68 = distinct !{!68, !27}


; 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.ClipperLib::IntPoint" = type { i64, i64 }

; 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 noundef zeroext i1 @_ZN10ClipperLib11SlopesEqualENS_8IntPointES0_S0_S0_b(i64, i64, i64, i64, i64, i64, ptr noundef byval(%"struct.ClipperLib::IntPoint") align 8, i1 noundef zeroext) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN10ClipperLib12IsHorizontalERNS_5TEdgeE(ptr noundef nonnull align 8 dereferenceable(136)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN10ClipperLib19HorzSegmentsOverlapExxxx(i64 noundef, i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10ClipperLib11ClipperBase14InsertScanbeamEx(ptr noundef nonnull align 8 dereferenceable(144), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN10ClipperLib11ClipperBase14PopLocalMinimaExRPKNS_12LocalMinimumE(ptr noundef nonnull align 8 dereferenceable(144), i64 noundef, ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10ClipperLib7Clipper24InsertLocalMinimaIntoAELEx(ptr noundef nonnull align 8 dereferenceable(135) %0, i64 noundef %1) local_unnamed_addr #1 align 2 {
  %3 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %invariant.gep = getelementptr inbounds i8, ptr %0, i64 40
  %4 = load ptr, ptr %0, align 8, !tbaa !5
  %5 = getelementptr i8, ptr %4, i64 -24
  %6 = load i64, ptr %5, align 8
  %7 = getelementptr inbounds i8, ptr %0, i64 %6
  %8 = call noundef zeroext i1 @_ZN10ClipperLib11ClipperBase14PopLocalMinimaExRPKNS_12LocalMinimumE(ptr noundef nonnull align 8 dereferenceable(144) %7, i64 noundef %1, ptr noundef nonnull align 8 dereferenceable(8) %3)
  br i1 %8, label %.lr.ph142, label %._crit_edge

.lr.ph142:                                        ; preds = %2
  %9 = getelementptr inbounds i8, ptr %0, i64 32
  br label %10

10:                                               ; preds = %.lr.ph142, %.thread131
  %11 = load ptr, ptr %3, align 8, !tbaa !8
  %12 = getelementptr inbounds i8, ptr %11, i64 8
  %13 = load ptr, ptr %12, align 8, !tbaa !11
  %14 = getelementptr inbounds i8, ptr %11, i64 16
  %15 = load ptr, ptr %14, align 8, !tbaa !14
  %.not153 = icmp eq ptr %13, null
  br i1 %.not153, label %16, label %20

16:                                               ; preds = %10
  call void @_ZN10ClipperLib7Clipper17InsertEdgeIntoAELEPNS_5TEdgeES2_(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef %15, ptr noundef null)
  call void @_ZN10ClipperLib7Clipper15SetWindingCountERNS_5TEdgeE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef nonnull align 8 dereferenceable(136) %15)
  %17 = call noundef zeroext i1 @_ZNK10ClipperLib7Clipper14IsContributingERKNS_5TEdgeE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef nonnull align 8 dereferenceable(136) %15)
  br i1 %17, label %18, label %44

18:                                               ; preds = %16
  %19 = call noundef ptr @_ZN10ClipperLib7Clipper8AddOutPtEPNS_5TEdgeERKNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef %15, ptr noundef nonnull align 8 dereferenceable(16) %15)
  br label %44

20:                                               ; preds = %10
  %.not = icmp eq ptr %15, null
  call void @_ZN10ClipperLib7Clipper17InsertEdgeIntoAELEPNS_5TEdgeES2_(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef nonnull %13, ptr noundef null)
  br i1 %.not, label %21, label %31

21:                                               ; preds = %20
  call void @_ZN10ClipperLib7Clipper15SetWindingCountERNS_5TEdgeE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef nonnull align 8 dereferenceable(136) %13)
  %22 = call noundef zeroext i1 @_ZNK10ClipperLib7Clipper14IsContributingERKNS_5TEdgeE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef nonnull align 8 dereferenceable(136) %13)
  br i1 %22, label %23, label %.thread145

23:                                               ; preds = %21
  %24 = call noundef ptr @_ZN10ClipperLib7Clipper8AddOutPtEPNS_5TEdgeERKNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef nonnull %13, ptr noundef nonnull align 8 dereferenceable(16) %13)
  br label %.thread145

.thread145:                                       ; preds = %23, %21
  %25 = load ptr, ptr %0, align 8, !tbaa !5
  %26 = getelementptr i8, ptr %25, i64 -24
  %27 = load i64, ptr %26, align 8
  %28 = getelementptr inbounds i8, ptr %0, i64 %27
  %29 = getelementptr inbounds i8, ptr %13, i64 40
  %30 = load i64, ptr %29, align 8, !tbaa !15
  call void @_ZN10ClipperLib11ClipperBase14InsertScanbeamEx(ptr noundef nonnull align 8 dereferenceable(144) %28, i64 noundef %30)
  br label %.thread131

31:                                               ; preds = %20
  call void @_ZN10ClipperLib7Clipper17InsertEdgeIntoAELEPNS_5TEdgeES2_(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef nonnull %15, ptr noundef nonnull %13)
  call void @_ZN10ClipperLib7Clipper15SetWindingCountERNS_5TEdgeE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef nonnull align 8 dereferenceable(136) %13)
  %32 = getelementptr inbounds i8, ptr %13, i64 68
  %33 = getelementptr inbounds i8, ptr %15, i64 68
  %34 = load <2 x i32>, ptr %32, align 4, !tbaa !22
  store <2 x i32> %34, ptr %33, align 4, !tbaa !22
  %35 = call noundef zeroext i1 @_ZNK10ClipperLib7Clipper14IsContributingERKNS_5TEdgeE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef nonnull align 8 dereferenceable(136) %13)
  br i1 %35, label %36, label %.thread

36:                                               ; preds = %31
  %37 = call noundef ptr @_ZN10ClipperLib7Clipper15AddLocalMinPolyEPNS_5TEdgeES2_RKNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef nonnull %13, ptr noundef nonnull %15, ptr noundef nonnull align 8 dereferenceable(16) %13)
  br label %.thread

.thread:                                          ; preds = %31, %36
  %.1 = phi ptr [ %37, %36 ], [ null, %31 ]
  %38 = load ptr, ptr %0, align 8, !tbaa !5
  %39 = getelementptr i8, ptr %38, i64 -24
  %40 = load i64, ptr %39, align 8
  %41 = getelementptr inbounds i8, ptr %0, i64 %40
  %42 = getelementptr inbounds i8, ptr %13, i64 40
  %43 = load i64, ptr %42, align 8, !tbaa !15
  call void @_ZN10ClipperLib11ClipperBase14InsertScanbeamEx(ptr noundef nonnull align 8 dereferenceable(144) %41, i64 noundef %43)
  br label %45

44:                                               ; preds = %16, %18
  %.2 = phi ptr [ %19, %18 ], [ null, %16 ]
  %.not134 = icmp eq ptr %15, null
  br i1 %.not134, label %.thread131, label %45

45:                                               ; preds = %.thread, %44
  %.2128 = phi ptr [ %.1, %.thread ], [ %.2, %44 ]
  %46 = call noundef zeroext i1 @_ZN10ClipperLib12IsHorizontalERNS_5TEdgeE(ptr noundef nonnull align 8 dereferenceable(136) %15)
  br i1 %46, label %47, label %.sink.split

47:                                               ; preds = %45
  call void @_ZN10ClipperLib7Clipper12AddEdgeToSELEPNS_5TEdgeE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef nonnull %15)
  %48 = getelementptr inbounds i8, ptr %15, i64 96
  %49 = load ptr, ptr %48, align 8, !tbaa !23
  %.not114 = icmp eq ptr %49, null
  br i1 %.not114, label %56, label %.sink.split

.sink.split:                                      ; preds = %45, %47
  %.sink150 = phi ptr [ %49, %47 ], [ %15, %45 ]
  %50 = load ptr, ptr %0, align 8, !tbaa !5
  %51 = getelementptr i8, ptr %50, i64 -24
  %52 = load i64, ptr %51, align 8
  %53 = getelementptr inbounds i8, ptr %0, i64 %52
  %54 = getelementptr inbounds i8, ptr %.sink150, i64 40
  %55 = load i64, ptr %54, align 8, !tbaa !15
  call void @_ZN10ClipperLib11ClipperBase14InsertScanbeamEx(ptr noundef nonnull align 8 dereferenceable(144) %53, i64 noundef %55)
  br label %56

56:                                               ; preds = %.sink.split, %47
  br i1 %.not153, label %.thread131, label %57, !llvm.loop !24

57:                                               ; preds = %56
  %.not115 = icmp eq ptr %.2128, null
  br i1 %.not115, label %.loopexit, label %58

58:                                               ; preds = %57
  %59 = call noundef zeroext i1 @_ZN10ClipperLib12IsHorizontalERNS_5TEdgeE(ptr noundef nonnull align 8 dereferenceable(136) %15)
  br i1 %59, label %60, label %.loopexit

60:                                               ; preds = %58
  %61 = call noundef i64 @_ZNKSt6vectorIPN10ClipperLib4JoinESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  %.not116 = icmp eq i64 %61, 0
  br i1 %.not116, label %.loopexit, label %62

62:                                               ; preds = %60
  %63 = getelementptr inbounds i8, ptr %15, i64 64
  %64 = load i32, ptr %63, align 8, !tbaa !26
  %.not117 = icmp eq i32 %64, 0
  br i1 %.not117, label %.loopexit, label %.preheader135

.preheader135:                                    ; preds = %62
  %65 = call noundef i64 @_ZNKSt6vectorIPN10ClipperLib4JoinESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  %.not144 = icmp eq i64 %65, 0
  br i1 %.not144, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader135
  %66 = getelementptr inbounds i8, ptr %15, i64 32
  br label %67

67:                                               ; preds = %.lr.ph, %80
  %.0105136 = phi i64 [ 0, %.lr.ph ], [ %81, %80 ]
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10ClipperLib4JoinESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %.0105136) #4
  %69 = load ptr, ptr %68, align 8, !tbaa !8
  %70 = load ptr, ptr %69, align 8, !tbaa !27
  %71 = getelementptr inbounds i8, ptr %70, i64 8
  %72 = load i64, ptr %71, align 8, !tbaa !29
  %73 = getelementptr inbounds i8, ptr %69, i64 16
  %74 = load i64, ptr %73, align 8, !tbaa !31
  %75 = load i64, ptr %15, align 8, !tbaa !32
  %76 = load i64, ptr %66, align 8, !tbaa !33
  %77 = call noundef zeroext i1 @_ZN10ClipperLib19HorzSegmentsOverlapExxxx(i64 noundef %72, i64 noundef %74, i64 noundef %75, i64 noundef %76)
  br i1 %77, label %78, label %80

78:                                               ; preds = %67
  %79 = load ptr, ptr %69, align 8, !tbaa !27
  %.sroa.021.0.copyload = load i64, ptr %73, align 8, !tbaa !34
  %.sroa.222.0..sroa_idx = getelementptr inbounds i8, ptr %69, i64 24
  %.sroa.222.0.copyload = load i64, ptr %.sroa.222.0..sroa_idx, align 8, !tbaa !34
  call void @_ZN10ClipperLib7Clipper7AddJoinEPNS_5OutPtES2_NS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef %79, ptr noundef nonnull %.2128, i64 %.sroa.021.0.copyload, i64 %.sroa.222.0.copyload)
  br label %80

80:                                               ; preds = %78, %67
  %81 = add nuw i64 %.0105136, 1
  %82 = call noundef i64 @_ZNKSt6vectorIPN10ClipperLib4JoinESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  %83 = icmp ult i64 %81, %82
  br i1 %83, label %67, label %.loopexit, !llvm.loop !35

.loopexit:                                        ; preds = %80, %.preheader135, %62, %60, %58, %57
  %84 = getelementptr inbounds i8, ptr %13, i64 76
  %85 = load i32, ptr %84, align 4, !tbaa !36
  %86 = icmp sgt i32 %85, -1
  br i1 %86, label %87, label %118

87:                                               ; preds = %.loopexit
  %88 = getelementptr inbounds i8, ptr %13, i64 112
  %89 = load ptr, ptr %88, align 8, !tbaa !37
  %.not118 = icmp eq ptr %89, null
  br i1 %.not118, label %118, label %90

90:                                               ; preds = %87
  %91 = getelementptr inbounds i8, ptr %89, i64 16
  %92 = load i64, ptr %91, align 8, !tbaa !38
  %93 = load i64, ptr %13, align 8, !tbaa !32
  %94 = icmp eq i64 %92, %93
  br i1 %94, label %95, label %118

95:                                               ; preds = %90
  %96 = getelementptr inbounds i8, ptr %89, i64 76
  %97 = load i32, ptr %96, align 4, !tbaa !36
  %98 = icmp sgt i32 %97, -1
  br i1 %98, label %99, label %118

99:                                               ; preds = %95
  %.sroa.019.0.copyload = load i64, ptr %89, align 8, !tbaa !34
  %.sroa.220.0..sroa_idx = getelementptr inbounds i8, ptr %89, i64 8
  %.sroa.220.0.copyload = load i64, ptr %.sroa.220.0..sroa_idx, align 8, !tbaa !34
  %100 = getelementptr inbounds i8, ptr %89, i64 32
  %.sroa.017.0.copyload = load i64, ptr %100, align 8, !tbaa !34
  %.sroa.218.0..sroa_idx = getelementptr inbounds i8, ptr %89, i64 40
  %.sroa.218.0.copyload = load i64, ptr %.sroa.218.0..sroa_idx, align 8, !tbaa !34
  %101 = getelementptr inbounds i8, ptr %13, i64 16
  %.sroa.015.0.copyload = load i64, ptr %101, align 8, !tbaa !34
  %.sroa.216.0..sroa_idx = getelementptr inbounds i8, ptr %13, i64 24
  %.sroa.216.0.copyload = load i64, ptr %.sroa.216.0..sroa_idx, align 8, !tbaa !34
  %102 = getelementptr inbounds i8, ptr %13, i64 32
  %103 = load ptr, ptr %0, align 8, !tbaa !5
  %104 = getelementptr i8, ptr %103, i64 -24
  %105 = load i64, ptr %104, align 8
  %gep = getelementptr i8, ptr %invariant.gep, i64 %105
  %106 = load i8, ptr %gep, align 8, !tbaa !39, !range !61, !noundef !62
  %107 = trunc nuw i8 %106 to i1
  %108 = call noundef zeroext i1 @_ZN10ClipperLib11SlopesEqualENS_8IntPointES0_S0_S0_b(i64 %.sroa.019.0.copyload, i64 %.sroa.220.0.copyload, i64 %.sroa.017.0.copyload, i64 %.sroa.218.0.copyload, i64 %.sroa.015.0.copyload, i64 %.sroa.216.0.copyload, ptr noundef nonnull byval(%"struct.ClipperLib::IntPoint") align 8 %102, i1 noundef zeroext %107)
  br i1 %108, label %109, label %118

109:                                              ; preds = %99
  %110 = getelementptr inbounds i8, ptr %13, i64 64
  %111 = load i32, ptr %110, align 8, !tbaa !26
  %.not119 = icmp eq i32 %111, 0
  br i1 %.not119, label %118, label %112

112:                                              ; preds = %109
  %113 = load ptr, ptr %88, align 8, !tbaa !37
  %114 = getelementptr inbounds i8, ptr %113, i64 64
  %115 = load i32, ptr %114, align 8, !tbaa !26
  %.not120 = icmp eq i32 %115, 0
  br i1 %.not120, label %118, label %116

116:                                              ; preds = %112
  %117 = call noundef ptr @_ZN10ClipperLib7Clipper8AddOutPtEPNS_5TEdgeERKNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef nonnull %113, ptr noundef nonnull align 8 dereferenceable(16) %13)
  %.sroa.012.0.copyload = load i64, ptr %102, align 8, !tbaa !34
  %.sroa.213.0..sroa_idx = getelementptr inbounds i8, ptr %13, i64 40
  %.sroa.213.0.copyload = load i64, ptr %.sroa.213.0..sroa_idx, align 8, !tbaa !34
  call void @_ZN10ClipperLib7Clipper7AddJoinEPNS_5OutPtES2_NS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef %.2128, ptr noundef %117, i64 %.sroa.012.0.copyload, i64 %.sroa.213.0.copyload)
  br label %118

118:                                              ; preds = %116, %112, %109, %99, %95, %90, %87, %.loopexit
  %119 = getelementptr inbounds i8, ptr %13, i64 104
  %120 = load ptr, ptr %119, align 8, !tbaa !63
  %.not121 = icmp eq ptr %120, %15
  br i1 %.not121, label %.thread131, label %121

121:                                              ; preds = %118
  %122 = getelementptr inbounds i8, ptr %15, i64 76
  %123 = load i32, ptr %122, align 4, !tbaa !36
  %124 = icmp sgt i32 %123, -1
  br i1 %124, label %125, label %151

125:                                              ; preds = %121
  %126 = getelementptr inbounds i8, ptr %15, i64 112
  %127 = load ptr, ptr %126, align 8, !tbaa !37
  %128 = getelementptr inbounds i8, ptr %127, i64 76
  %129 = load i32, ptr %128, align 4, !tbaa !36
  %130 = icmp sgt i32 %129, -1
  br i1 %130, label %131, label %151

131:                                              ; preds = %125
  %132 = getelementptr inbounds i8, ptr %127, i64 16
  %.sroa.010.0.copyload = load i64, ptr %132, align 8, !tbaa !34
  %.sroa.211.0..sroa_idx = getelementptr inbounds i8, ptr %127, i64 24
  %.sroa.211.0.copyload = load i64, ptr %.sroa.211.0..sroa_idx, align 8, !tbaa !34
  %133 = getelementptr inbounds i8, ptr %127, i64 32
  %.sroa.08.0.copyload = load i64, ptr %133, align 8, !tbaa !34
  %.sroa.29.0..sroa_idx = getelementptr inbounds i8, ptr %127, i64 40
  %.sroa.29.0.copyload = load i64, ptr %.sroa.29.0..sroa_idx, align 8, !tbaa !34
  %134 = getelementptr inbounds i8, ptr %15, i64 16
  %.sroa.06.0.copyload = load i64, ptr %134, align 8, !tbaa !34
  %.sroa.27.0..sroa_idx = getelementptr inbounds i8, ptr %15, i64 24
  %.sroa.27.0.copyload = load i64, ptr %.sroa.27.0..sroa_idx, align 8, !tbaa !34
  %135 = getelementptr inbounds i8, ptr %15, i64 32
  %136 = load ptr, ptr %0, align 8, !tbaa !5
  %137 = getelementptr i8, ptr %136, i64 -24
  %138 = load i64, ptr %137, align 8
  %gep141 = getelementptr i8, ptr %invariant.gep, i64 %138
  %139 = load i8, ptr %gep141, align 8, !tbaa !39, !range !61, !noundef !62
  %140 = trunc nuw i8 %139 to i1
  %141 = call noundef zeroext i1 @_ZN10ClipperLib11SlopesEqualENS_8IntPointES0_S0_S0_b(i64 %.sroa.010.0.copyload, i64 %.sroa.211.0.copyload, i64 %.sroa.08.0.copyload, i64 %.sroa.29.0.copyload, i64 %.sroa.06.0.copyload, i64 %.sroa.27.0.copyload, ptr noundef nonnull byval(%"struct.ClipperLib::IntPoint") align 8 %135, i1 noundef zeroext %140)
  br i1 %141, label %142, label %151

142:                                              ; preds = %131
  %143 = getelementptr inbounds i8, ptr %15, i64 64
  %144 = load i32, ptr %143, align 8, !tbaa !26
  %.not122 = icmp eq i32 %144, 0
  br i1 %.not122, label %151, label %145

145:                                              ; preds = %142
  %146 = load ptr, ptr %126, align 8, !tbaa !37
  %147 = getelementptr inbounds i8, ptr %146, i64 64
  %148 = load i32, ptr %147, align 8, !tbaa !26
  %.not123 = icmp eq i32 %148, 0
  br i1 %.not123, label %151, label %149

149:                                              ; preds = %145
  %150 = call noundef ptr @_ZN10ClipperLib7Clipper8AddOutPtEPNS_5TEdgeERKNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef nonnull %146, ptr noundef nonnull align 8 dereferenceable(16) %15)
  %.sroa.0.0.copyload = load i64, ptr %135, align 8, !tbaa !34
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %15, i64 40
  %.sroa.2.0.copyload = load i64, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !34
  call void @_ZN10ClipperLib7Clipper7AddJoinEPNS_5OutPtES2_NS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef %.2128, ptr noundef %150, i64 %.sroa.0.0.copyload, i64 %.sroa.2.0.copyload)
  br label %151

151:                                              ; preds = %149, %145, %142, %131, %125, %121
  %152 = load ptr, ptr %119, align 8, !tbaa !63
  %.not124 = icmp eq ptr %152, null
  %.not125137 = icmp eq ptr %152, %15
  %or.cond143 = select i1 %.not124, i1 true, i1 %.not125137
  br i1 %or.cond143, label %.thread131, label %.lr.ph139

.lr.ph139:                                        ; preds = %151
  %153 = getelementptr inbounds i8, ptr %13, i64 16
  br label %154

154:                                              ; preds = %.lr.ph139, %154
  %.0138 = phi ptr [ %152, %.lr.ph139 ], [ %156, %154 ]
  call void @_ZN10ClipperLib7Clipper14IntersectEdgesEPNS_5TEdgeES2_RNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef nonnull %15, ptr noundef %.0138, ptr noundef nonnull align 8 dereferenceable(16) %153)
  %155 = getelementptr inbounds i8, ptr %.0138, i64 104
  %156 = load ptr, ptr %155, align 8, !tbaa !63
  %.not125 = icmp eq ptr %156, %15
  br i1 %.not125, label %.thread131, label %154, !llvm.loop !64

.thread131:                                       ; preds = %154, %.thread145, %44, %118, %151, %56
  %157 = load ptr, ptr %0, align 8, !tbaa !5
  %158 = getelementptr i8, ptr %157, i64 -24
  %159 = load i64, ptr %158, align 8
  %160 = getelementptr inbounds i8, ptr %0, i64 %159
  %161 = call noundef zeroext i1 @_ZN10ClipperLib11ClipperBase14PopLocalMinimaExRPKNS_12LocalMinimumE(ptr noundef nonnull align 8 dereferenceable(144) %160, i64 noundef %1, ptr noundef nonnull align 8 dereferenceable(8) %3)
  br i1 %161, label %10, label %._crit_edge

._crit_edge:                                      ; preds = %.thread131, %2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  ret void
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK10ClipperLib7Clipper14IsContributingERKNS_5TEdgeE(ptr noundef nonnull align 8 dereferenceable(135), ptr noundef nonnull align 8 dereferenceable(136)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN10ClipperLib7Clipper15AddLocalMinPolyEPNS_5TEdgeES2_RKNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135), ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN10ClipperLib7Clipper8AddOutPtEPNS_5TEdgeERKNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135), ptr noundef, ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10ClipperLib7Clipper14IntersectEdgesEPNS_5TEdgeES2_RNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135), ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 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 = { 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 #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 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !9, i64 8}
!12 = !{!"_ZTSN10ClipperLib12LocalMinimumE", !13, i64 0, !9, i64 8, !9, i64 16}
!13 = !{!"long long", !10, i64 0}
!14 = !{!12, !9, i64 16}
!15 = !{!16, !13, i64 40}
!16 = !{!"_ZTSN10ClipperLib5TEdgeE", !17, i64 0, !17, i64 16, !17, i64 32, !18, i64 48, !19, i64 56, !20, i64 60, !21, i64 64, !21, i64 68, !21, i64 72, !21, i64 76, !9, i64 80, !9, i64 88, !9, i64 96, !9, i64 104, !9, i64 112, !9, i64 120, !9, i64 128}
!17 = !{!"_ZTSN10ClipperLib8IntPointE", !13, i64 0, !13, i64 8}
!18 = !{!"double", !10, i64 0}
!19 = !{!"_ZTSN10ClipperLib8PolyTypeE", !10, i64 0}
!20 = !{!"_ZTSN10ClipperLib8EdgeSideE", !10, i64 0}
!21 = !{!"int", !10, i64 0}
!22 = !{!21, !21, i64 0}
!23 = !{!16, !9, i64 96}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!16, !21, i64 64}
!27 = !{!28, !9, i64 0}
!28 = !{!"_ZTSN10ClipperLib4JoinE", !9, i64 0, !9, i64 8, !17, i64 16}
!29 = !{!30, !13, i64 8}
!30 = !{!"_ZTSN10ClipperLib5OutPtE", !21, i64 0, !17, i64 8, !9, i64 24, !9, i64 32}
!31 = !{!28, !13, i64 16}
!32 = !{!16, !13, i64 0}
!33 = !{!16, !13, i64 32}
!34 = !{!13, !13, i64 0}
!35 = distinct !{!35, !25}
!36 = !{!16, !21, i64 76}
!37 = !{!16, !9, i64 112}
!38 = !{!16, !13, i64 16}
!39 = !{!40, !46, i64 40}
!40 = !{!"_ZTSN10ClipperLib11ClipperBaseE", !41, i64 8, !42, i64 16, !46, i64 40, !47, i64 48, !46, i64 72, !46, i64 73, !51, i64 80, !9, i64 104, !55, i64 112}
!41 = !{!"_ZTSN9__gnu_cxx17__normal_iteratorIPN10ClipperLib12LocalMinimumESt6vectorIS2_SaIS2_EEEE", !9, i64 0}
!42 = !{!"_ZTSSt6vectorIN10ClipperLib12LocalMinimumESaIS1_EE", !43, i64 0}
!43 = !{!"_ZTSSt12_Vector_baseIN10ClipperLib12LocalMinimumESaIS1_EE", !44, i64 0}
!44 = !{!"_ZTSNSt12_Vector_baseIN10ClipperLib12LocalMinimumESaIS1_EE12_Vector_implE", !45, i64 0}
!45 = !{!"_ZTSNSt12_Vector_baseIN10ClipperLib12LocalMinimumESaIS1_EE17_Vector_impl_dataE", !9, i64 0, !9, i64 8, !9, i64 16}
!46 = !{!"bool", !10, i64 0}
!47 = !{!"_ZTSSt6vectorIPN10ClipperLib5TEdgeESaIS2_EE", !48, i64 0}
!48 = !{!"_ZTSSt12_Vector_baseIPN10ClipperLib5TEdgeESaIS2_EE", !49, i64 0}
!49 = !{!"_ZTSNSt12_Vector_baseIPN10ClipperLib5TEdgeESaIS2_EE12_Vector_implE", !50, i64 0}
!50 = !{!"_ZTSNSt12_Vector_baseIPN10ClipperLib5TEdgeESaIS2_EE17_Vector_impl_dataE", !9, i64 0, !9, i64 8, !9, i64 16}
!51 = !{!"_ZTSSt6vectorIPN10ClipperLib6OutRecESaIS2_EE", !52, i64 0}
!52 = !{!"_ZTSSt12_Vector_baseIPN10ClipperLib6OutRecESaIS2_EE", !53, i64 0}
!53 = !{!"_ZTSNSt12_Vector_baseIPN10ClipperLib6OutRecESaIS2_EE12_Vector_implE", !54, i64 0}
!54 = !{!"_ZTSNSt12_Vector_baseIPN10ClipperLib6OutRecESaIS2_EE17_Vector_impl_dataE", !9, i64 0, !9, i64 8, !9, i64 16}
!55 = !{!"_ZTSSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE", !56, i64 0, !60, i64 24}
!56 = !{!"_ZTSSt6vectorIxSaIxEE", !57, i64 0}
!57 = !{!"_ZTSSt12_Vector_baseIxSaIxEE", !58, i64 0}
!58 = !{!"_ZTSNSt12_Vector_baseIxSaIxEE12_Vector_implE", !59, i64 0}
!59 = !{!"_ZTSNSt12_Vector_baseIxSaIxEE17_Vector_impl_dataE", !9, i64 0, !9, i64 8, !9, i64 16}
!60 = !{!"_ZTSSt4lessIxE"}
!61 = !{i8 0, i8 2}
!62 = !{}
!63 = !{!16, !9, i64 104}
!64 = distinct !{!64, !25}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass