; LLVM IR from eyangch/competitive-programming :: Codeforces/1365 (b)

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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"struct.std::pair" = type { i32, i32 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = 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 ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i8, align 1
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %12 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %13 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %14 = getelementptr i8, ptr %13, i64 -24
  %15 = load i64, ptr %14, align 8
  %16 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %15
  %17 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %16, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  br label %19

19:                                               ; preds = %117, %0
  %20 = load i32, ptr %2, align 4, !tbaa !8
  %21 = add nsw i32 %20, -1
  store i32 %21, ptr %2, align 4, !tbaa !8
  %22 = icmp ne i32 %20, 0
  br i1 %22, label %23, label %119

23:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %25 = load i32, ptr %3, align 4, !tbaa !8
  %26 = zext i32 %25 to i64
  %27 = call ptr @llvm.stacksave.p0()
  store ptr %27, ptr %4, align 8
  %28 = alloca %"struct.std::pair", i64 %26, align 16
  store i64 %26, ptr %5, align 8
  %29 = icmp eq i64 %26, 0
  br i1 %29, label %36, label %30

30:                                               ; preds = %23
  %31 = getelementptr inbounds %"struct.std::pair", ptr %28, i64 %26
  br label %32

32:                                               ; preds = %32, %30
  %33 = phi ptr [ %28, %30 ], [ %34, %32 ]
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %33)
  %34 = getelementptr inbounds %"struct.std::pair", ptr %33, i64 1
  %35 = icmp eq ptr %34, %31
  br i1 %35, label %36, label %32

36:                                               ; preds = %32, %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !8
  br label %37

37:                                               ; preds = %48, %36
  %38 = load i32, ptr %6, align 4, !tbaa !8
  %39 = load i32, ptr %3, align 4, !tbaa !8
  %40 = icmp slt i32 %38, %39
  br i1 %40, label %42, label %41

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

42:                                               ; preds = %37
  %43 = load i32, ptr %6, align 4, !tbaa !8
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds %"struct.std::pair", ptr %28, i64 %44
  %46 = getelementptr inbounds %"struct.std::pair", ptr %45, i32 0, i32 0
  %47 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %46)
  br label %48

48:                                               ; preds = %42
  %49 = load i32, ptr %6, align 4, !tbaa !8
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %6, align 4, !tbaa !8
  br label %37, !llvm.loop !11

51:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !8
  br label %52

52:                                               ; preds = %63, %51
  %53 = load i32, ptr %7, align 4, !tbaa !8
  %54 = load i32, ptr %3, align 4, !tbaa !8
  %55 = icmp slt i32 %53, %54
  br i1 %55, label %57, label %56

56:                                               ; preds = %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %66

57:                                               ; preds = %52
  %58 = load i32, ptr %7, align 4, !tbaa !8
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds %"struct.std::pair", ptr %28, i64 %59
  %61 = getelementptr inbounds %"struct.std::pair", ptr %60, i32 0, i32 1
  %62 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %61)
  br label %63

63:                                               ; preds = %57
  %64 = load i32, ptr %7, align 4, !tbaa !8
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %7, align 4, !tbaa !8
  br label %52, !llvm.loop !13

66:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 1, ptr %8, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #7
  store i8 0, ptr %9, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %67 = getelementptr inbounds %"struct.std::pair", ptr %28, i64 0
  %68 = getelementptr inbounds %"struct.std::pair", ptr %67, i32 0, i32 1
  %69 = load i32, ptr %68, align 4, !tbaa !16
  store i32 %69, ptr %10, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !8
  br label %70

70:                                               ; preds = %102, %66
  %71 = load i32, ptr %11, align 4, !tbaa !8
  %72 = load i32, ptr %3, align 4, !tbaa !8
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %105

75:                                               ; preds = %70
  %76 = load i32, ptr %11, align 4, !tbaa !8
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds %"struct.std::pair", ptr %28, i64 %77
  %79 = getelementptr inbounds %"struct.std::pair", ptr %78, i32 0, i32 1
  %80 = load i32, ptr %79, align 4, !tbaa !16
  %81 = load i32, ptr %10, align 4, !tbaa !8
  %82 = icmp ne i32 %80, %81
  br i1 %82, label %83, label %84

83:                                               ; preds = %75
  store i8 1, ptr %9, align 1, !tbaa !14
  br label %84

84:                                               ; preds = %83, %75
  %85 = load i32, ptr %11, align 4, !tbaa !8
  %86 = icmp sgt i32 %85, 0
  br i1 %86, label %87, label %101

87:                                               ; preds = %84
  %88 = load i32, ptr %11, align 4, !tbaa !8
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds %"struct.std::pair", ptr %28, i64 %89
  %91 = getelementptr inbounds %"struct.std::pair", ptr %90, i32 0, i32 0
  %92 = load i32, ptr %91, align 8, !tbaa !18
  %93 = load i32, ptr %11, align 4, !tbaa !8
  %94 = sub nsw i32 %93, 1
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds %"struct.std::pair", ptr %28, i64 %95
  %97 = getelementptr inbounds %"struct.std::pair", ptr %96, i32 0, i32 0
  %98 = load i32, ptr %97, align 8, !tbaa !18
  %99 = icmp slt i32 %92, %98
  br i1 %99, label %100, label %101

100:                                              ; preds = %87
  store i32 0, ptr %8, align 4, !tbaa !8
  br label %101

101:                                              ; preds = %100, %87, %84
  br label %102

102:                                              ; preds = %101
  %103 = load i32, ptr %11, align 4, !tbaa !8
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %11, align 4, !tbaa !8
  br label %70, !llvm.loop !19

105:                                              ; preds = %74
  %106 = load i32, ptr %8, align 4, !tbaa !8
  %107 = icmp ne i32 %106, 0
  br i1 %107, label %111, label %108

108:                                              ; preds = %105
  %109 = load i8, ptr %9, align 1, !tbaa !14, !range !20, !noundef !21
  %110 = trunc i8 %109 to i1
  br i1 %110, label %111, label %114

111:                                              ; preds = %108, %105
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %113 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %112, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %117

114:                                              ; preds = %108
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %115, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %117

117:                                              ; preds = %114, %111
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  %118 = load ptr, ptr %4, align 8
  call void @llvm.stackrestore.p0(ptr %118)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %19, !llvm.loop !22

119:                                              ; preds = %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  ret i32 0
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 2

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #2 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #6 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind willreturn }
attributes #5 = { 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 #6 = { 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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"bool", !10, i64 0}
!16 = !{!17, !9, i64 4}
!17 = !{!"_ZTSSt4pairIiiE", !9, i64 0, !9, i64 4}
!18 = !{!17, !9, i64 0}
!19 = distinct !{!19, !12}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = distinct !{!22, !12}


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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"struct.std::pair" = type { i32, i32 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 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 i32, align 4
  %3 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %4 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %5 = getelementptr i8, ptr %4, i64 -24
  %6 = load i64, ptr %5, align 8
  %7 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %6
  %8 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %7, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %10 = load i32, ptr %1, align 4, !tbaa !8
  %11 = add nsw i32 %10, -1
  store i32 %11, ptr %1, align 4, !tbaa !8
  %.not36 = icmp eq i32 %10, 0
  br i1 %.not36, label %._crit_edge39, label %.lr.ph38

.lr.ph38:                                         ; preds = %0, %._crit_edge33.thread
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %13 = load i32, ptr %2, align 4, !tbaa !8
  %14 = zext i32 %13 to i64
  %15 = call ptr @llvm.stacksave.p0()
  %16 = alloca %"struct.std::pair", i64 %14, align 16
  %17 = icmp eq i32 %13, 0
  br i1 %17, label %.loopexit, label %18

18:                                               ; preds = %.lr.ph38
  %19 = getelementptr inbounds %"struct.std::pair", ptr %16, i64 %14
  br label %20

20:                                               ; preds = %20, %18
  %21 = phi ptr [ %16, %18 ], [ %22, %20 ]
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %21)
  %22 = getelementptr inbounds i8, ptr %21, i64 8
  %23 = icmp eq ptr %22, %19
  br i1 %23, label %.loopexit, label %20

.loopexit:                                        ; preds = %20, %.lr.ph38
  %24 = load i32, ptr %2, align 4, !tbaa !8
  %25 = icmp sgt i32 %24, 0
  br i1 %25, label %.lr.ph, label %._crit_edge33.thread

.preheader:                                       ; preds = %.lr.ph
  %26 = icmp sgt i32 %29, 0
  br i1 %26, label %.lr.ph27, label %._crit_edge33.thread

.lr.ph:                                           ; preds = %.loopexit, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.loopexit ]
  %27 = getelementptr inbounds %"struct.std::pair", ptr %16, i64 %indvars.iv
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %27)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %29 = load i32, ptr %2, align 4, !tbaa !8
  %30 = sext i32 %29 to i64
  %31 = icmp slt i64 %indvars.iv.next, %30
  br i1 %31, label %.lr.ph, label %.preheader, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph27
  %32 = getelementptr inbounds i8, ptr %16, i64 4
  %33 = load i32, ptr %32, align 4, !tbaa !13
  %34 = icmp sgt i32 %60, 0
  br i1 %34, label %35, label %._crit_edge33.thread

35:                                               ; preds = %._crit_edge
  %wide.trip.count = zext nneg i32 %60 to i64
  %exitcond.peel.not = icmp eq i32 %60, 1
  br i1 %exitcond.peel.not, label %._crit_edge33.thread, label %.lr.ph32.peel.next.preheader

.lr.ph32.peel.next.preheader:                     ; preds = %35
  %min.iters.check = icmp ult i32 %60, 10
  br i1 %min.iters.check, label %.lr.ph32.peel.next.preheader71, label %vector.ph

.lr.ph32.peel.next.preheader71:                   ; preds = %middle.block, %.lr.ph32.peel.next.preheader
  %indvars.iv45.ph = phi i64 [ 1, %.lr.ph32.peel.next.preheader ], [ %ind.end, %middle.block ]
  %.01629.ph = phi i1 [ false, %.lr.ph32.peel.next.preheader ], [ %56, %middle.block ]
  %.01728.ph = phi i32 [ 1, %.lr.ph32.peel.next.preheader ], [ %rdx.select68, %middle.block ]
  br label %.lr.ph32.peel.next

vector.ph:                                        ; preds = %.lr.ph32.peel.next.preheader
  %36 = add nsw i64 %wide.trip.count, -1
  %n.mod.vf = and i64 %36, 7
  %37 = icmp eq i64 %n.mod.vf, 0
  %38 = select i1 %37, i64 8, i64 %n.mod.vf
  %n.vec = sub nsw i64 %36, %38
  %ind.end = add nsw i64 %n.vec, 1
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %33, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i1> [ zeroinitializer, %vector.ph ], [ %44, %vector.body ]
  %vec.phi56 = phi <4 x i1> [ zeroinitializer, %vector.ph ], [ %45, %vector.body ]
  %vec.phi57 = phi <4 x i1> [ zeroinitializer, %vector.ph ], [ %52, %vector.body ]
  %vec.phi58 = phi <4 x i1> [ zeroinitializer, %vector.ph ], [ %53, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %39 = or disjoint i64 %index, 5
  %40 = getelementptr inbounds %"struct.std::pair", ptr %16, i64 %offset.idx
  %41 = getelementptr inbounds %"struct.std::pair", ptr %16, i64 %39
  %wide.vec = load <8 x i32>, ptr %40, align 8, !tbaa !8
  %wide.vec59 = load <8 x i32>, ptr %41, align 8, !tbaa !8
  %strided.vec61 = shufflevector <8 x i32> %wide.vec, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
  %strided.vec62 = shufflevector <8 x i32> %wide.vec59, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
  %42 = icmp ne <4 x i32> %strided.vec61, %broadcast.splat
  %43 = icmp ne <4 x i32> %strided.vec62, %broadcast.splat
  %44 = or <4 x i1> %vec.phi, %42
  %45 = or <4 x i1> %vec.phi56, %43
  %46 = getelementptr i8, ptr %40, i64 -8
  %47 = getelementptr i8, ptr %41, i64 -8
  %wide.vec63 = load <8 x i32>, ptr %46, align 16, !tbaa !15
  %wide.vec64 = load <8 x i32>, ptr %47, align 16, !tbaa !15
  %48 = icmp slt <8 x i32> %wide.vec, %wide.vec63
  %49 = shufflevector <8 x i1> %48, <8 x i1> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
  %50 = icmp slt <8 x i32> %wide.vec59, %wide.vec64
  %51 = shufflevector <8 x i1> %50, <8 x i1> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
  %52 = or <4 x i1> %vec.phi57, %49
  %53 = or <4 x i1> %vec.phi58, %51
  %index.next = add nuw i64 %index, 8
  %54 = icmp eq i64 %index.next, %n.vec
  br i1 %54, label %middle.block, label %vector.body, !llvm.loop !16

middle.block:                                     ; preds = %vector.body
  %bin.rdx = or <4 x i1> %45, %44
  %bin.rdx.fr = freeze <4 x i1> %bin.rdx
  %55 = bitcast <4 x i1> %bin.rdx.fr to i4
  %56 = icmp ne i4 %55, 0
  %bin.rdx67 = or <4 x i1> %53, %52
  %bin.rdx67.fr = freeze <4 x i1> %bin.rdx67
  %57 = bitcast <4 x i1> %bin.rdx67.fr to i4
  %.not70 = icmp eq i4 %57, 0
  %rdx.select68 = zext i1 %.not70 to i32
  br label %.lr.ph32.peel.next.preheader71

.lr.ph27:                                         ; preds = %.preheader, %.lr.ph27
  %indvars.iv42 = phi i64 [ %indvars.iv.next43, %.lr.ph27 ], [ 0, %.preheader ]
  %58 = getelementptr inbounds %"struct.std::pair", ptr %16, i64 %indvars.iv42, i32 1
  %59 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %58)
  %indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1
  %60 = load i32, ptr %2, align 4, !tbaa !8
  %61 = sext i32 %60 to i64
  %62 = icmp slt i64 %indvars.iv.next43, %61
  br i1 %62, label %.lr.ph27, label %._crit_edge, !llvm.loop !20

._crit_edge33:                                    ; preds = %.lr.ph32.peel.next
  %.not21 = icmp ne i32 %spec.select24, 0
  %brmerge = select i1 %.not21, i1 true, i1 %spec.select
  %spec.select54 = select i1 %brmerge, ptr @.str, ptr @.str.1
  br label %._crit_edge33.thread

.lr.ph32.peel.next:                               ; preds = %.lr.ph32.peel.next.preheader71, %.lr.ph32.peel.next
  %indvars.iv45 = phi i64 [ %indvars.iv.next46, %.lr.ph32.peel.next ], [ %indvars.iv45.ph, %.lr.ph32.peel.next.preheader71 ]
  %.01629 = phi i1 [ %spec.select, %.lr.ph32.peel.next ], [ %.01629.ph, %.lr.ph32.peel.next.preheader71 ]
  %.01728 = phi i32 [ %spec.select24, %.lr.ph32.peel.next ], [ %.01728.ph, %.lr.ph32.peel.next.preheader71 ]
  %63 = getelementptr inbounds %"struct.std::pair", ptr %16, i64 %indvars.iv45
  %64 = getelementptr inbounds i8, ptr %63, i64 4
  %65 = load i32, ptr %64, align 4, !tbaa !13
  %.not22 = icmp ne i32 %65, %33
  %spec.select = select i1 %.not22, i1 true, i1 %.01629
  %66 = load i32, ptr %63, align 8, !tbaa !15
  %67 = getelementptr i8, ptr %63, i64 -8
  %68 = load i32, ptr %67, align 8, !tbaa !15
  %69 = icmp slt i32 %66, %68
  %spec.select24 = select i1 %69, i32 0, i32 %.01728
  %indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next46, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge33, label %.lr.ph32.peel.next, !llvm.loop !21

._crit_edge33.thread:                             ; preds = %._crit_edge33, %._crit_edge, %35, %.preheader, %.loopexit
  %.str.1.sink = phi ptr [ @.str, %.loopexit ], [ @.str, %.preheader ], [ @.str, %35 ], [ @.str, %._crit_edge ], [ %spec.select54, %._crit_edge33 ]
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %.str.1.sink)
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %70, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.stackrestore.p0(ptr %15)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %72 = load i32, ptr %1, align 4, !tbaa !8
  %73 = add nsw i32 %72, -1
  store i32 %73, ptr %1, align 4, !tbaa !8
  %.not = icmp eq i32 %72, 0
  br i1 %.not, label %._crit_edge39, label %.lr.ph38, !llvm.loop !22

._crit_edge39:                                    ; preds = %._crit_edge33.thread, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #2 align 2

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #2 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #6 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { 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 #6 = { 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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !9, i64 4}
!14 = !{!"_ZTSSt4pairIiiE", !9, i64 0, !9, i64 4}
!15 = !{!14, !9, i64 0}
!16 = distinct !{!16, !12, !17, !18, !19}
!17 = !{!"llvm.loop.peeled.count", i32 1}
!18 = !{!"llvm.loop.isvectorized", i32 1}
!19 = !{!"llvm.loop.unroll.runtime.disable"}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12, !17, !19, !18}
!22 = distinct !{!22, !12}


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