; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/300/Problem D (D)

; 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::__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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int>>, std::less<std::pair<int, int>>>::_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::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"struct.std::pair" = type { i32, i32 }
%"struct.std::pair.6" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@cnt = external dso_local global i32, align 4
@_Z1sB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@b = external dso_local global [50 x [50 x i32]], align 16
@a = external dso_local global [101 x [101 x i32]], align 16
@valid = external dso_local global %"class.std::vector", align 8
@ss = external dso_local global %"class.std::set", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z7inrangeii(i32 noundef, i32 noundef) #0

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

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

26:                                               ; preds = %22
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %73

27:                                               ; preds = %22
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %29

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

33:                                               ; preds = %29
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %69

34:                                               ; preds = %29
  %35 = load i32, ptr %4, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %36)
  %38 = load i8, ptr %37, align 1, !tbaa !9
  %39 = sext i8 %38 to i32
  %40 = icmp eq i32 %39, 111
  br i1 %40, label %41, label %48

41:                                               ; preds = %34
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [50 x [50 x i32]], ptr @b, i64 0, i64 %43
  %45 = load i32, ptr %4, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [50 x i32], ptr %44, i64 0, i64 %46
  store i32 1, ptr %47, align 4, !tbaa !5
  br label %65

48:                                               ; preds = %34
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %50)
  %52 = load i8, ptr %51, align 1, !tbaa !9
  %53 = sext i8 %52 to i32
  %54 = icmp eq i32 %53, 120
  br i1 %54, label %55, label %64

55:                                               ; preds = %48
  %56 = load i32, ptr %2, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [50 x [50 x i32]], ptr @b, i64 0, i64 %57
  %59 = load i32, ptr %4, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [50 x i32], ptr %58, i64 0, i64 %60
  store i32 2, ptr %61, align 4, !tbaa !5
  %62 = load i32, ptr @cnt, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr @cnt, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %55, %48
  br label %65

65:                                               ; preds = %64, %41
  br label %66

66:                                               ; preds = %65
  %67 = load i32, ptr %4, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %4, align 4, !tbaa !5
  br label %29, !llvm.loop !10

69:                                               ; preds = %33
  br label %70

70:                                               ; preds = %69
  %71 = load i32, ptr %2, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %2, align 4, !tbaa !5
  br label %22, !llvm.loop !12

73:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %74 = load i32, ptr @n, align 4, !tbaa !5
  %75 = sub nsw i32 1, %74
  store i32 %75, ptr %5, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %223, %73
  %77 = load i32, ptr %5, align 4, !tbaa !5
  %78 = load i32, ptr @n, align 4, !tbaa !5
  %79 = icmp slt i32 %77, %78
  br i1 %79, label %81, label %80

80:                                               ; preds = %76
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %226

81:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %82 = load i32, ptr @n, align 4, !tbaa !5
  %83 = sub nsw i32 1, %82
  store i32 %83, ptr %6, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %219, %81
  %85 = load i32, ptr %6, align 4, !tbaa !5
  %86 = load i32, ptr @n, align 4, !tbaa !5
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %89, label %88

88:                                               ; preds = %84
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %222

89:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #6
  store i8 1, ptr %7, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #6
  store i8 0, ptr %8, align 1, !tbaa !13
  %90 = load i32, ptr %5, align 4, !tbaa !5
  %91 = icmp eq i32 %90, 0
  br i1 %91, label %92, label %96

92:                                               ; preds = %89
  %93 = load i32, ptr %6, align 4, !tbaa !5
  %94 = icmp eq i32 %93, 0
  br i1 %94, label %95, label %96

95:                                               ; preds = %92
  store i32 13, ptr %3, align 4
  br label %216

96:                                               ; preds = %92, %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %97

97:                                               ; preds = %146, %96
  %98 = load i32, ptr %9, align 4, !tbaa !5
  %99 = load i32, ptr @n, align 4, !tbaa !5
  %100 = icmp slt i32 %98, %99
  br i1 %100, label %102, label %101

101:                                              ; preds = %97
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %149

102:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %142, %102
  %104 = load i32, ptr %10, align 4, !tbaa !5
  %105 = load i32, ptr @n, align 4, !tbaa !5
  %106 = icmp slt i32 %104, %105
  br i1 %106, label %108, label %107

107:                                              ; preds = %103
  store i32 17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %145

108:                                              ; preds = %103
  %109 = load i32, ptr %9, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [50 x [50 x i32]], ptr @b, i64 0, i64 %110
  %112 = load i32, ptr %10, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [50 x i32], ptr %111, i64 0, i64 %113
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = icmp eq i32 %115, 1
  br i1 %116, label %117, label %141

117:                                              ; preds = %108
  %118 = load i32, ptr %9, align 4, !tbaa !5
  %119 = load i32, ptr %5, align 4, !tbaa !5
  %120 = add nsw i32 %118, %119
  %121 = load i32, ptr %10, align 4, !tbaa !5
  %122 = load i32, ptr %6, align 4, !tbaa !5
  %123 = add nsw i32 %121, %122
  %124 = call noundef zeroext i1 @_Z7inrangeii(i32 noundef %120, i32 noundef %123)
  br i1 %124, label %125, label %141

125:                                              ; preds = %117
  %126 = load i32, ptr %9, align 4, !tbaa !5
  %127 = load i32, ptr %5, align 4, !tbaa !5
  %128 = add nsw i32 %126, %127
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [50 x [50 x i32]], ptr @b, i64 0, i64 %129
  %131 = load i32, ptr %10, align 4, !tbaa !5
  %132 = load i32, ptr %6, align 4, !tbaa !5
  %133 = add nsw i32 %131, %132
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [50 x i32], ptr %130, i64 0, i64 %134
  %136 = load i32, ptr %135, align 4, !tbaa !5
  %137 = icmp eq i32 %136, 0
  br i1 %137, label %138, label %139

138:                                              ; preds = %125
  store i8 0, ptr %7, align 1, !tbaa !13
  br label %140

139:                                              ; preds = %125
  store i8 1, ptr %8, align 1, !tbaa !13
  br label %140

140:                                              ; preds = %139, %138
  br label %141

141:                                              ; preds = %140, %117, %108
  br label %142

142:                                              ; preds = %141
  %143 = load i32, ptr %10, align 4, !tbaa !5
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %10, align 4, !tbaa !5
  br label %103, !llvm.loop !15

145:                                              ; preds = %107
  br label %146

146:                                              ; preds = %145
  %147 = load i32, ptr %9, align 4, !tbaa !5
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %9, align 4, !tbaa !5
  br label %97, !llvm.loop !16

149:                                              ; preds = %101
  %150 = load i8, ptr %7, align 1, !tbaa !13, !range !17, !noundef !18
  %151 = trunc i8 %150 to i1
  br i1 %151, label %152, label %215

152:                                              ; preds = %149
  %153 = load i8, ptr %8, align 1, !tbaa !13, !range !17, !noundef !18
  %154 = trunc i8 %153 to i1
  br i1 %154, label %155, label %215

155:                                              ; preds = %152
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %156 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  store i64 %156, ptr %11, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @valid, ptr noundef nonnull align 4 dereferenceable(8) %11)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %157

157:                                              ; preds = %211, %155
  %158 = load i32, ptr %12, align 4, !tbaa !5
  %159 = load i32, ptr @n, align 4, !tbaa !5
  %160 = icmp slt i32 %158, %159
  br i1 %160, label %162, label %161

161:                                              ; preds = %157
  store i32 20, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %214

162:                                              ; preds = %157
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %163

163:                                              ; preds = %207, %162
  %164 = load i32, ptr %13, align 4, !tbaa !5
  %165 = load i32, ptr @n, align 4, !tbaa !5
  %166 = icmp slt i32 %164, %165
  br i1 %166, label %168, label %167

167:                                              ; preds = %163
  store i32 23, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %210

168:                                              ; preds = %163
  %169 = load i32, ptr %12, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [50 x [50 x i32]], ptr @b, i64 0, i64 %170
  %172 = load i32, ptr %13, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [50 x i32], ptr %171, i64 0, i64 %173
  %175 = load i32, ptr %174, align 4, !tbaa !5
  %176 = icmp eq i32 %175, 2
  br i1 %176, label %177, label %206

177:                                              ; preds = %168
  %178 = load i32, ptr %12, align 4, !tbaa !5
  %179 = load i32, ptr %5, align 4, !tbaa !5
  %180 = sub nsw i32 %178, %179
  %181 = load i32, ptr %13, align 4, !tbaa !5
  %182 = load i32, ptr %6, align 4, !tbaa !5
  %183 = sub nsw i32 %181, %182
  %184 = call noundef zeroext i1 @_Z7inrangeii(i32 noundef %180, i32 noundef %183)
  br i1 %184, label %185, label %206

185:                                              ; preds = %177
  %186 = load i32, ptr %12, align 4, !tbaa !5
  %187 = load i32, ptr %5, align 4, !tbaa !5
  %188 = sub nsw i32 %186, %187
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [50 x [50 x i32]], ptr @b, i64 0, i64 %189
  %191 = load i32, ptr %13, align 4, !tbaa !5
  %192 = load i32, ptr %6, align 4, !tbaa !5
  %193 = sub nsw i32 %191, %192
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [50 x i32], ptr %190, i64 0, i64 %194
  %196 = load i32, ptr %195, align 4, !tbaa !5
  %197 = icmp eq i32 %196, 1
  br i1 %197, label %198, label %205

198:                                              ; preds = %185
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %199 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %13)
  store i64 %199, ptr %14, align 4
  %200 = call { ptr, i8 } @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @ss, ptr noundef nonnull align 4 dereferenceable(8) %14)
  %201 = getelementptr inbounds { ptr, i8 }, ptr %15, i32 0, i32 0
  %202 = extractvalue { ptr, i8 } %200, 0
  store ptr %202, ptr %201, align 8
  %203 = getelementptr inbounds { ptr, i8 }, ptr %15, i32 0, i32 1
  %204 = extractvalue { ptr, i8 } %200, 1
  store i8 %204, ptr %203, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %205

205:                                              ; preds = %198, %185
  br label %206

206:                                              ; preds = %205, %177, %168
  br label %207

207:                                              ; preds = %206
  %208 = load i32, ptr %13, align 4, !tbaa !5
  %209 = add nsw i32 %208, 1
  store i32 %209, ptr %13, align 4, !tbaa !5
  br label %163, !llvm.loop !19

210:                                              ; preds = %167
  br label %211

211:                                              ; preds = %210
  %212 = load i32, ptr %12, align 4, !tbaa !5
  %213 = add nsw i32 %212, 1
  store i32 %213, ptr %12, align 4, !tbaa !5
  br label %157, !llvm.loop !20

214:                                              ; preds = %161
  br label %215

215:                                              ; preds = %214, %152, %149
  store i32 0, ptr %3, align 4
  br label %216

216:                                              ; preds = %215, %95
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #6
  %217 = load i32, ptr %3, align 4
  switch i32 %217, label %331 [
    i32 0, label %218
    i32 13, label %219
  ]

218:                                              ; preds = %216
  br label %219

219:                                              ; preds = %218, %216
  %220 = load i32, ptr %6, align 4, !tbaa !5
  %221 = add nsw i32 %220, 1
  store i32 %221, ptr %6, align 4, !tbaa !5
  br label %84, !llvm.loop !21

222:                                              ; preds = %88
  br label %223

223:                                              ; preds = %222
  %224 = load i32, ptr %5, align 4, !tbaa !5
  %225 = add nsw i32 %224, 1
  store i32 %225, ptr %5, align 4, !tbaa !5
  br label %76, !llvm.loop !22

226:                                              ; preds = %80
  %227 = call noundef i64 @_ZNKSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) @ss) #6
  %228 = load i32, ptr @cnt, align 4, !tbaa !5
  %229 = sext i32 %228 to i64
  %230 = icmp ne i64 %227, %229
  br i1 %230, label %237, label %231

231:                                              ; preds = %226
  %232 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @valid) #6
  %233 = icmp eq i64 %232, 0
  br i1 %233, label %234, label %239

234:                                              ; preds = %231
  %235 = load i32, ptr @cnt, align 4, !tbaa !5
  %236 = icmp sgt i32 %235, 0
  br i1 %236, label %237, label %239

237:                                              ; preds = %234, %226
  %238 = call i32 @puts(ptr noundef @.str.4)
  store i32 0, ptr %1, align 4
  br label %329

239:                                              ; preds = %234, %231
  %240 = call i32 @puts(ptr noundef @.str.5)
  %241 = load i32, ptr @n, align 4, !tbaa !5
  %242 = sub nsw i32 %241, 1
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %243
  %245 = load i32, ptr @n, align 4, !tbaa !5
  %246 = sub nsw i32 %245, 1
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds [101 x i32], ptr %244, i64 0, i64 %247
  store i32 1, ptr %248, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %249 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @valid) #6
  %250 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %249, ptr %250, align 8
  br label %251

251:                                              ; preds = %273, %239
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %252 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @valid) #6
  %253 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  store ptr %252, ptr %253, align 8
  %254 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br i1 %254, label %256, label %255

255:                                              ; preds = %251
  store i32 26, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %276

256:                                              ; preds = %251
  %257 = load i32, ptr @n, align 4, !tbaa !5
  %258 = sub nsw i32 %257, 1
  %259 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #6
  %260 = getelementptr inbounds %"struct.std::pair", ptr %259, i32 0, i32 0
  %261 = load i32, ptr %260, align 4, !tbaa !23
  %262 = add nsw i32 %258, %261
  %263 = sext i32 %262 to i64
  %264 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %263
  %265 = load i32, ptr @n, align 4, !tbaa !5
  %266 = sub nsw i32 %265, 1
  %267 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #6
  %268 = getelementptr inbounds %"struct.std::pair", ptr %267, i32 0, i32 1
  %269 = load i32, ptr %268, align 4, !tbaa !25
  %270 = add nsw i32 %266, %269
  %271 = sext i32 %270 to i64
  %272 = getelementptr inbounds [101 x i32], ptr %264, i64 0, i64 %271
  store i32 2, ptr %272, align 4, !tbaa !5
  br label %273

273:                                              ; preds = %256
  %274 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %16, i32 noundef 0) #6
  %275 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %18, i32 0, i32 0
  store ptr %274, ptr %275, align 8
  br label %251, !llvm.loop !26

276:                                              ; preds = %255
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 0, ptr %19, align 4, !tbaa !5
  br label %277

277:                                              ; preds = %325, %276
  %278 = load i32, ptr %19, align 4, !tbaa !5
  %279 = load i32, ptr @n, align 4, !tbaa !5
  %280 = load i32, ptr @n, align 4, !tbaa !5
  %281 = add nsw i32 %279, %280
  %282 = sub nsw i32 %281, 1
  %283 = icmp slt i32 %278, %282
  br i1 %283, label %285, label %284

284:                                              ; preds = %277
  store i32 29, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %328

285:                                              ; preds = %277
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %286

286:                                              ; preds = %320, %285
  %287 = load i32, ptr %20, align 4, !tbaa !5
  %288 = load i32, ptr @n, align 4, !tbaa !5
  %289 = load i32, ptr @n, align 4, !tbaa !5
  %290 = add nsw i32 %288, %289
  %291 = sub nsw i32 %290, 1
  %292 = icmp slt i32 %287, %291
  br i1 %292, label %294, label %293

293:                                              ; preds = %286
  store i32 32, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %323

294:                                              ; preds = %286
  %295 = load i32, ptr %19, align 4, !tbaa !5
  %296 = sext i32 %295 to i64
  %297 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %296
  %298 = load i32, ptr %20, align 4, !tbaa !5
  %299 = sext i32 %298 to i64
  %300 = getelementptr inbounds [101 x i32], ptr %297, i64 0, i64 %299
  %301 = load i32, ptr %300, align 4, !tbaa !5
  %302 = icmp eq i32 %301, 0
  br i1 %302, label %303, label %305

303:                                              ; preds = %294
  %304 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  br label %319

305:                                              ; preds = %294
  %306 = load i32, ptr %19, align 4, !tbaa !5
  %307 = sext i32 %306 to i64
  %308 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %307
  %309 = load i32, ptr %20, align 4, !tbaa !5
  %310 = sext i32 %309 to i64
  %311 = getelementptr inbounds [101 x i32], ptr %308, i64 0, i64 %310
  %312 = load i32, ptr %311, align 4, !tbaa !5
  %313 = icmp eq i32 %312, 2
  br i1 %313, label %314, label %316

314:                                              ; preds = %305
  %315 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  br label %318

316:                                              ; preds = %305
  %317 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  br label %318

318:                                              ; preds = %316, %314
  br label %319

319:                                              ; preds = %318, %303
  br label %320

320:                                              ; preds = %319
  %321 = load i32, ptr %20, align 4, !tbaa !5
  %322 = add nsw i32 %321, 1
  store i32 %322, ptr %20, align 4, !tbaa !5
  br label %286, !llvm.loop !27

323:                                              ; preds = %293
  %324 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  br label %325

325:                                              ; preds = %323
  %326 = load i32, ptr %19, align 4, !tbaa !5
  %327 = add nsw i32 %326, 1
  store i32 %327, ptr %19, align 4, !tbaa !5
  br label %277, !llvm.loop !28

328:                                              ; preds = %284
  store i32 0, ptr %1, align 4
  br label %329

329:                                              ; preds = %328, %237
  %330 = load i32, ptr %1, align 4
  ret i32 %330

331:                                              ; preds = %216
  unreachable
}

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #2

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(8)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #4

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

declare i32 @puts(ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

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

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

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

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 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = { 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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = distinct !{!19, !11}
!20 = distinct !{!20, !11}
!21 = distinct !{!21, !11}
!22 = distinct !{!22, !11}
!23 = !{!24, !6, i64 0}
!24 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!25 = !{!24, !6, i64 4}
!26 = distinct !{!26, !11}
!27 = distinct !{!27, !11}
!28 = distinct !{!28, !11}


; 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::__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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int>>, std::less<std::pair<int, int>>>::_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::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"struct.std::pair" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@cnt = external dso_local local_unnamed_addr global i32, align 4
@_Z1sB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@b = external dso_local local_unnamed_addr global [50 x [50 x i32]], align 16
@a = external dso_local local_unnamed_addr global [101 x [101 x i32]], align 16
@valid = external dso_local global %"class.std::vector", align 8
@ss = external dso_local global %"class.std::set", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z7inrangeii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"struct.std::pair", align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %10 = load i32, ptr @n, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph56, label %._crit_edge57

._crit_edge57:                                    ; preds = %._crit_edge, %0
  %12 = phi i32 [ %10, %0 ], [ %18, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %13 = sub nsw i32 1, %12
  store i32 %13, ptr %1, align 4, !tbaa !5
  %14 = icmp slt i32 %13, %12
  br i1 %14, label %.lr.ph85, label %._crit_edge86

.lr.ph56:                                         ; preds = %0, %._crit_edge
  %indvars.iv98 = phi i64 [ %indvars.iv.next99, %._crit_edge ], [ 0, %0 ]
  %15 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11)
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph, label %.lr.ph56.._crit_edge_crit_edge

.lr.ph56.._crit_edge_crit_edge:                   ; preds = %.lr.ph56
  %.pre114 = sext i32 %16 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %33, %.lr.ph56.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre114, %.lr.ph56.._crit_edge_crit_edge ], [ %35, %33 ]
  %18 = phi i32 [ %16, %.lr.ph56.._crit_edge_crit_edge ], [ %34, %33 ]
  %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
  %19 = icmp slt i64 %indvars.iv.next99, %.pre-phi
  br i1 %19, label %.lr.ph56, label %._crit_edge57, !llvm.loop !9

.lr.ph:                                           ; preds = %.lr.ph56, %33
  %indvars.iv = phi i64 [ %indvars.iv.next, %33 ], [ 0, %.lr.ph56 ]
  %20 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %indvars.iv)
  %21 = load i8, ptr %20, align 1, !tbaa !11
  %22 = icmp eq i8 %21, 111
  br i1 %22, label %23, label %25

23:                                               ; preds = %.lr.ph
  %24 = getelementptr inbounds [50 x [50 x i32]], ptr @b, i64 0, i64 %indvars.iv98, i64 %indvars.iv
  store i32 1, ptr %24, align 4, !tbaa !5
  br label %33

25:                                               ; preds = %.lr.ph
  %26 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %indvars.iv)
  %27 = load i8, ptr %26, align 1, !tbaa !11
  %28 = icmp eq i8 %27, 120
  br i1 %28, label %29, label %33

29:                                               ; preds = %25
  %30 = getelementptr inbounds [50 x [50 x i32]], ptr @b, i64 0, i64 %indvars.iv98, i64 %indvars.iv
  store i32 2, ptr %30, align 4, !tbaa !5
  %31 = load i32, ptr @cnt, align 4, !tbaa !5
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr @cnt, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %23, %29, %25
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %34 = load i32, ptr @n, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = icmp slt i64 %indvars.iv.next, %35
  br i1 %36, label %.lr.ph, label %._crit_edge, !llvm.loop !12

._crit_edge86:                                    ; preds = %._crit_edge83, %._crit_edge57
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %37 = call noundef i64 @_ZNKSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) @ss) #7
  %38 = load i32, ptr @cnt, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %.not = icmp eq i64 %37, %39
  br i1 %.not, label %136, label %141

.lr.ph85:                                         ; preds = %._crit_edge57, %._crit_edge83
  %40 = phi i32 [ %44, %._crit_edge83 ], [ %12, %._crit_edge57 ]
  %41 = phi i32 [ %46, %._crit_edge83 ], [ %13, %._crit_edge57 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %42 = sub nsw i32 1, %40
  store i32 %42, ptr %2, align 4, !tbaa !5
  %43 = icmp slt i32 %42, %40
  br i1 %43, label %.lr.ph82, label %._crit_edge83

._crit_edge83.loopexit:                           ; preds = %._crit_edge68.thread
  %.pre113 = load i32, ptr %1, align 4, !tbaa !5
  br label %._crit_edge83

._crit_edge83:                                    ; preds = %._crit_edge83.loopexit, %.lr.ph85
  %44 = phi i32 [ %131, %._crit_edge83.loopexit ], [ %40, %.lr.ph85 ]
  %45 = phi i32 [ %.pre113, %._crit_edge83.loopexit ], [ %41, %.lr.ph85 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %1, align 4, !tbaa !5
  %47 = icmp slt i32 %46, %44
  br i1 %47, label %.lr.ph85, label %._crit_edge86, !llvm.loop !13

.lr.ph82:                                         ; preds = %.lr.ph85, %._crit_edge68.thread
  %48 = phi i32 [ %131, %._crit_edge68.thread ], [ %40, %.lr.ph85 ]
  %49 = phi i32 [ %132, %._crit_edge68.thread ], [ %40, %.lr.ph85 ]
  %storemerge4880 = phi i32 [ %134, %._crit_edge68.thread ], [ %42, %.lr.ph85 ]
  %50 = load i32, ptr %1, align 4, !tbaa !5
  %51 = or i32 %50, %storemerge4880
  %or.cond = icmp ne i32 %51, 0
  %52 = icmp sgt i32 %49, 0
  %or.cond128 = and i1 %or.cond, %52
  br i1 %or.cond128, label %.preheader51, label %._crit_edge68.thread

.preheader51:                                     ; preds = %.lr.ph82, %._crit_edge62
  %53 = phi i32 [ %59, %._crit_edge62 ], [ %48, %.lr.ph82 ]
  %54 = phi i32 [ %60, %._crit_edge62 ], [ %49, %.lr.ph82 ]
  %55 = phi i32 [ %61, %._crit_edge62 ], [ %49, %.lr.ph82 ]
  %indvars.iv103 = phi i64 [ %indvars.iv.next104, %._crit_edge62 ], [ 0, %.lr.ph82 ]
  %.04066 = phi i1 [ %.1.lcssa, %._crit_edge62 ], [ false, %.lr.ph82 ]
  %.04165 = phi i1 [ %.142.lcssa, %._crit_edge62 ], [ true, %.lr.ph82 ]
  %56 = icmp sgt i32 %55, 0
  br i1 %56, label %.lr.ph61, label %.preheader51.._crit_edge62_crit_edge

.preheader51.._crit_edge62_crit_edge:             ; preds = %.preheader51
  %.pre115 = sext i32 %55 to i64
  br label %._crit_edge62

.lr.ph61:                                         ; preds = %.preheader51
  %57 = trunc nuw nsw i64 %indvars.iv103 to i32
  br label %63

._crit_edge68:                                    ; preds = %._crit_edge62
  %58 = select i1 %.142.lcssa, i1 %.1.lcssa, i1 false
  br i1 %58, label %88, label %._crit_edge68.thread

._crit_edge62:                                    ; preds = %84, %.preheader51.._crit_edge62_crit_edge
  %.pre-phi116 = phi i64 [ %.pre115, %.preheader51.._crit_edge62_crit_edge ], [ %86, %84 ]
  %59 = phi i32 [ %53, %.preheader51.._crit_edge62_crit_edge ], [ %85, %84 ]
  %60 = phi i32 [ %54, %.preheader51.._crit_edge62_crit_edge ], [ %85, %84 ]
  %61 = phi i32 [ %55, %.preheader51.._crit_edge62_crit_edge ], [ %85, %84 ]
  %.142.lcssa = phi i1 [ %.04165, %.preheader51.._crit_edge62_crit_edge ], [ %.243, %84 ]
  %.1.lcssa = phi i1 [ %.04066, %.preheader51.._crit_edge62_crit_edge ], [ %.2, %84 ]
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
  %62 = icmp slt i64 %indvars.iv.next104, %.pre-phi116
  br i1 %62, label %.preheader51, label %._crit_edge68, !llvm.loop !14

63:                                               ; preds = %.lr.ph61, %84
  %indvars.iv101 = phi i64 [ 0, %.lr.ph61 ], [ %indvars.iv.next102, %84 ]
  %.159 = phi i1 [ %.04066, %.lr.ph61 ], [ %.2, %84 ]
  %.14258 = phi i1 [ %.04165, %.lr.ph61 ], [ %.243, %84 ]
  %64 = getelementptr inbounds [50 x [50 x i32]], ptr @b, i64 0, i64 %indvars.iv103, i64 %indvars.iv101
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = icmp eq i32 %65, 1
  br i1 %66, label %67, label %84

67:                                               ; preds = %63
  %68 = load i32, ptr %1, align 4, !tbaa !5
  %69 = add nsw i32 %68, %57
  %70 = load i32, ptr %2, align 4, !tbaa !5
  %71 = trunc nuw nsw i64 %indvars.iv101 to i32
  %72 = add nsw i32 %70, %71
  %73 = call noundef zeroext i1 @_Z7inrangeii(i32 noundef %69, i32 noundef %72)
  br i1 %73, label %74, label %84

74:                                               ; preds = %67
  %75 = load i32, ptr %1, align 4, !tbaa !5
  %76 = add nsw i32 %75, %57
  %77 = sext i32 %76 to i64
  %78 = load i32, ptr %2, align 4, !tbaa !5
  %79 = add nsw i32 %78, %71
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [50 x [50 x i32]], ptr @b, i64 0, i64 %77, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = icmp ne i32 %82, 0
  %..142 = select i1 %83, i1 %.14258, i1 false
  %.1. = select i1 %83, i1 true, i1 %.159
  br label %84

84:                                               ; preds = %74, %63, %67
  %.243 = phi i1 [ %.14258, %67 ], [ %.14258, %63 ], [ %..142, %74 ]
  %.2 = phi i1 [ %.159, %67 ], [ %.159, %63 ], [ %.1., %74 ]
  %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
  %85 = load i32, ptr @n, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = icmp slt i64 %indvars.iv.next102, %86
  br i1 %87, label %63, label %._crit_edge62, !llvm.loop !16

88:                                               ; preds = %._crit_edge68
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %89 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i64 %89, ptr %3, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @valid, ptr noundef nonnull align 4 dereferenceable(8) %3)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  store i32 0, ptr %4, align 4, !tbaa !5
  %90 = load i32, ptr @n, align 4, !tbaa !5
  %91 = icmp sgt i32 %90, 0
  br i1 %91, label %.lr.ph77.split, label %._crit_edge78

._crit_edge78:                                    ; preds = %._crit_edge75, %88
  %92 = phi i32 [ %90, %88 ], [ %96, %._crit_edge75 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  br label %._crit_edge68.thread

.lr.ph77.split:                                   ; preds = %88, %._crit_edge75
  %93 = phi i32 [ %96, %._crit_edge75 ], [ %90, %88 ]
  %94 = phi i32 [ %98, %._crit_edge75 ], [ 0, %88 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  store i32 0, ptr %5, align 4, !tbaa !5
  %95 = icmp sgt i32 %93, 0
  br i1 %95, label %.lr.ph74, label %._crit_edge75

._crit_edge75.loopexit:                           ; preds = %126
  %.pre112 = load i32, ptr %4, align 4, !tbaa !5
  br label %._crit_edge75

._crit_edge75:                                    ; preds = %._crit_edge75.loopexit, %.lr.ph77.split
  %96 = phi i32 [ %129, %._crit_edge75.loopexit ], [ %93, %.lr.ph77.split ]
  %97 = phi i32 [ %.pre112, %._crit_edge75.loopexit ], [ %94, %.lr.ph77.split ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %4, align 4, !tbaa !5
  %99 = icmp slt i32 %98, %96
  br i1 %99, label %.lr.ph77.split, label %._crit_edge78, !llvm.loop !17

.lr.ph74:                                         ; preds = %.lr.ph77.split, %126
  %storemerge5072 = phi i32 [ %128, %126 ], [ 0, %.lr.ph77.split ]
  %100 = load i32, ptr %4, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = sext i32 %storemerge5072 to i64
  %103 = getelementptr inbounds [50 x [50 x i32]], ptr @b, i64 0, i64 %101, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = icmp eq i32 %104, 2
  br i1 %105, label %106, label %126

106:                                              ; preds = %.lr.ph74
  %107 = load i32, ptr %1, align 4, !tbaa !5
  %108 = sub nsw i32 %100, %107
  %109 = load i32, ptr %2, align 4, !tbaa !5
  %110 = sub nsw i32 %storemerge5072, %109
  %111 = call noundef zeroext i1 @_Z7inrangeii(i32 noundef %108, i32 noundef %110)
  %.pre111 = load i32, ptr %5, align 4, !tbaa !5
  br i1 %111, label %112, label %126

112:                                              ; preds = %106
  %113 = load i32, ptr %4, align 4, !tbaa !5
  %114 = load i32, ptr %1, align 4, !tbaa !5
  %115 = sub nsw i32 %113, %114
  %116 = sext i32 %115 to i64
  %117 = load i32, ptr %2, align 4, !tbaa !5
  %118 = sub nsw i32 %.pre111, %117
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [50 x [50 x i32]], ptr @b, i64 0, i64 %116, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %122 = icmp eq i32 %121, 1
  br i1 %122, label %123, label %126

123:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %124 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  store i64 %124, ptr %6, align 8
  %125 = call { ptr, i8 } @_ZNSt3setISt4pairIiiESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) @ss, ptr noundef nonnull align 4 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  %.pre = load i32, ptr %5, align 4, !tbaa !5
  br label %126

126:                                              ; preds = %.lr.ph74, %106, %123, %112
  %127 = phi i32 [ %storemerge5072, %.lr.ph74 ], [ %.pre111, %106 ], [ %.pre, %123 ], [ %.pre111, %112 ]
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr %5, align 4, !tbaa !5
  %129 = load i32, ptr @n, align 4, !tbaa !5
  %130 = icmp slt i32 %128, %129
  br i1 %130, label %.lr.ph74, label %._crit_edge75.loopexit, !llvm.loop !18

._crit_edge68.thread:                             ; preds = %._crit_edge68, %._crit_edge78, %.lr.ph82
  %131 = phi i32 [ %59, %._crit_edge68 ], [ %92, %._crit_edge78 ], [ %48, %.lr.ph82 ]
  %132 = phi i32 [ %60, %._crit_edge68 ], [ %92, %._crit_edge78 ], [ %49, %.lr.ph82 ]
  %133 = load i32, ptr %2, align 4, !tbaa !5
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %2, align 4, !tbaa !5
  %135 = icmp slt i32 %134, %132
  br i1 %135, label %.lr.ph82, label %._crit_edge83.loopexit, !llvm.loop !19

136:                                              ; preds = %._crit_edge86
  %137 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @valid) #7
  %138 = icmp eq i64 %137, 0
  %139 = load i32, ptr @cnt, align 4
  %140 = icmp sgt i32 %139, 0
  %or.cond3 = select i1 %138, i1 %140, i1 false
  br i1 %or.cond3, label %141, label %143

141:                                              ; preds = %136, %._crit_edge86
  %142 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.4)
  br label %.loopexit

143:                                              ; preds = %136
  %144 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.5)
  %145 = load i32, ptr @n, align 4, !tbaa !5
  %146 = add nsw i32 %145, -1
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %147, i64 %147
  store i32 1, ptr %148, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %149 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @valid) #7
  store ptr %149, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %150 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @valid) #7
  store ptr %150, ptr %8, align 8
  %151 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  br i1 %151, label %.lr.ph88, label %._crit_edge89

._crit_edge89:                                    ; preds = %.lr.ph88, %143
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  %152 = load i32, ptr @n, align 4, !tbaa !5
  %153 = icmp sgt i32 %152, 0
  br i1 %153, label %.preheader, label %.loopexit

.lr.ph88:                                         ; preds = %143, %.lr.ph88
  %154 = load i32, ptr @n, align 4, !tbaa !5
  %155 = add nsw i32 %154, -1
  %156 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %157 = load i32, ptr %156, align 4, !tbaa !20
  %158 = add nsw i32 %155, %157
  %159 = sext i32 %158 to i64
  %160 = load i32, ptr @n, align 4, !tbaa !5
  %161 = add nsw i32 %160, -1
  %162 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %163 = getelementptr inbounds i8, ptr %162, i64 4
  %164 = load i32, ptr %163, align 4, !tbaa !22
  %165 = add nsw i32 %161, %164
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %159, i64 %166
  store i32 2, ptr %167, align 4, !tbaa !5
  %168 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %7, i32 noundef 0) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %169 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @valid) #7
  store ptr %169, ptr %8, align 8
  %170 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  br i1 %170, label %.lr.ph88, label %._crit_edge89, !llvm.loop !23

.preheader:                                       ; preds = %._crit_edge89, %._crit_edge92
  %171 = phi i32 [ %174, %._crit_edge92 ], [ %152, %._crit_edge89 ]
  %indvars.iv108 = phi i64 [ %indvars.iv.next109, %._crit_edge92 ], [ 0, %._crit_edge89 ]
  %172 = icmp sgt i32 %171, 0
  br i1 %172, label %.lr.ph91, label %._crit_edge92

._crit_edge92:                                    ; preds = %.lr.ph91, %.preheader
  %173 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  %indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
  %174 = load i32, ptr @n, align 4, !tbaa !5
  %175 = shl nsw i32 %174, 1
  %176 = add nsw i32 %175, -1
  %177 = sext i32 %176 to i64
  %178 = icmp slt i64 %indvars.iv.next109, %177
  br i1 %178, label %.preheader, label %.loopexit, !llvm.loop !24

.lr.ph91:                                         ; preds = %.preheader, %.lr.ph91
  %indvars.iv105 = phi i64 [ %indvars.iv.next106, %.lr.ph91 ], [ 0, %.preheader ]
  %179 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %indvars.iv108, i64 %indvars.iv105
  %180 = load i32, ptr %179, align 4, !tbaa !5
  %switch.selectcmp = icmp eq i32 %180, 2
  %switch.select = select i1 %switch.selectcmp, ptr @.str.7, ptr @.str.8
  %switch.selectcmp129 = icmp eq i32 %180, 0
  %switch.select130 = select i1 %switch.selectcmp129, ptr @.str.6, ptr %switch.select
  %181 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %switch.select130)
  %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
  %182 = load i32, ptr @n, align 4, !tbaa !5
  %183 = shl nsw i32 %182, 1
  %184 = add nsw i32 %183, -1
  %185 = sext i32 %184 to i64
  %186 = icmp slt i64 %indvars.iv.next106, %185
  br i1 %186, label %.lr.ph91, label %._crit_edge92, !llvm.loop !25

.loopexit:                                        ; preds = %._crit_edge92, %._crit_edge89, %141
  ret i32 0
}

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

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

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

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

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 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 #2 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { "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 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 = { 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 #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 = 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}
!15 = !{!"llvm.loop.unswitch.partial.disable"}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !15}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = !{!21, !6, i64 0}
!21 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!22 = !{!21, !6, i64 4}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}


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