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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #3

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #5

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN10ClipperLib8IntPointESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN10ClipperLib19SlopesNearCollinearERKNS_8IntPointES2_S2_d(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16), double noundef) #7

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN10ClipperLib14PointsAreCloseENS_8IntPointES0_d(i64, i64, i64, i64, double noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN10ClipperLib9ExcludeOpEPNS_5OutPtE(ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10ClipperLib12CleanPolygonERKSt6vectorINS_8IntPointESaIS1_EERS3_d(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, double noundef %2) #7 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca double, align 8
  %14 = alloca ptr, 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 %"struct.ClipperLib::IntPoint", align 8
  %19 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store double %2, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = call noundef i64 @_ZNKSt6vectorIN10ClipperLib8IntPointESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %20) #8
  store i64 %21, ptr %7, align 8, !tbaa !11
  %22 = load i64, ptr %7, align 8, !tbaa !11
  %23 = icmp eq i64 %22, 0
  br i1 %23, label %24, label %26

24:                                               ; preds = %3
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZNSt6vectorIN10ClipperLib8IntPointESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #8
  store i32 1, ptr %8, align 4
  br label %212

26:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %27 = load i64, ptr %7, align 8, !tbaa !11
  %28 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %27, i64 40)
  %29 = extractvalue { i64, i1 } %28, 1
  %30 = extractvalue { i64, i1 } %28, 0
  %31 = select i1 %29, i64 -1, i64 %30
  %32 = call noalias noundef nonnull ptr @_Znam(i64 noundef %31) #9
  %33 = icmp eq i64 %27, 0
  br i1 %33, label %41, label %34

34:                                               ; preds = %26
  %35 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %32, i64 %27
  br label %36

36:                                               ; preds = %38, %34
  %37 = phi ptr [ %32, %34 ], [ %39, %38 ]
  invoke void @_ZN10ClipperLib5OutPtC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %37)
          to label %38 unwind label %47

38:                                               ; preds = %36
  %39 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %37, i64 1
  %40 = icmp eq ptr %39, %35
  br i1 %40, label %41, label %36

41:                                               ; preds = %38, %26
  store ptr %32, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  store i64 0, ptr %12, align 8, !tbaa !11
  br label %42

42:                                               ; preds = %82, %41
  %43 = load i64, ptr %12, align 8, !tbaa !11
  %44 = load i64, ptr %7, align 8, !tbaa !11
  %45 = icmp ult i64 %43, %44
  br i1 %45, label %51, label %46

46:                                               ; preds = %42
  store i32 2, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br label %85

47:                                               ; preds = %36
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %10, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %11, align 4
  call void @_ZdaPvm(ptr noundef %32, i64 noundef %31) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  br label %215

51:                                               ; preds = %42
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = load i64, ptr %12, align 8, !tbaa !11
  %54 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorIN10ClipperLib8IntPointESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %52, i64 noundef %53) #8
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  %56 = load i64, ptr %12, align 8, !tbaa !11
  %57 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %55, i64 %56
  %58 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %57, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %58, ptr align 8 %54, i64 16, i1 false), !tbaa.struct !13
  %59 = load ptr, ptr %9, align 8, !tbaa !5
  %60 = load i64, ptr %12, align 8, !tbaa !11
  %61 = add i64 %60, 1
  %62 = load i64, ptr %7, align 8, !tbaa !11
  %63 = urem i64 %61, %62
  %64 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %59, i64 %63
  %65 = load ptr, ptr %9, align 8, !tbaa !5
  %66 = load i64, ptr %12, align 8, !tbaa !11
  %67 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %65, i64 %66
  %68 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %67, i32 0, i32 2
  store ptr %64, ptr %68, align 8, !tbaa !16
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  %70 = load i64, ptr %12, align 8, !tbaa !11
  %71 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %69, i64 %70
  %72 = load ptr, ptr %9, align 8, !tbaa !5
  %73 = load i64, ptr %12, align 8, !tbaa !11
  %74 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %72, i64 %73
  %75 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %74, i32 0, i32 2
  %76 = load ptr, ptr %75, align 8, !tbaa !16
  %77 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %76, i32 0, i32 3
  store ptr %71, ptr %77, align 8, !tbaa !20
  %78 = load ptr, ptr %9, align 8, !tbaa !5
  %79 = load i64, ptr %12, align 8, !tbaa !11
  %80 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %78, i64 %79
  %81 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %80, i32 0, i32 0
  store i32 0, ptr %81, align 8, !tbaa !21
  br label %82

82:                                               ; preds = %51
  %83 = load i64, ptr %12, align 8, !tbaa !11
  %84 = add i64 %83, 1
  store i64 %84, ptr %12, align 8, !tbaa !11
  br label %42, !llvm.loop !22

85:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %86 = load double, ptr %6, align 8, !tbaa !9
  %87 = load double, ptr %6, align 8, !tbaa !9
  %88 = fmul double %86, %87
  store double %88, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %89 = load ptr, ptr %9, align 8, !tbaa !5
  %90 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %89, i64 0
  store ptr %90, ptr %14, align 8, !tbaa !5
  br label %91

91:                                               ; preds = %182, %85
  %92 = load ptr, ptr %14, align 8, !tbaa !5
  %93 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %92, i32 0, i32 0
  %94 = load i32, ptr %93, align 8, !tbaa !21
  %95 = icmp eq i32 %94, 0
  br i1 %95, label %96, label %104

96:                                               ; preds = %91
  %97 = load ptr, ptr %14, align 8, !tbaa !5
  %98 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %97, i32 0, i32 2
  %99 = load ptr, ptr %98, align 8, !tbaa !16
  %100 = load ptr, ptr %14, align 8, !tbaa !5
  %101 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %100, i32 0, i32 3
  %102 = load ptr, ptr %101, align 8, !tbaa !20
  %103 = icmp ne ptr %99, %102
  br label %104

104:                                              ; preds = %96, %91
  %105 = phi i1 [ false, %91 ], [ %103, %96 ]
  br i1 %105, label %106, label %183

106:                                              ; preds = %104
  %107 = load ptr, ptr %14, align 8, !tbaa !5
  %108 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %107, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %108, i64 16, i1 false), !tbaa.struct !13
  %109 = load ptr, ptr %14, align 8, !tbaa !5
  %110 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %109, i32 0, i32 3
  %111 = load ptr, ptr %110, align 8, !tbaa !20
  %112 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %111, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 %112, i64 16, i1 false), !tbaa.struct !13
  %113 = load double, ptr %13, align 8, !tbaa !9
  %114 = getelementptr inbounds { i64, i64 }, ptr %15, i32 0, i32 0
  %115 = load i64, ptr %114, align 8
  %116 = getelementptr inbounds { i64, i64 }, ptr %15, i32 0, i32 1
  %117 = load i64, ptr %116, align 8
  %118 = getelementptr inbounds { i64, i64 }, ptr %16, i32 0, i32 0
  %119 = load i64, ptr %118, align 8
  %120 = getelementptr inbounds { i64, i64 }, ptr %16, i32 0, i32 1
  %121 = load i64, ptr %120, align 8
  %122 = call noundef zeroext i1 @_ZN10ClipperLib14PointsAreCloseENS_8IntPointES0_d(i64 %115, i64 %117, i64 %119, i64 %121, double noundef %113)
  br i1 %122, label %123, label %128

123:                                              ; preds = %106
  %124 = load ptr, ptr %14, align 8, !tbaa !5
  %125 = call noundef ptr @_ZN10ClipperLib9ExcludeOpEPNS_5OutPtE(ptr noundef %124)
  store ptr %125, ptr %14, align 8, !tbaa !5
  %126 = load i64, ptr %7, align 8, !tbaa !11
  %127 = add i64 %126, -1
  store i64 %127, ptr %7, align 8, !tbaa !11
  br label %182

128:                                              ; preds = %106
  %129 = load ptr, ptr %14, align 8, !tbaa !5
  %130 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %129, i32 0, i32 3
  %131 = load ptr, ptr %130, align 8, !tbaa !20
  %132 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %131, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %17, ptr align 8 %132, i64 16, i1 false), !tbaa.struct !13
  %133 = load ptr, ptr %14, align 8, !tbaa !5
  %134 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %133, i32 0, i32 2
  %135 = load ptr, ptr %134, align 8, !tbaa !16
  %136 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %135, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 8 %136, i64 16, i1 false), !tbaa.struct !13
  %137 = load double, ptr %13, align 8, !tbaa !9
  %138 = getelementptr inbounds { i64, i64 }, ptr %17, i32 0, i32 0
  %139 = load i64, ptr %138, align 8
  %140 = getelementptr inbounds { i64, i64 }, ptr %17, i32 0, i32 1
  %141 = load i64, ptr %140, align 8
  %142 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 0
  %143 = load i64, ptr %142, align 8
  %144 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 1
  %145 = load i64, ptr %144, align 8
  %146 = call noundef zeroext i1 @_ZN10ClipperLib14PointsAreCloseENS_8IntPointES0_d(i64 %139, i64 %141, i64 %143, i64 %145, double noundef %137)
  br i1 %146, label %147, label %156

147:                                              ; preds = %128
  %148 = load ptr, ptr %14, align 8, !tbaa !5
  %149 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %148, i32 0, i32 2
  %150 = load ptr, ptr %149, align 8, !tbaa !16
  %151 = call noundef ptr @_ZN10ClipperLib9ExcludeOpEPNS_5OutPtE(ptr noundef %150)
  %152 = load ptr, ptr %14, align 8, !tbaa !5
  %153 = call noundef ptr @_ZN10ClipperLib9ExcludeOpEPNS_5OutPtE(ptr noundef %152)
  store ptr %153, ptr %14, align 8, !tbaa !5
  %154 = load i64, ptr %7, align 8, !tbaa !11
  %155 = sub i64 %154, 2
  store i64 %155, ptr %7, align 8, !tbaa !11
  br label %181

156:                                              ; preds = %128
  %157 = load ptr, ptr %14, align 8, !tbaa !5
  %158 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %157, i32 0, i32 3
  %159 = load ptr, ptr %158, align 8, !tbaa !20
  %160 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %159, i32 0, i32 1
  %161 = load ptr, ptr %14, align 8, !tbaa !5
  %162 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %161, i32 0, i32 1
  %163 = load ptr, ptr %14, align 8, !tbaa !5
  %164 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %163, i32 0, i32 2
  %165 = load ptr, ptr %164, align 8, !tbaa !16
  %166 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %165, i32 0, i32 1
  %167 = load double, ptr %13, align 8, !tbaa !9
  %168 = call noundef zeroext i1 @_ZN10ClipperLib19SlopesNearCollinearERKNS_8IntPointES2_S2_d(ptr noundef nonnull align 8 dereferenceable(16) %160, ptr noundef nonnull align 8 dereferenceable(16) %162, ptr noundef nonnull align 8 dereferenceable(16) %166, double noundef %167)
  br i1 %168, label %169, label %174

169:                                              ; preds = %156
  %170 = load ptr, ptr %14, align 8, !tbaa !5
  %171 = call noundef ptr @_ZN10ClipperLib9ExcludeOpEPNS_5OutPtE(ptr noundef %170)
  store ptr %171, ptr %14, align 8, !tbaa !5
  %172 = load i64, ptr %7, align 8, !tbaa !11
  %173 = add i64 %172, -1
  store i64 %173, ptr %7, align 8, !tbaa !11
  br label %180

174:                                              ; preds = %156
  %175 = load ptr, ptr %14, align 8, !tbaa !5
  %176 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %175, i32 0, i32 0
  store i32 1, ptr %176, align 8, !tbaa !21
  %177 = load ptr, ptr %14, align 8, !tbaa !5
  %178 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %177, i32 0, i32 2
  %179 = load ptr, ptr %178, align 8, !tbaa !16
  store ptr %179, ptr %14, align 8, !tbaa !5
  br label %180

180:                                              ; preds = %174, %169
  br label %181

181:                                              ; preds = %180, %147
  br label %182

182:                                              ; preds = %181, %123
  br label %91, !llvm.loop !24

183:                                              ; preds = %104
  %184 = load i64, ptr %7, align 8, !tbaa !11
  %185 = icmp ult i64 %184, 3
  br i1 %185, label %186, label %187

186:                                              ; preds = %183
  store i64 0, ptr %7, align 8, !tbaa !11
  br label %187

187:                                              ; preds = %186, %183
  %188 = load ptr, ptr %5, align 8, !tbaa !5
  %189 = load i64, ptr %7, align 8, !tbaa !11
  call void @_ZNSt6vectorIN10ClipperLib8IntPointESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %188, i64 noundef %189)
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  store i64 0, ptr %19, align 8, !tbaa !11
  br label %190

190:                                              ; preds = %204, %187
  %191 = load i64, ptr %19, align 8, !tbaa !11
  %192 = load i64, ptr %7, align 8, !tbaa !11
  %193 = icmp ult i64 %191, %192
  br i1 %193, label %195, label %194

194:                                              ; preds = %190
  store i32 7, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %207

195:                                              ; preds = %190
  %196 = load ptr, ptr %14, align 8, !tbaa !5
  %197 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %196, i32 0, i32 1
  %198 = load ptr, ptr %5, align 8, !tbaa !5
  %199 = load i64, ptr %19, align 8, !tbaa !11
  %200 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorIN10ClipperLib8IntPointESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %198, i64 noundef %199) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %200, ptr align 8 %197, i64 16, i1 false), !tbaa.struct !13
  %201 = load ptr, ptr %14, align 8, !tbaa !5
  %202 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %201, i32 0, i32 2
  %203 = load ptr, ptr %202, align 8, !tbaa !16
  store ptr %203, ptr %14, align 8, !tbaa !5
  br label %204

204:                                              ; preds = %195
  %205 = load i64, ptr %19, align 8, !tbaa !11
  %206 = add i64 %205, 1
  store i64 %206, ptr %19, align 8, !tbaa !11
  br label %190, !llvm.loop !25

207:                                              ; preds = %194
  %208 = load ptr, ptr %9, align 8, !tbaa !5
  %209 = icmp eq ptr %208, null
  br i1 %209, label %211, label %210

210:                                              ; preds = %207
  call void @_ZdaPv(ptr noundef %208) #10
  br label %211

211:                                              ; preds = %210, %207
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  store i32 0, ptr %8, align 4
  br label %212

212:                                              ; preds = %211, %24
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  %213 = load i32, ptr %8, align 4
  switch i32 %213, label %220 [
    i32 0, label %214
    i32 1, label %214
  ]

214:                                              ; preds = %212, %212
  ret void

215:                                              ; preds = %47
  %216 = load ptr, ptr %10, align 8
  %217 = load i32, ptr %11, align 4
  %218 = insertvalue { ptr, i32 } poison, ptr %216, 0
  %219 = insertvalue { ptr, i32 } %218, i32 %217, 1
  resume { ptr, i32 } %219

220:                                              ; preds = %212
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN10ClipperLib8IntPointESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #7 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 #5 = { 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 #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 = { 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, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{i64 0, i64 8, !14, i64 8, i64 8, !14}
!14 = !{!15, !15, i64 0}
!15 = !{!"long long", !7, i64 0}
!16 = !{!17, !6, i64 24}
!17 = !{!"_ZTSN10ClipperLib5OutPtE", !18, i64 0, !19, i64 8, !6, i64 24, !6, i64 32}
!18 = !{!"int", !7, i64 0}
!19 = !{!"_ZTSN10ClipperLib8IntPointE", !15, i64 0, !15, i64 8}
!20 = !{!17, !6, i64 32}
!21 = !{!17, !18, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}
!25 = distinct !{!25, !23}


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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #2

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #4

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN10ClipperLib8IntPointESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN10ClipperLib19SlopesNearCollinearERKNS_8IntPointES2_S2_d(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16), double noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN10ClipperLib14PointsAreCloseENS_8IntPointES0_d(i64, i64, i64, i64, double noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10ClipperLib12CleanPolygonERKSt6vectorINS_8IntPointESaIS1_EERS3_d(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, double noundef %2) local_unnamed_addr #6 personality ptr @__gxx_personality_v0 {
  %4 = tail call noundef i64 @_ZNKSt6vectorIN10ClipperLib8IntPointESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  %5 = icmp eq i64 %4, 0
  br i1 %5, label %6, label %7

6:                                                ; preds = %3
  tail call void @_ZNSt6vectorIN10ClipperLib8IntPointESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  br label %76

7:                                                ; preds = %3
  %8 = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %4, i64 40)
  %9 = extractvalue { i64, i1 } %8, 1
  %10 = extractvalue { i64, i1 } %8, 0
  %11 = select i1 %9, i64 -1, i64 %10
  %12 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %11) #8
  %13 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %12, i64 %4
  br label %14

14:                                               ; preds = %16, %7
  %15 = phi ptr [ %12, %7 ], [ %17, %16 ]
  invoke void @_ZN10ClipperLib5OutPtC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %15)
          to label %16 unwind label %23

16:                                               ; preds = %14
  %17 = getelementptr inbounds i8, ptr %15, i64 40
  %18 = icmp eq ptr %17, %13
  br i1 %18, label %.preheader, label %14

19:                                               ; preds = %.preheader
  %20 = fmul double %2, %2
  %21 = load i32, ptr %12, align 8, !tbaa !5
  %22 = icmp eq i32 %21, 0
  br i1 %22, label %.lr.ph, label %.critedge

23:                                               ; preds = %14
  %24 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdaPvm(ptr noundef nonnull %12, i64 noundef %11) #9
  resume { ptr, i32 } %24

.preheader:                                       ; preds = %16, %.preheader
  %.06672 = phi i64 [ %28, %.preheader ], [ 0, %16 ]
  %25 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorIN10ClipperLib8IntPointESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %.06672) #7
  %26 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %12, i64 %.06672
  %27 = getelementptr inbounds i8, ptr %26, i64 8
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 8 dereferenceable(16) %25, i64 16, i1 false), !tbaa.struct !13
  %28 = add nuw i64 %.06672, 1
  %29 = icmp eq i64 %28, %4
  %30 = select i1 %29, i64 0, i64 %28
  %31 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %12, i64 %30
  %32 = getelementptr inbounds i8, ptr %26, i64 24
  store ptr %31, ptr %32, align 8, !tbaa !15
  %33 = getelementptr inbounds i8, ptr %31, i64 32
  store ptr %26, ptr %33, align 8, !tbaa !16
  store i32 0, ptr %26, align 8, !tbaa !5
  %exitcond.not = icmp eq i64 %28, %4
  br i1 %exitcond.not, label %19, label %.preheader, !llvm.loop !17

.lr.ph:                                           ; preds = %19, %67
  %.06574 = phi i64 [ %.1, %67 ], [ %4, %19 ]
  %.06773 = phi ptr [ %.168, %67 ], [ %12, %19 ]
  %34 = getelementptr inbounds i8, ptr %.06773, i64 24
  %35 = load ptr, ptr %34, align 8, !tbaa !15
  %36 = getelementptr inbounds i8, ptr %.06773, i64 32
  %37 = load ptr, ptr %36, align 8, !tbaa !16
  %.not = icmp eq ptr %35, %37
  br i1 %.not, label %.critedge, label %38

38:                                               ; preds = %.lr.ph
  %39 = getelementptr inbounds i8, ptr %.06773, i64 8
  %.sroa.07.0.copyload = load i64, ptr %39, align 8, !tbaa !14
  %.sroa.28.0..sroa_idx = getelementptr inbounds i8, ptr %.06773, i64 16
  %.sroa.28.0.copyload = load i64, ptr %.sroa.28.0..sroa_idx, align 8, !tbaa !14
  %40 = getelementptr inbounds i8, ptr %37, i64 8
  %.sroa.05.0.copyload = load i64, ptr %40, align 8, !tbaa !14
  %.sroa.26.0..sroa_idx = getelementptr inbounds i8, ptr %37, i64 16
  %.sroa.26.0.copyload = load i64, ptr %.sroa.26.0..sroa_idx, align 8, !tbaa !14
  %41 = tail call noundef zeroext i1 @_ZN10ClipperLib14PointsAreCloseENS_8IntPointES0_d(i64 %.sroa.07.0.copyload, i64 %.sroa.28.0.copyload, i64 %.sroa.05.0.copyload, i64 %.sroa.26.0.copyload, double noundef %20)
  br i1 %41, label %42, label %45

42:                                               ; preds = %38
  %43 = tail call noundef ptr @_ZN10ClipperLib9ExcludeOpEPNS_5OutPtE(ptr noundef nonnull %.06773)
  %44 = add i64 %.06574, -1
  br label %67

45:                                               ; preds = %38
  %46 = load ptr, ptr %36, align 8, !tbaa !16
  %47 = getelementptr inbounds i8, ptr %46, i64 8
  %.sroa.03.0.copyload = load i64, ptr %47, align 8, !tbaa !14
  %.sroa.24.0..sroa_idx = getelementptr inbounds i8, ptr %46, i64 16
  %.sroa.24.0.copyload = load i64, ptr %.sroa.24.0..sroa_idx, align 8, !tbaa !14
  %48 = load ptr, ptr %34, align 8, !tbaa !15
  %49 = getelementptr inbounds i8, ptr %48, i64 8
  %.sroa.0.0.copyload = load i64, ptr %49, align 8, !tbaa !14
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %48, i64 16
  %.sroa.2.0.copyload = load i64, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !14
  %50 = tail call noundef zeroext i1 @_ZN10ClipperLib14PointsAreCloseENS_8IntPointES0_d(i64 %.sroa.03.0.copyload, i64 %.sroa.24.0.copyload, i64 %.sroa.0.0.copyload, i64 %.sroa.2.0.copyload, double noundef %20)
  br i1 %50, label %51, label %56

51:                                               ; preds = %45
  %52 = load ptr, ptr %34, align 8, !tbaa !15
  %53 = tail call noundef ptr @_ZN10ClipperLib9ExcludeOpEPNS_5OutPtE(ptr noundef %52)
  %54 = tail call noundef ptr @_ZN10ClipperLib9ExcludeOpEPNS_5OutPtE(ptr noundef nonnull %.06773)
  %55 = add i64 %.06574, -2
  br label %67

56:                                               ; preds = %45
  %57 = load ptr, ptr %36, align 8, !tbaa !16
  %58 = getelementptr inbounds i8, ptr %57, i64 8
  %59 = load ptr, ptr %34, align 8, !tbaa !15
  %60 = getelementptr inbounds i8, ptr %59, i64 8
  %61 = tail call noundef zeroext i1 @_ZN10ClipperLib19SlopesNearCollinearERKNS_8IntPointES2_S2_d(ptr noundef nonnull align 8 dereferenceable(16) %58, ptr noundef nonnull align 8 dereferenceable(16) %39, ptr noundef nonnull align 8 dereferenceable(16) %60, double noundef %20)
  br i1 %61, label %62, label %65

62:                                               ; preds = %56
  %63 = tail call noundef ptr @_ZN10ClipperLib9ExcludeOpEPNS_5OutPtE(ptr noundef nonnull %.06773)
  %64 = add i64 %.06574, -1
  br label %67

65:                                               ; preds = %56
  store i32 1, ptr %.06773, align 8, !tbaa !5
  %66 = load ptr, ptr %34, align 8, !tbaa !15
  br label %67

67:                                               ; preds = %51, %65, %62, %42
  %.168 = phi ptr [ %43, %42 ], [ %54, %51 ], [ %63, %62 ], [ %66, %65 ]
  %.1 = phi i64 [ %44, %42 ], [ %55, %51 ], [ %64, %62 ], [ %.06574, %65 ]
  %68 = load i32, ptr %.168, align 8, !tbaa !5
  %69 = icmp eq i32 %68, 0
  br i1 %69, label %.lr.ph, label %.critedge, !llvm.loop !19

.critedge:                                        ; preds = %.lr.ph, %67, %19
  %.067.lcssa = phi ptr [ %12, %19 ], [ %.168, %67 ], [ %.06773, %.lr.ph ]
  %.065.lcssa = phi i64 [ %4, %19 ], [ %.1, %67 ], [ %.06574, %.lr.ph ]
  %70 = icmp ult i64 %.065.lcssa, 3
  %spec.store.select = select i1 %70, i64 0, i64 %.065.lcssa
  tail call void @_ZNSt6vectorIN10ClipperLib8IntPointESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %spec.store.select)
  br i1 %70, label %._crit_edge, label %.lr.ph81

.lr.ph81:                                         ; preds = %.critedge, %.lr.ph81
  %.080 = phi i64 [ %75, %.lr.ph81 ], [ 0, %.critedge ]
  %.279 = phi ptr [ %74, %.lr.ph81 ], [ %.067.lcssa, %.critedge ]
  %71 = getelementptr inbounds i8, ptr %.279, i64 8
  %72 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorIN10ClipperLib8IntPointESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %.080) #7
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %72, ptr noundef nonnull align 8 dereferenceable(16) %71, i64 16, i1 false), !tbaa.struct !13
  %73 = getelementptr inbounds i8, ptr %.279, i64 24
  %74 = load ptr, ptr %73, align 8, !tbaa !15
  %75 = add nuw i64 %.080, 1
  %exitcond83.not = icmp eq i64 %75, %.065.lcssa
  br i1 %exitcond83.not, label %._crit_edge, label %.lr.ph81, !llvm.loop !20

._crit_edge:                                      ; preds = %.lr.ph81, %.critedge
  tail call void @_ZdaPv(ptr noundef nonnull %12) #9
  br label %76

76:                                               ; preds = %._crit_edge, %6
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN10ClipperLib8IntPointESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #6 align 2

attributes #0 = { mustprogress nocallback nofree 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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #4 = { 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 #5 = { 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 #6 = { 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 = { nounwind }
attributes #8 = { builtin allocsize(0) }
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, !7, i64 0}
!6 = !{!"_ZTSN10ClipperLib5OutPtE", !7, i64 0, !10, i64 8, !12, i64 24, !12, i64 32}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN10ClipperLib8IntPointE", !11, i64 0, !11, i64 8}
!11 = !{!"long long", !8, i64 0}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{i64 0, i64 8, !14, i64 8, i64 8, !14}
!14 = !{!11, !11, i64 0}
!15 = !{!6, !12, i64 24}
!16 = !{!6, !12, i64 32}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass