; LLVM IR from tangjz/acm-icpc :: 51nod (1110)

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

@n = external dso_local global i32, align 4
@s = external dso_local global [10010 x i32], align 16
@p = external dso_local global [10010 x %"struct.std::pair"], 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 [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 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 i64, align 8
  %7 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %9

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

13:                                               ; preds = %9
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %27

14:                                               ; preds = %9
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [10010 x %"struct.std::pair"], ptr @p, i64 0, i64 %16
  %18 = getelementptr inbounds %"struct.std::pair", ptr %17, i32 0, i32 0
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [10010 x %"struct.std::pair"], ptr @p, i64 0, i64 %20
  %22 = getelementptr inbounds %"struct.std::pair", ptr %21, i32 0, i32 1
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %18, ptr noundef %22)
  br label %24

24:                                               ; preds = %14
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr %2, align 4, !tbaa !5
  br label %9, !llvm.loop !9

27:                                               ; preds = %13
  %28 = load i32, ptr @n, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds %"struct.std::pair", ptr @p, i64 %29
  call void @_ZSt4sortIPSt4pairIiiEEvT_S3_(ptr noundef @p, ptr noundef %30)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %57, %27
  %32 = load i32, ptr %3, align 4, !tbaa !5
  %33 = load i32, ptr @n, align 4, !tbaa !5
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %60

36:                                               ; preds = %31
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = icmp ne i32 %37, 0
  br i1 %38, label %39, label %45

39:                                               ; preds = %36
  %40 = load i32, ptr %3, align 4, !tbaa !5
  %41 = sub nsw i32 %40, 1
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [10010 x i32], ptr @s, i64 0, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !5
  br label %46

45:                                               ; preds = %36
  br label %46

46:                                               ; preds = %45, %39
  %47 = phi i32 [ %44, %39 ], [ 0, %45 ]
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [10010 x %"struct.std::pair"], ptr @p, i64 0, i64 %49
  %51 = getelementptr inbounds %"struct.std::pair", ptr %50, i32 0, i32 1
  %52 = load i32, ptr %51, align 4, !tbaa !11
  %53 = add nsw i32 %47, %52
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [10010 x i32], ptr @s, i64 0, i64 %55
  store i32 %53, ptr %56, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %46
  %58 = load i32, ptr %3, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %3, align 4, !tbaa !5
  br label %31, !llvm.loop !13

60:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %61 = load i32, ptr @n, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds i32, ptr @s, i64 %62
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %64 = load i32, ptr @n, align 4, !tbaa !5
  %65 = sub nsw i32 %64, 1
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [10010 x i32], ptr @s, i64 0, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = ashr i32 %68, 1
  store i32 %69, ptr %5, align 4, !tbaa !5
  %70 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef @s, ptr noundef %63, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %71 = ptrtoint ptr %70 to i64
  %72 = sub i64 %71, ptrtoint (ptr @s to i64)
  %73 = sdiv exact i64 %72, 4
  %74 = trunc i64 %73 to i32
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  store i32 %74, ptr %4, align 4, !tbaa !5
  %75 = load i32, ptr %4, align 4, !tbaa !5
  %76 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %75)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  store i64 0, ptr %6, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %105, %60
  %78 = load i32, ptr %7, align 4, !tbaa !5
  %79 = load i32, ptr @n, align 4, !tbaa !5
  %80 = icmp slt i32 %78, %79
  br i1 %80, label %82, label %81

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

82:                                               ; preds = %77
  %83 = load i32, ptr %7, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [10010 x %"struct.std::pair"], ptr @p, i64 0, i64 %84
  %86 = getelementptr inbounds %"struct.std::pair", ptr %85, i32 0, i32 0
  %87 = load i32, ptr %86, align 8, !tbaa !16
  %88 = load i32, ptr %4, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [10010 x %"struct.std::pair"], ptr @p, i64 0, i64 %89
  %91 = getelementptr inbounds %"struct.std::pair", ptr %90, i32 0, i32 0
  %92 = load i32, ptr %91, align 8, !tbaa !16
  %93 = sub nsw i32 %87, %92
  %94 = call i32 @llvm.abs.i32(i32 %93, i1 true)
  %95 = sext i32 %94 to i64
  %96 = load i32, ptr %7, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [10010 x %"struct.std::pair"], ptr @p, i64 0, i64 %97
  %99 = getelementptr inbounds %"struct.std::pair", ptr %98, i32 0, i32 1
  %100 = load i32, ptr %99, align 4, !tbaa !11
  %101 = sext i32 %100 to i64
  %102 = mul nsw i64 %95, %101
  %103 = load i64, ptr %6, align 8, !tbaa !14
  %104 = add nsw i64 %103, %102
  store i64 %104, ptr %6, align 8, !tbaa !14
  br label %105

105:                                              ; preds = %82
  %106 = load i32, ptr %7, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %7, align 4, !tbaa !5
  br label %77, !llvm.loop !17

108:                                              ; preds = %81
  %109 = load i64, ptr %6, align 8, !tbaa !14
  %110 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i64 noundef %109)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  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: 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 @_ZSt4sortIPSt4pairIiiEEvT_S3_(ptr noundef, ptr noundef) #3

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4

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 = { 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!12, !6, i64 4}
!12 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!13 = distinct !{!13, !10}
!14 = !{!15, !15, i64 0}
!15 = !{!"long long", !7, i64 0}
!16 = !{!12, !6, i64 0}
!17 = distinct !{!17, !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.std::pair" = type { i32, i32 }

@n = external dso_local global i32, align 4
@s = external dso_local global [10010 x i32], align 16
@p = external dso_local global [10010 x %"struct.std::pair"], 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 [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1

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

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre = sext i32 %3 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.._crit_edge_crit_edge ], [ %17, %.lr.ph ]
  %5 = getelementptr inbounds %"struct.std::pair", ptr @p, i64 %.pre-phi
  tail call void @_ZSt4sortIPSt4pairIiiEEvT_S3_(ptr noundef nonnull @p, ptr noundef nonnull %5)
  %6 = load i32, ptr @n, align 4, !tbaa !5
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %8, label %._crit_edge28

8:                                                ; preds = %._crit_edge
  %9 = load i32, ptr getelementptr inbounds (i8, ptr @p, i64 4), align 4, !tbaa !9
  store i32 %9, ptr @s, align 16, !tbaa !5
  %exitcond.peel.not = icmp eq i32 %6, 1
  br i1 %exitcond.peel.not, label %._crit_edge28, label %.lr.ph27.peel.next.preheader

.lr.ph27.peel.next.preheader:                     ; preds = %8
  %wide.trip.count = zext nneg i32 %6 to i64
  %10 = add nsw i64 %wide.trip.count, -1
  %11 = add nsw i64 %wide.trip.count, -2
  %xtraiter = and i64 %10, 3
  %12 = icmp ult i64 %11, 3
  br i1 %12, label %._crit_edge28.loopexit.unr-lcssa, label %.lr.ph27.peel.next.preheader.new

.lr.ph27.peel.next.preheader.new:                 ; preds = %.lr.ph27.peel.next.preheader
  %unroll_iter = and i64 %10, -4
  br label %.lr.ph27.peel.next

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %13 = getelementptr inbounds [10010 x %"struct.std::pair"], ptr @p, i64 0, i64 %indvars.iv
  %14 = getelementptr inbounds i8, ptr %13, i64 4
  %15 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %13, ptr noundef nonnull %14)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = icmp slt i64 %indvars.iv.next, %17
  br i1 %18, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge28.loopexit.unr-lcssa:                 ; preds = %.lr.ph27.peel.next, %.lr.ph27.peel.next.preheader
  %.unr = phi i32 [ %9, %.lr.ph27.peel.next.preheader ], [ %58, %.lr.ph27.peel.next ]
  %indvars.iv38.unr = phi i64 [ 1, %.lr.ph27.peel.next.preheader ], [ %indvars.iv.next39.3, %.lr.ph27.peel.next ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge28, label %.lr.ph27.peel.next.epil

.lr.ph27.peel.next.epil:                          ; preds = %._crit_edge28.loopexit.unr-lcssa, %.lr.ph27.peel.next.epil
  %19 = phi i32 [ %22, %.lr.ph27.peel.next.epil ], [ %.unr, %._crit_edge28.loopexit.unr-lcssa ]
  %indvars.iv38.epil = phi i64 [ %indvars.iv.next39.epil, %.lr.ph27.peel.next.epil ], [ %indvars.iv38.unr, %._crit_edge28.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph27.peel.next.epil ], [ 0, %._crit_edge28.loopexit.unr-lcssa ]
  %20 = getelementptr inbounds [10010 x %"struct.std::pair"], ptr @p, i64 0, i64 %indvars.iv38.epil, i32 1
  %21 = load i32, ptr %20, align 4, !tbaa !9
  %22 = add nsw i32 %21, %19
  %23 = getelementptr inbounds [10010 x i32], ptr @s, i64 0, i64 %indvars.iv38.epil
  store i32 %22, ptr %23, align 4, !tbaa !5
  %indvars.iv.next39.epil = add nuw nsw i64 %indvars.iv38.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge28, label %.lr.ph27.peel.next.epil, !llvm.loop !13

._crit_edge28:                                    ; preds = %._crit_edge28.loopexit.unr-lcssa, %.lr.ph27.peel.next.epil, %8, %._crit_edge
  %24 = sext i32 %6 to i64
  %25 = getelementptr inbounds i32, ptr @s, i64 %24
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %26 = add nsw i32 %6, -1
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [10010 x i32], ptr @s, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = ashr i32 %29, 1
  store i32 %30, ptr %1, align 4, !tbaa !5
  %31 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef nonnull @s, ptr noundef nonnull %25, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %32 = ptrtoint ptr %31 to i64
  %33 = sub i64 %32, ptrtoint (ptr @s to i64)
  %34 = lshr exact i64 %33, 2
  %35 = trunc i64 %34 to i32
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  %36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %35)
  %37 = load i32, ptr @n, align 4, !tbaa !5
  %38 = icmp sgt i32 %37, 0
  br i1 %38, label %.lr.ph33, label %._crit_edge34

.lr.ph33:                                         ; preds = %._crit_edge28
  %sext = shl i64 %33, 30
  %39 = ashr i64 %sext, 32
  %40 = getelementptr inbounds [10010 x %"struct.std::pair"], ptr @p, i64 0, i64 %39
  %41 = load i32, ptr %40, align 8, !tbaa !15
  %wide.trip.count45 = zext nneg i32 %37 to i64
  %xtraiter50 = and i64 %wide.trip.count45, 1
  %42 = icmp eq i32 %37, 1
  br i1 %42, label %._crit_edge34.loopexit.unr-lcssa, label %.lr.ph33.new

.lr.ph33.new:                                     ; preds = %.lr.ph33
  %unroll_iter54 = and i64 %wide.trip.count45, 2147483646
  br label %71

.lr.ph27.peel.next:                               ; preds = %.lr.ph27.peel.next, %.lr.ph27.peel.next.preheader.new
  %43 = phi i32 [ %9, %.lr.ph27.peel.next.preheader.new ], [ %58, %.lr.ph27.peel.next ]
  %indvars.iv38 = phi i64 [ 1, %.lr.ph27.peel.next.preheader.new ], [ %indvars.iv.next39.3, %.lr.ph27.peel.next ]
  %niter = phi i64 [ 0, %.lr.ph27.peel.next.preheader.new ], [ %niter.next.3, %.lr.ph27.peel.next ]
  %44 = getelementptr inbounds [10010 x %"struct.std::pair"], ptr @p, i64 0, i64 %indvars.iv38, i32 1
  %45 = load i32, ptr %44, align 4, !tbaa !9
  %46 = add nsw i32 %45, %43
  %47 = getelementptr inbounds [10010 x i32], ptr @s, i64 0, i64 %indvars.iv38
  store i32 %46, ptr %47, align 4, !tbaa !5
  %indvars.iv.next39 = add nuw nsw i64 %indvars.iv38, 1
  %48 = getelementptr inbounds [10010 x %"struct.std::pair"], ptr @p, i64 0, i64 %indvars.iv.next39, i32 1
  %49 = load i32, ptr %48, align 4, !tbaa !9
  %50 = add nsw i32 %49, %46
  %51 = getelementptr inbounds [10010 x i32], ptr @s, i64 0, i64 %indvars.iv.next39
  store i32 %50, ptr %51, align 4, !tbaa !5
  %indvars.iv.next39.1 = add nuw nsw i64 %indvars.iv38, 2
  %52 = getelementptr inbounds [10010 x %"struct.std::pair"], ptr @p, i64 0, i64 %indvars.iv.next39.1, i32 1
  %53 = load i32, ptr %52, align 4, !tbaa !9
  %54 = add nsw i32 %53, %50
  %55 = getelementptr inbounds [10010 x i32], ptr @s, i64 0, i64 %indvars.iv.next39.1
  store i32 %54, ptr %55, align 4, !tbaa !5
  %indvars.iv.next39.2 = add nuw nsw i64 %indvars.iv38, 3
  %56 = getelementptr inbounds [10010 x %"struct.std::pair"], ptr @p, i64 0, i64 %indvars.iv.next39.2, i32 1
  %57 = load i32, ptr %56, align 4, !tbaa !9
  %58 = add nsw i32 %57, %54
  %59 = getelementptr inbounds [10010 x i32], ptr @s, i64 0, i64 %indvars.iv.next39.2
  store i32 %58, ptr %59, align 4, !tbaa !5
  %indvars.iv.next39.3 = add nuw nsw i64 %indvars.iv38, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge28.loopexit.unr-lcssa, label %.lr.ph27.peel.next, !llvm.loop !16

._crit_edge34.loopexit.unr-lcssa:                 ; preds = %71, %.lr.ph33
  %.lcssa.ph = phi i64 [ poison, %.lr.ph33 ], [ %91, %71 ]
  %indvars.iv42.unr = phi i64 [ 0, %.lr.ph33 ], [ %indvars.iv.next43.1, %71 ]
  %.01830.unr = phi i64 [ 0, %.lr.ph33 ], [ %91, %71 ]
  %lcmp.mod52.not = icmp eq i64 %xtraiter50, 0
  br i1 %lcmp.mod52.not, label %._crit_edge34, label %._crit_edge34.loopexit.epilog-lcssa

._crit_edge34.loopexit.epilog-lcssa:              ; preds = %._crit_edge34.loopexit.unr-lcssa
  %60 = getelementptr inbounds [10010 x %"struct.std::pair"], ptr @p, i64 0, i64 %indvars.iv42.unr
  %61 = load i32, ptr %60, align 8, !tbaa !15
  %62 = sub nsw i32 %61, %41
  %63 = call i32 @llvm.abs.i32(i32 %62, i1 true)
  %64 = zext nneg i32 %63 to i64
  %65 = getelementptr inbounds i8, ptr %60, i64 4
  %66 = load i32, ptr %65, align 4, !tbaa !9
  %67 = sext i32 %66 to i64
  %68 = mul nsw i64 %64, %67
  %69 = add nsw i64 %68, %.01830.unr
  br label %._crit_edge34

._crit_edge34:                                    ; preds = %._crit_edge34.loopexit.epilog-lcssa, %._crit_edge34.loopexit.unr-lcssa, %._crit_edge28
  %.018.lcssa = phi i64 [ 0, %._crit_edge28 ], [ %.lcssa.ph, %._crit_edge34.loopexit.unr-lcssa ], [ %69, %._crit_edge34.loopexit.epilog-lcssa ]
  %70 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %.018.lcssa)
  ret i32 0

71:                                               ; preds = %71, %.lr.ph33.new
  %indvars.iv42 = phi i64 [ 0, %.lr.ph33.new ], [ %indvars.iv.next43.1, %71 ]
  %.01830 = phi i64 [ 0, %.lr.ph33.new ], [ %91, %71 ]
  %niter55 = phi i64 [ 0, %.lr.ph33.new ], [ %niter55.next.1, %71 ]
  %72 = getelementptr inbounds [10010 x %"struct.std::pair"], ptr @p, i64 0, i64 %indvars.iv42
  %73 = load i32, ptr %72, align 16, !tbaa !15
  %74 = sub nsw i32 %73, %41
  %75 = call i32 @llvm.abs.i32(i32 %74, i1 true)
  %76 = zext nneg i32 %75 to i64
  %77 = getelementptr inbounds i8, ptr %72, i64 4
  %78 = load i32, ptr %77, align 4, !tbaa !9
  %79 = sext i32 %78 to i64
  %80 = mul nsw i64 %76, %79
  %81 = add nsw i64 %80, %.01830
  %indvars.iv.next43 = or disjoint i64 %indvars.iv42, 1
  %82 = getelementptr inbounds [10010 x %"struct.std::pair"], ptr @p, i64 0, i64 %indvars.iv.next43
  %83 = load i32, ptr %82, align 8, !tbaa !15
  %84 = sub nsw i32 %83, %41
  %85 = call i32 @llvm.abs.i32(i32 %84, i1 true)
  %86 = zext nneg i32 %85 to i64
  %87 = getelementptr inbounds i8, ptr %82, i64 4
  %88 = load i32, ptr %87, align 4, !tbaa !9
  %89 = sext i32 %88 to i64
  %90 = mul nsw i64 %86, %89
  %91 = add nsw i64 %90, %81
  %indvars.iv.next43.1 = add nuw nsw i64 %indvars.iv42, 2
  %niter55.next.1 = add i64 %niter55, 2
  %niter55.ncmp.1 = icmp eq i64 %niter55.next.1, %unroll_iter54
  br i1 %niter55.ncmp.1, label %._crit_edge34.loopexit.unr-lcssa, label %71, !llvm.loop !18
}

; 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 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 @_ZSt4sortIPSt4pairIiiEEvT_S3_(ptr noundef, ptr noundef) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4

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 = { 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 #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!10, !6, i64 4}
!10 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = !{!10, !6, i64 0}
!16 = distinct !{!16, !12, !17}
!17 = !{!"llvm.loop.peeled.count", i32 1}
!18 = distinct !{!18, !12}


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