; 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 double @_ZN10ClipperLib4AreaEPKNS_5OutPtE(ptr noundef) #2

; 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)) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #4

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN10ClipperLib15FirstIsBottomPtEPKNS_5OutPtES2_(ptr noundef %0, ptr noundef %1) #5 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca double, align 8
  %8 = alloca %"struct.ClipperLib::IntPoint", align 8
  %9 = alloca %"struct.ClipperLib::IntPoint", align 8
  %10 = alloca double, align 8
  %11 = alloca %"struct.ClipperLib::IntPoint", align 8
  %12 = alloca %"struct.ClipperLib::IntPoint", align 8
  %13 = alloca double, align 8
  %14 = alloca %"struct.ClipperLib::IntPoint", align 8
  %15 = alloca %"struct.ClipperLib::IntPoint", align 8
  %16 = alloca double, align 8
  %17 = alloca %"struct.ClipperLib::IntPoint", align 8
  %18 = alloca %"struct.ClipperLib::IntPoint", align 8
  %19 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %20, i32 0, i32 3
  %22 = load ptr, ptr %21, align 8, !tbaa !9
  store ptr %22, ptr %6, align 8, !tbaa !5
  br label %23

23:                                               ; preds = %35, %2
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %24, i32 0, i32 1
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %26, i32 0, i32 1
  %28 = call noundef zeroext i1 @_ZN10ClipperLibeqERKNS_8IntPointES2_(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 8 dereferenceable(16) %27)
  br i1 %28, label %29, label %33

29:                                               ; preds = %23
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = icmp ne ptr %30, %31
  br label %33

33:                                               ; preds = %29, %23
  %34 = phi i1 [ false, %23 ], [ %32, %29 ]
  br i1 %34, label %35, label %39

35:                                               ; preds = %33
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %36, i32 0, i32 3
  %38 = load ptr, ptr %37, align 8, !tbaa !9
  store ptr %38, ptr %6, align 8, !tbaa !5
  br label %23, !llvm.loop !14

39:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %40, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %8, ptr align 8 %41, i64 16, i1 false), !tbaa.struct !16
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  %43 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %42, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %9, ptr align 8 %43, i64 16, i1 false), !tbaa.struct !16
  %44 = getelementptr inbounds { i64, i64 }, ptr %8, i32 0, i32 0
  %45 = load i64, ptr %44, align 8
  %46 = getelementptr inbounds { i64, i64 }, ptr %8, i32 0, i32 1
  %47 = load i64, ptr %46, align 8
  %48 = getelementptr inbounds { i64, i64 }, ptr %9, i32 0, i32 0
  %49 = load i64, ptr %48, align 8
  %50 = getelementptr inbounds { i64, i64 }, ptr %9, i32 0, i32 1
  %51 = load i64, ptr %50, align 8
  %52 = call noundef double @_ZN10ClipperLib5GetDxENS_8IntPointES0_(i64 %45, i64 %47, i64 %49, i64 %51)
  %53 = call double @llvm.fabs.f64(double %52)
  store double %53, ptr %7, align 8, !tbaa !18
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %54, i32 0, i32 2
  %56 = load ptr, ptr %55, align 8, !tbaa !20
  store ptr %56, ptr %6, align 8, !tbaa !5
  br label %57

57:                                               ; preds = %69, %39
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %58, i32 0, i32 1
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %60, i32 0, i32 1
  %62 = call noundef zeroext i1 @_ZN10ClipperLibeqERKNS_8IntPointES2_(ptr noundef nonnull align 8 dereferenceable(16) %59, ptr noundef nonnull align 8 dereferenceable(16) %61)
  br i1 %62, label %63, label %67

63:                                               ; preds = %57
  %64 = load ptr, ptr %6, align 8, !tbaa !5
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = icmp ne ptr %64, %65
  br label %67

67:                                               ; preds = %63, %57
  %68 = phi i1 [ false, %57 ], [ %66, %63 ]
  br i1 %68, label %69, label %73

69:                                               ; preds = %67
  %70 = load ptr, ptr %6, align 8, !tbaa !5
  %71 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %70, i32 0, i32 2
  %72 = load ptr, ptr %71, align 8, !tbaa !20
  store ptr %72, ptr %6, align 8, !tbaa !5
  br label %57, !llvm.loop !21

73:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  %75 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %74, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 %75, i64 16, i1 false), !tbaa.struct !16
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %76, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %77, i64 16, i1 false), !tbaa.struct !16
  %78 = getelementptr inbounds { i64, i64 }, ptr %11, i32 0, i32 0
  %79 = load i64, ptr %78, align 8
  %80 = getelementptr inbounds { i64, i64 }, ptr %11, i32 0, i32 1
  %81 = load i64, ptr %80, align 8
  %82 = getelementptr inbounds { i64, i64 }, ptr %12, i32 0, i32 0
  %83 = load i64, ptr %82, align 8
  %84 = getelementptr inbounds { i64, i64 }, ptr %12, i32 0, i32 1
  %85 = load i64, ptr %84, align 8
  %86 = call noundef double @_ZN10ClipperLib5GetDxENS_8IntPointES0_(i64 %79, i64 %81, i64 %83, i64 %85)
  %87 = call double @llvm.fabs.f64(double %86)
  store double %87, ptr %10, align 8, !tbaa !18
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %88, i32 0, i32 3
  %90 = load ptr, ptr %89, align 8, !tbaa !9
  store ptr %90, ptr %6, align 8, !tbaa !5
  br label %91

91:                                               ; preds = %103, %73
  %92 = load ptr, ptr %6, align 8, !tbaa !5
  %93 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %92, i32 0, i32 1
  %94 = load ptr, ptr %5, align 8, !tbaa !5
  %95 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %94, i32 0, i32 1
  %96 = call noundef zeroext i1 @_ZN10ClipperLibeqERKNS_8IntPointES2_(ptr noundef nonnull align 8 dereferenceable(16) %93, ptr noundef nonnull align 8 dereferenceable(16) %95)
  br i1 %96, label %97, label %101

97:                                               ; preds = %91
  %98 = load ptr, ptr %6, align 8, !tbaa !5
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = icmp ne ptr %98, %99
  br label %101

101:                                              ; preds = %97, %91
  %102 = phi i1 [ false, %91 ], [ %100, %97 ]
  br i1 %102, label %103, label %107

103:                                              ; preds = %101
  %104 = load ptr, ptr %6, align 8, !tbaa !5
  %105 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %104, i32 0, i32 3
  %106 = load ptr, ptr %105, align 8, !tbaa !9
  store ptr %106, ptr %6, align 8, !tbaa !5
  br label %91, !llvm.loop !22

107:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %108, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 8 %109, i64 16, i1 false), !tbaa.struct !16
  %110 = load ptr, ptr %6, align 8, !tbaa !5
  %111 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %110, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %111, i64 16, i1 false), !tbaa.struct !16
  %112 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 0
  %113 = load i64, ptr %112, align 8
  %114 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 1
  %115 = load i64, ptr %114, align 8
  %116 = getelementptr inbounds { i64, i64 }, ptr %15, i32 0, i32 0
  %117 = load i64, ptr %116, align 8
  %118 = getelementptr inbounds { i64, i64 }, ptr %15, i32 0, i32 1
  %119 = load i64, ptr %118, align 8
  %120 = call noundef double @_ZN10ClipperLib5GetDxENS_8IntPointES0_(i64 %113, i64 %115, i64 %117, i64 %119)
  %121 = call double @llvm.fabs.f64(double %120)
  store double %121, ptr %13, align 8, !tbaa !18
  %122 = load ptr, ptr %5, align 8, !tbaa !5
  %123 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %122, i32 0, i32 2
  %124 = load ptr, ptr %123, align 8, !tbaa !20
  store ptr %124, ptr %6, align 8, !tbaa !5
  br label %125

125:                                              ; preds = %137, %107
  %126 = load ptr, ptr %6, align 8, !tbaa !5
  %127 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %126, i32 0, i32 1
  %128 = load ptr, ptr %5, align 8, !tbaa !5
  %129 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %128, i32 0, i32 1
  %130 = call noundef zeroext i1 @_ZN10ClipperLibeqERKNS_8IntPointES2_(ptr noundef nonnull align 8 dereferenceable(16) %127, ptr noundef nonnull align 8 dereferenceable(16) %129)
  br i1 %130, label %131, label %135

131:                                              ; preds = %125
  %132 = load ptr, ptr %6, align 8, !tbaa !5
  %133 = load ptr, ptr %5, align 8, !tbaa !5
  %134 = icmp ne ptr %132, %133
  br label %135

135:                                              ; preds = %131, %125
  %136 = phi i1 [ false, %125 ], [ %134, %131 ]
  br i1 %136, label %137, label %141

137:                                              ; preds = %135
  %138 = load ptr, ptr %6, align 8, !tbaa !5
  %139 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %138, i32 0, i32 2
  %140 = load ptr, ptr %139, align 8, !tbaa !20
  store ptr %140, ptr %6, align 8, !tbaa !5
  br label %125, !llvm.loop !23

141:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %142 = load ptr, ptr %5, align 8, !tbaa !5
  %143 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %142, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %17, ptr align 8 %143, i64 16, i1 false), !tbaa.struct !16
  %144 = load ptr, ptr %6, align 8, !tbaa !5
  %145 = getelementptr inbounds %"struct.ClipperLib::OutPt", ptr %144, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 8 %145, i64 16, i1 false), !tbaa.struct !16
  %146 = getelementptr inbounds { i64, i64 }, ptr %17, i32 0, i32 0
  %147 = load i64, ptr %146, align 8
  %148 = getelementptr inbounds { i64, i64 }, ptr %17, i32 0, i32 1
  %149 = load i64, ptr %148, align 8
  %150 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 0
  %151 = load i64, ptr %150, align 8
  %152 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 1
  %153 = load i64, ptr %152, align 8
  %154 = call noundef double @_ZN10ClipperLib5GetDxENS_8IntPointES0_(i64 %147, i64 %149, i64 %151, i64 %153)
  %155 = call double @llvm.fabs.f64(double %154)
  store double %155, ptr %16, align 8, !tbaa !18
  %156 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %157 = load double, ptr %156, align 8, !tbaa !18
  %158 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %16)
  %159 = load double, ptr %158, align 8, !tbaa !18
  %160 = fcmp oeq double %157, %159
  br i1 %160, label %161, label %171

161:                                              ; preds = %141
  %162 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %163 = load double, ptr %162, align 8, !tbaa !18
  %164 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %16)
  %165 = load double, ptr %164, align 8, !tbaa !18
  %166 = fcmp oeq double %163, %165
  br i1 %166, label %167, label %171

167:                                              ; preds = %161
  %168 = load ptr, ptr %4, align 8, !tbaa !5
  %169 = call noundef double @_ZN10ClipperLib4AreaEPKNS_5OutPtE(ptr noundef %168)
  %170 = fcmp ogt double %169, 0.000000e+00
  store i1 %170, ptr %3, align 1
  store i32 1, ptr %19, align 4
  br label %191

171:                                              ; preds = %161, %141
  %172 = load double, ptr %7, align 8, !tbaa !18
  %173 = load double, ptr %13, align 8, !tbaa !18
  %174 = fcmp oge double %172, %173
  br i1 %174, label %175, label %179

175:                                              ; preds = %171
  %176 = load double, ptr %7, align 8, !tbaa !18
  %177 = load double, ptr %16, align 8, !tbaa !18
  %178 = fcmp oge double %176, %177
  br i1 %178, label %189, label %179

179:                                              ; preds = %175, %171
  %180 = load double, ptr %10, align 8, !tbaa !18
  %181 = load double, ptr %13, align 8, !tbaa !18
  %182 = fcmp oge double %180, %181
  br i1 %182, label %183, label %187

183:                                              ; preds = %179
  %184 = load double, ptr %10, align 8, !tbaa !18
  %185 = load double, ptr %16, align 8, !tbaa !18
  %186 = fcmp oge double %184, %185
  br label %187

187:                                              ; preds = %183, %179
  %188 = phi i1 [ false, %179 ], [ %186, %183 ]
  br label %189

189:                                              ; preds = %187, %175
  %190 = phi i1 [ true, %175 ], [ %188, %187 ]
  store i1 %190, ptr %3, align 1
  store i32 1, ptr %19, align 4
  br label %191

191:                                              ; preds = %189, %167
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %192 = load i1, ptr %3, align 1
  ret i1 %192
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZN10ClipperLib5GetDxENS_8IntPointES0_(i64, i64, i64, i64) #3

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 32}
!10 = !{!"_ZTSN10ClipperLib5OutPtE", !11, i64 0, !12, i64 8, !6, i64 24, !6, i64 32}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSN10ClipperLib8IntPointE", !13, i64 0, !13, i64 8}
!13 = !{!"long long", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{i64 0, i64 8, !17, i64 8, i64 8, !17}
!17 = !{!13, !13, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"double", !7, i64 0}
!20 = !{!10, !6, i64 24}
!21 = distinct !{!21, !15}
!22 = distinct !{!22, !15}
!23 = distinct !{!23, !15}


; 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN10ClipperLib4AreaEPKNS_5OutPtE(ptr noundef) local_unnamed_addr #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)) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #3

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_ZN10ClipperLib15FirstIsBottomPtEPKNS_5OutPtES2_(ptr noundef %0, ptr noundef %1) local_unnamed_addr #1 {
  %3 = alloca double, align 8
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = getelementptr inbounds i8, ptr %0, i64 8
  br label %8

8:                                                ; preds = %8, %2
  %.pn52 = phi ptr [ %0, %2 ], [ %.048, %8 ]
  %.048.in = getelementptr inbounds i8, ptr %.pn52, i64 32
  %.048 = load ptr, ptr %.048.in, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %.048, i64 8
  %10 = tail call noundef zeroext i1 @_ZN10ClipperLibeqERKNS_8IntPointES2_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %7)
  %11 = icmp ne ptr %.048, %0
  %12 = and i1 %10, %11
  br i1 %12, label %8, label %13, !llvm.loop !13

13:                                               ; preds = %8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %.sroa.013.0.copyload = load i64, ptr %7, align 8, !tbaa !15
  %.sroa.214.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 16
  %.sroa.214.0.copyload = load i64, ptr %.sroa.214.0..sroa_idx, align 8, !tbaa !15
  %.sroa.011.0.copyload = load i64, ptr %9, align 8, !tbaa !15
  %.sroa.212.0..sroa_idx = getelementptr inbounds i8, ptr %.048, i64 16
  %.sroa.212.0.copyload = load i64, ptr %.sroa.212.0..sroa_idx, align 8, !tbaa !15
  %14 = tail call noundef double @_ZN10ClipperLib5GetDxENS_8IntPointES0_(i64 %.sroa.013.0.copyload, i64 %.sroa.214.0.copyload, i64 %.sroa.011.0.copyload, i64 %.sroa.212.0.copyload)
  %15 = tail call double @llvm.fabs.f64(double %14)
  store double %15, ptr %3, align 8, !tbaa !16
  br label %16

16:                                               ; preds = %16, %13
  %.pn51 = phi ptr [ %0, %13 ], [ %.1, %16 ]
  %.1.in = getelementptr inbounds i8, ptr %.pn51, i64 24
  %.1 = load ptr, ptr %.1.in, align 8, !tbaa !18
  %17 = getelementptr inbounds i8, ptr %.1, i64 8
  %18 = tail call noundef zeroext i1 @_ZN10ClipperLibeqERKNS_8IntPointES2_(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(16) %7)
  %19 = icmp ne ptr %.1, %0
  %20 = and i1 %18, %19
  br i1 %20, label %16, label %21, !llvm.loop !19

21:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  %.sroa.09.0.copyload = load i64, ptr %7, align 8, !tbaa !15
  %.sroa.210.0.copyload = load i64, ptr %.sroa.214.0..sroa_idx, align 8, !tbaa !15
  %.sroa.07.0.copyload = load i64, ptr %17, align 8, !tbaa !15
  %.sroa.28.0..sroa_idx = getelementptr inbounds i8, ptr %.1, i64 16
  %.sroa.28.0.copyload = load i64, ptr %.sroa.28.0..sroa_idx, align 8, !tbaa !15
  %22 = tail call noundef double @_ZN10ClipperLib5GetDxENS_8IntPointES0_(i64 %.sroa.09.0.copyload, i64 %.sroa.210.0.copyload, i64 %.sroa.07.0.copyload, i64 %.sroa.28.0.copyload)
  %23 = tail call double @llvm.fabs.f64(double %22)
  store double %23, ptr %4, align 8, !tbaa !16
  %24 = getelementptr inbounds i8, ptr %1, i64 8
  br label %25

25:                                               ; preds = %25, %21
  %.pn50 = phi ptr [ %1, %21 ], [ %.2, %25 ]
  %.2.in = getelementptr inbounds i8, ptr %.pn50, i64 32
  %.2 = load ptr, ptr %.2.in, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %.2, i64 8
  %27 = tail call noundef zeroext i1 @_ZN10ClipperLibeqERKNS_8IntPointES2_(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 8 dereferenceable(16) %24)
  %28 = icmp ne ptr %.2, %1
  %29 = and i1 %27, %28
  br i1 %29, label %25, label %30, !llvm.loop !20

30:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  %.sroa.05.0.copyload = load i64, ptr %24, align 8, !tbaa !15
  %.sroa.26.0..sroa_idx = getelementptr inbounds i8, ptr %1, i64 16
  %.sroa.26.0.copyload = load i64, ptr %.sroa.26.0..sroa_idx, align 8, !tbaa !15
  %.sroa.03.0.copyload = load i64, ptr %26, align 8, !tbaa !15
  %.sroa.24.0..sroa_idx = getelementptr inbounds i8, ptr %.2, i64 16
  %.sroa.24.0.copyload = load i64, ptr %.sroa.24.0..sroa_idx, align 8, !tbaa !15
  %31 = tail call noundef double @_ZN10ClipperLib5GetDxENS_8IntPointES0_(i64 %.sroa.05.0.copyload, i64 %.sroa.26.0.copyload, i64 %.sroa.03.0.copyload, i64 %.sroa.24.0.copyload)
  %32 = tail call double @llvm.fabs.f64(double %31)
  store double %32, ptr %5, align 8, !tbaa !16
  br label %33

33:                                               ; preds = %33, %30
  %.pn = phi ptr [ %1, %30 ], [ %.3, %33 ]
  %.3.in = getelementptr inbounds i8, ptr %.pn, i64 24
  %.3 = load ptr, ptr %.3.in, align 8, !tbaa !18
  %34 = getelementptr inbounds i8, ptr %.3, i64 8
  %35 = tail call noundef zeroext i1 @_ZN10ClipperLibeqERKNS_8IntPointES2_(ptr noundef nonnull align 8 dereferenceable(16) %34, ptr noundef nonnull align 8 dereferenceable(16) %24)
  %36 = icmp ne ptr %.3, %1
  %37 = and i1 %35, %36
  br i1 %37, label %33, label %38, !llvm.loop !21

38:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %.sroa.01.0.copyload = load i64, ptr %24, align 8, !tbaa !15
  %.sroa.22.0.copyload = load i64, ptr %.sroa.26.0..sroa_idx, align 8, !tbaa !15
  %.sroa.0.0.copyload = load i64, ptr %34, align 8, !tbaa !15
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %.3, i64 16
  %.sroa.2.0.copyload = load i64, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !15
  %39 = tail call noundef double @_ZN10ClipperLib5GetDxENS_8IntPointES0_(i64 %.sroa.01.0.copyload, i64 %.sroa.22.0.copyload, i64 %.sroa.0.0.copyload, i64 %.sroa.2.0.copyload)
  %40 = tail call double @llvm.fabs.f64(double %39)
  store double %40, ptr %6, align 8, !tbaa !16
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %42 = load double, ptr %41, align 8, !tbaa !16
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %44 = load double, ptr %43, align 8, !tbaa !16
  %45 = fcmp oeq double %42, %44
  br i1 %45, label %46, label %55

46:                                               ; preds = %38
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %48 = load double, ptr %47, align 8, !tbaa !16
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %50 = load double, ptr %49, align 8, !tbaa !16
  %51 = fcmp oeq double %48, %50
  br i1 %51, label %52, label %55

52:                                               ; preds = %46
  %53 = call noundef double @_ZN10ClipperLib4AreaEPKNS_5OutPtE(ptr noundef %0)
  %54 = fcmp ogt double %53, 0.000000e+00
  br label %66

55:                                               ; preds = %46, %38
  %56 = load double, ptr %3, align 8, !tbaa !16
  %57 = load double, ptr %5, align 8, !tbaa !16
  %58 = fcmp ult double %56, %57
  %59 = load double, ptr %6, align 8
  %60 = fcmp ult double %56, %59
  %or.cond = select i1 %58, i1 true, i1 %60
  br i1 %or.cond, label %61, label %66

61:                                               ; preds = %55
  %62 = load double, ptr %4, align 8
  %63 = fcmp oge double %62, %57
  %64 = fcmp oge double %62, %59
  %65 = select i1 %63, i1 %64, i1 false
  br label %66

66:                                               ; preds = %61, %55, %52
  %.0 = phi i1 [ %54, %52 ], [ %65, %61 ], [ true, %55 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  ret i1 %.0
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZN10ClipperLib5GetDxENS_8IntPointES0_(i64, i64, i64, i64) local_unnamed_addr #2

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !12, i64 32}
!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 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!11, !11, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"double", !8, i64 0}
!18 = !{!6, !12, i64 24}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LICMPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass