; LLVM IR from tangjz/acm-icpc :: codeforces/gym (101412E)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"struct.std::pair" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@px = external dso_local global i32, align 4
@py = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@pos = external dso_local global [8 x i32], align 16
@que = external dso_local global [8 x [2500 x i32]], align 16
@L = external dso_local global i32, align 4
@R = external dso_local global i32, align 4
@dis = external dso_local global [8 x [2500 x i32]], align 16
@str = external dso_local global [50 x [51 x i8]], align 16
@dist = external dso_local global [10000 x i32], align 16
@e = external dso_local global [10000 x %"class.std::vector"], align 16
@Q = external dso_local global %"class.std::priority_queue", align 8
@vis = external dso_local global [10000 x i8], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@_ZL2dx = external hidden constant [4 x i32], align 16
@_ZL2dy = external hidden constant [4 x i32], align 16
@_ZL3dxx = external hidden constant [8 x i32], align 16
@_ZL3dyy = external hidden constant [8 x i32], align 16
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 personality ptr @__gxx_personality_v0 {
  %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
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca %"struct.std::pair", align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i8, align 1
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  %39 = alloca i32, align 4
  %40 = alloca %"class.std::vector", align 8
  %41 = alloca ptr, align 8
  %42 = alloca i32, align 4
  %43 = alloca %"struct.std::pair", align 4
  %44 = alloca i32, align 4
  %45 = alloca i32, align 4
  %46 = alloca i32, align 4
  %47 = alloca i32, align 4
  %48 = alloca i32, align 4
  %49 = alloca i32, align 4
  %50 = alloca i32, align 4
  %51 = alloca i32, align 4
  %52 = alloca i32, align 4
  %53 = alloca i32, align 4
  %54 = alloca i32, align 4
  %55 = alloca i32, align 4
  %56 = alloca i32, align 4
  %57 = alloca i32, align 4
  %58 = alloca i32, align 4
  %59 = alloca %"struct.std::pair", align 4
  %60 = alloca i32, align 4
  %61 = alloca i32, align 4
  %62 = alloca i32, align 4
  %63 = alloca i32, align 4
  %64 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %65 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %66 = alloca i32, align 4
  %67 = alloca i32, align 4
  %68 = alloca %"struct.std::pair", align 4
  %69 = alloca i32, align 4
  %70 = alloca i32, align 4
  %71 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  br label %72

72:                                               ; preds = %991, %154, %0
  %73 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  %74 = icmp eq i32 %73, 2
  br i1 %74, label %75, label %80

75:                                               ; preds = %72
  %76 = load i32, ptr @n, align 4, !tbaa !5
  %77 = load i32, ptr @m, align 4, !tbaa !5
  %78 = add nsw i32 %76, %77
  %79 = icmp ne i32 %78, 0
  br label %80

80:                                               ; preds = %75, %72
  %81 = phi i1 [ false, %72 ], [ %79, %75 ]
  br i1 %81, label %82, label %994

82:                                               ; preds = %80
  store i32 -1, ptr @py, align 4, !tbaa !5
  store i32 -1, ptr @px, align 4, !tbaa !5
  store i32 0, ptr @tot, 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 %83

83:                                               ; preds = %145, %82
  %84 = load i32, ptr %2, align 4, !tbaa !5
  %85 = load i32, ptr @n, align 4, !tbaa !5
  %86 = icmp slt i32 %84, %85
  br i1 %86, label %88, label %87

87:                                               ; preds = %83
  store i32 4, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %148

88:                                               ; preds = %83
  %89 = load i32, ptr %2, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [50 x [51 x i8]], ptr @str, i64 0, i64 %90
  %92 = getelementptr inbounds [51 x i8], ptr %91, i64 0, i64 0
  %93 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %92)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %94

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

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

99:                                               ; preds = %94
  %100 = load i32, ptr %2, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [50 x [51 x i8]], ptr @str, i64 0, i64 %101
  %103 = load i32, ptr %4, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [51 x i8], ptr %102, i64 0, i64 %104
  %106 = load i8, ptr %105, align 1, !tbaa !9
  %107 = sext i8 %106 to i32
  %108 = icmp eq i32 %107, 46
  br i1 %108, label %109, label %117

109:                                              ; preds = %99
  %110 = load i32, ptr %2, align 4, !tbaa !5
  %111 = load i32, ptr %4, align 4, !tbaa !5
  %112 = call noundef i32 @_Z5idx_1ii(i32 noundef %110, i32 noundef %111)
  %113 = load i32, ptr @tot, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr @tot, align 4, !tbaa !5
  %115 = sext i32 %113 to i64
  %116 = getelementptr inbounds [8 x i32], ptr @pos, i64 0, i64 %115
  store i32 %112, ptr %116, align 4, !tbaa !5
  br label %117

117:                                              ; preds = %109, %99
  %118 = load i32, ptr %2, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [50 x [51 x i8]], ptr @str, i64 0, i64 %119
  %121 = load i32, ptr %4, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [51 x i8], ptr %120, i64 0, i64 %122
  %124 = load i8, ptr %123, align 1, !tbaa !9
  %125 = sext i8 %124 to i32
  %126 = icmp eq i32 %125, 88
  br i1 %126, label %127, label %140

127:                                              ; preds = %117
  %128 = load i32, ptr @px, align 4, !tbaa !5
  %129 = icmp eq i32 %128, -1
  br i1 %129, label %130, label %133

130:                                              ; preds = %127
  %131 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %131, ptr @px, align 4, !tbaa !5
  %132 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %132, ptr @py, align 4, !tbaa !5
  br label %133

133:                                              ; preds = %130, %127
  %134 = load i32, ptr %2, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [50 x [51 x i8]], ptr @str, i64 0, i64 %135
  %137 = load i32, ptr %4, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [51 x i8], ptr %136, i64 0, i64 %138
  store i8 42, ptr %139, align 1, !tbaa !9
  br label %140

140:                                              ; preds = %133, %117
  br label %141

141:                                              ; preds = %140
  %142 = load i32, ptr %4, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %4, align 4, !tbaa !5
  br label %94, !llvm.loop !10

144:                                              ; preds = %98
  br label %145

145:                                              ; preds = %144
  %146 = load i32, ptr %2, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %2, align 4, !tbaa !5
  br label %83, !llvm.loop !12

148:                                              ; preds = %87
  %149 = load i32, ptr @px, align 4, !tbaa !5
  %150 = icmp ne i32 %149, 0
  br i1 %150, label %156, label %151

151:                                              ; preds = %148
  %152 = load i32, ptr @py, align 4, !tbaa !5
  %153 = icmp ne i32 %152, 0
  br i1 %153, label %156, label %154

154:                                              ; preds = %151
  %155 = call i32 @puts(ptr noundef @.str.3)
  br label %72, !llvm.loop !13

156:                                              ; preds = %151, %148
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %157

157:                                              ; preds = %268, %156
  %158 = load i32, ptr %5, align 4, !tbaa !5
  %159 = load i32, ptr @tot, align 4, !tbaa !5
  %160 = icmp slt i32 %158, %159
  br i1 %160, label %162, label %161

161:                                              ; preds = %157
  store i32 10, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %271

162:                                              ; preds = %157
  %163 = load i32, ptr %5, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %164
  %166 = getelementptr inbounds [2500 x i32], ptr %165, i64 0, i64 0
  %167 = load i32, ptr @n, align 4, !tbaa !5
  %168 = load i32, ptr @m, align 4, !tbaa !5
  %169 = mul nsw i32 %167, %168
  %170 = sext i32 %169 to i64
  %171 = mul i64 %170, 4
  call void @llvm.memset.p0.i64(ptr align 16 %166, i8 63, i64 %171, i1 false)
  store i32 0, ptr @R, align 4, !tbaa !5
  store i32 0, ptr @L, align 4, !tbaa !5
  %172 = load i32, ptr %5, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %173
  %175 = load i32, ptr %5, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [8 x i32], ptr @pos, i64 0, i64 %176
  %178 = load i32, ptr %177, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [2500 x i32], ptr %174, i64 0, i64 %179
  store i32 0, ptr %180, align 4, !tbaa !5
  %181 = load i32, ptr %5, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [8 x i32], ptr @pos, i64 0, i64 %182
  %184 = load i32, ptr %183, align 4, !tbaa !5
  %185 = load i32, ptr %5, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [8 x [2500 x i32]], ptr @que, i64 0, i64 %186
  %188 = load i32, ptr @R, align 4, !tbaa !5
  %189 = add nsw i32 %188, 1
  store i32 %189, ptr @R, align 4, !tbaa !5
  %190 = sext i32 %188 to i64
  %191 = getelementptr inbounds [2500 x i32], ptr %187, i64 0, i64 %190
  store i32 %184, ptr %191, align 4, !tbaa !5
  br label %192

192:                                              ; preds = %266, %162
  %193 = load i32, ptr @L, align 4, !tbaa !5
  %194 = load i32, ptr @R, align 4, !tbaa !5
  %195 = icmp slt i32 %193, %194
  br i1 %195, label %196, label %267

196:                                              ; preds = %192
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %197 = load i32, ptr %5, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [8 x [2500 x i32]], ptr @que, i64 0, i64 %198
  %200 = load i32, ptr @L, align 4, !tbaa !5
  %201 = add nsw i32 %200, 1
  store i32 %201, ptr @L, align 4, !tbaa !5
  %202 = sext i32 %200 to i64
  %203 = getelementptr inbounds [2500 x i32], ptr %199, i64 0, i64 %202
  %204 = load i32, ptr %203, align 4, !tbaa !5
  store i32 %204, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %205 = load i32, ptr %6, align 4, !tbaa !5
  call void @_Z5rdx_1iRiS_(i32 noundef %205, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %206

206:                                              ; preds = %263, %196
  %207 = load i32, ptr %9, align 4, !tbaa !5
  %208 = icmp slt i32 %207, 4
  br i1 %208, label %210, label %209

209:                                              ; preds = %206
  store i32 15, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %266

210:                                              ; preds = %206
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %211 = load i32, ptr %7, align 4, !tbaa !5
  %212 = load i32, ptr %9, align 4, !tbaa !5
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [4 x i32], ptr @_ZL2dx, i64 0, i64 %213
  %215 = load i32, ptr %214, align 4, !tbaa !5
  %216 = add nsw i32 %211, %215
  store i32 %216, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %217 = load i32, ptr %8, align 4, !tbaa !5
  %218 = load i32, ptr %9, align 4, !tbaa !5
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds [4 x i32], ptr @_ZL2dy, i64 0, i64 %219
  %221 = load i32, ptr %220, align 4, !tbaa !5
  %222 = add nsw i32 %217, %221
  store i32 %222, ptr %11, align 4, !tbaa !5
  %223 = load i32, ptr %10, align 4, !tbaa !5
  %224 = load i32, ptr %11, align 4, !tbaa !5
  %225 = call noundef zeroext i1 @_Z5validii(i32 noundef %223, i32 noundef %224)
  br i1 %225, label %226, label %262

226:                                              ; preds = %210
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %227 = load i32, ptr %10, align 4, !tbaa !5
  %228 = load i32, ptr %11, align 4, !tbaa !5
  %229 = call noundef i32 @_Z5idx_1ii(i32 noundef %227, i32 noundef %228)
  store i32 %229, ptr %12, align 4, !tbaa !5
  %230 = load i32, ptr %5, align 4, !tbaa !5
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %231
  %233 = load i32, ptr %12, align 4, !tbaa !5
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [2500 x i32], ptr %232, i64 0, i64 %234
  %236 = load i32, ptr %235, align 4, !tbaa !5
  %237 = icmp eq i32 %236, 1061109567
  br i1 %237, label %238, label %261

238:                                              ; preds = %226
  %239 = load i32, ptr %5, align 4, !tbaa !5
  %240 = sext i32 %239 to i64
  %241 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %240
  %242 = load i32, ptr %6, align 4, !tbaa !5
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds [2500 x i32], ptr %241, i64 0, i64 %243
  %245 = load i32, ptr %244, align 4, !tbaa !5
  %246 = add nsw i32 %245, 1
  %247 = load i32, ptr %5, align 4, !tbaa !5
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %248
  %250 = load i32, ptr %12, align 4, !tbaa !5
  %251 = sext i32 %250 to i64
  %252 = getelementptr inbounds [2500 x i32], ptr %249, i64 0, i64 %251
  store i32 %246, ptr %252, align 4, !tbaa !5
  %253 = load i32, ptr %12, align 4, !tbaa !5
  %254 = load i32, ptr %5, align 4, !tbaa !5
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [8 x [2500 x i32]], ptr @que, i64 0, i64 %255
  %257 = load i32, ptr @R, align 4, !tbaa !5
  %258 = add nsw i32 %257, 1
  store i32 %258, ptr @R, align 4, !tbaa !5
  %259 = sext i32 %257 to i64
  %260 = getelementptr inbounds [2500 x i32], ptr %256, i64 0, i64 %259
  store i32 %253, ptr %260, align 4, !tbaa !5
  br label %261

261:                                              ; preds = %238, %226
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %262

262:                                              ; preds = %261, %210
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %263

263:                                              ; preds = %262
  %264 = load i32, ptr %9, align 4, !tbaa !5
  %265 = add nsw i32 %264, 1
  store i32 %265, ptr %9, align 4, !tbaa !5
  br label %206, !llvm.loop !14

266:                                              ; preds = %209
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %192, !llvm.loop !15

267:                                              ; preds = %192
  br label %268

268:                                              ; preds = %267
  %269 = load i32, ptr %5, align 4, !tbaa !5
  %270 = add nsw i32 %269, 1
  store i32 %270, ptr %5, align 4, !tbaa !5
  br label %157, !llvm.loop !16

271:                                              ; preds = %161
  br label %272

272:                                              ; preds = %275, %271
  %273 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %274 = xor i1 %273, true
  br i1 %274, label %275, label %276

275:                                              ; preds = %272
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  br label %272, !llvm.loop !17

276:                                              ; preds = %272
  %277 = load i32, ptr @n, align 4, !tbaa !5
  %278 = load i32, ptr @m, align 4, !tbaa !5
  %279 = mul nsw i32 %277, %278
  %280 = mul nsw i32 %279, 4
  %281 = sext i32 %280 to i64
  %282 = mul i64 %281, 4
  call void @llvm.memset.p0.i64(ptr align 16 @dist, i8 63, i64 %282, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %283

283:                                              ; preds = %375, %276
  %284 = load i32, ptr %13, align 4, !tbaa !5
  %285 = icmp slt i32 %284, 4
  br i1 %285, label %287, label %286

286:                                              ; preds = %283
  store i32 20, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %378

287:                                              ; preds = %283
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %288 = load i32, ptr @px, align 4, !tbaa !5
  %289 = load i32, ptr %13, align 4, !tbaa !5
  %290 = shl i32 %289, 1
  %291 = sext i32 %290 to i64
  %292 = getelementptr inbounds [8 x i32], ptr @_ZL3dxx, i64 0, i64 %291
  %293 = load i32, ptr %292, align 4, !tbaa !5
  %294 = add nsw i32 %288, %293
  store i32 %294, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %295 = load i32, ptr @py, align 4, !tbaa !5
  %296 = load i32, ptr %13, align 4, !tbaa !5
  %297 = shl i32 %296, 1
  %298 = sext i32 %297 to i64
  %299 = getelementptr inbounds [8 x i32], ptr @_ZL3dyy, i64 0, i64 %298
  %300 = load i32, ptr %299, align 4, !tbaa !5
  %301 = add nsw i32 %295, %300
  store i32 %301, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %302 = load i32, ptr @px, align 4, !tbaa !5
  %303 = load i32, ptr %13, align 4, !tbaa !5
  %304 = shl i32 %303, 1
  %305 = or i32 %304, 1
  %306 = sext i32 %305 to i64
  %307 = getelementptr inbounds [8 x i32], ptr @_ZL3dxx, i64 0, i64 %306
  %308 = load i32, ptr %307, align 4, !tbaa !5
  %309 = add nsw i32 %302, %308
  store i32 %309, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %310 = load i32, ptr @py, align 4, !tbaa !5
  %311 = load i32, ptr %13, align 4, !tbaa !5
  %312 = shl i32 %311, 1
  %313 = or i32 %312, 1
  %314 = sext i32 %313 to i64
  %315 = getelementptr inbounds [8 x i32], ptr @_ZL3dyy, i64 0, i64 %314
  %316 = load i32, ptr %315, align 4, !tbaa !5
  %317 = add nsw i32 %310, %316
  store i32 %317, ptr %17, align 4, !tbaa !5
  %318 = load i32, ptr %14, align 4, !tbaa !5
  %319 = load i32, ptr %15, align 4, !tbaa !5
  %320 = call noundef zeroext i1 @_Z5validii(i32 noundef %318, i32 noundef %319)
  br i1 %320, label %321, label %374

321:                                              ; preds = %287
  %322 = load i32, ptr %16, align 4, !tbaa !5
  %323 = load i32, ptr %17, align 4, !tbaa !5
  %324 = call noundef zeroext i1 @_Z5validii(i32 noundef %322, i32 noundef %323)
  br i1 %324, label %325, label %374

325:                                              ; preds = %321
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %326 = load i32, ptr %14, align 4, !tbaa !5
  %327 = load i32, ptr %15, align 4, !tbaa !5
  %328 = call noundef i32 @_Z5idx_1ii(i32 noundef %326, i32 noundef %327)
  store i32 %328, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %329 = load i32, ptr %16, align 4, !tbaa !5
  %330 = load i32, ptr %17, align 4, !tbaa !5
  %331 = call noundef i32 @_Z5idx_1ii(i32 noundef %329, i32 noundef %330)
  store i32 %331, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %332 = load i32, ptr @px, align 4, !tbaa !5
  %333 = load i32, ptr @py, align 4, !tbaa !5
  %334 = load i32, ptr %13, align 4, !tbaa !5
  %335 = call noundef i32 @_Z5idx_2iii(i32 noundef %332, i32 noundef %333, i32 noundef %334)
  store i32 %335, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  %336 = load i32, ptr %18, align 4, !tbaa !5
  %337 = sext i32 %336 to i64
  %338 = getelementptr inbounds [2500 x i32], ptr @dis, i64 0, i64 %337
  %339 = load i32, ptr %338, align 4, !tbaa !5
  %340 = load i32, ptr %19, align 4, !tbaa !5
  %341 = sext i32 %340 to i64
  %342 = getelementptr inbounds [2500 x i32], ptr getelementptr inbounds ([8 x [2500 x i32]], ptr @dis, i64 0, i64 1), i64 0, i64 %341
  %343 = load i32, ptr %342, align 4, !tbaa !5
  %344 = add nsw i32 %339, %343
  store i32 %344, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %345 = load i32, ptr %19, align 4, !tbaa !5
  %346 = sext i32 %345 to i64
  %347 = getelementptr inbounds [2500 x i32], ptr @dis, i64 0, i64 %346
  %348 = load i32, ptr %347, align 4, !tbaa !5
  %349 = load i32, ptr %18, align 4, !tbaa !5
  %350 = sext i32 %349 to i64
  %351 = getelementptr inbounds [2500 x i32], ptr getelementptr inbounds ([8 x [2500 x i32]], ptr @dis, i64 0, i64 1), i64 0, i64 %350
  %352 = load i32, ptr %351, align 4, !tbaa !5
  %353 = add nsw i32 %348, %352
  store i32 %353, ptr %22, align 4, !tbaa !5
  %354 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(4) %22)
  %355 = load i32, ptr %354, align 4, !tbaa !5
  %356 = load i32, ptr %20, align 4, !tbaa !5
  %357 = sext i32 %356 to i64
  %358 = getelementptr inbounds [10000 x i32], ptr @dist, i64 0, i64 %357
  store i32 %355, ptr %358, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  %359 = load i32, ptr %20, align 4, !tbaa !5
  %360 = sext i32 %359 to i64
  %361 = getelementptr inbounds [10000 x i32], ptr @dist, i64 0, i64 %360
  %362 = load i32, ptr %361, align 4, !tbaa !5
  %363 = icmp slt i32 %362, 1061109567
  br i1 %363, label %364, label %369

364:                                              ; preds = %325
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %365 = load i32, ptr %20, align 4, !tbaa !5
  %366 = sext i32 %365 to i64
  %367 = getelementptr inbounds [10000 x i32], ptr @dist, i64 0, i64 %366
  %368 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %367, ptr noundef nonnull align 4 dereferenceable(4) %20)
  store i64 %368, ptr %23, align 4
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(8) %23)
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %373

369:                                              ; preds = %325
  %370 = load i32, ptr %20, align 4, !tbaa !5
  %371 = sext i32 %370 to i64
  %372 = getelementptr inbounds [10000 x i32], ptr @dist, i64 0, i64 %371
  store i32 1061109567, ptr %372, align 4, !tbaa !5
  br label %373

373:                                              ; preds = %369, %364
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %374

374:                                              ; preds = %373, %321, %287
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %375

375:                                              ; preds = %374
  %376 = load i32, ptr %13, align 4, !tbaa !5
  %377 = add nsw i32 %376, 1
  store i32 %377, ptr %13, align 4, !tbaa !5
  br label %283, !llvm.loop !18

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

379:                                              ; preds = %403, %378
  %380 = load i32, ptr %24, align 4, !tbaa !5
  %381 = icmp slt i32 %380, 2
  br i1 %381, label %383, label %382

382:                                              ; preds = %379
  store i32 23, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %406

383:                                              ; preds = %379
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  store i32 0, ptr %25, align 4, !tbaa !5
  br label %384

384:                                              ; preds = %399, %383
  %385 = load i32, ptr %25, align 4, !tbaa !5
  %386 = icmp slt i32 %385, 2
  br i1 %386, label %388, label %387

387:                                              ; preds = %384
  store i32 26, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %402

388:                                              ; preds = %384
  %389 = load i32, ptr @px, align 4, !tbaa !5
  %390 = load i32, ptr %24, align 4, !tbaa !5
  %391 = add nsw i32 %389, %390
  %392 = sext i32 %391 to i64
  %393 = getelementptr inbounds [50 x [51 x i8]], ptr @str, i64 0, i64 %392
  %394 = load i32, ptr @py, align 4, !tbaa !5
  %395 = load i32, ptr %25, align 4, !tbaa !5
  %396 = add nsw i32 %394, %395
  %397 = sext i32 %396 to i64
  %398 = getelementptr inbounds [51 x i8], ptr %393, i64 0, i64 %397
  store i8 111, ptr %398, align 1, !tbaa !9
  br label %399

399:                                              ; preds = %388
  %400 = load i32, ptr %25, align 4, !tbaa !5
  %401 = add nsw i32 %400, 1
  store i32 %401, ptr %25, align 4, !tbaa !5
  br label %384, !llvm.loop !19

402:                                              ; preds = %387
  br label %403

403:                                              ; preds = %402
  %404 = load i32, ptr %24, align 4, !tbaa !5
  %405 = add nsw i32 %404, 1
  store i32 %405, ptr %24, align 4, !tbaa !5
  br label %379, !llvm.loop !20

406:                                              ; preds = %382
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  store i32 0, ptr %26, align 4, !tbaa !5
  br label %407

407:                                              ; preds = %883, %406
  %408 = load i32, ptr %26, align 4, !tbaa !5
  %409 = load i32, ptr @n, align 4, !tbaa !5
  %410 = icmp slt i32 %408, %409
  br i1 %410, label %412, label %411

411:                                              ; preds = %407
  store i32 29, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  br label %886

412:                                              ; preds = %407
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  store i32 0, ptr %27, align 4, !tbaa !5
  br label %413

413:                                              ; preds = %879, %412
  %414 = load i32, ptr %27, align 4, !tbaa !5
  %415 = load i32, ptr @m, align 4, !tbaa !5
  %416 = icmp slt i32 %414, %415
  br i1 %416, label %418, label %417

417:                                              ; preds = %413
  store i32 32, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  br label %882

418:                                              ; preds = %413
  call void @llvm.lifetime.start.p0(i64 1, ptr %28) #7
  store i8 1, ptr %28, align 1, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #7
  store i32 0, ptr %29, align 4, !tbaa !5
  br label %419

419:                                              ; preds = %457, %418
  %420 = load i32, ptr %29, align 4, !tbaa !5
  %421 = icmp slt i32 %420, 2
  br i1 %421, label %422, label %425

422:                                              ; preds = %419
  %423 = load i8, ptr %28, align 1, !tbaa !21, !range !23, !noundef !24
  %424 = trunc i8 %423 to i1
  br label %425

425:                                              ; preds = %422, %419
  %426 = phi i1 [ false, %419 ], [ %424, %422 ]
  br i1 %426, label %428, label %427

427:                                              ; preds = %425
  store i32 35, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  br label %460

428:                                              ; preds = %425
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #7
  store i32 0, ptr %30, align 4, !tbaa !5
  br label %429

429:                                              ; preds = %453, %428
  %430 = load i32, ptr %30, align 4, !tbaa !5
  %431 = icmp slt i32 %430, 2
  br i1 %431, label %432, label %435

432:                                              ; preds = %429
  %433 = load i8, ptr %28, align 1, !tbaa !21, !range !23, !noundef !24
  %434 = trunc i8 %433 to i1
  br label %435

435:                                              ; preds = %432, %429
  %436 = phi i1 [ false, %429 ], [ %434, %432 ]
  br i1 %436, label %438, label %437

437:                                              ; preds = %435
  store i32 38, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #7
  br label %456

438:                                              ; preds = %435
  %439 = load i32, ptr %26, align 4, !tbaa !5
  %440 = load i32, ptr %29, align 4, !tbaa !5
  %441 = add nsw i32 %439, %440
  %442 = load i32, ptr %27, align 4, !tbaa !5
  %443 = load i32, ptr %30, align 4, !tbaa !5
  %444 = add nsw i32 %442, %443
  %445 = call noundef zeroext i1 @_Z5validii(i32 noundef %441, i32 noundef %444)
  %446 = zext i1 %445 to i32
  %447 = load i8, ptr %28, align 1, !tbaa !21, !range !23, !noundef !24
  %448 = trunc i8 %447 to i1
  %449 = zext i1 %448 to i32
  %450 = and i32 %449, %446
  %451 = icmp ne i32 %450, 0
  %452 = zext i1 %451 to i8
  store i8 %452, ptr %28, align 1, !tbaa !21
  br label %453

453:                                              ; preds = %438
  %454 = load i32, ptr %30, align 4, !tbaa !5
  %455 = add nsw i32 %454, 1
  store i32 %455, ptr %30, align 4, !tbaa !5
  br label %429, !llvm.loop !25

456:                                              ; preds = %437
  br label %457

457:                                              ; preds = %456
  %458 = load i32, ptr %29, align 4, !tbaa !5
  %459 = add nsw i32 %458, 1
  store i32 %459, ptr %29, align 4, !tbaa !5
  br label %419, !llvm.loop !26

460:                                              ; preds = %427
  %461 = load i8, ptr %28, align 1, !tbaa !21, !range !23, !noundef !24
  %462 = trunc i8 %461 to i1
  br i1 %462, label %464, label %463

463:                                              ; preds = %460
  store i32 34, ptr %3, align 4
  br label %876

464:                                              ; preds = %460
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #7
  store i32 0, ptr %31, align 4, !tbaa !5
  br label %465

465:                                              ; preds = %489, %464
  %466 = load i32, ptr %31, align 4, !tbaa !5
  %467 = icmp slt i32 %466, 2
  br i1 %467, label %469, label %468

468:                                              ; preds = %465
  store i32 41, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  br label %492

469:                                              ; preds = %465
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #7
  store i32 0, ptr %32, align 4, !tbaa !5
  br label %470

470:                                              ; preds = %485, %469
  %471 = load i32, ptr %32, align 4, !tbaa !5
  %472 = icmp slt i32 %471, 2
  br i1 %472, label %474, label %473

473:                                              ; preds = %470
  store i32 44, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #7
  br label %488

474:                                              ; preds = %470
  %475 = load i32, ptr %26, align 4, !tbaa !5
  %476 = load i32, ptr %31, align 4, !tbaa !5
  %477 = add nsw i32 %475, %476
  %478 = sext i32 %477 to i64
  %479 = getelementptr inbounds [50 x [51 x i8]], ptr @str, i64 0, i64 %478
  %480 = load i32, ptr %27, align 4, !tbaa !5
  %481 = load i32, ptr %32, align 4, !tbaa !5
  %482 = add nsw i32 %480, %481
  %483 = sext i32 %482 to i64
  %484 = getelementptr inbounds [51 x i8], ptr %479, i64 0, i64 %483
  store i8 42, ptr %484, align 1, !tbaa !9
  br label %485

485:                                              ; preds = %474
  %486 = load i32, ptr %32, align 4, !tbaa !5
  %487 = add nsw i32 %486, 1
  store i32 %487, ptr %32, align 4, !tbaa !5
  br label %470, !llvm.loop !27

488:                                              ; preds = %473
  br label %489

489:                                              ; preds = %488
  %490 = load i32, ptr %31, align 4, !tbaa !5
  %491 = add nsw i32 %490, 1
  store i32 %491, ptr %31, align 4, !tbaa !5
  br label %465, !llvm.loop !28

492:                                              ; preds = %468
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #7
  store i32 0, ptr %33, align 4, !tbaa !5
  br label %493

493:                                              ; preds = %597, %492
  %494 = load i32, ptr %33, align 4, !tbaa !5
  %495 = icmp slt i32 %494, 4
  br i1 %495, label %497, label %496

496:                                              ; preds = %493
  store i32 47, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #7
  br label %600

497:                                              ; preds = %493
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #7
  %498 = load i32, ptr %26, align 4, !tbaa !5
  %499 = load i32, ptr %33, align 4, !tbaa !5
  %500 = shl i32 %499, 1
  %501 = sext i32 %500 to i64
  %502 = getelementptr inbounds [8 x i32], ptr @_ZL3dxx, i64 0, i64 %501
  %503 = load i32, ptr %502, align 4, !tbaa !5
  %504 = add nsw i32 %498, %503
  store i32 %504, ptr %34, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #7
  %505 = load i32, ptr %27, align 4, !tbaa !5
  %506 = load i32, ptr %33, align 4, !tbaa !5
  %507 = shl i32 %506, 1
  %508 = sext i32 %507 to i64
  %509 = getelementptr inbounds [8 x i32], ptr @_ZL3dyy, i64 0, i64 %508
  %510 = load i32, ptr %509, align 4, !tbaa !5
  %511 = add nsw i32 %505, %510
  store i32 %511, ptr %35, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #7
  %512 = load i32, ptr %26, align 4, !tbaa !5
  %513 = load i32, ptr %33, align 4, !tbaa !5
  %514 = shl i32 %513, 1
  %515 = or i32 %514, 1
  %516 = sext i32 %515 to i64
  %517 = getelementptr inbounds [8 x i32], ptr @_ZL3dxx, i64 0, i64 %516
  %518 = load i32, ptr %517, align 4, !tbaa !5
  %519 = add nsw i32 %512, %518
  store i32 %519, ptr %36, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #7
  %520 = load i32, ptr %27, align 4, !tbaa !5
  %521 = load i32, ptr %33, align 4, !tbaa !5
  %522 = shl i32 %521, 1
  %523 = or i32 %522, 1
  %524 = sext i32 %523 to i64
  %525 = getelementptr inbounds [8 x i32], ptr @_ZL3dyy, i64 0, i64 %524
  %526 = load i32, ptr %525, align 4, !tbaa !5
  %527 = add nsw i32 %520, %526
  store i32 %527, ptr %37, align 4, !tbaa !5
  %528 = load i32, ptr %34, align 4, !tbaa !5
  %529 = load i32, ptr %35, align 4, !tbaa !5
  %530 = call noundef zeroext i1 @_Z5validii(i32 noundef %528, i32 noundef %529)
  br i1 %530, label %531, label %586

531:                                              ; preds = %497
  %532 = load i32, ptr %36, align 4, !tbaa !5
  %533 = load i32, ptr %37, align 4, !tbaa !5
  %534 = call noundef zeroext i1 @_Z5validii(i32 noundef %532, i32 noundef %533)
  br i1 %534, label %535, label %586

535:                                              ; preds = %531
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #7
  %536 = load i32, ptr %26, align 4, !tbaa !5
  %537 = load i32, ptr %33, align 4, !tbaa !5
  %538 = sext i32 %537 to i64
  %539 = getelementptr inbounds [4 x i32], ptr @_ZL2dx, i64 0, i64 %538
  %540 = load i32, ptr %539, align 4, !tbaa !5
  %541 = add nsw i32 %536, %540
  store i32 %541, ptr %38, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #7
  %542 = load i32, ptr %27, align 4, !tbaa !5
  %543 = load i32, ptr %33, align 4, !tbaa !5
  %544 = sext i32 %543 to i64
  %545 = getelementptr inbounds [4 x i32], ptr @_ZL2dy, i64 0, i64 %544
  %546 = load i32, ptr %545, align 4, !tbaa !5
  %547 = add nsw i32 %542, %546
  store i32 %547, ptr %39, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %40) #7
  call void @llvm.memset.p0.i64(ptr align 8 %40, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %40) #7
  %548 = load i32, ptr %26, align 4, !tbaa !5
  %549 = load i32, ptr %27, align 4, !tbaa !5
  %550 = load i32, ptr %33, align 4, !tbaa !5
  %551 = invoke noundef i32 @_Z5idx_2iii(i32 noundef %548, i32 noundef %549, i32 noundef %550)
          to label %552 unwind label %582

552:                                              ; preds = %535
  %553 = sext i32 %551 to i64
  %554 = getelementptr inbounds [10000 x %"class.std::vector"], ptr @e, i64 0, i64 %553
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE4swapERS3_(ptr noundef nonnull align 8 dereferenceable(24) %40, ptr noundef nonnull align 8 dereferenceable(24) %554) #7
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %40) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %40) #7
  %555 = load i32, ptr %26, align 4, !tbaa !5
  %556 = load i32, ptr %27, align 4, !tbaa !5
  %557 = load i32, ptr %33, align 4, !tbaa !5
  %558 = call noundef i32 @_Z5idx_2iii(i32 noundef %555, i32 noundef %556, i32 noundef %557)
  %559 = sext i32 %558 to i64
  %560 = getelementptr inbounds [10000 x %"class.std::vector"], ptr @e, i64 0, i64 %559
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #7
  store i32 1, ptr %44, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %45) #7
  %561 = load i32, ptr %38, align 4, !tbaa !5
  %562 = load i32, ptr %39, align 4, !tbaa !5
  %563 = load i32, ptr %33, align 4, !tbaa !5
  %564 = sub nsw i32 3, %563
  %565 = call noundef i32 @_Z5idx_2iii(i32 noundef %561, i32 noundef %562, i32 noundef %564)
  store i32 %565, ptr %45, align 4, !tbaa !5
  %566 = call i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %44, ptr noundef nonnull align 4 dereferenceable(4) %45)
  store i64 %566, ptr %43, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %560, ptr noundef nonnull align 4 dereferenceable(8) %43)
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #7
  %567 = load i32, ptr %34, align 4, !tbaa !5
  %568 = load i32, ptr %35, align 4, !tbaa !5
  %569 = call noundef i32 @_Z5idx_1ii(i32 noundef %567, i32 noundef %568)
  %570 = load i32, ptr %33, align 4, !tbaa !5
  %571 = shl i32 %570, 1
  %572 = sext i32 %571 to i64
  %573 = getelementptr inbounds [8 x i32], ptr @pos, i64 0, i64 %572
  store i32 %569, ptr %573, align 4, !tbaa !5
  %574 = load i32, ptr %36, align 4, !tbaa !5
  %575 = load i32, ptr %37, align 4, !tbaa !5
  %576 = call noundef i32 @_Z5idx_1ii(i32 noundef %574, i32 noundef %575)
  %577 = load i32, ptr %33, align 4, !tbaa !5
  %578 = shl i32 %577, 1
  %579 = or i32 %578, 1
  %580 = sext i32 %579 to i64
  %581 = getelementptr inbounds [8 x i32], ptr @pos, i64 0, i64 %580
  store i32 %576, ptr %581, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #7
  br label %596

582:                                              ; preds = %535
  %583 = landingpad { ptr, i32 }
          cleanup
  %584 = extractvalue { ptr, i32 } %583, 0
  store ptr %584, ptr %41, align 8
  %585 = extractvalue { ptr, i32 } %583, 1
  store i32 %585, ptr %42, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %40) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %40) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  br label %995

586:                                              ; preds = %531, %497
  %587 = load i32, ptr %33, align 4, !tbaa !5
  %588 = shl i32 %587, 1
  %589 = or i32 %588, 1
  %590 = sext i32 %589 to i64
  %591 = getelementptr inbounds [8 x i32], ptr @pos, i64 0, i64 %590
  store i32 -1, ptr %591, align 4, !tbaa !5
  %592 = load i32, ptr %33, align 4, !tbaa !5
  %593 = shl i32 %592, 1
  %594 = sext i32 %593 to i64
  %595 = getelementptr inbounds [8 x i32], ptr @pos, i64 0, i64 %594
  store i32 -1, ptr %595, align 4, !tbaa !5
  br label %596

596:                                              ; preds = %586, %552
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #7
  br label %597

597:                                              ; preds = %596
  %598 = load i32, ptr %33, align 4, !tbaa !5
  %599 = add nsw i32 %598, 1
  store i32 %599, ptr %33, align 4, !tbaa !5
  br label %493, !llvm.loop !29

600:                                              ; preds = %496
  call void @llvm.lifetime.start.p0(i64 4, ptr %46) #7
  store i32 0, ptr %46, align 4, !tbaa !5
  br label %601

601:                                              ; preds = %718, %600
  %602 = load i32, ptr %46, align 4, !tbaa !5
  %603 = icmp slt i32 %602, 8
  br i1 %603, label %605, label %604

604:                                              ; preds = %601
  store i32 50, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %46) #7
  br label %721

605:                                              ; preds = %601
  %606 = load i32, ptr %46, align 4, !tbaa !5
  %607 = sext i32 %606 to i64
  %608 = getelementptr inbounds [8 x i32], ptr @pos, i64 0, i64 %607
  %609 = load i32, ptr %608, align 4, !tbaa !5
  %610 = icmp eq i32 %609, -1
  br i1 %610, label %611, label %612

611:                                              ; preds = %605
  br label %718

612:                                              ; preds = %605
  %613 = load i32, ptr %46, align 4, !tbaa !5
  %614 = sext i32 %613 to i64
  %615 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %614
  %616 = getelementptr inbounds [2500 x i32], ptr %615, i64 0, i64 0
  %617 = load i32, ptr @n, align 4, !tbaa !5
  %618 = load i32, ptr @m, align 4, !tbaa !5
  %619 = mul nsw i32 %617, %618
  %620 = sext i32 %619 to i64
  %621 = mul i64 %620, 4
  call void @llvm.memset.p0.i64(ptr align 16 %616, i8 63, i64 %621, i1 false)
  store i32 0, ptr @R, align 4, !tbaa !5
  store i32 0, ptr @L, align 4, !tbaa !5
  %622 = load i32, ptr %46, align 4, !tbaa !5
  %623 = sext i32 %622 to i64
  %624 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %623
  %625 = load i32, ptr %46, align 4, !tbaa !5
  %626 = sext i32 %625 to i64
  %627 = getelementptr inbounds [8 x i32], ptr @pos, i64 0, i64 %626
  %628 = load i32, ptr %627, align 4, !tbaa !5
  %629 = sext i32 %628 to i64
  %630 = getelementptr inbounds [2500 x i32], ptr %624, i64 0, i64 %629
  store i32 0, ptr %630, align 4, !tbaa !5
  %631 = load i32, ptr %46, align 4, !tbaa !5
  %632 = sext i32 %631 to i64
  %633 = getelementptr inbounds [8 x i32], ptr @pos, i64 0, i64 %632
  %634 = load i32, ptr %633, align 4, !tbaa !5
  %635 = load i32, ptr %46, align 4, !tbaa !5
  %636 = sext i32 %635 to i64
  %637 = getelementptr inbounds [8 x [2500 x i32]], ptr @que, i64 0, i64 %636
  %638 = load i32, ptr @R, align 4, !tbaa !5
  %639 = add nsw i32 %638, 1
  store i32 %639, ptr @R, align 4, !tbaa !5
  %640 = sext i32 %638 to i64
  %641 = getelementptr inbounds [2500 x i32], ptr %637, i64 0, i64 %640
  store i32 %634, ptr %641, align 4, !tbaa !5
  br label %642

642:                                              ; preds = %716, %612
  %643 = load i32, ptr @L, align 4, !tbaa !5
  %644 = load i32, ptr @R, align 4, !tbaa !5
  %645 = icmp slt i32 %643, %644
  br i1 %645, label %646, label %717

646:                                              ; preds = %642
  call void @llvm.lifetime.start.p0(i64 4, ptr %47) #7
  %647 = load i32, ptr %46, align 4, !tbaa !5
  %648 = sext i32 %647 to i64
  %649 = getelementptr inbounds [8 x [2500 x i32]], ptr @que, i64 0, i64 %648
  %650 = load i32, ptr @L, align 4, !tbaa !5
  %651 = add nsw i32 %650, 1
  store i32 %651, ptr @L, align 4, !tbaa !5
  %652 = sext i32 %650 to i64
  %653 = getelementptr inbounds [2500 x i32], ptr %649, i64 0, i64 %652
  %654 = load i32, ptr %653, align 4, !tbaa !5
  store i32 %654, ptr %47, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %48) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %49) #7
  %655 = load i32, ptr %47, align 4, !tbaa !5
  call void @_Z5rdx_1iRiS_(i32 noundef %655, ptr noundef nonnull align 4 dereferenceable(4) %48, ptr noundef nonnull align 4 dereferenceable(4) %49)
  call void @llvm.lifetime.start.p0(i64 4, ptr %50) #7
  store i32 0, ptr %50, align 4, !tbaa !5
  br label %656

656:                                              ; preds = %713, %646
  %657 = load i32, ptr %50, align 4, !tbaa !5
  %658 = icmp slt i32 %657, 4
  br i1 %658, label %660, label %659

659:                                              ; preds = %656
  store i32 55, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %50) #7
  br label %716

660:                                              ; preds = %656
  call void @llvm.lifetime.start.p0(i64 4, ptr %51) #7
  %661 = load i32, ptr %48, align 4, !tbaa !5
  %662 = load i32, ptr %50, align 4, !tbaa !5
  %663 = sext i32 %662 to i64
  %664 = getelementptr inbounds [4 x i32], ptr @_ZL2dx, i64 0, i64 %663
  %665 = load i32, ptr %664, align 4, !tbaa !5
  %666 = add nsw i32 %661, %665
  store i32 %666, ptr %51, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %52) #7
  %667 = load i32, ptr %49, align 4, !tbaa !5
  %668 = load i32, ptr %50, align 4, !tbaa !5
  %669 = sext i32 %668 to i64
  %670 = getelementptr inbounds [4 x i32], ptr @_ZL2dy, i64 0, i64 %669
  %671 = load i32, ptr %670, align 4, !tbaa !5
  %672 = add nsw i32 %667, %671
  store i32 %672, ptr %52, align 4, !tbaa !5
  %673 = load i32, ptr %51, align 4, !tbaa !5
  %674 = load i32, ptr %52, align 4, !tbaa !5
  %675 = call noundef zeroext i1 @_Z5validii(i32 noundef %673, i32 noundef %674)
  br i1 %675, label %676, label %712

676:                                              ; preds = %660
  call void @llvm.lifetime.start.p0(i64 4, ptr %53) #7
  %677 = load i32, ptr %51, align 4, !tbaa !5
  %678 = load i32, ptr %52, align 4, !tbaa !5
  %679 = call noundef i32 @_Z5idx_1ii(i32 noundef %677, i32 noundef %678)
  store i32 %679, ptr %53, align 4, !tbaa !5
  %680 = load i32, ptr %46, align 4, !tbaa !5
  %681 = sext i32 %680 to i64
  %682 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %681
  %683 = load i32, ptr %53, align 4, !tbaa !5
  %684 = sext i32 %683 to i64
  %685 = getelementptr inbounds [2500 x i32], ptr %682, i64 0, i64 %684
  %686 = load i32, ptr %685, align 4, !tbaa !5
  %687 = icmp eq i32 %686, 1061109567
  br i1 %687, label %688, label %711

688:                                              ; preds = %676
  %689 = load i32, ptr %46, align 4, !tbaa !5
  %690 = sext i32 %689 to i64
  %691 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %690
  %692 = load i32, ptr %47, align 4, !tbaa !5
  %693 = sext i32 %692 to i64
  %694 = getelementptr inbounds [2500 x i32], ptr %691, i64 0, i64 %693
  %695 = load i32, ptr %694, align 4, !tbaa !5
  %696 = add nsw i32 %695, 1
  %697 = load i32, ptr %46, align 4, !tbaa !5
  %698 = sext i32 %697 to i64
  %699 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %698
  %700 = load i32, ptr %53, align 4, !tbaa !5
  %701 = sext i32 %700 to i64
  %702 = getelementptr inbounds [2500 x i32], ptr %699, i64 0, i64 %701
  store i32 %696, ptr %702, align 4, !tbaa !5
  %703 = load i32, ptr %53, align 4, !tbaa !5
  %704 = load i32, ptr %46, align 4, !tbaa !5
  %705 = sext i32 %704 to i64
  %706 = getelementptr inbounds [8 x [2500 x i32]], ptr @que, i64 0, i64 %705
  %707 = load i32, ptr @R, align 4, !tbaa !5
  %708 = add nsw i32 %707, 1
  store i32 %708, ptr @R, align 4, !tbaa !5
  %709 = sext i32 %707 to i64
  %710 = getelementptr inbounds [2500 x i32], ptr %706, i64 0, i64 %709
  store i32 %703, ptr %710, align 4, !tbaa !5
  br label %711

711:                                              ; preds = %688, %676
  call void @llvm.lifetime.end.p0(i64 4, ptr %53) #7
  br label %712

712:                                              ; preds = %711, %660
  call void @llvm.lifetime.end.p0(i64 4, ptr %52) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %51) #7
  br label %713

713:                                              ; preds = %712
  %714 = load i32, ptr %50, align 4, !tbaa !5
  %715 = add nsw i32 %714, 1
  store i32 %715, ptr %50, align 4, !tbaa !5
  br label %656, !llvm.loop !30

716:                                              ; preds = %659
  call void @llvm.lifetime.end.p0(i64 4, ptr %49) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %48) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %47) #7
  br label %642, !llvm.loop !31

717:                                              ; preds = %642
  br label %718

718:                                              ; preds = %717, %611
  %719 = load i32, ptr %46, align 4, !tbaa !5
  %720 = add nsw i32 %719, 1
  store i32 %720, ptr %46, align 4, !tbaa !5
  br label %601, !llvm.loop !32

721:                                              ; preds = %604
  call void @llvm.lifetime.start.p0(i64 4, ptr %54) #7
  store i32 0, ptr %54, align 4, !tbaa !5
  br label %722

722:                                              ; preds = %844, %721
  %723 = load i32, ptr %54, align 4, !tbaa !5
  %724 = icmp slt i32 %723, 4
  br i1 %724, label %726, label %725

725:                                              ; preds = %722
  store i32 58, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %54) #7
  br label %847

726:                                              ; preds = %722
  %727 = load i32, ptr %54, align 4, !tbaa !5
  %728 = shl i32 %727, 1
  %729 = sext i32 %728 to i64
  %730 = getelementptr inbounds [8 x i32], ptr @pos, i64 0, i64 %729
  %731 = load i32, ptr %730, align 4, !tbaa !5
  %732 = icmp ne i32 %731, -1
  br i1 %732, label %733, label %843

733:                                              ; preds = %726
  %734 = load i32, ptr %54, align 4, !tbaa !5
  %735 = shl i32 %734, 1
  %736 = or i32 %735, 1
  %737 = sext i32 %736 to i64
  %738 = getelementptr inbounds [8 x i32], ptr @pos, i64 0, i64 %737
  %739 = load i32, ptr %738, align 4, !tbaa !5
  %740 = icmp ne i32 %739, -1
  br i1 %740, label %741, label %843

741:                                              ; preds = %733
  call void @llvm.lifetime.start.p0(i64 4, ptr %55) #7
  store i32 0, ptr %55, align 4, !tbaa !5
  br label %742

742:                                              ; preds = %839, %741
  %743 = load i32, ptr %55, align 4, !tbaa !5
  %744 = icmp slt i32 %743, 4
  br i1 %744, label %746, label %745

745:                                              ; preds = %742
  store i32 61, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %55) #7
  br label %842

746:                                              ; preds = %742
  %747 = load i32, ptr %55, align 4, !tbaa !5
  %748 = shl i32 %747, 1
  %749 = sext i32 %748 to i64
  %750 = getelementptr inbounds [8 x i32], ptr @pos, i64 0, i64 %749
  %751 = load i32, ptr %750, align 4, !tbaa !5
  %752 = icmp ne i32 %751, -1
  br i1 %752, label %753, label %838

753:                                              ; preds = %746
  %754 = load i32, ptr %55, align 4, !tbaa !5
  %755 = shl i32 %754, 1
  %756 = or i32 %755, 1
  %757 = sext i32 %756 to i64
  %758 = getelementptr inbounds [8 x i32], ptr @pos, i64 0, i64 %757
  %759 = load i32, ptr %758, align 4, !tbaa !5
  %760 = icmp ne i32 %759, -1
  br i1 %760, label %761, label %838

761:                                              ; preds = %753
  %762 = load i32, ptr %54, align 4, !tbaa !5
  %763 = load i32, ptr %55, align 4, !tbaa !5
  %764 = icmp ne i32 %762, %763
  br i1 %764, label %765, label %837

765:                                              ; preds = %761
  call void @llvm.lifetime.start.p0(i64 4, ptr %56) #7
  %766 = load i32, ptr %54, align 4, !tbaa !5
  %767 = shl i32 %766, 1
  %768 = sext i32 %767 to i64
  %769 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %768
  %770 = load i32, ptr %55, align 4, !tbaa !5
  %771 = shl i32 %770, 1
  %772 = sext i32 %771 to i64
  %773 = getelementptr inbounds [8 x i32], ptr @pos, i64 0, i64 %772
  %774 = load i32, ptr %773, align 4, !tbaa !5
  %775 = sext i32 %774 to i64
  %776 = getelementptr inbounds [2500 x i32], ptr %769, i64 0, i64 %775
  %777 = load i32, ptr %776, align 4, !tbaa !5
  %778 = load i32, ptr %54, align 4, !tbaa !5
  %779 = shl i32 %778, 1
  %780 = or i32 %779, 1
  %781 = sext i32 %780 to i64
  %782 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %781
  %783 = load i32, ptr %55, align 4, !tbaa !5
  %784 = shl i32 %783, 1
  %785 = or i32 %784, 1
  %786 = sext i32 %785 to i64
  %787 = getelementptr inbounds [8 x i32], ptr @pos, i64 0, i64 %786
  %788 = load i32, ptr %787, align 4, !tbaa !5
  %789 = sext i32 %788 to i64
  %790 = getelementptr inbounds [2500 x i32], ptr %782, i64 0, i64 %789
  %791 = load i32, ptr %790, align 4, !tbaa !5
  %792 = add nsw i32 %777, %791
  store i32 %792, ptr %56, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %57) #7
  %793 = load i32, ptr %54, align 4, !tbaa !5
  %794 = shl i32 %793, 1
  %795 = sext i32 %794 to i64
  %796 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %795
  %797 = load i32, ptr %55, align 4, !tbaa !5
  %798 = shl i32 %797, 1
  %799 = or i32 %798, 1
  %800 = sext i32 %799 to i64
  %801 = getelementptr inbounds [8 x i32], ptr @pos, i64 0, i64 %800
  %802 = load i32, ptr %801, align 4, !tbaa !5
  %803 = sext i32 %802 to i64
  %804 = getelementptr inbounds [2500 x i32], ptr %796, i64 0, i64 %803
  %805 = load i32, ptr %804, align 4, !tbaa !5
  %806 = load i32, ptr %54, align 4, !tbaa !5
  %807 = shl i32 %806, 1
  %808 = or i32 %807, 1
  %809 = sext i32 %808 to i64
  %810 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %809
  %811 = load i32, ptr %55, align 4, !tbaa !5
  %812 = shl i32 %811, 1
  %813 = sext i32 %812 to i64
  %814 = getelementptr inbounds [8 x i32], ptr @pos, i64 0, i64 %813
  %815 = load i32, ptr %814, align 4, !tbaa !5
  %816 = sext i32 %815 to i64
  %817 = getelementptr inbounds [2500 x i32], ptr %810, i64 0, i64 %816
  %818 = load i32, ptr %817, align 4, !tbaa !5
  %819 = add nsw i32 %805, %818
  store i32 %819, ptr %57, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %58) #7
  %820 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %56, ptr noundef nonnull align 4 dereferenceable(4) %57)
  %821 = load i32, ptr %820, align 4, !tbaa !5
  store i32 %821, ptr %58, align 4, !tbaa !5
  %822 = load i32, ptr %58, align 4, !tbaa !5
  %823 = icmp slt i32 %822, 1061109567
  br i1 %823, label %824, label %836

824:                                              ; preds = %765
  %825 = load i32, ptr %26, align 4, !tbaa !5
  %826 = load i32, ptr %27, align 4, !tbaa !5
  %827 = load i32, ptr %54, align 4, !tbaa !5
  %828 = call noundef i32 @_Z5idx_2iii(i32 noundef %825, i32 noundef %826, i32 noundef %827)
  %829 = sext i32 %828 to i64
  %830 = getelementptr inbounds [10000 x %"class.std::vector"], ptr @e, i64 0, i64 %829
  call void @llvm.lifetime.start.p0(i64 8, ptr %59) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %60) #7
  %831 = load i32, ptr %26, align 4, !tbaa !5
  %832 = load i32, ptr %27, align 4, !tbaa !5
  %833 = load i32, ptr %55, align 4, !tbaa !5
  %834 = call noundef i32 @_Z5idx_2iii(i32 noundef %831, i32 noundef %832, i32 noundef %833)
  store i32 %834, ptr %60, align 4, !tbaa !5
  %835 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %58, ptr noundef nonnull align 4 dereferenceable(4) %60)
  store i64 %835, ptr %59, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %830, ptr noundef nonnull align 4 dereferenceable(8) %59)
  call void @llvm.lifetime.end.p0(i64 4, ptr %60) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %59) #7
  br label %836

836:                                              ; preds = %824, %765
  call void @llvm.lifetime.end.p0(i64 4, ptr %58) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %57) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %56) #7
  br label %837

837:                                              ; preds = %836, %761
  br label %838

838:                                              ; preds = %837, %753, %746
  br label %839

839:                                              ; preds = %838
  %840 = load i32, ptr %55, align 4, !tbaa !5
  %841 = add nsw i32 %840, 1
  store i32 %841, ptr %55, align 4, !tbaa !5
  br label %742, !llvm.loop !33

842:                                              ; preds = %745
  br label %843

843:                                              ; preds = %842, %733, %726
  br label %844

844:                                              ; preds = %843
  %845 = load i32, ptr %54, align 4, !tbaa !5
  %846 = add nsw i32 %845, 1
  store i32 %846, ptr %54, align 4, !tbaa !5
  br label %722, !llvm.loop !34

847:                                              ; preds = %725
  call void @llvm.lifetime.start.p0(i64 4, ptr %61) #7
  store i32 0, ptr %61, align 4, !tbaa !5
  br label %848

848:                                              ; preds = %872, %847
  %849 = load i32, ptr %61, align 4, !tbaa !5
  %850 = icmp slt i32 %849, 2
  br i1 %850, label %852, label %851

851:                                              ; preds = %848
  store i32 64, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %61) #7
  br label %875

852:                                              ; preds = %848
  call void @llvm.lifetime.start.p0(i64 4, ptr %62) #7
  store i32 0, ptr %62, align 4, !tbaa !5
  br label %853

853:                                              ; preds = %868, %852
  %854 = load i32, ptr %62, align 4, !tbaa !5
  %855 = icmp slt i32 %854, 2
  br i1 %855, label %857, label %856

856:                                              ; preds = %853
  store i32 67, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %62) #7
  br label %871

857:                                              ; preds = %853
  %858 = load i32, ptr %26, align 4, !tbaa !5
  %859 = load i32, ptr %61, align 4, !tbaa !5
  %860 = add nsw i32 %858, %859
  %861 = sext i32 %860 to i64
  %862 = getelementptr inbounds [50 x [51 x i8]], ptr @str, i64 0, i64 %861
  %863 = load i32, ptr %27, align 4, !tbaa !5
  %864 = load i32, ptr %62, align 4, !tbaa !5
  %865 = add nsw i32 %863, %864
  %866 = sext i32 %865 to i64
  %867 = getelementptr inbounds [51 x i8], ptr %862, i64 0, i64 %866
  store i8 111, ptr %867, align 1, !tbaa !9
  br label %868

868:                                              ; preds = %857
  %869 = load i32, ptr %62, align 4, !tbaa !5
  %870 = add nsw i32 %869, 1
  store i32 %870, ptr %62, align 4, !tbaa !5
  br label %853, !llvm.loop !35

871:                                              ; preds = %856
  br label %872

872:                                              ; preds = %871
  %873 = load i32, ptr %61, align 4, !tbaa !5
  %874 = add nsw i32 %873, 1
  store i32 %874, ptr %61, align 4, !tbaa !5
  br label %848, !llvm.loop !36

875:                                              ; preds = %851
  store i32 0, ptr %3, align 4
  br label %876

876:                                              ; preds = %875, %463
  call void @llvm.lifetime.end.p0(i64 1, ptr %28) #7
  %877 = load i32, ptr %3, align 4
  switch i32 %877, label %1000 [
    i32 0, label %878
    i32 34, label %879
  ]

878:                                              ; preds = %876
  br label %879

879:                                              ; preds = %878, %876
  %880 = load i32, ptr %27, align 4, !tbaa !5
  %881 = add nsw i32 %880, 1
  store i32 %881, ptr %27, align 4, !tbaa !5
  br label %413, !llvm.loop !37

882:                                              ; preds = %417
  br label %883

883:                                              ; preds = %882
  %884 = load i32, ptr %26, align 4, !tbaa !5
  %885 = add nsw i32 %884, 1
  store i32 %885, ptr %26, align 4, !tbaa !5
  br label %407, !llvm.loop !38

886:                                              ; preds = %411
  %887 = load i32, ptr @n, align 4, !tbaa !5
  %888 = load i32, ptr @m, align 4, !tbaa !5
  %889 = mul nsw i32 %887, %888
  %890 = mul nsw i32 %889, 4
  %891 = sext i32 %890 to i64
  %892 = mul i64 %891, 1
  call void @llvm.memset.p0.i64(ptr align 16 @vis, i8 0, i64 %892, i1 false)
  br label %893

893:                                              ; preds = %961, %959, %886
  %894 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %895 = xor i1 %894, true
  br i1 %895, label %896, label %962

896:                                              ; preds = %893
  call void @llvm.lifetime.start.p0(i64 4, ptr %63) #7
  %897 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %898 = getelementptr inbounds %"struct.std::pair", ptr %897, i32 0, i32 1
  %899 = load i32, ptr %898, align 4, !tbaa !39
  store i32 %899, ptr %63, align 4, !tbaa !5
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %900 = load i32, ptr %63, align 4, !tbaa !5
  %901 = sext i32 %900 to i64
  %902 = getelementptr inbounds [10000 x i8], ptr @vis, i64 0, i64 %901
  %903 = load i8, ptr %902, align 1, !tbaa !21, !range !23, !noundef !24
  %904 = trunc i8 %903 to i1
  br i1 %904, label %905, label %906

905:                                              ; preds = %896
  store i32 70, ptr %3, align 4
  br label %959, !llvm.loop !41

906:                                              ; preds = %896
  %907 = load i32, ptr %63, align 4, !tbaa !5
  %908 = sext i32 %907 to i64
  %909 = getelementptr inbounds [10000 x i8], ptr @vis, i64 0, i64 %908
  store i8 1, ptr %909, align 1, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %64) #7
  %910 = load i32, ptr %63, align 4, !tbaa !5
  %911 = sext i32 %910 to i64
  %912 = getelementptr inbounds [10000 x %"class.std::vector"], ptr @e, i64 0, i64 %911
  %913 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %912) #7
  %914 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %64, i32 0, i32 0
  store ptr %913, ptr %914, align 8
  br label %915

915:                                              ; preds = %956, %906
  call void @llvm.lifetime.start.p0(i64 8, ptr %65) #7
  %916 = load i32, ptr %63, align 4, !tbaa !5
  %917 = sext i32 %916 to i64
  %918 = getelementptr inbounds [10000 x %"class.std::vector"], ptr @e, i64 0, i64 %917
  %919 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %918) #7
  %920 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %65, i32 0, i32 0
  store ptr %919, ptr %920, align 8
  %921 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %64, ptr noundef nonnull align 8 dereferenceable(8) %65) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %65) #7
  br i1 %921, label %923, label %922

922:                                              ; preds = %915
  store i32 72, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %64) #7
  br label %958

923:                                              ; preds = %915
  call void @llvm.lifetime.start.p0(i64 4, ptr %66) #7
  %924 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %64) #7
  %925 = getelementptr inbounds %"struct.std::pair", ptr %924, i32 0, i32 1
  %926 = load i32, ptr %925, align 4, !tbaa !39
  store i32 %926, ptr %66, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %67) #7
  %927 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %64) #7
  %928 = getelementptr inbounds %"struct.std::pair", ptr %927, i32 0, i32 0
  %929 = load i32, ptr %928, align 4, !tbaa !42
  store i32 %929, ptr %67, align 4, !tbaa !5
  %930 = load i32, ptr %66, align 4, !tbaa !5
  %931 = sext i32 %930 to i64
  %932 = getelementptr inbounds [10000 x i32], ptr @dist, i64 0, i64 %931
  %933 = load i32, ptr %932, align 4, !tbaa !5
  %934 = load i32, ptr %63, align 4, !tbaa !5
  %935 = sext i32 %934 to i64
  %936 = getelementptr inbounds [10000 x i32], ptr @dist, i64 0, i64 %935
  %937 = load i32, ptr %936, align 4, !tbaa !5
  %938 = load i32, ptr %67, align 4, !tbaa !5
  %939 = add nsw i32 %937, %938
  %940 = icmp sgt i32 %933, %939
  br i1 %940, label %941, label %955

941:                                              ; preds = %923
  %942 = load i32, ptr %63, align 4, !tbaa !5
  %943 = sext i32 %942 to i64
  %944 = getelementptr inbounds [10000 x i32], ptr @dist, i64 0, i64 %943
  %945 = load i32, ptr %944, align 4, !tbaa !5
  %946 = load i32, ptr %67, align 4, !tbaa !5
  %947 = add nsw i32 %945, %946
  %948 = load i32, ptr %66, align 4, !tbaa !5
  %949 = sext i32 %948 to i64
  %950 = getelementptr inbounds [10000 x i32], ptr @dist, i64 0, i64 %949
  store i32 %947, ptr %950, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %68) #7
  %951 = load i32, ptr %66, align 4, !tbaa !5
  %952 = sext i32 %951 to i64
  %953 = getelementptr inbounds [10000 x i32], ptr @dist, i64 0, i64 %952
  %954 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %953, ptr noundef nonnull align 4 dereferenceable(4) %66)
  store i64 %954, ptr %68, align 4
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(8) %68)
  call void @llvm.lifetime.end.p0(i64 8, ptr %68) #7
  br label %955

955:                                              ; preds = %941, %923
  call void @llvm.lifetime.end.p0(i64 4, ptr %67) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %66) #7
  br label %956

956:                                              ; preds = %955
  %957 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %64) #7
  br label %915, !llvm.loop !43

958:                                              ; preds = %922
  store i32 0, ptr %3, align 4
  br label %959

959:                                              ; preds = %958, %905
  call void @llvm.lifetime.end.p0(i64 4, ptr %63) #7
  %960 = load i32, ptr %3, align 4
  switch i32 %960, label %1000 [
    i32 0, label %961
    i32 70, label %893
  ]

961:                                              ; preds = %959
  br label %893, !llvm.loop !41

962:                                              ; preds = %893
  call void @llvm.lifetime.start.p0(i64 4, ptr %69) #7
  store i32 1061109567, ptr %69, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %70) #7
  store i32 0, ptr %70, align 4, !tbaa !5
  br label %963

963:                                              ; preds = %982, %962
  %964 = load i32, ptr %70, align 4, !tbaa !5
  %965 = icmp slt i32 %964, 4
  br i1 %965, label %967, label %966

966:                                              ; preds = %963
  store i32 75, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %70) #7
  br label %985

967:                                              ; preds = %963
  call void @llvm.lifetime.start.p0(i64 4, ptr %71) #7
  %968 = load i32, ptr %70, align 4, !tbaa !5
  %969 = call noundef i32 @_Z5idx_2iii(i32 noundef 0, i32 noundef 0, i32 noundef %968)
  store i32 %969, ptr %71, align 4, !tbaa !5
  %970 = load i32, ptr %69, align 4, !tbaa !5
  %971 = load i32, ptr %71, align 4, !tbaa !5
  %972 = sext i32 %971 to i64
  %973 = getelementptr inbounds [10000 x i32], ptr @dist, i64 0, i64 %972
  %974 = load i32, ptr %973, align 4, !tbaa !5
  %975 = icmp sgt i32 %970, %974
  br i1 %975, label %976, label %981

976:                                              ; preds = %967
  %977 = load i32, ptr %71, align 4, !tbaa !5
  %978 = sext i32 %977 to i64
  %979 = getelementptr inbounds [10000 x i32], ptr @dist, i64 0, i64 %978
  %980 = load i32, ptr %979, align 4, !tbaa !5
  store i32 %980, ptr %69, align 4, !tbaa !5
  br label %981

981:                                              ; preds = %976, %967
  call void @llvm.lifetime.end.p0(i64 4, ptr %71) #7
  br label %982

982:                                              ; preds = %981
  %983 = load i32, ptr %70, align 4, !tbaa !5
  %984 = add nsw i32 %983, 1
  store i32 %984, ptr %70, align 4, !tbaa !5
  br label %963, !llvm.loop !44

985:                                              ; preds = %966
  %986 = load i32, ptr %69, align 4, !tbaa !5
  %987 = icmp eq i32 %986, 1061109567
  br i1 %987, label %988, label %989

988:                                              ; preds = %985
  br label %991

989:                                              ; preds = %985
  %990 = load i32, ptr %69, align 4, !tbaa !5
  br label %991

991:                                              ; preds = %989, %988
  %992 = phi i32 [ -1, %988 ], [ %990, %989 ]
  %993 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %992)
  call void @llvm.lifetime.end.p0(i64 4, ptr %69) #7
  br label %72, !llvm.loop !13

994:                                              ; preds = %80
  ret i32 0

995:                                              ; preds = %582
  %996 = load ptr, ptr %41, align 8
  %997 = load i32, ptr %42, align 4
  %998 = insertvalue { ptr, i32 } poison, ptr %996, 0
  %999 = insertvalue { ptr, i32 } %998, i32 %997, 1
  resume { ptr, i32 } %999

1000:                                             ; preds = %959, %876
  unreachable
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z5idx_1ii(i32 noundef, i32 noundef) #4

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

declare i32 @puts(ptr noundef) #2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z5idx_2iii(i32 noundef, i32 noundef, i32 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)) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 4 dereferenceable(8)) #6 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EE4swapERS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(8)) #6 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

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

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


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"struct.std::pair" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@px = external dso_local local_unnamed_addr global i32, align 4
@py = external dso_local local_unnamed_addr global i32, align 4
@tot = external dso_local local_unnamed_addr global i32, align 4
@pos = external dso_local local_unnamed_addr global [8 x i32], align 16
@que = external dso_local local_unnamed_addr global [8 x [2500 x i32]], align 16
@L = external dso_local local_unnamed_addr global i32, align 4
@R = external dso_local local_unnamed_addr global i32, align 4
@dis = external dso_local local_unnamed_addr global [8 x [2500 x i32]], align 16
@str = external dso_local global [50 x [51 x i8]], align 16
@dist = external dso_local global [10000 x i32], align 16
@e = external dso_local global [10000 x %"class.std::vector"], align 16
@Q = external dso_local global %"class.std::priority_queue", align 8
@vis = external dso_local local_unnamed_addr global [10000 x i8], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@_ZL2dx = external hidden local_unnamed_addr constant [4 x i32], align 16
@_ZL2dy = external hidden local_unnamed_addr constant [4 x i32], align 16
@_ZL3dxx = external hidden local_unnamed_addr constant [8 x i32], align 16
@_ZL3dyy = external hidden local_unnamed_addr constant [8 x i32], align 16
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %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 %"struct.std::pair", align 8
  %7 = alloca %"class.std::vector", align 8
  %8 = alloca %"struct.std::pair", align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %"struct.std::pair", align 8
  %17 = alloca i32, align 4
  %18 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %20 = alloca i32, align 4
  %21 = alloca %"struct.std::pair", align 8
  %22 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %23 = icmp eq i32 %22, 2
  %24 = load i32, ptr @n, align 4
  %25 = load i32, ptr @m, align 4
  %26 = sub i32 0, %25
  %27 = icmp ne i32 %24, %26
  %28 = select i1 %23, i1 %27, i1 false
  br i1 %28, label %.lr.ph299.preheader, label %._crit_edge300

.lr.ph299.preheader:                              ; preds = %0
  %.pre359 = load i32, ptr @_ZL2dx, align 16
  %.pre360 = load i32, ptr @_ZL2dy, align 16
  %29 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dx, i64 4), align 4
  %30 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dy, i64 4), align 4
  %31 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dx, i64 8), align 8
  %32 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dy, i64 8), align 8
  %33 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dx, i64 12), align 4
  %34 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dy, i64 12), align 4
  %35 = load i32, ptr @_ZL3dxx, align 16
  %36 = load i32, ptr @_ZL3dyy, align 16
  %37 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL3dxx, i64 4), align 4
  %38 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL3dyy, i64 4), align 4
  %39 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL3dxx, i64 8), align 8
  %40 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL3dyy, i64 8), align 8
  %41 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL3dxx, i64 12), align 4
  %42 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL3dyy, i64 12), align 4
  %43 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL3dxx, i64 16), align 16
  %44 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL3dyy, i64 16), align 16
  %45 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL3dxx, i64 20), align 4
  %46 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL3dyy, i64 20), align 4
  %47 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL3dxx, i64 24), align 8
  %48 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL3dyy, i64 24), align 8
  %49 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL3dxx, i64 28), align 4
  %50 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL3dyy, i64 28), align 4
  %51 = load i32, ptr @_ZL2dx, align 16
  %52 = load i32, ptr @_ZL2dy, align 16
  %53 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dx, i64 4), align 4
  %54 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dy, i64 4), align 4
  %55 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dx, i64 8), align 8
  %56 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dy, i64 8), align 8
  %57 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dx, i64 12), align 4
  %58 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dy, i64 12), align 4
  %.pre366 = load i32, ptr @_ZL2dx, align 16
  %.pre367 = load i32, ptr @_ZL2dy, align 16
  %59 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dx, i64 4), align 4
  %60 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dy, i64 4), align 4
  %61 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dx, i64 8), align 8
  %62 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dy, i64 8), align 8
  %63 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dx, i64 12), align 4
  %64 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dy, i64 12), align 4
  br label %.lr.ph299

.lr.ph299:                                        ; preds = %.lr.ph299.preheader, %.backedge
  %65 = phi i32 [ %24, %.lr.ph299.preheader ], [ %106, %.backedge ]
  store i32 -1, ptr @py, align 4, !tbaa !5
  store i32 -1, ptr @px, align 4, !tbaa !5
  store i32 0, ptr @tot, align 4, !tbaa !5
  %66 = icmp sgt i32 %65, 0
  br i1 %66, label %.lr.ph255, label %.preheader248

._crit_edge256:                                   ; preds = %._crit_edge
  %.pre = load i32, ptr @px, align 4, !tbaa !5
  %.pre358 = load i32, ptr @py, align 4
  %67 = icmp ne i32 %.pre, 0
  %68 = icmp ne i32 %.pre358, 0
  %or.cond = select i1 %67, i1 true, i1 %68
  br i1 %or.cond, label %.preheader249, label %102

.preheader249:                                    ; preds = %._crit_edge256
  %.pr374 = load i32, ptr @tot, align 4, !tbaa !5
  %69 = icmp sgt i32 %.pr374, 0
  br i1 %69, label %.lr.ph259.preheader, label %.preheader248

.lr.ph255:                                        ; preds = %.lr.ph299, %._crit_edge
  %indvars.iv304 = phi i64 [ %indvars.iv.next305, %._crit_edge ], [ 0, %.lr.ph299 ]
  %70 = getelementptr inbounds [50 x [51 x i8]], ptr @str, i64 0, i64 %indvars.iv304
  %71 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %70)
  %72 = load i32, ptr @m, align 4, !tbaa !5
  %73 = icmp sgt i32 %72, 0
  br i1 %73, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.lr.ph255
  %74 = trunc nuw nsw i64 %indvars.iv304 to i32
  %75 = trunc nuw nsw i64 %indvars.iv304 to i32
  br label %.lr.ph

._crit_edge:                                      ; preds = %98, %.lr.ph255
  %indvars.iv.next305 = add nuw nsw i64 %indvars.iv304, 1
  %76 = load i32, ptr @n, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = icmp slt i64 %indvars.iv.next305, %77
  br i1 %78, label %.lr.ph255, label %._crit_edge256, !llvm.loop !9

.lr.ph:                                           ; preds = %.lr.ph.preheader, %98
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %98 ]
  %79 = getelementptr inbounds [50 x [51 x i8]], ptr @str, i64 0, i64 %indvars.iv304, i64 %indvars.iv
  %80 = load i8, ptr %79, align 1, !tbaa !11
  %81 = icmp eq i8 %80, 46
  br i1 %81, label %82, label %89

82:                                               ; preds = %.lr.ph
  %83 = trunc nuw nsw i64 %indvars.iv to i32
  %84 = call noundef i32 @_Z5idx_1ii(i32 noundef %74, i32 noundef %83)
  %85 = load i32, ptr @tot, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr @tot, align 4, !tbaa !5
  %87 = sext i32 %85 to i64
  %88 = getelementptr inbounds [8 x i32], ptr @pos, i64 0, i64 %87
  store i32 %84, ptr %88, align 4, !tbaa !5
  %.pr = load i8, ptr %79, align 1, !tbaa !11
  br label %89

89:                                               ; preds = %82, %.lr.ph
  %90 = phi i8 [ %.pr, %82 ], [ %80, %.lr.ph ]
  %91 = icmp eq i8 %90, 88
  br i1 %91, label %92, label %98

92:                                               ; preds = %89
  %93 = load i32, ptr @px, align 4, !tbaa !5
  %94 = icmp eq i32 %93, -1
  br i1 %94, label %95, label %97

95:                                               ; preds = %92
  store i32 %75, ptr @px, align 4, !tbaa !5
  %96 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %96, ptr @py, align 4, !tbaa !5
  br label %97

97:                                               ; preds = %95, %92
  store i8 42, ptr %79, align 1, !tbaa !11
  br label %98

98:                                               ; preds = %89, %97
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %99 = load i32, ptr @m, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = icmp slt i64 %indvars.iv.next, %100
  br i1 %101, label %.lr.ph, label %._crit_edge, !llvm.loop !12

102:                                              ; preds = %._crit_edge256
  %103 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %.backedge

.backedge:                                        ; preds = %102, %.preheader245
  %104 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %105 = icmp eq i32 %104, 2
  %106 = load i32, ptr @n, align 4
  %107 = load i32, ptr @m, align 4
  %108 = sub i32 0, %107
  %109 = icmp ne i32 %106, %108
  %110 = select i1 %105, i1 %109, i1 false
  br i1 %110, label %.lr.ph299, label %._crit_edge300, !llvm.loop !13

.preheader248:                                    ; preds = %._crit_edge260, %.lr.ph299, %.preheader249
  %111 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  br i1 %111, label %._crit_edge264, label %.lr.ph263

.lr.ph259.preheader:                              ; preds = %.preheader249, %._crit_edge260
  %indvars.iv310 = phi i64 [ %indvars.iv.next311, %._crit_edge260 ], [ 0, %.preheader249 ]
  %112 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %indvars.iv310
  %113 = load i32, ptr @n, align 4, !tbaa !5
  %114 = load i32, ptr @m, align 4, !tbaa !5
  %115 = mul nsw i32 %114, %113
  %116 = sext i32 %115 to i64
  %117 = shl nsw i64 %116, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %112, i8 63, i64 %117, i1 false)
  %118 = getelementptr inbounds [8 x i32], ptr @pos, i64 0, i64 %indvars.iv310
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %indvars.iv310, i64 %120
  store i32 0, ptr %121, align 4, !tbaa !5
  store i32 1, ptr @R, align 4, !tbaa !5
  %122 = getelementptr inbounds [8 x [2500 x i32]], ptr @que, i64 0, i64 %indvars.iv310, i64 0
  store i32 %119, ptr %122, align 16, !tbaa !5
  br label %.lr.ph259

.lr.ph259:                                        ; preds = %.lr.ph259.preheader, %204
  %123 = phi i32 [ %206, %204 ], [ 0, %.lr.ph259.preheader ]
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr @L, align 4, !tbaa !5
  %125 = sext i32 %123 to i64
  %126 = getelementptr inbounds [8 x [2500 x i32]], ptr @que, i64 0, i64 %indvars.iv310, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  call void @_Z5rdx_1iRiS_(i32 noundef %127, ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %indvars.iv310, i64 %128
  %130 = load i32, ptr %1, align 4, !tbaa !5
  %131 = add nsw i32 %.pre359, %130
  %132 = load i32, ptr %2, align 4, !tbaa !5
  %133 = add nsw i32 %.pre360, %132
  %134 = call noundef zeroext i1 @_Z5validii(i32 noundef %131, i32 noundef %133)
  br i1 %134, label %135, label %148

135:                                              ; preds = %.lr.ph259
  %136 = call noundef i32 @_Z5idx_1ii(i32 noundef %131, i32 noundef %133)
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %indvars.iv310, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = icmp eq i32 %139, 1061109567
  br i1 %140, label %141, label %148

141:                                              ; preds = %135
  %142 = load i32, ptr %129, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %138, align 4, !tbaa !5
  %144 = load i32, ptr @R, align 4, !tbaa !5
  %145 = add nsw i32 %144, 1
  store i32 %145, ptr @R, align 4, !tbaa !5
  %146 = sext i32 %144 to i64
  %147 = getelementptr inbounds [8 x [2500 x i32]], ptr @que, i64 0, i64 %indvars.iv310, i64 %146
  store i32 %136, ptr %147, align 4, !tbaa !5
  br label %148

148:                                              ; preds = %135, %141, %.lr.ph259
  %149 = load i32, ptr %1, align 4, !tbaa !5
  %150 = add nsw i32 %29, %149
  %151 = load i32, ptr %2, align 4, !tbaa !5
  %152 = add nsw i32 %30, %151
  %153 = call noundef zeroext i1 @_Z5validii(i32 noundef %150, i32 noundef %152)
  br i1 %153, label %154, label %167

154:                                              ; preds = %148
  %155 = call noundef i32 @_Z5idx_1ii(i32 noundef %150, i32 noundef %152)
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %indvars.iv310, i64 %156
  %158 = load i32, ptr %157, align 4, !tbaa !5
  %159 = icmp eq i32 %158, 1061109567
  br i1 %159, label %160, label %167

160:                                              ; preds = %154
  %161 = load i32, ptr %129, align 4, !tbaa !5
  %162 = add nsw i32 %161, 1
  store i32 %162, ptr %157, align 4, !tbaa !5
  %163 = load i32, ptr @R, align 4, !tbaa !5
  %164 = add nsw i32 %163, 1
  store i32 %164, ptr @R, align 4, !tbaa !5
  %165 = sext i32 %163 to i64
  %166 = getelementptr inbounds [8 x [2500 x i32]], ptr @que, i64 0, i64 %indvars.iv310, i64 %165
  store i32 %155, ptr %166, align 4, !tbaa !5
  br label %167

167:                                              ; preds = %160, %154, %148
  %168 = load i32, ptr %1, align 4, !tbaa !5
  %169 = add nsw i32 %31, %168
  %170 = load i32, ptr %2, align 4, !tbaa !5
  %171 = add nsw i32 %32, %170
  %172 = call noundef zeroext i1 @_Z5validii(i32 noundef %169, i32 noundef %171)
  br i1 %172, label %173, label %186

173:                                              ; preds = %167
  %174 = call noundef i32 @_Z5idx_1ii(i32 noundef %169, i32 noundef %171)
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %indvars.iv310, i64 %175
  %177 = load i32, ptr %176, align 4, !tbaa !5
  %178 = icmp eq i32 %177, 1061109567
  br i1 %178, label %179, label %186

179:                                              ; preds = %173
  %180 = load i32, ptr %129, align 4, !tbaa !5
  %181 = add nsw i32 %180, 1
  store i32 %181, ptr %176, align 4, !tbaa !5
  %182 = load i32, ptr @R, align 4, !tbaa !5
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr @R, align 4, !tbaa !5
  %184 = sext i32 %182 to i64
  %185 = getelementptr inbounds [8 x [2500 x i32]], ptr @que, i64 0, i64 %indvars.iv310, i64 %184
  store i32 %174, ptr %185, align 4, !tbaa !5
  br label %186

186:                                              ; preds = %179, %173, %167
  %187 = load i32, ptr %1, align 4, !tbaa !5
  %188 = add nsw i32 %33, %187
  %189 = load i32, ptr %2, align 4, !tbaa !5
  %190 = add nsw i32 %34, %189
  %191 = call noundef zeroext i1 @_Z5validii(i32 noundef %188, i32 noundef %190)
  br i1 %191, label %192, label %._crit_edge361

._crit_edge361:                                   ; preds = %186
  %.pre362 = load i32, ptr @R, align 4, !tbaa !5
  br label %204

192:                                              ; preds = %186
  %193 = call noundef i32 @_Z5idx_1ii(i32 noundef %188, i32 noundef %190)
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %indvars.iv310, i64 %194
  %196 = load i32, ptr %195, align 4, !tbaa !5
  %197 = icmp eq i32 %196, 1061109567
  %.pre363 = load i32, ptr @R, align 4, !tbaa !5
  br i1 %197, label %198, label %204

198:                                              ; preds = %192
  %199 = load i32, ptr %129, align 4, !tbaa !5
  %200 = add nsw i32 %199, 1
  store i32 %200, ptr %195, align 4, !tbaa !5
  %201 = add nsw i32 %.pre363, 1
  store i32 %201, ptr @R, align 4, !tbaa !5
  %202 = sext i32 %.pre363 to i64
  %203 = getelementptr inbounds [8 x [2500 x i32]], ptr @que, i64 0, i64 %indvars.iv310, i64 %202
  store i32 %193, ptr %203, align 4, !tbaa !5
  br label %204

204:                                              ; preds = %._crit_edge361, %198, %192
  %205 = phi i32 [ %.pre362, %._crit_edge361 ], [ %201, %198 ], [ %.pre363, %192 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  %206 = load i32, ptr @L, align 4, !tbaa !5
  %207 = icmp slt i32 %206, %205
  br i1 %207, label %.lr.ph259, label %._crit_edge260, !llvm.loop !14

._crit_edge260:                                   ; preds = %204
  %.pre364 = load i32, ptr @tot, align 4, !tbaa !5
  %indvars.iv.next311 = add nuw nsw i64 %indvars.iv310, 1
  %208 = sext i32 %.pre364 to i64
  %209 = icmp slt i64 %indvars.iv.next311, %208
  br i1 %209, label %.lr.ph259.preheader, label %.preheader248, !llvm.loop !15

.lr.ph263:                                        ; preds = %.preheader248, %.lr.ph263
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %210 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  br i1 %210, label %._crit_edge264, label %.lr.ph263, !llvm.loop !16

._crit_edge264:                                   ; preds = %.lr.ph263, %.preheader248
  %211 = load i32, ptr @n, align 4, !tbaa !5
  %212 = load i32, ptr @m, align 4, !tbaa !5
  %213 = shl i32 %211, 2
  %214 = mul i32 %213, %212
  %215 = sext i32 %214 to i64
  %216 = shl nsw i64 %215, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @dist, i8 63, i64 %216, i1 false)
  %217 = load i32, ptr @px, align 4, !tbaa !5
  %218 = add nsw i32 %35, %217
  %219 = load i32, ptr @py, align 4, !tbaa !5
  %220 = add nsw i32 %36, %219
  %221 = add nsw i32 %37, %217
  %222 = add nsw i32 %38, %219
  %223 = call noundef zeroext i1 @_Z5validii(i32 noundef %218, i32 noundef %220)
  br i1 %223, label %224, label %254

224:                                              ; preds = %._crit_edge264
  %225 = call noundef zeroext i1 @_Z5validii(i32 noundef %221, i32 noundef %222)
  br i1 %225, label %226, label %254

226:                                              ; preds = %224
  %227 = call noundef i32 @_Z5idx_1ii(i32 noundef %218, i32 noundef %220)
  %228 = call noundef i32 @_Z5idx_1ii(i32 noundef %221, i32 noundef %222)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  %229 = load i32, ptr @px, align 4, !tbaa !5
  %230 = load i32, ptr @py, align 4, !tbaa !5
  %231 = call noundef i32 @_Z5idx_2iii(i32 noundef %229, i32 noundef %230, i32 noundef 0)
  store i32 %231, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  %232 = sext i32 %227 to i64
  %233 = getelementptr inbounds [2500 x i32], ptr @dis, i64 0, i64 %232
  %234 = load i32, ptr %233, align 4, !tbaa !5
  %235 = sext i32 %228 to i64
  %236 = getelementptr inbounds [2500 x i32], ptr getelementptr inbounds (i8, ptr @dis, i64 10000), i64 0, i64 %235
  %237 = load i32, ptr %236, align 4, !tbaa !5
  %238 = add nsw i32 %237, %234
  store i32 %238, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  %239 = getelementptr inbounds [2500 x i32], ptr @dis, i64 0, i64 %235
  %240 = load i32, ptr %239, align 4, !tbaa !5
  %241 = getelementptr inbounds [2500 x i32], ptr getelementptr inbounds (i8, ptr @dis, i64 10000), i64 0, i64 %232
  %242 = load i32, ptr %241, align 4, !tbaa !5
  %243 = add nsw i32 %242, %240
  store i32 %243, ptr %5, align 4, !tbaa !5
  %244 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %245 = load i32, ptr %244, align 4, !tbaa !5
  %246 = load i32, ptr %3, align 4, !tbaa !5
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds [10000 x i32], ptr @dist, i64 0, i64 %247
  store i32 %245, ptr %248, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  %249 = icmp slt i32 %245, 1061109567
  br i1 %249, label %250, label %252

250:                                              ; preds = %226
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  %251 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %248, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i64 %251, ptr %6, align 8
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  br label %253

252:                                              ; preds = %226
  store i32 1061109567, ptr %248, align 4, !tbaa !5
  br label %253

253:                                              ; preds = %252, %250
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  br label %254

254:                                              ; preds = %253, %224, %._crit_edge264
  %255 = load i32, ptr @px, align 4, !tbaa !5
  %256 = add nsw i32 %39, %255
  %257 = load i32, ptr @py, align 4, !tbaa !5
  %258 = add nsw i32 %40, %257
  %259 = add nsw i32 %41, %255
  %260 = add nsw i32 %42, %257
  %261 = call noundef zeroext i1 @_Z5validii(i32 noundef %256, i32 noundef %258)
  br i1 %261, label %262, label %292

262:                                              ; preds = %254
  %263 = call noundef zeroext i1 @_Z5validii(i32 noundef %259, i32 noundef %260)
  br i1 %263, label %264, label %292

264:                                              ; preds = %262
  %265 = call noundef i32 @_Z5idx_1ii(i32 noundef %256, i32 noundef %258)
  %266 = call noundef i32 @_Z5idx_1ii(i32 noundef %259, i32 noundef %260)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  %267 = load i32, ptr @px, align 4, !tbaa !5
  %268 = load i32, ptr @py, align 4, !tbaa !5
  %269 = call noundef i32 @_Z5idx_2iii(i32 noundef %267, i32 noundef %268, i32 noundef 1)
  store i32 %269, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  %270 = sext i32 %265 to i64
  %271 = getelementptr inbounds [2500 x i32], ptr @dis, i64 0, i64 %270
  %272 = load i32, ptr %271, align 4, !tbaa !5
  %273 = sext i32 %266 to i64
  %274 = getelementptr inbounds [2500 x i32], ptr getelementptr inbounds (i8, ptr @dis, i64 10000), i64 0, i64 %273
  %275 = load i32, ptr %274, align 4, !tbaa !5
  %276 = add nsw i32 %275, %272
  store i32 %276, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  %277 = getelementptr inbounds [2500 x i32], ptr @dis, i64 0, i64 %273
  %278 = load i32, ptr %277, align 4, !tbaa !5
  %279 = getelementptr inbounds [2500 x i32], ptr getelementptr inbounds (i8, ptr @dis, i64 10000), i64 0, i64 %270
  %280 = load i32, ptr %279, align 4, !tbaa !5
  %281 = add nsw i32 %280, %278
  store i32 %281, ptr %5, align 4, !tbaa !5
  %282 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %283 = load i32, ptr %282, align 4, !tbaa !5
  %284 = load i32, ptr %3, align 4, !tbaa !5
  %285 = sext i32 %284 to i64
  %286 = getelementptr inbounds [10000 x i32], ptr @dist, i64 0, i64 %285
  store i32 %283, ptr %286, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  %287 = icmp slt i32 %283, 1061109567
  br i1 %287, label %289, label %288

288:                                              ; preds = %264
  store i32 1061109567, ptr %286, align 4, !tbaa !5
  br label %291

289:                                              ; preds = %264
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  %290 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %286, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i64 %290, ptr %6, align 8
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  br label %291

291:                                              ; preds = %289, %288
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  br label %292

292:                                              ; preds = %291, %262, %254
  %293 = load i32, ptr @px, align 4, !tbaa !5
  %294 = add nsw i32 %43, %293
  %295 = load i32, ptr @py, align 4, !tbaa !5
  %296 = add nsw i32 %44, %295
  %297 = add nsw i32 %45, %293
  %298 = add nsw i32 %46, %295
  %299 = call noundef zeroext i1 @_Z5validii(i32 noundef %294, i32 noundef %296)
  br i1 %299, label %300, label %330

300:                                              ; preds = %292
  %301 = call noundef zeroext i1 @_Z5validii(i32 noundef %297, i32 noundef %298)
  br i1 %301, label %302, label %330

302:                                              ; preds = %300
  %303 = call noundef i32 @_Z5idx_1ii(i32 noundef %294, i32 noundef %296)
  %304 = call noundef i32 @_Z5idx_1ii(i32 noundef %297, i32 noundef %298)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  %305 = load i32, ptr @px, align 4, !tbaa !5
  %306 = load i32, ptr @py, align 4, !tbaa !5
  %307 = call noundef i32 @_Z5idx_2iii(i32 noundef %305, i32 noundef %306, i32 noundef 2)
  store i32 %307, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  %308 = sext i32 %303 to i64
  %309 = getelementptr inbounds [2500 x i32], ptr @dis, i64 0, i64 %308
  %310 = load i32, ptr %309, align 4, !tbaa !5
  %311 = sext i32 %304 to i64
  %312 = getelementptr inbounds [2500 x i32], ptr getelementptr inbounds (i8, ptr @dis, i64 10000), i64 0, i64 %311
  %313 = load i32, ptr %312, align 4, !tbaa !5
  %314 = add nsw i32 %313, %310
  store i32 %314, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  %315 = getelementptr inbounds [2500 x i32], ptr @dis, i64 0, i64 %311
  %316 = load i32, ptr %315, align 4, !tbaa !5
  %317 = getelementptr inbounds [2500 x i32], ptr getelementptr inbounds (i8, ptr @dis, i64 10000), i64 0, i64 %308
  %318 = load i32, ptr %317, align 4, !tbaa !5
  %319 = add nsw i32 %318, %316
  store i32 %319, ptr %5, align 4, !tbaa !5
  %320 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %321 = load i32, ptr %320, align 4, !tbaa !5
  %322 = load i32, ptr %3, align 4, !tbaa !5
  %323 = sext i32 %322 to i64
  %324 = getelementptr inbounds [10000 x i32], ptr @dist, i64 0, i64 %323
  store i32 %321, ptr %324, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  %325 = icmp slt i32 %321, 1061109567
  br i1 %325, label %327, label %326

326:                                              ; preds = %302
  store i32 1061109567, ptr %324, align 4, !tbaa !5
  br label %329

327:                                              ; preds = %302
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  %328 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %324, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i64 %328, ptr %6, align 8
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  br label %329

329:                                              ; preds = %327, %326
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  br label %330

330:                                              ; preds = %329, %300, %292
  %331 = load i32, ptr @px, align 4, !tbaa !5
  %332 = add nsw i32 %47, %331
  %333 = load i32, ptr @py, align 4, !tbaa !5
  %334 = add nsw i32 %48, %333
  %335 = add nsw i32 %49, %331
  %336 = add nsw i32 %50, %333
  %337 = call noundef zeroext i1 @_Z5validii(i32 noundef %332, i32 noundef %334)
  br i1 %337, label %338, label %.preheader247

338:                                              ; preds = %330
  %339 = call noundef zeroext i1 @_Z5validii(i32 noundef %335, i32 noundef %336)
  br i1 %339, label %340, label %.preheader247

340:                                              ; preds = %338
  %341 = call noundef i32 @_Z5idx_1ii(i32 noundef %332, i32 noundef %334)
  %342 = call noundef i32 @_Z5idx_1ii(i32 noundef %335, i32 noundef %336)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  %343 = load i32, ptr @px, align 4, !tbaa !5
  %344 = load i32, ptr @py, align 4, !tbaa !5
  %345 = call noundef i32 @_Z5idx_2iii(i32 noundef %343, i32 noundef %344, i32 noundef 3)
  store i32 %345, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  %346 = sext i32 %341 to i64
  %347 = getelementptr inbounds [2500 x i32], ptr @dis, i64 0, i64 %346
  %348 = load i32, ptr %347, align 4, !tbaa !5
  %349 = sext i32 %342 to i64
  %350 = getelementptr inbounds [2500 x i32], ptr getelementptr inbounds (i8, ptr @dis, i64 10000), i64 0, i64 %349
  %351 = load i32, ptr %350, align 4, !tbaa !5
  %352 = add nsw i32 %351, %348
  store i32 %352, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  %353 = getelementptr inbounds [2500 x i32], ptr @dis, i64 0, i64 %349
  %354 = load i32, ptr %353, align 4, !tbaa !5
  %355 = getelementptr inbounds [2500 x i32], ptr getelementptr inbounds (i8, ptr @dis, i64 10000), i64 0, i64 %346
  %356 = load i32, ptr %355, align 4, !tbaa !5
  %357 = add nsw i32 %356, %354
  store i32 %357, ptr %5, align 4, !tbaa !5
  %358 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %359 = load i32, ptr %358, align 4, !tbaa !5
  %360 = load i32, ptr %3, align 4, !tbaa !5
  %361 = sext i32 %360 to i64
  %362 = getelementptr inbounds [10000 x i32], ptr @dist, i64 0, i64 %361
  store i32 %359, ptr %362, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  %363 = icmp slt i32 %359, 1061109567
  br i1 %363, label %365, label %364

364:                                              ; preds = %340
  store i32 1061109567, ptr %362, align 4, !tbaa !5
  br label %367

365:                                              ; preds = %340
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  %366 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %362, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i64 %366, ptr %6, align 8
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  br label %367

367:                                              ; preds = %365, %364
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  br label %.preheader247

.preheader247:                                    ; preds = %367, %338, %330
  %368 = load i32, ptr @px, align 4, !tbaa !5
  %369 = load i32, ptr @py, align 4, !tbaa !5
  %370 = sext i32 %368 to i64
  %371 = mul nsw i64 %370, 51
  %372 = sext i32 %369 to i64
  %373 = add nsw i64 %371, %372
  %scevgep = getelementptr i8, ptr @str, i64 %373
  store i16 28527, ptr %scevgep, align 1
  %gep379 = getelementptr i8, ptr getelementptr inbounds (i8, ptr @str, i64 51), i64 %373
  store i16 28527, ptr %gep379, align 1
  %374 = load i32, ptr @n, align 4, !tbaa !5
  %375 = icmp sgt i32 %374, 0
  %.pre372 = load i32, ptr @m, align 4, !tbaa !5
  br i1 %375, label %.preheader243, label %._crit_edge289

.preheader243:                                    ; preds = %.preheader247, %._crit_edge287
  %376 = phi i32 [ %399, %._crit_edge287 ], [ %374, %.preheader247 ]
  %377 = phi i32 [ %400, %._crit_edge287 ], [ %.pre372, %.preheader247 ]
  %indvar = phi i64 [ %indvar.next, %._crit_edge287 ], [ 0, %.preheader247 ]
  %indvars356 = trunc i64 %indvar to i32
  %378 = mul nuw nsw i64 %indvar, 51
  %379 = icmp sgt i32 %377, 0
  br i1 %379, label %.preheader242.preheader, label %._crit_edge287

.preheader242.preheader:                          ; preds = %.preheader243
  %380 = add nsw i32 %35, %indvars356
  %381 = add nsw i32 %37, %indvars356
  %382 = add nsw i32 %51, %indvars356
  %383 = add nsw i32 %39, %indvars356
  %384 = add nsw i32 %41, %indvars356
  %385 = add nsw i32 %53, %indvars356
  %386 = add nsw i32 %43, %indvars356
  %387 = add nsw i32 %45, %indvars356
  %388 = add nsw i32 %55, %indvars356
  %389 = add nsw i32 %47, %indvars356
  %390 = add nsw i32 %49, %indvars356
  %391 = add nsw i32 %57, %indvars356
  br label %.preheader242

._crit_edge289:                                   ; preds = %._crit_edge287, %.preheader247
  %392 = phi i32 [ %.pre372, %.preheader247 ], [ %400, %._crit_edge287 ]
  %.lcssa250 = phi i32 [ %374, %.preheader247 ], [ %399, %._crit_edge287 ]
  %393 = shl i32 %.lcssa250, 2
  %394 = mul i32 %393, %392
  %395 = sext i32 %394 to i64
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @vis, i8 0, i64 %395, i1 false)
  %396 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  br i1 %396, label %.preheader245, label %.lr.ph295

.preheader242:                                    ; preds = %.preheader242.preheader, %.loopexit237
  %indvar320 = phi i64 [ 0, %.preheader242.preheader ], [ %indvar.next321, %.loopexit237 ]
  %indvars354 = trunc i64 %indvar320 to i32
  %397 = add nuw nsw i64 %378, %indvar320
  %398 = add nuw nsw i32 %indvars354, 1
  br label %.preheader235

._crit_edge287.loopexit:                          ; preds = %.loopexit237
  %.pre371 = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge287

._crit_edge287:                                   ; preds = %._crit_edge287.loopexit, %.preheader243
  %399 = phi i32 [ %.pre371, %._crit_edge287.loopexit ], [ %376, %.preheader243 ]
  %400 = phi i32 [ %695, %._crit_edge287.loopexit ], [ %377, %.preheader243 ]
  %indvar.next = add nuw nsw i64 %indvar, 1
  %indvars355 = trunc i64 %indvar.next to i32
  %401 = icmp sgt i32 %399, %indvars355
  br i1 %401, label %.preheader243, label %._crit_edge289, !llvm.loop !17

.preheader235:                                    ; preds = %.preheader242, %._crit_edge270
  %.0215272 = phi i8 [ 1, %.preheader242 ], [ %.1216.lcssa, %._crit_edge270 ]
  %402 = phi i1 [ true, %.preheader242 ], [ false, %._crit_edge270 ]
  %.0217271 = phi i32 [ 0, %.preheader242 ], [ 1, %._crit_edge270 ]
  %403 = trunc nuw i8 %.0215272 to i1
  br i1 %403, label %.lr.ph269, label %._crit_edge270

.lr.ph269:                                        ; preds = %.preheader235
  %404 = add nuw nsw i32 %.0217271, %indvars356
  %405 = call noundef zeroext i1 @_Z5validii(i32 noundef %404, i32 noundef %indvars354)
  br i1 %405, label %.lr.ph269.peel.newph, label %._crit_edge270.loopexit

406:                                              ; preds = %._crit_edge270
  br i1 %411, label %.preheader234.preheader, label %.loopexit237

.preheader234.preheader:                          ; preds = %406
  %scevgep324 = getelementptr i8, ptr @str, i64 %397
  store i16 10794, ptr %scevgep324, align 1
  %gep = getelementptr i8, ptr getelementptr inbounds (i8, ptr @str, i64 51), i64 %397
  store i16 10794, ptr %gep, align 1
  %407 = add nsw i32 %36, %indvars354
  %408 = add nsw i32 %38, %indvars354
  %409 = call noundef zeroext i1 @_Z5validii(i32 noundef %380, i32 noundef %407)
  br i1 %409, label %414, label %428

._crit_edge270.loopexit:                          ; preds = %.lr.ph269.peel.newph, %.lr.ph269
  %.lcssa = phi i1 [ %405, %.lr.ph269 ], [ %413, %.lr.ph269.peel.newph ]
  %410 = zext i1 %.lcssa to i8
  br label %._crit_edge270

._crit_edge270:                                   ; preds = %._crit_edge270.loopexit, %.preheader235
  %.1216.lcssa = phi i8 [ %.0215272, %.preheader235 ], [ %410, %._crit_edge270.loopexit ]
  %411 = trunc nuw i8 %.1216.lcssa to i1
  %412 = select i1 %402, i1 %411, i1 false
  br i1 %412, label %.preheader235, label %406, !llvm.loop !18

.lr.ph269.peel.newph:                             ; preds = %.lr.ph269
  %413 = call noundef zeroext i1 @_Z5validii(i32 noundef %404, i32 noundef %398)
  br label %._crit_edge270.loopexit

414:                                              ; preds = %.preheader234.preheader
  %415 = call noundef zeroext i1 @_Z5validii(i32 noundef %381, i32 noundef %408)
  br i1 %415, label %416, label %428

416:                                              ; preds = %414
  %417 = add nsw i32 %52, %indvars354
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %7, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #8
  %418 = call noundef i32 @_Z5idx_2iii(i32 noundef %indvars356, i32 noundef %indvars354, i32 noundef 0)
  %419 = sext i32 %418 to i64
  %420 = getelementptr inbounds [10000 x %"class.std::vector"], ptr @e, i64 0, i64 %419
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE4swapERS3_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %420) #8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #8
  %421 = call noundef i32 @_Z5idx_2iii(i32 noundef %indvars356, i32 noundef %indvars354, i32 noundef 0)
  %422 = sext i32 %421 to i64
  %423 = getelementptr inbounds [10000 x %"class.std::vector"], ptr @e, i64 0, i64 %422
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #8
  store i32 1, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #8
  %424 = call noundef i32 @_Z5idx_2iii(i32 noundef %382, i32 noundef %417, i32 noundef 3)
  store i32 %424, ptr %10, align 4, !tbaa !5
  %425 = call i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
  store i64 %425, ptr %8, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %423, ptr noundef nonnull align 4 dereferenceable(8) %8)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  %426 = call noundef i32 @_Z5idx_1ii(i32 noundef %380, i32 noundef %407)
  store i32 %426, ptr @pos, align 16, !tbaa !5
  %427 = call noundef i32 @_Z5idx_1ii(i32 noundef %381, i32 noundef %408)
  store i32 %427, ptr getelementptr inbounds (i8, ptr @pos, i64 4), align 4, !tbaa !5
  br label %.preheader240.1

428:                                              ; preds = %414, %.preheader234.preheader
  store i32 -1, ptr getelementptr inbounds (i8, ptr @pos, i64 4), align 4, !tbaa !5
  store i32 -1, ptr @pos, align 16, !tbaa !5
  br label %.preheader240.1

.preheader240.1:                                  ; preds = %428, %416
  %429 = add nsw i32 %40, %indvars354
  %430 = add nsw i32 %42, %indvars354
  %431 = call noundef zeroext i1 @_Z5validii(i32 noundef %383, i32 noundef %429)
  br i1 %431, label %432, label %434

432:                                              ; preds = %.preheader240.1
  %433 = call noundef zeroext i1 @_Z5validii(i32 noundef %384, i32 noundef %430)
  br i1 %433, label %435, label %434

434:                                              ; preds = %432, %.preheader240.1
  store i32 -1, ptr getelementptr inbounds (i8, ptr @pos, i64 12), align 4, !tbaa !5
  store i32 -1, ptr getelementptr inbounds (i8, ptr @pos, i64 8), align 8, !tbaa !5
  br label %.preheader240.2

435:                                              ; preds = %432
  %436 = add nsw i32 %54, %indvars354
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %7, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #8
  %437 = call noundef i32 @_Z5idx_2iii(i32 noundef %indvars356, i32 noundef %indvars354, i32 noundef 1)
  %438 = sext i32 %437 to i64
  %439 = getelementptr inbounds [10000 x %"class.std::vector"], ptr @e, i64 0, i64 %438
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE4swapERS3_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %439) #8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #8
  %440 = call noundef i32 @_Z5idx_2iii(i32 noundef %indvars356, i32 noundef %indvars354, i32 noundef 1)
  %441 = sext i32 %440 to i64
  %442 = getelementptr inbounds [10000 x %"class.std::vector"], ptr @e, i64 0, i64 %441
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #8
  store i32 1, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #8
  %443 = call noundef i32 @_Z5idx_2iii(i32 noundef %385, i32 noundef %436, i32 noundef 2)
  store i32 %443, ptr %10, align 4, !tbaa !5
  %444 = call i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
  store i64 %444, ptr %8, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %442, ptr noundef nonnull align 4 dereferenceable(8) %8)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  %445 = call noundef i32 @_Z5idx_1ii(i32 noundef %383, i32 noundef %429)
  store i32 %445, ptr getelementptr inbounds (i8, ptr @pos, i64 8), align 8, !tbaa !5
  %446 = call noundef i32 @_Z5idx_1ii(i32 noundef %384, i32 noundef %430)
  store i32 %446, ptr getelementptr inbounds (i8, ptr @pos, i64 12), align 4, !tbaa !5
  br label %.preheader240.2

.preheader240.2:                                  ; preds = %435, %434
  %447 = add nsw i32 %44, %indvars354
  %448 = add nsw i32 %46, %indvars354
  %449 = call noundef zeroext i1 @_Z5validii(i32 noundef %386, i32 noundef %447)
  br i1 %449, label %450, label %452

450:                                              ; preds = %.preheader240.2
  %451 = call noundef zeroext i1 @_Z5validii(i32 noundef %387, i32 noundef %448)
  br i1 %451, label %453, label %452

452:                                              ; preds = %450, %.preheader240.2
  store i32 -1, ptr getelementptr inbounds (i8, ptr @pos, i64 20), align 4, !tbaa !5
  store i32 -1, ptr getelementptr inbounds (i8, ptr @pos, i64 16), align 16, !tbaa !5
  br label %.preheader240.3

453:                                              ; preds = %450
  %454 = add nsw i32 %56, %indvars354
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %7, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #8
  %455 = call noundef i32 @_Z5idx_2iii(i32 noundef %indvars356, i32 noundef %indvars354, i32 noundef 2)
  %456 = sext i32 %455 to i64
  %457 = getelementptr inbounds [10000 x %"class.std::vector"], ptr @e, i64 0, i64 %456
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE4swapERS3_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %457) #8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #8
  %458 = call noundef i32 @_Z5idx_2iii(i32 noundef %indvars356, i32 noundef %indvars354, i32 noundef 2)
  %459 = sext i32 %458 to i64
  %460 = getelementptr inbounds [10000 x %"class.std::vector"], ptr @e, i64 0, i64 %459
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #8
  store i32 1, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #8
  %461 = call noundef i32 @_Z5idx_2iii(i32 noundef %388, i32 noundef %454, i32 noundef 1)
  store i32 %461, ptr %10, align 4, !tbaa !5
  %462 = call i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
  store i64 %462, ptr %8, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %460, ptr noundef nonnull align 4 dereferenceable(8) %8)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  %463 = call noundef i32 @_Z5idx_1ii(i32 noundef %386, i32 noundef %447)
  store i32 %463, ptr getelementptr inbounds (i8, ptr @pos, i64 16), align 16, !tbaa !5
  %464 = call noundef i32 @_Z5idx_1ii(i32 noundef %387, i32 noundef %448)
  store i32 %464, ptr getelementptr inbounds (i8, ptr @pos, i64 20), align 4, !tbaa !5
  br label %.preheader240.3

.preheader240.3:                                  ; preds = %453, %452
  %465 = add nsw i32 %48, %indvars354
  %466 = add nsw i32 %50, %indvars354
  %467 = call noundef zeroext i1 @_Z5validii(i32 noundef %389, i32 noundef %465)
  br i1 %467, label %468, label %470

468:                                              ; preds = %.preheader240.3
  %469 = call noundef zeroext i1 @_Z5validii(i32 noundef %390, i32 noundef %466)
  br i1 %469, label %471, label %470

470:                                              ; preds = %468, %.preheader240.3
  store i32 -1, ptr getelementptr inbounds (i8, ptr @pos, i64 28), align 4, !tbaa !5
  store i32 -1, ptr getelementptr inbounds (i8, ptr @pos, i64 24), align 8, !tbaa !5
  br label %.preheader239.preheader

471:                                              ; preds = %468
  %472 = add nsw i32 %58, %indvars354
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %7, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #8
  %473 = call noundef i32 @_Z5idx_2iii(i32 noundef %indvars356, i32 noundef %indvars354, i32 noundef 3)
  %474 = sext i32 %473 to i64
  %475 = getelementptr inbounds [10000 x %"class.std::vector"], ptr @e, i64 0, i64 %474
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE4swapERS3_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %475) #8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #8
  %476 = call noundef i32 @_Z5idx_2iii(i32 noundef %indvars356, i32 noundef %indvars354, i32 noundef 3)
  %477 = sext i32 %476 to i64
  %478 = getelementptr inbounds [10000 x %"class.std::vector"], ptr @e, i64 0, i64 %477
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #8
  store i32 1, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #8
  %479 = call noundef i32 @_Z5idx_2iii(i32 noundef %391, i32 noundef %472, i32 noundef 0)
  store i32 %479, ptr %10, align 4, !tbaa !5
  %480 = call i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
  store i64 %480, ptr %8, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %478, ptr noundef nonnull align 4 dereferenceable(8) %8)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  %481 = call noundef i32 @_Z5idx_1ii(i32 noundef %389, i32 noundef %465)
  store i32 %481, ptr getelementptr inbounds (i8, ptr @pos, i64 24), align 8, !tbaa !5
  %482 = call noundef i32 @_Z5idx_1ii(i32 noundef %390, i32 noundef %466)
  store i32 %482, ptr getelementptr inbounds (i8, ptr @pos, i64 28), align 4, !tbaa !5
  br label %.preheader239.preheader

.preheader239.preheader:                          ; preds = %471, %470
  br label %.preheader239

.preheader239:                                    ; preds = %.preheader239.preheader, %.loopexit233
  %indvars.iv335 = phi i64 [ %indvars.iv.next336, %.loopexit233 ], [ 0, %.preheader239.preheader ]
  %483 = getelementptr inbounds [8 x i32], ptr @pos, i64 0, i64 %indvars.iv335
  %484 = load i32, ptr %483, align 4, !tbaa !5
  %485 = icmp eq i32 %484, -1
  br i1 %485, label %.loopexit233, label %.lr.ph279.preheader

.lr.ph279.preheader:                              ; preds = %.preheader239
  %486 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %indvars.iv335
  %487 = load i32, ptr @n, align 4, !tbaa !5
  %488 = load i32, ptr @m, align 4, !tbaa !5
  %489 = mul nsw i32 %488, %487
  %490 = sext i32 %489 to i64
  %491 = shl nsw i64 %490, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %486, i8 63, i64 %491, i1 false)
  %492 = sext i32 %484 to i64
  %493 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %indvars.iv335, i64 %492
  store i32 0, ptr %493, align 4, !tbaa !5
  store i32 1, ptr @R, align 4, !tbaa !5
  %494 = getelementptr inbounds [8 x [2500 x i32]], ptr @que, i64 0, i64 %indvars.iv335, i64 0
  store i32 %484, ptr %494, align 16, !tbaa !5
  br label %.lr.ph279

.lr.ph279:                                        ; preds = %.lr.ph279.preheader, %576
  %495 = phi i32 [ %578, %576 ], [ 0, %.lr.ph279.preheader ]
  %496 = add nsw i32 %495, 1
  store i32 %496, ptr @L, align 4, !tbaa !5
  %497 = sext i32 %495 to i64
  %498 = getelementptr inbounds [8 x [2500 x i32]], ptr @que, i64 0, i64 %indvars.iv335, i64 %497
  %499 = load i32, ptr %498, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #8
  call void @_Z5rdx_1iRiS_(i32 noundef %499, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %500 = sext i32 %499 to i64
  %501 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %indvars.iv335, i64 %500
  %502 = load i32, ptr %11, align 4, !tbaa !5
  %503 = add nsw i32 %.pre366, %502
  %504 = load i32, ptr %12, align 4, !tbaa !5
  %505 = add nsw i32 %.pre367, %504
  %506 = call noundef zeroext i1 @_Z5validii(i32 noundef %503, i32 noundef %505)
  br i1 %506, label %507, label %520

507:                                              ; preds = %.lr.ph279
  %508 = call noundef i32 @_Z5idx_1ii(i32 noundef %503, i32 noundef %505)
  %509 = sext i32 %508 to i64
  %510 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %indvars.iv335, i64 %509
  %511 = load i32, ptr %510, align 4, !tbaa !5
  %512 = icmp eq i32 %511, 1061109567
  br i1 %512, label %513, label %520

513:                                              ; preds = %507
  %514 = load i32, ptr %501, align 4, !tbaa !5
  %515 = add nsw i32 %514, 1
  store i32 %515, ptr %510, align 4, !tbaa !5
  %516 = load i32, ptr @R, align 4, !tbaa !5
  %517 = add nsw i32 %516, 1
  store i32 %517, ptr @R, align 4, !tbaa !5
  %518 = sext i32 %516 to i64
  %519 = getelementptr inbounds [8 x [2500 x i32]], ptr @que, i64 0, i64 %indvars.iv335, i64 %518
  store i32 %508, ptr %519, align 4, !tbaa !5
  br label %520

520:                                              ; preds = %507, %513, %.lr.ph279
  %521 = load i32, ptr %11, align 4, !tbaa !5
  %522 = add nsw i32 %59, %521
  %523 = load i32, ptr %12, align 4, !tbaa !5
  %524 = add nsw i32 %60, %523
  %525 = call noundef zeroext i1 @_Z5validii(i32 noundef %522, i32 noundef %524)
  br i1 %525, label %526, label %539

526:                                              ; preds = %520
  %527 = call noundef i32 @_Z5idx_1ii(i32 noundef %522, i32 noundef %524)
  %528 = sext i32 %527 to i64
  %529 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %indvars.iv335, i64 %528
  %530 = load i32, ptr %529, align 4, !tbaa !5
  %531 = icmp eq i32 %530, 1061109567
  br i1 %531, label %532, label %539

532:                                              ; preds = %526
  %533 = load i32, ptr %501, align 4, !tbaa !5
  %534 = add nsw i32 %533, 1
  store i32 %534, ptr %529, align 4, !tbaa !5
  %535 = load i32, ptr @R, align 4, !tbaa !5
  %536 = add nsw i32 %535, 1
  store i32 %536, ptr @R, align 4, !tbaa !5
  %537 = sext i32 %535 to i64
  %538 = getelementptr inbounds [8 x [2500 x i32]], ptr @que, i64 0, i64 %indvars.iv335, i64 %537
  store i32 %527, ptr %538, align 4, !tbaa !5
  br label %539

539:                                              ; preds = %532, %526, %520
  %540 = load i32, ptr %11, align 4, !tbaa !5
  %541 = add nsw i32 %61, %540
  %542 = load i32, ptr %12, align 4, !tbaa !5
  %543 = add nsw i32 %62, %542
  %544 = call noundef zeroext i1 @_Z5validii(i32 noundef %541, i32 noundef %543)
  br i1 %544, label %545, label %558

545:                                              ; preds = %539
  %546 = call noundef i32 @_Z5idx_1ii(i32 noundef %541, i32 noundef %543)
  %547 = sext i32 %546 to i64
  %548 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %indvars.iv335, i64 %547
  %549 = load i32, ptr %548, align 4, !tbaa !5
  %550 = icmp eq i32 %549, 1061109567
  br i1 %550, label %551, label %558

551:                                              ; preds = %545
  %552 = load i32, ptr %501, align 4, !tbaa !5
  %553 = add nsw i32 %552, 1
  store i32 %553, ptr %548, align 4, !tbaa !5
  %554 = load i32, ptr @R, align 4, !tbaa !5
  %555 = add nsw i32 %554, 1
  store i32 %555, ptr @R, align 4, !tbaa !5
  %556 = sext i32 %554 to i64
  %557 = getelementptr inbounds [8 x [2500 x i32]], ptr @que, i64 0, i64 %indvars.iv335, i64 %556
  store i32 %546, ptr %557, align 4, !tbaa !5
  br label %558

558:                                              ; preds = %551, %545, %539
  %559 = load i32, ptr %11, align 4, !tbaa !5
  %560 = add nsw i32 %63, %559
  %561 = load i32, ptr %12, align 4, !tbaa !5
  %562 = add nsw i32 %64, %561
  %563 = call noundef zeroext i1 @_Z5validii(i32 noundef %560, i32 noundef %562)
  br i1 %563, label %564, label %._crit_edge368

._crit_edge368:                                   ; preds = %558
  %.pre369 = load i32, ptr @R, align 4, !tbaa !5
  br label %576

564:                                              ; preds = %558
  %565 = call noundef i32 @_Z5idx_1ii(i32 noundef %560, i32 noundef %562)
  %566 = sext i32 %565 to i64
  %567 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %indvars.iv335, i64 %566
  %568 = load i32, ptr %567, align 4, !tbaa !5
  %569 = icmp eq i32 %568, 1061109567
  %.pre370 = load i32, ptr @R, align 4, !tbaa !5
  br i1 %569, label %570, label %576

570:                                              ; preds = %564
  %571 = load i32, ptr %501, align 4, !tbaa !5
  %572 = add nsw i32 %571, 1
  store i32 %572, ptr %567, align 4, !tbaa !5
  %573 = add nsw i32 %.pre370, 1
  store i32 %573, ptr @R, align 4, !tbaa !5
  %574 = sext i32 %.pre370 to i64
  %575 = getelementptr inbounds [8 x [2500 x i32]], ptr @que, i64 0, i64 %indvars.iv335, i64 %574
  store i32 %565, ptr %575, align 4, !tbaa !5
  br label %576

576:                                              ; preds = %._crit_edge368, %570, %564
  %577 = phi i32 [ %.pre369, %._crit_edge368 ], [ %573, %570 ], [ %.pre370, %564 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #8
  %578 = load i32, ptr @L, align 4, !tbaa !5
  %579 = icmp slt i32 %578, %577
  br i1 %579, label %.lr.ph279, label %.loopexit233, !llvm.loop !19

.loopexit233:                                     ; preds = %576, %.preheader239
  %indvars.iv.next336 = add nuw nsw i64 %indvars.iv335, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next336, 8
  br i1 %exitcond.not, label %.preheader238, label %.preheader239, !llvm.loop !20

.preheader238:                                    ; preds = %.loopexit233, %.loopexit
  %indvars.iv342 = phi i64 [ %indvars.iv.next343, %.loopexit ], [ 0, %.loopexit233 ]
  %580 = shl nuw nsw i64 %indvars.iv342, 1
  %581 = getelementptr inbounds [8 x i32], ptr @pos, i64 0, i64 %580
  %582 = load i32, ptr %581, align 8, !tbaa !5
  %.not = icmp eq i32 %582, -1
  br i1 %.not, label %.loopexit, label %583

583:                                              ; preds = %.preheader238
  %584 = or disjoint i64 %580, 1
  %585 = getelementptr inbounds [8 x i32], ptr @pos, i64 0, i64 %584
  %586 = load i32, ptr %585, align 4, !tbaa !5
  %.not227 = icmp eq i32 %586, -1
  br i1 %.not227, label %.loopexit, label %.preheader232.preheader

.preheader232.preheader:                          ; preds = %583
  %587 = load i32, ptr @pos, align 16, !tbaa !5
  %.not228 = icmp eq i32 %587, -1
  br i1 %.not228, label %.preheader232.1, label %588

588:                                              ; preds = %.preheader232.preheader
  %589 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 4), align 4, !tbaa !5
  %.not229 = icmp eq i32 %589, -1
  %.not230 = icmp eq i64 %indvars.iv342, 0
  %or.cond231 = or i1 %.not230, %.not229
  br i1 %or.cond231, label %.preheader232.1, label %590

590:                                              ; preds = %588
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #8
  %591 = sext i32 %587 to i64
  %592 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %580, i64 %591
  %593 = load i32, ptr %592, align 4, !tbaa !5
  %594 = sext i32 %589 to i64
  %595 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %584, i64 %594
  %596 = load i32, ptr %595, align 4, !tbaa !5
  %597 = add nsw i32 %596, %593
  store i32 %597, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #8
  %598 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %580, i64 %594
  %599 = load i32, ptr %598, align 4, !tbaa !5
  %600 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %584, i64 %591
  %601 = load i32, ptr %600, align 4, !tbaa !5
  %602 = add nsw i32 %601, %599
  store i32 %602, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #8
  %603 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %604 = load i32, ptr %603, align 4, !tbaa !5
  store i32 %604, ptr %15, align 4, !tbaa !5
  %605 = icmp slt i32 %604, 1061109567
  br i1 %605, label %606, label %613

606:                                              ; preds = %590
  %607 = trunc nuw nsw i64 %indvars.iv342 to i32
  %608 = call noundef i32 @_Z5idx_2iii(i32 noundef %indvars356, i32 noundef %indvars354, i32 noundef %607)
  %609 = sext i32 %608 to i64
  %610 = getelementptr inbounds [10000 x %"class.std::vector"], ptr @e, i64 0, i64 %609
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %17) #8
  %611 = call noundef i32 @_Z5idx_2iii(i32 noundef %indvars356, i32 noundef %indvars354, i32 noundef 0)
  store i32 %611, ptr %17, align 4, !tbaa !5
  %612 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %17)
  store i64 %612, ptr %16, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %610, ptr noundef nonnull align 4 dereferenceable(8) %16)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #8
  br label %613

613:                                              ; preds = %606, %590
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #8
  br label %.preheader232.1

.preheader232.1:                                  ; preds = %.preheader232.preheader, %588, %613
  %614 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 8), align 8, !tbaa !5
  %.not228.1 = icmp eq i32 %614, -1
  br i1 %.not228.1, label %.preheader232.2, label %615

615:                                              ; preds = %.preheader232.1
  %616 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 12), align 4, !tbaa !5
  %.not229.1 = icmp eq i32 %616, -1
  %.not230.1 = icmp eq i64 %indvars.iv342, 1
  %or.cond231.1 = or i1 %.not230.1, %.not229.1
  br i1 %or.cond231.1, label %.preheader232.2, label %617

617:                                              ; preds = %615
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #8
  %618 = sext i32 %614 to i64
  %619 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %580, i64 %618
  %620 = load i32, ptr %619, align 4, !tbaa !5
  %621 = sext i32 %616 to i64
  %622 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %584, i64 %621
  %623 = load i32, ptr %622, align 4, !tbaa !5
  %624 = add nsw i32 %623, %620
  store i32 %624, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #8
  %625 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %580, i64 %621
  %626 = load i32, ptr %625, align 4, !tbaa !5
  %627 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %584, i64 %618
  %628 = load i32, ptr %627, align 4, !tbaa !5
  %629 = add nsw i32 %628, %626
  store i32 %629, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #8
  %630 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %631 = load i32, ptr %630, align 4, !tbaa !5
  store i32 %631, ptr %15, align 4, !tbaa !5
  %632 = icmp slt i32 %631, 1061109567
  br i1 %632, label %633, label %640

633:                                              ; preds = %617
  %634 = trunc nuw nsw i64 %indvars.iv342 to i32
  %635 = call noundef i32 @_Z5idx_2iii(i32 noundef %indvars356, i32 noundef %indvars354, i32 noundef %634)
  %636 = sext i32 %635 to i64
  %637 = getelementptr inbounds [10000 x %"class.std::vector"], ptr @e, i64 0, i64 %636
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %17) #8
  %638 = call noundef i32 @_Z5idx_2iii(i32 noundef %indvars356, i32 noundef %indvars354, i32 noundef 1)
  store i32 %638, ptr %17, align 4, !tbaa !5
  %639 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %17)
  store i64 %639, ptr %16, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %637, ptr noundef nonnull align 4 dereferenceable(8) %16)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #8
  br label %640

640:                                              ; preds = %633, %617
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #8
  br label %.preheader232.2

.preheader232.2:                                  ; preds = %640, %615, %.preheader232.1
  %641 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 16), align 16, !tbaa !5
  %.not228.2 = icmp eq i32 %641, -1
  br i1 %.not228.2, label %.preheader232.3, label %642

642:                                              ; preds = %.preheader232.2
  %643 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 20), align 4, !tbaa !5
  %.not229.2 = icmp eq i32 %643, -1
  %.not230.2 = icmp eq i64 %indvars.iv342, 2
  %or.cond231.2 = or i1 %.not230.2, %.not229.2
  br i1 %or.cond231.2, label %.preheader232.3, label %644

644:                                              ; preds = %642
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #8
  %645 = sext i32 %641 to i64
  %646 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %580, i64 %645
  %647 = load i32, ptr %646, align 4, !tbaa !5
  %648 = sext i32 %643 to i64
  %649 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %584, i64 %648
  %650 = load i32, ptr %649, align 4, !tbaa !5
  %651 = add nsw i32 %650, %647
  store i32 %651, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #8
  %652 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %580, i64 %648
  %653 = load i32, ptr %652, align 4, !tbaa !5
  %654 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %584, i64 %645
  %655 = load i32, ptr %654, align 4, !tbaa !5
  %656 = add nsw i32 %655, %653
  store i32 %656, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #8
  %657 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %658 = load i32, ptr %657, align 4, !tbaa !5
  store i32 %658, ptr %15, align 4, !tbaa !5
  %659 = icmp slt i32 %658, 1061109567
  br i1 %659, label %660, label %667

660:                                              ; preds = %644
  %661 = trunc nuw nsw i64 %indvars.iv342 to i32
  %662 = call noundef i32 @_Z5idx_2iii(i32 noundef %indvars356, i32 noundef %indvars354, i32 noundef %661)
  %663 = sext i32 %662 to i64
  %664 = getelementptr inbounds [10000 x %"class.std::vector"], ptr @e, i64 0, i64 %663
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %17) #8
  %665 = call noundef i32 @_Z5idx_2iii(i32 noundef %indvars356, i32 noundef %indvars354, i32 noundef 2)
  store i32 %665, ptr %17, align 4, !tbaa !5
  %666 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %17)
  store i64 %666, ptr %16, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %664, ptr noundef nonnull align 4 dereferenceable(8) %16)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #8
  br label %667

667:                                              ; preds = %660, %644
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #8
  br label %.preheader232.3

.preheader232.3:                                  ; preds = %667, %642, %.preheader232.2
  %668 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 24), align 8, !tbaa !5
  %.not228.3 = icmp eq i32 %668, -1
  br i1 %.not228.3, label %.loopexit, label %669

669:                                              ; preds = %.preheader232.3
  %670 = load i32, ptr getelementptr inbounds (i8, ptr @pos, i64 28), align 4, !tbaa !5
  %.not229.3 = icmp eq i32 %670, -1
  %.not230.3 = icmp eq i64 %indvars.iv342, 3
  %or.cond231.3 = or i1 %.not230.3, %.not229.3
  br i1 %or.cond231.3, label %.loopexit, label %671

671:                                              ; preds = %669
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #8
  %672 = sext i32 %668 to i64
  %673 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %580, i64 %672
  %674 = load i32, ptr %673, align 4, !tbaa !5
  %675 = sext i32 %670 to i64
  %676 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %584, i64 %675
  %677 = load i32, ptr %676, align 4, !tbaa !5
  %678 = add nsw i32 %677, %674
  store i32 %678, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #8
  %679 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %580, i64 %675
  %680 = load i32, ptr %679, align 4, !tbaa !5
  %681 = getelementptr inbounds [8 x [2500 x i32]], ptr @dis, i64 0, i64 %584, i64 %672
  %682 = load i32, ptr %681, align 4, !tbaa !5
  %683 = add nsw i32 %682, %680
  store i32 %683, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #8
  %684 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %685 = load i32, ptr %684, align 4, !tbaa !5
  store i32 %685, ptr %15, align 4, !tbaa !5
  %686 = icmp slt i32 %685, 1061109567
  br i1 %686, label %687, label %694

687:                                              ; preds = %671
  %688 = trunc nuw nsw i64 %indvars.iv342 to i32
  %689 = call noundef i32 @_Z5idx_2iii(i32 noundef %indvars356, i32 noundef %indvars354, i32 noundef %688)
  %690 = sext i32 %689 to i64
  %691 = getelementptr inbounds [10000 x %"class.std::vector"], ptr @e, i64 0, i64 %690
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %17) #8
  %692 = call noundef i32 @_Z5idx_2iii(i32 noundef %indvars356, i32 noundef %indvars354, i32 noundef 3)
  store i32 %692, ptr %17, align 4, !tbaa !5
  %693 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %17)
  store i64 %693, ptr %16, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %691, ptr noundef nonnull align 4 dereferenceable(8) %16)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #8
  br label %694

694:                                              ; preds = %687, %671
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #8
  br label %.loopexit

.loopexit:                                        ; preds = %.preheader232.3, %669, %694, %.preheader238, %583
  %indvars.iv.next343 = add nuw nsw i64 %indvars.iv342, 1
  %exitcond345.not = icmp eq i64 %indvars.iv.next343, 4
  br i1 %exitcond345.not, label %.preheader.preheader, label %.preheader238, !llvm.loop !21

.preheader.preheader:                             ; preds = %.loopexit
  store i16 28527, ptr %scevgep324, align 1
  store i16 28527, ptr %gep, align 1
  br label %.loopexit237

.loopexit237:                                     ; preds = %.preheader.preheader, %406
  %indvar.next321 = add nuw nsw i64 %indvar320, 1
  %indvars = trunc i64 %indvar.next321 to i32
  %695 = load i32, ptr @m, align 4, !tbaa !5
  %696 = icmp sgt i32 %695, %indvars
  br i1 %696, label %.preheader242, label %._crit_edge287.loopexit, !llvm.loop !22

.preheader245:                                    ; preds = %748, %._crit_edge289
  %697 = call noundef i32 @_Z5idx_2iii(i32 noundef 0, i32 noundef 0, i32 noundef 0)
  %698 = sext i32 %697 to i64
  %699 = getelementptr inbounds [10000 x i32], ptr @dist, i64 0, i64 %698
  %700 = load i32, ptr %699, align 4, !tbaa !5
  %701 = call noundef i32 @_Z5idx_2iii(i32 noundef 0, i32 noundef 0, i32 noundef 1)
  %702 = sext i32 %701 to i64
  %703 = getelementptr inbounds [10000 x i32], ptr @dist, i64 0, i64 %702
  %704 = load i32, ptr %703, align 4, !tbaa !5
  %spec.select = call i32 @llvm.smin.i32(i32 %700, i32 %704)
  %705 = call noundef i32 @_Z5idx_2iii(i32 noundef 0, i32 noundef 0, i32 noundef 2)
  %706 = sext i32 %705 to i64
  %707 = getelementptr inbounds [10000 x i32], ptr @dist, i64 0, i64 %706
  %708 = load i32, ptr %707, align 4, !tbaa !5
  %spec.select.1 = call i32 @llvm.smin.i32(i32 %spec.select, i32 %708)
  %709 = call noundef i32 @_Z5idx_2iii(i32 noundef 0, i32 noundef 0, i32 noundef 3)
  %710 = sext i32 %709 to i64
  %711 = getelementptr inbounds [10000 x i32], ptr @dist, i64 0, i64 %710
  %712 = load i32, ptr %711, align 4, !tbaa !5
  %spec.select.2 = call i32 @llvm.smin.i32(i32 %spec.select.1, i32 %712)
  %spec.select.3 = call i32 @llvm.smin.i32(i32 %spec.select.2, i32 1061109567)
  %713 = icmp sgt i32 %spec.select.2, 1061109566
  %714 = select i1 %713, i32 -1, i32 %spec.select.3
  %715 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %714)
  br label %.backedge

.lr.ph295:                                        ; preds = %._crit_edge289, %748
  %716 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %717 = getelementptr inbounds i8, ptr %716, i64 4
  %718 = load i32, ptr %717, align 4, !tbaa !23
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %719 = sext i32 %718 to i64
  %720 = getelementptr inbounds [10000 x i8], ptr @vis, i64 0, i64 %719
  %721 = load i8, ptr %720, align 1, !tbaa !25, !range !27, !noundef !28
  %722 = trunc nuw i8 %721 to i1
  br i1 %722, label %748, label %723, !llvm.loop !29

723:                                              ; preds = %.lr.ph295
  store i8 1, ptr %720, align 1, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #8
  %724 = getelementptr inbounds [10000 x %"class.std::vector"], ptr @e, i64 0, i64 %719
  %725 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %724) #8
  store ptr %725, ptr %18, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #8
  %726 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %724) #8
  store ptr %726, ptr %19, align 8
  %727 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #8
  br i1 %727, label %.lr.ph292, label %._crit_edge293

.lr.ph292:                                        ; preds = %723
  %728 = getelementptr inbounds [10000 x i32], ptr @dist, i64 0, i64 %719
  br label %729

._crit_edge293:                                   ; preds = %744, %723
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #8
  br label %748

729:                                              ; preds = %.lr.ph292, %744
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %20) #8
  %730 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #8
  %731 = getelementptr inbounds i8, ptr %730, i64 4
  %732 = load i32, ptr %731, align 4, !tbaa !23
  store i32 %732, ptr %20, align 4, !tbaa !5
  %733 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #8
  %734 = load i32, ptr %733, align 4, !tbaa !30
  %735 = load i32, ptr %20, align 4, !tbaa !5
  %736 = sext i32 %735 to i64
  %737 = getelementptr inbounds [10000 x i32], ptr @dist, i64 0, i64 %736
  %738 = load i32, ptr %737, align 4, !tbaa !5
  %739 = load i32, ptr %728, align 4, !tbaa !5
  %740 = add nsw i32 %739, %734
  %741 = icmp sgt i32 %738, %740
  br i1 %741, label %742, label %744

742:                                              ; preds = %729
  store i32 %740, ptr %737, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %21) #8
  %743 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %737, ptr noundef nonnull align 4 dereferenceable(4) %20)
  store i64 %743, ptr %21, align 8
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(8) %21)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %21) #8
  br label %744

744:                                              ; preds = %742, %729
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %20) #8
  %745 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #8
  %746 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %724) #8
  store ptr %746, ptr %19, align 8
  %747 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #8
  br i1 %747, label %729, label %._crit_edge293, !llvm.loop !31

748:                                              ; preds = %.lr.ph295, %._crit_edge293
  %749 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  br i1 %749, label %.preheader245, label %.lr.ph295

._crit_edge300:                                   ; preds = %.backedge, %0
  ret i32 0
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z5idx_1ii(i32 noundef, i32 noundef) local_unnamed_addr #4

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z5idx_2iii(i32 noundef, i32 noundef, i32 noundef) 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 #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #6 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EE4swapERS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #6 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.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 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 #2 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = !{!24, !6, i64 4}
!24 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!25 = !{!26, !26, i64 0}
!26 = !{!"bool", !7, i64 0}
!27 = !{i8 0, i8 2}
!28 = !{}
!29 = distinct !{!29, !10}
!30 = !{!24, !6, i64 0}
!31 = distinct !{!31, !10}


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