; LLVM IR from wesley-a-leung/Resources :: Tests/C++/geometry/2d (ConvexPolygonFuzzTest)

; 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.pt = type { x86_fp80, x86_fp80 }
%"struct.std::pair.20" = type { i32, i32 }

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z14closestPtOnSeg2ptS_S_(ptr dead_on_unwind noalias writable sret(%struct.pt) align 16, ptr noundef byval(%struct.pt) align 16, ptr noundef byval(%struct.pt) align 16, ptr noundef byval(%struct.pt) align 16) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef x86_fp80 @_Z9ptSegDist2ptS_S_(ptr noundef byval(%struct.pt) align 16, ptr noundef byval(%struct.pt) align 16, ptr noundef byval(%struct.pt) align 16) #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3modii(i32 noundef, i32 noundef) #3

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_Z25convexPolygonPointTangentRKSt6vectorI2ptSaIS0_EES0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef byval(%struct.pt) align 16) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z27closestPointOnConvexPolygonRKSt6vectorI2ptSaIS0_EES0_(ptr dead_on_unwind noalias writable sret(%struct.pt) align 16 %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef byval(%struct.pt) align 16 %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca %"struct.std::pair.20", align 4
  %6 = alloca %struct.pt, align 16
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %struct.pt, align 16
  %15 = alloca %struct.pt, align 16
  %16 = alloca %struct.pt, align 16
  %17 = alloca %struct.pt, align 16
  %18 = alloca %struct.pt, align 16
  %19 = alloca %struct.pt, align 16
  %20 = alloca i32, align 4
  %21 = alloca %struct.pt, align 16
  %22 = alloca %struct.pt, align 16
  %23 = alloca %struct.pt, align 16
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %6, ptr align 16 %2, i64 32, i1 false), !tbaa.struct !9
  %25 = call i64 @_Z25convexPolygonPointTangentRKSt6vectorI2ptSaIS0_EES0_(ptr noundef nonnull align 8 dereferenceable(24) %24, ptr noundef byval(%struct.pt) align 16 %6)
  store i64 %25, ptr %5, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = call noundef i64 @_ZNKSt6vectorI2ptSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %26) #4
  %28 = trunc i64 %27 to i32
  store i32 %28, ptr %7, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %29 = getelementptr inbounds %"struct.std::pair.20", ptr %5, i32 0, i32 1
  %30 = load i32, ptr %29, align 4, !tbaa !14
  %31 = getelementptr inbounds %"struct.std::pair.20", ptr %5, i32 0, i32 0
  %32 = load i32, ptr %31, align 4, !tbaa !16
  %33 = sub nsw i32 %30, %32
  store i32 %33, ptr %8, align 4, !tbaa !12
  %34 = load i32, ptr %8, align 4, !tbaa !12
  %35 = icmp slt i32 %34, 0
  br i1 %35, label %36, label %40

36:                                               ; preds = %3
  %37 = load i32, ptr %7, align 4, !tbaa !12
  %38 = load i32, ptr %8, align 4, !tbaa !12
  %39 = add nsw i32 %38, %37
  store i32 %39, ptr %8, align 4, !tbaa !12
  br label %40

40:                                               ; preds = %36, %3
  %41 = load i32, ptr %8, align 4, !tbaa !12
  %42 = icmp eq i32 %41, 0
  br i1 %42, label %43, label %49

43:                                               ; preds = %40
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = getelementptr inbounds %"struct.std::pair.20", ptr %5, i32 0, i32 0
  %46 = load i32, ptr %45, align 4, !tbaa !16
  %47 = sext i32 %46 to i64
  %48 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %44, i64 noundef %47) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %0, ptr align 16 %48, i64 32, i1 false), !tbaa.struct !9
  store i32 1, ptr %9, align 4
  br label %122

49:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %50 = load i32, ptr %8, align 4, !tbaa !12
  %51 = sub nsw i32 %50, 2
  store i32 %51, ptr %11, align 4, !tbaa !12
  br label %52

52:                                               ; preds = %103, %49
  %53 = load i32, ptr %10, align 4, !tbaa !12
  %54 = load i32, ptr %11, align 4, !tbaa !12
  %55 = icmp sle i32 %53, %54
  br i1 %55, label %56, label %104

56:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %57 = load i32, ptr %10, align 4, !tbaa !12
  %58 = load i32, ptr %11, align 4, !tbaa !12
  %59 = load i32, ptr %10, align 4, !tbaa !12
  %60 = sub nsw i32 %58, %59
  %61 = sdiv i32 %60, 2
  %62 = add nsw i32 %57, %61
  store i32 %62, ptr %12, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %63 = getelementptr inbounds %"struct.std::pair.20", ptr %5, i32 0, i32 0
  %64 = load i32, ptr %63, align 4, !tbaa !16
  %65 = load i32, ptr %12, align 4, !tbaa !12
  %66 = add nsw i32 %64, %65
  %67 = load i32, ptr %7, align 4, !tbaa !12
  %68 = call noundef i32 @_Z3modii(i32 noundef %66, i32 noundef %67)
  store i32 %68, ptr %13, align 4, !tbaa !12
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %14, ptr align 16 %2, i64 32, i1 false), !tbaa.struct !9
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = load i32, ptr %13, align 4, !tbaa !12
  %71 = sext i32 %70 to i64
  %72 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %69, i64 noundef %71) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %15, ptr align 16 %72, i64 32, i1 false), !tbaa.struct !9
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = load i32, ptr %13, align 4, !tbaa !12
  %75 = add nsw i32 %74, 1
  %76 = load i32, ptr %7, align 4, !tbaa !12
  %77 = call noundef i32 @_Z3modii(i32 noundef %75, i32 noundef %76)
  %78 = sext i32 %77 to i64
  %79 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %73, i64 noundef %78) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %16, ptr align 16 %79, i64 32, i1 false), !tbaa.struct !9
  %80 = call noundef x86_fp80 @_Z9ptSegDist2ptS_S_(ptr noundef byval(%struct.pt) align 16 %14, ptr noundef byval(%struct.pt) align 16 %15, ptr noundef byval(%struct.pt) align 16 %16)
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %17, ptr align 16 %2, i64 32, i1 false), !tbaa.struct !9
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = load i32, ptr %13, align 4, !tbaa !12
  %83 = add nsw i32 %82, 1
  %84 = load i32, ptr %7, align 4, !tbaa !12
  %85 = call noundef i32 @_Z3modii(i32 noundef %83, i32 noundef %84)
  %86 = sext i32 %85 to i64
  %87 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %81, i64 noundef %86) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %18, ptr align 16 %87, i64 32, i1 false), !tbaa.struct !9
  %88 = load ptr, ptr %4, align 8, !tbaa !5
  %89 = load i32, ptr %13, align 4, !tbaa !12
  %90 = add nsw i32 %89, 2
  %91 = load i32, ptr %7, align 4, !tbaa !12
  %92 = call noundef i32 @_Z3modii(i32 noundef %90, i32 noundef %91)
  %93 = sext i32 %92 to i64
  %94 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %88, i64 noundef %93) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %19, ptr align 16 %94, i64 32, i1 false), !tbaa.struct !9
  %95 = call noundef x86_fp80 @_Z9ptSegDist2ptS_S_(ptr noundef byval(%struct.pt) align 16 %17, ptr noundef byval(%struct.pt) align 16 %18, ptr noundef byval(%struct.pt) align 16 %19)
  %96 = fcmp olt x86_fp80 %80, %95
  br i1 %96, label %97, label %100

97:                                               ; preds = %56
  %98 = load i32, ptr %12, align 4, !tbaa !12
  %99 = sub nsw i32 %98, 1
  store i32 %99, ptr %11, align 4, !tbaa !12
  br label %103

100:                                              ; preds = %56
  %101 = load i32, ptr %12, align 4, !tbaa !12
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %10, align 4, !tbaa !12
  br label %103

103:                                              ; preds = %100, %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %52, !llvm.loop !17

104:                                              ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  %105 = getelementptr inbounds %"struct.std::pair.20", ptr %5, i32 0, i32 0
  %106 = load i32, ptr %105, align 4, !tbaa !16
  %107 = load i32, ptr %10, align 4, !tbaa !12
  %108 = add nsw i32 %106, %107
  %109 = load i32, ptr %7, align 4, !tbaa !12
  %110 = call noundef i32 @_Z3modii(i32 noundef %108, i32 noundef %109)
  store i32 %110, ptr %20, align 4, !tbaa !12
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %21, ptr align 16 %2, i64 32, i1 false), !tbaa.struct !9
  %111 = load ptr, ptr %4, align 8, !tbaa !5
  %112 = load i32, ptr %20, align 4, !tbaa !12
  %113 = sext i32 %112 to i64
  %114 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %111, i64 noundef %113) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %22, ptr align 16 %114, i64 32, i1 false), !tbaa.struct !9
  %115 = load ptr, ptr %4, align 8, !tbaa !5
  %116 = load i32, ptr %20, align 4, !tbaa !12
  %117 = add nsw i32 %116, 1
  %118 = load i32, ptr %7, align 4, !tbaa !12
  %119 = call noundef i32 @_Z3modii(i32 noundef %117, i32 noundef %118)
  %120 = sext i32 %119 to i64
  %121 = call noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %115, i64 noundef %120) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %23, ptr align 16 %121, i64 32, i1 false), !tbaa.struct !9
  call void @_Z14closestPtOnSeg2ptS_S_(ptr dead_on_unwind writable sret(%struct.pt) align 16 %0, ptr noundef byval(%struct.pt) align 16 %21, ptr noundef byval(%struct.pt) align 16 %22, ptr noundef byval(%struct.pt) align 16 %23)
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %122

122:                                              ; preds = %104, %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  ret void
}

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

%struct.pt = type { x86_fp80, x86_fp80 }

; 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 uwtable
declare dso_local void @_Z14closestPtOnSeg2ptS_S_(ptr dead_on_unwind noalias writable sret(%struct.pt) align 16, ptr noundef byval(%struct.pt) align 16, ptr noundef byval(%struct.pt) align 16, ptr noundef byval(%struct.pt) align 16) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef x86_fp80 @_Z9ptSegDist2ptS_S_(ptr noundef byval(%struct.pt) align 16, ptr noundef byval(%struct.pt) align 16, ptr noundef byval(%struct.pt) align 16) local_unnamed_addr #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3modii(i32 noundef, i32 noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_Z25convexPolygonPointTangentRKSt6vectorI2ptSaIS0_EES0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef byval(%struct.pt) align 16) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z27closestPointOnConvexPolygonRKSt6vectorI2ptSaIS0_EES0_(ptr dead_on_unwind noalias writable sret(%struct.pt) align 16 %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr nocapture noundef readonly byval(%struct.pt) align 16 %2) local_unnamed_addr #1 {
  %4 = alloca %struct.pt, align 16
  %5 = alloca %struct.pt, align 16
  %6 = alloca %struct.pt, align 16
  %7 = alloca %struct.pt, align 16
  %8 = alloca %struct.pt, align 16
  %9 = alloca %struct.pt, align 16
  %10 = tail call i64 @_Z25convexPolygonPointTangentRKSt6vectorI2ptSaIS0_EES0_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull byval(%struct.pt) align 16 %2)
  %.sroa.0.0.extract.trunc = trunc i64 %10 to i32
  %.sroa.7.0.extract.shift = lshr i64 %10, 32
  %.sroa.7.0.extract.trunc = trunc nuw i64 %.sroa.7.0.extract.shift to i32
  %11 = tail call noundef i64 @_ZNKSt6vectorI2ptSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #3
  %12 = trunc i64 %11 to i32
  %13 = sub nsw i32 %.sroa.7.0.extract.trunc, %.sroa.0.0.extract.trunc
  %14 = icmp slt i32 %13, 0
  %15 = select i1 %14, i32 %12, i32 0
  %spec.select = add nsw i32 %15, %13
  %16 = icmp eq i32 %spec.select, 0
  br i1 %16, label %17, label %20

17:                                               ; preds = %3
  %sext = shl i64 %10, 32
  %18 = ashr exact i64 %sext, 32
  %19 = tail call noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %18) #3
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %0, ptr noundef nonnull align 16 dereferenceable(32) %19, i64 32, i1 false), !tbaa.struct !5
  br label %53

20:                                               ; preds = %3
  %.not42 = icmp slt i32 %spec.select, 2
  br i1 %.not42, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %20
  %21 = add nsw i32 %spec.select, -2
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %.03744 = phi i32 [ %.1, %.lr.ph ], [ 0, %.lr.ph.preheader ]
  %.03843 = phi i32 [ %.139, %.lr.ph ], [ %21, %.lr.ph.preheader ]
  %22 = sub nsw i32 %.03843, %.03744
  %23 = sdiv i32 %22, 2
  %24 = add nsw i32 %23, %.03744
  %25 = add nsw i32 %24, %.sroa.0.0.extract.trunc
  %26 = tail call noundef i32 @_Z3modii(i32 noundef %25, i32 noundef %12)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %4, ptr noundef nonnull align 16 dereferenceable(32) %2, i64 32, i1 false), !tbaa.struct !5
  %27 = sext i32 %26 to i64
  %28 = tail call noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %27) #3
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %5, ptr noundef nonnull align 16 dereferenceable(32) %28, i64 32, i1 false), !tbaa.struct !5
  %29 = add nsw i32 %26, 1
  %30 = tail call noundef i32 @_Z3modii(i32 noundef %29, i32 noundef %12)
  %31 = sext i32 %30 to i64
  %32 = tail call noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %31) #3
  %33 = tail call noundef x86_fp80 @_Z9ptSegDist2ptS_S_(ptr noundef nonnull byval(%struct.pt) align 16 %4, ptr noundef nonnull byval(%struct.pt) align 16 %5, ptr noundef nonnull byval(%struct.pt) align 16 %32)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %6, ptr noundef nonnull align 16 dereferenceable(32) %2, i64 32, i1 false), !tbaa.struct !5
  %34 = tail call noundef i32 @_Z3modii(i32 noundef %29, i32 noundef %12)
  %35 = sext i32 %34 to i64
  %36 = tail call noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %35) #3
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %7, ptr noundef nonnull align 16 dereferenceable(32) %36, i64 32, i1 false), !tbaa.struct !5
  %37 = add nsw i32 %26, 2
  %38 = tail call noundef i32 @_Z3modii(i32 noundef %37, i32 noundef %12)
  %39 = sext i32 %38 to i64
  %40 = tail call noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %39) #3
  %41 = tail call noundef x86_fp80 @_Z9ptSegDist2ptS_S_(ptr noundef nonnull byval(%struct.pt) align 16 %6, ptr noundef nonnull byval(%struct.pt) align 16 %7, ptr noundef nonnull byval(%struct.pt) align 16 %40)
  %42 = fcmp olt x86_fp80 %33, %41
  %43 = add nsw i32 %24, -1
  %44 = add nsw i32 %24, 1
  %.139 = select i1 %42, i32 %43, i32 %.03843
  %.1 = select i1 %42, i32 %.03744, i32 %44
  %.not = icmp sgt i32 %.1, %.139
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !10

._crit_edge:                                      ; preds = %.lr.ph, %20
  %.037.lcssa = phi i32 [ 0, %20 ], [ %.1, %.lr.ph ]
  %45 = add nsw i32 %.037.lcssa, %.sroa.0.0.extract.trunc
  %46 = tail call noundef i32 @_Z3modii(i32 noundef %45, i32 noundef %12)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %8, ptr noundef nonnull align 16 dereferenceable(32) %2, i64 32, i1 false), !tbaa.struct !5
  %47 = sext i32 %46 to i64
  %48 = tail call noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %47) #3
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %9, ptr noundef nonnull align 16 dereferenceable(32) %48, i64 32, i1 false), !tbaa.struct !5
  %49 = add nsw i32 %46, 1
  %50 = tail call noundef i32 @_Z3modii(i32 noundef %49, i32 noundef %12)
  %51 = sext i32 %50 to i64
  %52 = tail call noundef nonnull align 16 dereferenceable(32) ptr @_ZNKSt6vectorI2ptSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %51) #3
  tail call void @_Z14closestPtOnSeg2ptS_S_(ptr dead_on_unwind writable sret(%struct.pt) align 16 %0, ptr noundef nonnull byval(%struct.pt) align 16 %8, ptr noundef nonnull byval(%struct.pt) align 16 %9, ptr noundef nonnull byval(%struct.pt) align 16 %52)
  br label %53

53:                                               ; preds = %._crit_edge, %17
  ret void
}

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


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass