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

; 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<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@p = external dso_local global [301 x i32], align 16
@dis = external dso_local global [301 x [301 x i32]], align 16
@pre = external dso_local global [301 x [301 x i32]], align 16
@Dis = external dso_local global ptr, align 8
@Pre = external dso_local global ptr, align 8
@ctr = external dso_local global i32, align 4
@vis = external dso_local global [301 x [301 x i32]], align 16
@e = external dso_local global [301 x %"class.std::vector"], align 16
@buf = external dso_local global [301 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1

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

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

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %15

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

19:                                               ; preds = %15
  %20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %30, %19
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = load i32, ptr @n, align 4, !tbaa !5
  %24 = icmp slt i32 %22, %23
  br i1 %24, label %26, label %25

25:                                               ; preds = %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %33

26:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #8
  call void @llvm.memset.p0.i64(ptr align 8 %3, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [301 x %"class.std::vector"], ptr @e, i64 0, i64 %28
  call void @_ZNSt6vectorIiSaIiEE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %29) #8
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #8
  br label %30

30:                                               ; preds = %26
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %2, align 4, !tbaa !5
  br label %21, !llvm.loop !9

33:                                               ; preds = %25
  store i32 0, ptr @ctr, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %75, %33
  %35 = load i32, ptr %4, align 4, !tbaa !5
  %36 = load i32, ptr @n, align 4, !tbaa !5
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  br label %78

39:                                               ; preds = %34
  %40 = load i32, ptr %4, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds i32, ptr @p, i64 %41
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds i32, ptr @vis, i64 %44
  %46 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %42, ptr noundef %45)
  %47 = load i32, ptr %4, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [301 x i32], ptr @p, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = icmp sge i32 %50, 0
  br i1 %51, label %52, label %65

52:                                               ; preds = %39
  %53 = load i32, ptr %4, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [301 x %"class.std::vector"], ptr @e, i64 0, i64 %54
  %56 = load i32, ptr %4, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [301 x i32], ptr @p, i64 0, i64 %57
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %55, ptr noundef nonnull align 4 dereferenceable(4) %58)
  %59 = load i32, ptr %4, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [301 x i32], ptr @p, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [301 x %"class.std::vector"], ptr @e, i64 0, i64 %63
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %64, ptr noundef nonnull align 4 dereferenceable(4) %4)
  br label %65

65:                                               ; preds = %52, %39
  %66 = load i32, ptr %4, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [301 x i32], ptr @vis, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = icmp ne i32 %69, 0
  %71 = xor i1 %70, true
  %72 = zext i1 %71 to i32
  %73 = load i32, ptr @ctr, align 4, !tbaa !5
  %74 = add nsw i32 %73, %72
  store i32 %74, ptr @ctr, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %65
  %76 = load i32, ptr %4, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %4, align 4, !tbaa !5
  br label %34, !llvm.loop !11

78:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %94, %78
  %80 = load i32, ptr %5, align 4, !tbaa !5
  %81 = load i32, ptr @n, align 4, !tbaa !5
  %82 = icmp slt i32 %80, %81
  br i1 %82, label %84, label %83

83:                                               ; preds = %79
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  br label %97

84:                                               ; preds = %79
  %85 = load i32, ptr %5, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [301 x [301 x i32]], ptr @dis, i64 0, i64 %86
  %88 = getelementptr inbounds [301 x i32], ptr %87, i64 0, i64 0
  store ptr %88, ptr @Dis, align 8, !tbaa !12
  %89 = load i32, ptr %5, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [301 x [301 x i32]], ptr @pre, i64 0, i64 %90
  %92 = getelementptr inbounds [301 x i32], ptr %91, i64 0, i64 0
  store ptr %92, ptr @Pre, align 8, !tbaa !12
  %93 = load i32, ptr %5, align 4, !tbaa !5
  call void @_Z3dfsii(i32 noundef %93, i32 noundef -1)
  br label %94

94:                                               ; preds = %84
  %95 = load i32, ptr %5, align 4, !tbaa !5
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %5, align 4, !tbaa !5
  br label %79, !llvm.loop !14

97:                                               ; preds = %83
  store i8 49, ptr @buf, align 16, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %399, %97
  %99 = load i32, ptr %6, align 4, !tbaa !5
  %100 = load i32, ptr @n, align 4, !tbaa !5
  %101 = icmp slt i32 %99, %100
  br i1 %101, label %103, label %102

102:                                              ; preds = %98
  store i32 13, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  br label %402

103:                                              ; preds = %98
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [301 x i8], ptr @buf, i64 0, i64 %105
  store i8 48, ptr %106, align 1, !tbaa !15
  %107 = load i32, ptr %6, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [301 x i32], ptr @p, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [301 x i8], ptr @buf, i64 0, i64 %111
  %113 = load i8, ptr %112, align 1, !tbaa !15
  %114 = sext i8 %113 to i32
  %115 = icmp eq i32 %114, 48
  br i1 %115, label %116, label %117

116:                                              ; preds = %103
  br label %399

117:                                              ; preds = %103
  %118 = load i32, ptr %6, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [301 x [301 x i32]], ptr @vis, i64 0, i64 %119
  %121 = getelementptr inbounds [301 x i32], ptr %120, i64 0, i64 0
  %122 = load i32, ptr %6, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [301 x i32], ptr @p, i64 0, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [301 x [301 x i32]], ptr @vis, i64 0, i64 %126
  %128 = getelementptr inbounds [301 x i32], ptr %127, i64 0, i64 0
  %129 = load i32, ptr @n, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = mul i64 %130, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %121, ptr align 4 %128, i64 %131, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  %132 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %132, ptr %8, align 4, !tbaa !5
  br label %133

133:                                              ; preds = %175, %117
  %134 = load i32, ptr %8, align 4, !tbaa !5
  %135 = load i32, ptr @n, align 4, !tbaa !5
  %136 = icmp slt i32 %134, %135
  br i1 %136, label %138, label %137

137:                                              ; preds = %133
  store i32 16, ptr %7, align 4
  br label %178

138:                                              ; preds = %133
  %139 = load i32, ptr %6, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [301 x i32], ptr @p, i64 0, i64 %140
  %142 = load i32, ptr %141, align 4, !tbaa !5
  %143 = load i32, ptr %6, align 4, !tbaa !5
  %144 = load i32, ptr %8, align 4, !tbaa !5
  %145 = call noundef zeroext i1 @_Z7on_pathiii(i32 noundef %142, i32 noundef %143, i32 noundef %144)
  br i1 %145, label %146, label %174

146:                                              ; preds = %138
  %147 = load i32, ptr %6, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [301 x [301 x i32]], ptr @vis, i64 0, i64 %148
  %150 = load i32, ptr %8, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [301 x i32], ptr %149, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = icmp ne i32 %153, 0
  br i1 %154, label %174, label %155

155:                                              ; preds = %146
  %156 = load i32, ptr %6, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [301 x [301 x i32]], ptr @vis, i64 0, i64 %157
  %159 = load i32, ptr %6, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [301 x i32], ptr @p, i64 0, i64 %160
  %162 = load i32, ptr %161, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [301 x i32], ptr %158, i64 0, i64 %163
  %165 = load i32, ptr %6, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [301 x [301 x i32]], ptr @vis, i64 0, i64 %166
  %168 = load i32, ptr %8, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [301 x i32], ptr %167, i64 0, i64 %169
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %164, ptr noundef nonnull align 4 dereferenceable(4) %170) #8
  %171 = load i32, ptr %6, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [301 x i8], ptr @buf, i64 0, i64 %172
  store i8 49, ptr %173, align 1, !tbaa !15
  store i32 16, ptr %7, align 4
  br label %178

174:                                              ; preds = %146, %138
  br label %175

175:                                              ; preds = %174
  %176 = load i32, ptr %8, align 4, !tbaa !5
  %177 = add nsw i32 %176, 1
  store i32 %177, ptr %8, align 4, !tbaa !5
  br label %133, !llvm.loop !16

178:                                              ; preds = %155, %137
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  br label %179

179:                                              ; preds = %178
  %180 = load i32, ptr %6, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [301 x i8], ptr @buf, i64 0, i64 %181
  %183 = load i8, ptr %182, align 1, !tbaa !15
  %184 = sext i8 %183 to i32
  %185 = icmp eq i32 %184, 49
  br i1 %185, label %186, label %187

186:                                              ; preds = %179
  br label %399

187:                                              ; preds = %179
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 -1, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %188

188:                                              ; preds = %259, %187
  %189 = load i32, ptr %10, align 4, !tbaa !5
  %190 = load i32, ptr @n, align 4, !tbaa !5
  %191 = icmp slt i32 %189, %190
  br i1 %191, label %193, label %192

192:                                              ; preds = %188
  store i32 19, ptr %7, align 4
  br label %262

193:                                              ; preds = %188
  %194 = load i32, ptr %6, align 4, !tbaa !5
  %195 = load i32, ptr %6, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [301 x i32], ptr @p, i64 0, i64 %196
  %198 = load i32, ptr %197, align 4, !tbaa !5
  %199 = load i32, ptr %10, align 4, !tbaa !5
  %200 = call noundef zeroext i1 @_Z7on_pathiii(i32 noundef %194, i32 noundef %198, i32 noundef %199)
  br i1 %200, label %201, label %258

201:                                              ; preds = %193
  %202 = load i32, ptr %6, align 4, !tbaa !5
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds [301 x [301 x i32]], ptr @vis, i64 0, i64 %203
  %205 = load i32, ptr %10, align 4, !tbaa !5
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [301 x i32], ptr %204, i64 0, i64 %206
  %208 = load i32, ptr %207, align 4, !tbaa !5
  %209 = icmp ne i32 %208, 0
  br i1 %209, label %258, label %210

210:                                              ; preds = %201
  %211 = load i32, ptr %9, align 4, !tbaa !5
  %212 = icmp eq i32 %211, -1
  br i1 %212, label %213, label %224

213:                                              ; preds = %210
  %214 = load i32, ptr %10, align 4, !tbaa !5
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds [301 x [301 x i32]], ptr @pre, i64 0, i64 %215
  %217 = load i32, ptr %6, align 4, !tbaa !5
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [301 x i32], ptr @p, i64 0, i64 %218
  %220 = load i32, ptr %219, align 4, !tbaa !5
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [301 x i32], ptr %216, i64 0, i64 %221
  %223 = load i32, ptr %222, align 4, !tbaa !5
  store i32 %223, ptr %9, align 4, !tbaa !5
  br label %257

224:                                              ; preds = %210
  %225 = load i32, ptr %9, align 4, !tbaa !5
  %226 = load i32, ptr %10, align 4, !tbaa !5
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [301 x [301 x i32]], ptr @pre, i64 0, i64 %227
  %229 = load i32, ptr %6, align 4, !tbaa !5
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [301 x i32], ptr @p, i64 0, i64 %230
  %232 = load i32, ptr %231, align 4, !tbaa !5
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds [301 x i32], ptr %228, i64 0, i64 %233
  %235 = load i32, ptr %234, align 4, !tbaa !5
  %236 = icmp ne i32 %225, %235
  br i1 %236, label %237, label %256

237:                                              ; preds = %224
  %238 = load i32, ptr %6, align 4, !tbaa !5
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds [301 x [301 x i32]], ptr @vis, i64 0, i64 %239
  %241 = load i32, ptr %6, align 4, !tbaa !5
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds [301 x i32], ptr @p, i64 0, i64 %242
  %244 = load i32, ptr %243, align 4, !tbaa !5
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds [301 x i32], ptr %240, i64 0, i64 %245
  %247 = load i32, ptr %6, align 4, !tbaa !5
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds [301 x [301 x i32]], ptr @vis, i64 0, i64 %248
  %250 = load i32, ptr %10, align 4, !tbaa !5
  %251 = sext i32 %250 to i64
  %252 = getelementptr inbounds [301 x i32], ptr %249, i64 0, i64 %251
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %246, ptr noundef nonnull align 4 dereferenceable(4) %252) #8
  %253 = load i32, ptr %6, align 4, !tbaa !5
  %254 = sext i32 %253 to i64
  %255 = getelementptr inbounds [301 x i8], ptr @buf, i64 0, i64 %254
  store i8 49, ptr %255, align 1, !tbaa !15
  store i32 19, ptr %7, align 4
  br label %262

256:                                              ; preds = %224
  br label %257

257:                                              ; preds = %256, %213
  br label %258

258:                                              ; preds = %257, %201, %193
  br label %259

259:                                              ; preds = %258
  %260 = load i32, ptr %10, align 4, !tbaa !5
  %261 = add nsw i32 %260, 1
  store i32 %261, ptr %10, align 4, !tbaa !5
  br label %188, !llvm.loop !17

262:                                              ; preds = %237, %192
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %263

263:                                              ; preds = %262
  %264 = load i32, ptr %6, align 4, !tbaa !5
  %265 = sext i32 %264 to i64
  %266 = getelementptr inbounds [301 x i8], ptr @buf, i64 0, i64 %265
  %267 = load i8, ptr %266, align 1, !tbaa !15
  %268 = sext i8 %267 to i32
  %269 = icmp eq i32 %268, 49
  br i1 %269, label %273, label %270

270:                                              ; preds = %263
  %271 = load i32, ptr %9, align 4, !tbaa !5
  %272 = icmp eq i32 %271, -1
  br i1 %272, label %273, label %274

273:                                              ; preds = %270, %263
  store i32 15, ptr %7, align 4
  br label %396

274:                                              ; preds = %270
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 -1, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %275

275:                                              ; preds = %326, %274
  %276 = load i32, ptr %12, align 4, !tbaa !5
  %277 = load i32, ptr @n, align 4, !tbaa !5
  %278 = icmp slt i32 %276, %277
  br i1 %278, label %280, label %279

279:                                              ; preds = %275
  store i32 22, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %329

280:                                              ; preds = %275
  %281 = load i32, ptr %6, align 4, !tbaa !5
  %282 = sext i32 %281 to i64
  %283 = getelementptr inbounds [301 x i32], ptr @p, i64 0, i64 %282
  %284 = load i32, ptr %283, align 4, !tbaa !5
  %285 = load i32, ptr %9, align 4, !tbaa !5
  %286 = load i32, ptr %12, align 4, !tbaa !5
  %287 = call noundef zeroext i1 @_Z7on_pathiii(i32 noundef %284, i32 noundef %285, i32 noundef %286)
  br i1 %287, label %288, label %325

288:                                              ; preds = %280
  %289 = load i32, ptr %12, align 4, !tbaa !5
  %290 = sext i32 %289 to i64
  %291 = getelementptr inbounds [301 x %"class.std::vector"], ptr @e, i64 0, i64 %290
  %292 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %291) #8
  %293 = icmp uge i64 %292, 3
  br i1 %293, label %294, label %325

294:                                              ; preds = %288
  %295 = load i32, ptr %11, align 4, !tbaa !5
  %296 = icmp eq i32 %295, -1
  br i1 %296, label %297, label %299

297:                                              ; preds = %294
  %298 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %298, ptr %11, align 4, !tbaa !5
  br label %324

299:                                              ; preds = %294
  %300 = load i32, ptr %6, align 4, !tbaa !5
  %301 = sext i32 %300 to i64
  %302 = getelementptr inbounds [301 x i32], ptr @p, i64 0, i64 %301
  %303 = load i32, ptr %302, align 4, !tbaa !5
  %304 = sext i32 %303 to i64
  %305 = getelementptr inbounds [301 x [301 x i32]], ptr @dis, i64 0, i64 %304
  %306 = load i32, ptr %12, align 4, !tbaa !5
  %307 = sext i32 %306 to i64
  %308 = getelementptr inbounds [301 x i32], ptr %305, i64 0, i64 %307
  %309 = load i32, ptr %308, align 4, !tbaa !5
  %310 = load i32, ptr %6, align 4, !tbaa !5
  %311 = sext i32 %310 to i64
  %312 = getelementptr inbounds [301 x i32], ptr @p, i64 0, i64 %311
  %313 = load i32, ptr %312, align 4, !tbaa !5
  %314 = sext i32 %313 to i64
  %315 = getelementptr inbounds [301 x [301 x i32]], ptr @dis, i64 0, i64 %314
  %316 = load i32, ptr %11, align 4, !tbaa !5
  %317 = sext i32 %316 to i64
  %318 = getelementptr inbounds [301 x i32], ptr %315, i64 0, i64 %317
  %319 = load i32, ptr %318, align 4, !tbaa !5
  %320 = icmp slt i32 %309, %319
  br i1 %320, label %321, label %323

321:                                              ; preds = %299
  %322 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %322, ptr %11, align 4, !tbaa !5
  br label %323

323:                                              ; preds = %321, %299
  br label %324

324:                                              ; preds = %323, %297
  br label %325

325:                                              ; preds = %324, %288, %280
  br label %326

326:                                              ; preds = %325
  %327 = load i32, ptr %12, align 4, !tbaa !5
  %328 = add nsw i32 %327, 1
  store i32 %328, ptr %12, align 4, !tbaa !5
  br label %275, !llvm.loop !18

329:                                              ; preds = %279
  %330 = load i32, ptr %11, align 4, !tbaa !5
  %331 = icmp eq i32 %330, -1
  br i1 %331, label %346, label %332

332:                                              ; preds = %329
  %333 = load i32, ptr @ctr, align 4, !tbaa !5
  %334 = load i32, ptr %6, align 4, !tbaa !5
  %335 = sext i32 %334 to i64
  %336 = getelementptr inbounds [301 x i32], ptr @p, i64 0, i64 %335
  %337 = load i32, ptr %336, align 4, !tbaa !5
  %338 = sext i32 %337 to i64
  %339 = getelementptr inbounds [301 x [301 x i32]], ptr @dis, i64 0, i64 %338
  %340 = load i32, ptr %11, align 4, !tbaa !5
  %341 = sext i32 %340 to i64
  %342 = getelementptr inbounds [301 x i32], ptr %339, i64 0, i64 %341
  %343 = load i32, ptr %342, align 4, !tbaa !5
  %344 = add nsw i32 %343, 2
  %345 = icmp slt i32 %333, %344
  br i1 %345, label %346, label %347

346:                                              ; preds = %332, %329
  store i32 15, ptr %7, align 4
  br label %395

347:                                              ; preds = %332
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %348

348:                                              ; preds = %390, %347
  %349 = load i32, ptr %13, align 4, !tbaa !5
  %350 = load i32, ptr @n, align 4, !tbaa !5
  %351 = icmp slt i32 %349, %350
  br i1 %351, label %353, label %352

352:                                              ; preds = %348
  store i32 25, ptr %7, align 4
  br label %393

353:                                              ; preds = %348
  %354 = load i32, ptr %6, align 4, !tbaa !5
  %355 = sext i32 %354 to i64
  %356 = getelementptr inbounds [301 x i32], ptr @p, i64 0, i64 %355
  %357 = load i32, ptr %356, align 4, !tbaa !5
  %358 = load i32, ptr %9, align 4, !tbaa !5
  %359 = load i32, ptr %13, align 4, !tbaa !5
  %360 = call noundef zeroext i1 @_Z7on_pathiii(i32 noundef %357, i32 noundef %358, i32 noundef %359)
  br i1 %360, label %361, label %389

361:                                              ; preds = %353
  %362 = load i32, ptr %6, align 4, !tbaa !5
  %363 = sext i32 %362 to i64
  %364 = getelementptr inbounds [301 x [301 x i32]], ptr @vis, i64 0, i64 %363
  %365 = load i32, ptr %13, align 4, !tbaa !5
  %366 = sext i32 %365 to i64
  %367 = getelementptr inbounds [301 x i32], ptr %364, i64 0, i64 %366
  %368 = load i32, ptr %367, align 4, !tbaa !5
  %369 = icmp ne i32 %368, 0
  br i1 %369, label %389, label %370

370:                                              ; preds = %361
  %371 = load i32, ptr %6, align 4, !tbaa !5
  %372 = sext i32 %371 to i64
  %373 = getelementptr inbounds [301 x [301 x i32]], ptr @vis, i64 0, i64 %372
  %374 = load i32, ptr %6, align 4, !tbaa !5
  %375 = sext i32 %374 to i64
  %376 = getelementptr inbounds [301 x i32], ptr @p, i64 0, i64 %375
  %377 = load i32, ptr %376, align 4, !tbaa !5
  %378 = sext i32 %377 to i64
  %379 = getelementptr inbounds [301 x i32], ptr %373, i64 0, i64 %378
  %380 = load i32, ptr %6, align 4, !tbaa !5
  %381 = sext i32 %380 to i64
  %382 = getelementptr inbounds [301 x [301 x i32]], ptr @vis, i64 0, i64 %381
  %383 = load i32, ptr %13, align 4, !tbaa !5
  %384 = sext i32 %383 to i64
  %385 = getelementptr inbounds [301 x i32], ptr %382, i64 0, i64 %384
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %379, ptr noundef nonnull align 4 dereferenceable(4) %385) #8
  %386 = load i32, ptr %6, align 4, !tbaa !5
  %387 = sext i32 %386 to i64
  %388 = getelementptr inbounds [301 x i8], ptr @buf, i64 0, i64 %387
  store i8 49, ptr %388, align 1, !tbaa !15
  store i32 25, ptr %7, align 4
  br label %393

389:                                              ; preds = %361, %353
  br label %390

390:                                              ; preds = %389
  %391 = load i32, ptr %13, align 4, !tbaa !5
  %392 = add nsw i32 %391, 1
  store i32 %392, ptr %13, align 4, !tbaa !5
  br label %348, !llvm.loop !19

393:                                              ; preds = %370, %352
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %394

394:                                              ; preds = %393
  store i32 0, ptr %7, align 4
  br label %395

395:                                              ; preds = %394, %346
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %396

396:                                              ; preds = %395, %273
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  %397 = load i32, ptr %7, align 4
  switch i32 %397, label %408 [
    i32 0, label %398
    i32 15, label %399
  ]

398:                                              ; preds = %396
  br label %399

399:                                              ; preds = %398, %396, %186, %116
  %400 = load i32, ptr %6, align 4, !tbaa !5
  %401 = add nsw i32 %400, 1
  store i32 %401, ptr %6, align 4, !tbaa !5
  br label %98, !llvm.loop !20

402:                                              ; preds = %102
  %403 = load i32, ptr @n, align 4, !tbaa !5
  %404 = sext i32 %403 to i64
  %405 = getelementptr inbounds [301 x i8], ptr @buf, i64 0, i64 %404
  store i8 0, ptr %405, align 1, !tbaa !15
  %406 = call i32 @puts(ptr noundef @buf)
  br label %15, !llvm.loop !21

407:                                              ; preds = %15
  ret i32 0

408:                                              ; preds = %396
  unreachable
}

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

; 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: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

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

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

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

declare i32 @puts(ptr noundef) #4

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@p = external dso_local global [301 x i32], align 16
@dis = external dso_local global [301 x [301 x i32]], align 16
@pre = external dso_local global [301 x [301 x i32]], align 16
@Dis = external dso_local local_unnamed_addr global ptr, align 8
@Pre = external dso_local local_unnamed_addr global ptr, align 8
@ctr = external dso_local local_unnamed_addr global i32, align 4
@vis = external dso_local global [301 x [301 x i32]], align 16
@e = external dso_local global [301 x %"class.std::vector"], align 16
@buf = external dso_local global [301 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1

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

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

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

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

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

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

.lr.ph133:                                        ; preds = %0, %._crit_edge129
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %.lr.ph133
  store i32 0, ptr @ctr, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  br label %._crit_edge106.thread

._crit_edge:                                      ; preds = %.lr.ph
  store i32 0, ptr @ctr, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  store i32 0, ptr %2, align 4, !tbaa !5
  %9 = icmp sgt i32 %11, 0
  br i1 %9, label %.lr.ph105, label %._crit_edge106.thread

.lr.ph:                                           ; preds = %.lr.ph133, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph133 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %1, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #8
  %10 = getelementptr inbounds [301 x %"class.std::vector"], ptr @e, i64 0, i64 %indvars.iv
  call void @_ZNSt6vectorIiSaIiEE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %10) #8
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %11 = load i32, ptr @n, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %13 = icmp slt i64 %indvars.iv.next, %12
  br i1 %13, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge106.thread:                            ; preds = %._crit_edge, %._crit_edge.thread
  %.ph = phi i32 [ %7, %._crit_edge.thread ], [ %11, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  br label %._crit_edge110.thread

._crit_edge106:                                   ; preds = %32
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  %14 = icmp sgt i32 %40, 0
  br i1 %14, label %.lr.ph109, label %._crit_edge110.thread

.lr.ph105:                                        ; preds = %._crit_edge, %32
  %storemerge103 = phi i32 [ %39, %32 ], [ 0, %._crit_edge ]
  %15 = sext i32 %storemerge103 to i64
  %16 = getelementptr inbounds i32, ptr @p, i64 %15
  %17 = getelementptr inbounds i32, ptr @vis, i64 %15
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %16, ptr noundef nonnull %17)
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [301 x i32], ptr @p, i64 0, i64 %20
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %23 = icmp sgt i32 %22, -1
  br i1 %23, label %24, label %32

24:                                               ; preds = %.lr.ph105
  %25 = getelementptr inbounds [301 x %"class.std::vector"], ptr @e, i64 0, i64 %20
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %25, ptr noundef nonnull align 4 dereferenceable(4) %21)
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [301 x i32], ptr @p, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [301 x %"class.std::vector"], ptr @e, i64 0, i64 %30
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %31, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %.pre = load i32, ptr %2, align 4, !tbaa !5
  %.pre163 = sext i32 %.pre to i64
  br label %32

32:                                               ; preds = %24, %.lr.ph105
  %.pre-phi = phi i64 [ %.pre163, %24 ], [ %20, %.lr.ph105 ]
  %33 = phi i32 [ %.pre, %24 ], [ %19, %.lr.ph105 ]
  %34 = getelementptr inbounds [301 x i32], ptr @vis, i64 0, i64 %.pre-phi
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %.not92 = icmp eq i32 %35, 0
  %36 = zext i1 %.not92 to i32
  %37 = load i32, ptr @ctr, align 4, !tbaa !5
  %38 = add nsw i32 %37, %36
  store i32 %38, ptr @ctr, align 4, !tbaa !5
  %39 = add nsw i32 %33, 1
  store i32 %39, ptr %2, align 4, !tbaa !5
  %40 = load i32, ptr @n, align 4, !tbaa !5
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %.lr.ph105, label %._crit_edge106, !llvm.loop !11

._crit_edge110.thread:                            ; preds = %._crit_edge106, %._crit_edge106.thread
  %.ph166 = phi i32 [ %.ph, %._crit_edge106.thread ], [ %40, %._crit_edge106 ]
  store i8 49, ptr @buf, align 16, !tbaa !12
  br label %._crit_edge110.._crit_edge129_crit_edge

._crit_edge110:                                   ; preds = %.lr.ph109
  store i8 49, ptr @buf, align 16, !tbaa !12
  %42 = icmp sgt i32 %47, 1
  br i1 %42, label %.lr.ph128, label %._crit_edge110.._crit_edge129_crit_edge

._crit_edge110.._crit_edge129_crit_edge:          ; preds = %._crit_edge110.thread, %._crit_edge110
  %43 = phi i32 [ %.ph166, %._crit_edge110.thread ], [ %47, %._crit_edge110 ]
  %.pre164 = sext i32 %43 to i64
  br label %._crit_edge129

.lr.ph109:                                        ; preds = %._crit_edge106, %.lr.ph109
  %indvars.iv143 = phi i64 [ %indvars.iv.next144, %.lr.ph109 ], [ 0, %._crit_edge106 ]
  %44 = getelementptr inbounds [301 x [301 x i32]], ptr @dis, i64 0, i64 %indvars.iv143
  store ptr %44, ptr @Dis, align 8, !tbaa !13
  %45 = getelementptr inbounds [301 x [301 x i32]], ptr @pre, i64 0, i64 %indvars.iv143
  store ptr %45, ptr @Pre, align 8, !tbaa !13
  %46 = trunc nuw nsw i64 %indvars.iv143 to i32
  call void @_Z3dfsii(i32 noundef %46, i32 noundef -1)
  %indvars.iv.next144 = add nuw nsw i64 %indvars.iv143, 1
  %47 = load i32, ptr @n, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = icmp slt i64 %indvars.iv.next144, %48
  br i1 %49, label %.lr.ph109, label %._crit_edge110, !llvm.loop !15

._crit_edge129:                                   ; preds = %.loopexit, %._crit_edge110.._crit_edge129_crit_edge
  %.pre-phi165 = phi i64 [ %.pre164, %._crit_edge110.._crit_edge129_crit_edge ], [ %151, %.loopexit ]
  %50 = getelementptr inbounds [301 x i8], ptr @buf, i64 0, i64 %.pre-phi165
  store i8 0, ptr %50, align 1, !tbaa !12
  %51 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @buf)
  %52 = load i32, ptr @t, align 4, !tbaa !5
  %53 = add nsw i32 %52, -1
  store i32 %53, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %52, 0
  br i1 %.not, label %._crit_edge134, label %.lr.ph133, !llvm.loop !16

.lr.ph128:                                        ; preds = %._crit_edge110, %.loopexit
  %indvars.iv146 = phi i64 [ %indvars.iv.next147, %.loopexit ], [ 1, %._crit_edge110 ]
  %54 = phi i32 [ %150, %.loopexit ], [ %47, %._crit_edge110 ]
  %55 = getelementptr inbounds [301 x i8], ptr @buf, i64 0, i64 %indvars.iv146
  store i8 48, ptr %55, align 1, !tbaa !12
  %56 = getelementptr inbounds [301 x i32], ptr @p, i64 0, i64 %indvars.iv146
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [301 x i8], ptr @buf, i64 0, i64 %58
  %60 = load i8, ptr %59, align 1, !tbaa !12
  %61 = icmp eq i8 %60, 48
  br i1 %61, label %.loopexit, label %62

62:                                               ; preds = %.lr.ph128
  %63 = getelementptr inbounds [301 x [301 x i32]], ptr @vis, i64 0, i64 %indvars.iv146
  %64 = getelementptr inbounds [301 x [301 x i32]], ptr @vis, i64 0, i64 %58
  %65 = sext i32 %54 to i64
  %66 = shl nsw i64 %65, 2
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 %63, ptr nonnull align 4 %64, i64 %66, i1 false)
  %67 = icmp slt i64 %indvars.iv146, %65
  br i1 %67, label %.lr.ph113.preheader, label %.preheader94

.lr.ph113.preheader:                              ; preds = %62
  %68 = trunc nuw nsw i64 %indvars.iv146 to i32
  br label %.lr.ph113

.lr.ph113:                                        ; preds = %.lr.ph113.preheader, %75
  %indvars.iv148 = phi i64 [ %indvars.iv146, %.lr.ph113.preheader ], [ %indvars.iv.next149, %75 ]
  %69 = load i32, ptr %56, align 4, !tbaa !5
  %70 = trunc nuw nsw i64 %indvars.iv148 to i32
  %71 = call noundef zeroext i1 @_Z7on_pathiii(i32 noundef %69, i32 noundef %68, i32 noundef %70)
  br i1 %71, label %72, label %75

72:                                               ; preds = %.lr.ph113
  %73 = getelementptr inbounds [301 x [301 x i32]], ptr @vis, i64 0, i64 %indvars.iv146, i64 %indvars.iv148
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %.not88 = icmp eq i32 %74, 0
  br i1 %.not88, label %.loopexit.sink.split.sink.split, label %75

75:                                               ; preds = %.lr.ph113, %72
  %indvars.iv.next149 = add nuw nsw i64 %indvars.iv148, 1
  %76 = load i32, ptr @n, align 4, !tbaa !5
  %77 = trunc nuw i64 %indvars.iv.next149 to i32
  %78 = icmp sgt i32 %76, %77
  br i1 %78, label %.lr.ph113, label %._crit_edge114, !llvm.loop !17

._crit_edge114:                                   ; preds = %75
  %.pr.pre = load i8, ptr %55, align 1, !tbaa !12
  %79 = icmp eq i8 %.pr.pre, 49
  br i1 %79, label %.loopexit, label %.preheader94

.preheader94:                                     ; preds = %62, %._crit_edge114
  %80 = phi i32 [ %76, %._crit_edge114 ], [ %54, %62 ]
  %81 = icmp sgt i32 %80, 0
  br i1 %81, label %.lr.ph117.preheader, label %.loopexit

.lr.ph117.preheader:                              ; preds = %.preheader94
  %82 = trunc nuw nsw i64 %indvars.iv146 to i32
  br label %.lr.ph117

.lr.ph117:                                        ; preds = %.lr.ph117.preheader, %96
  %indvars.iv151 = phi i64 [ 0, %.lr.ph117.preheader ], [ %indvars.iv.next152, %96 ]
  %.080115 = phi i32 [ -1, %.lr.ph117.preheader ], [ %.181, %96 ]
  %83 = load i32, ptr %56, align 4, !tbaa !5
  %84 = trunc nuw nsw i64 %indvars.iv151 to i32
  %85 = call noundef zeroext i1 @_Z7on_pathiii(i32 noundef %82, i32 noundef %83, i32 noundef %84)
  br i1 %85, label %86, label %96

86:                                               ; preds = %.lr.ph117
  %87 = getelementptr inbounds [301 x [301 x i32]], ptr @vis, i64 0, i64 %indvars.iv146, i64 %indvars.iv151
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %.not89 = icmp eq i32 %88, 0
  br i1 %.not89, label %89, label %96

89:                                               ; preds = %86
  %90 = icmp eq i32 %.080115, -1
  %91 = load i32, ptr %56, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [301 x [301 x i32]], ptr @pre, i64 0, i64 %indvars.iv151, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  br i1 %90, label %96, label %95

95:                                               ; preds = %89
  %.not90 = icmp eq i32 %.080115, %94
  br i1 %.not90, label %96, label %.loopexit.sink.split

96:                                               ; preds = %89, %.lr.ph117, %86, %95
  %.181 = phi i32 [ %.080115, %86 ], [ %.080115, %95 ], [ %.080115, %.lr.ph117 ], [ %94, %89 ]
  %indvars.iv.next152 = add nuw nsw i64 %indvars.iv151, 1
  %97 = load i32, ptr @n, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = icmp slt i64 %indvars.iv.next152, %98
  br i1 %99, label %.lr.ph117, label %.loopexit95, !llvm.loop !18

.loopexit95:                                      ; preds = %96
  %.pre162 = load i8, ptr %55, align 1, !tbaa !12
  %100 = icmp ne i8 %.pre162, 49
  %101 = icmp ne i32 %.181, -1
  %or.cond.not186 = select i1 %100, i1 %101, i1 false
  %102 = load i32, ptr @n, align 4
  %103 = icmp sgt i32 %102, 0
  %or.cond183 = select i1 %or.cond.not186, i1 %103, i1 false
  br i1 %or.cond183, label %.lr.ph120, label %.loopexit

._crit_edge121:                                   ; preds = %123
  %104 = icmp eq i32 %.1, -1
  br i1 %104, label %.loopexit, label %127

.lr.ph120:                                        ; preds = %.loopexit95, %123
  %indvars.iv154 = phi i64 [ %indvars.iv.next155, %123 ], [ 0, %.loopexit95 ]
  %.078118 = phi i32 [ %.1, %123 ], [ -1, %.loopexit95 ]
  %105 = load i32, ptr %56, align 4, !tbaa !5
  %106 = trunc nuw nsw i64 %indvars.iv154 to i32
  %107 = call noundef zeroext i1 @_Z7on_pathiii(i32 noundef %105, i32 noundef %.181, i32 noundef %106)
  br i1 %107, label %108, label %123

108:                                              ; preds = %.lr.ph120
  %109 = getelementptr inbounds [301 x %"class.std::vector"], ptr @e, i64 0, i64 %indvars.iv154
  %110 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %109) #8
  %111 = icmp ugt i64 %110, 2
  br i1 %111, label %112, label %123

112:                                              ; preds = %108
  %113 = icmp eq i32 %.078118, -1
  br i1 %113, label %123, label %114

114:                                              ; preds = %112
  %115 = load i32, ptr %56, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [301 x [301 x i32]], ptr @dis, i64 0, i64 %116, i64 %indvars.iv154
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = sext i32 %.078118 to i64
  %120 = getelementptr inbounds [301 x [301 x i32]], ptr @dis, i64 0, i64 %116, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %122 = icmp slt i32 %118, %121
  %spec.select = select i1 %122, i32 %106, i32 %.078118
  br label %123

123:                                              ; preds = %114, %112, %.lr.ph120, %108
  %.1 = phi i32 [ %.078118, %108 ], [ %.078118, %.lr.ph120 ], [ %106, %112 ], [ %spec.select, %114 ]
  %indvars.iv.next155 = add nuw nsw i64 %indvars.iv154, 1
  %124 = load i32, ptr @n, align 4
  %125 = sext i32 %124 to i64
  %126 = icmp slt i64 %indvars.iv.next155, %125
  br i1 %126, label %.lr.ph120, label %._crit_edge121, !llvm.loop !19

127:                                              ; preds = %._crit_edge121
  %128 = load i32, ptr @ctr, align 4, !tbaa !5
  %129 = load i32, ptr %56, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = sext i32 %.1 to i64
  %132 = getelementptr inbounds [301 x [301 x i32]], ptr @dis, i64 0, i64 %130, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = add nsw i32 %133, 2
  %135 = icmp sge i32 %128, %134
  %136 = icmp sgt i32 %124, 0
  %or.cond136 = and i1 %135, %136
  br i1 %or.cond136, label %.lr.ph124, label %.loopexit

.lr.ph124:                                        ; preds = %127, %143
  %indvars.iv157 = phi i64 [ %indvars.iv.next158, %143 ], [ 0, %127 ]
  %137 = load i32, ptr %56, align 4, !tbaa !5
  %138 = trunc nuw nsw i64 %indvars.iv157 to i32
  %139 = call noundef zeroext i1 @_Z7on_pathiii(i32 noundef %137, i32 noundef %.181, i32 noundef %138)
  br i1 %139, label %140, label %143

140:                                              ; preds = %.lr.ph124
  %141 = getelementptr inbounds [301 x [301 x i32]], ptr @vis, i64 0, i64 %indvars.iv146, i64 %indvars.iv157
  %142 = load i32, ptr %141, align 4, !tbaa !5
  %.not91 = icmp eq i32 %142, 0
  br i1 %.not91, label %.loopexit.sink.split.sink.split, label %143

143:                                              ; preds = %.lr.ph124, %140
  %indvars.iv.next158 = add nuw nsw i64 %indvars.iv157, 1
  %144 = load i32, ptr @n, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = icmp slt i64 %indvars.iv.next158, %145
  br i1 %146, label %.lr.ph124, label %.loopexit, !llvm.loop !20

.loopexit.sink.split.sink.split:                  ; preds = %72, %140
  %.lcssa177.sink.ph = phi ptr [ %141, %140 ], [ %73, %72 ]
  %147 = load i32, ptr %56, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  br label %.loopexit.sink.split

.loopexit.sink.split:                             ; preds = %95, %.loopexit.sink.split.sink.split
  %.lcssa178.sink = phi i64 [ %148, %.loopexit.sink.split.sink.split ], [ %92, %95 ]
  %.lcssa177.sink = phi ptr [ %.lcssa177.sink.ph, %.loopexit.sink.split.sink.split ], [ %87, %95 ]
  %149 = getelementptr inbounds [301 x [301 x i32]], ptr @vis, i64 0, i64 %indvars.iv146, i64 %.lcssa178.sink
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %149, ptr noundef nonnull align 4 dereferenceable(4) %.lcssa177.sink) #8
  store i8 49, ptr %55, align 1, !tbaa !12
  br label %.loopexit

.loopexit:                                        ; preds = %143, %.loopexit.sink.split, %.preheader94, %.loopexit95, %._crit_edge121, %127, %._crit_edge114, %.lr.ph128
  %indvars.iv.next147 = add nuw nsw i64 %indvars.iv146, 1
  %150 = load i32, ptr @n, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = icmp slt i64 %indvars.iv.next147, %151
  br i1 %152, label %.lr.ph128, label %._crit_edge129, !llvm.loop !21

._crit_edge134:                                   ; preds = %._crit_edge129, %0
  ret i32 0
}

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

; 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: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

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

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

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

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

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


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