; LLVM IR from tangjz/acm-icpc :: codeforces/gym (100443E)

; 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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, int>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, int>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::set" = type { %"class.std::_Rb_tree.3" }
%"class.std::_Rb_tree.3" = type { %"struct.std::_Rb_tree<std::pair<long long, int>, std::pair<long long, int>, std::_Identity<std::pair<long long, int>>, std::less<std::pair<long long, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<long long, int>, std::pair<long long, int>, std::_Identity<std::pair<long long, int>>, std::less<std::pair<long long, int>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::pair" = type <{ i64, i32, [4 x i8] }>
%"struct.std::pair.8" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@pat = external dso_local global ptr, align 8
@tot = external dso_local global i32, align 4
@_Z4HashB5cxx11 = external dso_local global %"class.std::map", align 8
@sp = external dso_local global %"class.std::set", align 8
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@seq = external dso_local global [101 x i32], align 16
@buf = external dso_local global [21 x i8], align 16
@str = external dso_local global [101 x [21 x i8]], align 16
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [9 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z5getIDPc(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: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #0 align 2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNKSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5countERKS1_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(12)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE6insertERKS1_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(12)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z6insertv() #1

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIxiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"class.std::map", align 8
  %5 = alloca %"class.std::set", align 8
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca { i64, i32 }, align 8
  %10 = alloca %"struct.std::pair.8", align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::pair", align 8
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  %17 = alloca { i64, i32 }, align 8
  %18 = alloca %"struct.std::pair.8", align 8
  %19 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %183, %0
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef @n)
  %22 = icmp eq i32 %21, 1
  br i1 %22, label %24, label %23

23:                                               ; preds = %20
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %186

24:                                               ; preds = %20
  store i32 0, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr %4) #8
  call void @llvm.memset.p0.i64(ptr align 8 %4, i8 0, i64 48, i1 false)
  call void @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4lessIS5_ESaISt4pairIKS5_iEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #8
  call void @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4lessIS5_ESaISt4pairIKS5_iEEE4swapERSC_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 8 dereferenceable(48) @_Z4HashB5cxx11) #8
  call void @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4lessIS5_ESaISt4pairIKS5_iEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %4) #8
  call void @llvm.lifetime.start.p0(i64 48, ptr %5) #8
  call void @llvm.memset.p0.i64(ptr align 8 %5, i8 0, i64 48, i1 false)
  call void @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #8
  call void @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE4swapERS5_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(48) @sp) #8
  call void @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %5) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %25 = call noundef i32 @_Z5getIDPc(ptr noundef @.str.4)
  %26 = sext i32 %25 to i64
  store i64 %26, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 0, ptr %8, align 4, !tbaa !5
  %27 = call { i64, i32 } @_ZSt9make_pairIxiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  store { i64, i32 } %27, ptr %9, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %6, ptr align 8 %9, i64 12, i1 false)
  %28 = call { ptr, i8 } @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 8 dereferenceable(12) %6)
  %29 = getelementptr inbounds { ptr, i8 }, ptr %10, i32 0, i32 0
  %30 = extractvalue { ptr, i8 } %28, 0
  store ptr %30, ptr %29, align 8
  %31 = getelementptr inbounds { ptr, i8 }, ptr %10, i32 0, i32 1
  %32 = extractvalue { ptr, i8 } %28, 1
  store i8 %32, ptr %31, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #8
  br label %33

33:                                               ; preds = %68, %65, %24
  %34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.5, ptr noundef @buf)
  %35 = icmp eq i32 %34, 1
  br i1 %35, label %36, label %79

36:                                               ; preds = %33
  %37 = load i8, ptr getelementptr inbounds ([21 x i8], ptr @buf, i64 0, i64 1), align 1, !tbaa !11
  %38 = sext i8 %37 to i32
  %39 = icmp eq i32 %38, 0
  br i1 %39, label %40, label %68

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

41:                                               ; preds = %52, %40
  %42 = load i8, ptr @buf, align 16, !tbaa !11
  %43 = sext i8 %42 to i32
  %44 = load ptr, ptr @pat, align 8, !tbaa !12
  %45 = load i32, ptr %11, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds i8, ptr %44, i64 %46
  %48 = load i8, ptr %47, align 1, !tbaa !11
  %49 = sext i8 %48 to i32
  %50 = icmp ne i32 %43, %49
  br i1 %50, label %51, label %55

51:                                               ; preds = %41
  br label %52

52:                                               ; preds = %51
  %53 = load i32, ptr %11, align 4, !tbaa !5
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %11, align 4, !tbaa !5
  br label %41, !llvm.loop !14

55:                                               ; preds = %41
  %56 = load i32, ptr %11, align 4, !tbaa !5
  %57 = icmp slt i32 %56, 8
  br i1 %57, label %58, label %64

58:                                               ; preds = %55
  %59 = call noundef zeroext i1 @_Z6insertv()
  store i32 0, ptr @m, align 4, !tbaa !5
  %60 = load i32, ptr %11, align 4, !tbaa !5
  %61 = icmp slt i32 %60, 6
  br i1 %61, label %62, label %63

62:                                               ; preds = %58
  store i32 5, ptr %3, align 4
  br label %65, !llvm.loop !16

63:                                               ; preds = %58
  store i32 6, ptr %3, align 4
  br label %65

64:                                               ; preds = %55
  store i32 0, ptr %3, align 4
  br label %65

65:                                               ; preds = %64, %63, %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  %66 = load i32, ptr %3, align 4
  switch i32 %66, label %187 [
    i32 0, label %67
    i32 5, label %33
    i32 6, label %79
  ]

67:                                               ; preds = %65
  br label %68

68:                                               ; preds = %67, %36
  %69 = call noundef i32 @_Z5getIDPc(ptr noundef @buf)
  %70 = load i32, ptr @m, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [101 x i32], ptr @seq, i64 0, i64 %71
  store i32 %69, ptr %72, align 4, !tbaa !5
  %73 = load i32, ptr @m, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr @m, align 4, !tbaa !5
  %75 = sext i32 %73 to i64
  %76 = getelementptr inbounds [101 x [21 x i8]], ptr @str, i64 0, i64 %75
  %77 = getelementptr inbounds [21 x i8], ptr %76, i64 0, i64 0
  %78 = call ptr @strcpy(ptr noundef %77, ptr noundef @buf) #8
  br label %33, !llvm.loop !16

79:                                               ; preds = %65, %33
  %80 = load i32, ptr %2, align 4, !tbaa !5
  %81 = icmp sgt i32 %80, 1
  br i1 %81, label %82, label %84

82:                                               ; preds = %79
  %83 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  br label %84

84:                                               ; preds = %82, %79
  %85 = load i32, ptr %2, align 4, !tbaa !5
  %86 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, i32 noundef %85)
  br label %87

87:                                               ; preds = %171, %168, %84
  %88 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.5, ptr noundef @buf)
  %89 = icmp eq i32 %88, 1
  br i1 %89, label %90, label %182

90:                                               ; preds = %87
  %91 = load i8, ptr getelementptr inbounds ([21 x i8], ptr @buf, i64 0, i64 1), align 1, !tbaa !11
  %92 = sext i8 %91 to i32
  %93 = icmp eq i32 %92, 0
  br i1 %93, label %94, label %171

94:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %95

95:                                               ; preds = %106, %94
  %96 = load i8, ptr @buf, align 16, !tbaa !11
  %97 = sext i8 %96 to i32
  %98 = load ptr, ptr @pat, align 8, !tbaa !12
  %99 = load i32, ptr %12, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds i8, ptr %98, i64 %100
  %102 = load i8, ptr %101, align 1, !tbaa !11
  %103 = sext i8 %102 to i32
  %104 = icmp ne i32 %97, %103
  br i1 %104, label %105, label %109

105:                                              ; preds = %95
  br label %106

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

109:                                              ; preds = %95
  %110 = load i32, ptr %12, align 4, !tbaa !5
  %111 = icmp slt i32 %110, 8
  br i1 %111, label %112, label %167

112:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %113

113:                                              ; preds = %139, %112
  %114 = load i32, ptr %13, align 4, !tbaa !5
  %115 = load i32, ptr @m, align 4, !tbaa !5
  %116 = icmp slt i32 %114, %115
  br i1 %116, label %118, label %117

117:                                              ; preds = %113
  store i32 15, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %142

118:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %119 = load i32, ptr %13, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [101 x i32], ptr @seq, i64 0, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  store i64 %123, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  store i32 0, ptr %16, align 4, !tbaa !5
  %124 = call { i64, i32 } @_ZSt9make_pairIxiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 4 dereferenceable(4) %16)
  store { i64, i32 } %124, ptr %17, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 8 %17, i64 12, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  %125 = call noundef i64 @_ZNKSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5countERKS1_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 8 dereferenceable(12) %14)
  %126 = icmp ne i64 %125, 0
  br i1 %126, label %138, label %127

127:                                              ; preds = %118
  %128 = load i32, ptr %13, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [101 x [21 x i8]], ptr @str, i64 0, i64 %129
  %131 = getelementptr inbounds [21 x i8], ptr %130, i64 0, i64 0
  %132 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, ptr noundef %131)
  %133 = call { ptr, i8 } @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE6insertERKS1_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 8 dereferenceable(12) %14)
  %134 = getelementptr inbounds { ptr, i8 }, ptr %18, i32 0, i32 0
  %135 = extractvalue { ptr, i8 } %133, 0
  store ptr %135, ptr %134, align 8
  %136 = getelementptr inbounds { ptr, i8 }, ptr %18, i32 0, i32 1
  %137 = extractvalue { ptr, i8 } %133, 1
  store i8 %137, ptr %136, align 8
  br label %138

138:                                              ; preds = %127, %118
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #8
  br label %139

139:                                              ; preds = %138
  %140 = load i32, ptr %13, align 4, !tbaa !5
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %13, align 4, !tbaa !5
  br label %113, !llvm.loop !18

142:                                              ; preds = %117
  %143 = call noundef zeroext i1 @_Z6insertv()
  br i1 %143, label %144, label %162

144:                                              ; preds = %142
  %145 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, ptr noundef @str)
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  store i32 1, ptr %19, align 4, !tbaa !5
  br label %146

146:                                              ; preds = %157, %144
  %147 = load i32, ptr %19, align 4, !tbaa !5
  %148 = load i32, ptr @m, align 4, !tbaa !5
  %149 = icmp slt i32 %147, %148
  br i1 %149, label %151, label %150

150:                                              ; preds = %146
  store i32 18, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  br label %160

151:                                              ; preds = %146
  %152 = load i32, ptr %19, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [101 x [21 x i8]], ptr @str, i64 0, i64 %153
  %155 = getelementptr inbounds [21 x i8], ptr %154, i64 0, i64 0
  %156 = call i32 (ptr, ...) @printf(ptr noundef @.str.10, ptr noundef %155)
  br label %157

157:                                              ; preds = %151
  %158 = load i32, ptr %19, align 4, !tbaa !5
  %159 = add nsw i32 %158, 1
  store i32 %159, ptr %19, align 4, !tbaa !5
  br label %146, !llvm.loop !19

160:                                              ; preds = %150
  %161 = call i32 (ptr, ...) @printf(ptr noundef @.str.11)
  br label %162

162:                                              ; preds = %160, %142
  store i32 0, ptr @m, align 4, !tbaa !5
  %163 = load i32, ptr %12, align 4, !tbaa !5
  %164 = icmp slt i32 %163, 6
  br i1 %164, label %165, label %166

165:                                              ; preds = %162
  store i32 10, ptr %3, align 4
  br label %168, !llvm.loop !20

166:                                              ; preds = %162
  store i32 11, ptr %3, align 4
  br label %168

167:                                              ; preds = %109
  store i32 0, ptr %3, align 4
  br label %168

168:                                              ; preds = %167, %166, %165
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  %169 = load i32, ptr %3, align 4
  switch i32 %169, label %187 [
    i32 0, label %170
    i32 10, label %87
    i32 11, label %182
  ]

170:                                              ; preds = %168
  br label %171

171:                                              ; preds = %170, %90
  %172 = call noundef i32 @_Z5getIDPc(ptr noundef @buf)
  %173 = load i32, ptr @m, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [101 x i32], ptr @seq, i64 0, i64 %174
  store i32 %172, ptr %175, align 4, !tbaa !5
  %176 = load i32, ptr @m, align 4, !tbaa !5
  %177 = add nsw i32 %176, 1
  store i32 %177, ptr @m, align 4, !tbaa !5
  %178 = sext i32 %176 to i64
  %179 = getelementptr inbounds [101 x [21 x i8]], ptr @str, i64 0, i64 %178
  %180 = getelementptr inbounds [21 x i8], ptr %179, i64 0, i64 0
  %181 = call ptr @strcpy(ptr noundef %180, ptr noundef @buf) #8
  br label %87, !llvm.loop !20

182:                                              ; preds = %168, %87
  br label %183

183:                                              ; preds = %182
  %184 = load i32, ptr %2, align 4, !tbaa !5
  %185 = add nsw i32 %184, 1
  store i32 %185, ptr %2, align 4, !tbaa !5
  br label %20, !llvm.loop !21

186:                                              ; preds = %23
  ret i32 0

187:                                              ; preds = %168, %65
  unreachable
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4lessIS5_ESaISt4pairIKS5_iEEE4swapERSC_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE4swapERS5_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(12)) #1 align 2

; Function Attrs: nounwind
declare ptr @strcpy(ptr noundef, ptr noundef) #7

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

attributes #0 = { 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 #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { 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 #8 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !15}
!19 = distinct !{!19, !15}
!20 = distinct !{!20, !15}
!21 = distinct !{!21, !15}


; 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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, int>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, int>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::set" = type { %"class.std::_Rb_tree.3" }
%"class.std::_Rb_tree.3" = type { %"struct.std::_Rb_tree<std::pair<long long, int>, std::pair<long long, int>, std::_Identity<std::pair<long long, int>>, std::less<std::pair<long long, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<long long, int>, std::pair<long long, int>, std::_Identity<std::pair<long long, int>>, std::less<std::pair<long long, int>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::pair" = type <{ i64, i32, [4 x i8] }>

@pat = external dso_local local_unnamed_addr global ptr, align 8
@tot = external dso_local local_unnamed_addr global i32, align 4
@_Z4HashB5cxx11 = external dso_local global %"class.std::map", align 8
@sp = external dso_local global %"class.std::set", align 8
@n = external dso_local global i32, align 4
@m = external dso_local local_unnamed_addr global i32, align 4
@seq = external dso_local local_unnamed_addr global [101 x i32], align 16
@buf = external dso_local global [21 x i8], align 16
@str = external dso_local global [101 x [21 x i8]], align 16
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [9 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z5getIDPc(ptr noundef) 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: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNKSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5countERKS1_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE6insertERKS1_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z6insertv() local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIxiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca %"class.std::map", align 8
  %2 = alloca %"class.std::set", align 8
  %3 = alloca %"struct.std::pair", align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull @n)
  %10 = icmp eq i32 %9, 1
  br i1 %10, label %.lr.ph58, label %._crit_edge59

.lr.ph58:                                         ; preds = %0
  %.sroa.221.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 8
  br label %11

._crit_edge59:                                    ; preds = %.thread41, %0
  ret i32 0

11:                                               ; preds = %.lr.ph58, %.thread41
  %.02756 = phi i32 [ 1, %.lr.ph58 ], [ %92, %.thread41 ]
  store i32 0, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %1) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %1, i8 0, i64 48, i1 false)
  call void @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4lessIS5_ESaISt4pairIKS5_iEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #7
  call void @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4lessIS5_ESaISt4pairIKS5_iEEE4swapERSC_(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 8 dereferenceable(48) @_Z4HashB5cxx11) #7
  call void @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4lessIS5_ESaISt4pairIKS5_iEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %2) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %2, i8 0, i64 48, i1 false)
  call void @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #7
  call void @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE4swapERS5_(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(48) @sp) #7
  call void @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %12 = call noundef i32 @_Z5getIDPc(ptr noundef nonnull @.str.4)
  %13 = sext i32 %12 to i64
  store i64 %13, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  store i32 0, ptr %5, align 4, !tbaa !5
  %14 = call { i64, i32 } @_ZSt9make_pairIxiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %.fca.0.extract18 = extractvalue { i64, i32 } %14, 0
  %.fca.1.extract19 = extractvalue { i64, i32 } %14, 1
  store i64 %.fca.0.extract18, ptr %3, align 8
  store i32 %.fca.1.extract19, ptr %.sroa.221.0..sroa_idx, align 8
  %15 = call { ptr, i8 } @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 8 dereferenceable(12) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #7
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull @buf)
  %17 = icmp eq i32 %16, 1
  br i1 %17, label %.lr.ph, label %.thread36

.lr.ph:                                           ; preds = %11, %.backedge45
  %18 = load i8, ptr getelementptr inbounds (i8, ptr @buf, i64 1), align 1, !tbaa !11
  %19 = icmp eq i8 %18, 0
  br i1 %19, label %.preheader44, label %.thread

.preheader44:                                     ; preds = %.lr.ph
  %20 = load i8, ptr @buf, align 16, !tbaa !11
  %21 = load ptr, ptr @pat, align 8, !tbaa !12
  br label %22

22:                                               ; preds = %22, %.preheader44
  %indvars.iv = phi i64 [ %indvars.iv.next, %22 ], [ 0, %.preheader44 ]
  %23 = getelementptr inbounds i8, ptr %21, i64 %indvars.iv
  %24 = load i8, ptr %23, align 1, !tbaa !11
  %.not = icmp eq i8 %20, %24
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  br i1 %.not, label %25, label %22, !llvm.loop !14

25:                                               ; preds = %22
  %26 = icmp ult i64 %indvars.iv, 8
  br i1 %26, label %27, label %.thread

27:                                               ; preds = %25
  %28 = call noundef zeroext i1 @_Z6insertv()
  store i32 0, ptr @m, align 4, !tbaa !5
  %29 = icmp ult i64 %indvars.iv, 6
  br i1 %29, label %.backedge45, label %.thread36

.thread:                                          ; preds = %25, %.lr.ph
  %30 = call noundef i32 @_Z5getIDPc(ptr noundef nonnull @buf)
  %31 = load i32, ptr @m, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [101 x i32], ptr @seq, i64 0, i64 %32
  store i32 %30, ptr %33, align 4, !tbaa !5
  %34 = add nsw i32 %31, 1
  store i32 %34, ptr @m, align 4, !tbaa !5
  %35 = getelementptr inbounds [101 x [21 x i8]], ptr @str, i64 0, i64 %32
  %36 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %35, ptr noundef nonnull dereferenceable(1) @buf) #7
  br label %.backedge45

.backedge45:                                      ; preds = %.thread, %27
  %37 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull @buf)
  %38 = icmp eq i32 %37, 1
  br i1 %38, label %.lr.ph, label %.thread36, !llvm.loop !16

.thread36:                                        ; preds = %.backedge45, %27, %11
  %39 = icmp ugt i32 %.02756, 1
  br i1 %39, label %40, label %42

40:                                               ; preds = %.thread36
  %41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  br label %42

42:                                               ; preds = %40, %.thread36
  %43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %.02756)
  %44 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull @buf)
  %45 = icmp eq i32 %44, 1
  br i1 %45, label %.lr.ph54, label %.thread41

.lr.ph54:                                         ; preds = %42, %.backedge
  %46 = load i8, ptr getelementptr inbounds (i8, ptr @buf, i64 1), align 1, !tbaa !11
  %47 = icmp eq i8 %46, 0
  br i1 %47, label %.preheader43, label %.thread39

.preheader43:                                     ; preds = %.lr.ph54
  %48 = load i8, ptr @buf, align 16, !tbaa !11
  %49 = load ptr, ptr @pat, align 8, !tbaa !12
  br label %50

50:                                               ; preds = %50, %.preheader43
  %indvars.iv61 = phi i64 [ %indvars.iv.next62, %50 ], [ 0, %.preheader43 ]
  %51 = getelementptr inbounds i8, ptr %49, i64 %indvars.iv61
  %52 = load i8, ptr %51, align 1, !tbaa !11
  %.not32 = icmp eq i8 %48, %52
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  br i1 %.not32, label %53, label %50, !llvm.loop !17

53:                                               ; preds = %50
  %54 = icmp ult i64 %indvars.iv61, 8
  br i1 %54, label %.preheader, label %.thread39

.preheader:                                       ; preds = %53
  %55 = load i32, ptr @m, align 4, !tbaa !5
  %56 = icmp sgt i32 %55, 0
  br i1 %56, label %.lr.ph48, label %._crit_edge

._crit_edge:                                      ; preds = %67, %.preheader
  %57 = call noundef zeroext i1 @_Z6insertv()
  br i1 %57, label %71, label %81

.lr.ph48:                                         ; preds = %.preheader, %67
  %indvars.iv64 = phi i64 [ %indvars.iv.next65, %67 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %58 = getelementptr inbounds [101 x i32], ptr @seq, i64 0, i64 %indvars.iv64
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  store i64 %60, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  %61 = call { i64, i32 } @_ZSt9make_pairIxiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %.fca.0.extract = extractvalue { i64, i32 } %61, 0
  %.fca.1.extract = extractvalue { i64, i32 } %61, 1
  store i64 %.fca.0.extract, ptr %6, align 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  %62 = call noundef i64 @_ZNKSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE5countERKS1_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 8 dereferenceable(12) %6)
  %.not33 = icmp eq i64 %62, 0
  br i1 %.not33, label %63, label %67

63:                                               ; preds = %.lr.ph48
  %64 = getelementptr inbounds [101 x [21 x i8]], ptr @str, i64 0, i64 %indvars.iv64
  %65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, ptr noundef nonnull %64)
  %66 = call { ptr, i8 } @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE6insertERKS1_(ptr noundef nonnull align 8 dereferenceable(48) @sp, ptr noundef nonnull align 8 dereferenceable(12) %6)
  br label %67

67:                                               ; preds = %63, %.lr.ph48
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %68 = load i32, ptr @m, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = icmp slt i64 %indvars.iv.next65, %69
  br i1 %70, label %.lr.ph48, label %._crit_edge, !llvm.loop !18

71:                                               ; preds = %._crit_edge
  %72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, ptr noundef nonnull @str)
  %73 = load i32, ptr @m, align 4, !tbaa !5
  %74 = icmp sgt i32 %73, 1
  br i1 %74, label %.lr.ph51, label %._crit_edge52

._crit_edge52:                                    ; preds = %.lr.ph51, %71
  %75 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  br label %81

.lr.ph51:                                         ; preds = %71, %.lr.ph51
  %indvars.iv67 = phi i64 [ %indvars.iv.next68, %.lr.ph51 ], [ 1, %71 ]
  %76 = getelementptr inbounds [101 x [21 x i8]], ptr @str, i64 0, i64 %indvars.iv67
  %77 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, ptr noundef nonnull %76)
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %78 = load i32, ptr @m, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = icmp slt i64 %indvars.iv.next68, %79
  br i1 %80, label %.lr.ph51, label %._crit_edge52, !llvm.loop !19

81:                                               ; preds = %._crit_edge52, %._crit_edge
  store i32 0, ptr @m, align 4, !tbaa !5
  %82 = icmp ult i64 %indvars.iv61, 6
  br i1 %82, label %.backedge, label %.thread41

.thread39:                                        ; preds = %53, %.lr.ph54
  %83 = call noundef i32 @_Z5getIDPc(ptr noundef nonnull @buf)
  %84 = load i32, ptr @m, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [101 x i32], ptr @seq, i64 0, i64 %85
  store i32 %83, ptr %86, align 4, !tbaa !5
  %87 = add nsw i32 %84, 1
  store i32 %87, ptr @m, align 4, !tbaa !5
  %88 = getelementptr inbounds [101 x [21 x i8]], ptr @str, i64 0, i64 %85
  %89 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %88, ptr noundef nonnull dereferenceable(1) @buf) #7
  br label %.backedge

.backedge:                                        ; preds = %.thread39, %81
  %90 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull @buf)
  %91 = icmp eq i32 %90, 1
  br i1 %91, label %.lr.ph54, label %.thread41, !llvm.loop !20

.thread41:                                        ; preds = %.backedge, %81, %42
  %92 = add nuw nsw i32 %.02756, 1
  %93 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull @n)
  %94 = icmp eq i32 %93, 1
  br i1 %94, label %11, label %._crit_edge59, !llvm.loop !21
}

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4lessIS5_ESaISt4pairIKS5_iEEE4swapERSC_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE4swapERS5_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setISt4pairIxiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #6

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

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !15}
!19 = distinct !{!19, !15}
!20 = distinct !{!20, !15}
!21 = distinct !{!21, !15}


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