; LLVM IR from tangjz/acm-icpc :: codeforces/complete (317E)

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

@dis = external dso_local global [41209 x i32], align 16
@ban = external dso_local global [203 x [203 x i8]], align 16
@sx = external dso_local global i32, align 4
@sy = external dso_local global i32, align 4
@tx = external dso_local global i32, align 4
@ty = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@adt = external dso_local global [41209 x i32], align 16
@buf = external dso_local global [1000001 x i8], align 16
@xL = external dso_local global i32, align 4
@xR = external dso_local global i32, align 4
@yL = external dso_local global i32, align 4
@yR = external dso_local global i32, align 4
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3bfsi(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 uwtable
declare dso_local void @_Z6appendv() #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z9innerMoveii(i32 noundef, i32 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z9outerMoveiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @sx, ptr noundef @sy, ptr noundef @tx, ptr noundef @ty, ptr noundef @m)
  %11 = load i32, ptr @m, align 4, !tbaa !5
  %12 = icmp ne i32 %11, 0
  br i1 %12, label %15, label %13

13:                                               ; preds = %0
  %14 = call i32 @puts(ptr noundef @.str.2)
  store i32 0, ptr %1, align 4
  br label %299

15:                                               ; preds = %0
  %16 = load i32, ptr @sx, align 4, !tbaa !5
  %17 = add nsw i32 %16, 101
  store i32 %17, ptr @sx, align 4, !tbaa !5
  %18 = load i32, ptr @sy, align 4, !tbaa !5
  %19 = add nsw i32 %18, 101
  store i32 %19, ptr @sy, align 4, !tbaa !5
  %20 = load i32, ptr @tx, align 4, !tbaa !5
  %21 = add nsw i32 %20, 101
  store i32 %21, ptr @tx, align 4, !tbaa !5
  %22 = load i32, ptr @ty, align 4, !tbaa !5
  %23 = add nsw i32 %22, 101
  store i32 %23, ptr @ty, align 4, !tbaa !5
  store i32 203, ptr @yL, align 4, !tbaa !5
  store i32 203, ptr @xL, align 4, !tbaa !5
  store i32 -1, ptr @yR, align 4, !tbaa !5
  store i32 -1, ptr @xR, align 4, !tbaa !5
  br label %24

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

28:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %2, ptr noundef %3)
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = add nsw i32 %30, 101
  store i32 %31, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [203 x [203 x i8]], ptr @ban, i64 0, i64 %32
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = add nsw i32 %34, 101
  store i32 %35, ptr %3, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [203 x i8], ptr %33, i64 0, i64 %36
  store i8 1, ptr %37, align 1, !tbaa !9
  %38 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @xL, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %39 = load i32, ptr %38, align 4, !tbaa !5
  store i32 %39, ptr @xL, align 4, !tbaa !5
  %40 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @xR, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %41 = load i32, ptr %40, align 4, !tbaa !5
  store i32 %41, ptr @xR, align 4, !tbaa !5
  %42 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @yL, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %43 = load i32, ptr %42, align 4, !tbaa !5
  store i32 %43, ptr @yL, align 4, !tbaa !5
  %44 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @yR, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %45 = load i32, ptr %44, align 4, !tbaa !5
  store i32 %45, ptr @yR, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %24, !llvm.loop !11

46:                                               ; preds = %24
  %47 = load i32, ptr @sx, align 4, !tbaa !5
  %48 = mul nsw i32 %47, 203
  %49 = load i32, ptr @sy, align 4, !tbaa !5
  %50 = add nsw i32 %48, %49
  call void @_Z3bfsi(i32 noundef %50)
  %51 = load i32, ptr @tx, align 4, !tbaa !5
  %52 = mul nsw i32 %51, 203
  %53 = load i32, ptr @ty, align 4, !tbaa !5
  %54 = add nsw i32 %52, %53
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [41209 x i32], ptr @dis, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = icmp eq i32 %57, -1
  br i1 %58, label %59, label %61

59:                                               ; preds = %46
  %60 = call i32 @puts(ptr noundef @.str.2)
  store i32 0, ptr %1, align 4
  br label %299

61:                                               ; preds = %46
  %62 = load i32, ptr @dis, align 16, !tbaa !5
  %63 = icmp eq i32 %62, -1
  br i1 %63, label %64, label %82

64:                                               ; preds = %61
  br label %65

65:                                               ; preds = %76, %64
  %66 = load i32, ptr @tx, align 4, !tbaa !5
  %67 = load i32, ptr @ty, align 4, !tbaa !5
  call void @_Z9innerMoveii(i32 noundef %66, i32 noundef %67)
  %68 = load i32, ptr @sx, align 4, !tbaa !5
  %69 = load i32, ptr @tx, align 4, !tbaa !5
  %70 = icmp eq i32 %68, %69
  br i1 %70, label %71, label %76

71:                                               ; preds = %65
  %72 = load i32, ptr @sy, align 4, !tbaa !5
  %73 = load i32, ptr @ty, align 4, !tbaa !5
  %74 = icmp eq i32 %72, %73
  br i1 %74, label %75, label %76

75:                                               ; preds = %71
  br label %81

76:                                               ; preds = %71, %65
  %77 = load i32, ptr @sx, align 4, !tbaa !5
  %78 = mul nsw i32 %77, 203
  %79 = load i32, ptr @sy, align 4, !tbaa !5
  %80 = add nsw i32 %78, %79
  call void @_Z3bfsi(i32 noundef %80)
  br label %65, !llvm.loop !13

81:                                               ; preds = %75
  br label %294

82:                                               ; preds = %61
  %83 = load i32, ptr @xL, align 4, !tbaa !5
  %84 = sub nsw i32 %83, 1
  %85 = load i32, ptr @yL, align 4, !tbaa !5
  %86 = sub nsw i32 %85, 1
  call void @_Z9innerMoveii(i32 noundef %84, i32 noundef %86)
  store i32 0, ptr @m, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %87 = load i32, ptr @xL, align 4, !tbaa !5
  %88 = sub nsw i32 %87, 1
  store i32 %88, ptr %4, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %100, %82
  %90 = load i32, ptr %4, align 4, !tbaa !5
  %91 = load i32, ptr @xR, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  %93 = icmp sle i32 %90, %92
  br i1 %93, label %95, label %94

94:                                               ; preds = %89
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %103

95:                                               ; preds = %89
  %96 = load i32, ptr @m, align 4, !tbaa !5
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr @m, align 4, !tbaa !5
  %98 = sext i32 %96 to i64
  %99 = getelementptr inbounds [41209 x i32], ptr @adt, i64 0, i64 %98
  store i32 0, ptr %99, align 4, !tbaa !5
  br label %100

100:                                              ; preds = %95
  %101 = load i32, ptr %4, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %4, align 4, !tbaa !5
  br label %89, !llvm.loop !14

103:                                              ; preds = %94
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %104 = load i32, ptr @yL, align 4, !tbaa !5
  %105 = sub nsw i32 %104, 1
  store i32 %105, ptr %5, align 4, !tbaa !5
  br label %106

106:                                              ; preds = %117, %103
  %107 = load i32, ptr %5, align 4, !tbaa !5
  %108 = load i32, ptr @yR, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  %110 = icmp sle i32 %107, %109
  br i1 %110, label %112, label %111

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

112:                                              ; preds = %106
  %113 = load i32, ptr @m, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr @m, align 4, !tbaa !5
  %115 = sext i32 %113 to i64
  %116 = getelementptr inbounds [41209 x i32], ptr @adt, i64 0, i64 %115
  store i32 2, ptr %116, align 4, !tbaa !5
  br label %117

117:                                              ; preds = %112
  %118 = load i32, ptr %5, align 4, !tbaa !5
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %5, align 4, !tbaa !5
  br label %106, !llvm.loop !15

120:                                              ; preds = %111
  call void @_Z6appendv()
  %121 = load i32, ptr @xL, align 4, !tbaa !5
  %122 = load i32, ptr @tx, align 4, !tbaa !5
  %123 = icmp sle i32 %121, %122
  br i1 %123, label %124, label %145

124:                                              ; preds = %120
  %125 = load i32, ptr @tx, align 4, !tbaa !5
  %126 = load i32, ptr @xR, align 4, !tbaa !5
  %127 = icmp sle i32 %125, %126
  br i1 %127, label %128, label %145

128:                                              ; preds = %124
  %129 = load i32, ptr @yL, align 4, !tbaa !5
  %130 = load i32, ptr @ty, align 4, !tbaa !5
  %131 = icmp sle i32 %129, %130
  br i1 %131, label %132, label %145

132:                                              ; preds = %128
  %133 = load i32, ptr @ty, align 4, !tbaa !5
  %134 = load i32, ptr @yR, align 4, !tbaa !5
  %135 = icmp sle i32 %133, %134
  br i1 %135, label %136, label %145

136:                                              ; preds = %132
  %137 = load i32, ptr @tx, align 4, !tbaa !5
  %138 = mul nsw i32 %137, 203
  %139 = load i32, ptr @ty, align 4, !tbaa !5
  %140 = add nsw i32 %138, %139
  call void @_Z3bfsi(i32 noundef %140)
  %141 = load i32, ptr @xL, align 4, !tbaa !5
  %142 = sub nsw i32 %141, 1
  %143 = load i32, ptr @yL, align 4, !tbaa !5
  %144 = sub nsw i32 %143, 1
  call void @_Z9innerMoveii(i32 noundef %142, i32 noundef %144)
  br label %145

145:                                              ; preds = %136, %132, %128, %124, %120
  %146 = load i32, ptr @sx, align 4, !tbaa !5
  %147 = load i32, ptr @tx, align 4, !tbaa !5
  %148 = icmp slt i32 %146, %147
  br i1 %148, label %149, label %182

149:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %150 = load i32, ptr @yL, align 4, !tbaa !5
  store i32 %150, ptr %6, align 4, !tbaa !5
  br label %151

151:                                              ; preds = %168, %149
  %152 = load i32, ptr %6, align 4, !tbaa !5
  %153 = load i32, ptr @yR, align 4, !tbaa !5
  %154 = icmp sle i32 %152, %153
  br i1 %154, label %155, label %165

155:                                              ; preds = %151
  %156 = load i32, ptr @xL, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [203 x [203 x i8]], ptr @ban, i64 0, i64 %157
  %159 = load i32, ptr %6, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [203 x i8], ptr %158, i64 0, i64 %160
  %162 = load i8, ptr %161, align 1, !tbaa !9, !range !16, !noundef !17
  %163 = trunc i8 %162 to i1
  %164 = xor i1 %163, true
  br label %165

165:                                              ; preds = %155, %151
  %166 = phi i1 [ false, %151 ], [ %164, %155 ]
  br i1 %166, label %167, label %171

167:                                              ; preds = %165
  br label %168

168:                                              ; preds = %167
  %169 = load i32, ptr %6, align 4, !tbaa !5
  %170 = add nsw i32 %169, 1
  store i32 %170, ptr %6, align 4, !tbaa !5
  br label %151, !llvm.loop !18

171:                                              ; preds = %165
  %172 = load i32, ptr @tx, align 4, !tbaa !5
  %173 = load i32, ptr @ty, align 4, !tbaa !5
  %174 = load i32, ptr @xL, align 4, !tbaa !5
  %175 = sub nsw i32 %174, 1
  %176 = load i32, ptr %6, align 4, !tbaa !5
  call void @_Z9outerMoveiiii(i32 noundef %172, i32 noundef %173, i32 noundef %175, i32 noundef %176)
  %177 = load i32, ptr @sx, align 4, !tbaa !5
  %178 = load i32, ptr @sy, align 4, !tbaa !5
  %179 = load i32, ptr @xL, align 4, !tbaa !5
  %180 = sub nsw i32 %179, 1
  %181 = load i32, ptr @sy, align 4, !tbaa !5
  call void @_Z9outerMoveiiii(i32 noundef %177, i32 noundef %178, i32 noundef %180, i32 noundef %181)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %182

182:                                              ; preds = %171, %145
  %183 = load i32, ptr @sx, align 4, !tbaa !5
  %184 = load i32, ptr @tx, align 4, !tbaa !5
  %185 = icmp sgt i32 %183, %184
  br i1 %185, label %186, label %219

186:                                              ; preds = %182
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %187 = load i32, ptr @yL, align 4, !tbaa !5
  store i32 %187, ptr %7, align 4, !tbaa !5
  br label %188

188:                                              ; preds = %205, %186
  %189 = load i32, ptr %7, align 4, !tbaa !5
  %190 = load i32, ptr @yR, align 4, !tbaa !5
  %191 = icmp sle i32 %189, %190
  br i1 %191, label %192, label %202

192:                                              ; preds = %188
  %193 = load i32, ptr @xR, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [203 x [203 x i8]], ptr @ban, i64 0, i64 %194
  %196 = load i32, ptr %7, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [203 x i8], ptr %195, i64 0, i64 %197
  %199 = load i8, ptr %198, align 1, !tbaa !9, !range !16, !noundef !17
  %200 = trunc i8 %199 to i1
  %201 = xor i1 %200, true
  br label %202

202:                                              ; preds = %192, %188
  %203 = phi i1 [ false, %188 ], [ %201, %192 ]
  br i1 %203, label %204, label %208

204:                                              ; preds = %202
  br label %205

205:                                              ; preds = %204
  %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 %188, !llvm.loop !19

208:                                              ; preds = %202
  %209 = load i32, ptr @tx, align 4, !tbaa !5
  %210 = load i32, ptr @ty, align 4, !tbaa !5
  %211 = load i32, ptr @xR, align 4, !tbaa !5
  %212 = add nsw i32 %211, 1
  %213 = load i32, ptr %7, align 4, !tbaa !5
  call void @_Z9outerMoveiiii(i32 noundef %209, i32 noundef %210, i32 noundef %212, i32 noundef %213)
  %214 = load i32, ptr @sx, align 4, !tbaa !5
  %215 = load i32, ptr @sy, align 4, !tbaa !5
  %216 = load i32, ptr @xR, align 4, !tbaa !5
  %217 = add nsw i32 %216, 1
  %218 = load i32, ptr @sy, align 4, !tbaa !5
  call void @_Z9outerMoveiiii(i32 noundef %214, i32 noundef %215, i32 noundef %217, i32 noundef %218)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %219

219:                                              ; preds = %208, %182
  %220 = load i32, ptr @sy, align 4, !tbaa !5
  %221 = load i32, ptr @ty, align 4, !tbaa !5
  %222 = icmp slt i32 %220, %221
  br i1 %222, label %223, label %256

223:                                              ; preds = %219
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %224 = load i32, ptr @xL, align 4, !tbaa !5
  store i32 %224, ptr %8, align 4, !tbaa !5
  br label %225

225:                                              ; preds = %242, %223
  %226 = load i32, ptr %8, align 4, !tbaa !5
  %227 = load i32, ptr @xR, align 4, !tbaa !5
  %228 = icmp sle i32 %226, %227
  br i1 %228, label %229, label %239

229:                                              ; preds = %225
  %230 = load i32, ptr %8, align 4, !tbaa !5
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [203 x [203 x i8]], ptr @ban, i64 0, i64 %231
  %233 = load i32, ptr @yL, align 4, !tbaa !5
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [203 x i8], ptr %232, i64 0, i64 %234
  %236 = load i8, ptr %235, align 1, !tbaa !9, !range !16, !noundef !17
  %237 = trunc i8 %236 to i1
  %238 = xor i1 %237, true
  br label %239

239:                                              ; preds = %229, %225
  %240 = phi i1 [ false, %225 ], [ %238, %229 ]
  br i1 %240, label %241, label %245

241:                                              ; preds = %239
  br label %242

242:                                              ; preds = %241
  %243 = load i32, ptr %8, align 4, !tbaa !5
  %244 = add nsw i32 %243, 1
  store i32 %244, ptr %8, align 4, !tbaa !5
  br label %225, !llvm.loop !20

245:                                              ; preds = %239
  %246 = load i32, ptr @tx, align 4, !tbaa !5
  %247 = load i32, ptr @ty, align 4, !tbaa !5
  %248 = load i32, ptr %8, align 4, !tbaa !5
  %249 = load i32, ptr @yL, align 4, !tbaa !5
  %250 = sub nsw i32 %249, 1
  call void @_Z9outerMoveiiii(i32 noundef %246, i32 noundef %247, i32 noundef %248, i32 noundef %250)
  %251 = load i32, ptr @sx, align 4, !tbaa !5
  %252 = load i32, ptr @sy, align 4, !tbaa !5
  %253 = load i32, ptr @sx, align 4, !tbaa !5
  %254 = load i32, ptr @yL, align 4, !tbaa !5
  %255 = sub nsw i32 %254, 1
  call void @_Z9outerMoveiiii(i32 noundef %251, i32 noundef %252, i32 noundef %253, i32 noundef %255)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %256

256:                                              ; preds = %245, %219
  %257 = load i32, ptr @sy, align 4, !tbaa !5
  %258 = load i32, ptr @ty, align 4, !tbaa !5
  %259 = icmp sgt i32 %257, %258
  br i1 %259, label %260, label %293

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

262:                                              ; preds = %279, %260
  %263 = load i32, ptr %9, align 4, !tbaa !5
  %264 = load i32, ptr @xR, align 4, !tbaa !5
  %265 = icmp sle i32 %263, %264
  br i1 %265, label %266, label %276

266:                                              ; preds = %262
  %267 = load i32, ptr %9, align 4, !tbaa !5
  %268 = sext i32 %267 to i64
  %269 = getelementptr inbounds [203 x [203 x i8]], ptr @ban, i64 0, i64 %268
  %270 = load i32, ptr @yR, align 4, !tbaa !5
  %271 = sext i32 %270 to i64
  %272 = getelementptr inbounds [203 x i8], ptr %269, i64 0, i64 %271
  %273 = load i8, ptr %272, align 1, !tbaa !9, !range !16, !noundef !17
  %274 = trunc i8 %273 to i1
  %275 = xor i1 %274, true
  br label %276

276:                                              ; preds = %266, %262
  %277 = phi i1 [ false, %262 ], [ %275, %266 ]
  br i1 %277, label %278, label %282

278:                                              ; preds = %276
  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 %262, !llvm.loop !21

282:                                              ; preds = %276
  %283 = load i32, ptr @tx, align 4, !tbaa !5
  %284 = load i32, ptr @ty, align 4, !tbaa !5
  %285 = load i32, ptr %9, align 4, !tbaa !5
  %286 = load i32, ptr @yR, align 4, !tbaa !5
  %287 = add nsw i32 %286, 1
  call void @_Z9outerMoveiiii(i32 noundef %283, i32 noundef %284, i32 noundef %285, i32 noundef %287)
  %288 = load i32, ptr @sx, align 4, !tbaa !5
  %289 = load i32, ptr @sy, align 4, !tbaa !5
  %290 = load i32, ptr @sx, align 4, !tbaa !5
  %291 = load i32, ptr @yR, align 4, !tbaa !5
  %292 = add nsw i32 %291, 1
  call void @_Z9outerMoveiiii(i32 noundef %288, i32 noundef %289, i32 noundef %290, i32 noundef %292)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %293

293:                                              ; preds = %282, %256
  br label %294

294:                                              ; preds = %293, %81
  %295 = load i32, ptr @n, align 4, !tbaa !5
  %296 = sext i32 %295 to i64
  %297 = getelementptr inbounds [1000001 x i8], ptr @buf, i64 0, i64 %296
  store i8 0, ptr %297, align 1, !tbaa !22
  %298 = call i32 @puts(ptr noundef @buf)
  store i32 0, ptr %1, align 4
  br label %299

299:                                              ; preds = %294, %59, %13
  %300 = load i32, ptr %1, align 4
  ret i32 %300
}

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

declare i32 @puts(ptr noundef) #4

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #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 = { 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 #3 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

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


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

@dis = external dso_local local_unnamed_addr global [41209 x i32], align 16
@ban = external dso_local local_unnamed_addr global [203 x [203 x i8]], align 16
@sx = external dso_local global i32, align 4
@sy = external dso_local global i32, align 4
@tx = external dso_local global i32, align 4
@ty = external dso_local global i32, align 4
@n = external dso_local local_unnamed_addr global i32, align 4
@m = external dso_local global i32, align 4
@adt = external dso_local local_unnamed_addr global [41209 x i32], align 16
@buf = external dso_local global [1000001 x i8], align 16
@xL = external dso_local global i32, align 4
@xR = external dso_local global i32, align 4
@yL = external dso_local global i32, align 4
@yR = external dso_local global i32, align 4
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3bfsi(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 uwtable
declare dso_local void @_Z6appendv() local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z9innerMoveii(i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z9outerMoveiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @sx, ptr noundef nonnull @sy, ptr noundef nonnull @tx, ptr noundef nonnull @ty, ptr noundef nonnull @m)
  %4 = load i32, ptr @m, align 4, !tbaa !5
  %.not = icmp eq i32 %4, 0
  br i1 %.not, label %5, label %.lr.ph.preheader

5:                                                ; preds = %0
  %6 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %201

.lr.ph.preheader:                                 ; preds = %0
  %7 = load i32, ptr @sx, align 4, !tbaa !5
  %8 = add nsw i32 %7, 101
  store i32 %8, ptr @sx, align 4, !tbaa !5
  %9 = load i32, ptr @sy, align 4, !tbaa !5
  %10 = add nsw i32 %9, 101
  store i32 %10, ptr @sy, align 4, !tbaa !5
  %11 = load i32, ptr @tx, align 4, !tbaa !5
  %12 = add nsw i32 %11, 101
  store i32 %12, ptr @tx, align 4, !tbaa !5
  %13 = load i32, ptr @ty, align 4, !tbaa !5
  %14 = add nsw i32 %13, 101
  store i32 %14, ptr @ty, align 4, !tbaa !5
  store i32 203, ptr @yL, align 4, !tbaa !5
  store i32 203, ptr @xL, align 4, !tbaa !5
  store i32 -1, ptr @yR, align 4, !tbaa !5
  store i32 -1, ptr @xR, align 4, !tbaa !5
  %15 = add nsw i32 %4, -1
  store i32 %15, ptr @m, align 4, !tbaa !5
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %17 = load i32, ptr %1, align 4, !tbaa !5
  %18 = add nsw i32 %17, 101
  store i32 %18, ptr %1, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = add nsw i32 %20, 101
  store i32 %21, ptr %2, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [203 x [203 x i8]], ptr @ban, i64 0, i64 %19, i64 %22
  store i8 1, ptr %23, align 1, !tbaa !9
  %24 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @xL, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %25 = load i32, ptr %24, align 4, !tbaa !5
  store i32 %25, ptr @xL, align 4, !tbaa !5
  %26 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @xR, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %27 = load i32, ptr %26, align 4, !tbaa !5
  store i32 %27, ptr @xR, align 4, !tbaa !5
  %28 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @yL, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %29 = load i32, ptr %28, align 4, !tbaa !5
  store i32 %29, ptr @yL, align 4, !tbaa !5
  %30 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @yR, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %31 = load i32, ptr %30, align 4, !tbaa !5
  store i32 %31, ptr @yR, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %32 = load i32, ptr @m, align 4, !tbaa !5
  %33 = add nsw i32 %32, -1
  store i32 %33, ptr @m, align 4, !tbaa !5
  %.not35 = icmp eq i32 %32, 0
  br i1 %.not35, label %._crit_edge, label %.lr.ph, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph
  %.pre109 = load i32, ptr @sy, align 4, !tbaa !5
  %.pre = load i32, ptr @sx, align 4, !tbaa !5
  %34 = mul nsw i32 %.pre, 203
  %35 = add nsw i32 %34, %.pre109
  call void @_Z3bfsi(i32 noundef %35)
  %36 = load i32, ptr @tx, align 4, !tbaa !5
  %37 = mul nsw i32 %36, 203
  %38 = load i32, ptr @ty, align 4, !tbaa !5
  %39 = add nsw i32 %37, %38
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [41209 x i32], ptr @dis, i64 0, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = icmp eq i32 %42, -1
  br i1 %43, label %44, label %46

44:                                               ; preds = %._crit_edge
  %45 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %201

46:                                               ; preds = %._crit_edge
  %47 = load i32, ptr @dis, align 16, !tbaa !5
  %48 = icmp eq i32 %47, -1
  br i1 %48, label %.preheader.preheader, label %62

.preheader.preheader:                             ; preds = %46
  call void @_Z9innerMoveii(i32 noundef %36, i32 noundef %38)
  %49 = load i32, ptr @sx, align 4, !tbaa !5
  %50 = load i32, ptr @tx, align 4, !tbaa !5
  %51 = icmp eq i32 %49, %50
  %.pre122137 = load i32, ptr @sy, align 4, !tbaa !5
  %52 = load i32, ptr @ty, align 4
  %53 = icmp eq i32 %.pre122137, %52
  %or.cond132138 = select i1 %51, i1 %53, i1 false
  br i1 %or.cond132138, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %.pre122139 = phi i32 [ %.pre122, %.preheader ], [ %.pre122137, %.preheader.preheader ]
  %54 = phi i32 [ %57, %.preheader ], [ %49, %.preheader.preheader ]
  %55 = mul nsw i32 %54, 203
  %56 = add nsw i32 %.pre122139, %55
  call void @_Z3bfsi(i32 noundef %56)
  %.pre120 = load i32, ptr @tx, align 4, !tbaa !5
  %.pre121 = load i32, ptr @ty, align 4, !tbaa !5
  call void @_Z9innerMoveii(i32 noundef %.pre120, i32 noundef %.pre121)
  %57 = load i32, ptr @sx, align 4, !tbaa !5
  %58 = load i32, ptr @tx, align 4, !tbaa !5
  %59 = icmp eq i32 %57, %58
  %.pre122 = load i32, ptr @sy, align 4, !tbaa !5
  %60 = load i32, ptr @ty, align 4
  %61 = icmp eq i32 %.pre122, %60
  %or.cond132 = select i1 %59, i1 %61, i1 false
  br i1 %or.cond132, label %.loopexit, label %.preheader, !llvm.loop !13

62:                                               ; preds = %46
  %63 = load i32, ptr @xL, align 4, !tbaa !5
  %64 = add nsw i32 %63, -1
  %65 = load i32, ptr @yL, align 4, !tbaa !5
  %66 = add nsw i32 %65, -1
  call void @_Z9innerMoveii(i32 noundef %64, i32 noundef %66)
  store i32 0, ptr @m, align 4, !tbaa !5
  %67 = load i32, ptr @xL, align 4, !tbaa !5
  %68 = add nsw i32 %67, -1
  %69 = load i32, ptr @xR, align 4, !tbaa !5
  %70 = add nsw i32 %69, 1
  %.not3648 = icmp sgt i32 %68, %70
  br i1 %.not3648, label %77, label %.lr.ph51.preheader

.lr.ph51.preheader:                               ; preds = %62
  %71 = add i32 %69, 2
  %72 = sub i32 %71, %67
  %73 = zext i32 %72 to i64
  %74 = shl nuw nsw i64 %73, 2
  %75 = add nuw nsw i64 %74, 4
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) @adt, i8 0, i64 %75, i1 false), !tbaa !5
  %76 = add i32 %72, 1
  store i32 %76, ptr @m, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %.lr.ph51.preheader, %62
  %m.promoted53 = phi i32 [ %76, %.lr.ph51.preheader ], [ 0, %62 ]
  %78 = load i32, ptr @yL, align 4, !tbaa !5
  %79 = add nsw i32 %78, -1
  %80 = load i32, ptr @yR, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  %.not3754 = icmp sgt i32 %79, %81
  br i1 %.not3754, label %92, label %.lr.ph57.preheader

.lr.ph57.preheader:                               ; preds = %77
  %82 = sext i32 %m.promoted53 to i64
  %83 = add i32 %80, 1
  %84 = add i32 %80, 2
  %85 = sub i32 %84, %78
  %86 = zext i32 %85 to i64
  %87 = add nuw nsw i64 %86, 1
  %min.iters.check = icmp ult i32 %85, 7
  br i1 %min.iters.check, label %.lr.ph57.preheader148, label %vector.ph

.lr.ph57.preheader148:                            ; preds = %middle.block, %.lr.ph57.preheader
  %indvars.iv.ph = phi i64 [ %82, %.lr.ph57.preheader ], [ %ind.end, %middle.block ]
  %.03055.ph = phi i32 [ %79, %.lr.ph57.preheader ], [ %ind.end141, %middle.block ]
  br label %.lr.ph57

vector.ph:                                        ; preds = %.lr.ph57.preheader
  %n.vec = and i64 %87, 8589934584
  %ind.end = add nsw i64 %n.vec, %82
  %.cast = trunc i64 %n.vec to i32
  %ind.end141 = add i32 %79, %.cast
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = add i64 %index, %82
  %88 = getelementptr inbounds [41209 x i32], ptr @adt, i64 0, i64 %offset.idx
  %89 = getelementptr inbounds i8, ptr %88, i64 16
  store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, ptr %88, align 4, !tbaa !5
  store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, ptr %89, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %90 = icmp eq i64 %index.next, %n.vec
  br i1 %90, label %middle.block, label %vector.body, !llvm.loop !14

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %87, %n.vec
  br i1 %cmp.n, label %._crit_edge58, label %.lr.ph57.preheader148

._crit_edge58:                                    ; preds = %.lr.ph57, %middle.block
  %indvars.iv.next.lcssa = phi i64 [ %ind.end, %middle.block ], [ %indvars.iv.next, %.lr.ph57 ]
  %91 = trunc nsw i64 %indvars.iv.next.lcssa to i32
  store i32 %91, ptr @m, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %._crit_edge58, %77
  call void @_Z6appendv()
  %93 = load i32, ptr @xL, align 4, !tbaa !5
  %94 = load i32, ptr @tx, align 4, !tbaa !5
  %.not38 = icmp sgt i32 %93, %94
  %95 = load i32, ptr @xR, align 4
  %.not39 = icmp sgt i32 %94, %95
  %or.cond = select i1 %.not38, i1 true, i1 %.not39
  br i1 %or.cond, label %109, label %98

.lr.ph57:                                         ; preds = %.lr.ph57.preheader148, %.lr.ph57
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph57 ], [ %indvars.iv.ph, %.lr.ph57.preheader148 ]
  %.03055 = phi i32 [ %97, %.lr.ph57 ], [ %.03055.ph, %.lr.ph57.preheader148 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %96 = getelementptr inbounds [41209 x i32], ptr @adt, i64 0, i64 %indvars.iv
  store i32 2, ptr %96, align 4, !tbaa !5
  %97 = add i32 %.03055, 1
  %exitcond = icmp eq i32 %.03055, %83
  br i1 %exitcond, label %._crit_edge58, label %.lr.ph57, !llvm.loop !17

98:                                               ; preds = %92
  %99 = load i32, ptr @yL, align 4, !tbaa !5
  %100 = load i32, ptr @ty, align 4, !tbaa !5
  %.not40 = icmp sgt i32 %99, %100
  %101 = load i32, ptr @yR, align 4
  %.not41 = icmp sgt i32 %100, %101
  %or.cond46 = select i1 %.not40, i1 true, i1 %.not41
  br i1 %or.cond46, label %109, label %102

102:                                              ; preds = %98
  %103 = mul nsw i32 %94, 203
  %104 = add nsw i32 %100, %103
  call void @_Z3bfsi(i32 noundef %104)
  %105 = load i32, ptr @xL, align 4, !tbaa !5
  %106 = add nsw i32 %105, -1
  %107 = load i32, ptr @yL, align 4, !tbaa !5
  %108 = add nsw i32 %107, -1
  call void @_Z9innerMoveii(i32 noundef %106, i32 noundef %108)
  %.pre111 = load i32, ptr @tx, align 4, !tbaa !5
  br label %109

109:                                              ; preds = %102, %98, %92
  %110 = phi i32 [ %.pre111, %102 ], [ %94, %98 ], [ %94, %92 ]
  %111 = load i32, ptr @sx, align 4, !tbaa !5
  %112 = icmp slt i32 %111, %110
  br i1 %112, label %113, label %131

113:                                              ; preds = %109
  %114 = load i32, ptr @yL, align 4, !tbaa !5
  %115 = load i32, ptr @yR, align 4, !tbaa !5
  %.not4260 = icmp sgt i32 %114, %115
  %.pre112 = load i32, ptr @xL, align 4, !tbaa !5
  br i1 %.not4260, label %.critedge, label %.lr.ph63

.lr.ph63:                                         ; preds = %113
  %116 = sext i32 %.pre112 to i64
  %117 = sext i32 %114 to i64
  %118 = add i32 %115, 1
  br label %119

119:                                              ; preds = %.lr.ph63, %123
  %indvars.iv90 = phi i64 [ %117, %.lr.ph63 ], [ %indvars.iv.next91, %123 ]
  %120 = getelementptr inbounds [203 x [203 x i8]], ptr @ban, i64 0, i64 %116, i64 %indvars.iv90
  %121 = load i8, ptr %120, align 1, !tbaa !9, !range !18, !noundef !19
  %122 = trunc nuw i8 %121 to i1
  br i1 %122, label %.critedge.loopexit.split.loop.exit123, label %123

123:                                              ; preds = %119
  %indvars.iv.next91 = add nsw i64 %indvars.iv90, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next91 to i32
  %exitcond93.not = icmp eq i32 %118, %lftr.wideiv
  br i1 %exitcond93.not, label %.critedge, label %119, !llvm.loop !20

.critedge.loopexit.split.loop.exit123:            ; preds = %119
  %124 = trunc nsw i64 %indvars.iv90 to i32
  br label %.critedge

.critedge:                                        ; preds = %123, %.critedge.loopexit.split.loop.exit123, %113
  %.029.lcssa = phi i32 [ %114, %113 ], [ %124, %.critedge.loopexit.split.loop.exit123 ], [ %118, %123 ]
  %125 = load i32, ptr @ty, align 4, !tbaa !5
  %126 = add nsw i32 %.pre112, -1
  call void @_Z9outerMoveiiii(i32 noundef %110, i32 noundef %125, i32 noundef %126, i32 noundef %.029.lcssa)
  %127 = load i32, ptr @sx, align 4, !tbaa !5
  %128 = load i32, ptr @sy, align 4, !tbaa !5
  %129 = load i32, ptr @xL, align 4, !tbaa !5
  %130 = add nsw i32 %129, -1
  call void @_Z9outerMoveiiii(i32 noundef %127, i32 noundef %128, i32 noundef %130, i32 noundef %128)
  %.pre113 = load i32, ptr @sx, align 4, !tbaa !5
  %.pre114 = load i32, ptr @tx, align 4, !tbaa !5
  br label %131

131:                                              ; preds = %.critedge, %109
  %132 = phi i32 [ %.pre114, %.critedge ], [ %110, %109 ]
  %133 = phi i32 [ %.pre113, %.critedge ], [ %111, %109 ]
  %134 = icmp sgt i32 %133, %132
  br i1 %134, label %135, label %153

135:                                              ; preds = %131
  %136 = load i32, ptr @yL, align 4, !tbaa !5
  %137 = load i32, ptr @yR, align 4, !tbaa !5
  %.not4366 = icmp sgt i32 %136, %137
  %.pre115 = load i32, ptr @xR, align 4, !tbaa !5
  br i1 %.not4366, label %.critedge2, label %.lr.ph69

.lr.ph69:                                         ; preds = %135
  %138 = sext i32 %.pre115 to i64
  %139 = sext i32 %136 to i64
  %140 = add i32 %137, 1
  br label %141

141:                                              ; preds = %.lr.ph69, %145
  %indvars.iv94 = phi i64 [ %139, %.lr.ph69 ], [ %indvars.iv.next95, %145 ]
  %142 = getelementptr inbounds [203 x [203 x i8]], ptr @ban, i64 0, i64 %138, i64 %indvars.iv94
  %143 = load i8, ptr %142, align 1, !tbaa !9, !range !18, !noundef !19
  %144 = trunc nuw i8 %143 to i1
  br i1 %144, label %.critedge2.loopexit.split.loop.exit125, label %145

145:                                              ; preds = %141
  %indvars.iv.next95 = add nsw i64 %indvars.iv94, 1
  %lftr.wideiv97 = trunc i64 %indvars.iv.next95 to i32
  %exitcond98.not = icmp eq i32 %140, %lftr.wideiv97
  br i1 %exitcond98.not, label %.critedge2, label %141, !llvm.loop !21

.critedge2.loopexit.split.loop.exit125:           ; preds = %141
  %146 = trunc nsw i64 %indvars.iv94 to i32
  br label %.critedge2

.critedge2:                                       ; preds = %145, %.critedge2.loopexit.split.loop.exit125, %135
  %.028.lcssa = phi i32 [ %136, %135 ], [ %146, %.critedge2.loopexit.split.loop.exit125 ], [ %140, %145 ]
  %147 = load i32, ptr @ty, align 4, !tbaa !5
  %148 = add nsw i32 %.pre115, 1
  call void @_Z9outerMoveiiii(i32 noundef %132, i32 noundef %147, i32 noundef %148, i32 noundef %.028.lcssa)
  %149 = load i32, ptr @sx, align 4, !tbaa !5
  %150 = load i32, ptr @sy, align 4, !tbaa !5
  %151 = load i32, ptr @xR, align 4, !tbaa !5
  %152 = add nsw i32 %151, 1
  call void @_Z9outerMoveiiii(i32 noundef %149, i32 noundef %150, i32 noundef %152, i32 noundef %150)
  br label %153

153:                                              ; preds = %.critedge2, %131
  %154 = load i32, ptr @sy, align 4, !tbaa !5
  %155 = load i32, ptr @ty, align 4, !tbaa !5
  %156 = icmp slt i32 %154, %155
  br i1 %156, label %157, label %175

157:                                              ; preds = %153
  %158 = load i32, ptr @xL, align 4, !tbaa !5
  %159 = load i32, ptr @xR, align 4, !tbaa !5
  %.not4473 = icmp sgt i32 %158, %159
  %.pre116 = load i32, ptr @yL, align 4, !tbaa !5
  br i1 %.not4473, label %.critedge4, label %.lr.ph76

.lr.ph76:                                         ; preds = %157
  %160 = sext i32 %.pre116 to i64
  %161 = sext i32 %158 to i64
  %162 = add i32 %159, 1
  br label %163

163:                                              ; preds = %.lr.ph76, %167
  %indvars.iv99 = phi i64 [ %161, %.lr.ph76 ], [ %indvars.iv.next100, %167 ]
  %164 = getelementptr inbounds [203 x [203 x i8]], ptr @ban, i64 0, i64 %indvars.iv99, i64 %160
  %165 = load i8, ptr %164, align 1, !tbaa !9, !range !18, !noundef !19
  %166 = trunc nuw i8 %165 to i1
  br i1 %166, label %.critedge4.loopexit.split.loop.exit127, label %167

167:                                              ; preds = %163
  %indvars.iv.next100 = add nsw i64 %indvars.iv99, 1
  %lftr.wideiv102 = trunc i64 %indvars.iv.next100 to i32
  %exitcond103.not = icmp eq i32 %162, %lftr.wideiv102
  br i1 %exitcond103.not, label %.critedge4, label %163, !llvm.loop !22

.critedge4.loopexit.split.loop.exit127:           ; preds = %163
  %168 = trunc nsw i64 %indvars.iv99 to i32
  br label %.critedge4

.critedge4:                                       ; preds = %167, %.critedge4.loopexit.split.loop.exit127, %157
  %.027.lcssa = phi i32 [ %158, %157 ], [ %168, %.critedge4.loopexit.split.loop.exit127 ], [ %162, %167 ]
  %169 = load i32, ptr @tx, align 4, !tbaa !5
  %170 = add nsw i32 %.pre116, -1
  call void @_Z9outerMoveiiii(i32 noundef %169, i32 noundef %155, i32 noundef %.027.lcssa, i32 noundef %170)
  %171 = load i32, ptr @sx, align 4, !tbaa !5
  %172 = load i32, ptr @sy, align 4, !tbaa !5
  %173 = load i32, ptr @yL, align 4, !tbaa !5
  %174 = add nsw i32 %173, -1
  call void @_Z9outerMoveiiii(i32 noundef %171, i32 noundef %172, i32 noundef %171, i32 noundef %174)
  %.pre117 = load i32, ptr @sy, align 4, !tbaa !5
  %.pre118 = load i32, ptr @ty, align 4, !tbaa !5
  br label %175

175:                                              ; preds = %.critedge4, %153
  %176 = phi i32 [ %.pre118, %.critedge4 ], [ %155, %153 ]
  %177 = phi i32 [ %.pre117, %.critedge4 ], [ %154, %153 ]
  %178 = icmp sgt i32 %177, %176
  br i1 %178, label %179, label %.loopexit

179:                                              ; preds = %175
  %180 = load i32, ptr @xL, align 4, !tbaa !5
  %181 = load i32, ptr @xR, align 4, !tbaa !5
  %.not4580 = icmp sgt i32 %180, %181
  %.pre119 = load i32, ptr @yR, align 4, !tbaa !5
  br i1 %.not4580, label %.critedge6, label %.lr.ph83

.lr.ph83:                                         ; preds = %179
  %182 = sext i32 %.pre119 to i64
  %183 = sext i32 %180 to i64
  %184 = add i32 %181, 1
  br label %185

185:                                              ; preds = %.lr.ph83, %189
  %indvars.iv104 = phi i64 [ %183, %.lr.ph83 ], [ %indvars.iv.next105, %189 ]
  %186 = getelementptr inbounds [203 x [203 x i8]], ptr @ban, i64 0, i64 %indvars.iv104, i64 %182
  %187 = load i8, ptr %186, align 1, !tbaa !9, !range !18, !noundef !19
  %188 = trunc nuw i8 %187 to i1
  br i1 %188, label %.critedge6.loopexit.split.loop.exit129, label %189

189:                                              ; preds = %185
  %indvars.iv.next105 = add nsw i64 %indvars.iv104, 1
  %lftr.wideiv107 = trunc i64 %indvars.iv.next105 to i32
  %exitcond108.not = icmp eq i32 %184, %lftr.wideiv107
  br i1 %exitcond108.not, label %.critedge6, label %185, !llvm.loop !23

.critedge6.loopexit.split.loop.exit129:           ; preds = %185
  %190 = trunc nsw i64 %indvars.iv104 to i32
  br label %.critedge6

.critedge6:                                       ; preds = %189, %.critedge6.loopexit.split.loop.exit129, %179
  %.0.lcssa = phi i32 [ %180, %179 ], [ %190, %.critedge6.loopexit.split.loop.exit129 ], [ %184, %189 ]
  %191 = load i32, ptr @tx, align 4, !tbaa !5
  %192 = add nsw i32 %.pre119, 1
  call void @_Z9outerMoveiiii(i32 noundef %191, i32 noundef %176, i32 noundef %.0.lcssa, i32 noundef %192)
  %193 = load i32, ptr @sx, align 4, !tbaa !5
  %194 = load i32, ptr @sy, align 4, !tbaa !5
  %195 = load i32, ptr @yR, align 4, !tbaa !5
  %196 = add nsw i32 %195, 1
  call void @_Z9outerMoveiiii(i32 noundef %193, i32 noundef %194, i32 noundef %193, i32 noundef %196)
  br label %.loopexit

.loopexit:                                        ; preds = %.preheader, %.preheader.preheader, %175, %.critedge6
  %197 = load i32, ptr @n, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [1000001 x i8], ptr @buf, i64 0, i64 %198
  store i8 0, ptr %199, align 1, !tbaa !24
  %200 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @buf)
  br label %201

201:                                              ; preds = %.loopexit, %44, %5
  ret i32 0
}

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

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

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

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

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

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


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