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

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

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

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

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

13:                                               ; preds = %8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [500010 x i8], ptr @s, i64 0, i64 %15
  call void @_ZNSt4pairIciEC2IRcRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS5_S6_EEEbE4typeELb1EEEOS5_OS6_(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 1 dereferenceable(1) %16, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [500010 x %"struct.std::pair"], ptr @p, i64 0, i64 %18
  %20 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIciEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %19, ptr noundef nonnull align 4 dereferenceable(8) %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  br label %21

21:                                               ; preds = %13
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = add nsw i32 %22, 1
  store i32 %23, ptr %2, align 4, !tbaa !5
  br label %8, !llvm.loop !9

24:                                               ; preds = %12
  %25 = load i32, ptr @n, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds %"struct.std::pair", ptr @p, i64 %26
  call void @_ZSt4sortIPSt4pairIciEEvT_S3_(ptr noundef @p, ptr noundef %27)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %28

28:                                               ; preds = %50, %24
  %29 = load i32, ptr %4, align 4, !tbaa !5
  %30 = load i32, ptr @n, align 4, !tbaa !5
  %31 = icmp slt i32 %29, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %53

33:                                               ; preds = %28
  %34 = load i32, ptr %4, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [500010 x %"struct.std::pair"], ptr @p, i64 0, i64 %35
  %37 = getelementptr inbounds %"struct.std::pair", ptr %36, i32 0, i32 0
  %38 = load i8, ptr %37, align 8, !tbaa !11
  %39 = sext i8 %38 to i32
  %40 = load i32, ptr @o, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [500010 x %"struct.std::pair"], ptr @p, i64 0, i64 %41
  %43 = getelementptr inbounds %"struct.std::pair", ptr %42, i32 0, i32 0
  %44 = load i8, ptr %43, align 8, !tbaa !11
  %45 = sext i8 %44 to i32
  %46 = icmp slt i32 %39, %45
  br i1 %46, label %47, label %49

47:                                               ; preds = %33
  %48 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %48, ptr @o, align 4, !tbaa !5
  br label %49

49:                                               ; preds = %47, %33
  br label %50

50:                                               ; preds = %49
  %51 = load i32, ptr %4, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %4, align 4, !tbaa !5
  br label %28, !llvm.loop !13

53:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %79, %53
  %55 = load i32, ptr %5, align 4, !tbaa !5
  %56 = load i32, ptr @n, align 4, !tbaa !5
  %57 = icmp slt i32 %55, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %54
  store i32 8, ptr %6, align 4
  br label %87

59:                                               ; preds = %54
  %60 = load i32, ptr @o, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [500010 x i8], ptr @vis, i64 0, i64 %61
  %63 = load i8, ptr %62, align 1, !tbaa !14, !range !16, !noundef !17
  %64 = trunc i8 %63 to i1
  br i1 %64, label %65, label %67

65:                                               ; preds = %59
  %66 = call i32 @puts(ptr noundef @.str.1)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %6, align 4
  br label %87

67:                                               ; preds = %59
  %68 = load i32, ptr @o, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [500010 x i8], ptr @vis, i64 0, i64 %69
  store i8 1, ptr %70, align 1, !tbaa !14
  %71 = load i32, ptr @o, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [500010 x %"struct.std::pair"], ptr @p, i64 0, i64 %72
  %74 = getelementptr inbounds %"struct.std::pair", ptr %73, i32 0, i32 0
  %75 = load i8, ptr %74, align 8, !tbaa !11
  %76 = load i32, ptr %5, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [500010 x i8], ptr @t, i64 0, i64 %77
  store i8 %75, ptr %78, align 1, !tbaa !18
  br label %79

79:                                               ; preds = %67
  %80 = load i32, ptr %5, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %5, align 4, !tbaa !5
  %82 = load i32, ptr @o, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [500010 x %"struct.std::pair"], ptr @p, i64 0, i64 %83
  %85 = getelementptr inbounds %"struct.std::pair", ptr %84, i32 0, i32 1
  %86 = load i32, ptr %85, align 4, !tbaa !19
  store i32 %86, ptr @o, align 4, !tbaa !5
  br label %54, !llvm.loop !20

87:                                               ; preds = %65, %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  %88 = load i32, ptr %6, align 4
  switch i32 %88, label %93 [
    i32 8, label %89
    i32 1, label %91
  ]

89:                                               ; preds = %87
  %90 = call i32 @puts(ptr noundef @t)
  store i32 0, ptr %1, align 4
  br label %91

91:                                               ; preds = %89, %87
  %92 = load i32, ptr %1, align 4
  ret i32 %92

93:                                               ; preds = %87
  unreachable
}

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 nounwind uwtable
declare dso_local void @_ZNSt4pairIciEC2IRcRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS5_S6_EEEbE4typeELb1EEEOS5_OS6_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #3 align 2

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

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

declare i32 @puts(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 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 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 = !{!12, !7, i64 0}
!12 = !{!"_ZTSSt4pairIciE", !7, i64 0, !6, i64 4}
!13 = distinct !{!13, !10}
!14 = !{!15, !15, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!7, !7, i64 0}
!19 = !{!12, !6, i64 4}
!20 = distinct !{!20, !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 { i8, i32 }

@n = external dso_local global i32, align 4
@o = external dso_local local_unnamed_addr global i32, align 4
@p = external dso_local global [500010 x %"struct.std::pair"], align 16
@s = external dso_local global [500010 x i8], align 16
@t = external dso_local global [500010 x i8], align 16
@vis = external dso_local local_unnamed_addr global [500010 x i8], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [12 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 = alloca %"struct.std::pair", align 4
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @s)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  store i32 0, ptr %1, align 4, !tbaa !5
  %4 = load i32, ptr @n, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.lcssa15 = phi i32 [ %4, %0 ], [ %19, %.lr.ph ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  %6 = sext i32 %.lcssa15 to i64
  %7 = getelementptr inbounds %"struct.std::pair", ptr @p, i64 %6
  call void @_ZSt4sortIPSt4pairIciEEvT_S3_(ptr noundef nonnull @p, ptr noundef nonnull %7)
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph22.preheader, label %._crit_edge27

.lr.ph22.preheader:                               ; preds = %._crit_edge
  %o.promoted = load i32, ptr @o, align 4, !tbaa !5
  %wide.trip.count = zext nneg i32 %8 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %10 = icmp eq i32 %8, 1
  br i1 %10, label %.preheader.unr-lcssa, label %.lr.ph22.preheader.new

.lr.ph22.preheader.new:                           ; preds = %.lr.ph22.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  br label %.lr.ph22

.lr.ph:                                           ; preds = %0, %.lr.ph
  %storemerge16 = phi i32 [ %18, %.lr.ph ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %11 = sext i32 %storemerge16 to i64
  %12 = getelementptr inbounds [500010 x i8], ptr @s, i64 0, i64 %11
  call void @_ZNSt4pairIciEC2IRcRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS5_S6_EEEbE4typeELb1EEEOS5_OS6_(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef nonnull align 1 dereferenceable(1) %12, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %13 = load i32, ptr %1, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds [500010 x %"struct.std::pair"], ptr @p, i64 0, i64 %14
  %16 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIciEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %15, ptr noundef nonnull align 4 dereferenceable(8) %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  %17 = load i32, ptr %1, align 4, !tbaa !5
  %18 = add nsw i32 %17, 1
  store i32 %18, ptr %1, align 4, !tbaa !5
  %19 = load i32, ptr @n, align 4, !tbaa !5
  %20 = icmp slt i32 %18, %19
  br i1 %20, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.preheader.unr-lcssa:                             ; preds = %45, %.lr.ph22.preheader
  %.01017.lcssa.ph = phi i32 [ poison, %.lr.ph22.preheader ], [ %.01017.1, %45 ]
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph22.preheader ], [ %indvars.iv.next.1, %45 ]
  %.0101819.unr = phi i32 [ %o.promoted, %.lr.ph22.preheader ], [ %.01017.1, %45 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader, label %.lr.ph22.epil

.lr.ph22.epil:                                    ; preds = %.preheader.unr-lcssa
  %21 = getelementptr inbounds [500010 x %"struct.std::pair"], ptr @p, i64 0, i64 %indvars.iv.unr
  %22 = load i8, ptr %21, align 8, !tbaa !11
  %23 = sext i32 %.0101819.unr to i64
  %24 = getelementptr inbounds [500010 x %"struct.std::pair"], ptr @p, i64 0, i64 %23
  %25 = load i8, ptr %24, align 8, !tbaa !11
  %26 = icmp slt i8 %22, %25
  br i1 %26, label %27, label %.preheader

27:                                               ; preds = %.lr.ph22.epil
  %28 = trunc nuw nsw i64 %indvars.iv.unr to i32
  store i32 %28, ptr @o, align 4, !tbaa !5
  br label %.preheader

.preheader:                                       ; preds = %.lr.ph22.epil, %27, %.preheader.unr-lcssa
  %.01017.lcssa = phi i32 [ %.01017.lcssa.ph, %.preheader.unr-lcssa ], [ %.0101819.unr, %.lr.ph22.epil ], [ %28, %27 ]
  br i1 %9, label %.lr.ph26.preheader, label %._crit_edge27

.lr.ph26.preheader:                               ; preds = %.preheader
  %wide.trip.count32 = zext nneg i32 %8 to i64
  br label %.lr.ph26

.lr.ph22:                                         ; preds = %45, %.lr.ph22.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph22.preheader.new ], [ %indvars.iv.next.1, %45 ]
  %.0101819 = phi i32 [ %o.promoted, %.lr.ph22.preheader.new ], [ %.01017.1, %45 ]
  %niter = phi i64 [ 0, %.lr.ph22.preheader.new ], [ %niter.next.1, %45 ]
  %29 = getelementptr inbounds [500010 x %"struct.std::pair"], ptr @p, i64 0, i64 %indvars.iv
  %30 = load i8, ptr %29, align 16, !tbaa !11
  %31 = sext i32 %.0101819 to i64
  %32 = getelementptr inbounds [500010 x %"struct.std::pair"], ptr @p, i64 0, i64 %31
  %33 = load i8, ptr %32, align 8, !tbaa !11
  %34 = icmp slt i8 %30, %33
  br i1 %34, label %35, label %.lr.ph22.1

35:                                               ; preds = %.lr.ph22
  %36 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %36, ptr @o, align 4, !tbaa !5
  br label %.lr.ph22.1

.lr.ph22.1:                                       ; preds = %.lr.ph22, %35
  %.01017 = phi i32 [ %.0101819, %.lr.ph22 ], [ %36, %35 ]
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %37 = getelementptr inbounds [500010 x %"struct.std::pair"], ptr @p, i64 0, i64 %indvars.iv.next
  %38 = load i8, ptr %37, align 8, !tbaa !11
  %39 = sext i32 %.01017 to i64
  %40 = getelementptr inbounds [500010 x %"struct.std::pair"], ptr @p, i64 0, i64 %39
  %41 = load i8, ptr %40, align 8, !tbaa !11
  %42 = icmp slt i8 %38, %41
  br i1 %42, label %43, label %45

43:                                               ; preds = %.lr.ph22.1
  %44 = trunc nuw nsw i64 %indvars.iv.next to i32
  store i32 %44, ptr @o, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %43, %.lr.ph22.1
  %.01017.1 = phi i32 [ %.01017, %.lr.ph22.1 ], [ %44, %43 ]
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader.unr-lcssa, label %.lr.ph22, !llvm.loop !13

.lr.ph26:                                         ; preds = %.lr.ph26.preheader, %51
  %indvars.iv29 = phi i64 [ 0, %.lr.ph26.preheader ], [ %indvars.iv.next30, %51 ]
  %46 = phi i32 [ %.01017.lcssa, %.lr.ph26.preheader ], [ %56, %51 ]
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [500010 x i8], ptr @vis, i64 0, i64 %47
  %49 = load i8, ptr %48, align 1, !tbaa !14, !range !16, !noundef !17
  %50 = trunc nuw i8 %49 to i1
  br i1 %50, label %._crit_edge27, label %51

51:                                               ; preds = %.lr.ph26
  store i8 1, ptr %48, align 1, !tbaa !14
  %52 = getelementptr inbounds [500010 x %"struct.std::pair"], ptr @p, i64 0, i64 %47
  %53 = load i8, ptr %52, align 8, !tbaa !11
  %54 = getelementptr inbounds [500010 x i8], ptr @t, i64 0, i64 %indvars.iv29
  store i8 %53, ptr %54, align 1, !tbaa !18
  %indvars.iv.next30 = add nuw nsw i64 %indvars.iv29, 1
  %55 = getelementptr inbounds [500010 x %"struct.std::pair"], ptr @p, i64 0, i64 %47, i32 1
  %56 = load i32, ptr %55, align 4, !tbaa !19
  store i32 %56, ptr @o, align 4, !tbaa !5
  %exitcond33.not = icmp eq i64 %indvars.iv.next30, %wide.trip.count32
  br i1 %exitcond33.not, label %._crit_edge27, label %.lr.ph26, !llvm.loop !20

._crit_edge27:                                    ; preds = %51, %.lr.ph26, %.preheader, %._crit_edge
  %.str.1.sink = phi ptr [ @t, %._crit_edge ], [ @t, %.preheader ], [ @.str.1, %.lr.ph26 ], [ @t, %51 ]
  %57 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1.sink)
  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 nounwind uwtable
declare dso_local void @_ZNSt4pairIciEC2IRcRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS5_S6_EEEbE4typeELb1EEEOS5_OS6_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #3 align 2

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @puts(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 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 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 = !{!12, !7, i64 0}
!12 = !{!"_ZTSSt4pairIciE", !7, i64 0, !6, i64 4}
!13 = distinct !{!13, !10}
!14 = !{!15, !15, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!7, !7, i64 0}
!19 = !{!12, !6, i64 4}
!20 = distinct !{!20, !10}


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