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

; 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.fastIO::Ostream_fwrite" = type { ptr, ptr, ptr }

@_ZN6fastIO7OstreamE = external dso_local global %"struct.fastIO::Ostream_fwrite", align 8
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@upp = 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
@cnt = external dso_local global i32, align 4
@ans = external dso_local global [100001 x i32], align 16
@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 [3 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 ptr, align 8
  %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) @n)
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) @m)
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) @upp)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %23, %0
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = icmp slt i32 %15, %16
  br i1 %17, label %19, label %18

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

19:                                               ; preds = %14
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %21
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %22)
  br label %23

23:                                               ; preds = %19
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %2, align 4, !tbaa !5
  br label %14, !llvm.loop !9

26:                                               ; preds = %18
  %27 = load i32, ptr @upp, align 4, !tbaa !5
  %28 = add nsw i32 %27, 2
  %29 = sext i32 %28 to i64
  %30 = mul i64 %29, 4
  call void @llvm.memset.p0.i64(ptr align 16 @pos, i8 -1, i64 %30, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %54, %26
  %32 = load i32, ptr %3, align 4, !tbaa !5
  %33 = load i32, ptr @m, align 4, !tbaa !5
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %57

36:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [100001 x i32], ptr @b, i64 0, i64 %38
  store ptr %39, ptr %4, align 8, !tbaa !11
  %40 = load ptr, ptr %4, align 8, !tbaa !11
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %40)
  %41 = load ptr, ptr %4, align 8, !tbaa !11
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [29 x i32], ptr @pos, i64 0, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = load i32, ptr %3, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [100001 x i32], ptr @eq, i64 0, i64 %47
  store i32 %45, ptr %48, align 4, !tbaa !5
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = load ptr, ptr %4, align 8, !tbaa !11
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [29 x i32], ptr @pos, i64 0, i64 %52
  store i32 %49, ptr %53, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  br label %54

54:                                               ; preds = %36
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %3, align 4, !tbaa !5
  br label %31, !llvm.loop !13

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

58:                                               ; preds = %80, %57
  %59 = load i32, ptr %6, align 4, !tbaa !5
  %60 = load i32, ptr @upp, align 4, !tbaa !5
  %61 = icmp sle i32 %59, %60
  br i1 %61, label %63, label %62

62:                                               ; preds = %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %83

63:                                               ; preds = %58
  %64 = load i32, ptr %6, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [29 x i32], ptr @pos, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = icmp ne i32 %67, -1
  br i1 %68, label %69, label %79

69:                                               ; preds = %63
  %70 = load i32, ptr %5, align 4, !tbaa !5
  %71 = load i32, ptr %6, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [29 x i32], ptr @pL, i64 0, i64 %72
  store i32 %70, ptr %73, align 4, !tbaa !5
  %74 = load i32, ptr %6, align 4, !tbaa !5
  %75 = load i32, ptr %5, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %76
  store i32 %74, ptr %77, align 4, !tbaa !5
  %78 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %78, ptr %5, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %69, %63
  br label %80

80:                                               ; preds = %79
  %81 = load i32, ptr %6, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %6, align 4, !tbaa !5
  br label %58, !llvm.loop !14

83:                                               ; preds = %62
  %84 = load i32, ptr %5, align 4, !tbaa !5
  %85 = load i32, ptr @upp, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [29 x i32], ptr @pL, i64 0, i64 %87
  store i32 %84, ptr %88, align 4, !tbaa !5
  %89 = load i32, ptr @upp, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  %91 = load i32, ptr %5, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %92
  store i32 %90, ptr %93, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %94 = load i32, ptr @m, align 4, !tbaa !5
  %95 = sub nsw i32 %94, 1
  store i32 %95, ptr %7, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %159, %83
  %97 = load i32, ptr %7, align 4, !tbaa !5
  %98 = icmp sge i32 %97, 0
  br i1 %98, label %100, label %99

99:                                               ; preds = %96
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %162

100:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %101 = load i32, ptr %7, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [100001 x i32], ptr @b, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  store i32 %104, ptr %8, align 4, !tbaa !5
  %105 = load i32, ptr %7, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [100001 x i32], ptr @eq, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = load i32, ptr %8, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [29 x i32], ptr @pos, i64 0, i64 %110
  store i32 %108, ptr %111, align 4, !tbaa !5
  %112 = load i32, ptr %8, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [29 x i32], ptr @pos, i64 0, i64 %113
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = icmp eq i32 %115, -1
  br i1 %116, label %117, label %138

117:                                              ; preds = %100
  %118 = load i32, ptr %8, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [29 x i32], ptr @pL, i64 0, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %122 = load i32, ptr %8, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [29 x i32], ptr @pL, i64 0, i64 %126
  store i32 %121, ptr %127, align 4, !tbaa !5
  %128 = load i32, ptr %8, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = load i32, ptr %8, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [29 x i32], ptr @pL, i64 0, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %136
  store i32 %131, ptr %137, align 4, !tbaa !5
  br label %138

138:                                              ; preds = %117, %100
  %139 = load i32, ptr %8, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [29 x i32], ptr @pL, i64 0, i64 %140
  %142 = load i32, ptr %141, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [29 x i32], ptr @pos, i64 0, i64 %143
  %145 = load i32, ptr %144, align 4, !tbaa !5
  %146 = load i32, ptr %7, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [100001 x i32], ptr @les, i64 0, i64 %147
  store i32 %145, ptr %148, align 4, !tbaa !5
  %149 = load i32, ptr %8, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %150
  %152 = load i32, ptr %151, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [29 x i32], ptr @pos, i64 0, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !5
  %156 = load i32, ptr %7, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [100001 x i32], ptr @gre, i64 0, i64 %157
  store i32 %155, ptr %158, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %159

159:                                              ; preds = %138
  %160 = load i32, ptr %7, align 4, !tbaa !5
  %161 = add nsw i32 %160, -1
  store i32 %161, ptr %7, align 4, !tbaa !5
  br label %96, !llvm.loop !15

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

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

167:                                              ; preds = %163
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %212

168:                                              ; preds = %163
  br label %169

169:                                              ; preds = %185, %168
  %170 = load i32, ptr %10, align 4, !tbaa !5
  %171 = icmp ne i32 %170, 0
  br i1 %171, label %172, label %183

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

183:                                              ; preds = %172, %169
  %184 = phi i1 [ false, %169 ], [ %182, %172 ]
  br i1 %184, label %185, label %190

185:                                              ; preds = %183
  %186 = load i32, ptr %10, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [100001 x i32], ptr @fail, i64 0, i64 %187
  %189 = load i32, ptr %188, align 4, !tbaa !5
  store i32 %189, ptr %10, align 4, !tbaa !5
  br label %169, !llvm.loop !16

190:                                              ; preds = %183
  %191 = load i32, ptr %10, align 4, !tbaa !5
  %192 = load i32, ptr %9, align 4, !tbaa !5
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds i32, ptr @b, i64 %193
  %195 = load i32, ptr %10, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = sub i64 0, %196
  %198 = getelementptr inbounds i32, ptr %194, i64 %197
  %199 = call noundef zeroext i1 @_Z5matchiPi(i32 noundef %191, ptr noundef %198)
  br i1 %199, label %200, label %203

200:                                              ; preds = %190
  %201 = load i32, ptr %10, align 4, !tbaa !5
  %202 = add nsw i32 %201, 1
  store i32 %202, ptr %10, align 4, !tbaa !5
  br label %203

203:                                              ; preds = %200, %190
  %204 = load i32, ptr %10, align 4, !tbaa !5
  %205 = load i32, ptr %9, align 4, !tbaa !5
  %206 = add nsw i32 %205, 1
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [100001 x i32], ptr @fail, i64 0, i64 %207
  store i32 %204, ptr %208, align 4, !tbaa !5
  br label %209

209:                                              ; preds = %203
  %210 = load i32, ptr %9, align 4, !tbaa !5
  %211 = add nsw i32 %210, 1
  store i32 %211, ptr %9, align 4, !tbaa !5
  br label %163, !llvm.loop !17

212:                                              ; preds = %167
  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 %213

213:                                              ; preds = %271, %212
  %214 = load i32, ptr %11, align 4, !tbaa !5
  %215 = load i32, ptr @n, align 4, !tbaa !5
  %216 = icmp slt i32 %214, %215
  br i1 %216, label %218, label %217

217:                                              ; preds = %213
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %274

218:                                              ; preds = %213
  br label %219

219:                                              ; preds = %235, %218
  %220 = load i32, ptr %12, align 4, !tbaa !5
  %221 = icmp ne i32 %220, 0
  br i1 %221, label %222, label %233

222:                                              ; preds = %219
  %223 = load i32, ptr %12, align 4, !tbaa !5
  %224 = load i32, ptr %11, align 4, !tbaa !5
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds i32, ptr @a, i64 %225
  %227 = load i32, ptr %12, align 4, !tbaa !5
  %228 = sext i32 %227 to i64
  %229 = sub i64 0, %228
  %230 = getelementptr inbounds i32, ptr %226, i64 %229
  %231 = call noundef zeroext i1 @_Z5matchiPi(i32 noundef %223, ptr noundef %230)
  %232 = xor i1 %231, true
  br label %233

233:                                              ; preds = %222, %219
  %234 = phi i1 [ false, %219 ], [ %232, %222 ]
  br i1 %234, label %235, label %240

235:                                              ; preds = %233
  %236 = load i32, ptr %12, align 4, !tbaa !5
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [100001 x i32], ptr @fail, i64 0, i64 %237
  %239 = load i32, ptr %238, align 4, !tbaa !5
  store i32 %239, ptr %12, align 4, !tbaa !5
  br label %219, !llvm.loop !18

240:                                              ; preds = %233
  %241 = load i32, ptr %12, align 4, !tbaa !5
  %242 = load i32, ptr %11, align 4, !tbaa !5
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds i32, ptr @a, i64 %243
  %245 = load i32, ptr %12, align 4, !tbaa !5
  %246 = sext i32 %245 to i64
  %247 = sub i64 0, %246
  %248 = getelementptr inbounds i32, ptr %244, i64 %247
  %249 = call noundef zeroext i1 @_Z5matchiPi(i32 noundef %241, ptr noundef %248)
  br i1 %249, label %250, label %253

250:                                              ; preds = %240
  %251 = load i32, ptr %12, align 4, !tbaa !5
  %252 = add nsw i32 %251, 1
  store i32 %252, ptr %12, align 4, !tbaa !5
  br label %253

253:                                              ; preds = %250, %240
  %254 = load i32, ptr %12, align 4, !tbaa !5
  %255 = load i32, ptr @m, align 4, !tbaa !5
  %256 = icmp eq i32 %254, %255
  br i1 %256, label %257, label %270

257:                                              ; preds = %253
  %258 = load i32, ptr %11, align 4, !tbaa !5
  %259 = load i32, ptr %12, align 4, !tbaa !5
  %260 = sub nsw i32 %258, %259
  %261 = add nsw i32 %260, 1
  %262 = load i32, ptr @cnt, align 4, !tbaa !5
  %263 = add nsw i32 %262, 1
  store i32 %263, ptr @cnt, align 4, !tbaa !5
  %264 = sext i32 %262 to i64
  %265 = getelementptr inbounds [100001 x i32], ptr @ans, i64 0, i64 %264
  store i32 %261, ptr %265, align 4, !tbaa !5
  %266 = load i32, ptr %12, align 4, !tbaa !5
  %267 = sext i32 %266 to i64
  %268 = getelementptr inbounds [100001 x i32], ptr @fail, i64 0, i64 %267
  %269 = load i32, ptr %268, align 4, !tbaa !5
  store i32 %269, ptr %12, align 4, !tbaa !5
  br label %270

270:                                              ; preds = %257, %253
  br label %271

271:                                              ; preds = %270
  %272 = load i32, ptr %11, align 4, !tbaa !5
  %273 = add nsw i32 %272, 1
  store i32 %273, ptr %11, align 4, !tbaa !5
  br label %213, !llvm.loop !19

274:                                              ; preds = %217
  %275 = load i32, ptr @cnt, align 4, !tbaa !5
  call void @_ZN6fastIO14Ostream_fwrite5writeEic(ptr noundef nonnull align 8 dereferenceable(24) @_ZN6fastIO7OstreamE, i32 noundef %275, i8 noundef signext 10)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %276

276:                                              ; preds = %294, %274
  %277 = load i32, ptr %13, align 4, !tbaa !5
  %278 = load i32, ptr @cnt, align 4, !tbaa !5
  %279 = icmp slt i32 %277, %278
  br i1 %279, label %281, label %280

280:                                              ; preds = %276
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %297

281:                                              ; preds = %276
  %282 = load i32, ptr %13, align 4, !tbaa !5
  %283 = sext i32 %282 to i64
  %284 = getelementptr inbounds [100001 x i32], ptr @ans, i64 0, i64 %283
  %285 = load i32, ptr %284, align 4, !tbaa !5
  %286 = add nsw i32 %285, 1
  %287 = load i32, ptr %13, align 4, !tbaa !5
  %288 = load i32, ptr @cnt, align 4, !tbaa !5
  %289 = sub nsw i32 %288, 1
  %290 = icmp eq i32 %287, %289
  %291 = zext i1 %290 to i64
  %292 = getelementptr inbounds [3 x i8], ptr @.str, i64 0, i64 %291
  %293 = load i8, ptr %292, align 1, !tbaa !20
  call void @_ZN6fastIO14Ostream_fwrite5writeEic(ptr noundef nonnull align 8 dereferenceable(24) @_ZN6fastIO7OstreamE, i32 noundef %286, i8 noundef signext %293)
  br label %294

294:                                              ; preds = %281
  %295 = load i32, ptr %13, align 4, !tbaa !5
  %296 = add nsw i32 %295, 1
  store i32 %296, ptr %13, align 4, !tbaa !5
  br label %276, !llvm.loop !21

297:                                              ; preds = %280
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  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 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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6fastIO14Ostream_fwrite5writeEic(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i8 noundef signext) #5 align 2

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = !{!7, !7, i64 0}
!21 = distinct !{!21, !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.fastIO::Ostream_fwrite" = type { ptr, ptr, ptr }

@_ZN6fastIO7OstreamE = external dso_local global %"struct.fastIO::Ostream_fwrite", align 8
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@upp = 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
@cnt = external dso_local local_unnamed_addr global i32, align 4
@ans = external dso_local local_unnamed_addr global [100001 x i32], align 16
@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 [3 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) @n)
  tail call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) @m)
  tail call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) @upp)
  %1 = load i32, ptr @n, align 4, !tbaa !5
  %2 = icmp sgt i32 %1, 0
  br i1 %2, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %3 = load i32, ptr @upp, align 4, !tbaa !5
  %4 = add nsw i32 %3, 2
  %5 = sext i32 %4 to i64
  %6 = shl nsw i64 %5, 2
  tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @pos, i8 -1, i64 %6, i1 false)
  %7 = load i32, ptr @m, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph94, label %.preheader89

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %9 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %indvars.iv
  tail call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %9)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %10 = load i32, ptr @n, align 4, !tbaa !5
  %11 = sext i32 %10 to i64
  %12 = icmp slt i64 %indvars.iv.next, %11
  br i1 %12, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.preheader89.loopexit:                            ; preds = %.lr.ph94
  %.pre = load i32, ptr @upp, align 4, !tbaa !5
  br label %.preheader89

.preheader89:                                     ; preds = %.preheader89.loopexit, %._crit_edge
  %13 = phi i32 [ %3, %._crit_edge ], [ %.pre, %.preheader89.loopexit ]
  %14 = phi i32 [ %7, %._crit_edge ], [ %24, %.preheader89.loopexit ]
  %.not95 = icmp slt i32 %13, 1
  %.pre152 = add i32 %13, 1
  br i1 %.not95, label %._crit_edge99, label %.lr.ph98.preheader

.lr.ph98.preheader:                               ; preds = %.preheader89
  %wide.trip.count = zext i32 %.pre152 to i64
  %15 = add nsw i64 %wide.trip.count, -1
  %xtraiter = and i64 %15, 1
  %16 = icmp eq i32 %.pre152, 2
  br i1 %16, label %._crit_edge99.loopexit.unr-lcssa, label %.lr.ph98.preheader.new

.lr.ph98.preheader.new:                           ; preds = %.lr.ph98.preheader
  %unroll_iter = and i64 %15, -2
  br label %.lr.ph98

.lr.ph94:                                         ; preds = %._crit_edge, %.lr.ph94
  %indvars.iv128 = phi i64 [ %indvars.iv.next129, %.lr.ph94 ], [ 0, %._crit_edge ]
  %17 = getelementptr inbounds [100001 x i32], ptr @b, i64 0, i64 %indvars.iv128
  tail call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %17)
  %18 = load i32, ptr %17, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [29 x i32], ptr @pos, i64 0, i64 %19
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = getelementptr inbounds [100001 x i32], ptr @eq, i64 0, i64 %indvars.iv128
  store i32 %21, ptr %22, align 4, !tbaa !5
  %23 = trunc nuw nsw i64 %indvars.iv128 to i32
  store i32 %23, ptr %20, align 4, !tbaa !5
  %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
  %24 = load i32, ptr @m, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = icmp slt i64 %indvars.iv.next129, %25
  br i1 %26, label %.lr.ph94, label %.preheader89.loopexit, !llvm.loop !11

._crit_edge99.loopexit.unr-lcssa:                 ; preds = %54, %.lr.ph98.preheader
  %.178.lcssa.ph = phi i32 [ poison, %.lr.ph98.preheader ], [ %.178.1, %54 ]
  %indvars.iv131.unr = phi i64 [ 1, %.lr.ph98.preheader ], [ %indvars.iv.next132.1, %54 ]
  %.07796.unr = phi i32 [ 0, %.lr.ph98.preheader ], [ %.178.1, %54 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge99, label %.lr.ph98.epil

.lr.ph98.epil:                                    ; preds = %._crit_edge99.loopexit.unr-lcssa
  %27 = getelementptr inbounds [29 x i32], ptr @pos, i64 0, i64 %indvars.iv131.unr
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %.not84.epil = icmp eq i32 %28, -1
  br i1 %.not84.epil, label %._crit_edge99, label %29

29:                                               ; preds = %.lr.ph98.epil
  %30 = getelementptr inbounds [29 x i32], ptr @pL, i64 0, i64 %indvars.iv131.unr
  store i32 %.07796.unr, ptr %30, align 4, !tbaa !5
  %31 = sext i32 %.07796.unr to i64
  %32 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %31
  %33 = trunc nuw nsw i64 %indvars.iv131.unr to i32
  store i32 %33, ptr %32, align 4, !tbaa !5
  br label %._crit_edge99

._crit_edge99:                                    ; preds = %._crit_edge99.loopexit.unr-lcssa, %29, %.lr.ph98.epil, %.preheader89
  %.077.lcssa = phi i32 [ 0, %.preheader89 ], [ %.178.lcssa.ph, %._crit_edge99.loopexit.unr-lcssa ], [ %33, %29 ], [ %.07796.unr, %.lr.ph98.epil ]
  %34 = sext i32 %.pre152 to i64
  %35 = getelementptr inbounds [29 x i32], ptr @pL, i64 0, i64 %34
  store i32 %.077.lcssa, ptr %35, align 4, !tbaa !5
  %36 = sext i32 %.077.lcssa to i64
  %37 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %36
  store i32 %.pre152, ptr %37, align 4, !tbaa !5
  %38 = icmp sgt i32 %14, 0
  br i1 %38, label %.lr.ph105.preheader, label %.preheader86

.lr.ph105.preheader:                              ; preds = %._crit_edge99
  %39 = zext nneg i32 %14 to i64
  br label %.lr.ph105

.lr.ph98:                                         ; preds = %54, %.lr.ph98.preheader.new
  %indvars.iv131 = phi i64 [ 1, %.lr.ph98.preheader.new ], [ %indvars.iv.next132.1, %54 ]
  %.07796 = phi i32 [ 0, %.lr.ph98.preheader.new ], [ %.178.1, %54 ]
  %niter = phi i64 [ 0, %.lr.ph98.preheader.new ], [ %niter.next.1, %54 ]
  %40 = getelementptr inbounds [29 x i32], ptr @pos, i64 0, i64 %indvars.iv131
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %.not84 = icmp eq i32 %41, -1
  br i1 %.not84, label %.lr.ph98.1, label %42

42:                                               ; preds = %.lr.ph98
  %43 = getelementptr inbounds [29 x i32], ptr @pL, i64 0, i64 %indvars.iv131
  store i32 %.07796, ptr %43, align 4, !tbaa !5
  %44 = sext i32 %.07796 to i64
  %45 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %44
  %46 = trunc nuw nsw i64 %indvars.iv131 to i32
  store i32 %46, ptr %45, align 4, !tbaa !5
  br label %.lr.ph98.1

.lr.ph98.1:                                       ; preds = %.lr.ph98, %42
  %.178 = phi i32 [ %46, %42 ], [ %.07796, %.lr.ph98 ]
  %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1
  %47 = getelementptr inbounds [29 x i32], ptr @pos, i64 0, i64 %indvars.iv.next132
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %.not84.1 = icmp eq i32 %48, -1
  br i1 %.not84.1, label %54, label %49

49:                                               ; preds = %.lr.ph98.1
  %50 = getelementptr inbounds [29 x i32], ptr @pL, i64 0, i64 %indvars.iv.next132
  store i32 %.178, ptr %50, align 4, !tbaa !5
  %51 = sext i32 %.178 to i64
  %52 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %51
  %53 = trunc nuw nsw i64 %indvars.iv.next132 to i32
  store i32 %53, ptr %52, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %49, %.lr.ph98.1
  %.178.1 = phi i32 [ %53, %49 ], [ %.178, %.lr.ph98.1 ]
  %indvars.iv.next132.1 = add nuw nsw i64 %indvars.iv131, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge99.loopexit.unr-lcssa, label %.lr.ph98, !llvm.loop !12

.preheader88:                                     ; preds = %71
  %.not = icmp eq i32 %14, 1
  br i1 %.not, label %.preheader86, label %.preheader87

.lr.ph105:                                        ; preds = %.lr.ph105.preheader, %71
  %indvars.iv134 = phi i64 [ %39, %.lr.ph105.preheader ], [ %indvars.iv.next135, %71 ]
  %indvars.iv.next135 = add nsw i64 %indvars.iv134, -1
  %55 = getelementptr inbounds [100001 x i32], ptr @b, i64 0, i64 %indvars.iv.next135
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = getelementptr inbounds [100001 x i32], ptr @eq, i64 0, i64 %indvars.iv.next135
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = sext i32 %56 to i64
  %60 = getelementptr inbounds [29 x i32], ptr @pos, i64 0, i64 %59
  store i32 %58, ptr %60, align 4, !tbaa !5
  %61 = icmp eq i32 %58, -1
  %62 = getelementptr inbounds [29 x i32], ptr @pL, i64 0, i64 %59
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %59
  %65 = load i32, ptr %64, align 4, !tbaa !5
  br i1 %61, label %66, label %.lr.ph105._crit_edge

.lr.ph105._crit_edge:                             ; preds = %.lr.ph105
  %.pre149 = sext i32 %63 to i64
  %.pre150 = sext i32 %65 to i64
  br label %71

66:                                               ; preds = %.lr.ph105
  %67 = sext i32 %65 to i64
  %68 = getelementptr inbounds [29 x i32], ptr @pL, i64 0, i64 %67
  store i32 %63, ptr %68, align 4, !tbaa !5
  %69 = sext i32 %63 to i64
  %70 = getelementptr inbounds [29 x i32], ptr @pR, i64 0, i64 %69
  store i32 %65, ptr %70, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %.lr.ph105._crit_edge, %66
  %.pre-phi151 = phi i64 [ %.pre150, %.lr.ph105._crit_edge ], [ %67, %66 ]
  %.pre-phi = phi i64 [ %.pre149, %.lr.ph105._crit_edge ], [ %69, %66 ]
  %72 = getelementptr inbounds [29 x i32], ptr @pos, i64 0, i64 %.pre-phi
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = getelementptr inbounds [100001 x i32], ptr @les, i64 0, i64 %indvars.iv.next135
  store i32 %73, ptr %74, align 4, !tbaa !5
  %75 = getelementptr inbounds [29 x i32], ptr @pos, i64 0, i64 %.pre-phi151
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = getelementptr inbounds [100001 x i32], ptr @gre, i64 0, i64 %indvars.iv.next135
  store i32 %76, ptr %77, align 4, !tbaa !5
  %78 = icmp ugt i64 %indvars.iv134, 1
  br i1 %78, label %.lr.ph105, label %.preheader88, !llvm.loop !13

.preheader87:                                     ; preds = %.preheader88, %.critedge
  %indvars.iv137 = phi i64 [ %indvars.iv.next138, %.critedge ], [ 1, %.preheader88 ]
  %.070113 = phi i32 [ %spec.select, %.critedge ], [ 0, %.preheader88 ]
  %.not83106 = icmp eq i32 %.070113, 0
  br i1 %.not83106, label %.critedge, label %.lr.ph108

.lr.ph108:                                        ; preds = %.preheader87
  %79 = getelementptr inbounds i32, ptr @b, i64 %indvars.iv137
  br label %82

.preheader86:                                     ; preds = %.critedge, %._crit_edge99, %.preheader88
  %80 = load i32, ptr @n, align 4, !tbaa !5
  %81 = icmp sgt i32 %80, 0
  br i1 %81, label %.preheader, label %._crit_edge122

82:                                               ; preds = %.lr.ph108, %87
  %.171107 = phi i32 [ %.070113, %.lr.ph108 ], [ %89, %87 ]
  %83 = sext i32 %.171107 to i64
  %84 = sub nsw i64 0, %83
  %85 = getelementptr inbounds i32, ptr %79, i64 %84
  %86 = tail call noundef zeroext i1 @_Z5matchiPi(i32 noundef %.171107, ptr noundef nonnull %85)
  br i1 %86, label %.critedge, label %87

87:                                               ; preds = %82
  %88 = getelementptr inbounds [100001 x i32], ptr @fail, i64 0, i64 %83
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %.not83 = icmp eq i32 %89, 0
  br i1 %.not83, label %.critedge, label %82, !llvm.loop !14

.critedge:                                        ; preds = %82, %87, %.preheader87
  %.171.lcssa = phi i32 [ 0, %.preheader87 ], [ 0, %87 ], [ %.171107, %82 ]
  %90 = getelementptr inbounds i32, ptr @b, i64 %indvars.iv137
  %91 = sext i32 %.171.lcssa to i64
  %92 = sub nsw i64 0, %91
  %93 = getelementptr inbounds i32, ptr %90, i64 %92
  %94 = tail call noundef zeroext i1 @_Z5matchiPi(i32 noundef %.171.lcssa, ptr noundef nonnull %93)
  %95 = zext i1 %94 to i32
  %spec.select = add nsw i32 %.171.lcssa, %95
  %indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1
  %96 = getelementptr inbounds [100001 x i32], ptr @fail, i64 0, i64 %indvars.iv.next138
  store i32 %spec.select, ptr %96, align 4, !tbaa !5
  %97 = load i32, ptr @m, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = icmp slt i64 %indvars.iv.next138, %98
  br i1 %99, label %.preheader87, label %.preheader86, !llvm.loop !15

.preheader:                                       ; preds = %.preheader86, %.critedge2._crit_edge
  %indvars.iv140 = phi i64 [ %120, %.critedge2._crit_edge ], [ 0, %.preheader86 ]
  %.068121 = phi i32 [ %.3, %.critedge2._crit_edge ], [ 0, %.preheader86 ]
  %.not82114 = icmp eq i32 %.068121, 0
  br i1 %.not82114, label %.critedge2, label %.lr.ph116

.lr.ph116:                                        ; preds = %.preheader
  %100 = getelementptr inbounds i32, ptr @a, i64 %indvars.iv140
  br label %104

._crit_edge122:                                   ; preds = %.critedge2._crit_edge, %.preheader86
  %101 = load i32, ptr @cnt, align 4, !tbaa !5
  tail call void @_ZN6fastIO14Ostream_fwrite5writeEic(ptr noundef nonnull align 8 dereferenceable(24) @_ZN6fastIO7OstreamE, i32 noundef %101, i8 noundef signext 10)
  %102 = load i32, ptr @cnt, align 4, !tbaa !5
  %103 = icmp sgt i32 %102, 0
  br i1 %103, label %.lr.ph125, label %._crit_edge126

104:                                              ; preds = %.lr.ph116, %109
  %.1115 = phi i32 [ %.068121, %.lr.ph116 ], [ %111, %109 ]
  %105 = sext i32 %.1115 to i64
  %106 = sub nsw i64 0, %105
  %107 = getelementptr inbounds i32, ptr %100, i64 %106
  %108 = tail call noundef zeroext i1 @_Z5matchiPi(i32 noundef %.1115, ptr noundef nonnull %107)
  br i1 %108, label %.critedge2, label %109

109:                                              ; preds = %104
  %110 = getelementptr inbounds [100001 x i32], ptr @fail, i64 0, i64 %105
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %.not82 = icmp eq i32 %111, 0
  br i1 %.not82, label %.critedge2, label %104, !llvm.loop !16

.critedge2:                                       ; preds = %104, %109, %.preheader
  %.1.lcssa = phi i32 [ 0, %.preheader ], [ 0, %109 ], [ %.1115, %104 ]
  %112 = getelementptr inbounds i32, ptr @a, i64 %indvars.iv140
  %113 = sext i32 %.1.lcssa to i64
  %114 = sub nsw i64 0, %113
  %115 = getelementptr inbounds i32, ptr %112, i64 %114
  %116 = tail call noundef zeroext i1 @_Z5matchiPi(i32 noundef %.1.lcssa, ptr noundef nonnull %115)
  %117 = zext i1 %116 to i32
  %spec.select85 = add nsw i32 %.1.lcssa, %117
  %118 = load i32, ptr @m, align 4, !tbaa !5
  %119 = icmp eq i32 %spec.select85, %118
  %120 = add nuw nsw i64 %indvars.iv140, 1
  br i1 %119, label %121, label %.critedge2._crit_edge

121:                                              ; preds = %.critedge2
  %122 = trunc nuw nsw i64 %120 to i32
  %123 = sub i32 %122, %spec.select85
  %124 = load i32, ptr @cnt, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr @cnt, align 4, !tbaa !5
  %126 = sext i32 %124 to i64
  %127 = getelementptr inbounds [100001 x i32], ptr @ans, i64 0, i64 %126
  store i32 %123, ptr %127, align 4, !tbaa !5
  %128 = sext i32 %spec.select85 to i64
  %129 = getelementptr inbounds [100001 x i32], ptr @fail, i64 0, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !5
  br label %.critedge2._crit_edge

.critedge2._crit_edge:                            ; preds = %.critedge2, %121
  %.3 = phi i32 [ %130, %121 ], [ %spec.select85, %.critedge2 ]
  %131 = load i32, ptr @n, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = icmp slt i64 %120, %132
  br i1 %133, label %.preheader, label %._crit_edge122, !llvm.loop !17

._crit_edge126:                                   ; preds = %.lr.ph125, %._crit_edge122
  ret i32 0

.lr.ph125:                                        ; preds = %._crit_edge122, %.lr.ph125
  %indvars.iv143 = phi i64 [ %indvars.iv.next144, %.lr.ph125 ], [ 0, %._crit_edge122 ]
  %134 = phi i32 [ %144, %.lr.ph125 ], [ %102, %._crit_edge122 ]
  %135 = getelementptr inbounds [100001 x i32], ptr @ans, i64 0, i64 %indvars.iv143
  %136 = load i32, ptr %135, align 4, !tbaa !5
  %137 = add nsw i32 %136, 1
  %138 = add nsw i32 %134, -1
  %139 = zext i32 %138 to i64
  %140 = icmp eq i64 %indvars.iv143, %139
  %141 = zext i1 %140 to i64
  %142 = getelementptr inbounds [3 x i8], ptr @.str, i64 0, i64 %141
  %143 = load i8, ptr %142, align 1, !tbaa !18
  tail call void @_ZN6fastIO14Ostream_fwrite5writeEic(ptr noundef nonnull align 8 dereferenceable(24) @_ZN6fastIO7OstreamE, i32 noundef %137, i8 noundef signext %143)
  %indvars.iv.next144 = add nuw nsw i64 %indvars.iv143, 1
  %144 = load i32, ptr @cnt, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = icmp slt i64 %indvars.iv.next144, %145
  br i1 %146, label %.lr.ph125, label %._crit_edge126, !llvm.loop !19
}

; 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: mustprogress uwtable
declare dso_local void @_ZN6fastIO14Ostream_fwrite5writeEic(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i8 noundef signext) local_unnamed_addr #4 align 2

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

!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}
!18 = !{!7, !7, i64 0}
!19 = distinct !{!19, !10}


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