; 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 }

; 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

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

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

18:                                               ; preds = %2
  store i32 0, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %239

19:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #4
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorIN10ClipperLib8IntPointESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef 0) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %9, ptr align 8 %21, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  store i64 1, ptr %10, align 8, !tbaa !11
  br label %22

22:                                               ; preds = %231, %19
  %23 = load i64, ptr %10, align 8, !tbaa !11
  %24 = load i64, ptr %7, align 8, !tbaa !11
  %25 = icmp ule i64 %23, %24
  br i1 %25, label %27, label %26

26:                                               ; preds = %22
  store i32 2, ptr %8, align 4
  br label %234

27:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #4
  %28 = load i64, ptr %10, align 8, !tbaa !11
  %29 = load i64, ptr %7, align 8, !tbaa !11
  %30 = icmp eq i64 %28, %29
  br i1 %30, label %31, label %34

31:                                               ; preds = %27
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorIN10ClipperLib8IntPointESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %32, i64 noundef 0) #4
  br label %38

34:                                               ; preds = %27
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = load i64, ptr %10, align 8, !tbaa !11
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorIN10ClipperLib8IntPointESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %35, i64 noundef %36) #4
  br label %38

38:                                               ; preds = %34, %31
  %39 = phi ptr [ %33, %31 ], [ %37, %34 ]
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 %39, i64 16, i1 false), !tbaa.struct !13
  %40 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %11, i32 0, i32 1
  %41 = load i64, ptr %40, align 8, !tbaa !16
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %42, i32 0, i32 1
  %44 = load i64, ptr %43, align 8, !tbaa !16
  %45 = icmp eq i64 %41, %44
  br i1 %45, label %46, label %78

46:                                               ; preds = %38
  %47 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %11, i32 0, i32 0
  %48 = load i64, ptr %47, align 8, !tbaa !18
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %49, i32 0, i32 0
  %51 = load i64, ptr %50, align 8, !tbaa !18
  %52 = icmp eq i64 %48, %51
  br i1 %52, label %76, label %53

53:                                               ; preds = %46
  %54 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %9, i32 0, i32 1
  %55 = load i64, ptr %54, align 8, !tbaa !16
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %56, i32 0, i32 1
  %58 = load i64, ptr %57, align 8, !tbaa !16
  %59 = icmp eq i64 %55, %58
  br i1 %59, label %60, label %77

60:                                               ; preds = %53
  %61 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %11, i32 0, i32 0
  %62 = load i64, ptr %61, align 8, !tbaa !18
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %63, i32 0, i32 0
  %65 = load i64, ptr %64, align 8, !tbaa !18
  %66 = icmp sgt i64 %62, %65
  %67 = zext i1 %66 to i32
  %68 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %9, i32 0, i32 0
  %69 = load i64, ptr %68, align 8, !tbaa !18
  %70 = load ptr, ptr %4, align 8, !tbaa !5
  %71 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %70, i32 0, i32 0
  %72 = load i64, ptr %71, align 8, !tbaa !18
  %73 = icmp slt i64 %69, %72
  %74 = zext i1 %73 to i32
  %75 = icmp eq i32 %67, %74
  br i1 %75, label %76, label %77

76:                                               ; preds = %60, %46
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %228

77:                                               ; preds = %60, %53
  br label %78

78:                                               ; preds = %77, %38
  %79 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %9, i32 0, i32 1
  %80 = load i64, ptr %79, align 8, !tbaa !16
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %81, i32 0, i32 1
  %83 = load i64, ptr %82, align 8, !tbaa !16
  %84 = icmp slt i64 %80, %83
  %85 = zext i1 %84 to i32
  %86 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %11, i32 0, i32 1
  %87 = load i64, ptr %86, align 8, !tbaa !16
  %88 = load ptr, ptr %4, align 8, !tbaa !5
  %89 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %88, i32 0, i32 1
  %90 = load i64, ptr %89, align 8, !tbaa !16
  %91 = icmp slt i64 %87, %90
  %92 = zext i1 %91 to i32
  %93 = icmp ne i32 %85, %92
  br i1 %93, label %94, label %227

94:                                               ; preds = %78
  %95 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %9, i32 0, i32 0
  %96 = load i64, ptr %95, align 8, !tbaa !18
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  %98 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %97, i32 0, i32 0
  %99 = load i64, ptr %98, align 8, !tbaa !18
  %100 = icmp sge i64 %96, %99
  br i1 %100, label %101, label %165

101:                                              ; preds = %94
  %102 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %11, i32 0, i32 0
  %103 = load i64, ptr %102, align 8, !tbaa !18
  %104 = load ptr, ptr %4, align 8, !tbaa !5
  %105 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %104, i32 0, i32 0
  %106 = load i64, ptr %105, align 8, !tbaa !18
  %107 = icmp sgt i64 %103, %106
  br i1 %107, label %108, label %111

108:                                              ; preds = %101
  %109 = load i32, ptr %6, align 4, !tbaa !9
  %110 = sub nsw i32 1, %109
  store i32 %110, ptr %6, align 4, !tbaa !9
  br label %164

111:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %112 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %9, i32 0, i32 0
  %113 = load i64, ptr %112, align 8, !tbaa !18
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  %115 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %114, i32 0, i32 0
  %116 = load i64, ptr %115, align 8, !tbaa !18
  %117 = sub nsw i64 %113, %116
  %118 = sitofp i64 %117 to double
  %119 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %11, i32 0, i32 1
  %120 = load i64, ptr %119, align 8, !tbaa !16
  %121 = load ptr, ptr %4, align 8, !tbaa !5
  %122 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %121, i32 0, i32 1
  %123 = load i64, ptr %122, align 8, !tbaa !16
  %124 = sub nsw i64 %120, %123
  %125 = sitofp i64 %124 to double
  %126 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %11, i32 0, i32 0
  %127 = load i64, ptr %126, align 8, !tbaa !18
  %128 = load ptr, ptr %4, align 8, !tbaa !5
  %129 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %128, i32 0, i32 0
  %130 = load i64, ptr %129, align 8, !tbaa !18
  %131 = sub nsw i64 %127, %130
  %132 = sitofp i64 %131 to double
  %133 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %9, i32 0, i32 1
  %134 = load i64, ptr %133, align 8, !tbaa !16
  %135 = load ptr, ptr %4, align 8, !tbaa !5
  %136 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %135, i32 0, i32 1
  %137 = load i64, ptr %136, align 8, !tbaa !16
  %138 = sub nsw i64 %134, %137
  %139 = sitofp i64 %138 to double
  %140 = fmul double %132, %139
  %141 = fneg double %140
  %142 = call double @llvm.fmuladd.f64(double %118, double %125, double %141)
  store double %142, ptr %12, align 8, !tbaa !19
  %143 = load double, ptr %12, align 8, !tbaa !19
  %144 = fcmp une double %143, 0.000000e+00
  br i1 %144, label %146, label %145

145:                                              ; preds = %111
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %161

146:                                              ; preds = %111
  %147 = load double, ptr %12, align 8, !tbaa !19
  %148 = fcmp ogt double %147, 0.000000e+00
  %149 = zext i1 %148 to i32
  %150 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %11, i32 0, i32 1
  %151 = load i64, ptr %150, align 8, !tbaa !16
  %152 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %9, i32 0, i32 1
  %153 = load i64, ptr %152, align 8, !tbaa !16
  %154 = icmp sgt i64 %151, %153
  %155 = zext i1 %154 to i32
  %156 = icmp eq i32 %149, %155
  br i1 %156, label %157, label %160

157:                                              ; preds = %146
  %158 = load i32, ptr %6, align 4, !tbaa !9
  %159 = sub nsw i32 1, %158
  store i32 %159, ptr %6, align 4, !tbaa !9
  br label %160

160:                                              ; preds = %157, %146
  store i32 0, ptr %8, align 4
  br label %161

161:                                              ; preds = %160, %145
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  %162 = load i32, ptr %8, align 4
  switch i32 %162, label %228 [
    i32 0, label %163
  ]

163:                                              ; preds = %161
  br label %164

164:                                              ; preds = %163, %108
  br label %226

165:                                              ; preds = %94
  %166 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %11, i32 0, i32 0
  %167 = load i64, ptr %166, align 8, !tbaa !18
  %168 = load ptr, ptr %4, align 8, !tbaa !5
  %169 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %168, i32 0, i32 0
  %170 = load i64, ptr %169, align 8, !tbaa !18
  %171 = icmp sgt i64 %167, %170
  br i1 %171, label %172, label %225

172:                                              ; preds = %165
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %173 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %9, i32 0, i32 0
  %174 = load i64, ptr %173, align 8, !tbaa !18
  %175 = load ptr, ptr %4, align 8, !tbaa !5
  %176 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %175, i32 0, i32 0
  %177 = load i64, ptr %176, align 8, !tbaa !18
  %178 = sub nsw i64 %174, %177
  %179 = sitofp i64 %178 to double
  %180 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %11, i32 0, i32 1
  %181 = load i64, ptr %180, align 8, !tbaa !16
  %182 = load ptr, ptr %4, align 8, !tbaa !5
  %183 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %182, i32 0, i32 1
  %184 = load i64, ptr %183, align 8, !tbaa !16
  %185 = sub nsw i64 %181, %184
  %186 = sitofp i64 %185 to double
  %187 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %11, i32 0, i32 0
  %188 = load i64, ptr %187, align 8, !tbaa !18
  %189 = load ptr, ptr %4, align 8, !tbaa !5
  %190 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %189, i32 0, i32 0
  %191 = load i64, ptr %190, align 8, !tbaa !18
  %192 = sub nsw i64 %188, %191
  %193 = sitofp i64 %192 to double
  %194 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %9, i32 0, i32 1
  %195 = load i64, ptr %194, align 8, !tbaa !16
  %196 = load ptr, ptr %4, align 8, !tbaa !5
  %197 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %196, i32 0, i32 1
  %198 = load i64, ptr %197, align 8, !tbaa !16
  %199 = sub nsw i64 %195, %198
  %200 = sitofp i64 %199 to double
  %201 = fmul double %193, %200
  %202 = fneg double %201
  %203 = call double @llvm.fmuladd.f64(double %179, double %186, double %202)
  store double %203, ptr %13, align 8, !tbaa !19
  %204 = load double, ptr %13, align 8, !tbaa !19
  %205 = fcmp une double %204, 0.000000e+00
  br i1 %205, label %207, label %206

206:                                              ; preds = %172
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %222

207:                                              ; preds = %172
  %208 = load double, ptr %13, align 8, !tbaa !19
  %209 = fcmp ogt double %208, 0.000000e+00
  %210 = zext i1 %209 to i32
  %211 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %11, i32 0, i32 1
  %212 = load i64, ptr %211, align 8, !tbaa !16
  %213 = getelementptr inbounds %"struct.ClipperLib::IntPoint", ptr %9, i32 0, i32 1
  %214 = load i64, ptr %213, align 8, !tbaa !16
  %215 = icmp sgt i64 %212, %214
  %216 = zext i1 %215 to i32
  %217 = icmp eq i32 %210, %216
  br i1 %217, label %218, label %221

218:                                              ; preds = %207
  %219 = load i32, ptr %6, align 4, !tbaa !9
  %220 = sub nsw i32 1, %219
  store i32 %220, ptr %6, align 4, !tbaa !9
  br label %221

221:                                              ; preds = %218, %207
  store i32 0, ptr %8, align 4
  br label %222

222:                                              ; preds = %221, %206
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  %223 = load i32, ptr %8, align 4
  switch i32 %223, label %228 [
    i32 0, label %224
  ]

224:                                              ; preds = %222
  br label %225

225:                                              ; preds = %224, %165
  br label %226

226:                                              ; preds = %225, %164
  br label %227

227:                                              ; preds = %226, %78
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %9, ptr align 8 %11, i64 16, i1 false), !tbaa.struct !13
  store i32 0, ptr %8, align 4
  br label %228

228:                                              ; preds = %227, %222, %161, %76
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #4
  %229 = load i32, ptr %8, align 4
  switch i32 %229, label %234 [
    i32 0, label %230
  ]

230:                                              ; preds = %228
  br label %231

231:                                              ; preds = %230
  %232 = load i64, ptr %10, align 8, !tbaa !11
  %233 = add i64 %232, 1
  store i64 %233, ptr %10, align 8, !tbaa !11
  br label %22, !llvm.loop !21

234:                                              ; preds = %228, %26
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  %235 = load i32, ptr %8, align 4
  switch i32 %235, label %238 [
    i32 2, label %236
  ]

236:                                              ; preds = %234
  %237 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %237, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %238

238:                                              ; preds = %236, %234
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #4
  br label %239

239:                                              ; preds = %238, %18
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  %240 = load i32, ptr %3, align 4
  ret i32 %240
}

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 = { 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 = !{!"int", !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, !15, i64 8}
!17 = !{!"_ZTSN10ClipperLib8IntPointE", !15, i64 0, !15, i64 8}
!18 = !{!17, !15, i64 0}
!19 = !{!20, !20, i64 0}
!20 = !{!"double", !7, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}


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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_ZN10ClipperLib14PointInPolygonERKNS_8IntPointERKSt6vectorIS0_SaIS0_EE(ptr nocapture noundef nonnull readonly align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) local_unnamed_addr #0 {
  %3 = tail call noundef i64 @_ZNKSt6vectorIN10ClipperLib8IntPointESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #2
  %4 = icmp ult i64 %3, 3
  br i1 %4, label %.loopexit, label %5

5:                                                ; preds = %2
  %6 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorIN10ClipperLib8IntPointESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef 0) #2
  %.sroa.023.0.copyload = load i64, ptr %6, align 8, !tbaa !5
  %.sroa.8.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 8
  %.sroa.8.0.copyload = load i64, ptr %.sroa.8.0..sroa_idx, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 8
  br label %8

8:                                                ; preds = %5, %66
  %.066104 = phi i32 [ 0, %5 ], [ %.672.ph, %66 ]
  %.sroa.8.0103 = phi i64 [ %.sroa.8.0.copyload, %5 ], [ %.sroa.10.0.copyload, %66 ]
  %.078102 = phi i64 [ 1, %5 ], [ %67, %66 ]
  %.sroa.023.0101 = phi i64 [ %.sroa.023.0.copyload, %5 ], [ %.sroa.0.0.copyload, %66 ]
  %9 = icmp eq i64 %.078102, %3
  %..078102 = select i1 %9, i64 0, i64 %.078102
  %10 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorIN10ClipperLib8IntPointESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %..078102) #2
  %.sroa.0.0.copyload = load i64, ptr %10, align 8, !tbaa !5
  %.sroa.10.0..sroa_idx = getelementptr inbounds i8, ptr %10, i64 8
  %.sroa.10.0.copyload = load i64, ptr %.sroa.10.0..sroa_idx, align 8, !tbaa !5
  %11 = load i64, ptr %7, align 8, !tbaa !9
  %12 = icmp eq i64 %.sroa.10.0.copyload, %11
  br i1 %12, label %13, label %22

13:                                               ; preds = %8
  %14 = load i64, ptr %0, align 8, !tbaa !11
  %15 = icmp eq i64 %.sroa.0.0.copyload, %14
  br i1 %15, label %.loopexit, label %16

16:                                               ; preds = %13
  %17 = icmp eq i64 %.sroa.8.0103, %.sroa.10.0.copyload
  br i1 %17, label %18, label %22

18:                                               ; preds = %16
  %19 = icmp sgt i64 %.sroa.0.0.copyload, %14
  %20 = icmp sge i64 %.sroa.023.0101, %14
  %21 = xor i1 %19, %20
  br i1 %21, label %.loopexit, label %22

22:                                               ; preds = %16, %18, %8
  %23 = icmp slt i64 %.sroa.8.0103, %11
  %24 = icmp sge i64 %.sroa.10.0.copyload, %11
  %.not86 = xor i1 %23, %24
  br i1 %.not86, label %66, label %25

25:                                               ; preds = %22
  %26 = load i64, ptr %0, align 8, !tbaa !11
  %.not87 = icmp slt i64 %.sroa.023.0101, %26
  %27 = icmp sgt i64 %.sroa.0.0.copyload, %26
  br i1 %.not87, label %48, label %28

28:                                               ; preds = %25
  br i1 %27, label %29, label %31

29:                                               ; preds = %28
  %30 = sub nuw nsw i32 1, %.066104
  br label %66

31:                                               ; preds = %28
  %32 = sub nsw i64 %.sroa.023.0101, %26
  %33 = sitofp i64 %32 to double
  %34 = sub nsw i64 %.sroa.10.0.copyload, %11
  %35 = sitofp i64 %34 to double
  %36 = sub nsw i64 %.sroa.0.0.copyload, %26
  %37 = sitofp i64 %36 to double
  %38 = sub nsw i64 %.sroa.8.0103, %11
  %39 = sitofp i64 %38 to double
  %40 = fneg double %37
  %41 = fmul double %39, %40
  %42 = tail call double @llvm.fmuladd.f64(double %33, double %35, double %41)
  %43 = fcmp une double %42, 0.000000e+00
  br i1 %43, label %.thread, label %.loopexit

.thread:                                          ; preds = %31
  %44 = fcmp ogt double %42, 0.000000e+00
  %45 = icmp sle i64 %.sroa.10.0.copyload, %.sroa.8.0103
  %46 = xor i1 %45, %44
  %47 = sub nuw nsw i32 1, %.066104
  %spec.select = select i1 %46, i32 %47, i32 %.066104
  br label %66

48:                                               ; preds = %25
  br i1 %27, label %49, label %66

49:                                               ; preds = %48
  %50 = sub nsw i64 %.sroa.023.0101, %26
  %51 = sitofp i64 %50 to double
  %52 = sub nsw i64 %.sroa.10.0.copyload, %11
  %53 = sitofp i64 %52 to double
  %54 = sub nsw i64 %.sroa.0.0.copyload, %26
  %55 = sitofp i64 %54 to double
  %56 = sub nsw i64 %.sroa.8.0103, %11
  %57 = sitofp i64 %56 to double
  %58 = fneg double %55
  %59 = fmul double %57, %58
  %60 = tail call double @llvm.fmuladd.f64(double %51, double %53, double %59)
  %61 = fcmp une double %60, 0.000000e+00
  br i1 %61, label %.thread91, label %.loopexit

.thread91:                                        ; preds = %49
  %62 = fcmp ogt double %60, 0.000000e+00
  %63 = icmp sle i64 %.sroa.10.0.copyload, %.sroa.8.0103
  %64 = xor i1 %63, %62
  %65 = sub nuw nsw i32 1, %.066104
  %spec.select88 = select i1 %64, i32 %65, i32 %.066104
  br label %66

66:                                               ; preds = %.thread91, %.thread, %29, %48, %22
  %.672.ph = phi i32 [ %spec.select88, %.thread91 ], [ %spec.select, %.thread ], [ %.066104, %22 ], [ %.066104, %48 ], [ %30, %29 ]
  %67 = add i64 %.078102, 1
  %.not = icmp ugt i64 %67, %3
  br i1 %.not, label %.loopexit, label %8, !llvm.loop !12

.loopexit:                                        ; preds = %66, %49, %31, %13, %18, %2
  %.7 = phi i32 [ 0, %2 ], [ %.672.ph, %66 ], [ -1, %49 ], [ -1, %31 ], [ -1, %13 ], [ -1, %18 ]
  ret i32 %.7
}

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"_ZTSN10ClipperLib8IntPointE", !6, i64 0, !6, i64 8}
!11 = !{!10, !6, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}


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