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

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

%"class.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::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 }
%"struct.ClipperLib::IntPoint" = type { i64, i64 }
%"struct.ClipperLib::OutRec" = type { i32, i8, i8, ptr, ptr, ptr, ptr }
%"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: mustprogress nounwind uwtable
declare dso_local void @_ZN10ClipperLib18ReversePolyPtLinksEPNS_5OutPtE(ptr noundef) #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10ClipperLib7Clipper13AppendPolygonEPNS_5TEdgeES2_(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef %1, ptr noundef %2) #2 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %17 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %18 = load ptr, ptr %17, align 8, !tbaa !9
  %19 = getelementptr i8, ptr %18, i64 -24
  %20 = load i64, ptr %19, align 8
  %21 = getelementptr inbounds i8, ptr %17, i64 %20
  %22 = getelementptr inbounds %"class.ClipperLib::ClipperBase", ptr %21, i32 0, i32 7
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %23, i32 0, i32 9
  %25 = load i32, ptr %24, align 4, !tbaa !11
  %26 = sext i32 %25 to i64
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10ClipperLib6OutRecESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %26) #3
  %28 = load ptr, ptr %27, align 8, !tbaa !5
  store ptr %28, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %29 = load ptr, ptr %17, align 8, !tbaa !9
  %30 = getelementptr i8, ptr %29, i64 -24
  %31 = load i64, ptr %30, align 8
  %32 = getelementptr inbounds i8, ptr %17, i64 %31
  %33 = getelementptr inbounds %"class.ClipperLib::ClipperBase", ptr %32, i32 0, i32 7
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %34, i32 0, i32 9
  %36 = load i32, ptr %35, align 4, !tbaa !11
  %37 = sext i32 %36 to i64
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10ClipperLib6OutRecESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %33, i64 noundef %37) #3
  %39 = load ptr, ptr %38, align 8, !tbaa !5
  store ptr %39, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = load ptr, ptr %8, align 8, !tbaa !5
  %42 = call noundef zeroext i1 @_ZN10ClipperLib21OutRec1RightOfOutRec2EPNS_6OutRecES1_(ptr noundef %40, ptr noundef %41)
  br i1 %42, label %43, label %45

43:                                               ; preds = %3
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %44, ptr %9, align 8, !tbaa !5
  br label %56

45:                                               ; preds = %3
  %46 = load ptr, ptr %8, align 8, !tbaa !5
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  %48 = call noundef zeroext i1 @_ZN10ClipperLib21OutRec1RightOfOutRec2EPNS_6OutRecES1_(ptr noundef %46, ptr noundef %47)
  br i1 %48, label %49, label %51

49:                                               ; preds = %45
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %50, ptr %9, align 8, !tbaa !5
  br label %55

51:                                               ; preds = %45
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = load ptr, ptr %8, align 8, !tbaa !5
  %54 = call noundef ptr @_ZN10ClipperLib15GetLowermostRecEPNS_6OutRecES1_(ptr noundef %52, ptr noundef %53)
  store ptr %54, ptr %9, align 8, !tbaa !5
  br label %55

55:                                               ; preds = %51, %49
  br label %56

56:                                               ; preds = %55, %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %57, i32 0, i32 5
  %59 = load ptr, ptr %58, align 8, !tbaa !19
  store ptr %59, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %60 = load ptr, ptr %10, align 8, !tbaa !5
  %61 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %60, i32 0, i32 3
  %62 = load ptr, ptr %61, align 8, !tbaa !22
  store ptr %62, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %63 = load ptr, ptr %8, align 8, !tbaa !5
  %64 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %63, i32 0, i32 5
  %65 = load ptr, ptr %64, align 8, !tbaa !19
  store ptr %65, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %66 = load ptr, ptr %12, align 8, !tbaa !5
  %67 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %66, i32 0, i32 3
  %68 = load ptr, ptr %67, align 8, !tbaa !22
  store ptr %68, ptr %13, align 8, !tbaa !5
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %69, i32 0, i32 5
  %71 = load i32, ptr %70, align 4, !tbaa !24
  %72 = icmp eq i32 %71, 1
  br i1 %72, label %73, label %112

73:                                               ; preds = %56
  %74 = load ptr, ptr %6, align 8, !tbaa !5
  %75 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %74, i32 0, i32 5
  %76 = load i32, ptr %75, align 4, !tbaa !24
  %77 = icmp eq i32 %76, 1
  br i1 %77, label %78, label %95

78:                                               ; preds = %73
  %79 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN10ClipperLib18ReversePolyPtLinksEPNS_5OutPtE(ptr noundef %79)
  %80 = load ptr, ptr %10, align 8, !tbaa !5
  %81 = load ptr, ptr %12, align 8, !tbaa !5
  %82 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %81, i32 0, i32 2
  store ptr %80, ptr %82, align 8, !tbaa !25
  %83 = load ptr, ptr %12, align 8, !tbaa !5
  %84 = load ptr, ptr %10, align 8, !tbaa !5
  %85 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %84, i32 0, i32 3
  store ptr %83, ptr %85, align 8, !tbaa !22
  %86 = load ptr, ptr %13, align 8, !tbaa !5
  %87 = load ptr, ptr %11, align 8, !tbaa !5
  %88 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %87, i32 0, i32 2
  store ptr %86, ptr %88, align 8, !tbaa !25
  %89 = load ptr, ptr %11, align 8, !tbaa !5
  %90 = load ptr, ptr %13, align 8, !tbaa !5
  %91 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %90, i32 0, i32 3
  store ptr %89, ptr %91, align 8, !tbaa !22
  %92 = load ptr, ptr %13, align 8, !tbaa !5
  %93 = load ptr, ptr %7, align 8, !tbaa !5
  %94 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %93, i32 0, i32 5
  store ptr %92, ptr %94, align 8, !tbaa !19
  br label %111

95:                                               ; preds = %73
  %96 = load ptr, ptr %10, align 8, !tbaa !5
  %97 = load ptr, ptr %13, align 8, !tbaa !5
  %98 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %97, i32 0, i32 2
  store ptr %96, ptr %98, align 8, !tbaa !25
  %99 = load ptr, ptr %13, align 8, !tbaa !5
  %100 = load ptr, ptr %10, align 8, !tbaa !5
  %101 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %100, i32 0, i32 3
  store ptr %99, ptr %101, align 8, !tbaa !22
  %102 = load ptr, ptr %11, align 8, !tbaa !5
  %103 = load ptr, ptr %12, align 8, !tbaa !5
  %104 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %103, i32 0, i32 3
  store ptr %102, ptr %104, align 8, !tbaa !22
  %105 = load ptr, ptr %12, align 8, !tbaa !5
  %106 = load ptr, ptr %11, align 8, !tbaa !5
  %107 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %106, i32 0, i32 2
  store ptr %105, ptr %107, align 8, !tbaa !25
  %108 = load ptr, ptr %12, align 8, !tbaa !5
  %109 = load ptr, ptr %7, align 8, !tbaa !5
  %110 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %109, i32 0, i32 5
  store ptr %108, ptr %110, align 8, !tbaa !19
  br label %111

111:                                              ; preds = %95, %78
  br label %145

112:                                              ; preds = %56
  %113 = load ptr, ptr %6, align 8, !tbaa !5
  %114 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %113, i32 0, i32 5
  %115 = load i32, ptr %114, align 4, !tbaa !24
  %116 = icmp eq i32 %115, 2
  br i1 %116, label %117, label %131

117:                                              ; preds = %112
  %118 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN10ClipperLib18ReversePolyPtLinksEPNS_5OutPtE(ptr noundef %118)
  %119 = load ptr, ptr %13, align 8, !tbaa !5
  %120 = load ptr, ptr %11, align 8, !tbaa !5
  %121 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %120, i32 0, i32 2
  store ptr %119, ptr %121, align 8, !tbaa !25
  %122 = load ptr, ptr %11, align 8, !tbaa !5
  %123 = load ptr, ptr %13, align 8, !tbaa !5
  %124 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %123, i32 0, i32 3
  store ptr %122, ptr %124, align 8, !tbaa !22
  %125 = load ptr, ptr %10, align 8, !tbaa !5
  %126 = load ptr, ptr %12, align 8, !tbaa !5
  %127 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %126, i32 0, i32 2
  store ptr %125, ptr %127, align 8, !tbaa !25
  %128 = load ptr, ptr %12, align 8, !tbaa !5
  %129 = load ptr, ptr %10, align 8, !tbaa !5
  %130 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %129, i32 0, i32 3
  store ptr %128, ptr %130, align 8, !tbaa !22
  br label %144

131:                                              ; preds = %112
  %132 = load ptr, ptr %12, align 8, !tbaa !5
  %133 = load ptr, ptr %11, align 8, !tbaa !5
  %134 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %133, i32 0, i32 2
  store ptr %132, ptr %134, align 8, !tbaa !25
  %135 = load ptr, ptr %11, align 8, !tbaa !5
  %136 = load ptr, ptr %12, align 8, !tbaa !5
  %137 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %136, i32 0, i32 3
  store ptr %135, ptr %137, align 8, !tbaa !22
  %138 = load ptr, ptr %13, align 8, !tbaa !5
  %139 = load ptr, ptr %10, align 8, !tbaa !5
  %140 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %139, i32 0, i32 3
  store ptr %138, ptr %140, align 8, !tbaa !22
  %141 = load ptr, ptr %10, align 8, !tbaa !5
  %142 = load ptr, ptr %13, align 8, !tbaa !5
  %143 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %142, i32 0, i32 2
  store ptr %141, ptr %143, align 8, !tbaa !25
  br label %144

144:                                              ; preds = %131, %117
  br label %145

145:                                              ; preds = %144, %111
  %146 = load ptr, ptr %7, align 8, !tbaa !5
  %147 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %146, i32 0, i32 6
  store ptr null, ptr %147, align 8, !tbaa !26
  %148 = load ptr, ptr %9, align 8, !tbaa !5
  %149 = load ptr, ptr %8, align 8, !tbaa !5
  %150 = icmp eq ptr %148, %149
  br i1 %150, label %151, label %171

151:                                              ; preds = %145
  %152 = load ptr, ptr %8, align 8, !tbaa !5
  %153 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %152, i32 0, i32 3
  %154 = load ptr, ptr %153, align 8, !tbaa !27
  %155 = load ptr, ptr %7, align 8, !tbaa !5
  %156 = icmp ne ptr %154, %155
  br i1 %156, label %157, label %163

157:                                              ; preds = %151
  %158 = load ptr, ptr %8, align 8, !tbaa !5
  %159 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %158, i32 0, i32 3
  %160 = load ptr, ptr %159, align 8, !tbaa !27
  %161 = load ptr, ptr %7, align 8, !tbaa !5
  %162 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %161, i32 0, i32 3
  store ptr %160, ptr %162, align 8, !tbaa !27
  br label %163

163:                                              ; preds = %157, %151
  %164 = load ptr, ptr %8, align 8, !tbaa !5
  %165 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %164, i32 0, i32 1
  %166 = load i8, ptr %165, align 4, !tbaa !28, !range !29, !noundef !30
  %167 = trunc i8 %166 to i1
  %168 = load ptr, ptr %7, align 8, !tbaa !5
  %169 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %168, i32 0, i32 1
  %170 = zext i1 %167 to i8
  store i8 %170, ptr %169, align 4, !tbaa !28
  br label %171

171:                                              ; preds = %163, %145
  %172 = load ptr, ptr %8, align 8, !tbaa !5
  %173 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %172, i32 0, i32 5
  store ptr null, ptr %173, align 8, !tbaa !19
  %174 = load ptr, ptr %8, align 8, !tbaa !5
  %175 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %174, i32 0, i32 6
  store ptr null, ptr %175, align 8, !tbaa !26
  %176 = load ptr, ptr %7, align 8, !tbaa !5
  %177 = load ptr, ptr %8, align 8, !tbaa !5
  %178 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %177, i32 0, i32 3
  store ptr %176, ptr %178, align 8, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  %179 = load ptr, ptr %5, align 8, !tbaa !5
  %180 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %179, i32 0, i32 9
  %181 = load i32, ptr %180, align 4, !tbaa !11
  store i32 %181, ptr %14, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  %182 = load ptr, ptr %6, align 8, !tbaa !5
  %183 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %182, i32 0, i32 9
  %184 = load i32, ptr %183, align 4, !tbaa !11
  store i32 %184, ptr %15, align 4, !tbaa !31
  %185 = load ptr, ptr %5, align 8, !tbaa !5
  %186 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %185, i32 0, i32 9
  store i32 -1, ptr %186, align 4, !tbaa !11
  %187 = load ptr, ptr %6, align 8, !tbaa !5
  %188 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %187, i32 0, i32 9
  store i32 -1, ptr %188, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  %189 = load ptr, ptr %17, align 8, !tbaa !9
  %190 = getelementptr i8, ptr %189, i64 -24
  %191 = load i64, ptr %190, align 8
  %192 = getelementptr inbounds i8, ptr %17, i64 %191
  %193 = getelementptr inbounds %"class.ClipperLib::ClipperBase", ptr %192, i32 0, i32 8
  %194 = load ptr, ptr %193, align 8, !tbaa !32
  store ptr %194, ptr %16, align 8, !tbaa !5
  br label %195

195:                                              ; preds = %213, %171
  %196 = load ptr, ptr %16, align 8, !tbaa !5
  %197 = icmp ne ptr %196, null
  br i1 %197, label %198, label %217

198:                                              ; preds = %195
  %199 = load ptr, ptr %16, align 8, !tbaa !5
  %200 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %199, i32 0, i32 9
  %201 = load i32, ptr %200, align 4, !tbaa !11
  %202 = load i32, ptr %15, align 4, !tbaa !31
  %203 = icmp eq i32 %201, %202
  br i1 %203, label %204, label %213

204:                                              ; preds = %198
  %205 = load i32, ptr %14, align 4, !tbaa !31
  %206 = load ptr, ptr %16, align 8, !tbaa !5
  %207 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %206, i32 0, i32 9
  store i32 %205, ptr %207, align 4, !tbaa !11
  %208 = load ptr, ptr %5, align 8, !tbaa !5
  %209 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %208, i32 0, i32 5
  %210 = load i32, ptr %209, align 4, !tbaa !24
  %211 = load ptr, ptr %16, align 8, !tbaa !5
  %212 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %211, i32 0, i32 5
  store i32 %210, ptr %212, align 4, !tbaa !24
  br label %217

213:                                              ; preds = %198
  %214 = load ptr, ptr %16, align 8, !tbaa !5
  %215 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %214, i32 0, i32 13
  %216 = load ptr, ptr %215, align 8, !tbaa !53
  store ptr %216, ptr %16, align 8, !tbaa !5
  br label %195, !llvm.loop !54

217:                                              ; preds = %204, %195
  %218 = load ptr, ptr %7, align 8, !tbaa !5
  %219 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %218, i32 0, i32 0
  %220 = load i32, ptr %219, align 8, !tbaa !56
  %221 = load ptr, ptr %8, align 8, !tbaa !5
  %222 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %221, i32 0, i32 0
  store i32 %220, ptr %222, align 8, !tbaa !56
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  ret void
}

; 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

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 = { 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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !18, i64 76}
!12 = !{!"_ZTSN10ClipperLib5TEdgeE", !13, i64 0, !13, i64 16, !13, i64 32, !15, i64 48, !16, i64 56, !17, i64 60, !18, i64 64, !18, i64 68, !18, i64 72, !18, i64 76, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128}
!13 = !{!"_ZTSN10ClipperLib8IntPointE", !14, i64 0, !14, i64 8}
!14 = !{!"long long", !7, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = !{!"_ZTSN10ClipperLib8PolyTypeE", !7, i64 0}
!17 = !{!"_ZTSN10ClipperLib8EdgeSideE", !7, i64 0}
!18 = !{!"int", !7, i64 0}
!19 = !{!20, !6, i64 24}
!20 = !{!"_ZTSN10ClipperLib6OutRecE", !18, 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 = !{!23, !6, i64 32}
!23 = !{!"_ZTSN10ClipperLib5OutPtE", !18, i64 0, !13, i64 8, !6, i64 24, !6, i64 32}
!24 = !{!12, !17, i64 60}
!25 = !{!23, !6, i64 24}
!26 = !{!20, !6, i64 32}
!27 = !{!20, !6, i64 8}
!28 = !{!20, !21, i64 4}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = !{!18, !18, i64 0}
!32 = !{!33, !6, i64 104}
!33 = !{!"_ZTSN10ClipperLib11ClipperBaseE", !34, i64 8, !35, i64 16, !21, i64 40, !39, i64 48, !21, i64 72, !21, i64 73, !43, i64 80, !6, i64 104, !47, i64 112}
!34 = !{!"_ZTSN9__gnu_cxx17__normal_iteratorIPN10ClipperLib12LocalMinimumESt6vectorIS2_SaIS2_EEEE", !6, i64 0}
!35 = !{!"_ZTSSt6vectorIN10ClipperLib12LocalMinimumESaIS1_EE", !36, i64 0}
!36 = !{!"_ZTSSt12_Vector_baseIN10ClipperLib12LocalMinimumESaIS1_EE", !37, i64 0}
!37 = !{!"_ZTSNSt12_Vector_baseIN10ClipperLib12LocalMinimumESaIS1_EE12_Vector_implE", !38, i64 0}
!38 = !{!"_ZTSNSt12_Vector_baseIN10ClipperLib12LocalMinimumESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!39 = !{!"_ZTSSt6vectorIPN10ClipperLib5TEdgeESaIS2_EE", !40, i64 0}
!40 = !{!"_ZTSSt12_Vector_baseIPN10ClipperLib5TEdgeESaIS2_EE", !41, i64 0}
!41 = !{!"_ZTSNSt12_Vector_baseIPN10ClipperLib5TEdgeESaIS2_EE12_Vector_implE", !42, i64 0}
!42 = !{!"_ZTSNSt12_Vector_baseIPN10ClipperLib5TEdgeESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!43 = !{!"_ZTSSt6vectorIPN10ClipperLib6OutRecESaIS2_EE", !44, i64 0}
!44 = !{!"_ZTSSt12_Vector_baseIPN10ClipperLib6OutRecESaIS2_EE", !45, i64 0}
!45 = !{!"_ZTSNSt12_Vector_baseIPN10ClipperLib6OutRecESaIS2_EE12_Vector_implE", !46, i64 0}
!46 = !{!"_ZTSNSt12_Vector_baseIPN10ClipperLib6OutRecESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!47 = !{!"_ZTSSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE", !48, i64 0, !52, i64 24}
!48 = !{!"_ZTSSt6vectorIxSaIxEE", !49, i64 0}
!49 = !{!"_ZTSSt12_Vector_baseIxSaIxEE", !50, i64 0}
!50 = !{!"_ZTSNSt12_Vector_baseIxSaIxEE12_Vector_implE", !51, i64 0}
!51 = !{!"_ZTSNSt12_Vector_baseIxSaIxEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!52 = !{!"_ZTSSt4lessIxE"}
!53 = !{!12, !6, i64 104}
!54 = distinct !{!54, !55}
!55 = !{!"llvm.loop.mustprogress"}
!56 = !{!20, !18, i64 0}


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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10ClipperLib7Clipper13AppendPolygonEPNS_5TEdgeES2_(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr nocapture noundef %1, ptr nocapture noundef %2) local_unnamed_addr #1 align 2 {
  %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 = getelementptr inbounds i8, ptr %7, i64 80
  %9 = getelementptr inbounds i8, ptr %1, i64 76
  %10 = load i32, ptr %9, align 4, !tbaa !8
  %11 = sext i32 %10 to i64
  %12 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10ClipperLib6OutRecESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %11) #3
  %13 = load ptr, ptr %12, align 8, !tbaa !18
  %14 = load ptr, ptr %0, align 8, !tbaa !5
  %15 = getelementptr i8, ptr %14, i64 -24
  %16 = load i64, ptr %15, align 8
  %17 = getelementptr inbounds i8, ptr %0, i64 %16
  %18 = getelementptr inbounds i8, ptr %17, i64 80
  %19 = getelementptr inbounds i8, ptr %2, i64 76
  %20 = load i32, ptr %19, align 4, !tbaa !8
  %21 = sext i32 %20 to i64
  %22 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10ClipperLib6OutRecESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef %21) #3
  %23 = load ptr, ptr %22, align 8, !tbaa !18
  %24 = tail call noundef zeroext i1 @_ZN10ClipperLib21OutRec1RightOfOutRec2EPNS_6OutRecES1_(ptr noundef %13, ptr noundef %23)
  br i1 %24, label %29, label %25

25:                                               ; preds = %3
  %26 = tail call noundef zeroext i1 @_ZN10ClipperLib21OutRec1RightOfOutRec2EPNS_6OutRecES1_(ptr noundef %23, ptr noundef %13)
  br i1 %26, label %29, label %27

27:                                               ; preds = %25
  %28 = tail call noundef ptr @_ZN10ClipperLib15GetLowermostRecEPNS_6OutRecES1_(ptr noundef %13, ptr noundef %23)
  br label %29

29:                                               ; preds = %25, %3, %27
  %.082 = phi ptr [ %28, %27 ], [ %23, %3 ], [ %13, %25 ]
  %30 = getelementptr inbounds i8, ptr %13, i64 24
  %31 = load ptr, ptr %30, align 8, !tbaa !19
  %32 = getelementptr inbounds i8, ptr %31, i64 32
  %33 = load ptr, ptr %32, align 8, !tbaa !22
  %34 = getelementptr inbounds i8, ptr %23, i64 24
  %35 = load ptr, ptr %34, align 8, !tbaa !19
  %36 = getelementptr inbounds i8, ptr %35, i64 32
  %37 = load ptr, ptr %36, align 8, !tbaa !22
  %38 = getelementptr inbounds i8, ptr %1, i64 60
  %39 = load i32, ptr %38, align 4, !tbaa !24
  %40 = icmp eq i32 %39, 1
  %41 = getelementptr inbounds i8, ptr %2, i64 60
  %42 = load i32, ptr %41, align 4, !tbaa !24
  br i1 %40, label %43, label %51

43:                                               ; preds = %29
  %44 = icmp eq i32 %42, 1
  %45 = getelementptr inbounds i8, ptr %33, i64 24
  br i1 %44, label %46, label %49

46:                                               ; preds = %43
  tail call void @_ZN10ClipperLib18ReversePolyPtLinksEPNS_5OutPtE(ptr noundef nonnull %35)
  %47 = getelementptr inbounds i8, ptr %35, i64 24
  store ptr %31, ptr %47, align 8, !tbaa !25
  store ptr %35, ptr %32, align 8, !tbaa !22
  store ptr %37, ptr %45, align 8, !tbaa !25
  %48 = getelementptr inbounds i8, ptr %37, i64 32
  store ptr %33, ptr %48, align 8, !tbaa !22
  store ptr %37, ptr %30, align 8, !tbaa !19
  br label %60

49:                                               ; preds = %43
  %50 = getelementptr inbounds i8, ptr %37, i64 24
  store ptr %31, ptr %50, align 8, !tbaa !25
  store ptr %37, ptr %32, align 8, !tbaa !22
  store ptr %33, ptr %36, align 8, !tbaa !22
  store ptr %35, ptr %45, align 8, !tbaa !25
  store ptr %35, ptr %30, align 8, !tbaa !19
  br label %60

51:                                               ; preds = %29
  %52 = icmp eq i32 %42, 2
  br i1 %52, label %53, label %57

53:                                               ; preds = %51
  tail call void @_ZN10ClipperLib18ReversePolyPtLinksEPNS_5OutPtE(ptr noundef nonnull %35)
  %54 = getelementptr inbounds i8, ptr %33, i64 24
  store ptr %37, ptr %54, align 8, !tbaa !25
  %55 = getelementptr inbounds i8, ptr %37, i64 32
  store ptr %33, ptr %55, align 8, !tbaa !22
  %56 = getelementptr inbounds i8, ptr %35, i64 24
  store ptr %31, ptr %56, align 8, !tbaa !25
  store ptr %35, ptr %32, align 8, !tbaa !22
  br label %60

57:                                               ; preds = %51
  %58 = getelementptr inbounds i8, ptr %33, i64 24
  store ptr %35, ptr %58, align 8, !tbaa !25
  store ptr %33, ptr %36, align 8, !tbaa !22
  store ptr %37, ptr %32, align 8, !tbaa !22
  %59 = getelementptr inbounds i8, ptr %37, i64 24
  store ptr %31, ptr %59, align 8, !tbaa !25
  br label %60

60:                                               ; preds = %53, %57, %46, %49
  %61 = getelementptr inbounds i8, ptr %13, i64 32
  store ptr null, ptr %61, align 8, !tbaa !26
  %62 = icmp eq ptr %.082, %23
  br i1 %62, label %63, label %72

63:                                               ; preds = %60
  %64 = getelementptr inbounds i8, ptr %23, i64 8
  %65 = load ptr, ptr %64, align 8, !tbaa !27
  %.not = icmp eq ptr %65, %13
  br i1 %.not, label %68, label %66

66:                                               ; preds = %63
  %67 = getelementptr inbounds i8, ptr %13, i64 8
  store ptr %65, ptr %67, align 8, !tbaa !27
  br label %68

68:                                               ; preds = %66, %63
  %69 = getelementptr inbounds i8, ptr %23, i64 4
  %70 = load i8, ptr %69, align 4, !tbaa !28, !range !29, !noundef !30
  %71 = getelementptr inbounds i8, ptr %13, i64 4
  store i8 %70, ptr %71, align 4, !tbaa !28
  br label %72

72:                                               ; preds = %68, %60
  %73 = getelementptr inbounds i8, ptr %23, i64 8
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %34, i8 0, i64 16, i1 false)
  store ptr %13, ptr %73, align 8, !tbaa !27
  %74 = load i32, ptr %9, align 4, !tbaa !8
  %75 = load i32, ptr %19, align 4, !tbaa !8
  store i32 -1, ptr %9, align 4, !tbaa !8
  store i32 -1, ptr %19, align 4, !tbaa !8
  %76 = load ptr, ptr %0, align 8, !tbaa !5
  %77 = getelementptr i8, ptr %76, i64 -24
  %78 = load i64, ptr %77, align 8
  %79 = getelementptr inbounds i8, ptr %0, i64 %78
  br label %80

80:                                               ; preds = %81, %72
  %.pn = phi ptr [ %79, %72 ], [ %.0, %81 ]
  %.0.in = getelementptr inbounds i8, ptr %.pn, i64 104
  %.0 = load ptr, ptr %.0.in, align 8, !tbaa !18
  %.not86 = icmp eq ptr %.0, null
  br i1 %.not86, label %.loopexit, label %81

81:                                               ; preds = %80
  %82 = getelementptr inbounds i8, ptr %.0, i64 76
  %83 = load i32, ptr %82, align 4, !tbaa !8
  %84 = icmp eq i32 %83, %75
  br i1 %84, label %85, label %80, !llvm.loop !31

85:                                               ; preds = %81
  %86 = getelementptr inbounds i8, ptr %.0, i64 76
  store i32 %74, ptr %86, align 4, !tbaa !8
  %87 = load i32, ptr %38, align 4, !tbaa !24
  %88 = getelementptr inbounds i8, ptr %.0, i64 60
  store i32 %87, ptr %88, align 4, !tbaa !24
  br label %.loopexit

.loopexit:                                        ; preds = %80, %85
  %89 = load i32, ptr %13, align 8, !tbaa !33
  store i32 %89, ptr %23, align 8, !tbaa !33
  ret void
}

; 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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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, !16, i64 76}
!9 = !{!"_ZTSN10ClipperLib5TEdgeE", !10, i64 0, !10, i64 16, !10, i64 32, !13, i64 48, !14, i64 56, !15, i64 60, !16, i64 64, !16, i64 68, !16, i64 72, !16, i64 76, !17, i64 80, !17, i64 88, !17, i64 96, !17, i64 104, !17, i64 112, !17, i64 120, !17, i64 128}
!10 = !{!"_ZTSN10ClipperLib8IntPointE", !11, i64 0, !11, i64 8}
!11 = !{!"long long", !12, i64 0}
!12 = !{!"omnipotent char", !7, i64 0}
!13 = !{!"double", !12, i64 0}
!14 = !{!"_ZTSN10ClipperLib8PolyTypeE", !12, i64 0}
!15 = !{!"_ZTSN10ClipperLib8EdgeSideE", !12, i64 0}
!16 = !{!"int", !12, i64 0}
!17 = !{!"any pointer", !12, i64 0}
!18 = !{!17, !17, i64 0}
!19 = !{!20, !17, i64 24}
!20 = !{!"_ZTSN10ClipperLib6OutRecE", !16, i64 0, !21, i64 4, !21, i64 5, !17, i64 8, !17, i64 16, !17, i64 24, !17, i64 32}
!21 = !{!"bool", !12, i64 0}
!22 = !{!23, !17, i64 32}
!23 = !{!"_ZTSN10ClipperLib5OutPtE", !16, i64 0, !10, i64 8, !17, i64 24, !17, i64 32}
!24 = !{!9, !15, i64 60}
!25 = !{!23, !17, i64 24}
!26 = !{!20, !17, i64 32}
!27 = !{!20, !17, i64 8}
!28 = !{!20, !21, i64 4}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!20, !16, i64 0}


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