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

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

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

; 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 uwtable
declare dso_local noundef i64 @_ZN10ClipperLib4TopXERNS_5TEdgeEx(ptr noundef nonnull align 8 dereferenceable(136), i64 noundef) #3

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN10ClipperLib7Clipper15AddLocalMinPolyEPNS_5TEdgeES2_RKNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef %1, ptr noundef %2, ptr noundef nonnull align 8 dereferenceable(16) %3) #2 align 2 {
  %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 i64, align 8
  %13 = alloca i64, 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 %"struct.ClipperLib::IntPoint", align 8
  %18 = alloca ptr, align 8
  %19 = alloca %"struct.ClipperLib::IntPoint", align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  %20 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %21 = load ptr, ptr %7, align 8, !tbaa !5
  %22 = call noundef zeroext i1 @_ZN10ClipperLib12IsHorizontalERNS_5TEdgeE(ptr noundef nonnull align 8 dereferenceable(136) %21)
  br i1 %22, label %31, label %23

23:                                               ; preds = %4
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %24, i32 0, i32 3
  %26 = load double, ptr %25, align 8, !tbaa !9
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %27, i32 0, i32 3
  %29 = load double, ptr %28, align 8, !tbaa !9
  %30 = fcmp ogt double %26, %29
  br i1 %30, label %31, label %59

31:                                               ; preds = %23, %4
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = call noundef ptr @_ZN10ClipperLib7Clipper8AddOutPtEPNS_5TEdgeERKNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %20, ptr noundef %32, ptr noundef nonnull align 8 dereferenceable(16) %33)
  store ptr %34, ptr %9, align 8, !tbaa !5
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %35, i32 0, i32 9
  %37 = load i32, ptr %36, align 4, !tbaa !17
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %38, i32 0, i32 9
  store i32 %37, ptr %39, align 4, !tbaa !17
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %40, i32 0, i32 5
  store i32 1, ptr %41, align 4, !tbaa !18
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %42, i32 0, i32 5
  store i32 2, ptr %43, align 4, !tbaa !18
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %44, ptr %10, align 8, !tbaa !5
  %45 = load ptr, ptr %10, align 8, !tbaa !5
  %46 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %45, i32 0, i32 14
  %47 = load ptr, ptr %46, align 8, !tbaa !19
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = icmp eq ptr %47, %48
  br i1 %49, label %50, label %54

50:                                               ; preds = %31
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %51, i32 0, i32 14
  %53 = load ptr, ptr %52, align 8, !tbaa !19
  store ptr %53, ptr %11, align 8, !tbaa !5
  br label %58

54:                                               ; preds = %31
  %55 = load ptr, ptr %10, align 8, !tbaa !5
  %56 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %55, i32 0, i32 14
  %57 = load ptr, ptr %56, align 8, !tbaa !19
  store ptr %57, ptr %11, align 8, !tbaa !5
  br label %58

58:                                               ; preds = %54, %50
  br label %87

59:                                               ; preds = %23
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  %61 = load ptr, ptr %8, align 8, !tbaa !5
  %62 = call noundef ptr @_ZN10ClipperLib7Clipper8AddOutPtEPNS_5TEdgeERKNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %20, ptr noundef %60, ptr noundef nonnull align 8 dereferenceable(16) %61)
  store ptr %62, ptr %9, align 8, !tbaa !5
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %63, i32 0, i32 9
  %65 = load i32, ptr %64, align 4, !tbaa !17
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  %67 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %66, i32 0, i32 9
  store i32 %65, ptr %67, align 4, !tbaa !17
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %68, i32 0, i32 5
  store i32 2, ptr %69, align 4, !tbaa !18
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  %71 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %70, i32 0, i32 5
  store i32 1, ptr %71, align 4, !tbaa !18
  %72 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %72, ptr %10, align 8, !tbaa !5
  %73 = load ptr, ptr %10, align 8, !tbaa !5
  %74 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %73, i32 0, i32 14
  %75 = load ptr, ptr %74, align 8, !tbaa !19
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = icmp eq ptr %75, %76
  br i1 %77, label %78, label %82

78:                                               ; preds = %59
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %79, i32 0, i32 14
  %81 = load ptr, ptr %80, align 8, !tbaa !19
  store ptr %81, ptr %11, align 8, !tbaa !5
  br label %86

82:                                               ; preds = %59
  %83 = load ptr, ptr %10, align 8, !tbaa !5
  %84 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %83, i32 0, i32 14
  %85 = load ptr, ptr %84, align 8, !tbaa !19
  store ptr %85, ptr %11, align 8, !tbaa !5
  br label %86

86:                                               ; preds = %82, %78
  br label %87

87:                                               ; preds = %86, %58
  %88 = load ptr, ptr %11, align 8, !tbaa !5
  %89 = icmp ne ptr %88, null
  br i1 %89, label %90, label %183

90:                                               ; preds = %87
  %91 = load ptr, ptr %11, align 8, !tbaa !5
  %92 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %91, i32 0, i32 9
  %93 = load i32, ptr %92, align 4, !tbaa !17
  %94 = icmp sge i32 %93, 0
  br i1 %94, label %95, label %183

95:                                               ; preds = %90
  %96 = load ptr, ptr %11, align 8, !tbaa !5
  %97 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %96, i32 0, i32 2
  %98 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %97, i32 0, i32 1
  %99 = load i64, ptr %98, align 8, !tbaa !20
  %100 = load ptr, ptr %8, align 8, !tbaa !5
  %101 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %100, i32 0, i32 1
  %102 = load i64, ptr %101, align 8, !tbaa !21
  %103 = icmp slt i64 %99, %102
  br i1 %103, label %104, label %183

104:                                              ; preds = %95
  %105 = load ptr, ptr %10, align 8, !tbaa !5
  %106 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %105, i32 0, i32 2
  %107 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %106, i32 0, i32 1
  %108 = load i64, ptr %107, align 8, !tbaa !20
  %109 = load ptr, ptr %8, align 8, !tbaa !5
  %110 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %109, i32 0, i32 1
  %111 = load i64, ptr %110, align 8, !tbaa !21
  %112 = icmp slt i64 %108, %111
  br i1 %112, label %113, label %183

113:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %114 = load ptr, ptr %11, align 8, !tbaa !5
  %115 = load ptr, ptr %8, align 8, !tbaa !5
  %116 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %115, i32 0, i32 1
  %117 = load i64, ptr %116, align 8, !tbaa !21
  %118 = call noundef i64 @_ZN10ClipperLib4TopXERNS_5TEdgeEx(ptr noundef nonnull align 8 dereferenceable(136) %114, i64 noundef %117)
  store i64 %118, ptr %12, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %119 = load ptr, ptr %10, align 8, !tbaa !5
  %120 = load ptr, ptr %8, align 8, !tbaa !5
  %121 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %120, i32 0, i32 1
  %122 = load i64, ptr %121, align 8, !tbaa !21
  %123 = call noundef i64 @_ZN10ClipperLib4TopXERNS_5TEdgeEx(ptr noundef nonnull align 8 dereferenceable(136) %119, i64 noundef %122)
  store i64 %123, ptr %13, align 8, !tbaa !22
  %124 = load i64, ptr %12, align 8, !tbaa !22
  %125 = load i64, ptr %13, align 8, !tbaa !22
  %126 = icmp eq i64 %124, %125
  br i1 %126, label %127, label %182

127:                                              ; preds = %113
  %128 = load ptr, ptr %10, align 8, !tbaa !5
  %129 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %128, i32 0, i32 6
  %130 = load i32, ptr %129, align 8, !tbaa !23
  %131 = icmp ne i32 %130, 0
  br i1 %131, label %132, label %182

132:                                              ; preds = %127
  %133 = load ptr, ptr %11, align 8, !tbaa !5
  %134 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %133, i32 0, i32 6
  %135 = load i32, ptr %134, align 8, !tbaa !23
  %136 = icmp ne i32 %135, 0
  br i1 %136, label %137, label %182

137:                                              ; preds = %132
  %138 = load i64, ptr %12, align 8, !tbaa !22
  %139 = load ptr, ptr %8, align 8, !tbaa !5
  %140 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %139, i32 0, i32 1
  %141 = load i64, ptr %140, align 8, !tbaa !21
  call void @_ZN10ClipperLib8IntPointC2Exx(ptr noundef nonnull align 8 dereferenceable(16) %14, i64 noundef %138, i64 noundef %141)
  %142 = load ptr, ptr %11, align 8, !tbaa !5
  %143 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %142, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %143, i64 16, i1 false), !tbaa.struct !24
  %144 = load i64, ptr %13, align 8, !tbaa !22
  %145 = load ptr, ptr %8, align 8, !tbaa !5
  %146 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %145, i32 0, i32 1
  %147 = load i64, ptr %146, align 8, !tbaa !21
  call void @_ZN10ClipperLib8IntPointC2Exx(ptr noundef nonnull align 8 dereferenceable(16) %16, i64 noundef %144, i64 noundef %147)
  %148 = load ptr, ptr %10, align 8, !tbaa !5
  %149 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %148, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %17, ptr align 8 %149, i64 16, i1 false), !tbaa.struct !24
  %150 = load ptr, ptr %20, align 8, !tbaa !25
  %151 = getelementptr i8, ptr %150, i64 -24
  %152 = load i64, ptr %151, align 8
  %153 = getelementptr inbounds i8, ptr %20, i64 %152
  %154 = getelementptr inbounds %"class.ClipperLib::ClipperBase", ptr %153, i32 0, i32 3
  %155 = load i8, ptr %154, align 8, !tbaa !27, !range !49, !noundef !50
  %156 = trunc i8 %155 to i1
  %157 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 0
  %158 = load i64, ptr %157, align 8
  %159 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 1
  %160 = load i64, ptr %159, align 8
  %161 = getelementptr inbounds { i64, i64 }, ptr %15, i32 0, i32 0
  %162 = load i64, ptr %161, align 8
  %163 = getelementptr inbounds { i64, i64 }, ptr %15, i32 0, i32 1
  %164 = load i64, ptr %163, align 8
  %165 = getelementptr inbounds { i64, i64 }, ptr %16, i32 0, i32 0
  %166 = load i64, ptr %165, align 8
  %167 = getelementptr inbounds { i64, i64 }, ptr %16, i32 0, i32 1
  %168 = load i64, ptr %167, align 8
  %169 = call noundef zeroext i1 @_ZN10ClipperLib11SlopesEqualENS_8IntPointES0_S0_S0_b(i64 %158, i64 %160, i64 %162, i64 %164, i64 %166, i64 %168, ptr noundef byval(%"struct.ClipperLib::IntPoint") align 8 %17, i1 noundef zeroext %156)
  br i1 %169, label %170, label %182

170:                                              ; preds = %137
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %171 = load ptr, ptr %11, align 8, !tbaa !5
  %172 = load ptr, ptr %8, align 8, !tbaa !5
  %173 = call noundef ptr @_ZN10ClipperLib7Clipper8AddOutPtEPNS_5TEdgeERKNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %20, ptr noundef %171, ptr noundef nonnull align 8 dereferenceable(16) %172)
  store ptr %173, ptr %18, align 8, !tbaa !5
  %174 = load ptr, ptr %9, align 8, !tbaa !5
  %175 = load ptr, ptr %18, align 8, !tbaa !5
  %176 = load ptr, ptr %10, align 8, !tbaa !5
  %177 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %176, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %177, i64 16, i1 false), !tbaa.struct !24
  %178 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 0
  %179 = load i64, ptr %178, align 8
  %180 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 1
  %181 = load i64, ptr %180, align 8
  call void @_ZN10ClipperLib7Clipper7AddJoinEPNS_5OutPtES2_NS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %20, ptr noundef %174, ptr noundef %175, i64 %179, i64 %181)
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %182

182:                                              ; preds = %170, %137, %132, %127, %113
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %183

183:                                              ; preds = %182, %104, %95, %90, %87
  %184 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  ret ptr %184
}

; 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 nounwind uwtable
declare dso_local void @_ZN10ClipperLib8IntPointC2Exx(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i64 noundef) unnamed_addr #5 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

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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { 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, !13, i64 48}
!10 = !{!"_ZTSN10ClipperLib5TEdgeE", !11, i64 0, !11, i64 16, !11, i64 32, !13, i64 48, !14, i64 56, !15, i64 60, !16, i64 64, !16, i64 68, !16, i64 72, !16, i64 76, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128}
!11 = !{!"_ZTSN10ClipperLib8IntPointE", !12, i64 0, !12, i64 8}
!12 = !{!"long long", !7, i64 0}
!13 = !{!"double", !7, i64 0}
!14 = !{!"_ZTSN10ClipperLib8PolyTypeE", !7, i64 0}
!15 = !{!"_ZTSN10ClipperLib8EdgeSideE", !7, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{!10, !16, i64 76}
!18 = !{!10, !15, i64 60}
!19 = !{!10, !6, i64 112}
!20 = !{!10, !12, i64 40}
!21 = !{!11, !12, i64 8}
!22 = !{!12, !12, i64 0}
!23 = !{!10, !16, i64 64}
!24 = !{i64 0, i64 8, !22, i64 8, i64 8, !22}
!25 = !{!26, !26, i64 0}
!26 = !{!"vtable pointer", !8, i64 0}
!27 = !{!28, !34, i64 40}
!28 = !{!"_ZTSN10ClipperLib11ClipperBaseE", !29, i64 8, !30, i64 16, !34, i64 40, !35, i64 48, !34, i64 72, !34, i64 73, !39, i64 80, !6, i64 104, !43, i64 112}
!29 = !{!"_ZTSN9__gnu_cxx17__normal_iteratorIPN10ClipperLib12LocalMinimumESt6vectorIS2_SaIS2_EEEE", !6, i64 0}
!30 = !{!"_ZTSSt6vectorIN10ClipperLib12LocalMinimumESaIS1_EE", !31, i64 0}
!31 = !{!"_ZTSSt12_Vector_baseIN10ClipperLib12LocalMinimumESaIS1_EE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseIN10ClipperLib12LocalMinimumESaIS1_EE12_Vector_implE", !33, i64 0}
!33 = !{!"_ZTSNSt12_Vector_baseIN10ClipperLib12LocalMinimumESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!34 = !{!"bool", !7, i64 0}
!35 = !{!"_ZTSSt6vectorIPN10ClipperLib5TEdgeESaIS2_EE", !36, i64 0}
!36 = !{!"_ZTSSt12_Vector_baseIPN10ClipperLib5TEdgeESaIS2_EE", !37, i64 0}
!37 = !{!"_ZTSNSt12_Vector_baseIPN10ClipperLib5TEdgeESaIS2_EE12_Vector_implE", !38, i64 0}
!38 = !{!"_ZTSNSt12_Vector_baseIPN10ClipperLib5TEdgeESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!39 = !{!"_ZTSSt6vectorIPN10ClipperLib6OutRecESaIS2_EE", !40, i64 0}
!40 = !{!"_ZTSSt12_Vector_baseIPN10ClipperLib6OutRecESaIS2_EE", !41, i64 0}
!41 = !{!"_ZTSNSt12_Vector_baseIPN10ClipperLib6OutRecESaIS2_EE12_Vector_implE", !42, i64 0}
!42 = !{!"_ZTSNSt12_Vector_baseIPN10ClipperLib6OutRecESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!43 = !{!"_ZTSSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE", !44, i64 0, !48, i64 24}
!44 = !{!"_ZTSSt6vectorIxSaIxEE", !45, i64 0}
!45 = !{!"_ZTSSt12_Vector_baseIxSaIxEE", !46, i64 0}
!46 = !{!"_ZTSNSt12_Vector_baseIxSaIxEE12_Vector_implE", !47, i64 0}
!47 = !{!"_ZTSNSt12_Vector_baseIxSaIxEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!48 = !{!"_ZTSSt4lessIxE"}
!49 = !{i8 0, i8 2}
!50 = !{}


; 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 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 #0

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZN10ClipperLib4TopXERNS_5TEdgeEx(ptr noundef nonnull align 8 dereferenceable(136), i64 noundef) 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 uwtable
define dso_local noundef ptr @_ZN10ClipperLib7Clipper15AddLocalMinPolyEPNS_5TEdgeES2_RKNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef %1, ptr noundef nonnull %2, ptr noundef nonnull align 8 dereferenceable(16) %3) local_unnamed_addr #0 align 2 {
  %5 = alloca %"struct.ClipperLib::IntPoint", align 8
  %6 = alloca %"struct.ClipperLib::IntPoint", align 8
  %7 = tail call noundef zeroext i1 @_ZN10ClipperLib12IsHorizontalERNS_5TEdgeE(ptr noundef nonnull align 8 dereferenceable(136) %2)
  br i1 %7, label %14, label %8

8:                                                ; preds = %4
  %9 = getelementptr inbounds i8, ptr %1, i64 48
  %10 = load double, ptr %9, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %2, i64 48
  %12 = load double, ptr %11, align 8, !tbaa !5
  %13 = fcmp ogt double %10, %12
  br i1 %13, label %14, label %24

14:                                               ; preds = %8, %4
  %15 = tail call noundef ptr @_ZN10ClipperLib7Clipper8AddOutPtEPNS_5TEdgeERKNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef %1, ptr noundef nonnull align 8 dereferenceable(16) %3)
  %16 = getelementptr inbounds i8, ptr %1, i64 76
  %17 = load i32, ptr %16, align 4, !tbaa !16
  %18 = getelementptr inbounds i8, ptr %2, i64 76
  store i32 %17, ptr %18, align 4, !tbaa !16
  %19 = getelementptr inbounds i8, ptr %1, i64 60
  store i32 1, ptr %19, align 4, !tbaa !17
  %20 = getelementptr inbounds i8, ptr %2, i64 60
  store i32 2, ptr %20, align 4, !tbaa !17
  %21 = getelementptr inbounds i8, ptr %1, i64 112
  %22 = load ptr, ptr %21, align 8, !tbaa !18
  %23 = icmp eq ptr %22, %2
  br i1 %23, label %.sink.split, label %36

24:                                               ; preds = %8
  %25 = tail call noundef ptr @_ZN10ClipperLib7Clipper8AddOutPtEPNS_5TEdgeERKNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef nonnull %2, ptr noundef nonnull align 8 dereferenceable(16) %3)
  %26 = getelementptr inbounds i8, ptr %2, i64 76
  %27 = load i32, ptr %26, align 4, !tbaa !16
  %28 = getelementptr inbounds i8, ptr %1, i64 76
  store i32 %27, ptr %28, align 4, !tbaa !16
  %29 = getelementptr inbounds i8, ptr %1, i64 60
  store i32 2, ptr %29, align 4, !tbaa !17
  %30 = getelementptr inbounds i8, ptr %2, i64 60
  store i32 1, ptr %30, align 4, !tbaa !17
  %31 = getelementptr inbounds i8, ptr %2, i64 112
  %32 = load ptr, ptr %31, align 8, !tbaa !18
  %33 = icmp eq ptr %32, %1
  br i1 %33, label %.sink.split, label %36

.sink.split:                                      ; preds = %24, %14
  %.sink64 = phi ptr [ %2, %14 ], [ %1, %24 ]
  %.053.ph = phi ptr [ %1, %14 ], [ %2, %24 ]
  %.0.ph = phi ptr [ %15, %14 ], [ %25, %24 ]
  %34 = getelementptr inbounds i8, ptr %.sink64, i64 112
  %35 = load ptr, ptr %34, align 8, !tbaa !18
  br label %36

36:                                               ; preds = %.sink.split, %24, %14
  %.054 = phi ptr [ %22, %14 ], [ %32, %24 ], [ %35, %.sink.split ]
  %.053 = phi ptr [ %1, %14 ], [ %2, %24 ], [ %.053.ph, %.sink.split ]
  %.0 = phi ptr [ %15, %14 ], [ %25, %24 ], [ %.0.ph, %.sink.split ]
  %.not = icmp eq ptr %.054, null
  br i1 %.not, label %83, label %37

37:                                               ; preds = %36
  %38 = getelementptr inbounds i8, ptr %.054, i64 76
  %39 = load i32, ptr %38, align 4, !tbaa !16
  %40 = icmp sgt i32 %39, -1
  br i1 %40, label %41, label %83

41:                                               ; preds = %37
  %42 = getelementptr inbounds i8, ptr %.054, i64 32
  %43 = getelementptr inbounds i8, ptr %.054, i64 40
  %44 = load i64, ptr %43, align 8, !tbaa !19
  %45 = getelementptr inbounds i8, ptr %3, i64 8
  %46 = load i64, ptr %45, align 8, !tbaa !20
  %47 = icmp slt i64 %44, %46
  br i1 %47, label %48, label %83

48:                                               ; preds = %41
  %49 = getelementptr inbounds i8, ptr %.053, i64 32
  %50 = getelementptr inbounds i8, ptr %.053, i64 40
  %51 = load i64, ptr %50, align 8, !tbaa !19
  %52 = icmp slt i64 %51, %46
  br i1 %52, label %53, label %83

53:                                               ; preds = %48
  %54 = tail call noundef i64 @_ZN10ClipperLib4TopXERNS_5TEdgeEx(ptr noundef nonnull align 8 dereferenceable(136) %.054, i64 noundef %46)
  %55 = load i64, ptr %45, align 8, !tbaa !20
  %56 = tail call noundef i64 @_ZN10ClipperLib4TopXERNS_5TEdgeEx(ptr noundef nonnull align 8 dereferenceable(136) %.053, i64 noundef %55)
  %57 = icmp eq i64 %54, %56
  br i1 %57, label %58, label %83

58:                                               ; preds = %53
  %59 = getelementptr inbounds i8, ptr %.053, i64 64
  %60 = load i32, ptr %59, align 8, !tbaa !21
  %.not62 = icmp eq i32 %60, 0
  br i1 %.not62, label %83, label %61

61:                                               ; preds = %58
  %62 = getelementptr inbounds i8, ptr %.054, i64 64
  %63 = load i32, ptr %62, align 8, !tbaa !21
  %.not63 = icmp eq i32 %63, 0
  br i1 %.not63, label %83, label %64

64:                                               ; preds = %61
  %65 = load i64, ptr %45, align 8, !tbaa !20
  call void @_ZN10ClipperLib8IntPointC2Exx(ptr noundef nonnull align 8 dereferenceable(16) %5, i64 noundef %54, i64 noundef %65)
  %.sroa.01.0.copyload = load i64, ptr %42, align 8, !tbaa !22
  %.sroa.22.0.copyload = load i64, ptr %43, align 8, !tbaa !22
  %66 = load i64, ptr %45, align 8, !tbaa !20
  call void @_ZN10ClipperLib8IntPointC2Exx(ptr noundef nonnull align 8 dereferenceable(16) %6, i64 noundef %54, i64 noundef %66)
  %67 = load ptr, ptr %0, align 8, !tbaa !23
  %68 = getelementptr i8, ptr %67, i64 -24
  %69 = load i64, ptr %68, align 8
  %70 = getelementptr inbounds i8, ptr %0, i64 %69
  %71 = getelementptr inbounds i8, ptr %70, i64 40
  %72 = load i8, ptr %71, align 8, !tbaa !25, !range !47, !noundef !48
  %73 = trunc nuw i8 %72 to i1
  %74 = load i64, ptr %5, align 8
  %75 = getelementptr inbounds i8, ptr %5, i64 8
  %76 = load i64, ptr %75, align 8
  %77 = load i64, ptr %6, align 8
  %78 = getelementptr inbounds i8, ptr %6, i64 8
  %79 = load i64, ptr %78, align 8
  %80 = call noundef zeroext i1 @_ZN10ClipperLib11SlopesEqualENS_8IntPointES0_S0_S0_b(i64 %74, i64 %76, i64 %.sroa.01.0.copyload, i64 %.sroa.22.0.copyload, i64 %77, i64 %79, ptr noundef nonnull byval(%"struct.ClipperLib::IntPoint") align 8 %49, i1 noundef zeroext %73)
  br i1 %80, label %81, label %83

81:                                               ; preds = %64
  %82 = call noundef ptr @_ZN10ClipperLib7Clipper8AddOutPtEPNS_5TEdgeERKNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef nonnull %.054, ptr noundef nonnull align 8 dereferenceable(16) %3)
  %.sroa.0.0.copyload = load i64, ptr %49, align 8, !tbaa !22
  %.sroa.2.0.copyload = load i64, ptr %50, align 8, !tbaa !22
  call void @_ZN10ClipperLib7Clipper7AddJoinEPNS_5OutPtES2_NS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef %.0, ptr noundef %82, i64 %.sroa.0.0.copyload, i64 %.sroa.2.0.copyload)
  br label %83

83:                                               ; preds = %53, %58, %61, %64, %81, %48, %41, %37, %36
  ret ptr %.0
}

; 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 #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10ClipperLib8IntPointC2Exx(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i64 noundef) unnamed_addr #3 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 #0 align 2

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

!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, !11, i64 48}
!6 = !{!"_ZTSN10ClipperLib5TEdgeE", !7, i64 0, !7, i64 16, !7, i64 32, !11, i64 48, !12, i64 56, !13, i64 60, !14, i64 64, !14, i64 68, !14, i64 72, !14, i64 76, !15, i64 80, !15, i64 88, !15, i64 96, !15, i64 104, !15, i64 112, !15, i64 120, !15, i64 128}
!7 = !{!"_ZTSN10ClipperLib8IntPointE", !8, i64 0, !8, i64 8}
!8 = !{!"long long", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"double", !9, i64 0}
!12 = !{!"_ZTSN10ClipperLib8PolyTypeE", !9, i64 0}
!13 = !{!"_ZTSN10ClipperLib8EdgeSideE", !9, i64 0}
!14 = !{!"int", !9, i64 0}
!15 = !{!"any pointer", !9, i64 0}
!16 = !{!6, !14, i64 76}
!17 = !{!6, !13, i64 60}
!18 = !{!6, !15, i64 112}
!19 = !{!6, !8, i64 40}
!20 = !{!7, !8, i64 8}
!21 = !{!6, !14, i64 64}
!22 = !{!8, !8, i64 0}
!23 = !{!24, !24, i64 0}
!24 = !{!"vtable pointer", !10, i64 0}
!25 = !{!26, !32, i64 40}
!26 = !{!"_ZTSN10ClipperLib11ClipperBaseE", !27, i64 8, !28, i64 16, !32, i64 40, !33, i64 48, !32, i64 72, !32, i64 73, !37, i64 80, !15, i64 104, !41, i64 112}
!27 = !{!"_ZTSN9__gnu_cxx17__normal_iteratorIPN10ClipperLib12LocalMinimumESt6vectorIS2_SaIS2_EEEE", !15, i64 0}
!28 = !{!"_ZTSSt6vectorIN10ClipperLib12LocalMinimumESaIS1_EE", !29, i64 0}
!29 = !{!"_ZTSSt12_Vector_baseIN10ClipperLib12LocalMinimumESaIS1_EE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIN10ClipperLib12LocalMinimumESaIS1_EE12_Vector_implE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIN10ClipperLib12LocalMinimumESaIS1_EE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!32 = !{!"bool", !9, i64 0}
!33 = !{!"_ZTSSt6vectorIPN10ClipperLib5TEdgeESaIS2_EE", !34, i64 0}
!34 = !{!"_ZTSSt12_Vector_baseIPN10ClipperLib5TEdgeESaIS2_EE", !35, i64 0}
!35 = !{!"_ZTSNSt12_Vector_baseIPN10ClipperLib5TEdgeESaIS2_EE12_Vector_implE", !36, i64 0}
!36 = !{!"_ZTSNSt12_Vector_baseIPN10ClipperLib5TEdgeESaIS2_EE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!37 = !{!"_ZTSSt6vectorIPN10ClipperLib6OutRecESaIS2_EE", !38, i64 0}
!38 = !{!"_ZTSSt12_Vector_baseIPN10ClipperLib6OutRecESaIS2_EE", !39, i64 0}
!39 = !{!"_ZTSNSt12_Vector_baseIPN10ClipperLib6OutRecESaIS2_EE12_Vector_implE", !40, i64 0}
!40 = !{!"_ZTSNSt12_Vector_baseIPN10ClipperLib6OutRecESaIS2_EE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!41 = !{!"_ZTSSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE", !42, i64 0, !46, i64 24}
!42 = !{!"_ZTSSt6vectorIxSaIxEE", !43, i64 0}
!43 = !{!"_ZTSSt12_Vector_baseIxSaIxEE", !44, i64 0}
!44 = !{!"_ZTSNSt12_Vector_baseIxSaIxEE12_Vector_implE", !45, i64 0}
!45 = !{!"_ZTSNSt12_Vector_baseIxSaIxEE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!46 = !{!"_ZTSSt4lessIxE"}
!47 = !{i8 0, i8 2}
!48 = !{}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass