; LLVM IR from tangjz/acm-icpc :: hdu (6127)

; 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 { i32, i32, i32 }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@ord = external dso_local global [100003 x i32], align 16
@p = external dso_local global [50001 x %struct.Point], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %10

10:                                               ; preds = %134, %0
  %11 = load i32, ptr @t, align 4, !tbaa !5
  %12 = add nsw i32 %11, -1
  store i32 %12, ptr @t, align 4, !tbaa !5
  %13 = icmp ne i32 %11, 0
  br i1 %13, label %14, label %137

14:                                               ; preds = %10
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 0, ptr %2, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  store i64 0, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  store i64 0, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %37, %14
  %17 = load i32, ptr %5, align 4, !tbaa !5
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = icmp slt i32 %17, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %40

21:                                               ; preds = %16
  %22 = load i32, ptr %5, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [50001 x %struct.Point], ptr @p, i64 0, i64 %23
  call void @_ZN5Point4readEv(ptr noundef nonnull align 4 dereferenceable(12) %24)
  %25 = load i32, ptr %5, align 4, !tbaa !5
  %26 = load i32, ptr %5, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [100003 x i32], ptr @ord, i64 0, i64 %27
  store i32 %25, ptr %28, align 4, !tbaa !5
  %29 = load i32, ptr %5, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [50001 x %struct.Point], ptr @p, i64 0, i64 %30
  %32 = getelementptr inbounds %struct.Point, ptr %31, i32 0, i32 2
  %33 = load i32, ptr %32, align 4, !tbaa !11
  %34 = sext i32 %33 to i64
  %35 = load i64, ptr %3, align 8, !tbaa !9
  %36 = add nsw i64 %35, %34
  store i64 %36, ptr %3, align 8, !tbaa !9
  br label %37

37:                                               ; preds = %21
  %38 = load i32, ptr %5, align 4, !tbaa !5
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %5, align 4, !tbaa !5
  br label %16, !llvm.loop !13

40:                                               ; preds = %20
  %41 = load i32, ptr @n, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds i32, ptr @ord, i64 %42
  call void @_ZSt4sortIPiPFiRKiS2_EEvT_S5_T0_(ptr noundef @ord, ptr noundef %43, ptr noundef @_Z9polar_cmpRKiS0_)
  %44 = load i32, ptr @n, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds i32, ptr @ord, i64 %45
  %47 = load i32, ptr @n, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = mul i64 %48, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %46, ptr align 16 @ord, i64 %49, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %131, %40
  %51 = load i32, ptr %6, align 4, !tbaa !5
  %52 = load i32, ptr @n, align 4, !tbaa !5
  %53 = icmp slt i32 %51, %52
  br i1 %53, label %55, label %54

54:                                               ; preds = %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %134

55:                                               ; preds = %50
  br label %56

56:                                               ; preds = %100, %55
  %57 = load i32, ptr %7, align 4, !tbaa !5
  %58 = load i32, ptr @n, align 4, !tbaa !5
  %59 = shl i32 %58, 1
  %60 = icmp slt i32 %57, %59
  br i1 %60, label %61, label %75

61:                                               ; preds = %56
  %62 = load i32, ptr %6, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [100003 x i32], ptr @ord, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [50001 x %struct.Point], ptr @p, i64 0, i64 %66
  %68 = load i32, ptr %7, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [100003 x i32], ptr @ord, i64 0, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [50001 x %struct.Point], ptr @p, i64 0, i64 %72
  %74 = call noundef zeroext i1 @_Z5checkRK5PointS1_(ptr noundef nonnull align 4 dereferenceable(12) %67, ptr noundef nonnull align 4 dereferenceable(12) %73)
  br label %75

75:                                               ; preds = %61, %56
  %76 = phi i1 [ false, %56 ], [ %74, %61 ]
  br i1 %76, label %77, label %103

77:                                               ; preds = %75
  %78 = load i32, ptr %7, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [100003 x i32], ptr @ord, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [50001 x %struct.Point], ptr @p, i64 0, i64 %82
  %84 = getelementptr inbounds %struct.Point, ptr %83, i32 0, i32 2
  %85 = load i32, ptr %84, align 4, !tbaa !11
  %86 = sext i32 %85 to i64
  %87 = load i64, ptr %2, align 8, !tbaa !9
  %88 = add nsw i64 %87, %86
  store i64 %88, ptr %2, align 8, !tbaa !9
  %89 = load i32, ptr %7, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [100003 x i32], ptr @ord, i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [50001 x %struct.Point], ptr @p, i64 0, i64 %93
  %95 = getelementptr inbounds %struct.Point, ptr %94, i32 0, i32 2
  %96 = load i32, ptr %95, align 4, !tbaa !11
  %97 = sext i32 %96 to i64
  %98 = load i64, ptr %3, align 8, !tbaa !9
  %99 = sub nsw i64 %98, %97
  store i64 %99, ptr %3, align 8, !tbaa !9
  br label %100

100:                                              ; preds = %77
  %101 = load i32, ptr %7, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %7, align 4, !tbaa !5
  br label %56, !llvm.loop !15

103:                                              ; preds = %75
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %104 = load i64, ptr %2, align 8, !tbaa !9
  %105 = load i64, ptr %3, align 8, !tbaa !9
  %106 = mul nsw i64 %104, %105
  store i64 %106, ptr %8, align 8, !tbaa !9
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %108 = load i64, ptr %107, align 8, !tbaa !9
  store i64 %108, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  %109 = load i32, ptr %6, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [100003 x i32], ptr @ord, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [50001 x %struct.Point], ptr @p, i64 0, i64 %113
  %115 = getelementptr inbounds %struct.Point, ptr %114, i32 0, i32 2
  %116 = load i32, ptr %115, align 4, !tbaa !11
  %117 = sext i32 %116 to i64
  %118 = load i64, ptr %2, align 8, !tbaa !9
  %119 = sub nsw i64 %118, %117
  store i64 %119, ptr %2, align 8, !tbaa !9
  %120 = load i32, ptr %6, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [100003 x i32], ptr @ord, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [50001 x %struct.Point], ptr @p, i64 0, i64 %124
  %126 = getelementptr inbounds %struct.Point, ptr %125, i32 0, i32 2
  %127 = load i32, ptr %126, align 4, !tbaa !11
  %128 = sext i32 %127 to i64
  %129 = load i64, ptr %3, align 8, !tbaa !9
  %130 = add nsw i64 %129, %128
  store i64 %130, ptr %3, align 8, !tbaa !9
  br label %131

131:                                              ; preds = %103
  %132 = load i32, ptr %6, align 4, !tbaa !5
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %6, align 4, !tbaa !5
  br label %50, !llvm.loop !16

134:                                              ; preds = %54
  %135 = load i64, ptr %4, align 8, !tbaa !9
  %136 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %135)
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %10, !llvm.loop !17

137:                                              ; preds = %10
  ret i32 0
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Point4readEv(ptr noundef nonnull align 4 dereferenceable(12)) #3 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiPFiRKiS2_EEvT_S5_T0_(ptr noundef, ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z9polar_cmpRKiS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z5checkRK5PointS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #4

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

declare i32 @printf(ptr noundef, ...) #1

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


; 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 { i32, i32, i32 }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@ord = external dso_local global [100003 x i32], align 16
@p = external dso_local global [50001 x %struct.Point], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %4 = load i32, ptr @t, align 4, !tbaa !5
  %5 = add nsw i32 %4, -1
  store i32 %5, ptr @t, align 4, !tbaa !5
  %.not49 = icmp eq i32 %4, 0
  br i1 %.not49, label %._crit_edge52, label %.lr.ph51

.lr.ph51:                                         ; preds = %0, %._crit_edge48
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  store i64 0, ptr %1, align 8, !tbaa !9
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph, label %.lr.ph51.._crit_edge_crit_edge

.lr.ph51.._crit_edge_crit_edge:                   ; preds = %.lr.ph51
  %.pre63 = sext i32 %7 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph51.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre63, %.lr.ph51.._crit_edge_crit_edge ], [ %23, %.lr.ph ]
  %.025.lcssa = phi i64 [ 0, %.lr.ph51.._crit_edge_crit_edge ], [ %21, %.lr.ph ]
  %9 = getelementptr inbounds i32, ptr @ord, i64 %.pre-phi
  call void @_ZSt4sortIPiPFiRKiS2_EEvT_S5_T0_(ptr noundef nonnull @ord, ptr noundef nonnull %9, ptr noundef nonnull @_Z9polar_cmpRKiS0_)
  %10 = load i32, ptr @n, align 4, !tbaa !5
  %11 = sext i32 %10 to i64
  %12 = getelementptr inbounds i32, ptr @ord, i64 %11
  %13 = shl nsw i64 %11, 2
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 %12, ptr nonnull align 16 @ord, i64 %13, i1 false)
  %14 = icmp sgt i32 %10, 0
  br i1 %14, label %.preheader, label %._crit_edge.._crit_edge48_crit_edge

._crit_edge.._crit_edge48_crit_edge:              ; preds = %._crit_edge
  %.pre = load i64, ptr %1, align 8, !tbaa !9
  br label %._crit_edge48

.lr.ph:                                           ; preds = %.lr.ph51, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph51 ]
  %.02530 = phi i64 [ %21, %.lr.ph ], [ 0, %.lr.ph51 ]
  %15 = getelementptr inbounds [50001 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv
  call void @_ZN5Point4readEv(ptr noundef nonnull align 4 dereferenceable(12) %15)
  %16 = getelementptr inbounds [100003 x i32], ptr @ord, i64 0, i64 %indvars.iv
  %17 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %17, ptr %16, align 4, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %15, i64 8
  %19 = load i32, ptr %18, align 4, !tbaa !11
  %20 = sext i32 %19 to i64
  %21 = add nsw i64 %.02530, %20
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %22 = load i32, ptr @n, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = icmp slt i64 %indvars.iv.next, %23
  br i1 %24, label %.lr.ph, label %._crit_edge, !llvm.loop !13

.preheader:                                       ; preds = %._crit_edge, %.critedge
  %25 = phi i32 [ %66, %.critedge ], [ %10, %._crit_edge ]
  %indvars.iv59 = phi i64 [ %indvars.iv.next60, %.critedge ], [ 0, %._crit_edge ]
  %.047 = phi i32 [ %.1.lcssa, %.critedge ], [ 0, %._crit_edge ]
  %.12645 = phi i64 [ %65, %.critedge ], [ %.025.lcssa, %._crit_edge ]
  %.02744 = phi i64 [ %64, %.critedge ], [ 0, %._crit_edge ]
  %26 = shl i32 %25, 1
  %27 = icmp slt i32 %.047, %26
  br i1 %27, label %.lr.ph36, label %.critedge

.lr.ph36:                                         ; preds = %.preheader
  %28 = getelementptr inbounds [100003 x i32], ptr @ord, i64 0, i64 %indvars.iv59
  %29 = sext i32 %.047 to i64
  br label %34

._crit_edge48:                                    ; preds = %.critedge, %._crit_edge.._crit_edge48_crit_edge
  %30 = phi i64 [ %.pre, %._crit_edge.._crit_edge48_crit_edge ], [ %57, %.critedge ]
  %31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %30)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  %32 = load i32, ptr @t, align 4, !tbaa !5
  %33 = add nsw i32 %32, -1
  store i32 %33, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %32, 0
  br i1 %.not, label %._crit_edge52, label %.lr.ph51, !llvm.loop !15

34:                                               ; preds = %.lr.ph36, %43
  %indvars.iv56 = phi i64 [ %29, %.lr.ph36 ], [ %indvars.iv.next57, %43 ]
  %.234 = phi i64 [ %.12645, %.lr.ph36 ], [ %50, %43 ]
  %.12833 = phi i64 [ %.02744, %.lr.ph36 ], [ %49, %43 ]
  %35 = load i32, ptr %28, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [50001 x %struct.Point], ptr @p, i64 0, i64 %36
  %38 = getelementptr inbounds [100003 x i32], ptr @ord, i64 0, i64 %indvars.iv56
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [50001 x %struct.Point], ptr @p, i64 0, i64 %40
  %42 = call noundef zeroext i1 @_Z5checkRK5PointS1_(ptr noundef nonnull align 4 dereferenceable(12) %37, ptr noundef nonnull align 4 dereferenceable(12) %41)
  br i1 %42, label %43, label %.critedge.loopexit

43:                                               ; preds = %34
  %44 = load i32, ptr %38, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [50001 x %struct.Point], ptr @p, i64 0, i64 %45, i32 2
  %47 = load i32, ptr %46, align 4, !tbaa !11
  %48 = sext i32 %47 to i64
  %49 = add nsw i64 %.12833, %48
  %50 = sub nsw i64 %.234, %48
  %indvars.iv.next57 = add nsw i64 %indvars.iv56, 1
  %51 = load i32, ptr @n, align 4, !tbaa !5
  %52 = shl i32 %51, 1
  %53 = sext i32 %52 to i64
  %54 = icmp slt i64 %indvars.iv.next57, %53
  br i1 %54, label %34, label %.critedge.loopexit, !llvm.loop !16

.critedge.loopexit:                               ; preds = %43, %34
  %.128.lcssa.ph = phi i64 [ %.12833, %34 ], [ %49, %43 ]
  %.2.lcssa.ph = phi i64 [ %.234, %34 ], [ %50, %43 ]
  %.1.lcssa.ph.in = phi i64 [ %indvars.iv56, %34 ], [ %indvars.iv.next57, %43 ]
  %.1.lcssa.ph = trunc i64 %.1.lcssa.ph.in to i32
  br label %.critedge

.critedge:                                        ; preds = %.critedge.loopexit, %.preheader
  %.128.lcssa = phi i64 [ %.02744, %.preheader ], [ %.128.lcssa.ph, %.critedge.loopexit ]
  %.2.lcssa = phi i64 [ %.12645, %.preheader ], [ %.2.lcssa.ph, %.critedge.loopexit ]
  %.1.lcssa = phi i32 [ %.047, %.preheader ], [ %.1.lcssa.ph, %.critedge.loopexit ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %55 = mul nsw i64 %.2.lcssa, %.128.lcssa
  store i64 %55, ptr %2, align 8, !tbaa !9
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %57 = load i64, ptr %56, align 8, !tbaa !9
  store i64 %57, ptr %1, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  %58 = getelementptr inbounds [100003 x i32], ptr @ord, i64 0, i64 %indvars.iv59
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [50001 x %struct.Point], ptr @p, i64 0, i64 %60, i32 2
  %62 = load i32, ptr %61, align 4, !tbaa !11
  %63 = sext i32 %62 to i64
  %64 = sub nsw i64 %.128.lcssa, %63
  %65 = add nsw i64 %.2.lcssa, %63
  %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
  %66 = load i32, ptr @n, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = icmp slt i64 %indvars.iv.next60, %67
  br i1 %68, label %.preheader, label %._crit_edge48, !llvm.loop !17

._crit_edge52:                                    ; preds = %._crit_edge48, %0
  ret i32 0
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Point4readEv(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #3 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiPFiRKiS2_EEvT_S5_T0_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z9polar_cmpRKiS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z5checkRK5PointS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #4

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

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


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