; LLVM IR from tangjz/acm-icpc :: hdu/6419.ll (Z7isValid5Point)

; 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.Point = type { double, double }
%struct.Segment = type { %struct.Point, %struct.Point }

@n = external dso_local global i32, align 4
@rad = external dso_local global i32, align 4
@p = external dso_local global [209 x %struct.Point], align 16

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z12getFootPoint7Segment5PointRS0_(ptr noundef byval(%struct.Segment) align 8, double, double, ptr noundef nonnull align 8 dereferenceable(16)) #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { double, double } @_ZNK5PointmiERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3sgnd(double noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5Point3lenEv(ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z7isValid5Point(double %0, double %1) #0 {
  %3 = alloca %struct.Point, align 8
  %4 = alloca double, align 8
  %5 = alloca i8, align 1
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca double, align 8
  %9 = alloca %struct.Point, align 8
  %10 = alloca %struct.Point, align 8
  %11 = alloca %struct.Segment, align 8
  %12 = alloca %struct.Point, align 8
  %13 = alloca double, align 8
  %14 = alloca %struct.Point, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca double, align 8
  %18 = getelementptr inbounds { double, double }, ptr %3, i32 0, i32 0
  store double %0, ptr %18, align 8
  %19 = getelementptr inbounds { double, double }, ptr %3, i32 0, i32 1
  store double %1, ptr %19, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  store double 1.000000e+10, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #6
  store i8 0, ptr %5, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !11
  br label %20

20:                                               ; preds = %151, %2
  %21 = load i32, ptr %6, align 4, !tbaa !11
  %22 = load i32, ptr @n, align 4, !tbaa !11
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %154

25:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %26 = load i32, ptr %6, align 4, !tbaa !11
  %27 = add nsw i32 %26, 1
  %28 = load i32, ptr @n, align 4, !tbaa !11
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %30, label %33

30:                                               ; preds = %25
  %31 = load i32, ptr %6, align 4, !tbaa !11
  %32 = add nsw i32 %31, 1
  br label %34

33:                                               ; preds = %25
  br label %34

34:                                               ; preds = %33, %30
  %35 = phi i32 [ %32, %30 ], [ 0, %33 ]
  store i32 %35, ptr %7, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #6
  %36 = load i32, ptr %6, align 4, !tbaa !11
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [209 x %struct.Point], ptr @p, i64 0, i64 %37
  %39 = call { double, double } @_ZNK5PointmiERKS_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %38)
  %40 = getelementptr inbounds { double, double }, ptr %9, i32 0, i32 0
  %41 = extractvalue { double, double } %39, 0
  store double %41, ptr %40, align 8
  %42 = getelementptr inbounds { double, double }, ptr %9, i32 0, i32 1
  %43 = extractvalue { double, double } %39, 1
  store double %43, ptr %42, align 8
  %44 = call noundef double @_ZNK5Point3lenEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
  store double %44, ptr %8, align 8, !tbaa !5
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %46 = load double, ptr %45, align 8, !tbaa !5
  store double %46, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #6
  %47 = getelementptr inbounds %struct.Segment, ptr %11, i32 0, i32 0
  %48 = load i32, ptr %6, align 4, !tbaa !11
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [209 x %struct.Point], ptr @p, i64 0, i64 %49
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %47, ptr align 16 %50, i64 16, i1 false), !tbaa.struct !13
  %51 = getelementptr inbounds %struct.Segment, ptr %11, i32 0, i32 1
  %52 = load i32, ptr %7, align 4, !tbaa !11
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [209 x %struct.Point], ptr @p, i64 0, i64 %53
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %51, ptr align 16 %54, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %3, i64 16, i1 false), !tbaa.struct !13
  %55 = getelementptr inbounds { double, double }, ptr %12, i32 0, i32 0
  %56 = load double, ptr %55, align 8
  %57 = getelementptr inbounds { double, double }, ptr %12, i32 0, i32 1
  %58 = load double, ptr %57, align 8
  %59 = call noundef zeroext i1 @_Z12getFootPoint7Segment5PointRS0_(ptr noundef byval(%struct.Segment) align 8 %11, double %56, double %58, ptr noundef nonnull align 8 dereferenceable(16) %10)
  br i1 %59, label %60, label %69

60:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #6
  %61 = call { double, double } @_ZNK5PointmiERKS_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %10)
  %62 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 0
  %63 = extractvalue { double, double } %61, 0
  store double %63, ptr %62, align 8
  %64 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 1
  %65 = extractvalue { double, double } %61, 1
  store double %65, ptr %64, align 8
  %66 = call noundef double @_ZNK5Point3lenEv(ptr noundef nonnull align 8 dereferenceable(16) %14)
  store double %66, ptr %13, align 8, !tbaa !5
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %68 = load double, ptr %67, align 8, !tbaa !5
  store double %68, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %69

69:                                               ; preds = %60, %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %70 = load i32, ptr %6, align 4, !tbaa !11
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [209 x %struct.Point], ptr @p, i64 0, i64 %71
  %73 = getelementptr inbounds %struct.Point, ptr %72, i32 0, i32 1
  %74 = load double, ptr %73, align 8, !tbaa !14
  %75 = getelementptr inbounds %struct.Point, ptr %3, i32 0, i32 1
  %76 = load double, ptr %75, align 8, !tbaa !14
  %77 = fsub double %74, %76
  %78 = call noundef i32 @_Z3sgnd(double noundef %77)
  store i32 %78, ptr %15, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %79 = load i32, ptr %7, align 4, !tbaa !11
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [209 x %struct.Point], ptr @p, i64 0, i64 %80
  %82 = getelementptr inbounds %struct.Point, ptr %81, i32 0, i32 1
  %83 = load double, ptr %82, align 8, !tbaa !14
  %84 = getelementptr inbounds %struct.Point, ptr %3, i32 0, i32 1
  %85 = load double, ptr %84, align 8, !tbaa !14
  %86 = fsub double %83, %85
  %87 = call noundef i32 @_Z3sgnd(double noundef %86)
  store i32 %87, ptr %16, align 4, !tbaa !11
  %88 = load i32, ptr %15, align 4, !tbaa !11
  %89 = icmp slt i32 %88, 0
  br i1 %89, label %90, label %93

90:                                               ; preds = %69
  %91 = load i32, ptr %16, align 4, !tbaa !11
  %92 = icmp sge i32 %91, 0
  br i1 %92, label %99, label %93

93:                                               ; preds = %90, %69
  %94 = load i32, ptr %15, align 4, !tbaa !11
  %95 = icmp sge i32 %94, 0
  br i1 %95, label %96, label %150

96:                                               ; preds = %93
  %97 = load i32, ptr %16, align 4, !tbaa !11
  %98 = icmp slt i32 %97, 0
  br i1 %98, label %99, label %150

99:                                               ; preds = %96, %90
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %100 = load i32, ptr %6, align 4, !tbaa !11
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [209 x %struct.Point], ptr @p, i64 0, i64 %101
  %103 = getelementptr inbounds %struct.Point, ptr %102, i32 0, i32 0
  %104 = load double, ptr %103, align 16, !tbaa !16
  %105 = load i32, ptr %7, align 4, !tbaa !11
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [209 x %struct.Point], ptr @p, i64 0, i64 %106
  %108 = getelementptr inbounds %struct.Point, ptr %107, i32 0, i32 0
  %109 = load double, ptr %108, align 16, !tbaa !16
  %110 = load i32, ptr %6, align 4, !tbaa !11
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [209 x %struct.Point], ptr @p, i64 0, i64 %111
  %113 = getelementptr inbounds %struct.Point, ptr %112, i32 0, i32 0
  %114 = load double, ptr %113, align 16, !tbaa !16
  %115 = fsub double %109, %114
  %116 = load i32, ptr %7, align 4, !tbaa !11
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [209 x %struct.Point], ptr @p, i64 0, i64 %117
  %119 = getelementptr inbounds %struct.Point, ptr %118, i32 0, i32 1
  %120 = load double, ptr %119, align 8, !tbaa !14
  %121 = load i32, ptr %6, align 4, !tbaa !11
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [209 x %struct.Point], ptr @p, i64 0, i64 %122
  %124 = getelementptr inbounds %struct.Point, ptr %123, i32 0, i32 1
  %125 = load double, ptr %124, align 8, !tbaa !14
  %126 = fsub double %120, %125
  %127 = fdiv double %115, %126
  %128 = getelementptr inbounds %struct.Point, ptr %3, i32 0, i32 1
  %129 = load double, ptr %128, align 8, !tbaa !14
  %130 = load i32, ptr %6, align 4, !tbaa !11
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [209 x %struct.Point], ptr @p, i64 0, i64 %131
  %133 = getelementptr inbounds %struct.Point, ptr %132, i32 0, i32 1
  %134 = load double, ptr %133, align 8, !tbaa !14
  %135 = fsub double %129, %134
  %136 = call double @llvm.fmuladd.f64(double %127, double %135, double %104)
  store double %136, ptr %17, align 8, !tbaa !5
  %137 = load double, ptr %17, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.Point, ptr %3, i32 0, i32 0
  %139 = load double, ptr %138, align 8, !tbaa !16
  %140 = fsub double %137, %139
  %141 = call noundef i32 @_Z3sgnd(double noundef %140)
  %142 = icmp slt i32 %141, 0
  %143 = zext i1 %142 to i32
  %144 = load i8, ptr %5, align 1, !tbaa !9, !range !17, !noundef !18
  %145 = trunc i8 %144 to i1
  %146 = zext i1 %145 to i32
  %147 = xor i32 %146, %143
  %148 = icmp ne i32 %147, 0
  %149 = zext i1 %148 to i8
  store i8 %149, ptr %5, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %150

150:                                              ; preds = %99, %96, %93
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %151

151:                                              ; preds = %150
  %152 = load i32, ptr %6, align 4, !tbaa !11
  %153 = add nsw i32 %152, 1
  store i32 %153, ptr %6, align 4, !tbaa !11
  br label %20, !llvm.loop !19

154:                                              ; preds = %24
  %155 = load double, ptr %4, align 8, !tbaa !5
  %156 = load i32, ptr @rad, align 4, !tbaa !11
  %157 = sitofp i32 %156 to double
  %158 = fsub double %155, %157
  %159 = call noundef i32 @_Z3sgnd(double noundef %158)
  %160 = icmp sge i32 %159, 0
  br i1 %160, label %161, label %164

161:                                              ; preds = %154
  %162 = load i8, ptr %5, align 1, !tbaa !9, !range !17, !noundef !18
  %163 = trunc i8 %162 to i1
  br label %164

164:                                              ; preds = %161, %154
  %165 = phi i1 [ false, %154 ], [ %163, %161 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  ret i1 %165
}

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

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

attributes #0 = { 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 #1 = { nocallback nofree nosync 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 nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{i64 0, i64 8, !5, i64 8, i64 8, !5}
!14 = !{!15, !6, i64 8}
!15 = !{!"_ZTS5Point", !6, i64 0, !6, i64 8}
!16 = !{!15, !6, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = distinct !{!19, !20}
!20 = !{!"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.Point = type { double, double }
%struct.Segment = type { %struct.Point, %struct.Point }

@n = external dso_local local_unnamed_addr global i32, align 4
@rad = external dso_local local_unnamed_addr global i32, align 4
@p = external dso_local global [209 x %struct.Point], align 16

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z12getFootPoint7Segment5PointRS0_(ptr noundef byval(%struct.Segment) align 8, double, double, ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { double, double } @_ZNK5PointmiERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3sgnd(double noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK5Point3lenEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z7isValid5Point(double %0, double %1) local_unnamed_addr #0 {
  %3 = alloca %struct.Point, align 8
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca %struct.Point, align 8
  %7 = alloca %struct.Point, align 8
  %8 = alloca %struct.Segment, align 8
  %9 = alloca double, align 8
  %10 = alloca %struct.Point, align 8
  store double %0, ptr %3, align 8
  %11 = getelementptr inbounds i8, ptr %3, i64 8
  store double %1, ptr %11, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  store double 1.000000e+10, ptr %4, align 8, !tbaa !5
  %12 = load i32, ptr @n, align 4, !tbaa !9
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2
  %14 = getelementptr inbounds i8, ptr %6, i64 8
  %15 = getelementptr inbounds i8, ptr %8, i64 16
  %16 = getelementptr inbounds i8, ptr %10, i64 8
  br label %25

._crit_edge.loopexit:                             ; preds = %82
  %.pre = load double, ptr %4, align 8, !tbaa !5
  %17 = trunc nuw i8 %.1 to i1
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %2
  %18 = phi double [ 1.000000e+10, %2 ], [ %.pre, %._crit_edge.loopexit ]
  %.0.lcssa = phi i1 [ false, %2 ], [ %17, %._crit_edge.loopexit ]
  %19 = load i32, ptr @rad, align 4, !tbaa !9
  %20 = sitofp i32 %19 to double
  %21 = fsub double %18, %20
  %22 = call noundef i32 @_Z3sgnd(double noundef %21)
  %23 = icmp sgt i32 %22, -1
  %24 = select i1 %23, i1 %.0.lcssa, i1 false
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  ret i1 %24

25:                                               ; preds = %.lr.ph, %82
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %82 ]
  %26 = phi i32 [ %12, %.lr.ph ], [ %83, %82 ]
  %.027 = phi i8 [ 0, %.lr.ph ], [ %.1, %82 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %27 = sext i32 %26 to i64
  %28 = icmp slt i64 %indvars.iv.next, %27
  %29 = and i64 %indvars.iv.next, 4294967295
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #6
  %30 = getelementptr inbounds [209 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv
  %31 = call { double, double } @_ZNK5PointmiERKS_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %30)
  %32 = extractvalue { double, double } %31, 0
  store double %32, ptr %6, align 8
  %33 = extractvalue { double, double } %31, 1
  store double %33, ptr %14, align 8
  %34 = call noundef double @_ZNK5Point3lenEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  store double %34, ptr %5, align 8, !tbaa !5
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %36 = load double, ptr %35, align 8, !tbaa !5
  store double %36, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 16 dereferenceable(16) %30, i64 16, i1 false), !tbaa.struct !11
  %37 = select i1 %28, i64 %29, i64 0
  %38 = getelementptr inbounds [209 x %struct.Point], ptr @p, i64 0, i64 %37
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 16 dereferenceable(16) %38, i64 16, i1 false), !tbaa.struct !11
  %.sroa.0.0.copyload = load double, ptr %3, align 8, !tbaa !5
  %.sroa.2.0.copyload = load double, ptr %11, align 8, !tbaa !5
  %39 = call noundef zeroext i1 @_Z12getFootPoint7Segment5PointRS0_(ptr noundef nonnull byval(%struct.Segment) align 8 %8, double %.sroa.0.0.copyload, double %.sroa.2.0.copyload, ptr noundef nonnull align 8 dereferenceable(16) %7)
  br i1 %39, label %40, label %47

40:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #6
  %41 = call { double, double } @_ZNK5PointmiERKS_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %7)
  %42 = extractvalue { double, double } %41, 0
  store double %42, ptr %10, align 8
  %43 = extractvalue { double, double } %41, 1
  store double %43, ptr %16, align 8
  %44 = call noundef double @_ZNK5Point3lenEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  store double %44, ptr %9, align 8, !tbaa !5
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %46 = load double, ptr %45, align 8, !tbaa !5
  store double %46, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  br label %47

47:                                               ; preds = %40, %25
  %48 = getelementptr inbounds i8, ptr %30, i64 8
  %49 = load double, ptr %48, align 8, !tbaa !12
  %50 = load double, ptr %11, align 8, !tbaa !12
  %51 = fsub double %49, %50
  %52 = call noundef i32 @_Z3sgnd(double noundef %51)
  %53 = getelementptr inbounds i8, ptr %38, i64 8
  %54 = load double, ptr %53, align 8, !tbaa !12
  %55 = load double, ptr %11, align 8, !tbaa !12
  %56 = fsub double %54, %55
  %57 = call noundef i32 @_Z3sgnd(double noundef %56)
  %58 = icmp slt i32 %52, 0
  %59 = icmp sgt i32 %57, -1
  %or.cond = and i1 %58, %59
  br i1 %or.cond, label %63, label %60

60:                                               ; preds = %47
  %61 = icmp sgt i32 %52, -1
  %62 = icmp slt i32 %57, 0
  %or.cond3 = and i1 %61, %62
  br i1 %or.cond3, label %63, label %82

63:                                               ; preds = %60, %47
  %64 = load <2 x double>, ptr %38, align 16, !tbaa !5
  %65 = load <2 x double>, ptr %30, align 16, !tbaa !5
  %66 = fsub <2 x double> %64, %65
  %67 = extractelement <2 x double> %66, i64 0
  %68 = extractelement <2 x double> %66, i64 1
  %69 = fdiv double %67, %68
  %70 = load double, ptr %11, align 8, !tbaa !12
  %71 = extractelement <2 x double> %65, i64 1
  %72 = fsub double %70, %71
  %73 = extractelement <2 x double> %65, i64 0
  %74 = call double @llvm.fmuladd.f64(double %69, double %72, double %73)
  %75 = load double, ptr %3, align 8, !tbaa !14
  %76 = fsub double %74, %75
  %77 = call noundef i32 @_Z3sgnd(double noundef %76)
  %.lobit = lshr i32 %77, 31
  %78 = and i8 %.027, 1
  %79 = zext nneg i8 %78 to i32
  %80 = icmp ne i32 %.lobit, %79
  %81 = zext i1 %80 to i8
  br label %82

82:                                               ; preds = %63, %60
  %.1 = phi i8 [ %81, %63 ], [ %.027, %60 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  %83 = load i32, ptr @n, align 4, !tbaa !9
  %84 = sext i32 %83 to i64
  %85 = icmp slt i64 %indvars.iv.next, %84
  br i1 %85, label %25, label %._crit_edge.loopexit, !llvm.loop !15
}

; 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 #4

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{i64 0, i64 8, !5, i64 8, i64 8, !5}
!12 = !{!13, !6, i64 8}
!13 = !{!"_ZTS5Point", !6, i64 0, !6, i64 8}
!14 = !{!13, !6, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass