; LLVM IR from PaddlePaddle/FastDeploy :: fastdeploy/vision/ocr/ppocr/utils (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 = %391, %389, %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 %392

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 %43, label %46

43:                                               ; preds = %34
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = icmp ne ptr %44, null
  br i1 %45, label %65, label %46

46:                                               ; preds = %43, %34
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN10ClipperLib7Clipper17InsertEdgeIntoAELEPNS_5TEdgeES2_(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef %47, ptr noundef null)
  %48 = 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) %48)
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = call noundef zeroext i1 @_ZNK10ClipperLib7Clipper14IsContributingERKNS_5TEdgeE(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef nonnull align 8 dereferenceable(136) %49)
  br i1 %50, label %51, label %56

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

56:                                               ; preds = %51, %46
  %57 = load ptr, ptr %26, align 8, !tbaa !11
  %58 = getelementptr i8, ptr %57, i64 -24
  %59 = load i64, ptr %58, align 8
  %60 = getelementptr inbounds i8, ptr %26, i64 %59
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %61, i32 0, i32 2
  %63 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %62, i32 0, i32 1
  %64 = load i64, ptr %63, align 8, !tbaa !16
  call void @_ZN10ClipperLib11ClipperBase14InsertScanbeamEx(ptr noundef nonnull align 8 dereferenceable(144) %60, i64 noundef %64)
  br label %97

65:                                               ; preds = %43
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN10ClipperLib7Clipper17InsertEdgeIntoAELEPNS_5TEdgeES2_(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef %66, ptr noundef null)
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN10ClipperLib7Clipper17InsertEdgeIntoAELEPNS_5TEdgeES2_(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef %67, ptr noundef %68)
  %69 = 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) %69)
  %70 = load ptr, ptr %6, align 8, !tbaa !5
  %71 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %70, i32 0, i32 7
  %72 = load i32, ptr %71, align 4, !tbaa !23
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %73, i32 0, i32 7
  store i32 %72, ptr %74, align 4, !tbaa !23
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %75, i32 0, i32 8
  %77 = load i32, ptr %76, align 8, !tbaa !24
  %78 = load ptr, ptr %7, align 8, !tbaa !5
  %79 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %78, i32 0, i32 8
  store i32 %77, ptr %79, align 8, !tbaa !24
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = call noundef zeroext i1 @_ZNK10ClipperLib7Clipper14IsContributingERKNS_5TEdgeE(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef nonnull align 8 dereferenceable(136) %80)
  br i1 %81, label %82, label %88

82:                                               ; preds = %65
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = load ptr, ptr %7, align 8, !tbaa !5
  %85 = load ptr, ptr %6, align 8, !tbaa !5
  %86 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %85, i32 0, i32 0
  %87 = call noundef ptr @_ZN10ClipperLib7Clipper15AddLocalMinPolyEPNS_5TEdgeES2_RKNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef %83, ptr noundef %84, ptr noundef nonnull align 8 dereferenceable(16) %86)
  store ptr %87, ptr %8, align 8, !tbaa !5
  br label %88

88:                                               ; preds = %82, %65
  %89 = load ptr, ptr %26, align 8, !tbaa !11
  %90 = getelementptr i8, ptr %89, i64 -24
  %91 = load i64, ptr %90, align 8
  %92 = getelementptr inbounds i8, ptr %26, i64 %91
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %93, i32 0, i32 2
  %95 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %94, i32 0, i32 1
  %96 = load i64, ptr %95, align 8, !tbaa !16
  call void @_ZN10ClipperLib11ClipperBase14InsertScanbeamEx(ptr noundef nonnull align 8 dereferenceable(144) %92, i64 noundef %96)
  br label %97

97:                                               ; preds = %88, %56
  %98 = load ptr, ptr %7, align 8, !tbaa !5
  %99 = icmp ne ptr %98, null
  br i1 %99, label %100, label %131

100:                                              ; preds = %97
  %101 = load ptr, ptr %7, align 8, !tbaa !5
  %102 = call noundef zeroext i1 @_ZN10ClipperLib12IsHorizontalERNS_5TEdgeE(ptr noundef nonnull align 8 dereferenceable(136) %101)
  br i1 %102, label %103, label %121

103:                                              ; preds = %100
  %104 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN10ClipperLib7Clipper12AddEdgeToSELEPNS_5TEdgeE(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef %104)
  %105 = load ptr, ptr %7, align 8, !tbaa !5
  %106 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %105, i32 0, i32 12
  %107 = load ptr, ptr %106, align 8, !tbaa !25
  %108 = icmp ne ptr %107, null
  br i1 %108, label %109, label %120

109:                                              ; preds = %103
  %110 = load ptr, ptr %26, align 8, !tbaa !11
  %111 = getelementptr i8, ptr %110, i64 -24
  %112 = load i64, ptr %111, align 8
  %113 = getelementptr inbounds i8, ptr %26, i64 %112
  %114 = load ptr, ptr %7, align 8, !tbaa !5
  %115 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %114, i32 0, i32 12
  %116 = load ptr, ptr %115, align 8, !tbaa !25
  %117 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %116, i32 0, i32 2
  %118 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %117, i32 0, i32 1
  %119 = load i64, ptr %118, align 8, !tbaa !16
  call void @_ZN10ClipperLib11ClipperBase14InsertScanbeamEx(ptr noundef nonnull align 8 dereferenceable(144) %113, i64 noundef %119)
  br label %120

120:                                              ; preds = %109, %103
  br label %130

121:                                              ; preds = %100
  %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 2
  %128 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %127, i32 0, i32 1
  %129 = load i64, ptr %128, align 8, !tbaa !16
  call void @_ZN10ClipperLib11ClipperBase14InsertScanbeamEx(ptr noundef nonnull align 8 dereferenceable(144) %125, i64 noundef %129)
  br label %130

130:                                              ; preds = %121, %120
  br label %131

131:                                              ; preds = %130, %97
  %132 = load ptr, ptr %6, align 8, !tbaa !5
  %133 = icmp ne ptr %132, null
  br i1 %133, label %134, label %137

134:                                              ; preds = %131
  %135 = load ptr, ptr %7, align 8, !tbaa !5
  %136 = icmp ne ptr %135, null
  br i1 %136, label %138, label %137

137:                                              ; preds = %134, %131
  store i32 2, ptr %9, align 4
  br label %389, !llvm.loop !26

138:                                              ; preds = %134
  %139 = load ptr, ptr %8, align 8, !tbaa !5
  %140 = icmp ne ptr %139, null
  br i1 %140, label %141, label %200

141:                                              ; preds = %138
  %142 = load ptr, ptr %7, align 8, !tbaa !5
  %143 = call noundef zeroext i1 @_ZN10ClipperLib12IsHorizontalERNS_5TEdgeE(ptr noundef nonnull align 8 dereferenceable(136) %142)
  br i1 %143, label %144, label %200

144:                                              ; preds = %141
  %145 = getelementptr inbounds %"class.ClipperLib::Clipper", ptr %26, i32 0, i32 2
  %146 = call noundef i64 @_ZNKSt6vectorIPN10ClipperLib4JoinESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %145) #5
  %147 = icmp ugt i64 %146, 0
  br i1 %147, label %148, label %200

148:                                              ; preds = %144
  %149 = load ptr, ptr %7, align 8, !tbaa !5
  %150 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %149, i32 0, i32 6
  %151 = load i32, ptr %150, align 8, !tbaa !28
  %152 = icmp ne i32 %151, 0
  br i1 %152, label %153, label %200

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

154:                                              ; preds = %196, %153
  %155 = load i64, ptr %10, align 8, !tbaa !29
  %156 = getelementptr inbounds %"class.ClipperLib::Clipper", ptr %26, i32 0, i32 2
  %157 = call noundef i64 @_ZNKSt6vectorIPN10ClipperLib4JoinESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %156) #5
  %158 = icmp ult i64 %155, %157
  br i1 %158, label %160, label %159

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

160:                                              ; preds = %154
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %161 = getelementptr inbounds %"class.ClipperLib::Clipper", ptr %26, i32 0, i32 2
  %162 = load i64, ptr %10, align 8, !tbaa !29
  %163 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10ClipperLib4JoinESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %161, i64 noundef %162) #5
  %164 = load ptr, ptr %163, align 8, !tbaa !5
  store ptr %164, ptr %11, align 8, !tbaa !5
  %165 = load ptr, ptr %11, align 8, !tbaa !5
  %166 = getelementptr inbounds %"struct.ClipperLib::Join", ptr %165, i32 0, i32 0
  %167 = load ptr, ptr %166, align 8, !tbaa !31
  %168 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %167, i32 0, i32 1
  %169 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %168, i32 0, i32 0
  %170 = load i64, ptr %169, align 8, !tbaa !33
  %171 = load ptr, ptr %11, align 8, !tbaa !5
  %172 = getelementptr inbounds %"struct.ClipperLib::Join", ptr %171, i32 0, i32 2
  %173 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %172, i32 0, i32 0
  %174 = load i64, ptr %173, align 8, !tbaa !35
  %175 = load ptr, ptr %7, align 8, !tbaa !5
  %176 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %175, i32 0, i32 0
  %177 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %176, i32 0, i32 0
  %178 = load i64, ptr %177, align 8, !tbaa !36
  %179 = load ptr, ptr %7, align 8, !tbaa !5
  %180 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %179, i32 0, i32 2
  %181 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %180, i32 0, i32 0
  %182 = load i64, ptr %181, align 8, !tbaa !37
  %183 = call noundef zeroext i1 @_ZN10ClipperLib19HorzSegmentsOverlapExxxx(i64 noundef %170, i64 noundef %174, i64 noundef %178, i64 noundef %182)
  br i1 %183, label %184, label %195

184:                                              ; preds = %160
  %185 = load ptr, ptr %11, align 8, !tbaa !5
  %186 = getelementptr inbounds %"struct.ClipperLib::Join", ptr %185, i32 0, i32 0
  %187 = load ptr, ptr %186, align 8, !tbaa !31
  %188 = load ptr, ptr %8, align 8, !tbaa !5
  %189 = load ptr, ptr %11, align 8, !tbaa !5
  %190 = getelementptr inbounds %"struct.ClipperLib::Join", ptr %189, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %190, i64 16, i1 false), !tbaa.struct !38
  %191 = getelementptr inbounds { i64, i64 }, ptr %12, i32 0, i32 0
  %192 = load i64, ptr %191, align 8
  %193 = getelementptr inbounds { i64, i64 }, ptr %12, i32 0, i32 1
  %194 = load i64, ptr %193, align 8
  call void @_ZN10ClipperLib7Clipper7AddJoinEPNS_5OutPtES2_NS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef %187, ptr noundef %188, i64 %192, i64 %194)
  br label %195

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

196:                                              ; preds = %195
  %197 = load i64, ptr %10, align 8, !tbaa !29
  %198 = add i64 %197, 1
  store i64 %198, ptr %10, align 8, !tbaa !29
  br label %154, !llvm.loop !39

199:                                              ; preds = %159
  br label %200

200:                                              ; preds = %199, %148, %144, %141, %138
  %201 = load ptr, ptr %6, align 8, !tbaa !5
  %202 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %201, i32 0, i32 9
  %203 = load i32, ptr %202, align 4, !tbaa !40
  %204 = icmp sge i32 %203, 0
  br i1 %204, label %205, label %289

205:                                              ; preds = %200
  %206 = load ptr, ptr %6, align 8, !tbaa !5
  %207 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %206, i32 0, i32 14
  %208 = load ptr, ptr %207, align 8, !tbaa !41
  %209 = icmp ne ptr %208, null
  br i1 %209, label %210, label %289

210:                                              ; preds = %205
  %211 = load ptr, ptr %6, align 8, !tbaa !5
  %212 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %211, i32 0, i32 14
  %213 = load ptr, ptr %212, align 8, !tbaa !41
  %214 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %213, i32 0, i32 1
  %215 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %214, i32 0, i32 0
  %216 = load i64, ptr %215, align 8, !tbaa !42
  %217 = load ptr, ptr %6, align 8, !tbaa !5
  %218 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %217, i32 0, i32 0
  %219 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %218, i32 0, i32 0
  %220 = load i64, ptr %219, align 8, !tbaa !36
  %221 = icmp eq i64 %216, %220
  br i1 %221, label %222, label %289

222:                                              ; preds = %210
  %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 9
  %227 = load i32, ptr %226, align 4, !tbaa !40
  %228 = icmp sge i32 %227, 0
  br i1 %228, label %229, label %289

229:                                              ; preds = %222
  %230 = load ptr, ptr %6, align 8, !tbaa !5
  %231 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %230, i32 0, i32 14
  %232 = load ptr, ptr %231, align 8, !tbaa !41
  %233 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %232, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 %233, i64 16, i1 false), !tbaa.struct !38
  %234 = load ptr, ptr %6, align 8, !tbaa !5
  %235 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %234, i32 0, i32 14
  %236 = load ptr, ptr %235, align 8, !tbaa !41
  %237 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %236, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 8 %237, i64 16, i1 false), !tbaa.struct !38
  %238 = load ptr, ptr %6, align 8, !tbaa !5
  %239 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %238, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %239, i64 16, i1 false), !tbaa.struct !38
  %240 = load ptr, ptr %6, align 8, !tbaa !5
  %241 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %240, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 %241, i64 16, i1 false), !tbaa.struct !38
  %242 = load ptr, ptr %26, align 8, !tbaa !11
  %243 = getelementptr i8, ptr %242, i64 -24
  %244 = load i64, ptr %243, align 8
  %245 = getelementptr inbounds i8, ptr %26, i64 %244
  %246 = getelementptr inbounds %"class.ClipperLib::ClipperBase", ptr %245, i32 0, i32 3
  %247 = load i8, ptr %246, align 8, !tbaa !43, !range !65, !noundef !66
  %248 = trunc i8 %247 to i1
  %249 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 0
  %250 = load i64, ptr %249, align 8
  %251 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 1
  %252 = load i64, ptr %251, align 8
  %253 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 0
  %254 = load i64, ptr %253, align 8
  %255 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 1
  %256 = load i64, ptr %255, align 8
  %257 = getelementptr inbounds { i64, i64 }, ptr %15, i32 0, i32 0
  %258 = load i64, ptr %257, align 8
  %259 = getelementptr inbounds { i64, i64 }, ptr %15, i32 0, i32 1
  %260 = load i64, ptr %259, align 8
  %261 = call noundef zeroext i1 @_ZN10ClipperLib11SlopesEqualENS_8IntPointES0_S0_S0_b(i64 %250, i64 %252, i64 %254, i64 %256, i64 %258, i64 %260, ptr noundef byval(%"struct.ClipperLib::IntPoint") align 8 %16, i1 noundef zeroext %248)
  br i1 %261, label %262, label %289

262:                                              ; preds = %229
  %263 = load ptr, ptr %6, align 8, !tbaa !5
  %264 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %263, i32 0, i32 6
  %265 = load i32, ptr %264, align 8, !tbaa !28
  %266 = icmp ne i32 %265, 0
  br i1 %266, label %267, label %289

267:                                              ; preds = %262
  %268 = load ptr, ptr %6, align 8, !tbaa !5
  %269 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %268, i32 0, i32 14
  %270 = load ptr, ptr %269, align 8, !tbaa !41
  %271 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %270, i32 0, i32 6
  %272 = load i32, ptr %271, align 8, !tbaa !28
  %273 = icmp ne i32 %272, 0
  br i1 %273, label %274, label %289

274:                                              ; preds = %267
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %275 = load ptr, ptr %6, align 8, !tbaa !5
  %276 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %275, i32 0, i32 14
  %277 = load ptr, ptr %276, align 8, !tbaa !41
  %278 = load ptr, ptr %6, align 8, !tbaa !5
  %279 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %278, i32 0, i32 0
  %280 = call noundef ptr @_ZN10ClipperLib7Clipper8AddOutPtEPNS_5TEdgeERKNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef %277, ptr noundef nonnull align 8 dereferenceable(16) %279)
  store ptr %280, ptr %17, align 8, !tbaa !5
  %281 = load ptr, ptr %8, align 8, !tbaa !5
  %282 = load ptr, ptr %17, align 8, !tbaa !5
  %283 = load ptr, ptr %6, align 8, !tbaa !5
  %284 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %283, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 8 %284, i64 16, i1 false), !tbaa.struct !38
  %285 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 0
  %286 = load i64, ptr %285, align 8
  %287 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 1
  %288 = load i64, ptr %287, align 8
  call void @_ZN10ClipperLib7Clipper7AddJoinEPNS_5OutPtES2_NS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef %281, ptr noundef %282, i64 %286, i64 %288)
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %289

289:                                              ; preds = %274, %267, %262, %229, %222, %210, %205, %200
  %290 = load ptr, ptr %6, align 8, !tbaa !5
  %291 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %290, i32 0, i32 13
  %292 = load ptr, ptr %291, align 8, !tbaa !67
  %293 = load ptr, ptr %7, align 8, !tbaa !5
  %294 = icmp ne ptr %292, %293
  br i1 %294, label %295, label %388

295:                                              ; preds = %289
  %296 = load ptr, ptr %7, align 8, !tbaa !5
  %297 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %296, i32 0, i32 9
  %298 = load i32, ptr %297, align 4, !tbaa !40
  %299 = icmp sge i32 %298, 0
  br i1 %299, label %300, label %367

300:                                              ; preds = %295
  %301 = load ptr, ptr %7, align 8, !tbaa !5
  %302 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %301, i32 0, i32 14
  %303 = load ptr, ptr %302, align 8, !tbaa !41
  %304 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %303, i32 0, i32 9
  %305 = load i32, ptr %304, align 4, !tbaa !40
  %306 = icmp sge i32 %305, 0
  br i1 %306, label %307, label %367

307:                                              ; preds = %300
  %308 = load ptr, ptr %7, align 8, !tbaa !5
  %309 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %308, i32 0, i32 14
  %310 = load ptr, ptr %309, align 8, !tbaa !41
  %311 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %310, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %311, i64 16, i1 false), !tbaa.struct !38
  %312 = load ptr, ptr %7, align 8, !tbaa !5
  %313 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %312, i32 0, i32 14
  %314 = load ptr, ptr %313, align 8, !tbaa !41
  %315 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %314, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %315, i64 16, i1 false), !tbaa.struct !38
  %316 = load ptr, ptr %7, align 8, !tbaa !5
  %317 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %316, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %317, i64 16, i1 false), !tbaa.struct !38
  %318 = load ptr, ptr %7, align 8, !tbaa !5
  %319 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %318, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %22, ptr align 8 %319, i64 16, i1 false), !tbaa.struct !38
  %320 = load ptr, ptr %26, align 8, !tbaa !11
  %321 = getelementptr i8, ptr %320, i64 -24
  %322 = load i64, ptr %321, align 8
  %323 = getelementptr inbounds i8, ptr %26, i64 %322
  %324 = getelementptr inbounds %"class.ClipperLib::ClipperBase", ptr %323, i32 0, i32 3
  %325 = load i8, ptr %324, align 8, !tbaa !43, !range !65, !noundef !66
  %326 = trunc i8 %325 to i1
  %327 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 0
  %328 = load i64, ptr %327, align 8
  %329 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 1
  %330 = load i64, ptr %329, align 8
  %331 = getelementptr inbounds { i64, i64 }, ptr %20, i32 0, i32 0
  %332 = load i64, ptr %331, align 8
  %333 = getelementptr inbounds { i64, i64 }, ptr %20, i32 0, i32 1
  %334 = load i64, ptr %333, align 8
  %335 = getelementptr inbounds { i64, i64 }, ptr %21, i32 0, i32 0
  %336 = load i64, ptr %335, align 8
  %337 = getelementptr inbounds { i64, i64 }, ptr %21, i32 0, i32 1
  %338 = load i64, ptr %337, align 8
  %339 = call noundef zeroext i1 @_ZN10ClipperLib11SlopesEqualENS_8IntPointES0_S0_S0_b(i64 %328, i64 %330, i64 %332, i64 %334, i64 %336, i64 %338, ptr noundef byval(%"struct.ClipperLib::IntPoint") align 8 %22, i1 noundef zeroext %326)
  br i1 %339, label %340, label %367

340:                                              ; preds = %307
  %341 = load ptr, ptr %7, align 8, !tbaa !5
  %342 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %341, i32 0, i32 6
  %343 = load i32, ptr %342, align 8, !tbaa !28
  %344 = icmp ne i32 %343, 0
  br i1 %344, label %345, label %367

345:                                              ; preds = %340
  %346 = load ptr, ptr %7, align 8, !tbaa !5
  %347 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %346, i32 0, i32 14
  %348 = load ptr, ptr %347, align 8, !tbaa !41
  %349 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %348, i32 0, i32 6
  %350 = load i32, ptr %349, align 8, !tbaa !28
  %351 = icmp ne i32 %350, 0
  br i1 %351, label %352, label %367

352:                                              ; preds = %345
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %353 = load ptr, ptr %7, align 8, !tbaa !5
  %354 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %353, i32 0, i32 14
  %355 = load ptr, ptr %354, align 8, !tbaa !41
  %356 = load ptr, ptr %7, align 8, !tbaa !5
  %357 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %356, i32 0, i32 0
  %358 = call noundef ptr @_ZN10ClipperLib7Clipper8AddOutPtEPNS_5TEdgeERKNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef %355, ptr noundef nonnull align 8 dereferenceable(16) %357)
  store ptr %358, ptr %23, align 8, !tbaa !5
  %359 = load ptr, ptr %8, align 8, !tbaa !5
  %360 = load ptr, ptr %23, align 8, !tbaa !5
  %361 = load ptr, ptr %7, align 8, !tbaa !5
  %362 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %361, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %24, ptr align 8 %362, i64 16, i1 false), !tbaa.struct !38
  %363 = getelementptr inbounds { i64, i64 }, ptr %24, i32 0, i32 0
  %364 = load i64, ptr %363, align 8
  %365 = getelementptr inbounds { i64, i64 }, ptr %24, i32 0, i32 1
  %366 = load i64, ptr %365, align 8
  call void @_ZN10ClipperLib7Clipper7AddJoinEPNS_5OutPtES2_NS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef %359, ptr noundef %360, i64 %364, i64 %366)
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  br label %367

367:                                              ; preds = %352, %345, %340, %307, %300, %295
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %368 = load ptr, ptr %6, align 8, !tbaa !5
  %369 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %368, i32 0, i32 13
  %370 = load ptr, ptr %369, align 8, !tbaa !67
  store ptr %370, ptr %25, align 8, !tbaa !5
  %371 = load ptr, ptr %25, align 8, !tbaa !5
  %372 = icmp ne ptr %371, null
  br i1 %372, label %373, label %387

373:                                              ; preds = %367
  br label %374

374:                                              ; preds = %378, %373
  %375 = load ptr, ptr %25, align 8, !tbaa !5
  %376 = load ptr, ptr %7, align 8, !tbaa !5
  %377 = icmp ne ptr %375, %376
  br i1 %377, label %378, label %386

378:                                              ; preds = %374
  %379 = load ptr, ptr %7, align 8, !tbaa !5
  %380 = load ptr, ptr %25, align 8, !tbaa !5
  %381 = load ptr, ptr %6, align 8, !tbaa !5
  %382 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %381, i32 0, i32 1
  call void @_ZN10ClipperLib7Clipper14IntersectEdgesEPNS_5TEdgeES2_RNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %26, ptr noundef %379, ptr noundef %380, ptr noundef nonnull align 8 dereferenceable(16) %382)
  %383 = load ptr, ptr %25, align 8, !tbaa !5
  %384 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %383, i32 0, i32 13
  %385 = load ptr, ptr %384, align 8, !tbaa !67
  store ptr %385, ptr %25, align 8, !tbaa !5
  br label %374, !llvm.loop !68

386:                                              ; preds = %374
  br label %387

387:                                              ; preds = %386, %367
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  br label %388

388:                                              ; preds = %387, %289
  store i32 0, ptr %9, align 4
  br label %389

389:                                              ; preds = %388, %137
  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
  %390 = load i32, ptr %9, align 4
  switch i32 %390, label %393 [
    i32 0, label %391
    i32 2, label %27
  ]

391:                                              ; preds = %389
  br label %27, !llvm.loop !26

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

393:                                              ; preds = %389
  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.ph134, label %._crit_edge

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

10:                                               ; preds = %.lr.ph134, %.thread125
  %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
  %16 = icmp ne ptr %13, null
  %17 = icmp ne ptr %15, null
  %or.cond = select i1 %16, i1 %17, i1 false
  br i1 %or.cond, label %22, label %18

18:                                               ; 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)
  %19 = call noundef zeroext i1 @_ZNK10ClipperLib7Clipper14IsContributingERKNS_5TEdgeE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef nonnull align 8 dereferenceable(136) %15)
  br i1 %19, label %20, label %35

20:                                               ; preds = %18
  %21 = 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 %35

22:                                               ; preds = %10
  call void @_ZN10ClipperLib7Clipper17InsertEdgeIntoAELEPNS_5TEdgeES2_(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef nonnull %13, ptr noundef null)
  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)
  %23 = getelementptr inbounds i8, ptr %13, i64 68
  %24 = getelementptr inbounds i8, ptr %15, i64 68
  %25 = load <2 x i32>, ptr %23, align 4, !tbaa !15
  store <2 x i32> %25, ptr %24, align 4, !tbaa !15
  %26 = call noundef zeroext i1 @_ZNK10ClipperLib7Clipper14IsContributingERKNS_5TEdgeE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef nonnull align 8 dereferenceable(136) %13)
  br i1 %26, label %27, label %.thread

27:                                               ; preds = %22
  %28 = 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 = %22, %27
  %.1 = phi ptr [ %28, %27 ], [ null, %22 ]
  %29 = load ptr, ptr %0, align 8, !tbaa !5
  %30 = getelementptr i8, ptr %29, i64 -24
  %31 = load i64, ptr %30, align 8
  %32 = getelementptr inbounds i8, ptr %0, i64 %31
  %33 = getelementptr inbounds i8, ptr %13, i64 40
  %34 = load i64, ptr %33, align 8, !tbaa !17
  call void @_ZN10ClipperLib11ClipperBase14InsertScanbeamEx(ptr noundef nonnull align 8 dereferenceable(144) %32, i64 noundef %34)
  br label %42

35:                                               ; preds = %18, %20
  %.0101 = phi ptr [ %21, %20 ], [ null, %18 ]
  %36 = load ptr, ptr %0, align 8, !tbaa !5
  %37 = getelementptr i8, ptr %36, i64 -24
  %38 = load i64, ptr %37, align 8
  %39 = getelementptr inbounds i8, ptr %0, i64 %38
  %40 = getelementptr inbounds i8, ptr %13, i64 40
  %41 = load i64, ptr %40, align 8, !tbaa !17
  call void @_ZN10ClipperLib11ClipperBase14InsertScanbeamEx(ptr noundef nonnull align 8 dereferenceable(144) %39, i64 noundef %41)
  br i1 %17, label %42, label %.thread125

42:                                               ; preds = %.thread, %35
  %.2124 = phi ptr [ %.1, %.thread ], [ %.0101, %35 ]
  %43 = call noundef zeroext i1 @_ZN10ClipperLib12IsHorizontalERNS_5TEdgeE(ptr noundef nonnull align 8 dereferenceable(136) %15)
  br i1 %43, label %44, label %.sink.split

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

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

53:                                               ; preds = %.sink.split, %44
  %.not111 = icmp eq ptr %.2124, null
  br i1 %.not111, label %.loopexit, label %54

54:                                               ; preds = %53
  %55 = call noundef zeroext i1 @_ZN10ClipperLib12IsHorizontalERNS_5TEdgeE(ptr noundef nonnull align 8 dereferenceable(136) %15)
  br i1 %55, label %56, label %.loopexit

56:                                               ; preds = %54
  %57 = call noundef i64 @_ZNKSt6vectorIPN10ClipperLib4JoinESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  %.not112 = icmp eq i64 %57, 0
  br i1 %.not112, label %.loopexit, label %58

58:                                               ; preds = %56
  %59 = getelementptr inbounds i8, ptr %15, i64 64
  %60 = load i32, ptr %59, align 8, !tbaa !24
  %.not113 = icmp eq i32 %60, 0
  br i1 %.not113, label %.loopexit, label %.preheader127

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

.lr.ph:                                           ; preds = %.preheader127
  %62 = getelementptr inbounds i8, ptr %15, i64 32
  br label %63

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

74:                                               ; preds = %63
  %75 = load ptr, ptr %65, align 8, !tbaa !25
  %.sroa.023.0.copyload = load i64, ptr %69, align 8, !tbaa !32
  %.sroa.224.0..sroa_idx = getelementptr inbounds i8, ptr %65, i64 24
  %.sroa.224.0.copyload = load i64, ptr %.sroa.224.0..sroa_idx, align 8, !tbaa !32
  call void @_ZN10ClipperLib7Clipper7AddJoinEPNS_5OutPtES2_NS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef %75, ptr noundef nonnull %.2124, i64 %.sroa.023.0.copyload, i64 %.sroa.224.0.copyload)
  br label %76

76:                                               ; preds = %74, %63
  %77 = add nuw i64 %.0102128, 1
  %78 = call noundef i64 @_ZNKSt6vectorIPN10ClipperLib4JoinESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  %79 = icmp ult i64 %77, %78
  br i1 %79, label %63, label %.loopexit, !llvm.loop !33

.loopexit:                                        ; preds = %76, %.preheader127, %58, %56, %54, %53
  %80 = getelementptr inbounds i8, ptr %13, i64 76
  %81 = load i32, ptr %80, align 4, !tbaa !35
  %82 = icmp sgt i32 %81, -1
  br i1 %82, label %83, label %114

83:                                               ; preds = %.loopexit
  %84 = getelementptr inbounds i8, ptr %13, i64 112
  %85 = load ptr, ptr %84, align 8, !tbaa !36
  %.not114 = icmp eq ptr %85, null
  br i1 %.not114, label %114, label %86

86:                                               ; preds = %83
  %87 = getelementptr inbounds i8, ptr %85, i64 16
  %88 = load i64, ptr %87, align 8, !tbaa !37
  %89 = load i64, ptr %13, align 8, !tbaa !30
  %90 = icmp eq i64 %88, %89
  br i1 %90, label %91, label %114

91:                                               ; preds = %86
  %92 = getelementptr inbounds i8, ptr %85, i64 76
  %93 = load i32, ptr %92, align 4, !tbaa !35
  %94 = icmp sgt i32 %93, -1
  br i1 %94, label %95, label %114

95:                                               ; preds = %91
  %.sroa.021.0.copyload = load i64, ptr %85, align 8, !tbaa !32
  %.sroa.222.0..sroa_idx = getelementptr inbounds i8, ptr %85, i64 8
  %.sroa.222.0.copyload = load i64, ptr %.sroa.222.0..sroa_idx, align 8, !tbaa !32
  %96 = getelementptr inbounds i8, ptr %85, i64 32
  %.sroa.019.0.copyload = load i64, ptr %96, align 8, !tbaa !32
  %.sroa.220.0..sroa_idx = getelementptr inbounds i8, ptr %85, i64 40
  %.sroa.220.0.copyload = load i64, ptr %.sroa.220.0..sroa_idx, align 8, !tbaa !32
  %97 = getelementptr inbounds i8, ptr %13, i64 16
  %.sroa.017.0.copyload = load i64, ptr %97, align 8, !tbaa !32
  %.sroa.218.0..sroa_idx = getelementptr inbounds i8, ptr %13, i64 24
  %.sroa.218.0.copyload = load i64, ptr %.sroa.218.0..sroa_idx, align 8, !tbaa !32
  %98 = getelementptr inbounds i8, ptr %13, i64 32
  %99 = load ptr, ptr %0, align 8, !tbaa !5
  %100 = getelementptr i8, ptr %99, i64 -24
  %101 = load i64, ptr %100, align 8
  %gep = getelementptr i8, ptr %invariant.gep, i64 %101
  %102 = load i8, ptr %gep, align 8, !tbaa !38, !range !60, !noundef !61
  %103 = trunc nuw i8 %102 to i1
  %104 = call noundef zeroext i1 @_ZN10ClipperLib11SlopesEqualENS_8IntPointES0_S0_S0_b(i64 %.sroa.021.0.copyload, i64 %.sroa.222.0.copyload, i64 %.sroa.019.0.copyload, i64 %.sroa.220.0.copyload, i64 %.sroa.017.0.copyload, i64 %.sroa.218.0.copyload, ptr noundef nonnull byval(%"struct.ClipperLib::IntPoint") align 8 %98, i1 noundef zeroext %103)
  br i1 %104, label %105, label %114

105:                                              ; preds = %95
  %106 = getelementptr inbounds i8, ptr %13, i64 64
  %107 = load i32, ptr %106, align 8, !tbaa !24
  %.not115 = icmp eq i32 %107, 0
  br i1 %.not115, label %114, label %108

108:                                              ; preds = %105
  %109 = load ptr, ptr %84, align 8, !tbaa !36
  %110 = getelementptr inbounds i8, ptr %109, i64 64
  %111 = load i32, ptr %110, align 8, !tbaa !24
  %.not116 = icmp eq i32 %111, 0
  br i1 %.not116, label %114, label %112

112:                                              ; preds = %108
  %113 = call noundef ptr @_ZN10ClipperLib7Clipper8AddOutPtEPNS_5TEdgeERKNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef nonnull %109, ptr noundef nonnull align 8 dereferenceable(16) %13)
  %.sroa.014.0.copyload = load i64, ptr %98, align 8, !tbaa !32
  %.sroa.215.0..sroa_idx = getelementptr inbounds i8, ptr %13, i64 40
  %.sroa.215.0.copyload = load i64, ptr %.sroa.215.0..sroa_idx, align 8, !tbaa !32
  call void @_ZN10ClipperLib7Clipper7AddJoinEPNS_5OutPtES2_NS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef %.2124, ptr noundef %113, i64 %.sroa.014.0.copyload, i64 %.sroa.215.0.copyload)
  br label %114

114:                                              ; preds = %112, %108, %105, %95, %91, %86, %83, %.loopexit
  %115 = getelementptr inbounds i8, ptr %13, i64 104
  %116 = load ptr, ptr %115, align 8, !tbaa !62
  %.not117 = icmp eq ptr %116, %15
  br i1 %.not117, label %.thread125, label %117

117:                                              ; preds = %114
  %118 = getelementptr inbounds i8, ptr %15, i64 76
  %119 = load i32, ptr %118, align 4, !tbaa !35
  %120 = icmp sgt i32 %119, -1
  br i1 %120, label %121, label %147

121:                                              ; preds = %117
  %122 = getelementptr inbounds i8, ptr %15, i64 112
  %123 = load ptr, ptr %122, align 8, !tbaa !36
  %124 = getelementptr inbounds i8, ptr %123, i64 76
  %125 = load i32, ptr %124, align 4, !tbaa !35
  %126 = icmp sgt i32 %125, -1
  br i1 %126, label %127, label %147

127:                                              ; preds = %121
  %128 = getelementptr inbounds i8, ptr %123, i64 16
  %.sroa.012.0.copyload = load i64, ptr %128, align 8, !tbaa !32
  %.sroa.213.0..sroa_idx = getelementptr inbounds i8, ptr %123, i64 24
  %.sroa.213.0.copyload = load i64, ptr %.sroa.213.0..sroa_idx, align 8, !tbaa !32
  %129 = getelementptr inbounds i8, ptr %123, i64 32
  %.sroa.010.0.copyload = load i64, ptr %129, align 8, !tbaa !32
  %.sroa.211.0..sroa_idx = getelementptr inbounds i8, ptr %123, i64 40
  %.sroa.211.0.copyload = load i64, ptr %.sroa.211.0..sroa_idx, align 8, !tbaa !32
  %130 = getelementptr inbounds i8, ptr %15, i64 16
  %.sroa.08.0.copyload = load i64, ptr %130, align 8, !tbaa !32
  %.sroa.29.0..sroa_idx = getelementptr inbounds i8, ptr %15, i64 24
  %.sroa.29.0.copyload = load i64, ptr %.sroa.29.0..sroa_idx, align 8, !tbaa !32
  %131 = getelementptr inbounds i8, ptr %15, i64 32
  %132 = load ptr, ptr %0, align 8, !tbaa !5
  %133 = getelementptr i8, ptr %132, i64 -24
  %134 = load i64, ptr %133, align 8
  %gep133 = getelementptr i8, ptr %invariant.gep, i64 %134
  %135 = load i8, ptr %gep133, align 8, !tbaa !38, !range !60, !noundef !61
  %136 = trunc nuw i8 %135 to i1
  %137 = call noundef zeroext i1 @_ZN10ClipperLib11SlopesEqualENS_8IntPointES0_S0_S0_b(i64 %.sroa.012.0.copyload, i64 %.sroa.213.0.copyload, i64 %.sroa.010.0.copyload, i64 %.sroa.211.0.copyload, i64 %.sroa.08.0.copyload, i64 %.sroa.29.0.copyload, ptr noundef nonnull byval(%"struct.ClipperLib::IntPoint") align 8 %131, i1 noundef zeroext %136)
  br i1 %137, label %138, label %147

138:                                              ; preds = %127
  %139 = getelementptr inbounds i8, ptr %15, i64 64
  %140 = load i32, ptr %139, align 8, !tbaa !24
  %.not118 = icmp eq i32 %140, 0
  br i1 %.not118, label %147, label %141

141:                                              ; preds = %138
  %142 = load ptr, ptr %122, align 8, !tbaa !36
  %143 = getelementptr inbounds i8, ptr %142, i64 64
  %144 = load i32, ptr %143, align 8, !tbaa !24
  %.not119 = icmp eq i32 %144, 0
  br i1 %.not119, label %147, label %145

145:                                              ; preds = %141
  %146 = call noundef ptr @_ZN10ClipperLib7Clipper8AddOutPtEPNS_5TEdgeERKNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef nonnull %142, ptr noundef nonnull align 8 dereferenceable(16) %15)
  %.sroa.0.0.copyload = load i64, ptr %131, align 8, !tbaa !32
  %.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 !32
  call void @_ZN10ClipperLib7Clipper7AddJoinEPNS_5OutPtES2_NS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef %.2124, ptr noundef %146, i64 %.sroa.0.0.copyload, i64 %.sroa.2.0.copyload)
  br label %147

147:                                              ; preds = %145, %141, %138, %127, %121, %117
  %148 = load ptr, ptr %115, align 8, !tbaa !62
  %.not120 = icmp eq ptr %148, null
  %.not121129 = icmp eq ptr %148, %15
  %or.cond135 = select i1 %.not120, i1 true, i1 %.not121129
  br i1 %or.cond135, label %.thread125, label %.lr.ph131

.lr.ph131:                                        ; preds = %147
  %149 = getelementptr inbounds i8, ptr %13, i64 16
  br label %150

150:                                              ; preds = %.lr.ph131, %150
  %.0130 = phi ptr [ %148, %.lr.ph131 ], [ %152, %150 ]
  call void @_ZN10ClipperLib7Clipper14IntersectEdgesEPNS_5TEdgeES2_RNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef nonnull %15, ptr noundef %.0130, ptr noundef nonnull align 8 dereferenceable(16) %149)
  %151 = getelementptr inbounds i8, ptr %.0130, i64 104
  %152 = load ptr, ptr %151, align 8, !tbaa !62
  %.not121 = icmp eq ptr %152, %15
  br i1 %.not121, label %.thread125, label %150, !llvm.loop !63

.thread125:                                       ; preds = %150, %35, %114, %147
  %153 = load ptr, ptr %0, align 8, !tbaa !5
  %154 = getelementptr i8, ptr %153, i64 -24
  %155 = load i64, ptr %154, align 8
  %156 = getelementptr inbounds i8, ptr %0, i64 %155
  %157 = call noundef zeroext i1 @_ZN10ClipperLib11ClipperBase14PopLocalMinimaExRPKNS_12LocalMinimumE(ptr noundef nonnull align 8 dereferenceable(144) %156, i64 noundef %1, ptr noundef nonnull align 8 dereferenceable(8) %3)
  br i1 %157, label %10, label %._crit_edge

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


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