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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.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::IntPoint" = type { i64, i64 }
%"struct.ClipperLib::OutPt" = type { i32, %"struct.ClipperLib::IntPoint", ptr, ptr }
%"struct.ClipperLib::OutRec" = type { i32, i8, i8, ptr, ptr, 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: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN10ClipperLib4AreaERKNS_6OutRecE(ptr noundef nonnull align 8 dereferenceable(40)) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10ClipperLib18ReversePolyPtLinksEPNS_5OutPtE(ptr noundef) #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10ClipperLib7Clipper15JoinCommonEdgesEv(ptr noundef nonnull align 8 dereferenceable(135) %0) #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %9 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  store i64 0, ptr %3, align 8, !tbaa !9
  br label %10

10:                                               ; preds = %276, %1
  %11 = load i64, ptr %3, align 8, !tbaa !9
  %12 = getelementptr inbounds %"class.ClipperLib::Clipper", ptr %9, i32 0, i32 1
  %13 = call noundef i64 @_ZNKSt6vectorIPN10ClipperLib4JoinESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #4
  %14 = icmp ult i64 %11, %13
  br i1 %14, label %16, label %15

15:                                               ; preds = %10
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  br label %279

16:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %17 = getelementptr inbounds %"class.ClipperLib::Clipper", ptr %9, i32 0, i32 1
  %18 = load i64, ptr %3, align 8, !tbaa !9
  %19 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10ClipperLib4JoinESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %18) #4
  %20 = load ptr, ptr %19, align 8, !tbaa !5
  store ptr %20, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = getelementptr inbounds %"struct.ClipperLib::Join", ptr %21, i32 0, i32 0
  %23 = load ptr, ptr %22, align 8, !tbaa !11
  %24 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %23, i32 0, i32 0
  %25 = load i32, ptr %24, align 8, !tbaa !15
  %26 = call noundef ptr @_ZN10ClipperLib7Clipper9GetOutRecEi(ptr noundef nonnull align 8 dereferenceable(135) %9, i32 noundef %25)
  store ptr %26, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = getelementptr inbounds %"struct.ClipperLib::Join", ptr %27, i32 0, i32 1
  %29 = load ptr, ptr %28, align 8, !tbaa !18
  %30 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %29, i32 0, i32 0
  %31 = load i32, ptr %30, align 8, !tbaa !15
  %32 = call noundef ptr @_ZN10ClipperLib7Clipper9GetOutRecEi(ptr noundef nonnull align 8 dereferenceable(135) %9, i32 noundef %31)
  store ptr %32, ptr %7, align 8, !tbaa !5
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %33, i32 0, i32 5
  %35 = load ptr, ptr %34, align 8, !tbaa !19
  %36 = icmp ne ptr %35, null
  br i1 %36, label %37, label %42

37:                                               ; preds = %16
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %38, i32 0, i32 5
  %40 = load ptr, ptr %39, align 8, !tbaa !19
  %41 = icmp ne ptr %40, null
  br i1 %41, label %43, label %42

42:                                               ; preds = %37, %16
  store i32 4, ptr %4, align 4
  br label %273

43:                                               ; preds = %37
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %44, i32 0, i32 2
  %46 = load i8, ptr %45, align 1, !tbaa !22, !range !23, !noundef !24
  %47 = trunc i8 %46 to i1
  br i1 %47, label %53, label %48

48:                                               ; preds = %43
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %49, i32 0, i32 2
  %51 = load i8, ptr %50, align 1, !tbaa !22, !range !23, !noundef !24
  %52 = trunc i8 %51 to i1
  br i1 %52, label %53, label %54

53:                                               ; preds = %48, %43
  store i32 4, ptr %4, align 4
  br label %273

54:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = load ptr, ptr %7, align 8, !tbaa !5
  %57 = icmp eq ptr %55, %56
  br i1 %57, label %58, label %60

58:                                               ; preds = %54
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %59, ptr %8, align 8, !tbaa !5
  br label %78

60:                                               ; preds = %54
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = call noundef zeroext i1 @_ZN10ClipperLib21OutRec1RightOfOutRec2EPNS_6OutRecES1_(ptr noundef %61, ptr noundef %62)
  br i1 %63, label %64, label %66

64:                                               ; preds = %60
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %65, ptr %8, align 8, !tbaa !5
  br label %77

66:                                               ; preds = %60
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = call noundef zeroext i1 @_ZN10ClipperLib21OutRec1RightOfOutRec2EPNS_6OutRecES1_(ptr noundef %67, ptr noundef %68)
  br i1 %69, label %70, label %72

70:                                               ; preds = %66
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %71, ptr %8, align 8, !tbaa !5
  br label %76

72:                                               ; preds = %66
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = call noundef ptr @_ZN10ClipperLib15GetLowermostRecEPNS_6OutRecES1_(ptr noundef %73, ptr noundef %74)
  store ptr %75, ptr %8, align 8, !tbaa !5
  br label %76

76:                                               ; preds = %72, %70
  br label %77

77:                                               ; preds = %76, %64
  br label %78

78:                                               ; preds = %77, %58
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = call noundef zeroext i1 @_ZN10ClipperLib7Clipper10JoinPointsEPNS_4JoinEPNS_6OutRecES4_(ptr noundef nonnull align 8 dereferenceable(135) %9, ptr noundef %79, ptr noundef %80, ptr noundef %81)
  br i1 %82, label %84, label %83

83:                                               ; preds = %78
  store i32 4, ptr %4, align 4
  br label %272

84:                                               ; preds = %78
  %85 = load ptr, ptr %6, align 8, !tbaa !5
  %86 = load ptr, ptr %7, align 8, !tbaa !5
  %87 = icmp eq ptr %85, %86
  br i1 %87, label %88, label %234

88:                                               ; preds = %84
  %89 = load ptr, ptr %5, align 8, !tbaa !5
  %90 = getelementptr inbounds %"struct.ClipperLib::Join", ptr %89, i32 0, i32 0
  %91 = load ptr, ptr %90, align 8, !tbaa !11
  %92 = load ptr, ptr %6, align 8, !tbaa !5
  %93 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %92, i32 0, i32 5
  store ptr %91, ptr %93, align 8, !tbaa !19
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %94, i32 0, i32 6
  store ptr null, ptr %95, align 8, !tbaa !25
  %96 = load ptr, ptr %9, align 8, !tbaa !26
  %97 = getelementptr i8, ptr %96, i64 -24
  %98 = load i64, ptr %97, align 8
  %99 = getelementptr inbounds i8, ptr %9, i64 %98
  %100 = call noundef ptr @_ZN10ClipperLib11ClipperBase12CreateOutRecEv(ptr noundef nonnull align 8 dereferenceable(144) %99)
  store ptr %100, ptr %7, align 8, !tbaa !5
  %101 = load ptr, ptr %5, align 8, !tbaa !5
  %102 = getelementptr inbounds %"struct.ClipperLib::Join", ptr %101, i32 0, i32 1
  %103 = load ptr, ptr %102, align 8, !tbaa !18
  %104 = load ptr, ptr %7, align 8, !tbaa !5
  %105 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %104, i32 0, i32 5
  store ptr %103, ptr %105, align 8, !tbaa !19
  %106 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN10ClipperLib15UpdateOutPtIdxsERNS_6OutRecE(ptr noundef nonnull align 8 dereferenceable(40) %106)
  %107 = load ptr, ptr %7, align 8, !tbaa !5
  %108 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %107, i32 0, i32 5
  %109 = load ptr, ptr %108, align 8, !tbaa !19
  %110 = load ptr, ptr %6, align 8, !tbaa !5
  %111 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %110, i32 0, i32 5
  %112 = load ptr, ptr %111, align 8, !tbaa !19
  %113 = call noundef zeroext i1 @_ZN10ClipperLib18Poly2ContainsPoly1EPNS_5OutPtES1_(ptr noundef %109, ptr noundef %112)
  br i1 %113, label %114, label %153

114:                                              ; preds = %88
  %115 = load ptr, ptr %6, align 8, !tbaa !5
  %116 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %115, i32 0, i32 1
  %117 = load i8, ptr %116, align 4, !tbaa !28, !range !23, !noundef !24
  %118 = trunc i8 %117 to i1
  %119 = xor i1 %118, true
  %120 = load ptr, ptr %7, align 8, !tbaa !5
  %121 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %120, i32 0, i32 1
  %122 = zext i1 %119 to i8
  store i8 %122, ptr %121, align 4, !tbaa !28
  %123 = load ptr, ptr %6, align 8, !tbaa !5
  %124 = load ptr, ptr %7, align 8, !tbaa !5
  %125 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %124, i32 0, i32 3
  store ptr %123, ptr %125, align 8, !tbaa !29
  %126 = getelementptr inbounds %"class.ClipperLib::Clipper", ptr %9, i32 0, i32 13
  %127 = load i8, ptr %126, align 1, !tbaa !30, !range !23, !noundef !24
  %128 = trunc i8 %127 to i1
  br i1 %128, label %129, label %132

129:                                              ; preds = %114
  %130 = load ptr, ptr %7, align 8, !tbaa !5
  %131 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN10ClipperLib7Clipper16FixupFirstLefts2EPNS_6OutRecES2_(ptr noundef nonnull align 8 dereferenceable(135) %9, ptr noundef %130, ptr noundef %131)
  br label %132

132:                                              ; preds = %129, %114
  %133 = load ptr, ptr %7, align 8, !tbaa !5
  %134 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %133, i32 0, i32 1
  %135 = load i8, ptr %134, align 4, !tbaa !28, !range !23, !noundef !24
  %136 = trunc i8 %135 to i1
  %137 = zext i1 %136 to i32
  %138 = getelementptr inbounds %"class.ClipperLib::Clipper", ptr %9, i32 0, i32 12
  %139 = load i8, ptr %138, align 4, !tbaa !47, !range !23, !noundef !24
  %140 = trunc i8 %139 to i1
  %141 = zext i1 %140 to i32
  %142 = xor i32 %137, %141
  %143 = load ptr, ptr %7, align 8, !tbaa !5
  %144 = call noundef double @_ZN10ClipperLib4AreaERKNS_6OutRecE(ptr noundef nonnull align 8 dereferenceable(40) %143)
  %145 = fcmp ogt double %144, 0.000000e+00
  %146 = zext i1 %145 to i32
  %147 = icmp eq i32 %142, %146
  br i1 %147, label %148, label %152

148:                                              ; preds = %132
  %149 = load ptr, ptr %7, align 8, !tbaa !5
  %150 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %149, i32 0, i32 5
  %151 = load ptr, ptr %150, align 8, !tbaa !19
  call void @_ZN10ClipperLib18ReversePolyPtLinksEPNS_5OutPtE(ptr noundef %151)
  br label %152

152:                                              ; preds = %148, %132
  br label %233

153:                                              ; preds = %88
  %154 = load ptr, ptr %6, align 8, !tbaa !5
  %155 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %154, i32 0, i32 5
  %156 = load ptr, ptr %155, align 8, !tbaa !19
  %157 = load ptr, ptr %7, align 8, !tbaa !5
  %158 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %157, i32 0, i32 5
  %159 = load ptr, ptr %158, align 8, !tbaa !19
  %160 = call noundef zeroext i1 @_ZN10ClipperLib18Poly2ContainsPoly1EPNS_5OutPtES1_(ptr noundef %156, ptr noundef %159)
  br i1 %160, label %161, label %212

161:                                              ; preds = %153
  %162 = load ptr, ptr %6, align 8, !tbaa !5
  %163 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %162, i32 0, i32 1
  %164 = load i8, ptr %163, align 4, !tbaa !28, !range !23, !noundef !24
  %165 = trunc i8 %164 to i1
  %166 = load ptr, ptr %7, align 8, !tbaa !5
  %167 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %166, i32 0, i32 1
  %168 = zext i1 %165 to i8
  store i8 %168, ptr %167, align 4, !tbaa !28
  %169 = load ptr, ptr %7, align 8, !tbaa !5
  %170 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %169, i32 0, i32 1
  %171 = load i8, ptr %170, align 4, !tbaa !28, !range !23, !noundef !24
  %172 = trunc i8 %171 to i1
  %173 = xor i1 %172, true
  %174 = load ptr, ptr %6, align 8, !tbaa !5
  %175 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %174, i32 0, i32 1
  %176 = zext i1 %173 to i8
  store i8 %176, ptr %175, align 4, !tbaa !28
  %177 = load ptr, ptr %6, align 8, !tbaa !5
  %178 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %177, i32 0, i32 3
  %179 = load ptr, ptr %178, align 8, !tbaa !29
  %180 = load ptr, ptr %7, align 8, !tbaa !5
  %181 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %180, i32 0, i32 3
  store ptr %179, ptr %181, align 8, !tbaa !29
  %182 = load ptr, ptr %7, align 8, !tbaa !5
  %183 = load ptr, ptr %6, align 8, !tbaa !5
  %184 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %183, i32 0, i32 3
  store ptr %182, ptr %184, align 8, !tbaa !29
  %185 = getelementptr inbounds %"class.ClipperLib::Clipper", ptr %9, i32 0, i32 13
  %186 = load i8, ptr %185, align 1, !tbaa !30, !range !23, !noundef !24
  %187 = trunc i8 %186 to i1
  br i1 %187, label %188, label %191

188:                                              ; preds = %161
  %189 = load ptr, ptr %6, align 8, !tbaa !5
  %190 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN10ClipperLib7Clipper16FixupFirstLefts2EPNS_6OutRecES2_(ptr noundef nonnull align 8 dereferenceable(135) %9, ptr noundef %189, ptr noundef %190)
  br label %191

191:                                              ; preds = %188, %161
  %192 = load ptr, ptr %6, align 8, !tbaa !5
  %193 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %192, i32 0, i32 1
  %194 = load i8, ptr %193, align 4, !tbaa !28, !range !23, !noundef !24
  %195 = trunc i8 %194 to i1
  %196 = zext i1 %195 to i32
  %197 = getelementptr inbounds %"class.ClipperLib::Clipper", ptr %9, i32 0, i32 12
  %198 = load i8, ptr %197, align 4, !tbaa !47, !range !23, !noundef !24
  %199 = trunc i8 %198 to i1
  %200 = zext i1 %199 to i32
  %201 = xor i32 %196, %200
  %202 = load ptr, ptr %6, align 8, !tbaa !5
  %203 = call noundef double @_ZN10ClipperLib4AreaERKNS_6OutRecE(ptr noundef nonnull align 8 dereferenceable(40) %202)
  %204 = fcmp ogt double %203, 0.000000e+00
  %205 = zext i1 %204 to i32
  %206 = icmp eq i32 %201, %205
  br i1 %206, label %207, label %211

207:                                              ; preds = %191
  %208 = load ptr, ptr %6, align 8, !tbaa !5
  %209 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %208, i32 0, i32 5
  %210 = load ptr, ptr %209, align 8, !tbaa !19
  call void @_ZN10ClipperLib18ReversePolyPtLinksEPNS_5OutPtE(ptr noundef %210)
  br label %211

211:                                              ; preds = %207, %191
  br label %232

212:                                              ; preds = %153
  %213 = load ptr, ptr %6, align 8, !tbaa !5
  %214 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %213, i32 0, i32 1
  %215 = load i8, ptr %214, align 4, !tbaa !28, !range !23, !noundef !24
  %216 = trunc i8 %215 to i1
  %217 = load ptr, ptr %7, align 8, !tbaa !5
  %218 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %217, i32 0, i32 1
  %219 = zext i1 %216 to i8
  store i8 %219, ptr %218, align 4, !tbaa !28
  %220 = load ptr, ptr %6, align 8, !tbaa !5
  %221 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %220, i32 0, i32 3
  %222 = load ptr, ptr %221, align 8, !tbaa !29
  %223 = load ptr, ptr %7, align 8, !tbaa !5
  %224 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %223, i32 0, i32 3
  store ptr %222, ptr %224, align 8, !tbaa !29
  %225 = getelementptr inbounds %"class.ClipperLib::Clipper", ptr %9, i32 0, i32 13
  %226 = load i8, ptr %225, align 1, !tbaa !30, !range !23, !noundef !24
  %227 = trunc i8 %226 to i1
  br i1 %227, label %228, label %231

228:                                              ; preds = %212
  %229 = load ptr, ptr %6, align 8, !tbaa !5
  %230 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN10ClipperLib7Clipper16FixupFirstLefts1EPNS_6OutRecES2_(ptr noundef nonnull align 8 dereferenceable(135) %9, ptr noundef %229, ptr noundef %230)
  br label %231

231:                                              ; preds = %228, %212
  br label %232

232:                                              ; preds = %231, %211
  br label %233

233:                                              ; preds = %232, %152
  br label %271

234:                                              ; preds = %84
  %235 = load ptr, ptr %7, align 8, !tbaa !5
  %236 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %235, i32 0, i32 5
  store ptr null, ptr %236, align 8, !tbaa !19
  %237 = load ptr, ptr %7, align 8, !tbaa !5
  %238 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %237, i32 0, i32 6
  store ptr null, ptr %238, align 8, !tbaa !25
  %239 = load ptr, ptr %6, align 8, !tbaa !5
  %240 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %239, i32 0, i32 0
  %241 = load i32, ptr %240, align 8, !tbaa !48
  %242 = load ptr, ptr %7, align 8, !tbaa !5
  %243 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %242, i32 0, i32 0
  store i32 %241, ptr %243, align 8, !tbaa !48
  %244 = load ptr, ptr %8, align 8, !tbaa !5
  %245 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %244, i32 0, i32 1
  %246 = load i8, ptr %245, align 4, !tbaa !28, !range !23, !noundef !24
  %247 = trunc i8 %246 to i1
  %248 = load ptr, ptr %6, align 8, !tbaa !5
  %249 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %248, i32 0, i32 1
  %250 = zext i1 %247 to i8
  store i8 %250, ptr %249, align 4, !tbaa !28
  %251 = load ptr, ptr %8, align 8, !tbaa !5
  %252 = load ptr, ptr %7, align 8, !tbaa !5
  %253 = icmp eq ptr %251, %252
  br i1 %253, label %254, label %260

254:                                              ; preds = %234
  %255 = load ptr, ptr %7, align 8, !tbaa !5
  %256 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %255, i32 0, i32 3
  %257 = load ptr, ptr %256, align 8, !tbaa !29
  %258 = load ptr, ptr %6, align 8, !tbaa !5
  %259 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %258, i32 0, i32 3
  store ptr %257, ptr %259, align 8, !tbaa !29
  br label %260

260:                                              ; preds = %254, %234
  %261 = load ptr, ptr %6, align 8, !tbaa !5
  %262 = load ptr, ptr %7, align 8, !tbaa !5
  %263 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %262, i32 0, i32 3
  store ptr %261, ptr %263, align 8, !tbaa !29
  %264 = getelementptr inbounds %"class.ClipperLib::Clipper", ptr %9, i32 0, i32 13
  %265 = load i8, ptr %264, align 1, !tbaa !30, !range !23, !noundef !24
  %266 = trunc i8 %265 to i1
  br i1 %266, label %267, label %270

267:                                              ; preds = %260
  %268 = load ptr, ptr %7, align 8, !tbaa !5
  %269 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN10ClipperLib7Clipper16FixupFirstLefts3EPNS_6OutRecES2_(ptr noundef nonnull align 8 dereferenceable(135) %9, ptr noundef %268, ptr noundef %269)
  br label %270

270:                                              ; preds = %267, %260
  br label %271

271:                                              ; preds = %270, %233
  store i32 0, ptr %4, align 4
  br label %272

272:                                              ; preds = %271, %83
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %273

273:                                              ; preds = %272, %53, %42
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  %274 = load i32, ptr %4, align 4
  switch i32 %274, label %280 [
    i32 0, label %275
    i32 4, label %276
  ]

275:                                              ; preds = %273
  br label %276

276:                                              ; preds = %275, %273
  %277 = load i64, ptr %3, align 8, !tbaa !9
  %278 = add i64 %277, 1
  store i64 %278, ptr %3, align 8, !tbaa !9
  br label %10, !llvm.loop !49

279:                                              ; preds = %15
  ret void

280:                                              ; preds = %273
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIPN10ClipperLib4JoinESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 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) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN10ClipperLib15GetLowermostRecEPNS_6OutRecES1_(ptr noundef, ptr noundef) #2

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

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

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

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTSN10ClipperLib4JoinE", !6, i64 0, !6, i64 8, !13, i64 16}
!13 = !{!"_ZTSN10ClipperLib8IntPointE", !14, i64 0, !14, i64 8}
!14 = !{!"long long", !7, i64 0}
!15 = !{!16, !17, i64 0}
!16 = !{!"_ZTSN10ClipperLib5OutPtE", !17, i64 0, !13, i64 8, !6, i64 24, !6, i64 32}
!17 = !{!"int", !7, i64 0}
!18 = !{!12, !6, i64 8}
!19 = !{!20, !6, i64 24}
!20 = !{!"_ZTSN10ClipperLib6OutRecE", !17, i64 0, !21, i64 4, !21, i64 5, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!21 = !{!"bool", !7, i64 0}
!22 = !{!20, !21, i64 5}
!23 = !{i8 0, i8 2}
!24 = !{}
!25 = !{!20, !6, i64 32}
!26 = !{!27, !27, i64 0}
!27 = !{!"vtable pointer", !8, i64 0}
!28 = !{!20, !21, i64 4}
!29 = !{!20, !6, i64 8}
!30 = !{!31, !21, i64 133}
!31 = !{!"_ZTSN10ClipperLib7ClipperE", !32, i64 8, !32, i64 32, !36, i64 56, !40, i64 80, !41, i64 88, !6, i64 112, !21, i64 120, !46, i64 124, !46, i64 128, !21, i64 132, !21, i64 133, !21, i64 134}
!32 = !{!"_ZTSSt6vectorIPN10ClipperLib4JoinESaIS2_EE", !33, i64 0}
!33 = !{!"_ZTSSt12_Vector_baseIPN10ClipperLib4JoinESaIS2_EE", !34, i64 0}
!34 = !{!"_ZTSNSt12_Vector_baseIPN10ClipperLib4JoinESaIS2_EE12_Vector_implE", !35, i64 0}
!35 = !{!"_ZTSNSt12_Vector_baseIPN10ClipperLib4JoinESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!36 = !{!"_ZTSSt6vectorIPN10ClipperLib13IntersectNodeESaIS2_EE", !37, i64 0}
!37 = !{!"_ZTSSt12_Vector_baseIPN10ClipperLib13IntersectNodeESaIS2_EE", !38, i64 0}
!38 = !{!"_ZTSNSt12_Vector_baseIPN10ClipperLib13IntersectNodeESaIS2_EE12_Vector_implE", !39, i64 0}
!39 = !{!"_ZTSNSt12_Vector_baseIPN10ClipperLib13IntersectNodeESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!40 = !{!"_ZTSN10ClipperLib8ClipTypeE", !7, i64 0}
!41 = !{!"_ZTSNSt7__cxx114listIxSaIxEEE", !42, i64 0}
!42 = !{!"_ZTSNSt7__cxx1110_List_baseIxSaIxEEE", !43, i64 0}
!43 = !{!"_ZTSNSt7__cxx1110_List_baseIxSaIxEE10_List_implE", !44, i64 0}
!44 = !{!"_ZTSNSt8__detail17_List_node_headerE", !45, i64 0, !10, i64 16}
!45 = !{!"_ZTSNSt8__detail15_List_node_baseE", !6, i64 0, !6, i64 8}
!46 = !{!"_ZTSN10ClipperLib12PolyFillTypeE", !7, i64 0}
!47 = !{!31, !21, i64 132}
!48 = !{!20, !17, i64 0}
!49 = distinct !{!49, !50}
!50 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN10ClipperLib4AreaERKNS_6OutRecE(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10ClipperLib18ReversePolyPtLinksEPNS_5OutPtE(ptr noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10ClipperLib7Clipper15JoinCommonEdgesEv(ptr noundef nonnull align 8 dereferenceable(135) %0) local_unnamed_addr #1 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 8
  %3 = tail call noundef i64 @_ZNKSt6vectorIPN10ClipperLib4JoinESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %.not87 = icmp eq i64 %3, 0
  br i1 %.not87, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %1
  %4 = getelementptr inbounds i8, ptr %0, i64 133
  %5 = getelementptr inbounds i8, ptr %0, i64 132
  br label %6

._crit_edge:                                      ; preds = %118, %1
  ret void

6:                                                ; preds = %.lr.ph, %118
  %.07786 = phi i64 [ 0, %.lr.ph ], [ %119, %118 ]
  %7 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10ClipperLib4JoinESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.07786) #4
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = load ptr, ptr %8, align 8, !tbaa !9
  %10 = load i32, ptr %9, align 8, !tbaa !13
  %11 = tail call noundef ptr @_ZN10ClipperLib7Clipper9GetOutRecEi(ptr noundef nonnull align 8 dereferenceable(135) %0, i32 noundef %10)
  %12 = getelementptr inbounds i8, ptr %8, i64 8
  %13 = load ptr, ptr %12, align 8, !tbaa !16
  %14 = load i32, ptr %13, align 8, !tbaa !13
  %15 = tail call noundef ptr @_ZN10ClipperLib7Clipper9GetOutRecEi(ptr noundef nonnull align 8 dereferenceable(135) %0, i32 noundef %14)
  %16 = getelementptr inbounds i8, ptr %11, i64 24
  %17 = load ptr, ptr %16, align 8, !tbaa !17
  %.not = icmp eq ptr %17, null
  br i1 %.not, label %118, label %18

18:                                               ; preds = %6
  %19 = getelementptr inbounds i8, ptr %15, i64 24
  %20 = load ptr, ptr %19, align 8, !tbaa !17
  %.not81 = icmp eq ptr %20, null
  br i1 %.not81, label %118, label %21

21:                                               ; preds = %18
  %22 = getelementptr inbounds i8, ptr %11, i64 5
  %23 = load i8, ptr %22, align 1, !tbaa !20, !range !21, !noundef !22
  %24 = trunc nuw i8 %23 to i1
  br i1 %24, label %118, label %25

25:                                               ; preds = %21
  %26 = getelementptr inbounds i8, ptr %15, i64 5
  %27 = load i8, ptr %26, align 1, !tbaa !20, !range !21, !noundef !22
  %28 = trunc nuw i8 %27 to i1
  br i1 %28, label %118, label %29

29:                                               ; preds = %25
  %30 = icmp eq ptr %11, %15
  br i1 %30, label %.thread, label %31

31:                                               ; preds = %29
  %32 = tail call noundef zeroext i1 @_ZN10ClipperLib21OutRec1RightOfOutRec2EPNS_6OutRecES1_(ptr noundef nonnull %11, ptr noundef nonnull %15)
  br i1 %32, label %37, label %33

33:                                               ; preds = %31
  %34 = tail call noundef zeroext i1 @_ZN10ClipperLib21OutRec1RightOfOutRec2EPNS_6OutRecES1_(ptr noundef nonnull %15, ptr noundef nonnull %11)
  br i1 %34, label %37, label %35

35:                                               ; preds = %33
  %36 = tail call noundef ptr @_ZN10ClipperLib15GetLowermostRecEPNS_6OutRecES1_(ptr noundef nonnull %11, ptr noundef nonnull %15)
  br label %37

37:                                               ; preds = %33, %31, %35
  %.0 = phi ptr [ %36, %35 ], [ %15, %31 ], [ %11, %33 ]
  %38 = tail call noundef zeroext i1 @_ZN10ClipperLib7Clipper10JoinPointsEPNS_4JoinEPNS_6OutRecES4_(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef nonnull %8, ptr noundef nonnull %11, ptr noundef nonnull %15)
  br i1 %38, label %103, label %118

.thread:                                          ; preds = %29
  %39 = tail call noundef zeroext i1 @_ZN10ClipperLib7Clipper10JoinPointsEPNS_4JoinEPNS_6OutRecES4_(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef nonnull %8, ptr noundef nonnull %11, ptr noundef nonnull %15)
  br i1 %39, label %.thread84, label %118

.thread84:                                        ; preds = %.thread
  %40 = load ptr, ptr %8, align 8, !tbaa !9
  store ptr %40, ptr %16, align 8, !tbaa !17
  %41 = getelementptr inbounds i8, ptr %11, i64 32
  store ptr null, ptr %41, align 8, !tbaa !23
  %42 = load ptr, ptr %0, align 8, !tbaa !24
  %43 = getelementptr i8, ptr %42, i64 -24
  %44 = load i64, ptr %43, align 8
  %45 = getelementptr inbounds i8, ptr %0, i64 %44
  %46 = tail call noundef ptr @_ZN10ClipperLib11ClipperBase12CreateOutRecEv(ptr noundef nonnull align 8 dereferenceable(144) %45)
  %47 = load ptr, ptr %12, align 8, !tbaa !16
  %48 = getelementptr inbounds i8, ptr %46, i64 24
  store ptr %47, ptr %48, align 8, !tbaa !17
  tail call void @_ZN10ClipperLib15UpdateOutPtIdxsERNS_6OutRecE(ptr noundef nonnull align 8 dereferenceable(40) %46)
  %49 = load ptr, ptr %48, align 8, !tbaa !17
  %50 = load ptr, ptr %16, align 8, !tbaa !17
  %51 = tail call noundef zeroext i1 @_ZN10ClipperLib18Poly2ContainsPoly1EPNS_5OutPtES1_(ptr noundef %49, ptr noundef %50)
  br i1 %51, label %52, label %71

52:                                               ; preds = %.thread84
  %53 = getelementptr inbounds i8, ptr %11, i64 4
  %54 = load i8, ptr %53, align 4, !tbaa !26, !range !21, !noundef !22
  %55 = xor i8 %54, 1
  %56 = getelementptr inbounds i8, ptr %46, i64 4
  store i8 %55, ptr %56, align 4, !tbaa !26
  %57 = getelementptr inbounds i8, ptr %46, i64 8
  store ptr %11, ptr %57, align 8, !tbaa !27
  %58 = load i8, ptr %4, align 1, !tbaa !28, !range !21, !noundef !22
  %59 = trunc nuw i8 %58 to i1
  br i1 %59, label %60, label %61

60:                                               ; preds = %52
  tail call void @_ZN10ClipperLib7Clipper16FixupFirstLefts2EPNS_6OutRecES2_(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef nonnull %46, ptr noundef nonnull %11)
  %.pre88 = load i8, ptr %56, align 4, !tbaa !26, !range !21
  br label %61

61:                                               ; preds = %60, %52
  %62 = phi i8 [ %.pre88, %60 ], [ %55, %52 ]
  %63 = load i8, ptr %5, align 4, !tbaa !46, !range !21, !noundef !22
  %64 = xor i8 %63, %62
  %65 = tail call noundef double @_ZN10ClipperLib4AreaERKNS_6OutRecE(ptr noundef nonnull align 8 dereferenceable(40) %46)
  %66 = fcmp ogt double %65, 0.000000e+00
  %67 = zext i1 %66 to i8
  %68 = icmp eq i8 %64, %67
  br i1 %68, label %69, label %118

69:                                               ; preds = %61
  %70 = load ptr, ptr %48, align 8, !tbaa !17
  tail call void @_ZN10ClipperLib18ReversePolyPtLinksEPNS_5OutPtE(ptr noundef %70)
  br label %118

71:                                               ; preds = %.thread84
  %72 = load ptr, ptr %16, align 8, !tbaa !17
  %73 = load ptr, ptr %48, align 8, !tbaa !17
  %74 = tail call noundef zeroext i1 @_ZN10ClipperLib18Poly2ContainsPoly1EPNS_5OutPtES1_(ptr noundef %72, ptr noundef %73)
  %75 = getelementptr inbounds i8, ptr %11, i64 4
  %76 = load i8, ptr %75, align 4, !tbaa !26, !range !21, !noundef !22
  %77 = getelementptr inbounds i8, ptr %46, i64 4
  store i8 %76, ptr %77, align 4, !tbaa !26
  br i1 %74, label %78, label %96

78:                                               ; preds = %71
  %79 = xor i8 %76, 1
  store i8 %79, ptr %75, align 4, !tbaa !26
  %80 = getelementptr inbounds i8, ptr %11, i64 8
  %81 = load ptr, ptr %80, align 8, !tbaa !27
  %82 = getelementptr inbounds i8, ptr %46, i64 8
  store ptr %81, ptr %82, align 8, !tbaa !27
  store ptr %46, ptr %80, align 8, !tbaa !27
  %83 = load i8, ptr %4, align 1, !tbaa !28, !range !21, !noundef !22
  %84 = trunc nuw i8 %83 to i1
  br i1 %84, label %85, label %86

85:                                               ; preds = %78
  tail call void @_ZN10ClipperLib7Clipper16FixupFirstLefts2EPNS_6OutRecES2_(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef nonnull %11, ptr noundef nonnull %46)
  %.pre = load i8, ptr %75, align 4, !tbaa !26, !range !21
  br label %86

86:                                               ; preds = %85, %78
  %87 = phi i8 [ %.pre, %85 ], [ %79, %78 ]
  %88 = load i8, ptr %5, align 4, !tbaa !46, !range !21, !noundef !22
  %89 = xor i8 %88, %87
  %90 = tail call noundef double @_ZN10ClipperLib4AreaERKNS_6OutRecE(ptr noundef nonnull align 8 dereferenceable(40) %11)
  %91 = fcmp ogt double %90, 0.000000e+00
  %92 = zext i1 %91 to i8
  %93 = icmp eq i8 %89, %92
  br i1 %93, label %94, label %118

94:                                               ; preds = %86
  %95 = load ptr, ptr %16, align 8, !tbaa !17
  tail call void @_ZN10ClipperLib18ReversePolyPtLinksEPNS_5OutPtE(ptr noundef %95)
  br label %118

96:                                               ; preds = %71
  %97 = getelementptr inbounds i8, ptr %11, i64 8
  %98 = load ptr, ptr %97, align 8, !tbaa !27
  %99 = getelementptr inbounds i8, ptr %46, i64 8
  store ptr %98, ptr %99, align 8, !tbaa !27
  %100 = load i8, ptr %4, align 1, !tbaa !28, !range !21, !noundef !22
  %101 = trunc nuw i8 %100 to i1
  br i1 %101, label %102, label %118

102:                                              ; preds = %96
  tail call void @_ZN10ClipperLib7Clipper16FixupFirstLefts1EPNS_6OutRecES2_(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef nonnull %11, ptr noundef nonnull %46)
  br label %118

103:                                              ; preds = %37
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %19, i8 0, i64 16, i1 false)
  %104 = load i32, ptr %11, align 8, !tbaa !47
  store i32 %104, ptr %15, align 8, !tbaa !47
  %105 = getelementptr inbounds i8, ptr %.0, i64 4
  %106 = load i8, ptr %105, align 4, !tbaa !26, !range !21, !noundef !22
  %107 = getelementptr inbounds i8, ptr %11, i64 4
  store i8 %106, ptr %107, align 4, !tbaa !26
  %108 = icmp eq ptr %.0, %15
  br i1 %108, label %109, label %113

109:                                              ; preds = %103
  %110 = getelementptr inbounds i8, ptr %15, i64 8
  %111 = load ptr, ptr %110, align 8, !tbaa !27
  %112 = getelementptr inbounds i8, ptr %11, i64 8
  store ptr %111, ptr %112, align 8, !tbaa !27
  br label %113

113:                                              ; preds = %109, %103
  %114 = getelementptr inbounds i8, ptr %15, i64 8
  store ptr %11, ptr %114, align 8, !tbaa !27
  %115 = load i8, ptr %4, align 1, !tbaa !28, !range !21, !noundef !22
  %116 = trunc nuw i8 %115 to i1
  br i1 %116, label %117, label %118

117:                                              ; preds = %113
  tail call void @_ZN10ClipperLib7Clipper16FixupFirstLefts3EPNS_6OutRecES2_(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef nonnull %15, ptr noundef nonnull %11)
  br label %118

118:                                              ; preds = %.thread, %37, %113, %117, %69, %61, %96, %102, %86, %94, %21, %25, %6, %18
  %119 = add nuw i64 %.07786, 1
  %120 = tail call noundef i64 @_ZNKSt6vectorIPN10ClipperLib4JoinESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %121 = icmp ult i64 %119, %120
  br i1 %121, label %6, label %._crit_edge, !llvm.loop !48
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIPN10ClipperLib4JoinESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 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 #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN10ClipperLib15GetLowermostRecEPNS_6OutRecES1_(ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10ClipperLib7Clipper16FixupFirstLefts1EPNS_6OutRecES2_(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 @_ZN10ClipperLib7Clipper16FixupFirstLefts2EPNS_6OutRecES2_(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 @_ZN10ClipperLib7Clipper16FixupFirstLefts3EPNS_6OutRecES2_(ptr noundef nonnull align 8 dereferenceable(135), ptr noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN10ClipperLib15UpdateOutPtIdxsERNS_6OutRecE(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint mustprogress 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTSN10ClipperLib4JoinE", !6, i64 0, !6, i64 8, !11, i64 16}
!11 = !{!"_ZTSN10ClipperLib8IntPointE", !12, i64 0, !12, i64 8}
!12 = !{!"long long", !7, i64 0}
!13 = !{!14, !15, i64 0}
!14 = !{!"_ZTSN10ClipperLib5OutPtE", !15, i64 0, !11, i64 8, !6, i64 24, !6, i64 32}
!15 = !{!"int", !7, i64 0}
!16 = !{!10, !6, i64 8}
!17 = !{!18, !6, i64 24}
!18 = !{!"_ZTSN10ClipperLib6OutRecE", !15, i64 0, !19, i64 4, !19, i64 5, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!19 = !{!"bool", !7, i64 0}
!20 = !{!18, !19, i64 5}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = !{!18, !6, i64 32}
!24 = !{!25, !25, i64 0}
!25 = !{!"vtable pointer", !8, i64 0}
!26 = !{!18, !19, i64 4}
!27 = !{!18, !6, i64 8}
!28 = !{!29, !19, i64 133}
!29 = !{!"_ZTSN10ClipperLib7ClipperE", !30, i64 8, !30, i64 32, !34, i64 56, !38, i64 80, !39, i64 88, !6, i64 112, !19, i64 120, !45, i64 124, !45, i64 128, !19, i64 132, !19, i64 133, !19, i64 134}
!30 = !{!"_ZTSSt6vectorIPN10ClipperLib4JoinESaIS2_EE", !31, i64 0}
!31 = !{!"_ZTSSt12_Vector_baseIPN10ClipperLib4JoinESaIS2_EE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseIPN10ClipperLib4JoinESaIS2_EE12_Vector_implE", !33, i64 0}
!33 = !{!"_ZTSNSt12_Vector_baseIPN10ClipperLib4JoinESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!34 = !{!"_ZTSSt6vectorIPN10ClipperLib13IntersectNodeESaIS2_EE", !35, i64 0}
!35 = !{!"_ZTSSt12_Vector_baseIPN10ClipperLib13IntersectNodeESaIS2_EE", !36, i64 0}
!36 = !{!"_ZTSNSt12_Vector_baseIPN10ClipperLib13IntersectNodeESaIS2_EE12_Vector_implE", !37, i64 0}
!37 = !{!"_ZTSNSt12_Vector_baseIPN10ClipperLib13IntersectNodeESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!38 = !{!"_ZTSN10ClipperLib8ClipTypeE", !7, i64 0}
!39 = !{!"_ZTSNSt7__cxx114listIxSaIxEEE", !40, i64 0}
!40 = !{!"_ZTSNSt7__cxx1110_List_baseIxSaIxEEE", !41, i64 0}
!41 = !{!"_ZTSNSt7__cxx1110_List_baseIxSaIxEE10_List_implE", !42, i64 0}
!42 = !{!"_ZTSNSt8__detail17_List_node_headerE", !43, i64 0, !44, i64 16}
!43 = !{!"_ZTSNSt8__detail15_List_node_baseE", !6, i64 0, !6, i64 8}
!44 = !{!"long", !7, i64 0}
!45 = !{!"_ZTSN10ClipperLib12PolyFillTypeE", !7, i64 0}
!46 = !{!29, !19, i64 132}
!47 = !{!18, !15, i64 0}
!48 = distinct !{!48, !49}
!49 = !{!"llvm.loop.mustprogress"}


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