; LLVM IR from tangjz/acm-icpc :: codeforces (1578A)

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

%"struct.std::pair" = type { i32, i32 }
%"struct.std::pair.0" = type <{ i32, i8, [3 x i8] }>
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.2", %"struct.std::_Head_base.3" }
%"struct.std::_Tuple_impl.2" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { ptr }
%"struct.std::_Head_base.3" = type { ptr }

@mat = external dso_local global [51 x [51 x i8]], align 16
@ans = external dso_local global [2501 x [2501 x i8]], align 16
@r = external dso_local global i32, align 4
@c = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@seq = external dso_local global [2501 x i32], align 16
@sta = external dso_local global [2501 x i32], align 16
@sz = external dso_local global [2501 x i32], align 16
@rem = external dso_local global [2501 x [2501 x i32]], align 16
@pos = external dso_local global [2501 x [7 x %"struct.std::pair"]], align 16
@que = external dso_local global [6250001 x %"struct.std::pair"], align 16
@op = external dso_local global [2501 x [2501 x %"struct.std::pair.0"]], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.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 [7 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i8, align 1
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %"struct.std::pair", align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %"class.std::tuple", align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca %"struct.std::pair", align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca %"class.std::tuple", align 8
  %31 = alloca i32, align 4
  %32 = alloca %"struct.std::pair.0", align 4
  %33 = alloca i32, align 4
  %34 = alloca i8, align 1
  %35 = alloca %"struct.std::pair", align 4
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  %39 = alloca %"class.std::tuple", align 8
  %40 = alloca ptr, align 8
  %41 = alloca i32, align 4
  %42 = alloca i32, align 4
  %43 = alloca ptr, align 8
  %44 = alloca i32, align 4
  %45 = alloca ptr, align 8
  %46 = alloca i32, align 4
  %47 = alloca ptr, align 8
  %48 = alloca ptr, align 8
  %49 = alloca ptr, align 8
  %50 = alloca i32, align 4
  %51 = alloca i32, align 4
  %52 = alloca i32, align 4
  %53 = alloca i32, align 4
  %54 = alloca i32, align 4
  %55 = alloca i8, align 1
  %56 = alloca i32, align 4
  %57 = alloca i32, align 4
  %58 = alloca i32, align 4
  %59 = alloca i32, align 4
  %60 = alloca i32, align 4
  %61 = alloca %"struct.std::pair.0", align 4
  %62 = alloca i8, align 1
  %63 = alloca %"struct.std::pair", align 4
  %64 = alloca ptr, align 8
  %65 = alloca i32, align 4
  %66 = alloca i32, align 4
  %67 = alloca i32, align 4
  %68 = alloca i32, align 4
  %69 = alloca i32, align 4
  %70 = alloca %"struct.std::pair.0", align 4
  %71 = alloca i8, align 1
  %72 = alloca %"struct.std::pair", align 4
  %73 = alloca i32, align 4
  %74 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %75 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @r, ptr noundef @c)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  %76 = load i32, ptr @r, align 4, !tbaa !5
  %77 = load i32, ptr @c, align 4, !tbaa !5
  %78 = mul nsw i32 %76, %77
  store i32 %78, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %90, %0
  %80 = load i32, ptr %3, align 4, !tbaa !5
  %81 = load i32, ptr @r, align 4, !tbaa !5
  %82 = icmp slt i32 %80, %81
  br i1 %82, label %84, label %83

83:                                               ; preds = %79
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %93

84:                                               ; preds = %79
  %85 = load i32, ptr %3, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [51 x [51 x i8]], ptr @mat, i64 0, i64 %86
  %88 = getelementptr inbounds [51 x i8], ptr %87, i64 0, i64 0
  %89 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %88)
  br label %90

90:                                               ; preds = %84
  %91 = load i32, ptr %3, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %3, align 4, !tbaa !5
  br label %79, !llvm.loop !9

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

94:                                               ; preds = %411, %93
  %95 = load i32, ptr %4, align 4, !tbaa !5
  %96 = load i32, ptr @r, align 4, !tbaa !5
  %97 = icmp slt i32 %95, %96
  br i1 %97, label %99, label %98

98:                                               ; preds = %94
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %414

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

100:                                              ; preds = %407, %99
  %101 = load i32, ptr %6, align 4, !tbaa !5
  %102 = load i32, ptr @c, align 4, !tbaa !5
  %103 = icmp slt i32 %101, %102
  br i1 %103, label %105, label %104

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

105:                                              ; preds = %100
  %106 = load i32, ptr %4, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [51 x [51 x i8]], ptr @mat, i64 0, i64 %107
  %109 = load i32, ptr %6, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [51 x i8], ptr %108, i64 0, i64 %110
  %112 = load i8, ptr %111, align 1, !tbaa !11
  %113 = sext i8 %112 to i32
  %114 = icmp slt i32 %113, 97
  br i1 %114, label %125, label %115

115:                                              ; preds = %105
  %116 = load i32, ptr %4, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [51 x [51 x i8]], ptr @mat, i64 0, i64 %117
  %119 = load i32, ptr %6, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [51 x i8], ptr %118, i64 0, i64 %120
  %122 = load i8, ptr %121, align 1, !tbaa !11
  %123 = sext i8 %122 to i32
  %124 = icmp sgt i32 %123, 122
  br i1 %124, label %125, label %126

125:                                              ; preds = %115, %105
  br label %407

126:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #5
  %127 = load i32, ptr %4, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [51 x [51 x i8]], ptr @mat, i64 0, i64 %128
  %130 = load i32, ptr %6, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [51 x i8], ptr %129, i64 0, i64 %131
  %133 = load i8, ptr %132, align 1, !tbaa !11
  store i8 %133, ptr %7, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %134 = load i32, ptr @n, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [2501 x i32], ptr @sz, i64 0, i64 %135
  store i32 0, ptr %136, align 4, !tbaa !5
  store ptr %136, ptr %8, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %137 = load i32, ptr @n, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [2501 x [2501 x i32]], ptr @rem, i64 0, i64 %138
  %140 = getelementptr inbounds [2501 x i32], ptr %139, i64 0, i64 0
  store ptr %140, ptr %9, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %141 = load i32, ptr @n, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [2501 x [7 x %"struct.std::pair"]], ptr @pos, i64 0, i64 %142
  %144 = getelementptr inbounds [7 x %"struct.std::pair"], ptr %143, i64 0, i64 0
  store ptr %144, ptr %10, align 8, !tbaa !12
  %145 = load i32, ptr %4, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [51 x [51 x i8]], ptr @mat, i64 0, i64 %146
  %148 = load i32, ptr %6, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [51 x i8], ptr %147, i64 0, i64 %149
  store i8 46, ptr %150, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %151 = load ptr, ptr %10, align 8, !tbaa !12
  %152 = load ptr, ptr %8, align 8, !tbaa !12
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %152, align 4, !tbaa !5
  %155 = sext i32 %153 to i64
  %156 = getelementptr inbounds %"struct.std::pair", ptr %151, i64 %155
  %157 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %156, ptr noundef nonnull align 4 dereferenceable(8) %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %158

158:                                              ; preds = %248, %126
  %159 = load i32, ptr %12, align 4, !tbaa !5
  %160 = load ptr, ptr %8, align 8, !tbaa !12
  %161 = load i32, ptr %160, align 4, !tbaa !5
  %162 = icmp slt i32 %159, %161
  br i1 %162, label %164, label %163

163:                                              ; preds = %158
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %251

164:                                              ; preds = %158
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %165 = load ptr, ptr %10, align 8, !tbaa !12
  %166 = load i32, ptr %12, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds %"struct.std::pair", ptr %165, i64 %167
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #5
  call void @_ZSt3tieIJiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind writable sret(%"class.std::tuple") align 8 %15, ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %14) #5
  %169 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJRiS0_EEaSIiiEENSt9enable_ifIXcl12__assignableIRKT_RKT0_EEERS1_E4typeERKSt4pairIS4_S7_E(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 4 dereferenceable(8) %168) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 -1, ptr %16, align 4, !tbaa !5
  br label %170

170:                                              ; preds = %244, %164
  %171 = load i32, ptr %16, align 4, !tbaa !5
  %172 = icmp sle i32 %171, 1
  br i1 %172, label %174, label %173

173:                                              ; preds = %170
  store i32 14, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %247

174:                                              ; preds = %170
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 -1, ptr %17, align 4, !tbaa !5
  br label %175

175:                                              ; preds = %240, %174
  %176 = load i32, ptr %17, align 4, !tbaa !5
  %177 = icmp sle i32 %176, 1
  br i1 %177, label %179, label %178

178:                                              ; preds = %175
  store i32 17, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %243

179:                                              ; preds = %175
  %180 = load i32, ptr %16, align 4, !tbaa !5
  %181 = icmp ne i32 %180, 0
  %182 = xor i1 %181, true
  %183 = zext i1 %182 to i32
  %184 = load i32, ptr %17, align 4, !tbaa !5
  %185 = icmp ne i32 %184, 0
  %186 = xor i1 %185, true
  %187 = zext i1 %186 to i32
  %188 = icmp eq i32 %183, %187
  br i1 %188, label %189, label %190

189:                                              ; preds = %179
  br label %240

190:                                              ; preds = %179
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %191 = load i32, ptr %13, align 4, !tbaa !5
  %192 = load i32, ptr %16, align 4, !tbaa !5
  %193 = add nsw i32 %191, %192
  store i32 %193, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  %194 = load i32, ptr %14, align 4, !tbaa !5
  %195 = load i32, ptr %17, align 4, !tbaa !5
  %196 = add nsw i32 %194, %195
  store i32 %196, ptr %19, align 4, !tbaa !5
  %197 = load i32, ptr %18, align 4, !tbaa !5
  %198 = icmp slt i32 %197, 0
  br i1 %198, label %222, label %199

199:                                              ; preds = %190
  %200 = load i32, ptr %18, align 4, !tbaa !5
  %201 = load i32, ptr @r, align 4, !tbaa !5
  %202 = icmp sge i32 %200, %201
  br i1 %202, label %222, label %203

203:                                              ; preds = %199
  %204 = load i32, ptr %19, align 4, !tbaa !5
  %205 = icmp slt i32 %204, 0
  br i1 %205, label %222, label %206

206:                                              ; preds = %203
  %207 = load i32, ptr %19, align 4, !tbaa !5
  %208 = load i32, ptr @c, align 4, !tbaa !5
  %209 = icmp sge i32 %207, %208
  br i1 %209, label %222, label %210

210:                                              ; preds = %206
  %211 = load i32, ptr %18, align 4, !tbaa !5
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds [51 x [51 x i8]], ptr @mat, i64 0, i64 %212
  %214 = load i32, ptr %19, align 4, !tbaa !5
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds [51 x i8], ptr %213, i64 0, i64 %215
  %217 = load i8, ptr %216, align 1, !tbaa !11
  %218 = sext i8 %217 to i32
  %219 = load i8, ptr %7, align 1, !tbaa !11
  %220 = sext i8 %219 to i32
  %221 = icmp ne i32 %218, %220
  br i1 %221, label %222, label %223

222:                                              ; preds = %210, %206, %203, %199, %190
  store i32 19, ptr %5, align 4
  br label %237

223:                                              ; preds = %210
  %224 = load i32, ptr %18, align 4, !tbaa !5
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds [51 x [51 x i8]], ptr @mat, i64 0, i64 %225
  %227 = load i32, ptr %19, align 4, !tbaa !5
  %228 = sext i32 %227 to i64
  %229 = getelementptr inbounds [51 x i8], ptr %226, i64 0, i64 %228
  store i8 46, ptr %229, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %20, ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) %19)
  %230 = load ptr, ptr %10, align 8, !tbaa !12
  %231 = load ptr, ptr %8, align 8, !tbaa !12
  %232 = load i32, ptr %231, align 4, !tbaa !5
  %233 = add nsw i32 %232, 1
  store i32 %233, ptr %231, align 4, !tbaa !5
  %234 = sext i32 %232 to i64
  %235 = getelementptr inbounds %"struct.std::pair", ptr %230, i64 %234
  %236 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %235, ptr noundef nonnull align 4 dereferenceable(8) %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  store i32 0, ptr %5, align 4
  br label %237

237:                                              ; preds = %223, %222
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  %238 = load i32, ptr %5, align 4
  switch i32 %238, label %850 [
    i32 0, label %239
    i32 19, label %240
  ]

239:                                              ; preds = %237
  br label %240

240:                                              ; preds = %239, %237, %189
  %241 = load i32, ptr %17, align 4, !tbaa !5
  %242 = add nsw i32 %241, 1
  store i32 %242, ptr %17, align 4, !tbaa !5
  br label %175, !llvm.loop !14

243:                                              ; preds = %178
  br label %244

244:                                              ; preds = %243
  %245 = load i32, ptr %16, align 4, !tbaa !5
  %246 = add nsw i32 %245, 1
  store i32 %246, ptr %16, align 4, !tbaa !5
  br label %170, !llvm.loop !15

247:                                              ; preds = %173
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %248

248:                                              ; preds = %247
  %249 = load i32, ptr %12, align 4, !tbaa !5
  %250 = add nsw i32 %249, 1
  store i32 %250, ptr %12, align 4, !tbaa !5
  br label %158, !llvm.loop !16

251:                                              ; preds = %163
  %252 = load ptr, ptr %9, align 8, !tbaa !12
  %253 = load i32, ptr %2, align 4, !tbaa !5
  %254 = sext i32 %253 to i64
  %255 = mul i64 %254, 4
  call void @llvm.memset.p0.i64(ptr align 4 %252, i8 63, i64 %255, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  store i32 0, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  store i32 0, ptr %22, align 4, !tbaa !5
  br label %256

256:                                              ; preds = %354, %251
  %257 = load i32, ptr %22, align 4, !tbaa !5
  %258 = load i32, ptr @r, align 4, !tbaa !5
  %259 = icmp slt i32 %257, %258
  br i1 %259, label %261, label %260

260:                                              ; preds = %256
  store i32 20, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  br label %357

261:                                              ; preds = %256
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  store i32 0, ptr %23, align 4, !tbaa !5
  br label %262

262:                                              ; preds = %348, %261
  %263 = load i32, ptr %23, align 4, !tbaa !5
  %264 = load i32, ptr @c, align 4, !tbaa !5
  %265 = icmp slt i32 %263, %264
  br i1 %265, label %267, label %266

266:                                              ; preds = %262
  store i32 23, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  br label %353

267:                                              ; preds = %262
  %268 = load ptr, ptr %9, align 8, !tbaa !12
  %269 = load i32, ptr %21, align 4, !tbaa !5
  %270 = sext i32 %269 to i64
  %271 = getelementptr inbounds i32, ptr %268, i64 %270
  store i32 0, ptr %271, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  store i32 0, ptr %24, align 4, !tbaa !5
  br label %272

272:                                              ; preds = %343, %267
  %273 = load i32, ptr %24, align 4, !tbaa !5
  %274 = load ptr, ptr %8, align 8, !tbaa !12
  %275 = load i32, ptr %274, align 4, !tbaa !5
  %276 = icmp slt i32 %273, %275
  br i1 %276, label %278, label %277

277:                                              ; preds = %272
  store i32 26, ptr %5, align 4
  br label %346

278:                                              ; preds = %272
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  %279 = load i32, ptr %22, align 4, !tbaa !5
  %280 = load ptr, ptr %10, align 8, !tbaa !12
  %281 = getelementptr inbounds %"struct.std::pair", ptr %280, i64 0
  %282 = getelementptr inbounds %"struct.std::pair", ptr %281, i32 0, i32 0
  %283 = load i32, ptr %282, align 4, !tbaa !17
  %284 = sub nsw i32 %279, %283
  %285 = load ptr, ptr %10, align 8, !tbaa !12
  %286 = load i32, ptr %24, align 4, !tbaa !5
  %287 = sext i32 %286 to i64
  %288 = getelementptr inbounds %"struct.std::pair", ptr %285, i64 %287
  %289 = getelementptr inbounds %"struct.std::pair", ptr %288, i32 0, i32 0
  %290 = load i32, ptr %289, align 4, !tbaa !17
  %291 = add nsw i32 %284, %290
  store i32 %291, ptr %25, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  %292 = load i32, ptr %23, align 4, !tbaa !5
  %293 = load ptr, ptr %10, align 8, !tbaa !12
  %294 = getelementptr inbounds %"struct.std::pair", ptr %293, i64 0
  %295 = getelementptr inbounds %"struct.std::pair", ptr %294, i32 0, i32 1
  %296 = load i32, ptr %295, align 4, !tbaa !19
  %297 = sub nsw i32 %292, %296
  %298 = load ptr, ptr %10, align 8, !tbaa !12
  %299 = load i32, ptr %24, align 4, !tbaa !5
  %300 = sext i32 %299 to i64
  %301 = getelementptr inbounds %"struct.std::pair", ptr %298, i64 %300
  %302 = getelementptr inbounds %"struct.std::pair", ptr %301, i32 0, i32 1
  %303 = load i32, ptr %302, align 4, !tbaa !19
  %304 = add nsw i32 %297, %303
  store i32 %304, ptr %26, align 4, !tbaa !5
  %305 = load i32, ptr %25, align 4, !tbaa !5
  %306 = icmp slt i32 %305, 0
  br i1 %306, label %318, label %307

307:                                              ; preds = %278
  %308 = load i32, ptr %25, align 4, !tbaa !5
  %309 = load i32, ptr @r, align 4, !tbaa !5
  %310 = icmp sge i32 %308, %309
  br i1 %310, label %318, label %311

311:                                              ; preds = %307
  %312 = load i32, ptr %26, align 4, !tbaa !5
  %313 = icmp slt i32 %312, 0
  br i1 %313, label %318, label %314

314:                                              ; preds = %311
  %315 = load i32, ptr %26, align 4, !tbaa !5
  %316 = load i32, ptr @c, align 4, !tbaa !5
  %317 = icmp sge i32 %315, %316
  br i1 %317, label %318, label %323

318:                                              ; preds = %314, %311, %307, %278
  %319 = load ptr, ptr %9, align 8, !tbaa !12
  %320 = load i32, ptr %21, align 4, !tbaa !5
  %321 = sext i32 %320 to i64
  %322 = getelementptr inbounds i32, ptr %319, i64 %321
  store i32 1061109567, ptr %322, align 4, !tbaa !5
  store i32 26, ptr %5, align 4
  br label %340

323:                                              ; preds = %314
  %324 = load i32, ptr %25, align 4, !tbaa !5
  %325 = sext i32 %324 to i64
  %326 = getelementptr inbounds [51 x [51 x i8]], ptr @mat, i64 0, i64 %325
  %327 = load i32, ptr %26, align 4, !tbaa !5
  %328 = sext i32 %327 to i64
  %329 = getelementptr inbounds [51 x i8], ptr %326, i64 0, i64 %328
  %330 = load i8, ptr %329, align 1, !tbaa !11
  %331 = sext i8 %330 to i32
  %332 = icmp ne i32 %331, 46
  %333 = zext i1 %332 to i32
  %334 = load ptr, ptr %9, align 8, !tbaa !12
  %335 = load i32, ptr %21, align 4, !tbaa !5
  %336 = sext i32 %335 to i64
  %337 = getelementptr inbounds i32, ptr %334, i64 %336
  %338 = load i32, ptr %337, align 4, !tbaa !5
  %339 = add nsw i32 %338, %333
  store i32 %339, ptr %337, align 4, !tbaa !5
  store i32 0, ptr %5, align 4
  br label %340

340:                                              ; preds = %323, %318
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  %341 = load i32, ptr %5, align 4
  switch i32 %341, label %346 [
    i32 0, label %342
  ]

342:                                              ; preds = %340
  br label %343

343:                                              ; preds = %342
  %344 = load i32, ptr %24, align 4, !tbaa !5
  %345 = add nsw i32 %344, 1
  store i32 %345, ptr %24, align 4, !tbaa !5
  br label %272, !llvm.loop !20

346:                                              ; preds = %340, %277
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  br label %347

347:                                              ; preds = %346
  br label %348

348:                                              ; preds = %347
  %349 = load i32, ptr %23, align 4, !tbaa !5
  %350 = add nsw i32 %349, 1
  store i32 %350, ptr %23, align 4, !tbaa !5
  %351 = load i32, ptr %21, align 4, !tbaa !5
  %352 = add nsw i32 %351, 1
  store i32 %352, ptr %21, align 4, !tbaa !5
  br label %262, !llvm.loop !21

353:                                              ; preds = %266
  br label %354

354:                                              ; preds = %353
  %355 = load i32, ptr %22, align 4, !tbaa !5
  %356 = add nsw i32 %355, 1
  store i32 %356, ptr %22, align 4, !tbaa !5
  br label %256, !llvm.loop !22

357:                                              ; preds = %260
  %358 = load i8, ptr %7, align 1, !tbaa !11
  %359 = sext i8 %358 to i32
  %360 = sub nsw i32 %359, 97
  %361 = add nsw i32 %360, 65
  %362 = trunc i32 %361 to i8
  store i8 %362, ptr %7, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  store i32 0, ptr %27, align 4, !tbaa !5
  br label %363

363:                                              ; preds = %382, %357
  %364 = load i32, ptr %27, align 4, !tbaa !5
  %365 = load ptr, ptr %8, align 8, !tbaa !12
  %366 = load i32, ptr %365, align 4, !tbaa !5
  %367 = icmp slt i32 %364, %366
  br i1 %367, label %369, label %368

368:                                              ; preds = %363
  store i32 29, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  br label %385

369:                                              ; preds = %363
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #5
  %370 = load ptr, ptr %10, align 8, !tbaa !12
  %371 = load i32, ptr %27, align 4, !tbaa !5
  %372 = sext i32 %371 to i64
  %373 = getelementptr inbounds %"struct.std::pair", ptr %370, i64 %372
  call void @llvm.lifetime.start.p0(i64 16, ptr %30) #5
  call void @_ZSt3tieIJiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind writable sret(%"class.std::tuple") align 8 %30, ptr noundef nonnull align 4 dereferenceable(4) %28, ptr noundef nonnull align 4 dereferenceable(4) %29) #5
  %374 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJRiS0_EEaSIiiEENSt9enable_ifIXcl12__assignableIRKT_RKT0_EEERS1_E4typeERKSt4pairIS4_S7_E(ptr noundef nonnull align 8 dereferenceable(16) %30, ptr noundef nonnull align 4 dereferenceable(8) %373) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #5
  %375 = load i8, ptr %7, align 1, !tbaa !11
  %376 = load i32, ptr %28, align 4, !tbaa !5
  %377 = sext i32 %376 to i64
  %378 = getelementptr inbounds [51 x [51 x i8]], ptr @mat, i64 0, i64 %377
  %379 = load i32, ptr %29, align 4, !tbaa !5
  %380 = sext i32 %379 to i64
  %381 = getelementptr inbounds [51 x i8], ptr %378, i64 0, i64 %380
  store i8 %375, ptr %381, align 1, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  br label %382

382:                                              ; preds = %369
  %383 = load i32, ptr %27, align 4, !tbaa !5
  %384 = add nsw i32 %383, 1
  store i32 %384, ptr %27, align 4, !tbaa !5
  br label %363, !llvm.loop !23

385:                                              ; preds = %368
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #5
  %386 = load i32, ptr %4, align 4, !tbaa !5
  %387 = load i32, ptr @c, align 4, !tbaa !5
  %388 = mul nsw i32 %386, %387
  %389 = load i32, ptr %6, align 4, !tbaa !5
  %390 = add nsw i32 %388, %389
  store i32 %390, ptr %31, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #5
  store i32 -1, ptr %33, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %34) #5
  store i8 83, ptr %34, align 1, !tbaa !11
  call void @_ZNSt4pairIicEC2IicTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 4 dereferenceable(5) %32, ptr noundef nonnull align 4 dereferenceable(4) %33, ptr noundef nonnull align 1 dereferenceable(1) %34)
  %391 = load i32, ptr @n, align 4, !tbaa !5
  %392 = sext i32 %391 to i64
  %393 = getelementptr inbounds [2501 x [2501 x %"struct.std::pair.0"]], ptr @op, i64 0, i64 %392
  %394 = load i32, ptr %31, align 4, !tbaa !5
  %395 = sext i32 %394 to i64
  %396 = getelementptr inbounds [2501 x %"struct.std::pair.0"], ptr %393, i64 0, i64 %395
  %397 = call noundef nonnull align 4 dereferenceable(5) ptr @_ZNSt4pairIicEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(5) %396, ptr noundef nonnull align 4 dereferenceable(5) %32) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %34) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #5
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %35, ptr noundef nonnull align 4 dereferenceable(4) @n, ptr noundef nonnull align 4 dereferenceable(4) %31)
  %398 = load i32, ptr @tot, align 4, !tbaa !5
  %399 = add nsw i32 %398, 1
  store i32 %399, ptr @tot, align 4, !tbaa !5
  %400 = sext i32 %398 to i64
  %401 = getelementptr inbounds [6250001 x %"struct.std::pair"], ptr @que, i64 0, i64 %400
  %402 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %401, ptr noundef nonnull align 4 dereferenceable(8) %35) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #5
  %403 = load i32, ptr @n, align 4, !tbaa !5
  %404 = add nsw i32 %403, 1
  store i32 %404, ptr @n, align 4, !tbaa !5
  %405 = sext i32 %403 to i64
  %406 = getelementptr inbounds [2501 x i32], ptr @sta, i64 0, i64 %405
  store i32 -1, ptr %406, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #5
  br label %407

407:                                              ; preds = %385, %125
  %408 = load i32, ptr %6, align 4, !tbaa !5
  %409 = add nsw i32 %408, 1
  store i32 %409, ptr %6, align 4, !tbaa !5
  br label %100, !llvm.loop !24

410:                                              ; preds = %104
  br label %411

411:                                              ; preds = %410
  %412 = load i32, ptr %4, align 4, !tbaa !5
  %413 = add nsw i32 %412, 1
  store i32 %413, ptr %4, align 4, !tbaa !5
  br label %94, !llvm.loop !25

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

415:                                              ; preds = %811, %414
  %416 = load i32, ptr %36, align 4, !tbaa !5
  %417 = load i32, ptr @tot, align 4, !tbaa !5
  %418 = icmp slt i32 %416, %417
  br i1 %418, label %420, label %419

419:                                              ; preds = %415
  store i32 32, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #5
  br label %814

420:                                              ; preds = %415
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #5
  %421 = load i32, ptr %36, align 4, !tbaa !5
  %422 = sext i32 %421 to i64
  %423 = getelementptr inbounds [6250001 x %"struct.std::pair"], ptr @que, i64 0, i64 %422
  call void @llvm.lifetime.start.p0(i64 16, ptr %39) #5
  call void @_ZSt3tieIJiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind writable sret(%"class.std::tuple") align 8 %39, ptr noundef nonnull align 4 dereferenceable(4) %37, ptr noundef nonnull align 4 dereferenceable(4) %38) #5
  %424 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJRiS0_EEaSIiiEENSt9enable_ifIXcl12__assignableIRKT_RKT0_EEERS1_E4typeERKSt4pairIS4_S7_E(ptr noundef nonnull align 8 dereferenceable(16) %39, ptr noundef nonnull align 4 dereferenceable(8) %423) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %39) #5
  %425 = load i32, ptr %37, align 4, !tbaa !5
  %426 = sext i32 %425 to i64
  %427 = getelementptr inbounds [2501 x i32], ptr @sta, i64 0, i64 %426
  %428 = load i32, ptr %427, align 4, !tbaa !5
  %429 = icmp ne i32 %428, -1
  br i1 %429, label %430, label %431

430:                                              ; preds = %420
  store i32 34, ptr %5, align 4
  br label %808

431:                                              ; preds = %420
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #5
  %432 = load i32, ptr %37, align 4, !tbaa !5
  %433 = sext i32 %432 to i64
  %434 = getelementptr inbounds [2501 x [2501 x %"struct.std::pair.0"]], ptr @op, i64 0, i64 %433
  %435 = getelementptr inbounds [2501 x %"struct.std::pair.0"], ptr %434, i64 0, i64 0
  store ptr %435, ptr %40, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %41) #5
  %436 = load i32, ptr %38, align 4, !tbaa !5
  %437 = load i32, ptr @c, align 4, !tbaa !5
  %438 = sdiv i32 %436, %437
  store i32 %438, ptr %41, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #5
  %439 = load i32, ptr %38, align 4, !tbaa !5
  %440 = load i32, ptr @c, align 4, !tbaa !5
  %441 = srem i32 %439, %440
  store i32 %441, ptr %42, align 4, !tbaa !5
  %442 = load i32, ptr %41, align 4, !tbaa !5
  %443 = icmp ne i32 %442, 0
  br i1 %443, label %707, label %444

444:                                              ; preds = %431
  %445 = load i32, ptr %42, align 4, !tbaa !5
  %446 = load i32, ptr %37, align 4, !tbaa !5
  %447 = sext i32 %446 to i64
  %448 = getelementptr inbounds [2501 x i32], ptr @sta, i64 0, i64 %447
  store i32 %445, ptr %448, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #5
  %449 = load i32, ptr %37, align 4, !tbaa !5
  %450 = sext i32 %449 to i64
  %451 = getelementptr inbounds [2501 x [2501 x i8]], ptr @ans, i64 0, i64 %450
  %452 = getelementptr inbounds [2501 x i8], ptr %451, i64 0, i64 0
  store ptr %452, ptr %43, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #5
  %453 = load i32, ptr %38, align 4, !tbaa !5
  store i32 %453, ptr %44, align 4, !tbaa !5
  br label %454

454:                                              ; preds = %467, %444
  %455 = load i32, ptr %44, align 4, !tbaa !5
  %456 = icmp ne i32 %455, -1
  br i1 %456, label %458, label %457

457:                                              ; preds = %454
  store i32 35, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #5
  br label %474

458:                                              ; preds = %454
  %459 = load ptr, ptr %40, align 8, !tbaa !12
  %460 = load i32, ptr %44, align 4, !tbaa !5
  %461 = sext i32 %460 to i64
  %462 = getelementptr inbounds %"struct.std::pair.0", ptr %459, i64 %461
  %463 = getelementptr inbounds %"struct.std::pair.0", ptr %462, i32 0, i32 1
  %464 = load i8, ptr %463, align 4, !tbaa !26
  %465 = load ptr, ptr %43, align 8, !tbaa !12
  %466 = getelementptr inbounds i8, ptr %465, i32 1
  store ptr %466, ptr %43, align 8, !tbaa !12
  store i8 %464, ptr %465, align 1, !tbaa !11
  br label %467

467:                                              ; preds = %458
  %468 = load ptr, ptr %40, align 8, !tbaa !12
  %469 = load i32, ptr %44, align 4, !tbaa !5
  %470 = sext i32 %469 to i64
  %471 = getelementptr inbounds %"struct.std::pair.0", ptr %468, i64 %470
  %472 = getelementptr inbounds %"struct.std::pair.0", ptr %471, i32 0, i32 0
  %473 = load i32, ptr %472, align 4, !tbaa !28
  store i32 %473, ptr %44, align 4, !tbaa !5
  br label %454, !llvm.loop !29

474:                                              ; preds = %457
  %475 = load ptr, ptr %43, align 8, !tbaa !12
  store i8 0, ptr %475, align 1, !tbaa !11
  %476 = load i32, ptr %37, align 4, !tbaa !5
  %477 = load i32, ptr @m, align 4, !tbaa !5
  %478 = add nsw i32 %477, 1
  store i32 %478, ptr @m, align 4, !tbaa !5
  %479 = sext i32 %477 to i64
  %480 = getelementptr inbounds [2501 x i32], ptr @seq, i64 0, i64 %479
  store i32 %476, ptr %480, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %45) #5
  %481 = load i32, ptr %37, align 4, !tbaa !5
  %482 = sext i32 %481 to i64
  %483 = getelementptr inbounds [2501 x [7 x %"struct.std::pair"]], ptr @pos, i64 0, i64 %482
  %484 = getelementptr inbounds [7 x %"struct.std::pair"], ptr %483, i64 0, i64 0
  store ptr %484, ptr %45, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %46) #5
  store i32 0, ptr %46, align 4, !tbaa !5
  br label %485

485:                                              ; preds = %703, %474
  %486 = load i32, ptr %46, align 4, !tbaa !5
  %487 = load i32, ptr @n, align 4, !tbaa !5
  %488 = icmp slt i32 %486, %487
  br i1 %488, label %490, label %489

489:                                              ; preds = %485
  store i32 38, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %46) #5
  br label %706

490:                                              ; preds = %485
  %491 = load i32, ptr %46, align 4, !tbaa !5
  %492 = sext i32 %491 to i64
  %493 = getelementptr inbounds [2501 x i32], ptr @sta, i64 0, i64 %492
  %494 = load i32, ptr %493, align 4, !tbaa !5
  %495 = icmp ne i32 %494, -1
  br i1 %495, label %496, label %497

496:                                              ; preds = %490
  br label %703

497:                                              ; preds = %490
  call void @llvm.lifetime.start.p0(i64 8, ptr %47) #5
  %498 = load i32, ptr %46, align 4, !tbaa !5
  %499 = sext i32 %498 to i64
  %500 = getelementptr inbounds [2501 x [2501 x i32]], ptr @rem, i64 0, i64 %499
  %501 = getelementptr inbounds [2501 x i32], ptr %500, i64 0, i64 0
  store ptr %501, ptr %47, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %48) #5
  %502 = load i32, ptr %46, align 4, !tbaa !5
  %503 = sext i32 %502 to i64
  %504 = getelementptr inbounds [2501 x [7 x %"struct.std::pair"]], ptr @pos, i64 0, i64 %503
  %505 = getelementptr inbounds [7 x %"struct.std::pair"], ptr %504, i64 0, i64 0
  store ptr %505, ptr %48, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %49) #5
  %506 = load i32, ptr %46, align 4, !tbaa !5
  %507 = sext i32 %506 to i64
  %508 = getelementptr inbounds [2501 x [2501 x %"struct.std::pair.0"]], ptr @op, i64 0, i64 %507
  %509 = getelementptr inbounds [2501 x %"struct.std::pair.0"], ptr %508, i64 0, i64 0
  store ptr %509, ptr %49, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %50) #5
  store i32 0, ptr %50, align 4, !tbaa !5
  br label %510

510:                                              ; preds = %699, %497
  %511 = load i32, ptr %50, align 4, !tbaa !5
  %512 = load i32, ptr %37, align 4, !tbaa !5
  %513 = sext i32 %512 to i64
  %514 = getelementptr inbounds [2501 x i32], ptr @sz, i64 0, i64 %513
  %515 = load i32, ptr %514, align 4, !tbaa !5
  %516 = icmp slt i32 %511, %515
  br i1 %516, label %518, label %517

517:                                              ; preds = %510
  store i32 41, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %50) #5
  br label %702

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

519:                                              ; preds = %695, %518
  %520 = load i32, ptr %51, align 4, !tbaa !5
  %521 = load i32, ptr %46, align 4, !tbaa !5
  %522 = sext i32 %521 to i64
  %523 = getelementptr inbounds [2501 x i32], ptr @sz, i64 0, i64 %522
  %524 = load i32, ptr %523, align 4, !tbaa !5
  %525 = icmp slt i32 %520, %524
  br i1 %525, label %527, label %526

526:                                              ; preds = %519
  store i32 44, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %51) #5
  br label %698

527:                                              ; preds = %519
  call void @llvm.lifetime.start.p0(i64 4, ptr %52) #5
  %528 = load ptr, ptr %45, align 8, !tbaa !12
  %529 = load i32, ptr %50, align 4, !tbaa !5
  %530 = sext i32 %529 to i64
  %531 = getelementptr inbounds %"struct.std::pair", ptr %528, i64 %530
  %532 = getelementptr inbounds %"struct.std::pair", ptr %531, i32 0, i32 0
  %533 = load i32, ptr %532, align 4, !tbaa !17
  %534 = load ptr, ptr %48, align 8, !tbaa !12
  %535 = load i32, ptr %51, align 4, !tbaa !5
  %536 = sext i32 %535 to i64
  %537 = getelementptr inbounds %"struct.std::pair", ptr %534, i64 %536
  %538 = getelementptr inbounds %"struct.std::pair", ptr %537, i32 0, i32 0
  %539 = load i32, ptr %538, align 4, !tbaa !17
  %540 = sub nsw i32 %533, %539
  %541 = load ptr, ptr %48, align 8, !tbaa !12
  %542 = getelementptr inbounds %"struct.std::pair", ptr %541, i64 0
  %543 = getelementptr inbounds %"struct.std::pair", ptr %542, i32 0, i32 0
  %544 = load i32, ptr %543, align 4, !tbaa !17
  %545 = add nsw i32 %540, %544
  store i32 %545, ptr %52, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %53) #5
  %546 = load ptr, ptr %45, align 8, !tbaa !12
  %547 = load i32, ptr %50, align 4, !tbaa !5
  %548 = sext i32 %547 to i64
  %549 = getelementptr inbounds %"struct.std::pair", ptr %546, i64 %548
  %550 = getelementptr inbounds %"struct.std::pair", ptr %549, i32 0, i32 1
  %551 = load i32, ptr %550, align 4, !tbaa !19
  %552 = load ptr, ptr %48, align 8, !tbaa !12
  %553 = load i32, ptr %51, align 4, !tbaa !5
  %554 = sext i32 %553 to i64
  %555 = getelementptr inbounds %"struct.std::pair", ptr %552, i64 %554
  %556 = getelementptr inbounds %"struct.std::pair", ptr %555, i32 0, i32 1
  %557 = load i32, ptr %556, align 4, !tbaa !19
  %558 = sub nsw i32 %551, %557
  %559 = load ptr, ptr %48, align 8, !tbaa !12
  %560 = getelementptr inbounds %"struct.std::pair", ptr %559, i64 0
  %561 = getelementptr inbounds %"struct.std::pair", ptr %560, i32 0, i32 1
  %562 = load i32, ptr %561, align 4, !tbaa !19
  %563 = add nsw i32 %558, %562
  store i32 %563, ptr %53, align 4, !tbaa !5
  %564 = load i32, ptr %52, align 4, !tbaa !5
  %565 = icmp slt i32 %564, 0
  br i1 %565, label %577, label %566

566:                                              ; preds = %527
  %567 = load i32, ptr %52, align 4, !tbaa !5
  %568 = load i32, ptr @r, align 4, !tbaa !5
  %569 = icmp sge i32 %567, %568
  br i1 %569, label %577, label %570

570:                                              ; preds = %566
  %571 = load i32, ptr %53, align 4, !tbaa !5
  %572 = icmp slt i32 %571, 0
  br i1 %572, label %577, label %573

573:                                              ; preds = %570
  %574 = load i32, ptr %53, align 4, !tbaa !5
  %575 = load i32, ptr @c, align 4, !tbaa !5
  %576 = icmp sge i32 %574, %575
  br i1 %576, label %577, label %578

577:                                              ; preds = %573, %570, %566, %527
  store i32 46, ptr %5, align 4
  br label %692

578:                                              ; preds = %573
  call void @llvm.lifetime.start.p0(i64 4, ptr %54) #5
  %579 = load i32, ptr %52, align 4, !tbaa !5
  %580 = load i32, ptr @c, align 4, !tbaa !5
  %581 = mul nsw i32 %579, %580
  %582 = load i32, ptr %53, align 4, !tbaa !5
  %583 = add nsw i32 %581, %582
  store i32 %583, ptr %54, align 4, !tbaa !5
  %584 = load ptr, ptr %47, align 8, !tbaa !12
  %585 = load i32, ptr %54, align 4, !tbaa !5
  %586 = sext i32 %585 to i64
  %587 = getelementptr inbounds i32, ptr %584, i64 %586
  %588 = load i32, ptr %587, align 4, !tbaa !5
  %589 = add nsw i32 %588, -1
  store i32 %589, ptr %587, align 4, !tbaa !5
  %590 = icmp sgt i32 %589, 0
  br i1 %590, label %591, label %592

591:                                              ; preds = %578
  store i32 46, ptr %5, align 4
  br label %691

592:                                              ; preds = %578
  call void @llvm.lifetime.start.p0(i64 1, ptr %55) #5
  store i8 0, ptr %55, align 1, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 4, ptr %56) #5
  store i32 0, ptr %56, align 4, !tbaa !5
  br label %593

593:                                              ; preds = %687, %592
  %594 = load i8, ptr %55, align 1, !tbaa !30, !range !32, !noundef !33
  %595 = trunc i8 %594 to i1
  br i1 %595, label %599, label %596

596:                                              ; preds = %593
  %597 = load i32, ptr %56, align 4, !tbaa !5
  %598 = icmp sle i32 %597, 1
  br label %599

599:                                              ; preds = %596, %593
  %600 = phi i1 [ false, %593 ], [ %598, %596 ]
  br i1 %600, label %602, label %601

601:                                              ; preds = %599
  store i32 47, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %56) #5
  br label %690

602:                                              ; preds = %599
  call void @llvm.lifetime.start.p0(i64 4, ptr %57) #5
  store i32 -1, ptr %57, align 4, !tbaa !5
  br label %603

603:                                              ; preds = %683, %602
  %604 = load i8, ptr %55, align 1, !tbaa !30, !range !32, !noundef !33
  %605 = trunc i8 %604 to i1
  br i1 %605, label %609, label %606

606:                                              ; preds = %603
  %607 = load i32, ptr %57, align 4, !tbaa !5
  %608 = icmp sle i32 %607, 1
  br label %609

609:                                              ; preds = %606, %603
  %610 = phi i1 [ false, %603 ], [ %608, %606 ]
  br i1 %610, label %612, label %611

611:                                              ; preds = %609
  store i32 50, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %57) #5
  br label %686

612:                                              ; preds = %609
  %613 = load i32, ptr %56, align 4, !tbaa !5
  %614 = icmp ne i32 %613, 0
  %615 = xor i1 %614, true
  %616 = zext i1 %615 to i32
  %617 = load i32, ptr %57, align 4, !tbaa !5
  %618 = icmp ne i32 %617, 0
  %619 = xor i1 %618, true
  %620 = zext i1 %619 to i32
  %621 = icmp eq i32 %616, %620
  br i1 %621, label %622, label %623

622:                                              ; preds = %612
  br label %683

623:                                              ; preds = %612
  call void @llvm.lifetime.start.p0(i64 4, ptr %58) #5
  %624 = load i32, ptr %54, align 4, !tbaa !5
  %625 = load i32, ptr %56, align 4, !tbaa !5
  %626 = load i32, ptr @c, align 4, !tbaa !5
  %627 = mul nsw i32 %625, %626
  %628 = add nsw i32 %624, %627
  %629 = load i32, ptr %57, align 4, !tbaa !5
  %630 = add nsw i32 %628, %629
  store i32 %630, ptr %58, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %59) #5
  %631 = load i32, ptr %52, align 4, !tbaa !5
  %632 = load i32, ptr %56, align 4, !tbaa !5
  %633 = add nsw i32 %631, %632
  store i32 %633, ptr %59, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %60) #5
  %634 = load i32, ptr %53, align 4, !tbaa !5
  %635 = load i32, ptr %57, align 4, !tbaa !5
  %636 = add nsw i32 %634, %635
  store i32 %636, ptr %60, align 4, !tbaa !5
  %637 = load i32, ptr %59, align 4, !tbaa !5
  %638 = icmp slt i32 %637, 0
  br i1 %638, label %658, label %639

639:                                              ; preds = %623
  %640 = load i32, ptr %59, align 4, !tbaa !5
  %641 = load i32, ptr @r, align 4, !tbaa !5
  %642 = icmp sge i32 %640, %641
  br i1 %642, label %658, label %643

643:                                              ; preds = %639
  %644 = load i32, ptr %60, align 4, !tbaa !5
  %645 = icmp slt i32 %644, 0
  br i1 %645, label %658, label %646

646:                                              ; preds = %643
  %647 = load i32, ptr %60, align 4, !tbaa !5
  %648 = load i32, ptr @c, align 4, !tbaa !5
  %649 = icmp sge i32 %647, %648
  br i1 %649, label %658, label %650

650:                                              ; preds = %646
  %651 = load ptr, ptr %49, align 8, !tbaa !12
  %652 = load i32, ptr %58, align 4, !tbaa !5
  %653 = sext i32 %652 to i64
  %654 = getelementptr inbounds %"struct.std::pair.0", ptr %651, i64 %653
  %655 = getelementptr inbounds %"struct.std::pair.0", ptr %654, i32 0, i32 1
  %656 = load i8, ptr %655, align 4, !tbaa !26
  %657 = icmp ne i8 %656, 0
  br i1 %657, label %659, label %658

658:                                              ; preds = %650, %646, %643, %639, %623
  store i32 52, ptr %5, align 4
  br label %680

659:                                              ; preds = %650
  call void @llvm.lifetime.start.p0(i64 8, ptr %61) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %62) #5
  %660 = load i32, ptr %56, align 4, !tbaa !5
  %661 = icmp sgt i32 %660, 0
  br i1 %661, label %662, label %663

662:                                              ; preds = %659
  br label %668

663:                                              ; preds = %659
  %664 = load i32, ptr %57, align 4, !tbaa !5
  %665 = icmp sgt i32 %664, 0
  %666 = zext i1 %665 to i64
  %667 = select i1 %665, i8 82, i8 76
  br label %668

668:                                              ; preds = %663, %662
  %669 = phi i8 [ 68, %662 ], [ %667, %663 ]
  store i8 %669, ptr %62, align 1, !tbaa !11
  call void @_ZNSt4pairIicEC2IRicTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(5) %61, ptr noundef nonnull align 4 dereferenceable(4) %58, ptr noundef nonnull align 1 dereferenceable(1) %62)
  %670 = load ptr, ptr %49, align 8, !tbaa !12
  %671 = load i32, ptr %54, align 4, !tbaa !5
  %672 = sext i32 %671 to i64
  %673 = getelementptr inbounds %"struct.std::pair.0", ptr %670, i64 %672
  %674 = call noundef nonnull align 4 dereferenceable(5) ptr @_ZNSt4pairIicEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(5) %673, ptr noundef nonnull align 4 dereferenceable(5) %61) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %62) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %61) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %63) #5
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %63, ptr noundef nonnull align 4 dereferenceable(4) %46, ptr noundef nonnull align 4 dereferenceable(4) %54)
  %675 = load i32, ptr @tot, align 4, !tbaa !5
  %676 = add nsw i32 %675, 1
  store i32 %676, ptr @tot, align 4, !tbaa !5
  %677 = sext i32 %675 to i64
  %678 = getelementptr inbounds [6250001 x %"struct.std::pair"], ptr @que, i64 0, i64 %677
  %679 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %678, ptr noundef nonnull align 4 dereferenceable(8) %63) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %63) #5
  store i8 1, ptr %55, align 1, !tbaa !30
  store i32 0, ptr %5, align 4
  br label %680

680:                                              ; preds = %668, %658
  call void @llvm.lifetime.end.p0(i64 4, ptr %60) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %59) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %58) #5
  %681 = load i32, ptr %5, align 4
  switch i32 %681, label %850 [
    i32 0, label %682
    i32 52, label %683
  ]

682:                                              ; preds = %680
  br label %683

683:                                              ; preds = %682, %680, %622
  %684 = load i32, ptr %57, align 4, !tbaa !5
  %685 = add nsw i32 %684, 1
  store i32 %685, ptr %57, align 4, !tbaa !5
  br label %603, !llvm.loop !34

686:                                              ; preds = %611
  br label %687

687:                                              ; preds = %686
  %688 = load i32, ptr %56, align 4, !tbaa !5
  %689 = add nsw i32 %688, 1
  store i32 %689, ptr %56, align 4, !tbaa !5
  br label %593, !llvm.loop !35

690:                                              ; preds = %601
  call void @llvm.lifetime.end.p0(i64 1, ptr %55) #5
  store i32 0, ptr %5, align 4
  br label %691

691:                                              ; preds = %690, %591
  call void @llvm.lifetime.end.p0(i64 4, ptr %54) #5
  br label %692

692:                                              ; preds = %691, %577
  call void @llvm.lifetime.end.p0(i64 4, ptr %53) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %52) #5
  %693 = load i32, ptr %5, align 4
  switch i32 %693, label %850 [
    i32 0, label %694
    i32 46, label %695
  ]

694:                                              ; preds = %692
  br label %695

695:                                              ; preds = %694, %692
  %696 = load i32, ptr %51, align 4, !tbaa !5
  %697 = add nsw i32 %696, 1
  store i32 %697, ptr %51, align 4, !tbaa !5
  br label %519, !llvm.loop !36

698:                                              ; preds = %526
  br label %699

699:                                              ; preds = %698
  %700 = load i32, ptr %50, align 4, !tbaa !5
  %701 = add nsw i32 %700, 1
  store i32 %701, ptr %50, align 4, !tbaa !5
  br label %510, !llvm.loop !37

702:                                              ; preds = %517
  call void @llvm.lifetime.end.p0(i64 8, ptr %49) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %48) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #5
  br label %703

703:                                              ; preds = %702, %496
  %704 = load i32, ptr %46, align 4, !tbaa !5
  %705 = add nsw i32 %704, 1
  store i32 %705, ptr %46, align 4, !tbaa !5
  br label %485, !llvm.loop !38

706:                                              ; preds = %489
  store i32 34, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #5
  br label %807

707:                                              ; preds = %431
  call void @llvm.lifetime.start.p0(i64 8, ptr %64) #5
  %708 = load i32, ptr %37, align 4, !tbaa !5
  %709 = sext i32 %708 to i64
  %710 = getelementptr inbounds [2501 x [2501 x i32]], ptr @rem, i64 0, i64 %709
  %711 = getelementptr inbounds [2501 x i32], ptr %710, i64 0, i64 0
  store ptr %711, ptr %64, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %65) #5
  store i32 -1, ptr %65, align 4, !tbaa !5
  br label %712

712:                                              ; preds = %803, %707
  %713 = load i32, ptr %65, align 4, !tbaa !5
  %714 = icmp sle i32 %713, 0
  br i1 %714, label %716, label %715

715:                                              ; preds = %712
  store i32 53, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %65) #5
  br label %806

716:                                              ; preds = %712
  call void @llvm.lifetime.start.p0(i64 4, ptr %66) #5
  store i32 -1, ptr %66, align 4, !tbaa !5
  br label %717

717:                                              ; preds = %799, %716
  %718 = load i32, ptr %66, align 4, !tbaa !5
  %719 = icmp sle i32 %718, 1
  br i1 %719, label %721, label %720

720:                                              ; preds = %717
  store i32 56, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %66) #5
  br label %802

721:                                              ; preds = %717
  %722 = load i32, ptr %65, align 4, !tbaa !5
  %723 = icmp ne i32 %722, 0
  %724 = xor i1 %723, true
  %725 = zext i1 %724 to i32
  %726 = load i32, ptr %66, align 4, !tbaa !5
  %727 = icmp ne i32 %726, 0
  %728 = xor i1 %727, true
  %729 = zext i1 %728 to i32
  %730 = icmp eq i32 %725, %729
  br i1 %730, label %731, label %732

731:                                              ; preds = %721
  br label %799

732:                                              ; preds = %721
  call void @llvm.lifetime.start.p0(i64 4, ptr %67) #5
  %733 = load i32, ptr %38, align 4, !tbaa !5
  %734 = load i32, ptr %65, align 4, !tbaa !5
  %735 = load i32, ptr @c, align 4, !tbaa !5
  %736 = mul nsw i32 %734, %735
  %737 = add nsw i32 %733, %736
  %738 = load i32, ptr %66, align 4, !tbaa !5
  %739 = add nsw i32 %737, %738
  store i32 %739, ptr %67, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %68) #5
  %740 = load i32, ptr %41, align 4, !tbaa !5
  %741 = load i32, ptr %65, align 4, !tbaa !5
  %742 = add nsw i32 %740, %741
  store i32 %742, ptr %68, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %69) #5
  %743 = load i32, ptr %42, align 4, !tbaa !5
  %744 = load i32, ptr %66, align 4, !tbaa !5
  %745 = add nsw i32 %743, %744
  store i32 %745, ptr %69, align 4, !tbaa !5
  %746 = load i32, ptr %68, align 4, !tbaa !5
  %747 = icmp slt i32 %746, 0
  br i1 %747, label %774, label %748

748:                                              ; preds = %732
  %749 = load i32, ptr %68, align 4, !tbaa !5
  %750 = load i32, ptr @r, align 4, !tbaa !5
  %751 = icmp sge i32 %749, %750
  br i1 %751, label %774, label %752

752:                                              ; preds = %748
  %753 = load i32, ptr %69, align 4, !tbaa !5
  %754 = icmp slt i32 %753, 0
  br i1 %754, label %774, label %755

755:                                              ; preds = %752
  %756 = load i32, ptr %69, align 4, !tbaa !5
  %757 = load i32, ptr @c, align 4, !tbaa !5
  %758 = icmp sge i32 %756, %757
  br i1 %758, label %774, label %759

759:                                              ; preds = %755
  %760 = load ptr, ptr %64, align 8, !tbaa !12
  %761 = load i32, ptr %67, align 4, !tbaa !5
  %762 = sext i32 %761 to i64
  %763 = getelementptr inbounds i32, ptr %760, i64 %762
  %764 = load i32, ptr %763, align 4, !tbaa !5
  %765 = icmp ne i32 %764, 0
  br i1 %765, label %774, label %766

766:                                              ; preds = %759
  %767 = load ptr, ptr %40, align 8, !tbaa !12
  %768 = load i32, ptr %67, align 4, !tbaa !5
  %769 = sext i32 %768 to i64
  %770 = getelementptr inbounds %"struct.std::pair.0", ptr %767, i64 %769
  %771 = getelementptr inbounds %"struct.std::pair.0", ptr %770, i32 0, i32 1
  %772 = load i8, ptr %771, align 4, !tbaa !26
  %773 = icmp ne i8 %772, 0
  br i1 %773, label %774, label %775

774:                                              ; preds = %766, %759, %755, %752, %748, %732
  store i32 58, ptr %5, align 4
  br label %796

775:                                              ; preds = %766
  call void @llvm.lifetime.start.p0(i64 8, ptr %70) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %71) #5
  %776 = load i32, ptr %65, align 4, !tbaa !5
  %777 = icmp slt i32 %776, 0
  br i1 %777, label %778, label %779

778:                                              ; preds = %775
  br label %784

779:                                              ; preds = %775
  %780 = load i32, ptr %66, align 4, !tbaa !5
  %781 = icmp slt i32 %780, 0
  %782 = zext i1 %781 to i64
  %783 = select i1 %781, i8 82, i8 76
  br label %784

784:                                              ; preds = %779, %778
  %785 = phi i8 [ 68, %778 ], [ %783, %779 ]
  store i8 %785, ptr %71, align 1, !tbaa !11
  call void @_ZNSt4pairIicEC2IRicTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(5) %70, ptr noundef nonnull align 4 dereferenceable(4) %38, ptr noundef nonnull align 1 dereferenceable(1) %71)
  %786 = load ptr, ptr %40, align 8, !tbaa !12
  %787 = load i32, ptr %67, align 4, !tbaa !5
  %788 = sext i32 %787 to i64
  %789 = getelementptr inbounds %"struct.std::pair.0", ptr %786, i64 %788
  %790 = call noundef nonnull align 4 dereferenceable(5) ptr @_ZNSt4pairIicEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(5) %789, ptr noundef nonnull align 4 dereferenceable(5) %70) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %71) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %70) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %72) #5
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %72, ptr noundef nonnull align 4 dereferenceable(4) %37, ptr noundef nonnull align 4 dereferenceable(4) %67)
  %791 = load i32, ptr @tot, align 4, !tbaa !5
  %792 = add nsw i32 %791, 1
  store i32 %792, ptr @tot, align 4, !tbaa !5
  %793 = sext i32 %791 to i64
  %794 = getelementptr inbounds [6250001 x %"struct.std::pair"], ptr @que, i64 0, i64 %793
  %795 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %794, ptr noundef nonnull align 4 dereferenceable(8) %72) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %72) #5
  store i32 0, ptr %5, align 4
  br label %796

796:                                              ; preds = %784, %774
  call void @llvm.lifetime.end.p0(i64 4, ptr %69) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %68) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %67) #5
  %797 = load i32, ptr %5, align 4
  switch i32 %797, label %850 [
    i32 0, label %798
    i32 58, label %799
  ]

798:                                              ; preds = %796
  br label %799

799:                                              ; preds = %798, %796, %731
  %800 = load i32, ptr %66, align 4, !tbaa !5
  %801 = add nsw i32 %800, 1
  store i32 %801, ptr %66, align 4, !tbaa !5
  br label %717, !llvm.loop !39

802:                                              ; preds = %720
  br label %803

803:                                              ; preds = %802
  %804 = load i32, ptr %65, align 4, !tbaa !5
  %805 = add nsw i32 %804, 1
  store i32 %805, ptr %65, align 4, !tbaa !5
  br label %712, !llvm.loop !40

806:                                              ; preds = %715
  call void @llvm.lifetime.end.p0(i64 8, ptr %64) #5
  store i32 0, ptr %5, align 4
  br label %807

807:                                              ; preds = %806, %706
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #5
  br label %808

808:                                              ; preds = %807, %430
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #5
  %809 = load i32, ptr %5, align 4
  switch i32 %809, label %850 [
    i32 0, label %810
    i32 34, label %811
  ]

810:                                              ; preds = %808
  br label %811

811:                                              ; preds = %810, %808
  %812 = load i32, ptr %36, align 4, !tbaa !5
  %813 = add nsw i32 %812, 1
  store i32 %813, ptr %36, align 4, !tbaa !5
  br label %415, !llvm.loop !41

814:                                              ; preds = %419
  %815 = load i32, ptr @m, align 4, !tbaa !5
  %816 = load i32, ptr @n, align 4, !tbaa !5
  %817 = icmp slt i32 %815, %816
  br i1 %817, label %818, label %820

818:                                              ; preds = %814
  %819 = call i32 @puts(ptr noundef @.str.4)
  br label %848

820:                                              ; preds = %814
  %821 = load i32, ptr @n, align 4, !tbaa !5
  %822 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %821)
  call void @llvm.lifetime.start.p0(i64 4, ptr %73) #5
  %823 = load i32, ptr @n, align 4, !tbaa !5
  %824 = sub nsw i32 %823, 1
  store i32 %824, ptr %73, align 4, !tbaa !5
  br label %825

825:                                              ; preds = %844, %820
  %826 = load i32, ptr %73, align 4, !tbaa !5
  %827 = icmp sge i32 %826, 0
  br i1 %827, label %829, label %828

828:                                              ; preds = %825
  store i32 59, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %73) #5
  br label %847

829:                                              ; preds = %825
  call void @llvm.lifetime.start.p0(i64 4, ptr %74) #5
  %830 = load i32, ptr %73, align 4, !tbaa !5
  %831 = sext i32 %830 to i64
  %832 = getelementptr inbounds [2501 x i32], ptr @seq, i64 0, i64 %831
  %833 = load i32, ptr %832, align 4, !tbaa !5
  store i32 %833, ptr %74, align 4, !tbaa !5
  %834 = load i32, ptr %74, align 4, !tbaa !5
  %835 = sext i32 %834 to i64
  %836 = getelementptr inbounds [2501 x i32], ptr @sta, i64 0, i64 %835
  %837 = load i32, ptr %836, align 4, !tbaa !5
  %838 = add nsw i32 %837, 1
  %839 = load i32, ptr %74, align 4, !tbaa !5
  %840 = sext i32 %839 to i64
  %841 = getelementptr inbounds [2501 x [2501 x i8]], ptr @ans, i64 0, i64 %840
  %842 = getelementptr inbounds [2501 x i8], ptr %841, i64 0, i64 0
  %843 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i32 noundef %838, ptr noundef %842)
  call void @llvm.lifetime.end.p0(i64 4, ptr %74) #5
  br label %844

844:                                              ; preds = %829
  %845 = load i32, ptr %73, align 4, !tbaa !5
  %846 = add nsw i32 %845, -1
  store i32 %846, ptr %73, align 4, !tbaa !5
  br label %825, !llvm.loop !42

847:                                              ; preds = %828
  br label %848

848:                                              ; preds = %847, %818
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %849 = load i32, ptr %1, align 4
  ret i32 %849

850:                                              ; preds = %808, %796, %692, %680, %237
  unreachable
}

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt3tieIJiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 8, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJRiS0_EEaSIiiEENSt9enable_ifIXcl12__assignableIRKT_RKT0_EEERS1_E4typeERKSt4pairIS4_S7_E(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

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

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

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

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

declare i32 @puts(ptr noundef) #1

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = !{!18, !6, i64 0}
!18 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!19 = !{!18, !6, i64 4}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}
!26 = !{!27, !7, i64 4}
!27 = !{!"_ZTSSt4pairIicE", !6, i64 0, !7, i64 4}
!28 = !{!27, !6, i64 0}
!29 = distinct !{!29, !10}
!30 = !{!31, !31, i64 0}
!31 = !{!"bool", !7, i64 0}
!32 = !{i8 0, i8 2}
!33 = !{}
!34 = distinct !{!34, !10}
!35 = distinct !{!35, !10}
!36 = distinct !{!36, !10}
!37 = distinct !{!37, !10}
!38 = distinct !{!38, !10}
!39 = distinct !{!39, !10}
!40 = distinct !{!40, !10}
!41 = distinct !{!41, !10}
!42 = distinct !{!42, !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"

%"struct.std::pair" = type { i32, i32 }
%"struct.std::pair.0" = type <{ i32, i8, [3 x i8] }>
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.2", %"struct.std::_Head_base.3" }
%"struct.std::_Tuple_impl.2" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { ptr }
%"struct.std::_Head_base.3" = type { ptr }

@mat = external dso_local global [51 x [51 x i8]], align 16
@ans = external dso_local global [2501 x [2501 x i8]], align 16
@r = external dso_local global i32, align 4
@c = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local local_unnamed_addr global i32, align 4
@tot = external dso_local local_unnamed_addr global i32, align 4
@seq = external dso_local local_unnamed_addr global [2501 x i32], align 16
@sta = external dso_local local_unnamed_addr global [2501 x i32], align 16
@sz = external dso_local local_unnamed_addr global [2501 x i32], align 16
@rem = external dso_local local_unnamed_addr global [2501 x [2501 x i32]], align 16
@pos = external dso_local global [2501 x [7 x %"struct.std::pair"]], align 16
@que = external dso_local global [6250001 x %"struct.std::pair"], align 16
@op = external dso_local global [2501 x [2501 x %"struct.std::pair.0"]], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.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 [7 x i8], align 1

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"struct.std::pair", align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::tuple", align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"struct.std::pair", align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.std::tuple", align 8
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::pair.0", align 4
  %15 = alloca i32, align 4
  %16 = alloca i8, align 1
  %17 = alloca %"struct.std::pair", align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca %"class.std::tuple", align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca %"struct.std::pair.0", align 4
  %25 = alloca i8, align 1
  %26 = alloca %"struct.std::pair", align 4
  %27 = alloca i32, align 4
  %28 = alloca %"struct.std::pair.0", align 4
  %29 = alloca i8, align 1
  %30 = alloca %"struct.std::pair", align 4
  %31 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @r, ptr noundef nonnull @c)
  %32 = load i32, ptr @r, align 4, !tbaa !5
  %33 = load i32, ptr @c, align 4, !tbaa !5
  %34 = mul nsw i32 %33, %32
  %35 = icmp sgt i32 %32, 0
  br i1 %35, label %.lr.ph, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  br label %._crit_edge277

._crit_edge:                                      ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  store i32 0, ptr %1, align 4, !tbaa !5
  %36 = icmp sgt i32 %43, 0
  br i1 %36, label %.lr.ph276, label %._crit_edge277

.lr.ph276:                                        ; preds = %._crit_edge
  %37 = sext i32 %34 to i64
  %38 = shl nsw i64 %37, 2
  %39 = load i32, ptr @c, align 4, !tbaa !5
  %40 = icmp sgt i32 %39, 0
  br i1 %40, label %.lr.ph276.split, label %._crit_edge277

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %41 = getelementptr inbounds [51 x [51 x i8]], ptr @mat, i64 0, i64 %indvars.iv
  %42 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %41)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %43 = load i32, ptr @r, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = icmp slt i64 %indvars.iv.next, %44
  br i1 %45, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge277:                                   ; preds = %._crit_edge274, %.lr.ph276, %._crit_edge.thread, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  %46 = load i32, ptr @tot, align 4, !tbaa !5
  %47 = icmp sgt i32 %46, 0
  br i1 %47, label %.lr.ph307, label %._crit_edge308

.lr.ph276.split:                                  ; preds = %.lr.ph276, %._crit_edge274
  %48 = phi i32 [ %53, %._crit_edge274 ], [ %43, %.lr.ph276 ]
  %49 = phi i32 [ %57, %._crit_edge274 ], [ 0, %.lr.ph276 ]
  %50 = phi i32 [ %55, %._crit_edge274 ], [ %39, %.lr.ph276 ]
  %51 = phi i32 [ %56, %._crit_edge274 ], [ %39, %.lr.ph276 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  %52 = icmp sgt i32 %51, 0
  br i1 %52, label %.lr.ph273, label %._crit_edge274

._crit_edge274.loopexit:                          ; preds = %235
  %.pre361 = load i32, ptr %1, align 4, !tbaa !5
  %.pre362 = load i32, ptr @r, align 4, !tbaa !5
  br label %._crit_edge274

._crit_edge274:                                   ; preds = %._crit_edge274.loopexit, %.lr.ph276.split
  %53 = phi i32 [ %.pre362, %._crit_edge274.loopexit ], [ %48, %.lr.ph276.split ]
  %54 = phi i32 [ %.pre361, %._crit_edge274.loopexit ], [ %49, %.lr.ph276.split ]
  %55 = phi i32 [ %236, %._crit_edge274.loopexit ], [ %50, %.lr.ph276.split ]
  %56 = phi i32 [ %236, %._crit_edge274.loopexit ], [ %51, %.lr.ph276.split ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  %57 = add nsw i32 %54, 1
  store i32 %57, ptr %1, align 4, !tbaa !5
  %58 = icmp slt i32 %57, %53
  br i1 %58, label %.lr.ph276.split, label %._crit_edge277, !llvm.loop !11

.lr.ph273:                                        ; preds = %.lr.ph276.split, %235
  %59 = phi i32 [ %236, %235 ], [ %50, %.lr.ph276.split ]
  %storemerge204271 = phi i32 [ %238, %235 ], [ 0, %.lr.ph276.split ]
  %60 = load i32, ptr %1, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = sext i32 %storemerge204271 to i64
  %63 = getelementptr inbounds [51 x [51 x i8]], ptr @mat, i64 0, i64 %61, i64 %62
  %64 = load i8, ptr %63, align 1, !tbaa !13
  %65 = add i8 %64, -123
  %or.cond211 = icmp ult i8 %65, -26
  br i1 %or.cond211, label %235, label %66

66:                                               ; preds = %.lr.ph273
  %67 = load i32, ptr @n, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [2501 x i32], ptr @sz, i64 0, i64 %68
  store i32 0, ptr %69, align 4, !tbaa !5
  %70 = getelementptr inbounds [2501 x [2501 x i32]], ptr @rem, i64 0, i64 %68
  %71 = getelementptr inbounds [2501 x [7 x %"struct.std::pair"]], ptr @pos, i64 0, i64 %68
  store i8 46, ptr %63, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %72 = load i32, ptr %69, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %69, align 4, !tbaa !5
  %74 = sext i32 %72 to i64
  %75 = getelementptr inbounds %"struct.std::pair", ptr %71, i64 %74
  %76 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %75, ptr noundef nonnull align 4 dereferenceable(8) %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  %77 = load i32, ptr %69, align 4, !tbaa !5
  %78 = icmp sgt i32 %77, 0
  br i1 %78, label %.lr.ph247, label %._crit_edge248

._crit_edge248:                                   ; preds = %131, %66
  %79 = phi i32 [ %77, %66 ], [ %132, %131 ]
  call void @llvm.memset.p0.i64(ptr nonnull align 4 %70, i8 63, i64 %38, i1 false)
  %80 = load i32, ptr @r, align 4, !tbaa !5
  %81 = icmp sgt i32 %80, 0
  br i1 %81, label %.preheader241.lr.ph, label %._crit_edge261

.preheader241.lr.ph:                              ; preds = %._crit_edge248
  %82 = load i32, ptr @c, align 4
  %83 = icmp sgt i32 %82, 0
  %84 = getelementptr inbounds i8, ptr %71, i64 4
  br i1 %83, label %.preheader241.lr.ph.split.us, label %._crit_edge261

.preheader241.lr.ph.split.us:                     ; preds = %.preheader241.lr.ph
  %85 = icmp sgt i32 %79, 0
  br i1 %85, label %.preheader241.lr.ph.split.us.split.us, label %.preheader241.us.preheader

.preheader241.us.preheader:                       ; preds = %.preheader241.lr.ph.split.us
  %86 = mul nsw i64 %68, 10004
  %scevgep = getelementptr i8, ptr @rem, i64 %86
  %87 = zext nneg i32 %82 to i64
  %88 = shl nuw nsw i64 %87, 2
  %89 = zext nneg i32 %82 to i64
  %xtraiter = and i32 %80, 3
  %90 = icmp ult i32 %80, 4
  br i1 %90, label %._crit_edge261.loopexit410.unr-lcssa, label %.preheader241.us.preheader.new

.preheader241.us.preheader.new:                   ; preds = %.preheader241.us.preheader
  %unroll_iter = and i32 %80, 2147483644
  br label %.preheader241.us

.preheader241.lr.ph.split.us.split.us:            ; preds = %.preheader241.lr.ph.split.us
  %91 = load i32, ptr %71, align 8, !tbaa !14
  %92 = load i32, ptr %84, align 4, !tbaa !16
  %wide.trip.count = zext nneg i32 %79 to i64
  br label %.preheader241.us.us

.preheader241.us.us:                              ; preds = %._crit_edge256.split.us.us.us, %.preheader241.lr.ph.split.us.split.us
  %.0159260.us.us = phi i64 [ 0, %.preheader241.lr.ph.split.us.split.us ], [ %indvars.iv.next338, %._crit_edge256.split.us.us.us ]
  %.0163258.us.us = phi i32 [ 0, %.preheader241.lr.ph.split.us.split.us ], [ %118, %._crit_edge256.split.us.us.us ]
  %93 = sub nsw i32 %.0163258.us.us, %91
  %sext371 = shl i64 %.0159260.us.us, 32
  %94 = ashr exact i64 %sext371, 32
  br label %.lr.ph251.us.us.us

.lr.ph251.us.us.us:                               ; preds = %..loopexit239_crit_edge.us.us.us, %.preheader241.us.us
  %indvars.iv337 = phi i64 [ %indvars.iv.next338, %..loopexit239_crit_edge.us.us.us ], [ %94, %.preheader241.us.us ]
  %.0164252.us.us.us = phi i32 [ %117, %..loopexit239_crit_edge.us.us.us ], [ 0, %.preheader241.us.us ]
  %95 = getelementptr inbounds i32, ptr %70, i64 %indvars.iv337
  store i32 0, ptr %95, align 4, !tbaa !5
  %96 = sub nsw i32 %.0164252.us.us.us, %92
  br label %97

97:                                               ; preds = %.critedge.us.us.us, %.lr.ph251.us.us.us
  %98 = phi i32 [ %115, %.critedge.us.us.us ], [ 0, %.lr.ph251.us.us.us ]
  %indvars.iv331 = phi i64 [ %indvars.iv.next332, %.critedge.us.us.us ], [ 0, %.lr.ph251.us.us.us ]
  %99 = getelementptr inbounds %"struct.std::pair", ptr %71, i64 %indvars.iv331
  %100 = load i32, ptr %99, align 8, !tbaa !14
  %101 = add nsw i32 %93, %100
  %102 = getelementptr inbounds i8, ptr %99, i64 4
  %103 = load i32, ptr %102, align 4, !tbaa !16
  %104 = add nsw i32 %96, %103
  %105 = icmp slt i32 %101, 0
  br i1 %105, label %116, label %106

106:                                              ; preds = %97
  %107 = icmp slt i32 %101, %80
  %108 = icmp ult i32 %104, %82
  %or.cond213.us.us.us = select i1 %107, i1 %108, i1 false
  br i1 %or.cond213.us.us.us, label %.critedge.us.us.us, label %116

.critedge.us.us.us:                               ; preds = %106
  %109 = zext nneg i32 %101 to i64
  %110 = zext nneg i32 %104 to i64
  %111 = getelementptr inbounds [51 x [51 x i8]], ptr @mat, i64 0, i64 %109, i64 %110
  %112 = load i8, ptr %111, align 1, !tbaa !13
  %113 = icmp ne i8 %112, 46
  %114 = zext i1 %113 to i32
  %115 = add nuw nsw i32 %98, %114
  store i32 %115, ptr %95, align 4, !tbaa !5
  %indvars.iv.next332 = add nuw nsw i64 %indvars.iv331, 1
  %exitcond334.not = icmp eq i64 %indvars.iv.next332, %wide.trip.count
  br i1 %exitcond334.not, label %..loopexit239_crit_edge.us.us.us, label %97, !llvm.loop !17

116:                                              ; preds = %106, %97
  store i32 1061109567, ptr %95, align 4, !tbaa !5
  br label %..loopexit239_crit_edge.us.us.us

..loopexit239_crit_edge.us.us.us:                 ; preds = %.critedge.us.us.us, %116
  %117 = add nuw nsw i32 %.0164252.us.us.us, 1
  %indvars.iv.next338 = add nsw i64 %indvars.iv337, 1
  %exitcond340.not = icmp eq i32 %117, %82
  br i1 %exitcond340.not, label %._crit_edge256.split.us.us.us, label %.lr.ph251.us.us.us, !llvm.loop !18

._crit_edge256.split.us.us.us:                    ; preds = %..loopexit239_crit_edge.us.us.us
  %118 = add nuw nsw i32 %.0163258.us.us, 1
  %exitcond341.not = icmp eq i32 %118, %80
  br i1 %exitcond341.not, label %._crit_edge261, label %.preheader241.us.us, !llvm.loop !19

.preheader241.us:                                 ; preds = %.preheader241.us, %.preheader241.us.preheader.new
  %.0159260.us = phi i64 [ 0, %.preheader241.us.preheader.new ], [ %127, %.preheader241.us ]
  %niter = phi i32 [ 0, %.preheader241.us.preheader.new ], [ %niter.next.3, %.preheader241.us ]
  %sext = shl i64 %.0159260.us, 32
  %119 = ashr exact i64 %sext, 30
  %scevgep325 = getelementptr i8, ptr %scevgep, i64 %119
  call void @llvm.memset.p0.i64(ptr align 4 %scevgep325, i8 0, i64 %88, i1 false), !tbaa !5
  %120 = add nsw i64 %.0159260.us, %89
  %sext.1 = shl i64 %120, 32
  %121 = ashr exact i64 %sext.1, 30
  %scevgep325.1 = getelementptr i8, ptr %scevgep, i64 %121
  call void @llvm.memset.p0.i64(ptr align 4 %scevgep325.1, i8 0, i64 %88, i1 false), !tbaa !5
  %122 = add nsw i64 %120, %89
  %sext.2 = shl i64 %122, 32
  %123 = ashr exact i64 %sext.2, 30
  %scevgep325.2 = getelementptr i8, ptr %scevgep, i64 %123
  call void @llvm.memset.p0.i64(ptr align 4 %scevgep325.2, i8 0, i64 %88, i1 false), !tbaa !5
  %124 = add nsw i64 %122, %89
  %sext.3 = shl i64 %124, 32
  %125 = ashr exact i64 %sext.3, 32
  %126 = ashr exact i64 %sext.3, 30
  %scevgep325.3 = getelementptr i8, ptr %scevgep, i64 %126
  call void @llvm.memset.p0.i64(ptr align 4 %scevgep325.3, i8 0, i64 %88, i1 false), !tbaa !5
  %127 = add nsw i64 %125, %89
  %niter.next.3 = add i32 %niter, 4
  %niter.ncmp.3 = icmp eq i32 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge261.loopexit410.unr-lcssa, label %.preheader241.us, !llvm.loop !19

.lr.ph247:                                        ; preds = %66, %131
  %indvars.iv322 = phi i64 [ %indvars.iv.next323, %131 ], [ 0, %66 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  %128 = getelementptr inbounds %"struct.std::pair", ptr %71, i64 %indvars.iv322
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #5
  call void @_ZSt3tieIJiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple") align 8 %6, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5) #5
  %129 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJRiS0_EEaSIiiEENSt9enable_ifIXcl12__assignableIRKT_RKT0_EEERS1_E4typeERKSt4pairIS4_S7_E(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 4 dereferenceable(8) %128) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  br label %.preheader240

.preheader240:                                    ; preds = %.lr.ph247, %198
  %.0154244 = phi i32 [ -1, %.lr.ph247 ], [ %199, %198 ]
  %.not207.not = icmp eq i32 %.0154244, 0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  %130 = load i32, ptr %4, align 4, !tbaa !5
  br i1 %.not207.not, label %135, label %155

131:                                              ; preds = %198
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  %indvars.iv.next323 = add nuw nsw i64 %indvars.iv322, 1
  %132 = load i32, ptr %69, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = icmp slt i64 %indvars.iv.next323, %133
  br i1 %134, label %.lr.ph247, label %._crit_edge248, !llvm.loop !20

135:                                              ; preds = %.preheader240
  store i32 %130, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #5
  %136 = load i32, ptr %5, align 4, !tbaa !5
  %137 = add nsw i32 %136, -1
  store i32 %137, ptr %8, align 4, !tbaa !5
  %138 = icmp slt i32 %130, 0
  br i1 %138, label %176, label %139

139:                                              ; preds = %135
  %140 = load i32, ptr @r, align 4, !tbaa !5
  %141 = icmp slt i32 %130, %140
  %142 = icmp sgt i32 %136, 0
  %or.cond.not232 = select i1 %141, i1 %142, i1 false
  %143 = load i32, ptr @c, align 4
  %.not209 = icmp sle i32 %136, %143
  %or.cond212 = select i1 %or.cond.not232, i1 %.not209, i1 false
  br i1 %or.cond212, label %144, label %176

144:                                              ; preds = %139
  %145 = zext nneg i32 %130 to i64
  %146 = zext nneg i32 %137 to i64
  %147 = getelementptr inbounds [51 x [51 x i8]], ptr @mat, i64 0, i64 %145, i64 %146
  %148 = load i8, ptr %147, align 1, !tbaa !13
  %.not210 = icmp eq i8 %148, %64
  br i1 %.not210, label %149, label %176

149:                                              ; preds = %144
  store i8 46, ptr %147, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %150 = load i32, ptr %69, align 4, !tbaa !5
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %69, align 4, !tbaa !5
  %152 = sext i32 %150 to i64
  %153 = getelementptr inbounds %"struct.std::pair", ptr %71, i64 %152
  %154 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %153, ptr noundef nonnull align 4 dereferenceable(8) %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  br label %176

155:                                              ; preds = %.preheader240
  %156 = add nsw i32 %130, %.0154244
  store i32 %156, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #5
  %157 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %157, ptr %8, align 4, !tbaa !5
  %158 = icmp slt i32 %156, 0
  br i1 %158, label %175, label %159

159:                                              ; preds = %155
  %160 = load i32, ptr @r, align 4, !tbaa !5
  %161 = icmp slt i32 %156, %160
  %162 = icmp sgt i32 %157, -1
  %or.cond.not232.1 = select i1 %161, i1 %162, i1 false
  %163 = load i32, ptr @c, align 4
  %.not209.1 = icmp slt i32 %157, %163
  %or.cond212.1 = select i1 %or.cond.not232.1, i1 %.not209.1, i1 false
  br i1 %or.cond212.1, label %164, label %175

164:                                              ; preds = %159
  %165 = zext nneg i32 %156 to i64
  %166 = zext nneg i32 %157 to i64
  %167 = getelementptr inbounds [51 x [51 x i8]], ptr @mat, i64 0, i64 %165, i64 %166
  %168 = load i8, ptr %167, align 1, !tbaa !13
  %.not210.1 = icmp eq i8 %168, %64
  br i1 %.not210.1, label %169, label %175

169:                                              ; preds = %164
  store i8 46, ptr %167, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %170 = load i32, ptr %69, align 4, !tbaa !5
  %171 = add nsw i32 %170, 1
  store i32 %171, ptr %69, align 4, !tbaa !5
  %172 = sext i32 %170 to i64
  %173 = getelementptr inbounds %"struct.std::pair", ptr %71, i64 %172
  %174 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %173, ptr noundef nonnull align 4 dereferenceable(8) %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  br label %175

175:                                              ; preds = %155, %159, %164, %169
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  br label %198

176:                                              ; preds = %149, %144, %139, %135
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  %177 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %177, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #5
  %178 = load i32, ptr %5, align 4, !tbaa !5
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %8, align 4, !tbaa !5
  %180 = icmp slt i32 %177, 0
  br i1 %180, label %197, label %181

181:                                              ; preds = %176
  %182 = load i32, ptr @r, align 4, !tbaa !5
  %183 = icmp slt i32 %177, %182
  %184 = icmp sgt i32 %178, -2
  %or.cond.not232.2 = select i1 %183, i1 %184, i1 false
  %185 = load i32, ptr @c, align 4
  %.not209.2 = icmp slt i32 %179, %185
  %or.cond212.2 = select i1 %or.cond.not232.2, i1 %.not209.2, i1 false
  br i1 %or.cond212.2, label %186, label %197

186:                                              ; preds = %181
  %187 = zext nneg i32 %177 to i64
  %188 = zext nneg i32 %179 to i64
  %189 = getelementptr inbounds [51 x [51 x i8]], ptr @mat, i64 0, i64 %187, i64 %188
  %190 = load i8, ptr %189, align 1, !tbaa !13
  %.not210.2 = icmp eq i8 %190, %64
  br i1 %.not210.2, label %191, label %197

191:                                              ; preds = %186
  store i8 46, ptr %189, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %192 = load i32, ptr %69, align 4, !tbaa !5
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %69, align 4, !tbaa !5
  %194 = sext i32 %192 to i64
  %195 = getelementptr inbounds %"struct.std::pair", ptr %71, i64 %194
  %196 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %195, ptr noundef nonnull align 4 dereferenceable(8) %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  br label %197

197:                                              ; preds = %191, %186, %181, %176
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  br label %198

198:                                              ; preds = %175, %197
  %199 = add nsw i32 %.0154244, 1
  %exitcond.not = icmp eq i32 %199, 2
  br i1 %exitcond.not, label %131, label %.preheader240, !llvm.loop !21

._crit_edge261.loopexit410.unr-lcssa:             ; preds = %.preheader241.us, %.preheader241.us.preheader
  %.0159260.us.unr = phi i64 [ 0, %.preheader241.us.preheader ], [ %127, %.preheader241.us ]
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge261, label %.preheader241.us.epil

.preheader241.us.epil:                            ; preds = %._crit_edge261.loopexit410.unr-lcssa, %.preheader241.us.epil
  %.0159260.us.epil = phi i64 [ %202, %.preheader241.us.epil ], [ %.0159260.us.unr, %._crit_edge261.loopexit410.unr-lcssa ]
  %epil.iter = phi i32 [ %epil.iter.next, %.preheader241.us.epil ], [ 0, %._crit_edge261.loopexit410.unr-lcssa ]
  %sext.epil = shl i64 %.0159260.us.epil, 32
  %200 = ashr exact i64 %sext.epil, 32
  %201 = ashr exact i64 %sext.epil, 30
  %scevgep325.epil = getelementptr i8, ptr %scevgep, i64 %201
  call void @llvm.memset.p0.i64(ptr align 4 %scevgep325.epil, i8 0, i64 %88, i1 false), !tbaa !5
  %202 = add nsw i64 %200, %89
  %epil.iter.next = add i32 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge261, label %.preheader241.us.epil, !llvm.loop !22

._crit_edge261:                                   ; preds = %._crit_edge261.loopexit410.unr-lcssa, %.preheader241.us.epil, %._crit_edge256.split.us.us.us, %.preheader241.lr.ph, %._crit_edge248
  %203 = add nsw i8 %64, -32
  %204 = icmp sgt i32 %79, 0
  br i1 %204, label %.lr.ph269, label %._crit_edge270

._crit_edge270:                                   ; preds = %.lr.ph269, %._crit_edge261
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #5
  %205 = load i32, ptr %1, align 4, !tbaa !5
  %206 = load i32, ptr @c, align 4, !tbaa !5
  %207 = mul nsw i32 %206, %205
  %208 = load i32, ptr %2, align 4, !tbaa !5
  %209 = add nsw i32 %207, %208
  store i32 %209, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #5
  store i32 -1, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %16) #5
  store i8 83, ptr %16, align 1, !tbaa !13
  call void @_ZNSt4pairIicEC2IicTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 4 dereferenceable(5) %14, ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 1 dereferenceable(1) %16)
  %210 = load i32, ptr @n, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = load i32, ptr %13, align 4, !tbaa !5
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [2501 x [2501 x %"struct.std::pair.0"]], ptr @op, i64 0, i64 %211, i64 %213
  %215 = call noundef nonnull align 4 dereferenceable(5) ptr @_ZNSt4pairIicEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(5) %214, ptr noundef nonnull align 4 dereferenceable(5) %14) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #5
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %17, ptr noundef nonnull align 4 dereferenceable(4) @n, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %216 = load i32, ptr @tot, align 4, !tbaa !5
  %217 = add nsw i32 %216, 1
  store i32 %217, ptr @tot, align 4, !tbaa !5
  %218 = sext i32 %216 to i64
  %219 = getelementptr inbounds [6250001 x %"struct.std::pair"], ptr @que, i64 0, i64 %218
  %220 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %219, ptr noundef nonnull align 4 dereferenceable(8) %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #5
  %221 = load i32, ptr @n, align 4, !tbaa !5
  %222 = add nsw i32 %221, 1
  store i32 %222, ptr @n, align 4, !tbaa !5
  %223 = sext i32 %221 to i64
  %224 = getelementptr inbounds [2501 x i32], ptr @sta, i64 0, i64 %223
  store i32 -1, ptr %224, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #5
  %.pre = load i32, ptr %2, align 4, !tbaa !5
  %.pre360 = load i32, ptr @c, align 4, !tbaa !5
  br label %235

.lr.ph269:                                        ; preds = %._crit_edge261, %.lr.ph269
  %indvars.iv342 = phi i64 [ %indvars.iv.next343, %.lr.ph269 ], [ 0, %._crit_edge261 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #5
  %225 = getelementptr inbounds %"struct.std::pair", ptr %71, i64 %indvars.iv342
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #5
  call void @_ZSt3tieIJiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple") align 8 %12, ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %11) #5
  %226 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJRiS0_EEaSIiiEENSt9enable_ifIXcl12__assignableIRKT_RKT0_EEERS1_E4typeERKSt4pairIS4_S7_E(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 4 dereferenceable(8) %225) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #5
  %227 = load i32, ptr %10, align 4, !tbaa !5
  %228 = sext i32 %227 to i64
  %229 = load i32, ptr %11, align 4, !tbaa !5
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [51 x [51 x i8]], ptr @mat, i64 0, i64 %228, i64 %230
  store i8 %203, ptr %231, align 1, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #5
  %indvars.iv.next343 = add nuw nsw i64 %indvars.iv342, 1
  %232 = load i32, ptr %69, align 4, !tbaa !5
  %233 = sext i32 %232 to i64
  %234 = icmp slt i64 %indvars.iv.next343, %233
  br i1 %234, label %.lr.ph269, label %._crit_edge270, !llvm.loop !24

235:                                              ; preds = %.lr.ph273, %._crit_edge270
  %236 = phi i32 [ %59, %.lr.ph273 ], [ %.pre360, %._crit_edge270 ]
  %237 = phi i32 [ %storemerge204271, %.lr.ph273 ], [ %.pre, %._crit_edge270 ]
  %238 = add nsw i32 %237, 1
  store i32 %238, ptr %2, align 4, !tbaa !5
  %239 = icmp slt i32 %238, %236
  br i1 %239, label %.lr.ph273, label %._crit_edge274.loopexit, !llvm.loop !25

._crit_edge308:                                   ; preds = %.loopexit238, %._crit_edge277
  %240 = load i32, ptr @m, align 4, !tbaa !5
  %241 = load i32, ptr @n, align 4, !tbaa !5
  %242 = icmp slt i32 %240, %241
  br i1 %242, label %457, label %459

.lr.ph307:                                        ; preds = %._crit_edge277, %.loopexit238
  %indvars.iv354 = phi i64 [ %indvars.iv.next355, %.loopexit238 ], [ 0, %._crit_edge277 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %18) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %19) #5
  %243 = getelementptr inbounds [6250001 x %"struct.std::pair"], ptr @que, i64 0, i64 %indvars.iv354
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %20) #5
  call void @_ZSt3tieIJiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple") align 8 %20, ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) %19) #5
  %244 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJRiS0_EEaSIiiEENSt9enable_ifIXcl12__assignableIRKT_RKT0_EEERS1_E4typeERKSt4pairIS4_S7_E(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 4 dereferenceable(8) %243) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %20) #5
  %245 = load i32, ptr %18, align 4, !tbaa !5
  %246 = sext i32 %245 to i64
  %247 = getelementptr inbounds [2501 x i32], ptr @sta, i64 0, i64 %246
  %248 = load i32, ptr %247, align 4, !tbaa !5
  %.not = icmp eq i32 %248, -1
  br i1 %.not, label %249, label %.loopexit238

249:                                              ; preds = %.lr.ph307
  %250 = getelementptr inbounds [2501 x [2501 x %"struct.std::pair.0"]], ptr @op, i64 0, i64 %246
  %251 = load i32, ptr %19, align 4, !tbaa !5
  %252 = load i32, ptr @c, align 4, !tbaa !5
  %253 = sdiv i32 %251, %252
  %254 = srem i32 %251, %252
  %.not185 = icmp eq i32 %253, 0
  br i1 %.not185, label %255, label %379

255:                                              ; preds = %249
  store i32 %254, ptr %247, align 4, !tbaa !5
  %256 = getelementptr inbounds [2501 x [2501 x i8]], ptr @ans, i64 0, i64 %246
  %.not186282 = icmp eq i32 %251, -1
  br i1 %.not186282, label %._crit_edge287, label %.lr.ph286

._crit_edge287:                                   ; preds = %.lr.ph286, %255
  %.0168.lcssa = phi ptr [ %256, %255 ], [ %268, %.lr.ph286 ]
  store i8 0, ptr %.0168.lcssa, align 1, !tbaa !13
  %257 = load i32, ptr @m, align 4, !tbaa !5
  %258 = add nsw i32 %257, 1
  store i32 %258, ptr @m, align 4, !tbaa !5
  %259 = sext i32 %257 to i64
  %260 = getelementptr inbounds [2501 x i32], ptr @seq, i64 0, i64 %259
  store i32 %245, ptr %260, align 4, !tbaa !5
  %261 = getelementptr inbounds [2501 x [7 x %"struct.std::pair"]], ptr @pos, i64 0, i64 %246
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %21) #5
  store i32 0, ptr %21, align 4, !tbaa !5
  %262 = load i32, ptr @n, align 4, !tbaa !5
  %263 = icmp sgt i32 %262, 0
  br i1 %263, label %.lr.ph303, label %._crit_edge304

.lr.ph286:                                        ; preds = %255, %.lr.ph286
  %.0167284 = phi i32 [ %.0167, %.lr.ph286 ], [ %251, %255 ]
  %.0168283 = phi ptr [ %268, %.lr.ph286 ], [ %256, %255 ]
  %264 = sext i32 %.0167284 to i64
  %265 = getelementptr inbounds %"struct.std::pair.0", ptr %250, i64 %264
  %266 = getelementptr inbounds i8, ptr %265, i64 4
  %267 = load i8, ptr %266, align 4, !tbaa !26
  %268 = getelementptr inbounds i8, ptr %.0168283, i64 1
  store i8 %267, ptr %.0168283, align 1, !tbaa !13
  %.0167 = load i32, ptr %265, align 8, !tbaa !5
  %.not186 = icmp eq i32 %.0167, -1
  br i1 %.not186, label %._crit_edge287, label %.lr.ph286, !llvm.loop !28

._crit_edge304:                                   ; preds = %.loopexit236, %._crit_edge287
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %21) #5
  br label %.loopexit238

.lr.ph303:                                        ; preds = %._crit_edge287, %.loopexit236
  %269 = phi i32 [ %373, %.loopexit236 ], [ %262, %._crit_edge287 ]
  %270 = phi i32 [ %375, %.loopexit236 ], [ %245, %._crit_edge287 ]
  %271 = phi i32 [ %376, %.loopexit236 ], [ %245, %._crit_edge287 ]
  %storemerge187301 = phi i32 [ %377, %.loopexit236 ], [ 0, %._crit_edge287 ]
  %272 = sext i32 %storemerge187301 to i64
  %273 = getelementptr inbounds [2501 x i32], ptr @sta, i64 0, i64 %272
  %274 = load i32, ptr %273, align 4, !tbaa !5
  %.not188 = icmp eq i32 %274, -1
  br i1 %.not188, label %275, label %.loopexit236

275:                                              ; preds = %.lr.ph303
  %276 = getelementptr inbounds [2501 x [2501 x i32]], ptr @rem, i64 0, i64 %272
  %277 = getelementptr inbounds [2501 x [7 x %"struct.std::pair"]], ptr @pos, i64 0, i64 %272
  %278 = getelementptr inbounds [2501 x [2501 x %"struct.std::pair.0"]], ptr @op, i64 0, i64 %272
  %279 = sext i32 %271 to i64
  %280 = getelementptr inbounds [2501 x i32], ptr @sz, i64 0, i64 %279
  %281 = load i32, ptr %280, align 4, !tbaa !5
  %282 = icmp sgt i32 %281, 0
  br i1 %282, label %.preheader235.lr.ph, label %.loopexit236

.preheader235.lr.ph:                              ; preds = %275
  %283 = getelementptr inbounds i8, ptr %277, i64 4
  br label %.preheader235

.preheader235:                                    ; preds = %.preheader235.lr.ph, %._crit_edge299
  %.pre363366 = phi i32 [ %storemerge187301, %.preheader235.lr.ph ], [ %.pre363367, %._crit_edge299 ]
  %284 = phi i32 [ %270, %.preheader235.lr.ph ], [ %293, %._crit_edge299 ]
  %285 = phi i32 [ %storemerge187301, %.preheader235.lr.ph ], [ %294, %._crit_edge299 ]
  %286 = phi i32 [ %storemerge187301, %.preheader235.lr.ph ], [ %295, %._crit_edge299 ]
  %indvars.iv351 = phi i64 [ 0, %.preheader235.lr.ph ], [ %indvars.iv.next352, %._crit_edge299 ]
  %287 = sext i32 %286 to i64
  %288 = getelementptr inbounds [2501 x i32], ptr @sz, i64 0, i64 %287
  %289 = load i32, ptr %288, align 4, !tbaa !5
  %290 = icmp sgt i32 %289, 0
  br i1 %290, label %.lr.ph298, label %._crit_edge299

.lr.ph298:                                        ; preds = %.preheader235
  %291 = getelementptr inbounds %"struct.std::pair", ptr %261, i64 %indvars.iv351
  %292 = getelementptr inbounds i8, ptr %291, i64 4
  br label %301

._crit_edge299.loopexit:                          ; preds = %366
  %.pre364 = load i32, ptr %18, align 4, !tbaa !5
  br label %._crit_edge299

._crit_edge299:                                   ; preds = %._crit_edge299.loopexit, %.preheader235
  %.pre363367 = phi i32 [ %.pre363369, %._crit_edge299.loopexit ], [ %.pre363366, %.preheader235 ]
  %293 = phi i32 [ %.pre364, %._crit_edge299.loopexit ], [ %284, %.preheader235 ]
  %294 = phi i32 [ %367, %._crit_edge299.loopexit ], [ %285, %.preheader235 ]
  %295 = phi i32 [ %367, %._crit_edge299.loopexit ], [ %286, %.preheader235 ]
  %indvars.iv.next352 = add nuw nsw i64 %indvars.iv351, 1
  %296 = sext i32 %293 to i64
  %297 = getelementptr inbounds [2501 x i32], ptr @sz, i64 0, i64 %296
  %298 = load i32, ptr %297, align 4, !tbaa !5
  %299 = sext i32 %298 to i64
  %300 = icmp slt i64 %indvars.iv.next352, %299
  br i1 %300, label %.preheader235, label %.loopexit236.loopexit, !llvm.loop !29

301:                                              ; preds = %.lr.ph298, %366
  %.pre363368 = phi i32 [ %.pre363366, %.lr.ph298 ], [ %.pre363369, %366 ]
  %302 = phi i32 [ %285, %.lr.ph298 ], [ %367, %366 ]
  %indvars.iv348 = phi i64 [ 0, %.lr.ph298 ], [ %indvars.iv.next349, %366 ]
  %303 = load i32, ptr %291, align 8, !tbaa !14
  %304 = getelementptr inbounds %"struct.std::pair", ptr %277, i64 %indvars.iv348
  %305 = load i32, ptr %304, align 8, !tbaa !14
  %306 = sub nsw i32 %303, %305
  %307 = load i32, ptr %277, align 8, !tbaa !14
  %308 = add nsw i32 %306, %307
  %309 = load i32, ptr %292, align 4, !tbaa !16
  %310 = getelementptr inbounds i8, ptr %304, i64 4
  %311 = load i32, ptr %310, align 4, !tbaa !16
  %312 = sub nsw i32 %309, %311
  %313 = load i32, ptr %283, align 4, !tbaa !16
  %314 = add nsw i32 %312, %313
  %315 = icmp slt i32 %308, 0
  br i1 %315, label %366, label %316

316:                                              ; preds = %301
  %317 = load i32, ptr @r, align 4, !tbaa !5
  %318 = icmp slt i32 %308, %317
  %319 = icmp sgt i32 %314, -1
  %or.cond5.not223 = select i1 %318, i1 %319, i1 false
  %320 = load i32, ptr @c, align 4
  %.not189 = icmp slt i32 %314, %320
  %or.cond214 = select i1 %or.cond5.not223, i1 %.not189, i1 false
  br i1 %or.cond214, label %321, label %366

321:                                              ; preds = %316
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %22) #5
  %322 = mul nsw i32 %320, %308
  %323 = add nsw i32 %322, %314
  store i32 %323, ptr %22, align 4, !tbaa !5
  %324 = sext i32 %323 to i64
  %325 = getelementptr inbounds i32, ptr %276, i64 %324
  %326 = load i32, ptr %325, align 4, !tbaa !5
  %327 = add nsw i32 %326, -1
  store i32 %327, ptr %325, align 4, !tbaa !5
  %328 = icmp sgt i32 %326, 1
  br i1 %328, label %.loopexit234, label %.preheader

.preheader:                                       ; preds = %321, %._crit_edge293
  %.not198 = phi i1 [ false, %._crit_edge293 ], [ true, %321 ]
  %329 = phi i1 [ true, %._crit_edge293 ], [ false, %321 ]
  %.0156296 = phi i32 [ 1, %._crit_edge293 ], [ 0, %321 ]
  %.0157295 = phi i8 [ %.3, %._crit_edge293 ], [ 0, %321 ]
  %330 = trunc nuw i8 %.0157295 to i1
  br i1 %330, label %.loopexit234.loopexit, label %.lr.ph292

.lr.ph292:                                        ; preds = %.preheader
  %331 = add nuw nsw i32 %.0156296, %308
  br label %332

._crit_edge293:                                   ; preds = %362
  %.not191 = or i1 %329, %364
  br i1 %.not191, label %.loopexit234.loopexit, label %.preheader, !llvm.loop !30

332:                                              ; preds = %.lr.ph292, %362
  %.0155290 = phi i32 [ -1, %.lr.ph292 ], [ %363, %362 ]
  %.1289 = phi i8 [ %.0157295, %.lr.ph292 ], [ %.3, %362 ]
  %.not195 = icmp eq i32 %.0155290, 0
  %333 = zext i1 %.not195 to i32
  %.not391 = icmp eq i32 %.0156296, %333
  br i1 %.not391, label %334, label %362

334:                                              ; preds = %332
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %23) #5
  %335 = load i32, ptr %22, align 4, !tbaa !5
  %336 = load i32, ptr @c, align 4
  %337 = mul nuw nsw i32 %336, %.0156296
  %338 = add i32 %335, %.0155290
  %339 = add i32 %338, %337
  store i32 %339, ptr %23, align 4, !tbaa !5
  %340 = add nsw i32 %.0155290, %314
  %341 = load i32, ptr @r, align 4, !tbaa !5
  %342 = icmp slt i32 %331, %341
  %343 = icmp sgt i32 %340, -1
  %or.cond7.not226 = select i1 %342, i1 %343, i1 false
  %.not196 = icmp slt i32 %340, %336
  %or.cond215 = select i1 %or.cond7.not226, i1 %.not196, i1 false
  br i1 %or.cond215, label %344, label %361

344:                                              ; preds = %334
  %345 = sext i32 %339 to i64
  %346 = getelementptr inbounds %"struct.std::pair.0", ptr %278, i64 %345, i32 1
  %347 = load i8, ptr %346, align 4, !tbaa !26
  %.not197 = icmp eq i8 %347, 0
  br i1 %.not197, label %361, label %348

348:                                              ; preds = %344
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %24) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %25) #5
  %349 = icmp sgt i32 %.0155290, 0
  %350 = select i1 %349, i8 82, i8 76
  %351 = select i1 %.not198, i8 %350, i8 68
  store i8 %351, ptr %25, align 1, !tbaa !13
  call void @_ZNSt4pairIicEC2IRicTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(5) %24, ptr noundef nonnull align 4 dereferenceable(4) %23, ptr noundef nonnull align 1 dereferenceable(1) %25)
  %352 = load i32, ptr %22, align 4, !tbaa !5
  %353 = sext i32 %352 to i64
  %354 = getelementptr inbounds %"struct.std::pair.0", ptr %278, i64 %353
  %355 = call noundef nonnull align 4 dereferenceable(5) ptr @_ZNSt4pairIicEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(5) %354, ptr noundef nonnull align 4 dereferenceable(5) %24) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %24) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %26) #5
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %26, ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(4) %22)
  %356 = load i32, ptr @tot, align 4, !tbaa !5
  %357 = add nsw i32 %356, 1
  store i32 %357, ptr @tot, align 4, !tbaa !5
  %358 = sext i32 %356 to i64
  %359 = getelementptr inbounds [6250001 x %"struct.std::pair"], ptr @que, i64 0, i64 %358
  %360 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %359, ptr noundef nonnull align 4 dereferenceable(8) %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %26) #5
  br label %361

361:                                              ; preds = %334, %344, %348
  %.2 = phi i8 [ 1, %348 ], [ %.1289, %344 ], [ %.1289, %334 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %23) #5
  br label %362

362:                                              ; preds = %361, %332
  %.3 = phi i8 [ %.1289, %332 ], [ %.2, %361 ]
  %363 = add nsw i32 %.0155290, 1
  %364 = trunc nuw i8 %.3 to i1
  %365 = icmp sgt i32 %.0155290, 0
  %.not193 = or i1 %365, %364
  br i1 %.not193, label %._crit_edge293, label %332, !llvm.loop !31

.loopexit234.loopexit:                            ; preds = %.preheader, %._crit_edge293
  %.pre363.pre = load i32, ptr %21, align 4, !tbaa !5
  br label %.loopexit234

.loopexit234:                                     ; preds = %.loopexit234.loopexit, %321
  %.pre363 = phi i32 [ %.pre363.pre, %.loopexit234.loopexit ], [ %.pre363368, %321 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %22) #5
  br label %366

366:                                              ; preds = %301, %316, %.loopexit234
  %.pre363369 = phi i32 [ %.pre363368, %301 ], [ %.pre363368, %316 ], [ %.pre363, %.loopexit234 ]
  %367 = phi i32 [ %302, %301 ], [ %302, %316 ], [ %.pre363, %.loopexit234 ]
  %indvars.iv.next349 = add nuw nsw i64 %indvars.iv348, 1
  %368 = sext i32 %367 to i64
  %369 = getelementptr inbounds [2501 x i32], ptr @sz, i64 0, i64 %368
  %370 = load i32, ptr %369, align 4, !tbaa !5
  %371 = sext i32 %370 to i64
  %372 = icmp slt i64 %indvars.iv.next349, %371
  br i1 %372, label %301, label %._crit_edge299.loopexit, !llvm.loop !32

.loopexit236.loopexit:                            ; preds = %._crit_edge299
  %.pre365 = load i32, ptr @n, align 4, !tbaa !5
  br label %.loopexit236

.loopexit236:                                     ; preds = %.loopexit236.loopexit, %275, %.lr.ph303
  %373 = phi i32 [ %.pre365, %.loopexit236.loopexit ], [ %269, %275 ], [ %269, %.lr.ph303 ]
  %374 = phi i32 [ %294, %.loopexit236.loopexit ], [ %storemerge187301, %275 ], [ %storemerge187301, %.lr.ph303 ]
  %375 = phi i32 [ %293, %.loopexit236.loopexit ], [ %270, %275 ], [ %270, %.lr.ph303 ]
  %376 = phi i32 [ %293, %.loopexit236.loopexit ], [ %271, %275 ], [ %271, %.lr.ph303 ]
  %377 = add nsw i32 %374, 1
  store i32 %377, ptr %21, align 4, !tbaa !5
  %378 = icmp slt i32 %377, %373
  br i1 %378, label %.lr.ph303, label %._crit_edge304, !llvm.loop !33

379:                                              ; preds = %249
  %380 = getelementptr inbounds [2501 x [2501 x i32]], ptr @rem, i64 0, i64 %246
  %381 = icmp sgt i32 %254, -1
  br label %.preheader237

.preheader237:                                    ; preds = %.preheader237.backedge, %379
  %.0152280 = phi i32 [ -1, %379 ], [ %.0152280.be, %.preheader237.backedge ]
  %382 = add nsw i32 %.0152280, %253
  %.fr312 = freeze i32 %382
  %383 = icmp slt i32 %.fr312, 0
  br i1 %383, label %.preheader237.split.us, label %.preheader237.split.preheader

.preheader237.split.preheader:                    ; preds = %.preheader237
  %.not199.not = icmp eq i32 %.0152280, 0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %27) #5
  %384 = load i32, ptr %19, align 4, !tbaa !5
  %385 = load i32, ptr @c, align 4
  br i1 %.not199.not, label %386, label %.preheader237.split.1

.preheader237.split.us:                           ; preds = %.preheader237
  %cond = icmp eq i32 %.0152280, 0
  br i1 %cond, label %.loopexit238, label %.preheader237.backedge

386:                                              ; preds = %.preheader237.split.preheader
  %387 = add i32 %384, -1
  store i32 %387, ptr %27, align 4, !tbaa !5
  %388 = load i32, ptr @r, align 4, !tbaa !5
  %389 = icmp slt i32 %.fr312, %388
  %390 = icmp sgt i32 %254, 0
  %or.cond9.not219 = and i1 %389, %390
  %.not201 = icmp sle i32 %254, %385
  %or.cond216 = select i1 %or.cond9.not219, i1 %.not201, i1 false
  br i1 %or.cond216, label %391, label %429

391:                                              ; preds = %386
  %392 = sext i32 %387 to i64
  %393 = getelementptr inbounds i32, ptr %380, i64 %392
  %394 = load i32, ptr %393, align 4, !tbaa !5
  %.not202 = icmp eq i32 %394, 0
  br i1 %.not202, label %395, label %429

395:                                              ; preds = %391
  %396 = getelementptr inbounds %"struct.std::pair.0", ptr %250, i64 %392, i32 1
  %397 = load i8, ptr %396, align 4, !tbaa !26
  %.not203 = icmp eq i8 %397, 0
  br i1 %.not203, label %398, label %429

398:                                              ; preds = %395
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %28) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %29) #5
  store i8 82, ptr %29, align 1, !tbaa !13
  call void @_ZNSt4pairIicEC2IRicTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(5) %28, ptr noundef nonnull align 4 dereferenceable(4) %19, ptr noundef nonnull align 1 dereferenceable(1) %29)
  %399 = load i32, ptr %27, align 4, !tbaa !5
  %400 = sext i32 %399 to i64
  %401 = getelementptr inbounds %"struct.std::pair.0", ptr %250, i64 %400
  %402 = call noundef nonnull align 4 dereferenceable(5) ptr @_ZNSt4pairIicEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(5) %401, ptr noundef nonnull align 4 dereferenceable(5) %28) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %29) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %28) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %30) #5
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %30, ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) %27)
  %403 = load i32, ptr @tot, align 4, !tbaa !5
  %404 = add nsw i32 %403, 1
  store i32 %404, ptr @tot, align 4, !tbaa !5
  %405 = sext i32 %403 to i64
  %406 = getelementptr inbounds [6250001 x %"struct.std::pair"], ptr @que, i64 0, i64 %405
  %407 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %406, ptr noundef nonnull align 4 dereferenceable(8) %30) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %30) #5
  br label %429

.preheader237.split.1:                            ; preds = %.preheader237.split.preheader
  %408 = mul nsw i32 %385, %.0152280
  %409 = add i32 %384, %408
  store i32 %409, ptr %27, align 4, !tbaa !5
  %410 = load i32, ptr @r, align 4, !tbaa !5
  %411 = icmp slt i32 %.fr312, %410
  %or.cond9.not219.1 = and i1 %411, %381
  %.not201.1 = icmp slt i32 %254, %385
  %or.cond216.1 = select i1 %or.cond9.not219.1, i1 %.not201.1, i1 false
  br i1 %or.cond216.1, label %412, label %.preheader237.split.2

412:                                              ; preds = %.preheader237.split.1
  %413 = sext i32 %409 to i64
  %414 = getelementptr inbounds i32, ptr %380, i64 %413
  %415 = load i32, ptr %414, align 4, !tbaa !5
  %.not202.1 = icmp eq i32 %415, 0
  br i1 %.not202.1, label %416, label %.preheader237.split.2

416:                                              ; preds = %412
  %417 = getelementptr inbounds %"struct.std::pair.0", ptr %250, i64 %413, i32 1
  %418 = load i8, ptr %417, align 4, !tbaa !26
  %.not203.1 = icmp eq i8 %418, 0
  br i1 %.not203.1, label %419, label %.preheader237.split.2

419:                                              ; preds = %416
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %28) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %29) #5
  store i8 68, ptr %29, align 1, !tbaa !13
  call void @_ZNSt4pairIicEC2IRicTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(5) %28, ptr noundef nonnull align 4 dereferenceable(4) %19, ptr noundef nonnull align 1 dereferenceable(1) %29)
  %420 = load i32, ptr %27, align 4, !tbaa !5
  %421 = sext i32 %420 to i64
  %422 = getelementptr inbounds %"struct.std::pair.0", ptr %250, i64 %421
  %423 = call noundef nonnull align 4 dereferenceable(5) ptr @_ZNSt4pairIicEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(5) %422, ptr noundef nonnull align 4 dereferenceable(5) %28) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %29) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %28) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %30) #5
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %30, ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) %27)
  %424 = load i32, ptr @tot, align 4, !tbaa !5
  %425 = add nsw i32 %424, 1
  store i32 %425, ptr @tot, align 4, !tbaa !5
  %426 = sext i32 %424 to i64
  %427 = getelementptr inbounds [6250001 x %"struct.std::pair"], ptr @que, i64 0, i64 %426
  %428 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %427, ptr noundef nonnull align 4 dereferenceable(8) %30) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %30) #5
  br label %.preheader237.split.2

.preheader237.split.2:                            ; preds = %.preheader237.split.1, %412, %416, %419
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %27) #5
  br label %.preheader237.backedge

.preheader237.backedge:                           ; preds = %.preheader237.split.2, %.preheader237.split.us
  %.0152280.be = add nsw i32 %.0152280, 1
  br label %.preheader237, !llvm.loop !34

429:                                              ; preds = %398, %395, %391, %386
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %27) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %27) #5
  %430 = load i32, ptr %19, align 4, !tbaa !5
  %431 = load i32, ptr @c, align 4
  %432 = add i32 %430, 1
  store i32 %432, ptr %27, align 4, !tbaa !5
  %433 = add nsw i32 %254, 1
  %434 = load i32, ptr @r, align 4, !tbaa !5
  %435 = icmp slt i32 %.fr312, %434
  %436 = icmp sgt i32 %254, -2
  %or.cond9.not219.2 = and i1 %435, %436
  %.not201.2 = icmp slt i32 %433, %431
  %or.cond216.2 = select i1 %or.cond9.not219.2, i1 %.not201.2, i1 false
  br i1 %or.cond216.2, label %437, label %.split.us.thread379

437:                                              ; preds = %429
  %438 = sext i32 %432 to i64
  %439 = getelementptr inbounds i32, ptr %380, i64 %438
  %440 = load i32, ptr %439, align 4, !tbaa !5
  %.not202.2 = icmp eq i32 %440, 0
  br i1 %.not202.2, label %441, label %.split.us.thread379

441:                                              ; preds = %437
  %442 = getelementptr inbounds %"struct.std::pair.0", ptr %250, i64 %438, i32 1
  %443 = load i8, ptr %442, align 4, !tbaa !26
  %.not203.2 = icmp eq i8 %443, 0
  br i1 %.not203.2, label %444, label %.split.us.thread379

444:                                              ; preds = %441
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %28) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %29) #5
  store i8 76, ptr %29, align 1, !tbaa !13
  call void @_ZNSt4pairIicEC2IRicTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(5) %28, ptr noundef nonnull align 4 dereferenceable(4) %19, ptr noundef nonnull align 1 dereferenceable(1) %29)
  %445 = load i32, ptr %27, align 4, !tbaa !5
  %446 = sext i32 %445 to i64
  %447 = getelementptr inbounds %"struct.std::pair.0", ptr %250, i64 %446
  %448 = call noundef nonnull align 4 dereferenceable(5) ptr @_ZNSt4pairIicEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(5) %447, ptr noundef nonnull align 4 dereferenceable(5) %28) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %29) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %28) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %30) #5
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %30, ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) %27)
  %449 = load i32, ptr @tot, align 4, !tbaa !5
  %450 = add nsw i32 %449, 1
  store i32 %450, ptr @tot, align 4, !tbaa !5
  %451 = sext i32 %449 to i64
  %452 = getelementptr inbounds [6250001 x %"struct.std::pair"], ptr @que, i64 0, i64 %451
  %453 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %452, ptr noundef nonnull align 4 dereferenceable(8) %30) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %30) #5
  br label %.split.us.thread379

.split.us.thread379:                              ; preds = %429, %437, %441, %444
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %27) #5
  br label %.loopexit238

.loopexit238:                                     ; preds = %.preheader237.split.us, %.split.us.thread379, %._crit_edge304, %.lr.ph307
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %18) #5
  %indvars.iv.next355 = add nuw nsw i64 %indvars.iv354, 1
  %454 = load i32, ptr @tot, align 4, !tbaa !5
  %455 = sext i32 %454 to i64
  %456 = icmp slt i64 %indvars.iv.next355, %455
  br i1 %456, label %.lr.ph307, label %._crit_edge308, !llvm.loop !35

457:                                              ; preds = %._crit_edge308
  %458 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.4)
  br label %.loopexit

459:                                              ; preds = %._crit_edge308
  %460 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %241)
  %461 = load i32, ptr @n, align 4, !tbaa !5
  %462 = icmp sgt i32 %461, 0
  br i1 %462, label %.lr.ph311.preheader, label %.loopexit

.lr.ph311.preheader:                              ; preds = %459
  %463 = zext nneg i32 %461 to i64
  br label %.lr.ph311

.lr.ph311:                                        ; preds = %.lr.ph311.preheader, %.lr.ph311
  %indvars.iv357 = phi i64 [ %463, %.lr.ph311.preheader ], [ %indvars.iv.next358, %.lr.ph311 ]
  %indvars.iv.next358 = add nsw i64 %indvars.iv357, -1
  %464 = getelementptr inbounds [2501 x i32], ptr @seq, i64 0, i64 %indvars.iv.next358
  %465 = load i32, ptr %464, align 4, !tbaa !5
  %466 = sext i32 %465 to i64
  %467 = getelementptr inbounds [2501 x i32], ptr @sta, i64 0, i64 %466
  %468 = load i32, ptr %467, align 4, !tbaa !5
  %469 = add nsw i32 %468, 1
  %470 = getelementptr inbounds [2501 x [2501 x i8]], ptr @ans, i64 0, i64 %466
  %471 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %469, ptr noundef nonnull %470)
  %472 = icmp ugt i64 %indvars.iv357, 1
  br i1 %472, label %.lr.ph311, label %.loopexit, !llvm.loop !36

.loopexit:                                        ; preds = %.lr.ph311, %459, %457
  ret i32 0
}

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt3tieIJiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind noalias writable sret(%"class.std::tuple") align 8, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5tupleIJRiS0_EEaSIiiEENSt9enable_ifIXcl12__assignableIRKT_RKT0_EEERS1_E4typeERKSt4pairIS4_S7_E(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3 align 2

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

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

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

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

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

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

attributes #0 = { mustprogress norecurse 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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !6, i64 0}
!15 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!16 = !{!15, !6, i64 4}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.unroll.disable"}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}
!26 = !{!27, !7, i64 4}
!27 = !{!"_ZTSSt4pairIicE", !6, i64 0, !7, i64 4}
!28 = distinct !{!28, !10}
!29 = distinct !{!29, !10}
!30 = distinct !{!30, !10}
!31 = distinct !{!31, !10}
!32 = distinct !{!32, !10}
!33 = distinct !{!33, !10}
!34 = distinct !{!34, !10}
!35 = distinct !{!35, !10}
!36 = distinct !{!36, !10}


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