; 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::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 }
%"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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN10ClipperLibeqERKNS_8IntPointES2_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #2

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #3

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #6

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN10ClipperLib7Clipper8AddOutPtEPNS_5TEdgeERKNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef %1, ptr noundef nonnull align 8 dereferenceable(16) %2) #5 align 2 personality ptr @__gxx_personality_v0 {
  %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 i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i8, align 1
  %15 = alloca i32, align 4
  %16 = alloca ptr, 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
  %17 = load ptr, ptr %5, align 8
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %18, i32 0, i32 9
  %20 = load i32, ptr %19, align 4, !tbaa !9
  %21 = icmp slt i32 %20, 0
  br i1 %21, label %22, label %72

22:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %23 = load ptr, ptr %17, align 8, !tbaa !17
  %24 = getelementptr i8, ptr %23, i64 -24
  %25 = load i64, ptr %24, align 8
  %26 = getelementptr inbounds i8, ptr %17, i64 %25
  %27 = call noundef ptr @_ZN10ClipperLib11ClipperBase12CreateOutRecEv(ptr noundef nonnull align 8 dereferenceable(144) %26)
  store ptr %27, ptr %8, align 8, !tbaa !5
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %28, i32 0, i32 6
  %30 = load i32, ptr %29, align 8, !tbaa !19
  %31 = icmp eq i32 %30, 0
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %32, i32 0, i32 2
  %34 = zext i1 %31 to i8
  store i8 %34, ptr %33, align 1, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %35 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 40) #9
  invoke void @_ZN10ClipperLib5OutPtC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %35)
          to label %36 unwind label %61

36:                                               ; preds = %22
  store ptr %35, ptr %9, align 8, !tbaa !5
  %37 = load ptr, ptr %9, align 8, !tbaa !5
  %38 = load ptr, ptr %8, align 8, !tbaa !5
  %39 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %38, i32 0, i32 5
  store ptr %37, ptr %39, align 8, !tbaa !23
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  %41 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %40, i32 0, i32 0
  %42 = load i32, ptr %41, align 8, !tbaa !24
  %43 = load ptr, ptr %9, align 8, !tbaa !5
  %44 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %43, i32 0, i32 0
  store i32 %42, ptr %44, align 8, !tbaa !25
  %45 = load ptr, ptr %7, align 8, !tbaa !5
  %46 = load ptr, ptr %9, align 8, !tbaa !5
  %47 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %46, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %47, ptr align 8 %45, i64 16, i1 false), !tbaa.struct !27
  %48 = load ptr, ptr %9, align 8, !tbaa !5
  %49 = load ptr, ptr %9, align 8, !tbaa !5
  %50 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %49, i32 0, i32 2
  store ptr %48, ptr %50, align 8, !tbaa !29
  %51 = load ptr, ptr %9, align 8, !tbaa !5
  %52 = load ptr, ptr %9, align 8, !tbaa !5
  %53 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %52, i32 0, i32 3
  store ptr %51, ptr %53, align 8, !tbaa !30
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  %55 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %54, i32 0, i32 2
  %56 = load i8, ptr %55, align 1, !tbaa !20, !range !31, !noundef !32
  %57 = trunc i8 %56 to i1
  br i1 %57, label %65, label %58

58:                                               ; preds = %36
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  %60 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN10ClipperLib7Clipper12SetHoleStateEPNS_5TEdgeEPNS_6OutRecE(ptr noundef nonnull align 8 dereferenceable(135) %17, ptr noundef %59, ptr noundef %60)
  br label %65

61:                                               ; preds = %22
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %10, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %11, align 4
  call void @_ZdlPvm(ptr noundef %35, i64 noundef 40) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  br label %158

65:                                               ; preds = %58, %36
  %66 = load ptr, ptr %8, align 8, !tbaa !5
  %67 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %66, i32 0, i32 0
  %68 = load i32, ptr %67, align 8, !tbaa !24
  %69 = load ptr, ptr %6, align 8, !tbaa !5
  %70 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %69, i32 0, i32 9
  store i32 %68, ptr %70, align 4, !tbaa !9
  %71 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %71, ptr %4, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  br label %156

72:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %73 = load ptr, ptr %17, align 8, !tbaa !17
  %74 = getelementptr i8, ptr %73, i64 -24
  %75 = load i64, ptr %74, align 8
  %76 = getelementptr inbounds i8, ptr %17, i64 %75
  %77 = getelementptr inbounds %"class.ClipperLib::ClipperBase", ptr %76, i32 0, i32 7
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %78, i32 0, i32 9
  %80 = load i32, ptr %79, align 4, !tbaa !9
  %81 = sext i32 %80 to i64
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10ClipperLib6OutRecESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %77, i64 noundef %81) #8
  %83 = load ptr, ptr %82, align 8, !tbaa !5
  store ptr %83, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %84 = load ptr, ptr %12, align 8, !tbaa !5
  %85 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %84, i32 0, i32 5
  %86 = load ptr, ptr %85, align 8, !tbaa !23
  store ptr %86, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #8
  %87 = load ptr, ptr %6, align 8, !tbaa !5
  %88 = getelementptr inbounds %"struct.ClipperLib::TEdge", ptr %87, i32 0, i32 5
  %89 = load i32, ptr %88, align 4, !tbaa !33
  %90 = icmp eq i32 %89, 1
  %91 = zext i1 %90 to i8
  store i8 %91, ptr %14, align 1, !tbaa !34
  %92 = load i8, ptr %14, align 1, !tbaa !34, !range !31, !noundef !32
  %93 = trunc i8 %92 to i1
  br i1 %93, label %94, label %101

94:                                               ; preds = %72
  %95 = load ptr, ptr %7, align 8, !tbaa !5
  %96 = load ptr, ptr %13, align 8, !tbaa !5
  %97 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %96, i32 0, i32 1
  %98 = call noundef zeroext i1 @_ZN10ClipperLibeqERKNS_8IntPointES2_(ptr noundef nonnull align 8 dereferenceable(16) %95, ptr noundef nonnull align 8 dereferenceable(16) %97)
  br i1 %98, label %99, label %101

99:                                               ; preds = %94
  %100 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %100, ptr %4, align 8
  store i32 1, ptr %15, align 4
  br label %155

101:                                              ; preds = %94, %72
  %102 = load i8, ptr %14, align 1, !tbaa !34, !range !31, !noundef !32
  %103 = trunc i8 %102 to i1
  br i1 %103, label %115, label %104

104:                                              ; preds = %101
  %105 = load ptr, ptr %7, align 8, !tbaa !5
  %106 = load ptr, ptr %13, align 8, !tbaa !5
  %107 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %106, i32 0, i32 3
  %108 = load ptr, ptr %107, align 8, !tbaa !30
  %109 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %108, i32 0, i32 1
  %110 = call noundef zeroext i1 @_ZN10ClipperLibeqERKNS_8IntPointES2_(ptr noundef nonnull align 8 dereferenceable(16) %105, ptr noundef nonnull align 8 dereferenceable(16) %109)
  br i1 %110, label %111, label %115

111:                                              ; preds = %104
  %112 = load ptr, ptr %13, align 8, !tbaa !5
  %113 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %112, i32 0, i32 3
  %114 = load ptr, ptr %113, align 8, !tbaa !30
  store ptr %114, ptr %4, align 8
  store i32 1, ptr %15, align 4
  br label %155

115:                                              ; preds = %104, %101
  br label %116

116:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %117 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 40) #9
  invoke void @_ZN10ClipperLib5OutPtC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %117)
          to label %118 unwind label %149

118:                                              ; preds = %116
  store ptr %117, ptr %16, align 8, !tbaa !5
  %119 = load ptr, ptr %12, align 8, !tbaa !5
  %120 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %119, i32 0, i32 0
  %121 = load i32, ptr %120, align 8, !tbaa !24
  %122 = load ptr, ptr %16, align 8, !tbaa !5
  %123 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %122, i32 0, i32 0
  store i32 %121, ptr %123, align 8, !tbaa !25
  %124 = load ptr, ptr %7, align 8, !tbaa !5
  %125 = load ptr, ptr %16, align 8, !tbaa !5
  %126 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %125, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %126, ptr align 8 %124, i64 16, i1 false), !tbaa.struct !27
  %127 = load ptr, ptr %13, align 8, !tbaa !5
  %128 = load ptr, ptr %16, align 8, !tbaa !5
  %129 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %128, i32 0, i32 2
  store ptr %127, ptr %129, align 8, !tbaa !29
  %130 = load ptr, ptr %13, align 8, !tbaa !5
  %131 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %130, i32 0, i32 3
  %132 = load ptr, ptr %131, align 8, !tbaa !30
  %133 = load ptr, ptr %16, align 8, !tbaa !5
  %134 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %133, i32 0, i32 3
  store ptr %132, ptr %134, align 8, !tbaa !30
  %135 = load ptr, ptr %16, align 8, !tbaa !5
  %136 = load ptr, ptr %16, align 8, !tbaa !5
  %137 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %136, i32 0, i32 3
  %138 = load ptr, ptr %137, align 8, !tbaa !30
  %139 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %138, i32 0, i32 2
  store ptr %135, ptr %139, align 8, !tbaa !29
  %140 = load ptr, ptr %16, align 8, !tbaa !5
  %141 = load ptr, ptr %13, align 8, !tbaa !5
  %142 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %141, i32 0, i32 3
  store ptr %140, ptr %142, align 8, !tbaa !30
  %143 = load i8, ptr %14, align 1, !tbaa !34, !range !31, !noundef !32
  %144 = trunc i8 %143 to i1
  br i1 %144, label %145, label %153

145:                                              ; preds = %118
  %146 = load ptr, ptr %16, align 8, !tbaa !5
  %147 = load ptr, ptr %12, align 8, !tbaa !5
  %148 = getelementptr inbounds %"struct.ClipperLib::OutRec", ptr %147, i32 0, i32 5
  store ptr %146, ptr %148, align 8, !tbaa !23
  br label %153

149:                                              ; preds = %116
  %150 = landingpad { ptr, i32 }
          cleanup
  %151 = extractvalue { ptr, i32 } %150, 0
  store ptr %151, ptr %10, align 8
  %152 = extractvalue { ptr, i32 } %150, 1
  store i32 %152, ptr %11, align 4
  call void @_ZdlPvm(ptr noundef %117, i64 noundef 40) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br label %158

153:                                              ; preds = %145, %118
  %154 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %154, ptr %4, align 8
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  br label %155

155:                                              ; preds = %153, %111, %99
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br label %156

156:                                              ; preds = %155, %65
  %157 = load ptr, ptr %4, align 8
  ret ptr %157

158:                                              ; preds = %149, %61
  %159 = load ptr, ptr %10, align 8
  %160 = load i32, ptr %11, align 4
  %161 = insertvalue { ptr, i32 } poison, ptr %159, 0
  %162 = insertvalue { ptr, i32 } %161, i32 %160, 1
  resume { ptr, i32 } %162
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN10ClipperLib5OutPtC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #7 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nobuiltin allocsize(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 #7 = { 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 #8 = { nounwind }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { builtin 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, !16, i64 76}
!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 = !{!18, !18, i64 0}
!18 = !{!"vtable pointer", !8, i64 0}
!19 = !{!10, !16, i64 64}
!20 = !{!21, !22, i64 5}
!21 = !{!"_ZTSN10ClipperLib6OutRecE", !16, i64 0, !22, i64 4, !22, i64 5, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!22 = !{!"bool", !7, i64 0}
!23 = !{!21, !6, i64 24}
!24 = !{!21, !16, i64 0}
!25 = !{!26, !16, i64 0}
!26 = !{!"_ZTSN10ClipperLib5OutPtE", !16, i64 0, !11, i64 8, !6, i64 24, !6, i64 32}
!27 = !{i64 0, i64 8, !28, i64 8, i64 8, !28}
!28 = !{!12, !12, i64 0}
!29 = !{!26, !6, i64 24}
!30 = !{!26, !6, i64 32}
!31 = !{i8 0, i8 2}
!32 = !{}
!33 = !{!10, !15, i64 60}
!34 = !{!22, !22, 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 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) #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN10ClipperLibeqERKNS_8IntPointES2_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN10ClipperLib7Clipper8AddOutPtEPNS_5TEdgeERKNS_8IntPointE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef %1, ptr noundef nonnull align 8 dereferenceable(16) %2) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %4 = getelementptr inbounds i8, ptr %1, i64 76
  %5 = load i32, ptr %4, align 4, !tbaa !5
  %6 = icmp slt i32 %5, 0
  %7 = load ptr, ptr %0, align 8, !tbaa !16
  %8 = getelementptr i8, ptr %7, i64 -24
  %9 = load i64, ptr %8, align 8
  %10 = getelementptr inbounds i8, ptr %0, i64 %9
  br i1 %6, label %11, label %32

11:                                               ; preds = %3
  %12 = tail call noundef ptr @_ZN10ClipperLib11ClipperBase12CreateOutRecEv(ptr noundef nonnull align 8 dereferenceable(144) %10)
  %13 = getelementptr inbounds i8, ptr %1, i64 64
  %14 = load i32, ptr %13, align 8, !tbaa !18
  %15 = icmp eq i32 %14, 0
  %16 = getelementptr inbounds i8, ptr %12, i64 5
  %17 = zext i1 %15 to i8
  store i8 %17, ptr %16, align 1, !tbaa !19
  %18 = tail call noalias noundef nonnull dereferenceable(40) ptr @_Znwm(i64 noundef 40) #7
  invoke void @_ZN10ClipperLib5OutPtC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %18)
          to label %19 unwind label %28

19:                                               ; preds = %11
  %20 = getelementptr inbounds i8, ptr %12, i64 24
  store ptr %18, ptr %20, align 8, !tbaa !22
  %21 = load i32, ptr %12, align 8, !tbaa !23
  store i32 %21, ptr %18, align 8, !tbaa !24
  %22 = getelementptr inbounds i8, ptr %18, i64 8
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 8 dereferenceable(16) %2, i64 16, i1 false), !tbaa.struct !26
  %23 = getelementptr inbounds i8, ptr %18, i64 24
  store ptr %18, ptr %23, align 8, !tbaa !28
  %24 = getelementptr inbounds i8, ptr %18, i64 32
  store ptr %18, ptr %24, align 8, !tbaa !29
  %25 = load i8, ptr %16, align 1, !tbaa !19, !range !30, !noundef !31
  %26 = trunc nuw i8 %25 to i1
  br i1 %26, label %30, label %27

27:                                               ; preds = %19
  tail call void @_ZN10ClipperLib7Clipper12SetHoleStateEPNS_5TEdgeEPNS_6OutRecE(ptr noundef nonnull align 8 dereferenceable(135) %0, ptr noundef nonnull %1, ptr noundef nonnull %12)
  %.pre = load i32, ptr %12, align 8, !tbaa !23
  br label %30

28:                                               ; preds = %11
  %29 = landingpad { ptr, i32 }
          cleanup
  br label %65

30:                                               ; preds = %27, %19
  %31 = phi i32 [ %.pre, %27 ], [ %21, %19 ]
  store i32 %31, ptr %4, align 4, !tbaa !5
  br label %64

32:                                               ; preds = %3
  %33 = getelementptr inbounds i8, ptr %10, i64 80
  %34 = zext nneg i32 %5 to i64
  %35 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN10ClipperLib6OutRecESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %33, i64 noundef %34) #8
  %36 = load ptr, ptr %35, align 8, !tbaa !32
  %37 = getelementptr inbounds i8, ptr %36, i64 24
  %38 = load ptr, ptr %37, align 8, !tbaa !22
  %39 = getelementptr inbounds i8, ptr %1, i64 60
  %40 = load i32, ptr %39, align 4, !tbaa !33
  %41 = icmp eq i32 %40, 1
  br i1 %41, label %42, label %.critedge

42:                                               ; preds = %32
  %43 = getelementptr inbounds i8, ptr %38, i64 8
  %44 = tail call noundef zeroext i1 @_ZN10ClipperLibeqERKNS_8IntPointES2_(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(16) %43)
  br i1 %44, label %64, label %51

.critedge:                                        ; preds = %32
  %45 = getelementptr inbounds i8, ptr %38, i64 32
  %46 = load ptr, ptr %45, align 8, !tbaa !29
  %47 = getelementptr inbounds i8, ptr %46, i64 8
  %48 = tail call noundef zeroext i1 @_ZN10ClipperLibeqERKNS_8IntPointES2_(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(16) %47)
  br i1 %48, label %49, label %51

49:                                               ; preds = %.critedge
  %50 = load ptr, ptr %45, align 8, !tbaa !29
  br label %64

51:                                               ; preds = %42, %.critedge
  %52 = tail call noalias noundef nonnull dereferenceable(40) ptr @_Znwm(i64 noundef 40) #7
  invoke void @_ZN10ClipperLib5OutPtC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %52)
          to label %53 unwind label %62

53:                                               ; preds = %51
  %54 = load i32, ptr %36, align 8, !tbaa !23
  store i32 %54, ptr %52, align 8, !tbaa !24
  %55 = getelementptr inbounds i8, ptr %52, i64 8
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %55, ptr noundef nonnull align 8 dereferenceable(16) %2, i64 16, i1 false), !tbaa.struct !26
  %56 = getelementptr inbounds i8, ptr %52, i64 24
  store ptr %38, ptr %56, align 8, !tbaa !28
  %57 = getelementptr inbounds i8, ptr %38, i64 32
  %58 = load ptr, ptr %57, align 8, !tbaa !29
  %59 = getelementptr inbounds i8, ptr %52, i64 32
  store ptr %58, ptr %59, align 8, !tbaa !29
  %60 = getelementptr inbounds i8, ptr %58, i64 24
  store ptr %52, ptr %60, align 8, !tbaa !28
  store ptr %52, ptr %57, align 8, !tbaa !29
  br i1 %41, label %61, label %64

61:                                               ; preds = %53
  store ptr %52, ptr %37, align 8, !tbaa !22
  br label %64

62:                                               ; preds = %51
  %63 = landingpad { ptr, i32 }
          cleanup
  br label %65

64:                                               ; preds = %49, %42, %61, %53, %30
  %.1 = phi ptr [ %18, %30 ], [ %50, %49 ], [ %38, %42 ], [ %52, %61 ], [ %52, %53 ]
  ret ptr %.1

65:                                               ; preds = %62, %28
  %.sink = phi ptr [ %52, %62 ], [ %18, %28 ]
  %.pn = phi { ptr, i32 } [ %63, %62 ], [ %29, %28 ]
  tail call void @_ZdlPvm(ptr noundef nonnull %.sink, i64 noundef 40) #9
  resume { ptr, i32 } %.pn
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN10ClipperLib5OutPtC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #6 align 2

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { nobuiltin allocsize(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 = { 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 #7 = { builtin allocsize(0) }
attributes #8 = { nounwind }
attributes #9 = { builtin 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, !14, i64 76}
!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 = !{!17, !17, i64 0}
!17 = !{!"vtable pointer", !10, i64 0}
!18 = !{!6, !14, i64 64}
!19 = !{!20, !21, i64 5}
!20 = !{!"_ZTSN10ClipperLib6OutRecE", !14, i64 0, !21, i64 4, !21, i64 5, !15, i64 8, !15, i64 16, !15, i64 24, !15, i64 32}
!21 = !{!"bool", !9, i64 0}
!22 = !{!20, !15, i64 24}
!23 = !{!20, !14, i64 0}
!24 = !{!25, !14, i64 0}
!25 = !{!"_ZTSN10ClipperLib5OutPtE", !14, i64 0, !7, i64 8, !15, i64 24, !15, i64 32}
!26 = !{i64 0, i64 8, !27, i64 8, i64 8, !27}
!27 = !{!8, !8, i64 0}
!28 = !{!25, !15, i64 24}
!29 = !{!25, !15, i64 32}
!30 = !{i8 0, i8 2}
!31 = !{}
!32 = !{!15, !15, i64 0}
!33 = !{!6, !13, i64 60}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass,TailCallElimPass