; LLVM IR from tangjz/acm-icpc :: lydsy (1097)

; 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::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 }
%"struct.std::pair" = type { i32, i32 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@msk = external dso_local global [21 x i32], align 16
@f = external dso_local global [21 x [524289 x i32]], align 16
@g = external dso_local global [21 x [23 x i32]], align 16
@e = external dso_local global [20001 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5solveiPi(i32 noundef, ptr noundef) #0

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::pair", align 4
  %6 = alloca %"struct.std::pair", 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 i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m, ptr noundef @k)
  br label %23

23:                                               ; preds = %27, %0
  %24 = load i32, ptr @m, align 4, !tbaa !5
  %25 = add nsw i32 %24, -1
  store i32 %25, ptr @m, align 4, !tbaa !5
  %26 = icmp ne i32 %24, 0
  br i1 %26, label %27, label %37

27:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3, ptr noundef %4)
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [20001 x %"class.std::vector"], ptr @e, i64 0, i64 %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %32 = 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) %3)
  store i64 %32, ptr %5, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %31, ptr noundef nonnull align 4 dereferenceable(8) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  %33 = load i32, ptr %3, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [20001 x %"class.std::vector"], ptr @e, i64 0, i64 %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %36 = 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) %2)
  store i64 %36, ptr %6, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %35, ptr noundef nonnull align 4 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %23, !llvm.loop !9

37:                                               ; preds = %23
  %38 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef @m)
  br label %39

39:                                               ; preds = %43, %37
  %40 = load i32, ptr @m, align 4, !tbaa !5
  %41 = add nsw i32 %40, -1
  store i32 %41, ptr @m, align 4, !tbaa !5
  %42 = icmp ne i32 %40, 0
  br i1 %42, label %43, label %54

43:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %44 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.4, ptr noundef %7, ptr noundef %8)
  %45 = load i32, ptr %7, align 4, !tbaa !5
  %46 = sub nsw i32 %45, 2
  %47 = shl i32 1, %46
  %48 = load i32, ptr %8, align 4, !tbaa !5
  %49 = sub nsw i32 %48, 2
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [21 x i32], ptr @msk, i64 0, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = or i32 %52, %47
  store i32 %53, ptr %51, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %39, !llvm.loop !11

54:                                               ; preds = %39
  %55 = load i32, ptr @k, align 4, !tbaa !5
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %64, label %57

57:                                               ; preds = %54
  call void @_Z5solveiPi(i32 noundef 1, ptr noundef @g)
  %58 = load i32, ptr @k, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [23 x i32], ptr @g, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %62)
  store i32 0, ptr %1, align 4
  br label %260

64:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %65 = load i32, ptr @k, align 4, !tbaa !5
  %66 = sub nsw i32 %65, 1
  %67 = shl i32 1, %66
  store i32 %67, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %107, %64
  %69 = load i32, ptr %10, align 4, !tbaa !5
  %70 = load i32, ptr @k, align 4, !tbaa !5
  %71 = icmp slt i32 %69, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %110

73:                                               ; preds = %68
  %74 = load i32, ptr %10, align 4, !tbaa !5
  %75 = add nsw i32 %74, 2
  %76 = load i32, ptr %10, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [21 x [23 x i32]], ptr @g, i64 0, i64 %77
  %79 = getelementptr inbounds [23 x i32], ptr %78, i64 0, i64 0
  call void @_Z5solveiPi(i32 noundef %75, ptr noundef %79)
  %80 = load i32, ptr %10, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [21 x [524289 x i32]], ptr @f, i64 0, i64 %81
  %83 = getelementptr inbounds [524289 x i32], ptr %82, i64 0, i64 0
  %84 = load i32, ptr %9, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = mul i64 %85, 4
  call void @llvm.memset.p0.i64(ptr align 4 %83, i8 63, i64 %86, i1 false)
  %87 = load i32, ptr %10, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [21 x i32], ptr @msk, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = icmp ne i32 %90, 0
  br i1 %91, label %92, label %93

92:                                               ; preds = %73
  br label %101

93:                                               ; preds = %73
  %94 = load i32, ptr %10, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [21 x [23 x i32]], ptr @g, i64 0, i64 %95
  %97 = load i32, ptr @k, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [23 x i32], ptr %96, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !5
  br label %101

101:                                              ; preds = %93, %92
  %102 = phi i32 [ 1061109567, %92 ], [ %100, %93 ]
  %103 = load i32, ptr %10, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [21 x [524289 x i32]], ptr @f, i64 0, i64 %104
  %106 = getelementptr inbounds [524289 x i32], ptr %105, i64 0, i64 0
  store i32 %102, ptr %106, align 4, !tbaa !5
  br label %107

107:                                              ; preds = %101
  %108 = load i32, ptr %10, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %10, align 4, !tbaa !5
  br label %68, !llvm.loop !12

110:                                              ; preds = %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %111

111:                                              ; preds = %225, %110
  %112 = load i32, ptr %11, align 4, !tbaa !5
  %113 = load i32, ptr %9, align 4, !tbaa !5
  %114 = icmp slt i32 %112, %113
  br i1 %114, label %116, label %115

115:                                              ; preds = %111
  store i32 9, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %228

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

117:                                              ; preds = %221, %116
  %118 = load i32, ptr %13, align 4, !tbaa !5
  %119 = load i32, ptr @k, align 4, !tbaa !5
  %120 = icmp slt i32 %118, %119
  br i1 %120, label %122, label %121

121:                                              ; preds = %117
  store i32 12, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %224

122:                                              ; preds = %117
  %123 = load i32, ptr %13, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [21 x [524289 x i32]], ptr @f, i64 0, i64 %124
  %126 = load i32, ptr %11, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [524289 x i32], ptr %125, i64 0, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = icmp eq i32 %129, 1061109567
  br i1 %130, label %131, label %132

131:                                              ; preds = %122
  br label %221

132:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %133 = load i32, ptr %11, align 4, !tbaa !5
  %134 = load i32, ptr %13, align 4, !tbaa !5
  %135 = ashr i32 %133, %134
  %136 = shl i32 %135, 1
  %137 = or i32 %136, 1
  %138 = load i32, ptr %13, align 4, !tbaa !5
  %139 = shl i32 %137, %138
  %140 = load i32, ptr %11, align 4, !tbaa !5
  %141 = load i32, ptr %13, align 4, !tbaa !5
  %142 = shl i32 1, %141
  %143 = sub nsw i32 %142, 1
  %144 = and i32 %140, %143
  %145 = or i32 %139, %144
  store i32 %145, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %146

146:                                              ; preds = %217, %132
  %147 = load i32, ptr %15, align 4, !tbaa !5
  %148 = load i32, ptr @k, align 4, !tbaa !5
  %149 = icmp slt i32 %147, %148
  br i1 %149, label %151, label %150

150:                                              ; preds = %146
  store i32 15, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %220

151:                                              ; preds = %146
  %152 = load i32, ptr %13, align 4, !tbaa !5
  %153 = load i32, ptr %15, align 4, !tbaa !5
  %154 = icmp eq i32 %152, %153
  br i1 %154, label %174, label %155

155:                                              ; preds = %151
  %156 = load i32, ptr %11, align 4, !tbaa !5
  %157 = load i32, ptr %16, align 4, !tbaa !5
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %16, align 4, !tbaa !5
  %159 = shl i32 1, %157
  %160 = and i32 %156, %159
  %161 = icmp ne i32 %160, 0
  br i1 %161, label %174, label %162

162:                                              ; preds = %155
  %163 = load i32, ptr %15, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [21 x i32], ptr @msk, i64 0, i64 %164
  %166 = load i32, ptr %165, align 4, !tbaa !5
  %167 = load i32, ptr %14, align 4, !tbaa !5
  %168 = and i32 %166, %167
  %169 = load i32, ptr %15, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [21 x i32], ptr @msk, i64 0, i64 %170
  %172 = load i32, ptr %171, align 4, !tbaa !5
  %173 = icmp ne i32 %168, %172
  br i1 %173, label %174, label %175

174:                                              ; preds = %162, %155, %151
  br label %217

175:                                              ; preds = %162
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %176 = load i32, ptr %14, align 4, !tbaa !5
  %177 = load i32, ptr %15, align 4, !tbaa !5
  %178 = add nsw i32 %177, 1
  %179 = ashr i32 %176, %178
  %180 = load i32, ptr %15, align 4, !tbaa !5
  %181 = shl i32 %179, %180
  %182 = load i32, ptr %14, align 4, !tbaa !5
  %183 = load i32, ptr %15, align 4, !tbaa !5
  %184 = shl i32 1, %183
  %185 = sub nsw i32 %184, 1
  %186 = and i32 %182, %185
  %187 = or i32 %181, %186
  store i32 %187, ptr %17, align 4, !tbaa !5
  %188 = load i32, ptr %15, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [21 x [524289 x i32]], ptr @f, i64 0, i64 %189
  %191 = load i32, ptr %17, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [524289 x i32], ptr %190, i64 0, i64 %192
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %194 = load i32, ptr %13, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [21 x [524289 x i32]], ptr @f, i64 0, i64 %195
  %197 = load i32, ptr %11, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [524289 x i32], ptr %196, i64 0, i64 %198
  %200 = load i32, ptr %199, align 4, !tbaa !5
  %201 = load i32, ptr %13, align 4, !tbaa !5
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [21 x [23 x i32]], ptr @g, i64 0, i64 %202
  %204 = load i32, ptr %15, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [23 x i32], ptr %203, i64 0, i64 %205
  %207 = load i32, ptr %206, align 4, !tbaa !5
  %208 = add nsw i32 %200, %207
  store i32 %208, ptr %18, align 4, !tbaa !5
  %209 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %193, ptr noundef nonnull align 4 dereferenceable(4) %18)
  %210 = load i32, ptr %209, align 4, !tbaa !5
  %211 = load i32, ptr %15, align 4, !tbaa !5
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds [21 x [524289 x i32]], ptr @f, i64 0, i64 %212
  %214 = load i32, ptr %17, align 4, !tbaa !5
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds [524289 x i32], ptr %213, i64 0, i64 %215
  store i32 %210, ptr %216, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %217

217:                                              ; preds = %175, %174
  %218 = load i32, ptr %15, align 4, !tbaa !5
  %219 = add nsw i32 %218, 1
  store i32 %219, ptr %15, align 4, !tbaa !5
  br label %146, !llvm.loop !13

220:                                              ; preds = %150
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %221

221:                                              ; preds = %220, %131
  %222 = load i32, ptr %13, align 4, !tbaa !5
  %223 = add nsw i32 %222, 1
  store i32 %223, ptr %13, align 4, !tbaa !5
  br label %117, !llvm.loop !14

224:                                              ; preds = %121
  br label %225

225:                                              ; preds = %224
  %226 = load i32, ptr %11, align 4, !tbaa !5
  %227 = add nsw i32 %226, 1
  store i32 %227, ptr %11, align 4, !tbaa !5
  br label %111, !llvm.loop !15

228:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 1061109567, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %229

229:                                              ; preds = %254, %228
  %230 = load i32, ptr %20, align 4, !tbaa !5
  %231 = load i32, ptr @k, align 4, !tbaa !5
  %232 = icmp slt i32 %230, %231
  br i1 %232, label %234, label %233

233:                                              ; preds = %229
  store i32 18, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %257

234:                                              ; preds = %229
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %235 = load i32, ptr %20, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [21 x [524289 x i32]], ptr @f, i64 0, i64 %236
  %238 = load i32, ptr %9, align 4, !tbaa !5
  %239 = sub nsw i32 %238, 1
  %240 = sext i32 %239 to i64
  %241 = getelementptr inbounds [524289 x i32], ptr %237, i64 0, i64 %240
  %242 = load i32, ptr %241, align 4, !tbaa !5
  %243 = load i32, ptr %20, align 4, !tbaa !5
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds [21 x [23 x i32]], ptr @g, i64 0, i64 %244
  %246 = load i32, ptr @k, align 4, !tbaa !5
  %247 = add nsw i32 %246, 1
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds [23 x i32], ptr %245, i64 0, i64 %248
  %250 = load i32, ptr %249, align 4, !tbaa !5
  %251 = add nsw i32 %242, %250
  store i32 %251, ptr %21, align 4, !tbaa !5
  %252 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %19, ptr noundef nonnull align 4 dereferenceable(4) %21)
  %253 = load i32, ptr %252, align 4, !tbaa !5
  store i32 %253, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %254

254:                                              ; preds = %234
  %255 = load i32, ptr %20, align 4, !tbaa !5
  %256 = add nsw i32 %255, 1
  store i32 %256, ptr %20, align 4, !tbaa !5
  br label %229, !llvm.loop !16

257:                                              ; preds = %233
  %258 = load i32, ptr %19, align 4, !tbaa !5
  %259 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %258)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %260

260:                                              ; preds = %257, %57
  %261 = load i32, ptr %1, align 4
  ret i32 %261
}

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

; 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)) #0 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)) #0

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #5

attributes #0 = { 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 #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!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::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 }
%"struct.std::pair" = type { i32, i32 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@msk = external dso_local local_unnamed_addr global [21 x i32], align 16
@f = external dso_local global [21 x [524289 x i32]], align 16
@g = external dso_local global [21 x [23 x i32]], align 16
@e = external dso_local global [20001 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5solveiPi(i32 noundef, ptr noundef) local_unnamed_addr #0

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca %"struct.std::pair", 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 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @k)
  %12 = load i32, ptr @m, align 4, !tbaa !5
  %13 = add nsw i32 %12, -1
  store i32 %13, ptr @m, align 4, !tbaa !5
  %.not64 = icmp eq i32 %12, 0
  br i1 %.not64, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0, %.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %15 = load i32, ptr %1, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [20001 x %"class.std::vector"], ptr @e, i64 0, i64 %16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %18 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i64 %18, ptr %4, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 4 dereferenceable(8) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [20001 x %"class.std::vector"], ptr @e, i64 0, i64 %20
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %22 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %1)
  store i64 %22, ptr %5, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 4 dereferenceable(8) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %23 = load i32, ptr @m, align 4, !tbaa !5
  %24 = add nsw i32 %23, -1
  store i32 %24, ptr @m, align 4, !tbaa !5
  %.not = icmp eq i32 %23, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph, %0
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull @m)
  %26 = load i32, ptr @m, align 4, !tbaa !5
  %27 = add nsw i32 %26, -1
  store i32 %27, ptr @m, align 4, !tbaa !5
  %.not5765 = icmp eq i32 %26, 0
  br i1 %.not5765, label %._crit_edge68, label %.lr.ph67

.lr.ph67:                                         ; preds = %._crit_edge, %.lr.ph67
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %6, ptr noundef nonnull %7)
  %29 = load i32, ptr %6, align 4, !tbaa !5
  %30 = add nsw i32 %29, -2
  %31 = shl nuw i32 1, %30
  %32 = load i32, ptr %7, align 4, !tbaa !5
  %33 = add nsw i32 %32, -2
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [21 x i32], ptr @msk, i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = or i32 %36, %31
  store i32 %37, ptr %35, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  %38 = load i32, ptr @m, align 4, !tbaa !5
  %39 = add nsw i32 %38, -1
  store i32 %39, ptr @m, align 4, !tbaa !5
  %.not57 = icmp eq i32 %38, 0
  br i1 %.not57, label %._crit_edge68, label %.lr.ph67, !llvm.loop !11

._crit_edge68:                                    ; preds = %.lr.ph67, %._crit_edge
  %40 = load i32, ptr @k, align 4, !tbaa !5
  %.not58 = icmp eq i32 %40, 0
  br i1 %.not58, label %41, label %48

41:                                               ; preds = %._crit_edge68
  call void @_Z5solveiPi(i32 noundef 1, ptr noundef nonnull @g)
  %42 = load i32, ptr @k, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [23 x i32], ptr @g, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %46)
  br label %146

48:                                               ; preds = %._crit_edge68
  %49 = add nsw i32 %40, -1
  %50 = shl nuw i32 1, %49
  %51 = icmp sgt i32 %40, 0
  br i1 %51, label %.lr.ph71, label %._crit_edge80.thread

.lr.ph71:                                         ; preds = %48
  %52 = sext i32 %50 to i64
  %53 = shl nsw i64 %52, 2
  br label %55

.preheader63:                                     ; preds = %._crit_edge101
  %.not85 = icmp eq i32 %49, 31
  br i1 %.not85, label %._crit_edge80, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.preheader63
  %54 = icmp sgt i32 %.pre, 0
  br i1 %54, label %.preheader.preheader, label %._crit_edge80.thread

.preheader.preheader:                             ; preds = %.preheader.lr.ph
  %smax = call i32 @llvm.smax.i32(i32 %50, i32 1)
  %wide.trip.count = zext nneg i32 %smax to i64
  br label %.preheader

55:                                               ; preds = %.lr.ph71, %._crit_edge101
  %indvars.iv = phi i64 [ 0, %.lr.ph71 ], [ %indvars.iv.next, %._crit_edge101 ]
  %56 = getelementptr inbounds [21 x [23 x i32]], ptr @g, i64 0, i64 %indvars.iv
  %57 = trunc i64 %indvars.iv to i32
  %58 = add i32 %57, 2
  call void @_Z5solveiPi(i32 noundef %58, ptr noundef nonnull %56)
  %59 = getelementptr inbounds [21 x [524289 x i32]], ptr @f, i64 0, i64 %indvars.iv
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %59, i8 63, i64 %53, i1 false)
  %60 = getelementptr inbounds [21 x i32], ptr @msk, i64 0, i64 %indvars.iv
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %.not62 = icmp eq i32 %61, 0
  %.pre = load i32, ptr @k, align 4, !tbaa !5
  %62 = sext i32 %.pre to i64
  br i1 %.not62, label %63, label %._crit_edge101

63:                                               ; preds = %55
  %64 = getelementptr inbounds [21 x [23 x i32]], ptr @g, i64 0, i64 %indvars.iv, i64 %62
  %65 = load i32, ptr %64, align 4, !tbaa !5
  br label %._crit_edge101

._crit_edge101:                                   ; preds = %55, %63
  %66 = phi i32 [ %65, %63 ], [ 1061109567, %55 ]
  store i32 %66, ptr %59, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %67 = icmp slt i64 %indvars.iv.next, %62
  br i1 %67, label %55, label %.preheader63, !llvm.loop !12

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge78
  %68 = phi i32 [ %.pre, %.preheader.preheader ], [ %76, %._crit_edge78 ]
  %69 = phi i32 [ %.pre, %.preheader.preheader ], [ %77, %._crit_edge78 ]
  %indvars.iv94 = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next95, %._crit_edge78 ]
  %70 = icmp sgt i32 %69, 0
  br i1 %70, label %.lr.ph77, label %._crit_edge78

.lr.ph77:                                         ; preds = %.preheader
  %71 = trunc nuw nsw i64 %indvars.iv94 to i32
  br label %78

._crit_edge80.thread:                             ; preds = %.preheader.lr.ph, %48
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  store i32 1061109567, ptr %9, align 4, !tbaa !5
  br label %._crit_edge84

._crit_edge80:                                    ; preds = %._crit_edge78, %.preheader63
  %72 = phi i32 [ %.pre, %.preheader63 ], [ %76, %._crit_edge78 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  store i32 1061109567, ptr %9, align 4, !tbaa !5
  %73 = icmp sgt i32 %72, 0
  br i1 %73, label %.lr.ph83, label %._crit_edge84

.lr.ph83:                                         ; preds = %._crit_edge80
  %74 = add nsw i32 %50, -1
  %75 = sext i32 %74 to i64
  br label %132

._crit_edge78:                                    ; preds = %.loopexit, %.preheader
  %76 = phi i32 [ %68, %.preheader ], [ %127, %.loopexit ]
  %77 = phi i32 [ %69, %.preheader ], [ %127, %.loopexit ]
  %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next95, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge80, label %.preheader, !llvm.loop !13

78:                                               ; preds = %.lr.ph77, %.loopexit
  %79 = phi i32 [ %68, %.lr.ph77 ], [ %127, %.loopexit ]
  %80 = phi i32 [ %69, %.lr.ph77 ], [ %127, %.loopexit ]
  %indvars.iv91 = phi i64 [ 0, %.lr.ph77 ], [ %indvars.iv.next92, %.loopexit ]
  %81 = getelementptr inbounds [21 x [524289 x i32]], ptr @f, i64 0, i64 %indvars.iv91, i64 %indvars.iv94
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = icmp eq i32 %82, 1061109567
  br i1 %83, label %.loopexit, label %84

84:                                               ; preds = %78
  %85 = trunc nuw nsw i64 %indvars.iv91 to i32
  %86 = lshr i32 %71, %85
  %87 = shl nuw i32 %86, 1
  %88 = or disjoint i32 %87, 1
  %89 = shl i32 %88, %85
  %notmask = shl nsw i32 -1, %85
  %90 = xor i32 %notmask, -1
  %91 = and i32 %71, %90
  %92 = or i32 %89, %91
  %93 = icmp sgt i32 %80, 0
  br i1 %93, label %.lr.ph75, label %.loopexit

.lr.ph75:                                         ; preds = %84, %122
  %94 = phi i32 [ %123, %122 ], [ %79, %84 ]
  %95 = phi i32 [ %124, %122 ], [ %80, %84 ]
  %indvars.iv88 = phi i64 [ %indvars.iv.next89, %122 ], [ 0, %84 ]
  %.05073 = phi i32 [ %.1, %122 ], [ 0, %84 ]
  %96 = icmp eq i64 %indvars.iv91, %indvars.iv88
  br i1 %96, label %122, label %97

97:                                               ; preds = %.lr.ph75
  %98 = add nsw i32 %.05073, 1
  %99 = shl nuw i32 1, %.05073
  %100 = and i32 %99, %71
  %.not59 = icmp eq i32 %100, 0
  br i1 %.not59, label %101, label %122

101:                                              ; preds = %97
  %102 = getelementptr inbounds [21 x i32], ptr @msk, i64 0, i64 %indvars.iv88
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = and i32 %103, %92
  %.not60 = icmp eq i32 %104, %103
  br i1 %.not60, label %105, label %122

105:                                              ; preds = %101
  %106 = trunc i64 %indvars.iv88 to i32
  %107 = add i32 %106, 1
  %108 = ashr i32 %92, %107
  %109 = trunc nuw nsw i64 %indvars.iv88 to i32
  %110 = shl i32 %108, %109
  %notmask61 = shl nsw i32 -1, %109
  %111 = xor i32 %notmask61, -1
  %112 = and i32 %92, %111
  %113 = or i32 %110, %112
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [21 x [524289 x i32]], ptr @f, i64 0, i64 %indvars.iv88, i64 %114
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  %116 = load i32, ptr %81, align 4, !tbaa !5
  %117 = getelementptr inbounds [21 x [23 x i32]], ptr @g, i64 0, i64 %indvars.iv91, i64 %indvars.iv88
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = add nsw i32 %118, %116
  store i32 %119, ptr %8, align 4, !tbaa !5
  %120 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %115, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %121 = load i32, ptr %120, align 4, !tbaa !5
  store i32 %121, ptr %115, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  %.pre100 = load i32, ptr @k, align 4, !tbaa !5
  br label %122

122:                                              ; preds = %.lr.ph75, %97, %101, %105
  %123 = phi i32 [ %94, %.lr.ph75 ], [ %94, %97 ], [ %94, %101 ], [ %.pre100, %105 ]
  %124 = phi i32 [ %95, %.lr.ph75 ], [ %95, %97 ], [ %95, %101 ], [ %.pre100, %105 ]
  %.1 = phi i32 [ %.05073, %.lr.ph75 ], [ %98, %97 ], [ %98, %101 ], [ %98, %105 ]
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %125 = sext i32 %124 to i64
  %126 = icmp slt i64 %indvars.iv.next89, %125
  br i1 %126, label %.lr.ph75, label %.loopexit, !llvm.loop !15

.loopexit:                                        ; preds = %122, %84, %78
  %127 = phi i32 [ %79, %84 ], [ %79, %78 ], [ %123, %122 ]
  %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
  %128 = sext i32 %127 to i64
  %129 = icmp slt i64 %indvars.iv.next92, %128
  br i1 %129, label %78, label %._crit_edge78, !llvm.loop !16

._crit_edge84:                                    ; preds = %132, %._crit_edge80.thread, %._crit_edge80
  %130 = phi i32 [ 1061109567, %._crit_edge80 ], [ 1061109567, %._crit_edge80.thread ], [ %142, %132 ]
  %131 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %130)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  br label %146

132:                                              ; preds = %.lr.ph83, %132
  %indvars.iv97 = phi i64 [ 0, %.lr.ph83 ], [ %indvars.iv.next98, %132 ]
  %133 = phi i32 [ %72, %.lr.ph83 ], [ %143, %132 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  %134 = getelementptr inbounds [21 x [524289 x i32]], ptr @f, i64 0, i64 %indvars.iv97, i64 %75
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = add nsw i32 %133, 1
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [21 x [23 x i32]], ptr @g, i64 0, i64 %indvars.iv97, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = add nsw i32 %139, %135
  store i32 %140, ptr %10, align 4, !tbaa !5
  %141 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %142 = load i32, ptr %141, align 4, !tbaa !5
  store i32 %142, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  %indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1
  %143 = load i32, ptr @k, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = icmp slt i64 %indvars.iv.next98, %144
  br i1 %145, label %132, label %._crit_edge84, !llvm.loop !17

146:                                              ; preds = %._crit_edge84, %41
  ret i32 0
}

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

; 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 #0 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 #0

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10, !14}
!14 = !{!"llvm.loop.unswitch.partial.disable"}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}


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