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

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

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local global [100001 x i32], align 16
@b = external dso_local global [100001 x i32], align 16
@les = external dso_local global [100001 x i32], align 16
@eq = external dso_local global [100001 x i32], align 16
@gre = external dso_local global [100001 x i32], align 16
@fail = external dso_local global [100001 x i32], align 16
@ans = external dso_local global i32, align 4
@pos = external dso_local global [29 x i32], align 16
@pL = external dso_local global [29 x i32], align 16
@pR = external dso_local global [29 x i32], align 16
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 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 ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) @t)
  br label %14

14:                                               ; preds = %269, %0
  %15 = load i32, ptr @t, align 4, !tbaa !5
  %16 = add nsw i32 %15, -1
  store i32 %16, ptr @t, align 4, !tbaa !5
  %17 = icmp ne i32 %15, 0
  br i1 %17, label %18, label %270

18:                                               ; preds = %14
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) @m)
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) @n)
  call void @llvm.memset.p0.i64(ptr align 16 @pos, i8 -1, i64 116, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %42, %18
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = load i32, ptr @m, align 4, !tbaa !5
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %45

24:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [100001 x i32], ptr @b, i64 0, i64 %26
  store ptr %27, ptr %3, align 8, !tbaa !9
  %28 = load ptr, ptr %3, align 8, !tbaa !9
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %28)
  %29 = load ptr, ptr %3, align 8, !tbaa !9
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [29 x i32], ptr @pos, i64 0, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [100001 x i32], ptr @eq, i64 0, i64 %35
  store i32 %33, ptr %36, align 4, !tbaa !5
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = load ptr, ptr %3, align 8, !tbaa !9
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [29 x i32], ptr @pos, i64 0, i64 %40
  store i32 %37, ptr %41, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %42

42:                                               ; preds = %24
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %2, align 4, !tbaa !5
  br label %19, !llvm.loop !11

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

46:                                               ; preds = %67, %45
  %47 = load i32, ptr %5, align 4, !tbaa !5
  %48 = icmp slt i32 %47, 27
  br i1 %48, label %50, label %49

49:                                               ; preds = %46
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %70

50:                                               ; preds = %46
  %51 = load i32, ptr %5, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [29 x i32], ptr @pos, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = icmp ne i32 %54, -1
  br i1 %55, label %56, label %66

56:                                               ; preds = %50
  %57 = load i32, ptr %4, align 4, !tbaa !5
  %58 = load i32, ptr %5, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [29 x i32], ptr @pL, i64 0, i64 %59
  store i32 %57, ptr %60, align 4, !tbaa !5
  %61 = load i32, ptr %5, align 4, !tbaa !5
  %62 = load i32, ptr %4, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %63
  store i32 %61, ptr %64, align 4, !tbaa !5
  %65 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %65, ptr %4, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %56, %50
  br label %67

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

70:                                               ; preds = %49
  %71 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %71, ptr getelementptr inbounds ([29 x i32], ptr @pL, i64 0, i64 27), align 4, !tbaa !5
  %72 = load i32, ptr %4, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %73
  store i32 27, ptr %74, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %75 = load i32, ptr @m, align 4, !tbaa !5
  %76 = sub nsw i32 %75, 1
  store i32 %76, ptr %6, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %140, %70
  %78 = load i32, ptr %6, align 4, !tbaa !5
  %79 = icmp sge i32 %78, 0
  br i1 %79, label %81, label %80

80:                                               ; preds = %77
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %143

81:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %82 = load i32, ptr %6, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [100001 x i32], ptr @b, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  store i32 %85, ptr %7, align 4, !tbaa !5
  %86 = load i32, ptr %6, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [100001 x i32], ptr @eq, i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = load i32, ptr %7, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [29 x i32], ptr @pos, i64 0, i64 %91
  store i32 %89, ptr %92, align 4, !tbaa !5
  %93 = load i32, ptr %7, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [29 x i32], ptr @pos, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = icmp eq i32 %96, -1
  br i1 %97, label %98, label %119

98:                                               ; preds = %81
  %99 = load i32, ptr %7, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [29 x i32], ptr @pL, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = load i32, ptr %7, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [29 x i32], ptr @pL, i64 0, i64 %107
  store i32 %102, ptr %108, align 4, !tbaa !5
  %109 = load i32, ptr %7, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = load i32, ptr %7, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [29 x i32], ptr @pL, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %117
  store i32 %112, ptr %118, align 4, !tbaa !5
  br label %119

119:                                              ; preds = %98, %81
  %120 = load i32, ptr %7, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [29 x i32], ptr @pL, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [29 x i32], ptr @pos, i64 0, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = load i32, ptr %6, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [100001 x i32], ptr @les, i64 0, i64 %128
  store i32 %126, ptr %129, align 4, !tbaa !5
  %130 = load i32, ptr %7, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [29 x i32], ptr @pos, i64 0, i64 %134
  %136 = load i32, ptr %135, align 4, !tbaa !5
  %137 = load i32, ptr %6, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [100001 x i32], ptr @gre, i64 0, i64 %138
  store i32 %136, ptr %139, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %140

140:                                              ; preds = %119
  %141 = load i32, ptr %6, align 4, !tbaa !5
  %142 = add nsw i32 %141, -1
  store i32 %142, ptr %6, align 4, !tbaa !5
  br label %77, !llvm.loop !14

143:                                              ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 1, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %144

144:                                              ; preds = %190, %143
  %145 = load i32, ptr %8, align 4, !tbaa !5
  %146 = load i32, ptr @m, align 4, !tbaa !5
  %147 = icmp slt i32 %145, %146
  br i1 %147, label %149, label %148

148:                                              ; preds = %144
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %193

149:                                              ; preds = %144
  br label %150

150:                                              ; preds = %166, %149
  %151 = load i32, ptr %9, align 4, !tbaa !5
  %152 = icmp ne i32 %151, 0
  br i1 %152, label %153, label %164

153:                                              ; preds = %150
  %154 = load i32, ptr %9, align 4, !tbaa !5
  %155 = load i32, ptr %8, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds i32, ptr @b, i64 %156
  %158 = load i32, ptr %9, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = sub i64 0, %159
  %161 = getelementptr inbounds i32, ptr %157, i64 %160
  %162 = call noundef zeroext i1 @_Z5matchiPi(i32 noundef %154, ptr noundef %161)
  %163 = xor i1 %162, true
  br label %164

164:                                              ; preds = %153, %150
  %165 = phi i1 [ false, %150 ], [ %163, %153 ]
  br i1 %165, label %166, label %171

166:                                              ; preds = %164
  %167 = load i32, ptr %9, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [100001 x i32], ptr @fail, i64 0, i64 %168
  %170 = load i32, ptr %169, align 4, !tbaa !5
  store i32 %170, ptr %9, align 4, !tbaa !5
  br label %150, !llvm.loop !15

171:                                              ; preds = %164
  %172 = load i32, ptr %9, align 4, !tbaa !5
  %173 = load i32, ptr %8, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds i32, ptr @b, i64 %174
  %176 = load i32, ptr %9, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = sub i64 0, %177
  %179 = getelementptr inbounds i32, ptr %175, i64 %178
  %180 = call noundef zeroext i1 @_Z5matchiPi(i32 noundef %172, ptr noundef %179)
  br i1 %180, label %181, label %184

181:                                              ; preds = %171
  %182 = load i32, ptr %9, align 4, !tbaa !5
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %9, align 4, !tbaa !5
  br label %184

184:                                              ; preds = %181, %171
  %185 = load i32, ptr %9, align 4, !tbaa !5
  %186 = load i32, ptr %8, align 4, !tbaa !5
  %187 = add nsw i32 %186, 1
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [100001 x i32], ptr @fail, i64 0, i64 %188
  store i32 %185, ptr %189, align 4, !tbaa !5
  br label %190

190:                                              ; preds = %184
  %191 = load i32, ptr %8, align 4, !tbaa !5
  %192 = add nsw i32 %191, 1
  store i32 %192, ptr %8, align 4, !tbaa !5
  br label %144, !llvm.loop !16

193:                                              ; preds = %148
  store i32 -1, ptr @ans, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %194

194:                                              ; preds = %203, %193
  %195 = load i32, ptr %10, align 4, !tbaa !5
  %196 = load i32, ptr @n, align 4, !tbaa !5
  %197 = icmp slt i32 %195, %196
  br i1 %197, label %199, label %198

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

199:                                              ; preds = %194
  %200 = load i32, ptr %10, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %201
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %202)
  br label %203

203:                                              ; preds = %199
  %204 = load i32, ptr %10, align 4, !tbaa !5
  %205 = add nsw i32 %204, 1
  store i32 %205, ptr %10, align 4, !tbaa !5
  br label %194, !llvm.loop !17

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

207:                                              ; preds = %257, %206
  %208 = load i32, ptr %11, align 4, !tbaa !5
  %209 = load i32, ptr @n, align 4, !tbaa !5
  %210 = icmp slt i32 %208, %209
  br i1 %210, label %212, label %211

211:                                              ; preds = %207
  store i32 21, ptr %13, align 4
  br label %260

212:                                              ; preds = %207
  br label %213

213:                                              ; preds = %229, %212
  %214 = load i32, ptr %12, align 4, !tbaa !5
  %215 = icmp ne i32 %214, 0
  br i1 %215, label %216, label %227

216:                                              ; preds = %213
  %217 = load i32, ptr %12, align 4, !tbaa !5
  %218 = load i32, ptr %11, align 4, !tbaa !5
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds i32, ptr @a, i64 %219
  %221 = load i32, ptr %12, align 4, !tbaa !5
  %222 = sext i32 %221 to i64
  %223 = sub i64 0, %222
  %224 = getelementptr inbounds i32, ptr %220, i64 %223
  %225 = call noundef zeroext i1 @_Z5matchiPi(i32 noundef %217, ptr noundef %224)
  %226 = xor i1 %225, true
  br label %227

227:                                              ; preds = %216, %213
  %228 = phi i1 [ false, %213 ], [ %226, %216 ]
  br i1 %228, label %229, label %234

229:                                              ; preds = %227
  %230 = load i32, ptr %12, align 4, !tbaa !5
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [100001 x i32], ptr @fail, i64 0, i64 %231
  %233 = load i32, ptr %232, align 4, !tbaa !5
  store i32 %233, ptr %12, align 4, !tbaa !5
  br label %213, !llvm.loop !18

234:                                              ; preds = %227
  %235 = load i32, ptr %12, align 4, !tbaa !5
  %236 = load i32, ptr %11, align 4, !tbaa !5
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds i32, ptr @a, i64 %237
  %239 = load i32, ptr %12, align 4, !tbaa !5
  %240 = sext i32 %239 to i64
  %241 = sub i64 0, %240
  %242 = getelementptr inbounds i32, ptr %238, i64 %241
  %243 = call noundef zeroext i1 @_Z5matchiPi(i32 noundef %235, ptr noundef %242)
  br i1 %243, label %244, label %247

244:                                              ; preds = %234
  %245 = load i32, ptr %12, align 4, !tbaa !5
  %246 = add nsw i32 %245, 1
  store i32 %246, ptr %12, align 4, !tbaa !5
  br label %247

247:                                              ; preds = %244, %234
  %248 = load i32, ptr %12, align 4, !tbaa !5
  %249 = load i32, ptr @m, align 4, !tbaa !5
  %250 = icmp eq i32 %248, %249
  br i1 %250, label %251, label %256

251:                                              ; preds = %247
  %252 = load i32, ptr %11, align 4, !tbaa !5
  %253 = load i32, ptr %12, align 4, !tbaa !5
  %254 = sub nsw i32 %252, %253
  %255 = add nsw i32 %254, 1
  store i32 %255, ptr @ans, align 4, !tbaa !5
  store i32 21, ptr %13, align 4
  br label %260

256:                                              ; preds = %247
  br label %257

257:                                              ; preds = %256
  %258 = load i32, ptr %11, align 4, !tbaa !5
  %259 = add nsw i32 %258, 1
  store i32 %259, ptr %11, align 4, !tbaa !5
  br label %207, !llvm.loop !19

260:                                              ; preds = %251, %211
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %261

261:                                              ; preds = %260
  %262 = load i32, ptr @ans, align 4, !tbaa !5
  %263 = icmp eq i32 %262, -1
  br i1 %263, label %264, label %266

264:                                              ; preds = %261
  %265 = call i32 @puts(ptr noundef @.str)
  br label %269

266:                                              ; preds = %261
  %267 = load i32, ptr @ans, align 4, !tbaa !5
  %268 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %267)
  br label %269

269:                                              ; preds = %266, %264
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %14, !llvm.loop !20

270:                                              ; preds = %14
  ret i32 0
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4)) #1

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5matchiPi(i32 noundef, ptr noundef) #4

declare i32 @puts(ptr noundef) #5

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

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

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

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


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

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local global [100001 x i32], align 16
@b = external dso_local global [100001 x i32], align 16
@les = external dso_local local_unnamed_addr global [100001 x i32], align 16
@eq = external dso_local local_unnamed_addr global [100001 x i32], align 16
@gre = external dso_local local_unnamed_addr global [100001 x i32], align 16
@fail = external dso_local local_unnamed_addr global [100001 x i32], align 16
@ans = external dso_local local_unnamed_addr global i32, align 4
@pos = external dso_local local_unnamed_addr global [29 x i32], align 16
@pL = external dso_local local_unnamed_addr global [29 x i32], align 16
@pR = external dso_local local_unnamed_addr global [29 x i32], align 16
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  tail call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) @t)
  %1 = load i32, ptr @t, align 4, !tbaa !5
  %2 = add nsw i32 %1, -1
  store i32 %2, ptr @t, align 4, !tbaa !5
  %.not109 = icmp eq i32 %1, 0
  br i1 %.not109, label %._crit_edge112, label %.lr.ph111

.lr.ph111:                                        ; preds = %0, %228
  tail call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) @m)
  tail call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) @n)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(116) @pos, i8 -1, i64 116, i1 false)
  %3 = load i32, ptr @m, align 4, !tbaa !5
  %4 = icmp sgt i32 %3, 0
  br i1 %4, label %.lr.ph, label %.preheader82.thread

.preheader82:                                     ; preds = %.lr.ph
  %.pre = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 4), align 4, !tbaa !5
  %.not77 = icmp eq i32 %.pre, -1
  br i1 %.not77, label %.preheader82.thread, label %16

.lr.ph:                                           ; preds = %.lr.ph111, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph111 ]
  %5 = getelementptr inbounds [100001 x i32], ptr @b, i64 0, i64 %indvars.iv
  tail call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %5)
  %6 = load i32, ptr %5, align 4, !tbaa !5
  %7 = sext i32 %6 to i64
  %8 = getelementptr inbounds [29 x i32], ptr @pos, i64 0, i64 %7
  %9 = load i32, ptr %8, align 4, !tbaa !5
  %10 = getelementptr inbounds [100001 x i32], ptr @eq, i64 0, i64 %indvars.iv
  store i32 %9, ptr %10, align 4, !tbaa !5
  %11 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %11, ptr %8, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %12 = load i32, ptr @m, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = icmp slt i64 %indvars.iv.next, %13
  br i1 %14, label %.lr.ph, label %.preheader82, !llvm.loop !9

.lr.ph89.preheader:                               ; preds = %142
  %15 = zext nneg i32 %17 to i64
  br label %.lr.ph89

16:                                               ; preds = %.preheader82
  store i32 0, ptr getelementptr inbounds (i8, ptr @pL, i64 4), align 4, !tbaa !5
  store i32 1, ptr @pR, align 16, !tbaa !5
  br label %.preheader82.thread

.preheader82.thread:                              ; preds = %.lr.ph111, %.preheader82, %16
  %17 = phi i32 [ %12, %16 ], [ %12, %.preheader82 ], [ %3, %.lr.ph111 ]
  %.173 = phi i32 [ 1, %16 ], [ 0, %.preheader82 ], [ 0, %.lr.ph111 ]
  %18 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 8), align 8, !tbaa !5
  %.not77.1 = icmp eq i32 %18, -1
  br i1 %.not77.1, label %22, label %19

19:                                               ; preds = %.preheader82.thread
  store i32 %.173, ptr getelementptr inbounds (i8, ptr @pL, i64 8), align 8, !tbaa !5
  %20 = zext nneg i32 %.173 to i64
  %21 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %20
  store i32 2, ptr %21, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %19, %.preheader82.thread
  %.173.1 = phi i32 [ 2, %19 ], [ %.173, %.preheader82.thread ]
  %23 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 12), align 4, !tbaa !5
  %.not77.2 = icmp eq i32 %23, -1
  br i1 %.not77.2, label %27, label %24

24:                                               ; preds = %22
  store i32 %.173.1, ptr getelementptr inbounds (i8, ptr @pL, i64 12), align 4, !tbaa !5
  %25 = zext nneg i32 %.173.1 to i64
  %26 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %25
  store i32 3, ptr %26, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %24, %22
  %.173.2 = phi i32 [ 3, %24 ], [ %.173.1, %22 ]
  %28 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 16), align 16, !tbaa !5
  %.not77.3 = icmp eq i32 %28, -1
  br i1 %.not77.3, label %32, label %29

29:                                               ; preds = %27
  store i32 %.173.2, ptr getelementptr inbounds (i8, ptr @pL, i64 16), align 16, !tbaa !5
  %30 = zext nneg i32 %.173.2 to i64
  %31 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %30
  store i32 4, ptr %31, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %29, %27
  %.173.3 = phi i32 [ 4, %29 ], [ %.173.2, %27 ]
  %33 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 20), align 4, !tbaa !5
  %.not77.4 = icmp eq i32 %33, -1
  br i1 %.not77.4, label %37, label %34

34:                                               ; preds = %32
  store i32 %.173.3, ptr getelementptr inbounds (i8, ptr @pL, i64 20), align 4, !tbaa !5
  %35 = zext nneg i32 %.173.3 to i64
  %36 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %35
  store i32 5, ptr %36, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %34, %32
  %.173.4 = phi i32 [ 5, %34 ], [ %.173.3, %32 ]
  %38 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 24), align 8, !tbaa !5
  %.not77.5 = icmp eq i32 %38, -1
  br i1 %.not77.5, label %42, label %39

39:                                               ; preds = %37
  store i32 %.173.4, ptr getelementptr inbounds (i8, ptr @pL, i64 24), align 8, !tbaa !5
  %40 = zext nneg i32 %.173.4 to i64
  %41 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %40
  store i32 6, ptr %41, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %39, %37
  %.173.5 = phi i32 [ 6, %39 ], [ %.173.4, %37 ]
  %43 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 28), align 4, !tbaa !5
  %.not77.6 = icmp eq i32 %43, -1
  br i1 %.not77.6, label %47, label %44

44:                                               ; preds = %42
  store i32 %.173.5, ptr getelementptr inbounds (i8, ptr @pL, i64 28), align 4, !tbaa !5
  %45 = zext nneg i32 %.173.5 to i64
  %46 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %45
  store i32 7, ptr %46, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %44, %42
  %.173.6 = phi i32 [ 7, %44 ], [ %.173.5, %42 ]
  %48 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 32), align 16, !tbaa !5
  %.not77.7 = icmp eq i32 %48, -1
  br i1 %.not77.7, label %52, label %49

49:                                               ; preds = %47
  store i32 %.173.6, ptr getelementptr inbounds (i8, ptr @pL, i64 32), align 16, !tbaa !5
  %50 = zext nneg i32 %.173.6 to i64
  %51 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %50
  store i32 8, ptr %51, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %49, %47
  %.173.7 = phi i32 [ 8, %49 ], [ %.173.6, %47 ]
  %53 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 36), align 4, !tbaa !5
  %.not77.8 = icmp eq i32 %53, -1
  br i1 %.not77.8, label %57, label %54

54:                                               ; preds = %52
  store i32 %.173.7, ptr getelementptr inbounds (i8, ptr @pL, i64 36), align 4, !tbaa !5
  %55 = zext nneg i32 %.173.7 to i64
  %56 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %55
  store i32 9, ptr %56, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %54, %52
  %.173.8 = phi i32 [ 9, %54 ], [ %.173.7, %52 ]
  %58 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 40), align 8, !tbaa !5
  %.not77.9 = icmp eq i32 %58, -1
  br i1 %.not77.9, label %62, label %59

59:                                               ; preds = %57
  store i32 %.173.8, ptr getelementptr inbounds (i8, ptr @pL, i64 40), align 8, !tbaa !5
  %60 = zext nneg i32 %.173.8 to i64
  %61 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %60
  store i32 10, ptr %61, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %59, %57
  %.173.9 = phi i32 [ 10, %59 ], [ %.173.8, %57 ]
  %63 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 44), align 4, !tbaa !5
  %.not77.10 = icmp eq i32 %63, -1
  br i1 %.not77.10, label %67, label %64

64:                                               ; preds = %62
  store i32 %.173.9, ptr getelementptr inbounds (i8, ptr @pL, i64 44), align 4, !tbaa !5
  %65 = zext nneg i32 %.173.9 to i64
  %66 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %65
  store i32 11, ptr %66, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %64, %62
  %.173.10 = phi i32 [ 11, %64 ], [ %.173.9, %62 ]
  %68 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 48), align 16, !tbaa !5
  %.not77.11 = icmp eq i32 %68, -1
  br i1 %.not77.11, label %72, label %69

69:                                               ; preds = %67
  store i32 %.173.10, ptr getelementptr inbounds (i8, ptr @pL, i64 48), align 16, !tbaa !5
  %70 = zext nneg i32 %.173.10 to i64
  %71 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %70
  store i32 12, ptr %71, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %69, %67
  %.173.11 = phi i32 [ 12, %69 ], [ %.173.10, %67 ]
  %73 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 52), align 4, !tbaa !5
  %.not77.12 = icmp eq i32 %73, -1
  br i1 %.not77.12, label %77, label %74

74:                                               ; preds = %72
  store i32 %.173.11, ptr getelementptr inbounds (i8, ptr @pL, i64 52), align 4, !tbaa !5
  %75 = zext nneg i32 %.173.11 to i64
  %76 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %75
  store i32 13, ptr %76, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %74, %72
  %.173.12 = phi i32 [ 13, %74 ], [ %.173.11, %72 ]
  %78 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 56), align 8, !tbaa !5
  %.not77.13 = icmp eq i32 %78, -1
  br i1 %.not77.13, label %82, label %79

79:                                               ; preds = %77
  store i32 %.173.12, ptr getelementptr inbounds (i8, ptr @pL, i64 56), align 8, !tbaa !5
  %80 = zext nneg i32 %.173.12 to i64
  %81 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %80
  store i32 14, ptr %81, align 4, !tbaa !5
  br label %82

82:                                               ; preds = %79, %77
  %.173.13 = phi i32 [ 14, %79 ], [ %.173.12, %77 ]
  %83 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 60), align 4, !tbaa !5
  %.not77.14 = icmp eq i32 %83, -1
  br i1 %.not77.14, label %87, label %84

84:                                               ; preds = %82
  store i32 %.173.13, ptr getelementptr inbounds (i8, ptr @pL, i64 60), align 4, !tbaa !5
  %85 = zext nneg i32 %.173.13 to i64
  %86 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %85
  store i32 15, ptr %86, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %84, %82
  %.173.14 = phi i32 [ 15, %84 ], [ %.173.13, %82 ]
  %88 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 64), align 16, !tbaa !5
  %.not77.15 = icmp eq i32 %88, -1
  br i1 %.not77.15, label %92, label %89

89:                                               ; preds = %87
  store i32 %.173.14, ptr getelementptr inbounds (i8, ptr @pL, i64 64), align 16, !tbaa !5
  %90 = zext nneg i32 %.173.14 to i64
  %91 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %90
  store i32 16, ptr %91, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %89, %87
  %.173.15 = phi i32 [ 16, %89 ], [ %.173.14, %87 ]
  %93 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 68), align 4, !tbaa !5
  %.not77.16 = icmp eq i32 %93, -1
  br i1 %.not77.16, label %97, label %94

94:                                               ; preds = %92
  store i32 %.173.15, ptr getelementptr inbounds (i8, ptr @pL, i64 68), align 4, !tbaa !5
  %95 = zext nneg i32 %.173.15 to i64
  %96 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %95
  store i32 17, ptr %96, align 4, !tbaa !5
  br label %97

97:                                               ; preds = %94, %92
  %.173.16 = phi i32 [ 17, %94 ], [ %.173.15, %92 ]
  %98 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 72), align 8, !tbaa !5
  %.not77.17 = icmp eq i32 %98, -1
  br i1 %.not77.17, label %102, label %99

99:                                               ; preds = %97
  store i32 %.173.16, ptr getelementptr inbounds (i8, ptr @pL, i64 72), align 8, !tbaa !5
  %100 = zext nneg i32 %.173.16 to i64
  %101 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %100
  store i32 18, ptr %101, align 4, !tbaa !5
  br label %102

102:                                              ; preds = %99, %97
  %.173.17 = phi i32 [ 18, %99 ], [ %.173.16, %97 ]
  %103 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 76), align 4, !tbaa !5
  %.not77.18 = icmp eq i32 %103, -1
  br i1 %.not77.18, label %107, label %104

104:                                              ; preds = %102
  store i32 %.173.17, ptr getelementptr inbounds (i8, ptr @pL, i64 76), align 4, !tbaa !5
  %105 = zext nneg i32 %.173.17 to i64
  %106 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %105
  store i32 19, ptr %106, align 4, !tbaa !5
  br label %107

107:                                              ; preds = %104, %102
  %.173.18 = phi i32 [ 19, %104 ], [ %.173.17, %102 ]
  %108 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 80), align 16, !tbaa !5
  %.not77.19 = icmp eq i32 %108, -1
  br i1 %.not77.19, label %112, label %109

109:                                              ; preds = %107
  store i32 %.173.18, ptr getelementptr inbounds (i8, ptr @pL, i64 80), align 16, !tbaa !5
  %110 = zext nneg i32 %.173.18 to i64
  %111 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %110
  store i32 20, ptr %111, align 4, !tbaa !5
  br label %112

112:                                              ; preds = %109, %107
  %.173.19 = phi i32 [ 20, %109 ], [ %.173.18, %107 ]
  %113 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 84), align 4, !tbaa !5
  %.not77.20 = icmp eq i32 %113, -1
  br i1 %.not77.20, label %117, label %114

114:                                              ; preds = %112
  store i32 %.173.19, ptr getelementptr inbounds (i8, ptr @pL, i64 84), align 4, !tbaa !5
  %115 = zext nneg i32 %.173.19 to i64
  %116 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %115
  store i32 21, ptr %116, align 4, !tbaa !5
  br label %117

117:                                              ; preds = %114, %112
  %.173.20 = phi i32 [ 21, %114 ], [ %.173.19, %112 ]
  %118 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 88), align 8, !tbaa !5
  %.not77.21 = icmp eq i32 %118, -1
  br i1 %.not77.21, label %122, label %119

119:                                              ; preds = %117
  store i32 %.173.20, ptr getelementptr inbounds (i8, ptr @pL, i64 88), align 8, !tbaa !5
  %120 = zext nneg i32 %.173.20 to i64
  %121 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %120
  store i32 22, ptr %121, align 4, !tbaa !5
  br label %122

122:                                              ; preds = %119, %117
  %.173.21 = phi i32 [ 22, %119 ], [ %.173.20, %117 ]
  %123 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 92), align 4, !tbaa !5
  %.not77.22 = icmp eq i32 %123, -1
  br i1 %.not77.22, label %127, label %124

124:                                              ; preds = %122
  store i32 %.173.21, ptr getelementptr inbounds (i8, ptr @pL, i64 92), align 4, !tbaa !5
  %125 = zext nneg i32 %.173.21 to i64
  %126 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %125
  store i32 23, ptr %126, align 4, !tbaa !5
  br label %127

127:                                              ; preds = %124, %122
  %.173.22 = phi i32 [ 23, %124 ], [ %.173.21, %122 ]
  %128 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 96), align 16, !tbaa !5
  %.not77.23 = icmp eq i32 %128, -1
  br i1 %.not77.23, label %132, label %129

129:                                              ; preds = %127
  store i32 %.173.22, ptr getelementptr inbounds (i8, ptr @pL, i64 96), align 16, !tbaa !5
  %130 = zext nneg i32 %.173.22 to i64
  %131 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %130
  store i32 24, ptr %131, align 4, !tbaa !5
  br label %132

132:                                              ; preds = %129, %127
  %.173.23 = phi i32 [ 24, %129 ], [ %.173.22, %127 ]
  %133 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 100), align 4, !tbaa !5
  %.not77.24 = icmp eq i32 %133, -1
  br i1 %.not77.24, label %137, label %134

134:                                              ; preds = %132
  store i32 %.173.23, ptr getelementptr inbounds (i8, ptr @pL, i64 100), align 4, !tbaa !5
  %135 = zext nneg i32 %.173.23 to i64
  %136 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %135
  store i32 25, ptr %136, align 4, !tbaa !5
  br label %137

137:                                              ; preds = %134, %132
  %.173.24 = phi i32 [ 25, %134 ], [ %.173.23, %132 ]
  %138 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 104), align 8, !tbaa !5
  %.not77.25 = icmp eq i32 %138, -1
  br i1 %.not77.25, label %142, label %139

139:                                              ; preds = %137
  store i32 %.173.24, ptr getelementptr inbounds (i8, ptr @pL, i64 104), align 8, !tbaa !5
  %140 = zext nneg i32 %.173.24 to i64
  %141 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %140
  store i32 26, ptr %141, align 4, !tbaa !5
  br label %142

142:                                              ; preds = %139, %137
  %.173.25 = phi i32 [ 26, %139 ], [ %.173.24, %137 ]
  store i32 %.173.25, ptr getelementptr inbounds (i8, ptr @pL, i64 108), align 4, !tbaa !5
  %143 = zext nneg i32 %.173.25 to i64
  %144 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %143
  store i32 27, ptr %144, align 4, !tbaa !5
  %145 = icmp sgt i32 %17, 0
  br i1 %145, label %.lr.ph89.preheader, label %._crit_edge

.preheader81:                                     ; preds = %162
  %.not142 = icmp eq i32 %17, 1
  br i1 %.not142, label %._crit_edge, label %.preheader79

.lr.ph89:                                         ; preds = %.lr.ph89.preheader, %162
  %indvars.iv120 = phi i64 [ %15, %.lr.ph89.preheader ], [ %indvars.iv.next121, %162 ]
  %indvars.iv.next121 = add nsw i64 %indvars.iv120, -1
  %146 = getelementptr inbounds [100001 x i32], ptr @b, i64 0, i64 %indvars.iv.next121
  %147 = load i32, ptr %146, align 4, !tbaa !5
  %148 = getelementptr inbounds [100001 x i32], ptr @eq, i64 0, i64 %indvars.iv.next121
  %149 = load i32, ptr %148, align 4, !tbaa !5
  %150 = sext i32 %147 to i64
  %151 = getelementptr inbounds [29 x i32], ptr @pos, i64 0, i64 %150
  store i32 %149, ptr %151, align 4, !tbaa !5
  %152 = icmp eq i32 %149, -1
  %153 = getelementptr inbounds [29 x i32], ptr @pL, i64 0, i64 %150
  %154 = load i32, ptr %153, align 4, !tbaa !5
  %155 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %150
  %156 = load i32, ptr %155, align 4, !tbaa !5
  br i1 %152, label %157, label %.lr.ph89._crit_edge

.lr.ph89._crit_edge:                              ; preds = %.lr.ph89
  %.pre135 = sext i32 %154 to i64
  %.pre136 = sext i32 %156 to i64
  br label %162

157:                                              ; preds = %.lr.ph89
  %158 = sext i32 %156 to i64
  %159 = getelementptr inbounds [29 x i32], ptr @pL, i64 0, i64 %158
  store i32 %154, ptr %159, align 4, !tbaa !5
  %160 = sext i32 %154 to i64
  %161 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %160
  store i32 %156, ptr %161, align 4, !tbaa !5
  br label %162

162:                                              ; preds = %.lr.ph89._crit_edge, %157
  %.pre-phi137 = phi i64 [ %.pre136, %.lr.ph89._crit_edge ], [ %158, %157 ]
  %.pre-phi = phi i64 [ %.pre135, %.lr.ph89._crit_edge ], [ %160, %157 ]
  %163 = getelementptr inbounds [29 x i32], ptr @pos, i64 0, i64 %.pre-phi
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = getelementptr inbounds [100001 x i32], ptr @les, i64 0, i64 %indvars.iv.next121
  store i32 %164, ptr %165, align 4, !tbaa !5
  %166 = getelementptr inbounds [29 x i32], ptr @pos, i64 0, i64 %.pre-phi137
  %167 = load i32, ptr %166, align 4, !tbaa !5
  %168 = getelementptr inbounds [100001 x i32], ptr @gre, i64 0, i64 %indvars.iv.next121
  store i32 %167, ptr %168, align 4, !tbaa !5
  %169 = icmp ugt i64 %indvars.iv120, 1
  br i1 %169, label %.lr.ph89, label %.preheader81, !llvm.loop !11

.preheader79:                                     ; preds = %.preheader81, %.critedge
  %indvars.iv123 = phi i64 [ %indvars.iv.next124, %.critedge ], [ 1, %.preheader81 ]
  %.06597 = phi i32 [ %spec.select, %.critedge ], [ 0, %.preheader81 ]
  %.not7690 = icmp eq i32 %.06597, 0
  br i1 %.not7690, label %.critedge, label %.lr.ph92

.lr.ph92:                                         ; preds = %.preheader79
  %170 = getelementptr inbounds i32, ptr @b, i64 %indvars.iv123
  br label %173

._crit_edge:                                      ; preds = %.critedge, %142, %.preheader81
  store i32 -1, ptr @ans, align 4, !tbaa !5
  %171 = load i32, ptr @n, align 4, !tbaa !5
  %172 = icmp sgt i32 %171, 0
  br i1 %172, label %.lr.ph100, label %thread-pre-split

173:                                              ; preds = %.lr.ph92, %178
  %.16691 = phi i32 [ %.06597, %.lr.ph92 ], [ %180, %178 ]
  %174 = sext i32 %.16691 to i64
  %175 = sub nsw i64 0, %174
  %176 = getelementptr inbounds i32, ptr %170, i64 %175
  %177 = tail call noundef zeroext i1 @_Z5matchiPi(i32 noundef %.16691, ptr noundef nonnull %176)
  br i1 %177, label %.critedge, label %178

178:                                              ; preds = %173
  %179 = getelementptr inbounds [100001 x i32], ptr @fail, i64 0, i64 %174
  %180 = load i32, ptr %179, align 4, !tbaa !5
  %.not76 = icmp eq i32 %180, 0
  br i1 %.not76, label %.critedge, label %173, !llvm.loop !12

.critedge:                                        ; preds = %173, %178, %.preheader79
  %.166.lcssa = phi i32 [ 0, %.preheader79 ], [ 0, %178 ], [ %.16691, %173 ]
  %181 = getelementptr inbounds i32, ptr @b, i64 %indvars.iv123
  %182 = sext i32 %.166.lcssa to i64
  %183 = sub nsw i64 0, %182
  %184 = getelementptr inbounds i32, ptr %181, i64 %183
  %185 = tail call noundef zeroext i1 @_Z5matchiPi(i32 noundef %.166.lcssa, ptr noundef nonnull %184)
  %186 = zext i1 %185 to i32
  %spec.select = add nsw i32 %.166.lcssa, %186
  %indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
  %187 = getelementptr inbounds [100001 x i32], ptr @fail, i64 0, i64 %indvars.iv.next124
  store i32 %spec.select, ptr %187, align 4, !tbaa !5
  %188 = load i32, ptr @m, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = icmp slt i64 %indvars.iv.next124, %189
  br i1 %190, label %.preheader79, label %._crit_edge, !llvm.loop !13

.preheader80:                                     ; preds = %.lr.ph100
  %191 = icmp sgt i32 %193, 0
  br i1 %191, label %.preheader, label %thread-pre-split

.lr.ph100:                                        ; preds = %._crit_edge, %.lr.ph100
  %indvars.iv126 = phi i64 [ %indvars.iv.next127, %.lr.ph100 ], [ 0, %._crit_edge ]
  %192 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %indvars.iv126
  tail call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %192)
  %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
  %193 = load i32, ptr @n, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = icmp slt i64 %indvars.iv.next127, %194
  br i1 %195, label %.lr.ph100, label %.preheader80, !llvm.loop !14

.preheader:                                       ; preds = %.preheader80, %217
  %indvars.iv129 = phi i64 [ %indvars.iv.next130, %217 ], [ 0, %.preheader80 ]
  %.0108 = phi i32 [ %spec.select78, %217 ], [ 0, %.preheader80 ]
  %.not75101 = icmp eq i32 %.0108, 0
  br i1 %.not75101, label %.critedge2, label %.lr.ph103

.lr.ph103:                                        ; preds = %.preheader
  %196 = getelementptr inbounds i32, ptr @a, i64 %indvars.iv129
  br label %197

197:                                              ; preds = %.lr.ph103, %202
  %.1102 = phi i32 [ %.0108, %.lr.ph103 ], [ %204, %202 ]
  %198 = sext i32 %.1102 to i64
  %199 = sub nsw i64 0, %198
  %200 = getelementptr inbounds i32, ptr %196, i64 %199
  %201 = tail call noundef zeroext i1 @_Z5matchiPi(i32 noundef %.1102, ptr noundef nonnull %200)
  br i1 %201, label %.critedge2, label %202

202:                                              ; preds = %197
  %203 = getelementptr inbounds [100001 x i32], ptr @fail, i64 0, i64 %198
  %204 = load i32, ptr %203, align 4, !tbaa !5
  %.not75 = icmp eq i32 %204, 0
  br i1 %.not75, label %.critedge2, label %197, !llvm.loop !15

.critedge2:                                       ; preds = %197, %202, %.preheader
  %.1.lcssa = phi i32 [ 0, %.preheader ], [ 0, %202 ], [ %.1102, %197 ]
  %205 = getelementptr inbounds i32, ptr @a, i64 %indvars.iv129
  %206 = sext i32 %.1.lcssa to i64
  %207 = sub nsw i64 0, %206
  %208 = getelementptr inbounds i32, ptr %205, i64 %207
  %209 = tail call noundef zeroext i1 @_Z5matchiPi(i32 noundef %.1.lcssa, ptr noundef nonnull %208)
  %210 = zext i1 %209 to i32
  %spec.select78 = add nsw i32 %.1.lcssa, %210
  %211 = load i32, ptr @m, align 4, !tbaa !5
  %212 = icmp eq i32 %spec.select78, %211
  br i1 %212, label %213, label %217

213:                                              ; preds = %.critedge2
  %214 = trunc nuw nsw i64 %indvars.iv129 to i32
  %215 = sub nsw i32 %214, %spec.select78
  %216 = add nsw i32 %215, 1
  store i32 %216, ptr @ans, align 4, !tbaa !5
  br label %221

217:                                              ; preds = %.critedge2
  %indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1
  %218 = load i32, ptr @n, align 4, !tbaa !5
  %219 = sext i32 %218 to i64
  %220 = icmp slt i64 %indvars.iv.next130, %219
  br i1 %220, label %.preheader, label %thread-pre-split, !llvm.loop !16

thread-pre-split:                                 ; preds = %217, %._crit_edge, %.preheader80
  %.pr = load i32, ptr @ans, align 4, !tbaa !5
  br label %221

221:                                              ; preds = %thread-pre-split, %213
  %222 = phi i32 [ %.pr, %thread-pre-split ], [ %216, %213 ]
  %223 = icmp eq i32 %222, -1
  br i1 %223, label %224, label %226

224:                                              ; preds = %221
  %225 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str)
  br label %228

226:                                              ; preds = %221
  %227 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %222)
  br label %228

228:                                              ; preds = %226, %224
  %229 = load i32, ptr @t, align 4, !tbaa !5
  %230 = add nsw i32 %229, -1
  store i32 %230, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %229, 0
  br i1 %.not, label %._crit_edge112, label %.lr.ph111, !llvm.loop !17

._crit_edge112:                                   ; preds = %228, %0
  ret i32 0
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5matchiPi(i32 noundef, ptr noundef) local_unnamed_addr #3

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

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

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

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

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


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