; LLVM IR from tangjz/acm-icpc :: codeforces/gym (101201L)

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

@n = external dso_local global i32, align 4
@ord = external dso_local global [51 x i32], align 16
@buf = external dso_local global [51 x i8], align 16
@p = external dso_local global [51 x %struct.Point], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %struct.Point, align 4
  %7 = alloca %struct.Point, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  store i32 1, ptr %3, align 4, !tbaa !5
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %9

9:                                                ; preds = %37, %0
  %10 = load i32, ptr %2, align 4, !tbaa !5
  %11 = load i32, ptr @n, align 4, !tbaa !5
  %12 = icmp sle i32 %10, %11
  br i1 %12, label %13, label %40

13:                                               ; preds = %9
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [51 x %struct.Point], ptr @p, i64 0, i64 %15
  %17 = getelementptr inbounds %struct.Point, ptr %16, i32 0, i32 0
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [51 x %struct.Point], ptr @p, i64 0, i64 %19
  %21 = getelementptr inbounds %struct.Point, ptr %20, i32 0, i32 1
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %17, ptr noundef %21)
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [51 x i32], ptr @ord, i64 0, i64 %25
  store i32 %23, ptr %26, align 4, !tbaa !5
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [51 x %struct.Point], ptr @p, i64 0, i64 %28
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [51 x %struct.Point], ptr @p, i64 0, i64 %31
  %33 = call noundef zeroext i1 @_ZNK5PointltERKS_(ptr noundef nonnull align 4 dereferenceable(8) %29, ptr noundef nonnull align 4 dereferenceable(8) %32)
  br i1 %33, label %34, label %36

34:                                               ; preds = %13
  %35 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %35, ptr %3, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %34, %13
  br label %37

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

40:                                               ; preds = %9
  %41 = load i32, ptr %3, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [51 x i32], ptr @ord, i64 0, i64 %42
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds ([51 x i32], ptr @ord, i64 0, i64 1), ptr noundef nonnull align 4 dereferenceable(4) %43) #5
  %44 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef @buf)
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %110, %40
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = load i32, ptr @n, align 4, !tbaa !5
  %48 = icmp slt i32 %46, %47
  br i1 %48, label %49, label %113

49:                                               ; preds = %45
  %50 = load i32, ptr %2, align 4, !tbaa !5
  %51 = sub nsw i32 %50, 2
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [51 x i8], ptr @buf, i64 0, i64 %52
  %54 = load i8, ptr %53, align 1, !tbaa !11
  %55 = sext i8 %54 to i32
  %56 = icmp eq i32 %55, 76
  %57 = zext i1 %56 to i64
  %58 = select i1 %56, i32 1, i32 -1
  store i32 %58, ptr %5, align 4, !tbaa !5
  %59 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %59, ptr %4, align 4, !tbaa !5
  store i32 %59, ptr %3, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %100, %49
  %61 = load i32, ptr %3, align 4, !tbaa !5
  %62 = load i32, ptr @n, align 4, !tbaa !5
  %63 = icmp sle i32 %61, %62
  br i1 %63, label %64, label %103

64:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %65 = load i32, ptr %4, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [51 x i32], ptr @ord, i64 0, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [51 x %struct.Point], ptr @p, i64 0, i64 %69
  %71 = load i32, ptr %2, align 4, !tbaa !5
  %72 = sub nsw i32 %71, 1
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [51 x i32], ptr @ord, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [51 x %struct.Point], ptr @p, i64 0, i64 %76
  %78 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) %70, ptr noundef nonnull align 4 dereferenceable(8) %77)
  store i64 %78, ptr %6, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %79 = load i32, ptr %3, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [51 x i32], ptr @ord, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [51 x %struct.Point], ptr @p, i64 0, i64 %83
  %85 = load i32, ptr %2, align 4, !tbaa !5
  %86 = sub nsw i32 %85, 1
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [51 x i32], ptr @ord, i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [51 x %struct.Point], ptr @p, i64 0, i64 %90
  %92 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) %84, ptr noundef nonnull align 4 dereferenceable(8) %91)
  store i64 %92, ptr %7, align 4
  %93 = call noundef i32 @_ZNK5Point3detERKS_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(8) %7)
  %94 = load i32, ptr %5, align 4, !tbaa !5
  %95 = mul nsw i32 %93, %94
  %96 = icmp slt i32 %95, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br i1 %96, label %97, label %99

97:                                               ; preds = %64
  %98 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %98, ptr %4, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %97, %64
  br label %100

100:                                              ; preds = %99
  %101 = load i32, ptr %3, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %3, align 4, !tbaa !5
  br label %60, !llvm.loop !12

103:                                              ; preds = %60
  %104 = load i32, ptr %2, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [51 x i32], ptr @ord, i64 0, i64 %105
  %107 = load i32, ptr %4, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [51 x i32], ptr @ord, i64 0, i64 %108
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %106, ptr noundef nonnull align 4 dereferenceable(4) %109) #5
  br label %110

110:                                              ; preds = %103
  %111 = load i32, ptr %2, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %2, align 4, !tbaa !5
  br label %45, !llvm.loop !13

113:                                              ; preds = %45
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %114

114:                                              ; preds = %131, %113
  %115 = load i32, ptr %2, align 4, !tbaa !5
  %116 = load i32, ptr @n, align 4, !tbaa !5
  %117 = icmp sle i32 %115, %116
  br i1 %117, label %118, label %134

118:                                              ; preds = %114
  %119 = load i32, ptr %2, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [51 x i32], ptr @ord, i64 0, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = load i32, ptr %2, align 4, !tbaa !5
  %124 = load i32, ptr @n, align 4, !tbaa !5
  %125 = icmp eq i32 %123, %124
  %126 = zext i1 %125 to i64
  %127 = getelementptr inbounds [3 x i8], ptr @.str.4, i64 0, i64 %126
  %128 = load i8, ptr %127, align 1, !tbaa !11
  %129 = sext i8 %128 to i32
  %130 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %122, i32 noundef %129)
  br label %131

131:                                              ; preds = %118
  %132 = load i32, ptr %2, align 4, !tbaa !5
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %2, align 4, !tbaa !5
  br label %114, !llvm.loop !14

134:                                              ; preds = %114
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  ret i32 0
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK5PointltERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK5Point3detERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

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

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


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

@n = external dso_local global i32, align 4
@ord = external dso_local global [51 x i32], align 16
@buf = external dso_local global [51 x i8], align 16
@p = external dso_local global [51 x %struct.Point], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca %struct.Point, align 8
  %2 = alloca %struct.Point, align 8
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %4 = load i32, ptr @n, align 4, !tbaa !5
  %.not37 = icmp slt i32 %4, 1
  br i1 %.not37, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %.03038 = phi i32 [ %spec.select, %.lr.ph ], [ 1, %0 ]
  %5 = getelementptr inbounds [51 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv
  %6 = getelementptr inbounds i8, ptr %5, i64 4
  %7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %5, ptr noundef nonnull %6)
  %8 = getelementptr inbounds [51 x i32], ptr @ord, i64 0, i64 %indvars.iv
  %9 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %9, ptr %8, align 4, !tbaa !5
  %10 = sext i32 %.03038 to i64
  %11 = getelementptr inbounds [51 x %struct.Point], ptr @p, i64 0, i64 %10
  %12 = tail call noundef zeroext i1 @_ZNK5PointltERKS_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(8) %11)
  %spec.select = select i1 %12, i32 %9, i32 %.03038
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %13 = load i32, ptr @n, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %.not.not = icmp slt i64 %indvars.iv, %14
  br i1 %.not.not, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !9

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %15 = sext i32 %spec.select to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %0
  %.030.lcssa = phi i64 [ 1, %0 ], [ %15, %._crit_edge.loopexit ]
  %16 = getelementptr inbounds [51 x i32], ptr @ord, i64 0, i64 %.030.lcssa
  tail call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @ord, i64 4), ptr noundef nonnull align 4 dereferenceable(4) %16) #5
  %17 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @buf)
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = icmp sgt i32 %18, 2
  br i1 %19, label %.lr.ph50, label %.preheader

.preheader:                                       ; preds = %._crit_edge45, %._crit_edge
  %20 = phi i32 [ %18, %._crit_edge ], [ %77, %._crit_edge45 ]
  %.not3451 = icmp slt i32 %20, 1
  br i1 %.not3451, label %._crit_edge54, label %.lr.ph53

.lr.ph50:                                         ; preds = %._crit_edge, %._crit_edge45
  %21 = phi i32 [ %77, %._crit_edge45 ], [ %18, %._crit_edge ]
  %indvars.iv58 = phi i64 [ %indvars.iv.next59, %._crit_edge45 ], [ 2, %._crit_edge ]
  %22 = sext i32 %21 to i64
  %.not3540 = icmp sgt i64 %indvars.iv58, %22
  %23 = trunc nuw nsw i64 %indvars.iv58 to i32
  br i1 %.not3540, label %._crit_edge45, label %.lr.ph44

.lr.ph44:                                         ; preds = %.lr.ph50
  %24 = add nsw i64 %indvars.iv58, -2
  %25 = getelementptr inbounds [51 x i8], ptr @buf, i64 0, i64 %24
  %26 = load i8, ptr %25, align 1, !tbaa !11
  %.fr55 = freeze i8 %26
  %27 = icmp eq i8 %.fr55, 76
  %28 = add nsw i64 %indvars.iv58, -1
  %29 = getelementptr inbounds [51 x i32], ptr @ord, i64 0, i64 %28
  br i1 %27, label %.lr.ph44.split.us, label %.lr.ph44.split

.lr.ph44.split.us:                                ; preds = %.lr.ph44, %.lr.ph44.split.us
  %indvars.iv63 = phi i64 [ %indvars.iv.next64, %.lr.ph44.split.us ], [ %indvars.iv58, %.lr.ph44 ]
  %.02842.us = phi i32 [ %spec.select36.us, %.lr.ph44.split.us ], [ %23, %.lr.ph44 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  %30 = sext i32 %.02842.us to i64
  %31 = getelementptr inbounds [51 x i32], ptr @ord, i64 0, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [51 x %struct.Point], ptr @p, i64 0, i64 %33
  %35 = load i32, ptr %29, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [51 x %struct.Point], ptr @p, i64 0, i64 %36
  %38 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) %34, ptr noundef nonnull align 4 dereferenceable(8) %37)
  store i64 %38, ptr %1, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %39 = getelementptr inbounds [51 x i32], ptr @ord, i64 0, i64 %indvars.iv63
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [51 x %struct.Point], ptr @p, i64 0, i64 %41
  %43 = load i32, ptr %29, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [51 x %struct.Point], ptr @p, i64 0, i64 %44
  %46 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) %42, ptr noundef nonnull align 4 dereferenceable(8) %45)
  store i64 %46, ptr %2, align 8
  %47 = call noundef i32 @_ZNK5Point3detERKS_(ptr noundef nonnull align 4 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(8) %2)
  %48 = icmp slt i32 %47, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  %49 = trunc nuw nsw i64 %indvars.iv63 to i32
  %spec.select36.us = select i1 %48, i32 %49, i32 %.02842.us
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %50 = load i32, ptr @n, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %.not35.us.not = icmp slt i64 %indvars.iv63, %51
  br i1 %.not35.us.not, label %.lr.ph44.split.us, label %._crit_edge45, !llvm.loop !12

.lr.ph44.split:                                   ; preds = %.lr.ph44, %.lr.ph44.split
  %indvars.iv60 = phi i64 [ %indvars.iv.next61, %.lr.ph44.split ], [ %indvars.iv58, %.lr.ph44 ]
  %.02842 = phi i32 [ %spec.select36, %.lr.ph44.split ], [ %23, %.lr.ph44 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  %52 = sext i32 %.02842 to i64
  %53 = getelementptr inbounds [51 x i32], ptr @ord, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [51 x %struct.Point], ptr @p, i64 0, i64 %55
  %57 = load i32, ptr %29, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [51 x %struct.Point], ptr @p, i64 0, i64 %58
  %60 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) %56, ptr noundef nonnull align 4 dereferenceable(8) %59)
  store i64 %60, ptr %1, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %61 = getelementptr inbounds [51 x i32], ptr @ord, i64 0, i64 %indvars.iv60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [51 x %struct.Point], ptr @p, i64 0, i64 %63
  %65 = load i32, ptr %29, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [51 x %struct.Point], ptr @p, i64 0, i64 %66
  %68 = call i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8) %64, ptr noundef nonnull align 4 dereferenceable(8) %67)
  store i64 %68, ptr %2, align 8
  %69 = call noundef i32 @_ZNK5Point3detERKS_(ptr noundef nonnull align 4 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(8) %2)
  %70 = icmp sgt i32 %69, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  %71 = trunc nuw nsw i64 %indvars.iv60 to i32
  %spec.select36 = select i1 %70, i32 %71, i32 %.02842
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  %72 = load i32, ptr @n, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %.not35.not = icmp slt i64 %indvars.iv60, %73
  br i1 %.not35.not, label %.lr.ph44.split, label %._crit_edge45, !llvm.loop !12

._crit_edge45:                                    ; preds = %.lr.ph44.split, %.lr.ph44.split.us, %.lr.ph50
  %.028.lcssa = phi i32 [ %23, %.lr.ph50 ], [ %spec.select36.us, %.lr.ph44.split.us ], [ %spec.select36, %.lr.ph44.split ]
  %74 = getelementptr inbounds [51 x i32], ptr @ord, i64 0, i64 %indvars.iv58
  %75 = sext i32 %.028.lcssa to i64
  %76 = getelementptr inbounds [51 x i32], ptr @ord, i64 0, i64 %75
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %74, ptr noundef nonnull align 4 dereferenceable(4) %76) #5
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %77 = load i32, ptr @n, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = icmp slt i64 %indvars.iv.next59, %78
  br i1 %79, label %.lr.ph50, label %.preheader, !llvm.loop !13

.lr.ph53:                                         ; preds = %.preheader, %.lr.ph53
  %indvars.iv67 = phi i64 [ %indvars.iv.next68, %.lr.ph53 ], [ 1, %.preheader ]
  %80 = phi i32 [ %90, %.lr.ph53 ], [ %20, %.preheader ]
  %81 = getelementptr inbounds [51 x i32], ptr @ord, i64 0, i64 %indvars.iv67
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = zext i32 %80 to i64
  %84 = icmp eq i64 %indvars.iv67, %83
  %85 = zext i1 %84 to i64
  %86 = getelementptr inbounds [3 x i8], ptr @.str.4, i64 0, i64 %85
  %87 = load i8, ptr %86, align 1, !tbaa !11
  %88 = sext i8 %87 to i32
  %89 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %82, i32 noundef %88)
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %90 = load i32, ptr @n, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %.not34.not = icmp slt i64 %indvars.iv67, %91
  br i1 %.not34.not, label %.lr.ph53, label %._crit_edge54, !llvm.loop !14

._crit_edge54:                                    ; preds = %.lr.ph53, %.preheader
  ret i32 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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK5PointltERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local i64 @_ZNK5PointmiERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK5Point3detERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) 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) #1

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

attributes #0 = { mustprogress norecurse 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 willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { 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 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass