; LLVM IR from tangjz/acm-icpc :: 51nod (1336)

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

@N = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@S = external dso_local global i32, align 4
@T = external dso_local global i32, align 4
@lnk = external dso_local global [210 x i32], align 16
@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@l = external dso_local global [210 x i32], align 16
@r = external dso_local global [210 x i32], align 16
@q = external dso_local global [210 x i32], align 16
@totx = external dso_local global i32, align 4
@quex = external dso_local global [210 x i32], align 16
@toty = external dso_local global i32, align 4
@quey = external dso_local global [210 x i32], align 16
@ban = external dso_local global [210 x [210 x i8]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1

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

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

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

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

; 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: mustprogress uwtable
declare dso_local noundef i32 @_Z3dfsii(i32 noundef, i32 noundef) #3

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca 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
  store i32 0, ptr %1, align 4
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %14

14:                                               ; preds = %326, %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 %333

18:                                               ; preds = %14
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef @m)
  store i32 0, ptr @toty, align 4, !tbaa !5
  store i32 0, ptr @totx, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %20

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

24:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %73

25:                                               ; preds = %20
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds i32, ptr @l, i64 %27
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds i32, ptr @r, i64 %30
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds i32, ptr @q, i64 %33
  %35 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %28, ptr noundef %31, ptr noundef %34)
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [210 x i32], ptr @l, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = load i32, ptr @totx, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr @totx, align 4, !tbaa !5
  %42 = sext i32 %40 to i64
  %43 = getelementptr inbounds [210 x i32], ptr @quex, i64 0, i64 %42
  store i32 %39, ptr %43, align 4, !tbaa !5
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [210 x i32], ptr @r, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  %49 = load i32, ptr @totx, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr @totx, align 4, !tbaa !5
  %51 = sext i32 %49 to i64
  %52 = getelementptr inbounds [210 x i32], ptr @quex, i64 0, i64 %51
  store i32 %48, ptr %52, align 4, !tbaa !5
  %53 = load i32, ptr %2, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [210 x i32], ptr @q, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = load i32, ptr @toty, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr @toty, align 4, !tbaa !5
  %59 = sext i32 %57 to i64
  %60 = getelementptr inbounds [210 x i32], ptr @quey, i64 0, i64 %59
  store i32 %56, ptr %60, align 4, !tbaa !5
  %61 = load i32, ptr %2, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [210 x i32], ptr @q, i64 0, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  %66 = load i32, ptr @toty, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr @toty, align 4, !tbaa !5
  %68 = sext i32 %66 to i64
  %69 = getelementptr inbounds [210 x i32], ptr @quey, i64 0, i64 %68
  store i32 %65, ptr %69, align 4, !tbaa !5
  br label %70

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

73:                                               ; preds = %24
  %74 = load i32, ptr @totx, align 4, !tbaa !5
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr @totx, align 4, !tbaa !5
  %76 = sext i32 %74 to i64
  %77 = getelementptr inbounds [210 x i32], ptr @quex, i64 0, i64 %76
  store i32 1, ptr %77, align 4, !tbaa !5
  %78 = load i32, ptr @n, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  %80 = load i32, ptr @totx, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr @totx, align 4, !tbaa !5
  %82 = sext i32 %80 to i64
  %83 = getelementptr inbounds [210 x i32], ptr @quex, i64 0, i64 %82
  store i32 %79, ptr %83, align 4, !tbaa !5
  %84 = load i32, ptr @toty, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr @toty, align 4, !tbaa !5
  %86 = sext i32 %84 to i64
  %87 = getelementptr inbounds [210 x i32], ptr @quey, i64 0, i64 %86
  store i32 1, ptr %87, align 4, !tbaa !5
  %88 = load i32, ptr @n, align 4, !tbaa !5
  %89 = add nsw i32 %88, 1
  %90 = load i32, ptr @toty, align 4, !tbaa !5
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr @toty, align 4, !tbaa !5
  %92 = sext i32 %90 to i64
  %93 = getelementptr inbounds [210 x i32], ptr @quey, i64 0, i64 %92
  store i32 %89, ptr %93, align 4, !tbaa !5
  %94 = load i32, ptr @totx, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds i32, ptr @quex, i64 %95
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @quex, ptr noundef %96)
  %97 = load i32, ptr @totx, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds i32, ptr @quex, i64 %98
  %100 = call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef @quex, ptr noundef %99)
  %101 = ptrtoint ptr %100 to i64
  %102 = sub i64 %101, ptrtoint (ptr @quex to i64)
  %103 = sdiv exact i64 %102, 4
  %104 = trunc i64 %103 to i32
  store i32 %104, ptr @totx, align 4, !tbaa !5
  %105 = load i32, ptr @toty, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds i32, ptr @quey, i64 %106
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @quey, ptr noundef %107)
  %108 = load i32, ptr @toty, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds i32, ptr @quey, i64 %109
  %111 = call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef @quey, ptr noundef %110)
  %112 = ptrtoint ptr %111 to i64
  %113 = sub i64 %112, ptrtoint (ptr @quey to i64)
  %114 = sdiv exact i64 %113, 4
  %115 = trunc i64 %114 to i32
  store i32 %115, ptr @toty, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 16 @ban, i8 0, i64 44100, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %116

116:                                              ; preds = %224, %73
  %117 = load i32, ptr %3, align 4, !tbaa !5
  %118 = load i32, ptr @m, align 4, !tbaa !5
  %119 = icmp slt i32 %117, %118
  br i1 %119, label %121, label %120

120:                                              ; preds = %116
  store i32 7, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %227

121:                                              ; preds = %116
  %122 = load i32, ptr @totx, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds i32, ptr @quex, i64 %123
  %125 = load i32, ptr %3, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [210 x i32], ptr @l, i64 0, i64 %126
  %128 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef @quex, ptr noundef %124, ptr noundef nonnull align 4 dereferenceable(4) %127)
  %129 = ptrtoint ptr %128 to i64
  %130 = sub i64 %129, ptrtoint (ptr @quex to i64)
  %131 = sdiv exact i64 %130, 4
  %132 = trunc i64 %131 to i32
  %133 = load i32, ptr %3, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [210 x i32], ptr @l, i64 0, i64 %134
  store i32 %132, ptr %135, align 4, !tbaa !5
  %136 = load i32, ptr @totx, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds i32, ptr @quex, i64 %137
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %139 = load i32, ptr %3, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [210 x i32], ptr @r, i64 0, i64 %140
  %142 = load i32, ptr %141, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %5, align 4, !tbaa !5
  %144 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef @quex, ptr noundef %138, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %145 = ptrtoint ptr %144 to i64
  %146 = sub i64 %145, ptrtoint (ptr @quex to i64)
  %147 = sdiv exact i64 %146, 4
  %148 = trunc i64 %147 to i32
  %149 = load i32, ptr %3, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [210 x i32], ptr @r, i64 0, i64 %150
  store i32 %148, ptr %151, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  %152 = load i32, ptr @toty, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds i32, ptr @quey, i64 %153
  %155 = load i32, ptr %3, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [210 x i32], ptr @q, i64 0, i64 %156
  %158 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef @quey, ptr noundef %154, ptr noundef nonnull align 4 dereferenceable(4) %157)
  %159 = ptrtoint ptr %158 to i64
  %160 = sub i64 %159, ptrtoint (ptr @quey to i64)
  %161 = sdiv exact i64 %160, 4
  %162 = trunc i64 %161 to i32
  %163 = load i32, ptr %3, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [210 x i32], ptr @q, i64 0, i64 %164
  store i32 %162, ptr %165, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %166

166:                                              ; preds = %220, %121
  %167 = load i32, ptr %6, align 4, !tbaa !5
  %168 = load i32, ptr @totx, align 4, !tbaa !5
  %169 = sub nsw i32 %168, 1
  %170 = icmp slt i32 %167, %169
  br i1 %170, label %172, label %171

171:                                              ; preds = %166
  store i32 10, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %223

172:                                              ; preds = %166
  %173 = load i32, ptr %3, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [210 x i32], ptr @l, i64 0, i64 %174
  %176 = load i32, ptr %175, align 4, !tbaa !5
  %177 = load i32, ptr %6, align 4, !tbaa !5
  %178 = icmp sle i32 %176, %177
  br i1 %178, label %179, label %209

179:                                              ; preds = %172
  %180 = load i32, ptr %6, align 4, !tbaa !5
  %181 = load i32, ptr %3, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [210 x i32], ptr @r, i64 0, i64 %182
  %184 = load i32, ptr %183, align 4, !tbaa !5
  %185 = icmp slt i32 %180, %184
  br i1 %185, label %186, label %209

186:                                              ; preds = %179
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %187 = load i32, ptr %3, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [210 x i32], ptr @q, i64 0, i64 %188
  %190 = load i32, ptr %189, align 4, !tbaa !5
  %191 = add nsw i32 %190, 1
  store i32 %191, ptr %7, align 4, !tbaa !5
  br label %192

192:                                              ; preds = %205, %186
  %193 = load i32, ptr %7, align 4, !tbaa !5
  %194 = load i32, ptr @toty, align 4, !tbaa !5
  %195 = sub nsw i32 %194, 1
  %196 = icmp slt i32 %193, %195
  br i1 %196, label %198, label %197

197:                                              ; preds = %192
  store i32 13, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %208

198:                                              ; preds = %192
  %199 = load i32, ptr %6, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [210 x [210 x i8]], ptr @ban, i64 0, i64 %200
  %202 = load i32, ptr %7, align 4, !tbaa !5
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds [210 x i8], ptr %201, i64 0, i64 %203
  store i8 1, ptr %204, align 1, !tbaa !11
  br label %205

205:                                              ; preds = %198
  %206 = load i32, ptr %7, align 4, !tbaa !5
  %207 = add nsw i32 %206, 1
  store i32 %207, ptr %7, align 4, !tbaa !5
  br label %192, !llvm.loop !13

208:                                              ; preds = %197
  br label %219

209:                                              ; preds = %179, %172
  %210 = load i32, ptr %6, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [210 x [210 x i8]], ptr @ban, i64 0, i64 %211
  %213 = load i32, ptr %3, align 4, !tbaa !5
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [210 x i32], ptr @q, i64 0, i64 %214
  %216 = load i32, ptr %215, align 4, !tbaa !5
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [210 x i8], ptr %212, i64 0, i64 %217
  store i8 1, ptr %218, align 1, !tbaa !11
  br label %219

219:                                              ; preds = %209, %208
  br label %220

220:                                              ; preds = %219
  %221 = load i32, ptr %6, align 4, !tbaa !5
  %222 = add nsw i32 %221, 1
  store i32 %222, ptr %6, align 4, !tbaa !5
  br label %166, !llvm.loop !14

223:                                              ; preds = %171
  br label %224

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

227:                                              ; preds = %120
  %228 = load i32, ptr @totx, align 4, !tbaa !5
  %229 = load i32, ptr @toty, align 4, !tbaa !5
  %230 = add nsw i32 %228, %229
  %231 = add nsw i32 %230, 2
  store i32 %231, ptr @N, align 4, !tbaa !5
  store i32 0, ptr @M, align 4, !tbaa !5
  %232 = load i32, ptr @N, align 4, !tbaa !5
  %233 = sub nsw i32 %232, 2
  store i32 %233, ptr @S, align 4, !tbaa !5
  %234 = load i32, ptr @N, align 4, !tbaa !5
  %235 = sub nsw i32 %234, 1
  store i32 %235, ptr @T, align 4, !tbaa !5
  %236 = load i32, ptr @N, align 4, !tbaa !5
  %237 = sext i32 %236 to i64
  %238 = mul i64 %237, 4
  call void @llvm.memset.p0.i64(ptr align 16 @lnk, i8 -1, i64 %238, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %239

239:                                              ; preds = %283, %227
  %240 = load i32, ptr %8, align 4, !tbaa !5
  %241 = load i32, ptr @totx, align 4, !tbaa !5
  %242 = sub nsw i32 %241, 1
  %243 = icmp slt i32 %240, %242
  br i1 %243, label %245, label %244

244:                                              ; preds = %239
  store i32 16, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %286

245:                                              ; preds = %239
  %246 = load i32, ptr @S, align 4, !tbaa !5
  %247 = load i32, ptr %8, align 4, !tbaa !5
  %248 = load i32, ptr %8, align 4, !tbaa !5
  %249 = add nsw i32 %248, 1
  %250 = sext i32 %249 to i64
  %251 = getelementptr inbounds [210 x i32], ptr @quex, i64 0, i64 %250
  %252 = load i32, ptr %251, align 4, !tbaa !5
  %253 = load i32, ptr %8, align 4, !tbaa !5
  %254 = sext i32 %253 to i64
  %255 = getelementptr inbounds [210 x i32], ptr @quex, i64 0, i64 %254
  %256 = load i32, ptr %255, align 4, !tbaa !5
  %257 = sub nsw i32 %252, %256
  call void @_Z7addEdgeiii(i32 noundef %246, i32 noundef %247, i32 noundef %257)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %258

258:                                              ; preds = %279, %245
  %259 = load i32, ptr %9, align 4, !tbaa !5
  %260 = load i32, ptr @toty, align 4, !tbaa !5
  %261 = sub nsw i32 %260, 1
  %262 = icmp slt i32 %259, %261
  br i1 %262, label %264, label %263

263:                                              ; preds = %258
  store i32 19, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %282

264:                                              ; preds = %258
  %265 = load i32, ptr %8, align 4, !tbaa !5
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds [210 x [210 x i8]], ptr @ban, i64 0, i64 %266
  %268 = load i32, ptr %9, align 4, !tbaa !5
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds [210 x i8], ptr %267, i64 0, i64 %269
  %271 = load i8, ptr %270, align 1, !tbaa !11, !range !16, !noundef !17
  %272 = trunc i8 %271 to i1
  br i1 %272, label %278, label %273

273:                                              ; preds = %264
  %274 = load i32, ptr %8, align 4, !tbaa !5
  %275 = load i32, ptr @totx, align 4, !tbaa !5
  %276 = load i32, ptr %9, align 4, !tbaa !5
  %277 = add nsw i32 %275, %276
  call void @_Z7addEdgeiii(i32 noundef %274, i32 noundef %277, i32 noundef 1061109567)
  br label %278

278:                                              ; preds = %273, %264
  br label %279

279:                                              ; preds = %278
  %280 = load i32, ptr %9, align 4, !tbaa !5
  %281 = add nsw i32 %280, 1
  store i32 %281, ptr %9, align 4, !tbaa !5
  br label %258, !llvm.loop !18

282:                                              ; preds = %263
  br label %283

283:                                              ; preds = %282
  %284 = load i32, ptr %8, align 4, !tbaa !5
  %285 = add nsw i32 %284, 1
  store i32 %285, ptr %8, align 4, !tbaa !5
  br label %239, !llvm.loop !19

286:                                              ; preds = %244
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %287

287:                                              ; preds = %308, %286
  %288 = load i32, ptr %10, align 4, !tbaa !5
  %289 = load i32, ptr @toty, align 4, !tbaa !5
  %290 = sub nsw i32 %289, 1
  %291 = icmp slt i32 %288, %290
  br i1 %291, label %293, label %292

292:                                              ; preds = %287
  store i32 22, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %311

293:                                              ; preds = %287
  %294 = load i32, ptr @totx, align 4, !tbaa !5
  %295 = load i32, ptr %10, align 4, !tbaa !5
  %296 = add nsw i32 %294, %295
  %297 = load i32, ptr @T, align 4, !tbaa !5
  %298 = load i32, ptr %10, align 4, !tbaa !5
  %299 = add nsw i32 %298, 1
  %300 = sext i32 %299 to i64
  %301 = getelementptr inbounds [210 x i32], ptr @quey, i64 0, i64 %300
  %302 = load i32, ptr %301, align 4, !tbaa !5
  %303 = load i32, ptr %10, align 4, !tbaa !5
  %304 = sext i32 %303 to i64
  %305 = getelementptr inbounds [210 x i32], ptr @quey, i64 0, i64 %304
  %306 = load i32, ptr %305, align 4, !tbaa !5
  %307 = sub nsw i32 %302, %306
  call void @_Z7addEdgeiii(i32 noundef %296, i32 noundef %297, i32 noundef %307)
  br label %308

308:                                              ; preds = %293
  %309 = load i32, ptr %10, align 4, !tbaa !5
  %310 = add nsw i32 %309, 1
  store i32 %310, ptr %10, align 4, !tbaa !5
  br label %287, !llvm.loop !20

311:                                              ; preds = %292
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %312

312:                                              ; preds = %325, %311
  %313 = call noundef zeroext i1 @_Z3bfsv()
  br i1 %313, label %314, label %326

314:                                              ; preds = %312
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  br label %315

315:                                              ; preds = %321, %314
  %316 = load i32, ptr @S, align 4, !tbaa !5
  %317 = call noundef i32 @_Z3dfsii(i32 noundef %316, i32 noundef 1061109567)
  store i32 %317, ptr %12, align 4, !tbaa !5
  %318 = icmp ne i32 %317, 0
  br i1 %318, label %320, label %319

319:                                              ; preds = %315
  store i32 27, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %325

320:                                              ; preds = %315
  br label %321

321:                                              ; preds = %320
  %322 = load i32, ptr %12, align 4, !tbaa !5
  %323 = load i32, ptr %11, align 4, !tbaa !5
  %324 = add nsw i32 %323, %322
  store i32 %324, ptr %11, align 4, !tbaa !5
  br label %315, !llvm.loop !21

325:                                              ; preds = %319
  br label %312, !llvm.loop !22

326:                                              ; preds = %312
  %327 = load i32, ptr %11, align 4, !tbaa !5
  %328 = load i32, ptr @n, align 4, !tbaa !5
  %329 = icmp eq i32 %327, %328
  %330 = zext i1 %329 to i64
  %331 = select i1 %329, ptr @.str.3, ptr @.str.4
  %332 = call i32 @puts(ptr noundef %331)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %14, !llvm.loop !23

333:                                              ; preds = %14
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef, ptr noundef) #6

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

declare i32 @puts(ptr noundef) #5

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

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

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

@N = external dso_local local_unnamed_addr global i32, align 4
@M = external dso_local local_unnamed_addr global i32, align 4
@S = external dso_local local_unnamed_addr global i32, align 4
@T = external dso_local local_unnamed_addr global i32, align 4
@lnk = external dso_local local_unnamed_addr global [210 x i32], align 16
@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@l = external dso_local global [210 x i32], align 16
@r = external dso_local global [210 x i32], align 16
@q = external dso_local global [210 x i32], align 16
@totx = external dso_local local_unnamed_addr global i32, align 4
@quex = external dso_local global [210 x i32], align 16
@toty = external dso_local local_unnamed_addr global i32, align 4
@quey = external dso_local global [210 x i32], align 16
@ban = external dso_local local_unnamed_addr global [210 x [210 x i8]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z3dfsii(i32 noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 {
  %1 = alloca i32, align 4
  %2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %3 = load i32, ptr @t, align 4, !tbaa !5
  %4 = add nsw i32 %3, -1
  store i32 %4, ptr @t, align 4, !tbaa !5
  %.not87 = icmp eq i32 %3, 0
  br i1 %.not87, label %._crit_edge90, label %.lr.ph89

.lr.ph89:                                         ; preds = %0, %._crit_edge86
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @m)
  store i32 0, ptr @toty, align 4, !tbaa !5
  store i32 0, ptr @totx, align 4, !tbaa !5
  %6 = load i32, ptr @m, align 4, !tbaa !5
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph89
  %8 = phi i32 [ 0, %.lr.ph89 ], [ %67, %.lr.ph ]
  %9 = phi i32 [ 0, %.lr.ph89 ], [ %58, %.lr.ph ]
  %10 = add nsw i32 %9, 1
  %11 = sext i32 %9 to i64
  %12 = getelementptr inbounds [210 x i32], ptr @quex, i64 0, i64 %11
  store i32 1, ptr %12, align 4, !tbaa !5
  %13 = load i32, ptr @n, align 4, !tbaa !5
  %14 = add nsw i32 %13, 1
  %15 = add nsw i32 %9, 2
  store i32 %15, ptr @totx, align 4, !tbaa !5
  %16 = sext i32 %10 to i64
  %17 = getelementptr inbounds [210 x i32], ptr @quex, i64 0, i64 %16
  store i32 %14, ptr %17, align 4, !tbaa !5
  %18 = add nsw i32 %8, 1
  %19 = sext i32 %8 to i64
  %20 = getelementptr inbounds [210 x i32], ptr @quey, i64 0, i64 %19
  store i32 1, ptr %20, align 4, !tbaa !5
  %21 = add nsw i32 %8, 2
  store i32 %21, ptr @toty, align 4, !tbaa !5
  %22 = sext i32 %18 to i64
  %23 = getelementptr inbounds [210 x i32], ptr @quey, i64 0, i64 %22
  store i32 %14, ptr %23, align 4, !tbaa !5
  %24 = sext i32 %15 to i64
  %25 = getelementptr inbounds i32, ptr @quex, i64 %24
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @quex, ptr noundef nonnull %25)
  %26 = load i32, ptr @totx, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds i32, ptr @quex, i64 %27
  %29 = call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef nonnull @quex, ptr noundef nonnull %28)
  %30 = ptrtoint ptr %29 to i64
  %31 = sub i64 %30, ptrtoint (ptr @quex to i64)
  %32 = lshr exact i64 %31, 2
  %33 = trunc i64 %32 to i32
  store i32 %33, ptr @totx, align 4, !tbaa !5
  %34 = load i32, ptr @toty, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds i32, ptr @quey, i64 %35
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @quey, ptr noundef nonnull %36)
  %37 = load i32, ptr @toty, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds i32, ptr @quey, i64 %38
  %40 = call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef nonnull @quey, ptr noundef nonnull %39)
  %41 = ptrtoint ptr %40 to i64
  %42 = sub i64 %41, ptrtoint (ptr @quey to i64)
  %43 = lshr exact i64 %42, 2
  %44 = trunc i64 %43 to i32
  store i32 %44, ptr @toty, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(44100) @ban, i8 0, i64 44100, i1 false)
  %45 = load i32, ptr @m, align 4, !tbaa !5
  %46 = icmp sgt i32 %45, 0
  %.pre114 = load i32, ptr @totx, align 4, !tbaa !5
  br i1 %46, label %.lr.ph75, label %._crit_edge76

.lr.ph:                                           ; preds = %.lr.ph89, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph89 ]
  %47 = getelementptr inbounds i32, ptr @l, i64 %indvars.iv
  %48 = getelementptr inbounds i32, ptr @r, i64 %indvars.iv
  %49 = getelementptr inbounds i32, ptr @q, i64 %indvars.iv
  %50 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %47, ptr noundef nonnull %48, ptr noundef nonnull %49)
  %51 = load i32, ptr %47, align 4, !tbaa !5
  %52 = load i32, ptr @totx, align 4, !tbaa !5
  %53 = add nsw i32 %52, 1
  %54 = sext i32 %52 to i64
  %55 = getelementptr inbounds [210 x i32], ptr @quex, i64 0, i64 %54
  store i32 %51, ptr %55, align 4, !tbaa !5
  %56 = load i32, ptr %48, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  %58 = add nsw i32 %52, 2
  store i32 %58, ptr @totx, align 4, !tbaa !5
  %59 = sext i32 %53 to i64
  %60 = getelementptr inbounds [210 x i32], ptr @quex, i64 0, i64 %59
  store i32 %57, ptr %60, align 4, !tbaa !5
  %61 = load i32, ptr %49, align 4, !tbaa !5
  %62 = load i32, ptr @toty, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  %64 = sext i32 %62 to i64
  %65 = getelementptr inbounds [210 x i32], ptr @quey, i64 0, i64 %64
  store i32 %61, ptr %65, align 4, !tbaa !5
  %66 = add nsw i32 %61, 1
  %67 = add nsw i32 %62, 2
  store i32 %67, ptr @toty, align 4, !tbaa !5
  %68 = sext i32 %63 to i64
  %69 = getelementptr inbounds [210 x i32], ptr @quey, i64 0, i64 %68
  store i32 %66, ptr %69, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %70 = load i32, ptr @m, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = icmp slt i64 %indvars.iv.next, %71
  br i1 %72, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge76.loopexit:                           ; preds = %._crit_edge72
  %.pre = load i32, ptr @toty, align 4, !tbaa !5
  br label %._crit_edge76

._crit_edge76:                                    ; preds = %._crit_edge76.loopexit, %._crit_edge
  %73 = phi i32 [ %.pre, %._crit_edge76.loopexit ], [ %44, %._crit_edge ]
  %74 = phi i32 [ %110, %._crit_edge76.loopexit ], [ %.pre114, %._crit_edge ]
  %75 = add nsw i32 %73, %74
  %76 = add nsw i32 %75, 2
  store i32 %76, ptr @N, align 4, !tbaa !5
  store i32 0, ptr @M, align 4, !tbaa !5
  store i32 %75, ptr @S, align 4, !tbaa !5
  %77 = add nsw i32 %75, 1
  store i32 %77, ptr @T, align 4, !tbaa !5
  %78 = sext i32 %76 to i64
  %79 = shl nsw i64 %78, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @lnk, i8 -1, i64 %79, i1 false)
  %80 = icmp sgt i32 %74, 1
  br i1 %80, label %.lr.ph82, label %.preheader63

.lr.ph75:                                         ; preds = %._crit_edge, %._crit_edge72
  %81 = phi i32 [ %110, %._crit_edge72 ], [ %.pre114, %._crit_edge ]
  %indvars.iv102 = phi i64 [ %indvars.iv.next103, %._crit_edge72 ], [ 0, %._crit_edge ]
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds i32, ptr @quex, i64 %82
  %84 = getelementptr inbounds [210 x i32], ptr @l, i64 0, i64 %indvars.iv102
  %85 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef nonnull @quex, ptr noundef nonnull %83, ptr noundef nonnull align 4 dereferenceable(4) %84)
  %86 = ptrtoint ptr %85 to i64
  %87 = sub i64 %86, ptrtoint (ptr @quex to i64)
  %88 = lshr exact i64 %87, 2
  %89 = trunc i64 %88 to i32
  store i32 %89, ptr %84, align 4, !tbaa !5
  %90 = load i32, ptr @totx, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds i32, ptr @quex, i64 %91
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  %93 = getelementptr inbounds [210 x i32], ptr @r, i64 0, i64 %indvars.iv102
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %1, align 4, !tbaa !5
  %96 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef nonnull @quex, ptr noundef nonnull %92, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %97 = ptrtoint ptr %96 to i64
  %98 = sub i64 %97, ptrtoint (ptr @quex to i64)
  %99 = lshr exact i64 %98, 2
  %100 = trunc i64 %99 to i32
  store i32 %100, ptr %93, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  %101 = load i32, ptr @toty, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds i32, ptr @quey, i64 %102
  %104 = getelementptr inbounds [210 x i32], ptr @q, i64 0, i64 %indvars.iv102
  %105 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef nonnull @quey, ptr noundef nonnull %103, ptr noundef nonnull align 4 dereferenceable(4) %104)
  %106 = ptrtoint ptr %105 to i64
  %107 = sub i64 %106, ptrtoint (ptr @quey to i64)
  %108 = lshr i64 %107, 2
  %109 = trunc i64 %108 to i32
  store i32 %109, ptr %104, align 4, !tbaa !5
  %110 = load i32, ptr @totx, align 4, !tbaa !5
  %111 = add i32 %110, -1
  %112 = icmp sgt i32 %110, 1
  br i1 %112, label %.lr.ph71, label %._crit_edge72

.lr.ph71:                                         ; preds = %.lr.ph75
  %113 = load i32, ptr %84, align 4, !tbaa !5
  %114 = load i32, ptr @toty, align 4
  %.fr = freeze i32 %114
  %115 = add i32 %.fr, -1
  %.05365 = add i32 %109, 1
  %116 = icmp slt i32 %.05365, %115
  %sext = shl i64 %107, 30
  %117 = ashr i64 %sext, 32
  br i1 %116, label %.lr.ph71.split.us.preheader, label %.lr.ph71.split.preheader

.lr.ph71.split.preheader:                         ; preds = %.lr.ph71
  %118 = sext i32 %113 to i64
  %wide.trip.count = zext i32 %111 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %119 = icmp eq i32 %111, 1
  br i1 %119, label %._crit_edge72.loopexit127.unr-lcssa, label %.lr.ph71.split.preheader.new

.lr.ph71.split.preheader.new:                     ; preds = %.lr.ph71.split.preheader
  %unroll_iter = and i64 %wide.trip.count, 4294967294
  br label %.lr.ph71.split

.lr.ph71.split.us.preheader:                      ; preds = %.lr.ph71
  %120 = sext i32 %.05365 to i64
  %121 = add i32 %109, 2
  %smax = call i32 @llvm.smax.i32(i32 %115, i32 %121)
  %122 = add i32 %smax, -2
  %123 = sub i32 %122, %109
  %124 = zext i32 %123 to i64
  %125 = add nuw nsw i64 %124, 1
  %126 = sext i32 %113 to i64
  %wide.trip.count100 = zext i32 %111 to i64
  %invariant.gep = getelementptr i8, ptr @ban, i64 %120
  %xtraiter134 = and i64 %wide.trip.count100, 1
  %127 = icmp eq i32 %111, 1
  br i1 %127, label %._crit_edge72.loopexit.unr-lcssa, label %.lr.ph71.split.us.preheader.new

.lr.ph71.split.us.preheader.new:                  ; preds = %.lr.ph71.split.us.preheader
  %unroll_iter136 = and i64 %wide.trip.count100, 4294967294
  br label %.lr.ph71.split.us

.lr.ph71.split.us:                                ; preds = %..loopexit_crit_edge.us.1, %.lr.ph71.split.us.preheader.new
  %indvar = phi i64 [ 0, %.lr.ph71.split.us.preheader.new ], [ %indvar.next.1, %..loopexit_crit_edge.us.1 ]
  %niter137 = phi i64 [ 0, %.lr.ph71.split.us.preheader.new ], [ %niter137.next.1, %..loopexit_crit_edge.us.1 ]
  %128 = mul nuw nsw i64 %indvar, 210
  %gep = getelementptr i8, ptr %invariant.gep, i64 %128
  %.not58.us = icmp slt i64 %indvar, %126
  br i1 %.not58.us, label %133, label %129

129:                                              ; preds = %.lr.ph71.split.us
  %130 = load i32, ptr %93, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = icmp slt i64 %indvar, %131
  br i1 %132, label %.preheader.us, label %133

133:                                              ; preds = %129, %.lr.ph71.split.us
  %134 = getelementptr inbounds [210 x [210 x i8]], ptr @ban, i64 0, i64 %indvar, i64 %117
  store i8 1, ptr %134, align 1, !tbaa !11
  br label %..loopexit_crit_edge.us

..loopexit_crit_edge.us:                          ; preds = %.preheader.us, %133
  %indvar.next = or disjoint i64 %indvar, 1
  %135 = mul nuw nsw i64 %indvar.next, 210
  %gep.1 = getelementptr i8, ptr %invariant.gep, i64 %135
  %.not58.us.1 = icmp slt i64 %indvar.next, %126
  br i1 %.not58.us.1, label %140, label %136

136:                                              ; preds = %..loopexit_crit_edge.us
  %137 = load i32, ptr %93, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = icmp slt i64 %indvar.next, %138
  br i1 %139, label %.preheader.us.1, label %140

.preheader.us.1:                                  ; preds = %136
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %gep.1, i8 1, i64 %125, i1 false), !tbaa !11
  br label %..loopexit_crit_edge.us.1

140:                                              ; preds = %136, %..loopexit_crit_edge.us
  %141 = getelementptr inbounds [210 x [210 x i8]], ptr @ban, i64 0, i64 %indvar.next, i64 %117
  store i8 1, ptr %141, align 1, !tbaa !11
  br label %..loopexit_crit_edge.us.1

..loopexit_crit_edge.us.1:                        ; preds = %140, %.preheader.us.1
  %indvar.next.1 = add nuw nsw i64 %indvar, 2
  %niter137.next.1 = add i64 %niter137, 2
  %niter137.ncmp.1 = icmp eq i64 %niter137.next.1, %unroll_iter136
  br i1 %niter137.ncmp.1, label %._crit_edge72.loopexit.unr-lcssa, label %.lr.ph71.split.us, !llvm.loop !13

.preheader.us:                                    ; preds = %129
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %gep, i8 1, i64 %125, i1 false), !tbaa !11
  br label %..loopexit_crit_edge.us

._crit_edge72.loopexit.unr-lcssa:                 ; preds = %..loopexit_crit_edge.us.1, %.lr.ph71.split.us.preheader
  %indvar.unr = phi i64 [ 0, %.lr.ph71.split.us.preheader ], [ %indvar.next.1, %..loopexit_crit_edge.us.1 ]
  %lcmp.mod135.not = icmp eq i64 %xtraiter134, 0
  br i1 %lcmp.mod135.not, label %._crit_edge72, label %.lr.ph71.split.us.epil

.lr.ph71.split.us.epil:                           ; preds = %._crit_edge72.loopexit.unr-lcssa
  %142 = mul nuw nsw i64 %indvar.unr, 210
  %gep.epil = getelementptr i8, ptr %invariant.gep, i64 %142
  %.not58.us.epil = icmp slt i64 %indvar.unr, %126
  br i1 %.not58.us.epil, label %147, label %143

143:                                              ; preds = %.lr.ph71.split.us.epil
  %144 = load i32, ptr %93, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = icmp slt i64 %indvar.unr, %145
  br i1 %146, label %.preheader.us.epil, label %147

.preheader.us.epil:                               ; preds = %143
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %gep.epil, i8 1, i64 %125, i1 false), !tbaa !11
  br label %._crit_edge72

147:                                              ; preds = %143, %.lr.ph71.split.us.epil
  %148 = getelementptr inbounds [210 x [210 x i8]], ptr @ban, i64 0, i64 %indvar.unr, i64 %117
  store i8 1, ptr %148, align 1, !tbaa !11
  br label %._crit_edge72

._crit_edge72.loopexit127.unr-lcssa:              ; preds = %.preheader.1, %.lr.ph71.split.preheader
  %indvars.iv93.unr = phi i64 [ 0, %.lr.ph71.split.preheader ], [ %indvars.iv.next94.1, %.preheader.1 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge72, label %.lr.ph71.split.epil

.lr.ph71.split.epil:                              ; preds = %._crit_edge72.loopexit127.unr-lcssa
  %.not58.epil = icmp slt i64 %indvars.iv93.unr, %118
  br i1 %.not58.epil, label %153, label %149

149:                                              ; preds = %.lr.ph71.split.epil
  %150 = load i32, ptr %93, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = icmp slt i64 %indvars.iv93.unr, %151
  br i1 %152, label %._crit_edge72, label %153

153:                                              ; preds = %149, %.lr.ph71.split.epil
  %154 = getelementptr inbounds [210 x [210 x i8]], ptr @ban, i64 0, i64 %indvars.iv93.unr, i64 %117
  store i8 1, ptr %154, align 1, !tbaa !11
  br label %._crit_edge72

._crit_edge72:                                    ; preds = %._crit_edge72.loopexit127.unr-lcssa, %153, %149, %._crit_edge72.loopexit.unr-lcssa, %147, %.preheader.us.epil, %.lr.ph75
  %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
  %155 = load i32, ptr @m, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = icmp slt i64 %indvars.iv.next103, %156
  br i1 %157, label %.lr.ph75, label %._crit_edge76.loopexit, !llvm.loop !14

.lr.ph71.split:                                   ; preds = %.preheader.1, %.lr.ph71.split.preheader.new
  %indvars.iv93 = phi i64 [ 0, %.lr.ph71.split.preheader.new ], [ %indvars.iv.next94.1, %.preheader.1 ]
  %niter = phi i64 [ 0, %.lr.ph71.split.preheader.new ], [ %niter.next.1, %.preheader.1 ]
  %.not58 = icmp slt i64 %indvars.iv93, %118
  br i1 %.not58, label %162, label %158

158:                                              ; preds = %.lr.ph71.split
  %159 = load i32, ptr %93, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = icmp slt i64 %indvars.iv93, %160
  br i1 %161, label %.preheader, label %162

162:                                              ; preds = %158, %.lr.ph71.split
  %163 = getelementptr inbounds [210 x [210 x i8]], ptr @ban, i64 0, i64 %indvars.iv93, i64 %117
  store i8 1, ptr %163, align 1, !tbaa !11
  br label %.preheader

.preheader:                                       ; preds = %158, %162
  %indvars.iv.next94 = or disjoint i64 %indvars.iv93, 1
  %.not58.1 = icmp slt i64 %indvars.iv.next94, %118
  br i1 %.not58.1, label %168, label %164

164:                                              ; preds = %.preheader
  %165 = load i32, ptr %93, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = icmp slt i64 %indvars.iv.next94, %166
  br i1 %167, label %.preheader.1, label %168

168:                                              ; preds = %164, %.preheader
  %169 = getelementptr inbounds [210 x [210 x i8]], ptr @ban, i64 0, i64 %indvars.iv.next94, i64 %117
  store i8 1, ptr %169, align 1, !tbaa !11
  br label %.preheader.1

.preheader.1:                                     ; preds = %168, %164
  %indvars.iv.next94.1 = add nuw nsw i64 %indvars.iv93, 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_edge72.loopexit127.unr-lcssa, label %.lr.ph71.split, !llvm.loop !13

.loopexit61:                                      ; preds = %194, %.lr.ph82
  %170 = phi i32 [ %184, %.lr.ph82 ], [ %195, %194 ]
  %171 = load i32, ptr @totx, align 4, !tbaa !5
  %172 = add nsw i32 %171, -1
  %173 = sext i32 %172 to i64
  %174 = icmp slt i64 %indvars.iv.next109, %173
  br i1 %174, label %.lr.ph82, label %.preheader63, !llvm.loop !15

.preheader63:                                     ; preds = %.loopexit61, %._crit_edge76
  %175 = phi i32 [ %73, %._crit_edge76 ], [ %170, %.loopexit61 ]
  %176 = icmp sgt i32 %175, 1
  br i1 %176, label %.lr.ph84, label %.preheader62

.lr.ph82:                                         ; preds = %._crit_edge76, %.loopexit61
  %indvars.iv108 = phi i64 [ %indvars.iv.next109, %.loopexit61 ], [ 0, %._crit_edge76 ]
  %177 = load i32, ptr @S, align 4, !tbaa !5
  %indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
  %178 = getelementptr inbounds [210 x i32], ptr @quex, i64 0, i64 %indvars.iv.next109
  %179 = load i32, ptr %178, align 4, !tbaa !5
  %180 = getelementptr inbounds [210 x i32], ptr @quex, i64 0, i64 %indvars.iv108
  %181 = load i32, ptr %180, align 4, !tbaa !5
  %182 = sub nsw i32 %179, %181
  %183 = trunc nuw nsw i64 %indvars.iv108 to i32
  call void @_Z7addEdgeiii(i32 noundef %177, i32 noundef %183, i32 noundef %182)
  %184 = load i32, ptr @toty, align 4, !tbaa !5
  %185 = icmp sgt i32 %184, 1
  br i1 %185, label %.lr.ph79, label %.loopexit61

.lr.ph79:                                         ; preds = %.lr.ph82, %194
  %186 = phi i32 [ %195, %194 ], [ %184, %.lr.ph82 ]
  %indvars.iv105 = phi i64 [ %indvars.iv.next106, %194 ], [ 0, %.lr.ph82 ]
  %187 = getelementptr inbounds [210 x [210 x i8]], ptr @ban, i64 0, i64 %indvars.iv108, i64 %indvars.iv105
  %188 = load i8, ptr %187, align 1, !tbaa !11, !range !16, !noundef !17
  %189 = trunc nuw i8 %188 to i1
  br i1 %189, label %194, label %190

190:                                              ; preds = %.lr.ph79
  %191 = load i32, ptr @totx, align 4, !tbaa !5
  %192 = trunc nuw nsw i64 %indvars.iv105 to i32
  %193 = add nsw i32 %191, %192
  call void @_Z7addEdgeiii(i32 noundef %183, i32 noundef %193, i32 noundef 1061109567)
  %.pre115 = load i32, ptr @toty, align 4, !tbaa !5
  br label %194

194:                                              ; preds = %.lr.ph79, %190
  %195 = phi i32 [ %186, %.lr.ph79 ], [ %.pre115, %190 ]
  %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
  %196 = add nsw i32 %195, -1
  %197 = sext i32 %196 to i64
  %198 = icmp slt i64 %indvars.iv.next106, %197
  br i1 %198, label %.lr.ph79, label %.loopexit61, !llvm.loop !18

.preheader62:                                     ; preds = %.lr.ph84, %.preheader63
  %199 = call noundef zeroext i1 @_Z3bfsv()
  br i1 %199, label %.preheader59.outer, label %._crit_edge86

.lr.ph84:                                         ; preds = %.preheader63, %.lr.ph84
  %indvars.iv111 = phi i64 [ %indvars.iv.next112, %.lr.ph84 ], [ 0, %.preheader63 ]
  %200 = load i32, ptr @totx, align 4, !tbaa !5
  %201 = trunc nuw nsw i64 %indvars.iv111 to i32
  %202 = add nsw i32 %200, %201
  %203 = load i32, ptr @T, align 4, !tbaa !5
  %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
  %204 = getelementptr inbounds [210 x i32], ptr @quey, i64 0, i64 %indvars.iv.next112
  %205 = load i32, ptr %204, align 4, !tbaa !5
  %206 = getelementptr inbounds [210 x i32], ptr @quey, i64 0, i64 %indvars.iv111
  %207 = load i32, ptr %206, align 4, !tbaa !5
  %208 = sub nsw i32 %205, %207
  call void @_Z7addEdgeiii(i32 noundef %202, i32 noundef %203, i32 noundef %208)
  %209 = load i32, ptr @toty, align 4, !tbaa !5
  %210 = add nsw i32 %209, -1
  %211 = sext i32 %210 to i64
  %212 = icmp slt i64 %indvars.iv.next112, %211
  br i1 %212, label %.lr.ph84, label %.preheader62, !llvm.loop !19

.loopexit60:                                      ; preds = %.preheader59
  %213 = call noundef zeroext i1 @_Z3bfsv()
  br i1 %213, label %.preheader59, label %._crit_edge86, !llvm.loop !20

.preheader59:                                     ; preds = %.preheader59.outer, %.loopexit60
  %214 = load i32, ptr @S, align 4, !tbaa !5
  %215 = call noundef i32 @_Z3dfsii(i32 noundef %214, i32 noundef 1061109567)
  %.not57 = icmp eq i32 %215, 0
  br i1 %.not57, label %.loopexit60, label %.preheader59.outer.loopexit

.preheader59.outer.loopexit:                      ; preds = %.preheader59
  %216 = add nsw i32 %215, %.1.ph
  br label %.preheader59.outer, !llvm.loop !21

.preheader59.outer:                               ; preds = %.preheader62, %.preheader59.outer.loopexit
  %.1.ph = phi i32 [ %216, %.preheader59.outer.loopexit ], [ 0, %.preheader62 ]
  br label %.preheader59

._crit_edge86:                                    ; preds = %.loopexit60, %.preheader62
  %.049.lcssa = phi i32 [ 0, %.preheader62 ], [ %.1.ph, %.loopexit60 ]
  %217 = load i32, ptr @n, align 4, !tbaa !5
  %218 = icmp eq i32 %.049.lcssa, %217
  %219 = select i1 %218, ptr @.str.3, ptr @.str.4
  %220 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %219)
  %221 = load i32, ptr @t, align 4, !tbaa !5
  %222 = add nsw i32 %221, -1
  store i32 %222, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %221, 0
  br i1 %.not, label %._crit_edge90, label %.lr.ph89, !llvm.loop !22

._crit_edge90:                                    ; preds = %._crit_edge86, %0
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef, ptr noundef) local_unnamed_addr #6

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

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

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

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


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