; LLVM IR from tangjz/acm-icpc :: TDL_training/2016-04-17 (B - Playof - tjz)

; 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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator.0" = type { i8 }

@_Z4HashB5cxx11 = external dso_local global %"class.std::map", align 8
@n = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@que = external dso_local global [524298 x i32], align 16
@fa = external dso_local global [524298 x i32], align 16
@e = external dso_local global [524298 x i8], align 16
@s = external dso_local global [21 x i8], align 16
@t = external dso_local global [21 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [94 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [8 x i8], align 1

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

21:                                               ; preds = %37, %0
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = load i32, ptr @n, align 4, !tbaa !5
  %24 = shl i32 1, %23
  %25 = icmp slt i32 %22, %24
  br i1 %25, label %27, label %26

26:                                               ; preds = %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %49

27:                                               ; preds = %21
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @s)
  %29 = load i32, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef @s, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %30 unwind label %40

30:                                               ; preds = %27
  %31 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4lessIS5_ESaISt4pairIKS5_iEEEixEOS5_(ptr noundef nonnull align 8 dereferenceable(48) @_Z4HashB5cxx11, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %32 unwind label %44

32:                                               ; preds = %30
  store i32 %29, ptr %31, align 4, !tbaa !5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #7
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [524298 x i32], ptr @que, i64 0, i64 %35
  store i32 %33, ptr %36, align 4, !tbaa !5
  br label %37

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

40:                                               ; preds = %27
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %5, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %6, align 4
  br label %48

44:                                               ; preds = %30
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %5, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %6, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  br label %48

48:                                               ; preds = %44, %40
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %204

49:                                               ; preds = %26
  %50 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @e)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 1, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %99, %49
  %52 = load i32, ptr %7, align 4, !tbaa !5
  %53 = load i32, ptr @n, align 4, !tbaa !5
  %54 = icmp sle i32 %52, %53
  br i1 %54, label %56, label %55

55:                                               ; preds = %51
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %102

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

57:                                               ; preds = %93, %56
  %58 = load i32, ptr %10, align 4, !tbaa !5
  %59 = load i32, ptr @n, align 4, !tbaa !5
  %60 = load i32, ptr %7, align 4, !tbaa !5
  %61 = sub nsw i32 %59, %60
  %62 = shl i32 1, %61
  %63 = icmp slt i32 %58, %62
  br i1 %63, label %65, label %64

64:                                               ; preds = %57
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %98

65:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %66 = load i32, ptr %10, align 4, !tbaa !5
  %67 = shl i32 %66, 1
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [524298 x i32], ptr @que, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  store i32 %70, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %71 = load i32, ptr %10, align 4, !tbaa !5
  %72 = shl i32 %71, 1
  %73 = or i32 %72, 1
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [524298 x i32], ptr @que, i64 0, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !5
  store i32 %76, ptr %12, align 4, !tbaa !5
  %77 = load i32, ptr %8, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [524298 x i8], ptr @e, i64 0, i64 %78
  %80 = load i8, ptr %79, align 1, !tbaa !11
  %81 = sext i8 %80 to i32
  %82 = icmp eq i32 %81, 76
  br i1 %82, label %83, label %84

83:                                               ; preds = %65
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12) #7
  br label %84

84:                                               ; preds = %83, %65
  %85 = load i32, ptr %11, align 4, !tbaa !5
  %86 = load i32, ptr %12, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [524298 x i32], ptr @fa, i64 0, i64 %87
  store i32 %85, ptr %88, align 4, !tbaa !5
  %89 = load i32, ptr %11, align 4, !tbaa !5
  %90 = load i32, ptr %10, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [524298 x i32], ptr @que, i64 0, i64 %91
  store i32 %89, ptr %92, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %93

93:                                               ; preds = %84
  %94 = load i32, ptr %10, align 4, !tbaa !5
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %10, align 4, !tbaa !5
  %96 = load i32, ptr %8, align 4, !tbaa !5
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %8, align 4, !tbaa !5
  br label %57, !llvm.loop !12

98:                                               ; preds = %64
  br label %99

99:                                               ; preds = %98
  %100 = load i32, ptr %7, align 4, !tbaa !5
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %7, align 4, !tbaa !5
  br label %51, !llvm.loop !13

102:                                              ; preds = %55
  %103 = load i32, ptr @que, align 16, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [524298 x i32], ptr @fa, i64 0, i64 %104
  store i32 -1, ptr %105, align 4, !tbaa !5
  %106 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @q)
  br label %107

107:                                              ; preds = %201, %199, %102
  %108 = load i32, ptr @q, align 4, !tbaa !5
  %109 = add nsw i32 %108, -1
  store i32 %109, ptr @q, align 4, !tbaa !5
  %110 = icmp ne i32 %108, 0
  br i1 %110, label %111, label %203

111:                                              ; preds = %107
  %112 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef @s, ptr noundef @t)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef @s, ptr noundef nonnull align 1 dereferenceable(1) %15)
          to label %113 unwind label %126

113:                                              ; preds = %111
  %114 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4lessIS5_ESaISt4pairIKS5_iEEEixEOS5_(ptr noundef nonnull align 8 dereferenceable(48) @_Z4HashB5cxx11, ptr noundef nonnull align 8 dereferenceable(32) %14)
          to label %115 unwind label %130

115:                                              ; preds = %113
  %116 = load i32, ptr %114, align 4, !tbaa !5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #7
  store i32 %116, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %18) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %17, ptr noundef @t, ptr noundef nonnull align 1 dereferenceable(1) %18)
          to label %117 unwind label %135

117:                                              ; preds = %115
  %118 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4lessIS5_ESaISt4pairIKS5_iEEEixEOS5_(ptr noundef nonnull align 8 dereferenceable(48) @_Z4HashB5cxx11, ptr noundef nonnull align 8 dereferenceable(32) %17)
          to label %119 unwind label %139

119:                                              ; preds = %117
  %120 = load i32, ptr %118, align 4, !tbaa !5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %18) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #7
  store i32 %120, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %121 = load i32, ptr %13, align 4, !tbaa !5
  %122 = load i32, ptr %16, align 4, !tbaa !5
  %123 = icmp ne i32 %121, %122
  br i1 %123, label %124, label %125

124:                                              ; preds = %119
  br label %145

125:                                              ; preds = %119
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.4, i32 noundef 36, ptr noundef @__PRETTY_FUNCTION__.main) #8
  unreachable

126:                                              ; preds = %111
  %127 = landingpad { ptr, i32 }
          cleanup
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %5, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %6, align 4
  br label %134

130:                                              ; preds = %113
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %5, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %6, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #7
  br label %134

134:                                              ; preds = %130, %126
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #7
  br label %202

135:                                              ; preds = %115
  %136 = landingpad { ptr, i32 }
          cleanup
  %137 = extractvalue { ptr, i32 } %136, 0
  store ptr %137, ptr %5, align 8
  %138 = extractvalue { ptr, i32 } %136, 1
  store i32 %138, ptr %6, align 4
  br label %143

139:                                              ; preds = %117
  %140 = landingpad { ptr, i32 }
          cleanup
  %141 = extractvalue { ptr, i32 } %140, 0
  store ptr %141, ptr %5, align 8
  %142 = extractvalue { ptr, i32 } %140, 1
  store i32 %142, ptr %6, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #7
  br label %143

143:                                              ; preds = %139, %135
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %18) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %202

144:                                              ; No predecessors!
  br label %145

145:                                              ; preds = %144, %124
  %146 = load i32, ptr %16, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [524298 x i32], ptr @fa, i64 0, i64 %147
  %149 = load i32, ptr %148, align 4, !tbaa !5
  store i32 %149, ptr %19, align 4, !tbaa !5
  br label %150

150:                                              ; preds = %160, %145
  %151 = load i32, ptr %19, align 4, !tbaa !5
  %152 = icmp ne i32 %151, -1
  br i1 %152, label %153, label %157

153:                                              ; preds = %150
  %154 = load i32, ptr %19, align 4, !tbaa !5
  %155 = load i32, ptr %13, align 4, !tbaa !5
  %156 = icmp ne i32 %154, %155
  br label %157

157:                                              ; preds = %153, %150
  %158 = phi i1 [ false, %150 ], [ %156, %153 ]
  br i1 %158, label %159, label %165

159:                                              ; preds = %157
  br label %160

160:                                              ; preds = %159
  %161 = load i32, ptr %19, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [524298 x i32], ptr @fa, i64 0, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !5
  store i32 %164, ptr %19, align 4, !tbaa !5
  br label %150, !llvm.loop !14

165:                                              ; preds = %157
  %166 = load i32, ptr %19, align 4, !tbaa !5
  %167 = load i32, ptr %13, align 4, !tbaa !5
  %168 = icmp eq i32 %166, %167
  br i1 %168, label %169, label %171

169:                                              ; preds = %165
  %170 = call i32 @puts(ptr noundef @.str.5)
  store i32 11, ptr %9, align 4
  br label %199, !llvm.loop !15

171:                                              ; preds = %165
  %172 = load i32, ptr %13, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [524298 x i32], ptr @fa, i64 0, i64 %173
  %175 = load i32, ptr %174, align 4, !tbaa !5
  store i32 %175, ptr %19, align 4, !tbaa !5
  br label %176

176:                                              ; preds = %186, %171
  %177 = load i32, ptr %19, align 4, !tbaa !5
  %178 = icmp ne i32 %177, -1
  br i1 %178, label %179, label %183

179:                                              ; preds = %176
  %180 = load i32, ptr %19, align 4, !tbaa !5
  %181 = load i32, ptr %16, align 4, !tbaa !5
  %182 = icmp ne i32 %180, %181
  br label %183

183:                                              ; preds = %179, %176
  %184 = phi i1 [ false, %176 ], [ %182, %179 ]
  br i1 %184, label %185, label %191

185:                                              ; preds = %183
  br label %186

186:                                              ; preds = %185
  %187 = load i32, ptr %19, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [524298 x i32], ptr @fa, i64 0, i64 %188
  %190 = load i32, ptr %189, align 4, !tbaa !5
  store i32 %190, ptr %19, align 4, !tbaa !5
  br label %176, !llvm.loop !16

191:                                              ; preds = %183
  %192 = load i32, ptr %19, align 4, !tbaa !5
  %193 = load i32, ptr %16, align 4, !tbaa !5
  %194 = icmp eq i32 %192, %193
  br i1 %194, label %195, label %197

195:                                              ; preds = %191
  %196 = call i32 @puts(ptr noundef @.str.6)
  store i32 11, ptr %9, align 4
  br label %199, !llvm.loop !15

197:                                              ; preds = %191
  %198 = call i32 @puts(ptr noundef @.str.7)
  store i32 0, ptr %9, align 4
  br label %199

199:                                              ; preds = %197, %195, %169
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  %200 = load i32, ptr %9, align 4
  switch i32 %200, label %209 [
    i32 0, label %201
    i32 11, label %107
  ]

201:                                              ; preds = %199
  br label %107, !llvm.loop !15

202:                                              ; preds = %143, %134
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %204

203:                                              ; preds = %107
  ret i32 0

204:                                              ; preds = %202, %48
  %205 = load ptr, ptr %5, align 8
  %206 = load i32, ptr %6, align 4
  %207 = insertvalue { ptr, i32 } poison, ptr %205, 0
  %208 = insertvalue { ptr, i32 } %207, i32 %206, 1
  resume { ptr, i32 } %208

209:                                              ; preds = %199
  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 uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4lessIS5_ESaISt4pairIKS5_iEEEixEOS5_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4 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 nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #5

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #6

declare i32 @puts(ptr noundef) #1

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { noreturn 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 #7 = { nounwind }
attributes #8 = { noreturn nounwind }

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

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

%"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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator.0" = type { i8 }

@_Z4HashB5cxx11 = external dso_local global %"class.std::map", align 8
@n = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@que = external dso_local local_unnamed_addr global [524298 x i32], align 16
@fa = external dso_local local_unnamed_addr global [524298 x i32], align 16
@e = external dso_local global [524298 x i8], align 16
@s = external dso_local global [21 x i8], align 16
@t = external dso_local global [21 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [94 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::__cxx11::basic_string", align 8
  %2 = alloca %"class.std::allocator.0", align 1
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca %"class.std::allocator.0", align 1
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca %"class.std::allocator.0", align 1
  %9 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %10 = load i32, ptr @n, align 4, !tbaa !5
  %.not72 = icmp eq i32 %10, 31
  br i1 %.not72, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %16, %0
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @e)
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %.not64 = icmp slt i32 %12, 1
  br i1 %.not64, label %._crit_edge67, label %.preheader58

.lr.ph:                                           ; preds = %0, %16
  %indvars.iv = phi i64 [ %indvars.iv.next, %16 ], [ 0, %0 ]
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @s)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull @s, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %14 unwind label %23

14:                                               ; preds = %.lr.ph
  %15 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4lessIS5_ESaISt4pairIKS5_iEEEixEOS5_(ptr noundef nonnull align 8 dereferenceable(48) @_Z4HashB5cxx11, ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %16 unwind label %25

16:                                               ; preds = %14
  %17 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %17, ptr %15, align 4, !tbaa !5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #7
  %18 = getelementptr inbounds [524298 x i32], ptr @que, i64 0, i64 %indvars.iv
  store i32 %17, ptr %18, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %19 = load i32, ptr @n, align 4, !tbaa !5
  %20 = shl nuw i32 1, %19
  %21 = sext i32 %20 to i64
  %22 = icmp slt i64 %indvars.iv.next, %21
  br i1 %22, label %.lr.ph, label %._crit_edge, !llvm.loop !9

23:                                               ; preds = %.lr.ph
  %24 = landingpad { ptr, i32 }
          cleanup
  br label %27

25:                                               ; preds = %14
  %26 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  br label %27

27:                                               ; preds = %25, %23
  %.pn54 = phi { ptr, i32 } [ %26, %25 ], [ %24, %23 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #7
  br label %100

.preheader58:                                     ; preds = %._crit_edge, %._crit_edge63
  %28 = phi i32 [ %38, %._crit_edge63 ], [ %12, %._crit_edge ]
  %.03666 = phi i32 [ %.137.lcssa, %._crit_edge63 ], [ 0, %._crit_edge ]
  %.03865 = phi i32 [ %39, %._crit_edge63 ], [ 1, %._crit_edge ]
  %29 = sub nsw i32 %28, %.03865
  %.not73 = icmp eq i32 %29, 31
  br i1 %.not73, label %._crit_edge63, label %.lr.ph62.preheader

.lr.ph62.preheader:                               ; preds = %.preheader58
  %30 = sext i32 %.03666 to i64
  br label %.lr.ph62

._crit_edge67:                                    ; preds = %._crit_edge63, %._crit_edge
  %31 = load i32, ptr @que, align 16, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [524298 x i32], ptr @fa, i64 0, i64 %32
  store i32 -1, ptr %33, align 4, !tbaa !5
  %34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @q)
  %35 = load i32, ptr @q, align 4, !tbaa !5
  %36 = add nsw i32 %35, -1
  store i32 %36, ptr @q, align 4, !tbaa !5
  %.not4668 = icmp eq i32 %35, 0
  br i1 %.not4668, label %._crit_edge71, label %.lr.ph70

._crit_edge63.loopexit:                           ; preds = %54
  %37 = trunc nsw i64 %indvars.iv.next78 to i32
  br label %._crit_edge63

._crit_edge63:                                    ; preds = %._crit_edge63.loopexit, %.preheader58
  %38 = phi i32 [ %28, %.preheader58 ], [ %55, %._crit_edge63.loopexit ]
  %.137.lcssa = phi i32 [ %.03666, %.preheader58 ], [ %37, %._crit_edge63.loopexit ]
  %39 = add nuw nsw i32 %.03865, 1
  %.not.not = icmp slt i32 %.03865, %38
  br i1 %.not.not, label %.preheader58, label %._crit_edge67, !llvm.loop !11

.lr.ph62:                                         ; preds = %.lr.ph62.preheader, %54
  %40 = phi i32 [ %28, %.lr.ph62.preheader ], [ %55, %54 ]
  %41 = phi i32 [ %28, %.lr.ph62.preheader ], [ %56, %54 ]
  %indvars.iv77 = phi i64 [ %30, %.lr.ph62.preheader ], [ %indvars.iv.next78, %54 ]
  %indvars.iv75 = phi i64 [ 0, %.lr.ph62.preheader ], [ %indvars.iv.next76, %54 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %sext = shl i64 %indvars.iv75, 33
  %42 = ashr exact i64 %sext, 32
  %43 = getelementptr inbounds [524298 x i32], ptr @que, i64 0, i64 %42
  %44 = load i32, ptr %43, align 8, !tbaa !5
  store i32 %44, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %indvars.iv75.tr = trunc i64 %indvars.iv75 to i32
  %45 = shl i32 %indvars.iv75.tr, 1
  %46 = or disjoint i32 %45, 1
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [524298 x i32], ptr @que, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  store i32 %49, ptr %4, align 4, !tbaa !5
  %50 = getelementptr inbounds [524298 x i8], ptr @e, i64 0, i64 %indvars.iv77
  %51 = load i8, ptr %50, align 1, !tbaa !12
  %52 = icmp eq i8 %51, 76
  br i1 %52, label %53, label %54

53:                                               ; preds = %.lr.ph62
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4) #7
  %.pre = load i32, ptr %3, align 4, !tbaa !5
  %.pre82 = load i32, ptr %4, align 4, !tbaa !5
  %.pre83 = load i32, ptr @n, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %53, %.lr.ph62
  %55 = phi i32 [ %.pre83, %53 ], [ %40, %.lr.ph62 ]
  %56 = phi i32 [ %.pre83, %53 ], [ %41, %.lr.ph62 ]
  %57 = phi i32 [ %.pre82, %53 ], [ %49, %.lr.ph62 ]
  %58 = phi i32 [ %.pre, %53 ], [ %44, %.lr.ph62 ]
  %59 = sext i32 %57 to i64
  %60 = getelementptr inbounds [524298 x i32], ptr @fa, i64 0, i64 %59
  store i32 %58, ptr %60, align 4, !tbaa !5
  %61 = getelementptr inbounds [524298 x i32], ptr @que, i64 0, i64 %indvars.iv75
  store i32 %58, ptr %61, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %indvars.iv.next78 = add nsw i64 %indvars.iv77, 1
  %62 = sub nsw i32 %56, %.03865
  %63 = shl nuw i32 1, %62
  %64 = sext i32 %63 to i64
  %65 = icmp slt i64 %indvars.iv.next76, %64
  br i1 %65, label %.lr.ph62, label %._crit_edge63.loopexit, !llvm.loop !13

.lr.ph70:                                         ; preds = %._crit_edge67, %96
  %66 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @s, ptr noundef nonnull @t)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull @s, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %67 unwind label %76

67:                                               ; preds = %.lr.ph70
  %68 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4lessIS5_ESaISt4pairIKS5_iEEEixEOS5_(ptr noundef nonnull align 8 dereferenceable(48) @_Z4HashB5cxx11, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %69 unwind label %78

69:                                               ; preds = %67
  %70 = load i32, ptr %68, align 4, !tbaa !5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull @t, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %71 unwind label %81

71:                                               ; preds = %69
  %72 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4lessIS5_ESaISt4pairIKS5_iEEEixEOS5_(ptr noundef nonnull align 8 dereferenceable(48) @_Z4HashB5cxx11, ptr noundef nonnull align 8 dereferenceable(32) %7)
          to label %73 unwind label %83

73:                                               ; preds = %71
  %74 = load i32, ptr %72, align 4, !tbaa !5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #7
  %.not51 = icmp eq i32 %70, %74
  br i1 %.not51, label %75, label %.preheader57

75:                                               ; preds = %73
  call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.4, i32 noundef 36, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #8
  unreachable

76:                                               ; preds = %.lr.ph70
  %77 = landingpad { ptr, i32 }
          cleanup
  br label %80

78:                                               ; preds = %67
  %79 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #7
  br label %80

80:                                               ; preds = %78, %76
  %.pn = phi { ptr, i32 } [ %79, %78 ], [ %77, %76 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #7
  br label %100

81:                                               ; preds = %69
  %82 = landingpad { ptr, i32 }
          cleanup
  br label %85

83:                                               ; preds = %71
  %84 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  br label %85

85:                                               ; preds = %83, %81
  %.pn48 = phi { ptr, i32 } [ %84, %83 ], [ %82, %81 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #7
  br label %100

.preheader57:                                     ; preds = %73, %.preheader57
  %.pn52.in = phi i32 [ %.0, %.preheader57 ], [ %74, %73 ]
  %.pn52 = sext i32 %.pn52.in to i64
  %.0.in = getelementptr inbounds [524298 x i32], ptr @fa, i64 0, i64 %.pn52
  %.0 = load i32, ptr %.0.in, align 4, !tbaa !5
  %86 = icmp ne i32 %.0, -1
  %87 = icmp ne i32 %.0, %70
  %88 = select i1 %86, i1 %87, i1 false
  br i1 %88, label %.preheader57, label %89, !llvm.loop !14

89:                                               ; preds = %.preheader57
  %90 = icmp eq i32 %.0, %70
  br i1 %90, label %96, label %.preheader, !llvm.loop !15

.preheader:                                       ; preds = %89, %.preheader
  %.pn53.in = phi i32 [ %.1, %.preheader ], [ %70, %89 ]
  %.pn53 = sext i32 %.pn53.in to i64
  %.1.in = getelementptr inbounds [524298 x i32], ptr @fa, i64 0, i64 %.pn53
  %.1 = load i32, ptr %.1.in, align 4, !tbaa !5
  %91 = icmp ne i32 %.1, -1
  %92 = icmp ne i32 %.1, %74
  %93 = select i1 %91, i1 %92, i1 false
  br i1 %93, label %.preheader, label %94, !llvm.loop !16

94:                                               ; preds = %.preheader
  %95 = icmp eq i32 %.1, %74
  %.str.6..str.7 = select i1 %95, ptr @.str.6, ptr @.str.7
  br label %96, !llvm.loop !15

96:                                               ; preds = %94, %89
  %.str.7.sink = phi ptr [ @.str.5, %89 ], [ %.str.6..str.7, %94 ]
  %97 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.7.sink)
  %98 = load i32, ptr @q, align 4, !tbaa !5
  %99 = add nsw i32 %98, -1
  store i32 %99, ptr @q, align 4, !tbaa !5
  %.not46 = icmp eq i32 %98, 0
  br i1 %.not46, label %._crit_edge71, label %.lr.ph70

._crit_edge71:                                    ; preds = %96, %._crit_edge67
  ret i32 0

100:                                              ; preds = %80, %85, %27
  %.pn54.pn = phi { ptr, i32 } [ %.pn54, %27 ], [ %.pn48, %85 ], [ %.pn, %80 ]
  resume { ptr, i32 } %.pn54.pn
}

; 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 uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4lessIS5_ESaISt4pairIKS5_iEEEixEOS5_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4 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 nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #6

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

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { noreturn 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 #7 = { nounwind }
attributes #8 = { noreturn 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 = distinct !{!11, !10}
!12 = !{!7, !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}


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