; LLVM IR from upupming/algorithm :: AdvancedLevel_C++/1111. Online Map (30)  (main)

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

@dis = external dso_local global [510 x i32], align 16
@Time = external dso_local global [510 x i32], align 16
@e = external dso_local global [510 x [510 x i32]], align 16
@w = external dso_local global [510 x [510 x i32]], align 16
@dispre = external dso_local global [510 x i32], align 16
@Timepre = external dso_local global [510 x i32], align 16
@weight = external dso_local global [510 x i32], align 16
@NodeNum = external dso_local global [510 x i32], align 16
@visit = external dso_local global [510 x i8], align 16
@dispath = external dso_local global %"class.std::vector", align 8
@Timepath = external dso_local global %"class.std::vector", align 8
@st = external dso_local global i32, align 4
@fin = external dso_local global i32, align 4
@_ZL3inf = external hidden constant i32, align 4
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [13 x i8], align 1

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 {
  %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 i8, align 1
  %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 i32, align 4
  %24 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef @dis, ptr noundef getelementptr inbounds (i32, ptr @dis, i64 510), ptr noundef nonnull align 4 dereferenceable(4) @_ZL3inf)
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef @Time, ptr noundef getelementptr inbounds (i32, ptr @Time, i64 510), ptr noundef nonnull align 4 dereferenceable(4) @_ZL3inf)
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef @weight, ptr noundef getelementptr inbounds (i32, ptr @weight, i64 510), ptr noundef nonnull align 4 dereferenceable(4) @_ZL3inf)
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef @e, ptr noundef getelementptr inbounds (i32, ptr @e, i64 260100), ptr noundef nonnull align 4 dereferenceable(4) @_ZL3inf)
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef @w, ptr noundef getelementptr inbounds (i32, ptr @w, i64 260100), ptr noundef nonnull align 4 dereferenceable(4) @_ZL3inf)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %65, %0
  %27 = load i32, ptr %9, align 4, !tbaa !5
  %28 = load i32, ptr %3, align 4, !tbaa !5
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %31, label %30

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

31:                                               ; preds = %26
  %32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.4, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8)
  %33 = load i32, ptr %7, align 4, !tbaa !5
  %34 = load i32, ptr %4, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [510 x [510 x i32]], ptr @e, i64 0, i64 %35
  %37 = load i32, ptr %5, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [510 x i32], ptr %36, i64 0, i64 %38
  store i32 %33, ptr %39, align 4, !tbaa !5
  %40 = load i32, ptr %8, align 4, !tbaa !5
  %41 = load i32, ptr %4, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [510 x [510 x i32]], ptr @w, i64 0, i64 %42
  %44 = load i32, ptr %5, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [510 x i32], ptr %43, i64 0, i64 %45
  store i32 %40, ptr %46, align 4, !tbaa !5
  %47 = load i32, ptr %6, align 4, !tbaa !5
  %48 = icmp ne i32 %47, 1
  br i1 %48, label %49, label %64

49:                                               ; preds = %31
  %50 = load i32, ptr %7, align 4, !tbaa !5
  %51 = load i32, ptr %5, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [510 x [510 x i32]], ptr @e, i64 0, i64 %52
  %54 = load i32, ptr %4, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [510 x i32], ptr %53, i64 0, i64 %55
  store i32 %50, ptr %56, align 4, !tbaa !5
  %57 = load i32, ptr %8, align 4, !tbaa !5
  %58 = load i32, ptr %5, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [510 x [510 x i32]], ptr @w, i64 0, i64 %59
  %61 = load i32, ptr %4, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [510 x i32], ptr %60, i64 0, i64 %62
  store i32 %57, ptr %63, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %49, %31
  br label %65

65:                                               ; preds = %64
  %66 = load i32, ptr %9, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %9, align 4, !tbaa !5
  br label %26, !llvm.loop !9

68:                                               ; preds = %30
  %69 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @st, ptr noundef @fin)
  %70 = load i32, ptr @st, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [510 x i32], ptr @dis, i64 0, i64 %71
  store i32 0, ptr %72, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %83, %68
  %74 = load i32, ptr %10, align 4, !tbaa !5
  %75 = load i32, ptr %2, align 4, !tbaa !5
  %76 = icmp slt i32 %74, %75
  br i1 %76, label %78, label %77

77:                                               ; preds = %73
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %86

78:                                               ; preds = %73
  %79 = load i32, ptr %10, align 4, !tbaa !5
  %80 = load i32, ptr %10, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [510 x i32], ptr @dispre, i64 0, i64 %81
  store i32 %79, ptr %82, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %78
  %84 = load i32, ptr %10, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %10, align 4, !tbaa !5
  br label %73, !llvm.loop !11

86:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %272, %86
  %88 = load i32, ptr %11, align 4, !tbaa !5
  %89 = load i32, ptr %2, align 4, !tbaa !5
  %90 = icmp slt i32 %88, %89
  br i1 %90, label %92, label %91

91:                                               ; preds = %87
  store i32 8, ptr %12, align 4
  br label %275

92:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 -1, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 999999999, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %93

93:                                               ; preds = %120, %92
  %94 = load i32, ptr %15, align 4, !tbaa !5
  %95 = load i32, ptr %2, align 4, !tbaa !5
  %96 = icmp slt i32 %94, %95
  br i1 %96, label %98, label %97

97:                                               ; preds = %93
  store i32 11, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %123

98:                                               ; preds = %93
  %99 = load i32, ptr %15, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [510 x i8], ptr @visit, i64 0, i64 %100
  %102 = load i8, ptr %101, align 1, !tbaa !12, !range !14, !noundef !15
  %103 = trunc i8 %102 to i1
  %104 = zext i1 %103 to i32
  %105 = icmp eq i32 %104, 0
  br i1 %105, label %106, label %119

106:                                              ; preds = %98
  %107 = load i32, ptr %15, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [510 x i32], ptr @dis, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = load i32, ptr %14, align 4, !tbaa !5
  %112 = icmp slt i32 %110, %111
  br i1 %112, label %113, label %119

113:                                              ; preds = %106
  %114 = load i32, ptr %15, align 4, !tbaa !5
  store i32 %114, ptr %13, align 4, !tbaa !5
  %115 = load i32, ptr %15, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [510 x i32], ptr @dis, i64 0, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !5
  store i32 %118, ptr %14, align 4, !tbaa !5
  br label %119

119:                                              ; preds = %113, %106, %98
  br label %120

120:                                              ; preds = %119
  %121 = load i32, ptr %15, align 4, !tbaa !5
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %15, align 4, !tbaa !5
  br label %93, !llvm.loop !16

123:                                              ; preds = %97
  %124 = load i32, ptr %13, align 4, !tbaa !5
  %125 = icmp eq i32 %124, -1
  br i1 %125, label %126, label %127

126:                                              ; preds = %123
  store i32 8, ptr %12, align 4
  br label %269

127:                                              ; preds = %123
  %128 = load i32, ptr %13, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [510 x i8], ptr @visit, i64 0, i64 %129
  store i8 1, ptr %130, align 1, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %131

131:                                              ; preds = %265, %127
  %132 = load i32, ptr %16, align 4, !tbaa !5
  %133 = load i32, ptr %2, align 4, !tbaa !5
  %134 = icmp slt i32 %132, %133
  br i1 %134, label %136, label %135

135:                                              ; preds = %131
  store i32 14, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %268

136:                                              ; preds = %131
  %137 = load i32, ptr %16, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [510 x i8], ptr @visit, i64 0, i64 %138
  %140 = load i8, ptr %139, align 1, !tbaa !12, !range !14, !noundef !15
  %141 = trunc i8 %140 to i1
  %142 = zext i1 %141 to i32
  %143 = icmp eq i32 %142, 0
  br i1 %143, label %144, label %264

144:                                              ; preds = %136
  %145 = load i32, ptr %13, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [510 x [510 x i32]], ptr @e, i64 0, i64 %146
  %148 = load i32, ptr %16, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [510 x i32], ptr %147, i64 0, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !5
  %152 = icmp ne i32 %151, 999999999
  br i1 %152, label %153, label %264

153:                                              ; preds = %144
  %154 = load i32, ptr %13, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [510 x [510 x i32]], ptr @e, i64 0, i64 %155
  %157 = load i32, ptr %16, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [510 x i32], ptr %156, i64 0, i64 %158
  %160 = load i32, ptr %159, align 4, !tbaa !5
  %161 = load i32, ptr %13, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [510 x i32], ptr @dis, i64 0, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = add nsw i32 %160, %164
  %166 = load i32, ptr %16, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [510 x i32], ptr @dis, i64 0, i64 %167
  %169 = load i32, ptr %168, align 4, !tbaa !5
  %170 = icmp slt i32 %165, %169
  br i1 %170, label %171, label %206

171:                                              ; preds = %153
  %172 = load i32, ptr %13, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [510 x [510 x i32]], ptr @e, i64 0, i64 %173
  %175 = load i32, ptr %16, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [510 x i32], ptr %174, i64 0, i64 %176
  %178 = load i32, ptr %177, align 4, !tbaa !5
  %179 = load i32, ptr %13, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [510 x i32], ptr @dis, i64 0, i64 %180
  %182 = load i32, ptr %181, align 4, !tbaa !5
  %183 = add nsw i32 %178, %182
  %184 = load i32, ptr %16, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [510 x i32], ptr @dis, i64 0, i64 %185
  store i32 %183, ptr %186, align 4, !tbaa !5
  %187 = load i32, ptr %13, align 4, !tbaa !5
  %188 = load i32, ptr %16, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [510 x i32], ptr @dispre, i64 0, i64 %189
  store i32 %187, ptr %190, align 4, !tbaa !5
  %191 = load i32, ptr %13, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [510 x i32], ptr @weight, i64 0, i64 %192
  %194 = load i32, ptr %193, align 4, !tbaa !5
  %195 = load i32, ptr %13, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [510 x [510 x i32]], ptr @w, i64 0, i64 %196
  %198 = load i32, ptr %16, align 4, !tbaa !5
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [510 x i32], ptr %197, i64 0, i64 %199
  %201 = load i32, ptr %200, align 4, !tbaa !5
  %202 = add nsw i32 %194, %201
  %203 = load i32, ptr %16, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [510 x i32], ptr @weight, i64 0, i64 %204
  store i32 %202, ptr %205, align 4, !tbaa !5
  br label %263

206:                                              ; preds = %153
  %207 = load i32, ptr %13, align 4, !tbaa !5
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [510 x [510 x i32]], ptr @e, i64 0, i64 %208
  %210 = load i32, ptr %16, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [510 x i32], ptr %209, i64 0, i64 %211
  %213 = load i32, ptr %212, align 4, !tbaa !5
  %214 = load i32, ptr %13, align 4, !tbaa !5
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds [510 x i32], ptr @dis, i64 0, i64 %215
  %217 = load i32, ptr %216, align 4, !tbaa !5
  %218 = add nsw i32 %213, %217
  %219 = load i32, ptr %16, align 4, !tbaa !5
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds [510 x i32], ptr @dis, i64 0, i64 %220
  %222 = load i32, ptr %221, align 4, !tbaa !5
  %223 = icmp eq i32 %218, %222
  br i1 %223, label %224, label %262

224:                                              ; preds = %206
  %225 = load i32, ptr %16, align 4, !tbaa !5
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds [510 x i32], ptr @weight, i64 0, i64 %226
  %228 = load i32, ptr %227, align 4, !tbaa !5
  %229 = load i32, ptr %13, align 4, !tbaa !5
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [510 x i32], ptr @weight, i64 0, i64 %230
  %232 = load i32, ptr %231, align 4, !tbaa !5
  %233 = load i32, ptr %13, align 4, !tbaa !5
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [510 x [510 x i32]], ptr @w, i64 0, i64 %234
  %236 = load i32, ptr %16, align 4, !tbaa !5
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [510 x i32], ptr %235, i64 0, i64 %237
  %239 = load i32, ptr %238, align 4, !tbaa !5
  %240 = add nsw i32 %232, %239
  %241 = icmp sgt i32 %228, %240
  br i1 %241, label %242, label %262

242:                                              ; preds = %224
  %243 = load i32, ptr %13, align 4, !tbaa !5
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds [510 x i32], ptr @weight, i64 0, i64 %244
  %246 = load i32, ptr %245, align 4, !tbaa !5
  %247 = load i32, ptr %13, align 4, !tbaa !5
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds [510 x [510 x i32]], ptr @w, i64 0, i64 %248
  %250 = load i32, ptr %16, align 4, !tbaa !5
  %251 = sext i32 %250 to i64
  %252 = getelementptr inbounds [510 x i32], ptr %249, i64 0, i64 %251
  %253 = load i32, ptr %252, align 4, !tbaa !5
  %254 = add nsw i32 %246, %253
  %255 = load i32, ptr %16, align 4, !tbaa !5
  %256 = sext i32 %255 to i64
  %257 = getelementptr inbounds [510 x i32], ptr @weight, i64 0, i64 %256
  store i32 %254, ptr %257, align 4, !tbaa !5
  %258 = load i32, ptr %13, align 4, !tbaa !5
  %259 = load i32, ptr %16, align 4, !tbaa !5
  %260 = sext i32 %259 to i64
  %261 = getelementptr inbounds [510 x i32], ptr @dispre, i64 0, i64 %260
  store i32 %258, ptr %261, align 4, !tbaa !5
  br label %262

262:                                              ; preds = %242, %224, %206
  br label %263

263:                                              ; preds = %262, %171
  br label %264

264:                                              ; preds = %263, %144, %136
  br label %265

265:                                              ; preds = %264
  %266 = load i32, ptr %16, align 4, !tbaa !5
  %267 = add nsw i32 %266, 1
  store i32 %267, ptr %16, align 4, !tbaa !5
  br label %131, !llvm.loop !17

268:                                              ; preds = %135
  store i32 0, ptr %12, align 4
  br label %269

269:                                              ; preds = %268, %126
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  %270 = load i32, ptr %12, align 4
  switch i32 %270, label %275 [
    i32 0, label %271
  ]

271:                                              ; preds = %269
  br label %272

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

275:                                              ; preds = %269, %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %276

276:                                              ; preds = %275
  %277 = load i32, ptr @fin, align 4, !tbaa !5
  call void @_Z10dfsdispathi(i32 noundef %277)
  %278 = load i32, ptr @st, align 4, !tbaa !5
  %279 = sext i32 %278 to i64
  %280 = getelementptr inbounds [510 x i32], ptr @Time, i64 0, i64 %279
  store i32 0, ptr %280, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #6
  store i8 0, ptr %17, align 1, !tbaa !12
  call void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef @visit, ptr noundef getelementptr inbounds (i8, ptr @visit, i64 510), ptr noundef nonnull align 1 dereferenceable(1) %17)
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %281

281:                                              ; preds = %445, %276
  %282 = load i32, ptr %18, align 4, !tbaa !5
  %283 = load i32, ptr %2, align 4, !tbaa !5
  %284 = icmp slt i32 %282, %283
  br i1 %284, label %286, label %285

285:                                              ; preds = %281
  store i32 17, ptr %12, align 4
  br label %448

286:                                              ; preds = %281
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 -1, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  store i32 999999999, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %287

287:                                              ; preds = %314, %286
  %288 = load i32, ptr %21, align 4, !tbaa !5
  %289 = load i32, ptr %2, align 4, !tbaa !5
  %290 = icmp slt i32 %288, %289
  br i1 %290, label %292, label %291

291:                                              ; preds = %287
  store i32 20, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %317

292:                                              ; preds = %287
  %293 = load i32, ptr %21, align 4, !tbaa !5
  %294 = sext i32 %293 to i64
  %295 = getelementptr inbounds [510 x i8], ptr @visit, i64 0, i64 %294
  %296 = load i8, ptr %295, align 1, !tbaa !12, !range !14, !noundef !15
  %297 = trunc i8 %296 to i1
  %298 = zext i1 %297 to i32
  %299 = icmp eq i32 %298, 0
  br i1 %299, label %300, label %313

300:                                              ; preds = %292
  %301 = load i32, ptr %20, align 4, !tbaa !5
  %302 = load i32, ptr %21, align 4, !tbaa !5
  %303 = sext i32 %302 to i64
  %304 = getelementptr inbounds [510 x i32], ptr @Time, i64 0, i64 %303
  %305 = load i32, ptr %304, align 4, !tbaa !5
  %306 = icmp sgt i32 %301, %305
  br i1 %306, label %307, label %313

307:                                              ; preds = %300
  %308 = load i32, ptr %21, align 4, !tbaa !5
  store i32 %308, ptr %19, align 4, !tbaa !5
  %309 = load i32, ptr %21, align 4, !tbaa !5
  %310 = sext i32 %309 to i64
  %311 = getelementptr inbounds [510 x i32], ptr @Time, i64 0, i64 %310
  %312 = load i32, ptr %311, align 4, !tbaa !5
  store i32 %312, ptr %20, align 4, !tbaa !5
  br label %313

313:                                              ; preds = %307, %300, %292
  br label %314

314:                                              ; preds = %313
  %315 = load i32, ptr %21, align 4, !tbaa !5
  %316 = add nsw i32 %315, 1
  store i32 %316, ptr %21, align 4, !tbaa !5
  br label %287, !llvm.loop !19

317:                                              ; preds = %291
  %318 = load i32, ptr %19, align 4, !tbaa !5
  %319 = icmp eq i32 %318, -1
  br i1 %319, label %320, label %321

320:                                              ; preds = %317
  store i32 17, ptr %12, align 4
  br label %442

321:                                              ; preds = %317
  %322 = load i32, ptr %19, align 4, !tbaa !5
  %323 = sext i32 %322 to i64
  %324 = getelementptr inbounds [510 x i8], ptr @visit, i64 0, i64 %323
  store i8 1, ptr %324, align 1, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  store i32 0, ptr %22, align 4, !tbaa !5
  br label %325

325:                                              ; preds = %438, %321
  %326 = load i32, ptr %22, align 4, !tbaa !5
  %327 = load i32, ptr %2, align 4, !tbaa !5
  %328 = icmp slt i32 %326, %327
  br i1 %328, label %330, label %329

329:                                              ; preds = %325
  store i32 23, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  br label %441

330:                                              ; preds = %325
  %331 = load i32, ptr %22, align 4, !tbaa !5
  %332 = sext i32 %331 to i64
  %333 = getelementptr inbounds [510 x i8], ptr @visit, i64 0, i64 %332
  %334 = load i8, ptr %333, align 1, !tbaa !12, !range !14, !noundef !15
  %335 = trunc i8 %334 to i1
  %336 = zext i1 %335 to i32
  %337 = icmp eq i32 %336, 0
  br i1 %337, label %338, label %437

338:                                              ; preds = %330
  %339 = load i32, ptr %19, align 4, !tbaa !5
  %340 = sext i32 %339 to i64
  %341 = getelementptr inbounds [510 x [510 x i32]], ptr @w, i64 0, i64 %340
  %342 = load i32, ptr %22, align 4, !tbaa !5
  %343 = sext i32 %342 to i64
  %344 = getelementptr inbounds [510 x i32], ptr %341, i64 0, i64 %343
  %345 = load i32, ptr %344, align 4, !tbaa !5
  %346 = icmp ne i32 %345, 999999999
  br i1 %346, label %347, label %437

347:                                              ; preds = %338
  %348 = load i32, ptr %19, align 4, !tbaa !5
  %349 = sext i32 %348 to i64
  %350 = getelementptr inbounds [510 x [510 x i32]], ptr @w, i64 0, i64 %349
  %351 = load i32, ptr %22, align 4, !tbaa !5
  %352 = sext i32 %351 to i64
  %353 = getelementptr inbounds [510 x i32], ptr %350, i64 0, i64 %352
  %354 = load i32, ptr %353, align 4, !tbaa !5
  %355 = load i32, ptr %19, align 4, !tbaa !5
  %356 = sext i32 %355 to i64
  %357 = getelementptr inbounds [510 x i32], ptr @Time, i64 0, i64 %356
  %358 = load i32, ptr %357, align 4, !tbaa !5
  %359 = add nsw i32 %354, %358
  %360 = load i32, ptr %22, align 4, !tbaa !5
  %361 = sext i32 %360 to i64
  %362 = getelementptr inbounds [510 x i32], ptr @Time, i64 0, i64 %361
  %363 = load i32, ptr %362, align 4, !tbaa !5
  %364 = icmp slt i32 %359, %363
  br i1 %364, label %365, label %393

365:                                              ; preds = %347
  %366 = load i32, ptr %19, align 4, !tbaa !5
  %367 = sext i32 %366 to i64
  %368 = getelementptr inbounds [510 x [510 x i32]], ptr @w, i64 0, i64 %367
  %369 = load i32, ptr %22, align 4, !tbaa !5
  %370 = sext i32 %369 to i64
  %371 = getelementptr inbounds [510 x i32], ptr %368, i64 0, i64 %370
  %372 = load i32, ptr %371, align 4, !tbaa !5
  %373 = load i32, ptr %19, align 4, !tbaa !5
  %374 = sext i32 %373 to i64
  %375 = getelementptr inbounds [510 x i32], ptr @Time, i64 0, i64 %374
  %376 = load i32, ptr %375, align 4, !tbaa !5
  %377 = add nsw i32 %372, %376
  %378 = load i32, ptr %22, align 4, !tbaa !5
  %379 = sext i32 %378 to i64
  %380 = getelementptr inbounds [510 x i32], ptr @Time, i64 0, i64 %379
  store i32 %377, ptr %380, align 4, !tbaa !5
  %381 = load i32, ptr %19, align 4, !tbaa !5
  %382 = load i32, ptr %22, align 4, !tbaa !5
  %383 = sext i32 %382 to i64
  %384 = getelementptr inbounds [510 x i32], ptr @Timepre, i64 0, i64 %383
  store i32 %381, ptr %384, align 4, !tbaa !5
  %385 = load i32, ptr %19, align 4, !tbaa !5
  %386 = sext i32 %385 to i64
  %387 = getelementptr inbounds [510 x i32], ptr @NodeNum, i64 0, i64 %386
  %388 = load i32, ptr %387, align 4, !tbaa !5
  %389 = add nsw i32 %388, 1
  %390 = load i32, ptr %22, align 4, !tbaa !5
  %391 = sext i32 %390 to i64
  %392 = getelementptr inbounds [510 x i32], ptr @NodeNum, i64 0, i64 %391
  store i32 %389, ptr %392, align 4, !tbaa !5
  br label %436

393:                                              ; preds = %347
  %394 = load i32, ptr %19, align 4, !tbaa !5
  %395 = sext i32 %394 to i64
  %396 = getelementptr inbounds [510 x [510 x i32]], ptr @w, i64 0, i64 %395
  %397 = load i32, ptr %22, align 4, !tbaa !5
  %398 = sext i32 %397 to i64
  %399 = getelementptr inbounds [510 x i32], ptr %396, i64 0, i64 %398
  %400 = load i32, ptr %399, align 4, !tbaa !5
  %401 = load i32, ptr %19, align 4, !tbaa !5
  %402 = sext i32 %401 to i64
  %403 = getelementptr inbounds [510 x i32], ptr @Time, i64 0, i64 %402
  %404 = load i32, ptr %403, align 4, !tbaa !5
  %405 = add nsw i32 %400, %404
  %406 = load i32, ptr %22, align 4, !tbaa !5
  %407 = sext i32 %406 to i64
  %408 = getelementptr inbounds [510 x i32], ptr @Time, i64 0, i64 %407
  %409 = load i32, ptr %408, align 4, !tbaa !5
  %410 = icmp eq i32 %405, %409
  br i1 %410, label %411, label %435

411:                                              ; preds = %393
  %412 = load i32, ptr %19, align 4, !tbaa !5
  %413 = sext i32 %412 to i64
  %414 = getelementptr inbounds [510 x i32], ptr @NodeNum, i64 0, i64 %413
  %415 = load i32, ptr %414, align 4, !tbaa !5
  %416 = add nsw i32 %415, 1
  %417 = load i32, ptr %22, align 4, !tbaa !5
  %418 = sext i32 %417 to i64
  %419 = getelementptr inbounds [510 x i32], ptr @NodeNum, i64 0, i64 %418
  %420 = load i32, ptr %419, align 4, !tbaa !5
  %421 = icmp slt i32 %416, %420
  br i1 %421, label %422, label %435

422:                                              ; preds = %411
  %423 = load i32, ptr %19, align 4, !tbaa !5
  %424 = load i32, ptr %22, align 4, !tbaa !5
  %425 = sext i32 %424 to i64
  %426 = getelementptr inbounds [510 x i32], ptr @Timepre, i64 0, i64 %425
  store i32 %423, ptr %426, align 4, !tbaa !5
  %427 = load i32, ptr %19, align 4, !tbaa !5
  %428 = sext i32 %427 to i64
  %429 = getelementptr inbounds [510 x i32], ptr @NodeNum, i64 0, i64 %428
  %430 = load i32, ptr %429, align 4, !tbaa !5
  %431 = add nsw i32 %430, 1
  %432 = load i32, ptr %22, align 4, !tbaa !5
  %433 = sext i32 %432 to i64
  %434 = getelementptr inbounds [510 x i32], ptr @NodeNum, i64 0, i64 %433
  store i32 %431, ptr %434, align 4, !tbaa !5
  br label %435

435:                                              ; preds = %422, %411, %393
  br label %436

436:                                              ; preds = %435, %365
  br label %437

437:                                              ; preds = %436, %338, %330
  br label %438

438:                                              ; preds = %437
  %439 = load i32, ptr %22, align 4, !tbaa !5
  %440 = add nsw i32 %439, 1
  store i32 %440, ptr %22, align 4, !tbaa !5
  br label %325, !llvm.loop !20

441:                                              ; preds = %329
  store i32 0, ptr %12, align 4
  br label %442

442:                                              ; preds = %441, %320
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  %443 = load i32, ptr %12, align 4
  switch i32 %443, label %448 [
    i32 0, label %444
  ]

444:                                              ; preds = %442
  br label %445

445:                                              ; preds = %444
  %446 = load i32, ptr %18, align 4, !tbaa !5
  %447 = add nsw i32 %446, 1
  store i32 %447, ptr %18, align 4, !tbaa !5
  br label %281, !llvm.loop !21

448:                                              ; preds = %442, %285
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %449

449:                                              ; preds = %448
  %450 = load i32, ptr @fin, align 4, !tbaa !5
  call void @_Z11dfsTimepathi(i32 noundef %450)
  %451 = load i32, ptr @fin, align 4, !tbaa !5
  %452 = sext i32 %451 to i64
  %453 = getelementptr inbounds [510 x i32], ptr @dis, i64 0, i64 %452
  %454 = load i32, ptr %453, align 4, !tbaa !5
  %455 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %454)
  %456 = call noundef zeroext i1 @_ZSteqIiSaIiEEbRKSt6vectorIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(24) @dispath, ptr noundef nonnull align 8 dereferenceable(24) @Timepath)
  br i1 %456, label %457, label %463

457:                                              ; preds = %449
  %458 = load i32, ptr @fin, align 4, !tbaa !5
  %459 = sext i32 %458 to i64
  %460 = getelementptr inbounds [510 x i32], ptr @Time, i64 0, i64 %459
  %461 = load i32, ptr %460, align 4, !tbaa !5
  %462 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i32 noundef %461)
  br label %492

463:                                              ; preds = %449
  %464 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %465 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @dispath) #6
  %466 = sub i64 %465, 1
  %467 = trunc i64 %466 to i32
  store i32 %467, ptr %23, align 4, !tbaa !5
  br label %468

468:                                              ; preds = %483, %463
  %469 = load i32, ptr %23, align 4, !tbaa !5
  %470 = icmp sge i32 %469, 0
  br i1 %470, label %472, label %471

471:                                              ; preds = %468
  store i32 26, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  br label %486

472:                                              ; preds = %468
  %473 = load i32, ptr %23, align 4, !tbaa !5
  %474 = sext i32 %473 to i64
  %475 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @dispath, i64 noundef %474) #6
  %476 = load i32, ptr %475, align 4, !tbaa !5
  %477 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %476)
  %478 = load i32, ptr %23, align 4, !tbaa !5
  %479 = icmp ne i32 %478, 0
  br i1 %479, label %480, label %482

480:                                              ; preds = %472
  %481 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  br label %482

482:                                              ; preds = %480, %472
  br label %483

483:                                              ; preds = %482
  %484 = load i32, ptr %23, align 4, !tbaa !5
  %485 = add nsw i32 %484, -1
  store i32 %485, ptr %23, align 4, !tbaa !5
  br label %468, !llvm.loop !22

486:                                              ; preds = %471
  %487 = load i32, ptr @fin, align 4, !tbaa !5
  %488 = sext i32 %487 to i64
  %489 = getelementptr inbounds [510 x i32], ptr @Time, i64 0, i64 %488
  %490 = load i32, ptr %489, align 4, !tbaa !5
  %491 = call i32 (ptr, ...) @printf(ptr noundef @.str.10, i32 noundef %490)
  br label %492

492:                                              ; preds = %486, %457
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  %493 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @Timepath) #6
  %494 = sub i64 %493, 1
  %495 = trunc i64 %494 to i32
  store i32 %495, ptr %24, align 4, !tbaa !5
  br label %496

496:                                              ; preds = %511, %492
  %497 = load i32, ptr %24, align 4, !tbaa !5
  %498 = icmp sge i32 %497, 0
  br i1 %498, label %500, label %499

499:                                              ; preds = %496
  store i32 29, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  br label %514

500:                                              ; preds = %496
  %501 = load i32, ptr %24, align 4, !tbaa !5
  %502 = sext i32 %501 to i64
  %503 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Timepath, i64 noundef %502) #6
  %504 = load i32, ptr %503, align 4, !tbaa !5
  %505 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %504)
  %506 = load i32, ptr %24, align 4, !tbaa !5
  %507 = icmp ne i32 %506, 0
  br i1 %507, label %508, label %510

508:                                              ; preds = %500
  %509 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  br label %510

510:                                              ; preds = %508, %500
  br label %511

511:                                              ; preds = %510
  %512 = load i32, ptr %24, align 4, !tbaa !5
  %513 = add nsw i32 %512, -1
  store i32 %513, ptr %24, align 4, !tbaa !5
  br label %496, !llvm.loop !23

514:                                              ; preds = %499
  store i32 0, ptr %1, align 4
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %515 = load i32, ptr %1, align 4
  ret i32 %515
}

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZSteqIiSaIiEEbRKSt6vectorIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #5 align 2

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

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

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


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

%"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 }

@dis = external dso_local global [510 x i32], align 16
@Time = external dso_local global [510 x i32], align 16
@e = external dso_local global [510 x [510 x i32]], align 16
@w = external dso_local global [510 x [510 x i32]], align 16
@dispre = external dso_local local_unnamed_addr global [510 x i32], align 16
@Timepre = external dso_local local_unnamed_addr global [510 x i32], align 16
@weight = external dso_local global [510 x i32], align 16
@NodeNum = external dso_local local_unnamed_addr global [510 x i32], align 16
@visit = external dso_local global [510 x i8], align 16
@dispath = external dso_local global %"class.std::vector", align 8
@Timepath = external dso_local global %"class.std::vector", align 8
@st = external dso_local global i32, align 4
@fin = external dso_local global i32, align 4
@_ZL3inf = external hidden constant i32, align 4
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [13 x i8], align 1

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %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 i8, align 1
  tail call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull @dis, ptr noundef nonnull getelementptr inbounds (i8, ptr @dis, i64 2040), ptr noundef nonnull align 4 dereferenceable(4) @_ZL3inf)
  tail call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull @Time, ptr noundef nonnull getelementptr inbounds (i8, ptr @Time, i64 2040), ptr noundef nonnull align 4 dereferenceable(4) @_ZL3inf)
  tail call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull @weight, ptr noundef nonnull getelementptr inbounds (i8, ptr @weight, i64 2040), ptr noundef nonnull align 4 dereferenceable(4) @_ZL3inf)
  tail call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull @e, ptr noundef nonnull getelementptr inbounds (i8, ptr @e, i64 1040400), ptr noundef nonnull align 4 dereferenceable(4) @_ZL3inf)
  tail call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull @w, ptr noundef nonnull getelementptr inbounds (i8, ptr @w, i64 1040400), ptr noundef nonnull align 4 dereferenceable(4) @_ZL3inf)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  %10 = load i32, ptr %2, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %34, %0
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @st, ptr noundef nonnull @fin)
  %13 = load i32, ptr @st, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds [510 x i32], ptr @dis, i64 0, i64 %14
  store i32 0, ptr %15, align 4, !tbaa !5
  %16 = load i32, ptr %1, align 4, !tbaa !5
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph145.preheader, label %.critedge

.lr.ph145.preheader:                              ; preds = %._crit_edge
  %wide.trip.count = zext nneg i32 %16 to i64
  %min.iters.check = icmp ult i32 %16, 8
  br i1 %min.iters.check, label %.lr.ph145.preheader223, label %vector.ph

.lr.ph145.preheader223:                           ; preds = %middle.block, %.lr.ph145.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph145.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph145

vector.ph:                                        ; preds = %.lr.ph145.preheader
  %n.vec = and i64 %wide.trip.count, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %18 = getelementptr inbounds [510 x i32], ptr @dispre, i64 0, i64 %index
  %19 = getelementptr inbounds i8, ptr %18, i64 16
  store <4 x i32> %vec.ind, ptr %18, align 16, !tbaa !5
  store <4 x i32> %step.add, ptr %19, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %20 = icmp eq i64 %index.next, %n.vec
  br i1 %20, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.preheader141, label %.lr.ph145.preheader223

.lr.ph:                                           ; preds = %0, %34
  %.0117142 = phi i32 [ %35, %34 ], [ 0, %0 ]
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef nonnull %7)
  %22 = load i32, ptr %6, align 4, !tbaa !5
  %23 = load i32, ptr %3, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = load i32, ptr %4, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [510 x [510 x i32]], ptr @e, i64 0, i64 %24, i64 %26
  store i32 %22, ptr %27, align 4, !tbaa !5
  %28 = load i32, ptr %7, align 4, !tbaa !5
  %29 = getelementptr inbounds [510 x [510 x i32]], ptr @w, i64 0, i64 %24, i64 %26
  store i32 %28, ptr %29, align 4, !tbaa !5
  %30 = load i32, ptr %5, align 4, !tbaa !5
  %.not134 = icmp eq i32 %30, 1
  br i1 %.not134, label %34, label %31

31:                                               ; preds = %.lr.ph
  %32 = getelementptr inbounds [510 x [510 x i32]], ptr @e, i64 0, i64 %26, i64 %24
  store i32 %22, ptr %32, align 4, !tbaa !5
  %33 = getelementptr inbounds [510 x [510 x i32]], ptr @w, i64 0, i64 %26, i64 %24
  store i32 %28, ptr %33, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %.lr.ph, %31
  %35 = add nuw nsw i32 %.0117142, 1
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %.lr.ph, label %._crit_edge, !llvm.loop !13

.preheader141:                                    ; preds = %.lr.ph145, %middle.block
  br i1 %17, label %.preheader140.lr.ph, label %.critedge

.preheader140.lr.ph:                              ; preds = %.preheader141
  %wide.trip.count189 = zext nneg i32 %16 to i64
  %xtraiter = and i64 %wide.trip.count189, 1
  %38 = icmp eq i32 %16, 1
  %unroll_iter = and i64 %wide.trip.count189, 2147483646
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.lr.ph149.preheader

.lr.ph145:                                        ; preds = %.lr.ph145.preheader223, %.lr.ph145
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph145 ], [ %indvars.iv.ph, %.lr.ph145.preheader223 ]
  %39 = getelementptr inbounds [510 x i32], ptr @dispre, i64 0, i64 %indvars.iv
  %40 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %40, ptr %39, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader141, label %.lr.ph145, !llvm.loop !14

.lr.ph149.preheader:                              ; preds = %._crit_edge155, %.preheader140.lr.ph
  %.0115156 = phi i32 [ 0, %.preheader140.lr.ph ], [ %102, %._crit_edge155 ]
  br i1 %38, label %._crit_edge150.unr-lcssa, label %.lr.ph149

._crit_edge150.unr-lcssa:                         ; preds = %65, %.lr.ph149.preheader
  %.1112.lcssa.ph = phi i32 [ poison, %.lr.ph149.preheader ], [ %.1112.1, %65 ]
  %indvars.iv181.unr = phi i64 [ 0, %.lr.ph149.preheader ], [ %indvars.iv.next182.1, %65 ]
  %.0109147.unr = phi i32 [ 999999999, %.lr.ph149.preheader ], [ %.1110.1, %65 ]
  %.0111146.unr = phi i32 [ -1, %.lr.ph149.preheader ], [ %.1112.1, %65 ]
  br i1 %lcmp.mod.not, label %._crit_edge150, label %.lr.ph149.epil

.lr.ph149.epil:                                   ; preds = %._crit_edge150.unr-lcssa
  %41 = getelementptr inbounds [510 x i8], ptr @visit, i64 0, i64 %indvars.iv181.unr
  %42 = load i8, ptr %41, align 1, !tbaa !15, !range !17, !noundef !18
  %43 = icmp eq i8 %42, 0
  br i1 %43, label %44, label %._crit_edge150

44:                                               ; preds = %.lr.ph149.epil
  %45 = getelementptr inbounds [510 x i32], ptr @dis, i64 0, i64 %indvars.iv181.unr
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = icmp slt i32 %46, %.0109147.unr
  %48 = trunc nuw nsw i64 %indvars.iv181.unr to i32
  %spec.select.epil = select i1 %47, i32 %48, i32 %.0111146.unr
  br label %._crit_edge150

._crit_edge150:                                   ; preds = %.lr.ph149.epil, %44, %._crit_edge150.unr-lcssa
  %.1112.lcssa = phi i32 [ %.1112.lcssa.ph, %._crit_edge150.unr-lcssa ], [ %.0111146.unr, %.lr.ph149.epil ], [ %spec.select.epil, %44 ]
  %.not129 = icmp eq i32 %.1112.lcssa, -1
  br i1 %.not129, label %.critedge, label %.lr.ph154

.lr.ph149:                                        ; preds = %.lr.ph149.preheader, %65
  %indvars.iv181 = phi i64 [ %indvars.iv.next182.1, %65 ], [ 0, %.lr.ph149.preheader ]
  %.0109147 = phi i32 [ %.1110.1, %65 ], [ 999999999, %.lr.ph149.preheader ]
  %.0111146 = phi i32 [ %.1112.1, %65 ], [ -1, %.lr.ph149.preheader ]
  %niter = phi i64 [ %niter.next.1, %65 ], [ 0, %.lr.ph149.preheader ]
  %49 = getelementptr inbounds [510 x i8], ptr @visit, i64 0, i64 %indvars.iv181
  %50 = load i8, ptr %49, align 2, !tbaa !15, !range !17, !noundef !18
  %51 = icmp eq i8 %50, 0
  br i1 %51, label %52, label %.lr.ph149.1

52:                                               ; preds = %.lr.ph149
  %53 = getelementptr inbounds [510 x i32], ptr @dis, i64 0, i64 %indvars.iv181
  %54 = load i32, ptr %53, align 8, !tbaa !5
  %55 = icmp slt i32 %54, %.0109147
  %56 = trunc nuw nsw i64 %indvars.iv181 to i32
  %spec.select = select i1 %55, i32 %56, i32 %.0111146
  %spec.select135 = call i32 @llvm.smin.i32(i32 %54, i32 %.0109147)
  br label %.lr.ph149.1

.lr.ph149.1:                                      ; preds = %52, %.lr.ph149
  %.1112 = phi i32 [ %.0111146, %.lr.ph149 ], [ %spec.select, %52 ]
  %.1110 = phi i32 [ %.0109147, %.lr.ph149 ], [ %spec.select135, %52 ]
  %indvars.iv.next182 = or disjoint i64 %indvars.iv181, 1
  %57 = getelementptr inbounds [510 x i8], ptr @visit, i64 0, i64 %indvars.iv.next182
  %58 = load i8, ptr %57, align 1, !tbaa !15, !range !17, !noundef !18
  %59 = icmp eq i8 %58, 0
  br i1 %59, label %60, label %65

60:                                               ; preds = %.lr.ph149.1
  %61 = getelementptr inbounds [510 x i32], ptr @dis, i64 0, i64 %indvars.iv.next182
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = icmp slt i32 %62, %.1110
  %64 = trunc nuw nsw i64 %indvars.iv.next182 to i32
  %spec.select.1 = select i1 %63, i32 %64, i32 %.1112
  %spec.select135.1 = call i32 @llvm.smin.i32(i32 %62, i32 %.1110)
  br label %65

65:                                               ; preds = %60, %.lr.ph149.1
  %.1112.1 = phi i32 [ %.1112, %.lr.ph149.1 ], [ %spec.select.1, %60 ]
  %.1110.1 = phi i32 [ %.1110, %.lr.ph149.1 ], [ %spec.select135.1, %60 ]
  %indvars.iv.next182.1 = add nuw nsw i64 %indvars.iv181, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge150.unr-lcssa, label %.lr.ph149, !llvm.loop !19

.lr.ph154:                                        ; preds = %._crit_edge150
  %66 = sext i32 %.1112.lcssa to i64
  %67 = getelementptr inbounds [510 x i8], ptr @visit, i64 0, i64 %66
  store i8 1, ptr %67, align 1, !tbaa !15
  %68 = getelementptr inbounds [510 x i32], ptr @dis, i64 0, i64 %66
  %69 = getelementptr inbounds [510 x i32], ptr @weight, i64 0, i64 %66
  br label %70

70:                                               ; preds = %.lr.ph154, %101
  %indvars.iv186 = phi i64 [ 0, %.lr.ph154 ], [ %indvars.iv.next187, %101 ]
  %71 = getelementptr inbounds [510 x i8], ptr @visit, i64 0, i64 %indvars.iv186
  %72 = load i8, ptr %71, align 1, !tbaa !15, !range !17, !noundef !18
  %73 = icmp eq i8 %72, 0
  br i1 %73, label %74, label %101

74:                                               ; preds = %70
  %75 = getelementptr inbounds [510 x [510 x i32]], ptr @e, i64 0, i64 %66, i64 %indvars.iv186
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %.not = icmp eq i32 %76, 999999999
  br i1 %.not, label %101, label %77

77:                                               ; preds = %74
  %78 = load i32, ptr %68, align 4, !tbaa !5
  %79 = add nsw i32 %78, %76
  %80 = getelementptr inbounds [510 x i32], ptr @dis, i64 0, i64 %indvars.iv186
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = icmp slt i32 %79, %81
  br i1 %82, label %83, label %89

83:                                               ; preds = %77
  store i32 %79, ptr %80, align 4, !tbaa !5
  %84 = getelementptr inbounds [510 x i32], ptr @dispre, i64 0, i64 %indvars.iv186
  store i32 %.1112.lcssa, ptr %84, align 4, !tbaa !5
  %85 = load i32, ptr %69, align 4, !tbaa !5
  %86 = getelementptr inbounds [510 x [510 x i32]], ptr @w, i64 0, i64 %66, i64 %indvars.iv186
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = add nsw i32 %87, %85
  br label %.sink.split

89:                                               ; preds = %77
  %90 = icmp eq i32 %79, %81
  br i1 %90, label %91, label %101

91:                                               ; preds = %89
  %92 = getelementptr inbounds [510 x i32], ptr @weight, i64 0, i64 %indvars.iv186
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = load i32, ptr %69, align 4, !tbaa !5
  %95 = getelementptr inbounds [510 x [510 x i32]], ptr @w, i64 0, i64 %66, i64 %indvars.iv186
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = add nsw i32 %96, %94
  %98 = icmp sgt i32 %93, %97
  br i1 %98, label %99, label %101

99:                                               ; preds = %91
  store i32 %97, ptr %92, align 4, !tbaa !5
  br label %.sink.split

.sink.split:                                      ; preds = %83, %99
  %dispre.sink = phi ptr [ @dispre, %99 ], [ @weight, %83 ]
  %.1112.lcssa.sink = phi i32 [ %.1112.lcssa, %99 ], [ %88, %83 ]
  %100 = getelementptr inbounds [510 x i32], ptr %dispre.sink, i64 0, i64 %indvars.iv186
  store i32 %.1112.lcssa.sink, ptr %100, align 4, !tbaa !5
  br label %101

101:                                              ; preds = %.sink.split, %70, %74, %89, %91
  %indvars.iv.next187 = add nuw nsw i64 %indvars.iv186, 1
  %exitcond190.not = icmp eq i64 %indvars.iv.next187, %wide.trip.count189
  br i1 %exitcond190.not, label %._crit_edge155, label %70, !llvm.loop !20

._crit_edge155:                                   ; preds = %101
  %102 = add nuw nsw i32 %.0115156, 1
  %exitcond191.not = icmp eq i32 %102, %16
  br i1 %exitcond191.not, label %.critedge, label %.lr.ph149.preheader, !llvm.loop !21

.critedge:                                        ; preds = %._crit_edge155, %._crit_edge150, %._crit_edge, %.preheader141
  %103 = load i32, ptr @fin, align 4, !tbaa !5
  call void @_Z10dfsdispathi(i32 noundef %103)
  %104 = load i32, ptr @st, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [510 x i32], ptr @Time, i64 0, i64 %105
  store i32 0, ptr %106, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #7
  store i8 0, ptr %8, align 1, !tbaa !15
  call void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef nonnull @visit, ptr noundef nonnull getelementptr inbounds (i8, ptr @visit, i64 510), ptr noundef nonnull align 1 dereferenceable(1) %8)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #7
  %107 = load i32, ptr %1, align 4, !tbaa !5
  %108 = icmp sgt i32 %107, 0
  br i1 %108, label %.preheader.lr.ph, label %.critedge139

.preheader.lr.ph:                                 ; preds = %.critedge
  %wide.trip.count195 = zext nneg i32 %107 to i64
  %wide.trip.count200 = zext nneg i32 %107 to i64
  %xtraiter225 = and i64 %wide.trip.count195, 1
  %109 = icmp eq i32 %107, 1
  %unroll_iter228 = and i64 %wide.trip.count195, 2147483646
  %lcmp.mod226.not = icmp eq i64 %xtraiter225, 0
  br label %.lr.ph161.preheader

.lr.ph161.preheader:                              ; preds = %._crit_edge167, %.preheader.lr.ph
  %.0106168 = phi i32 [ 0, %.preheader.lr.ph ], [ %168, %._crit_edge167 ]
  br i1 %109, label %._crit_edge162.unr-lcssa, label %.lr.ph161

._crit_edge162.unr-lcssa:                         ; preds = %134, %.lr.ph161.preheader
  %.1105.lcssa.ph = phi i32 [ poison, %.lr.ph161.preheader ], [ %.1105.1, %134 ]
  %indvars.iv192.unr = phi i64 [ 0, %.lr.ph161.preheader ], [ %indvars.iv.next193.1, %134 ]
  %.0103159.unr = phi i32 [ 999999999, %.lr.ph161.preheader ], [ %.1.1, %134 ]
  %.0104158.unr = phi i32 [ -1, %.lr.ph161.preheader ], [ %.1105.1, %134 ]
  br i1 %lcmp.mod226.not, label %._crit_edge162, label %.lr.ph161.epil

.lr.ph161.epil:                                   ; preds = %._crit_edge162.unr-lcssa
  %110 = getelementptr inbounds [510 x i8], ptr @visit, i64 0, i64 %indvars.iv192.unr
  %111 = load i8, ptr %110, align 1, !tbaa !15, !range !17, !noundef !18
  %112 = icmp eq i8 %111, 0
  br i1 %112, label %113, label %._crit_edge162

113:                                              ; preds = %.lr.ph161.epil
  %114 = getelementptr inbounds [510 x i32], ptr @Time, i64 0, i64 %indvars.iv192.unr
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = icmp sgt i32 %.0103159.unr, %115
  %117 = trunc nuw nsw i64 %indvars.iv192.unr to i32
  %spec.select136.epil = select i1 %116, i32 %117, i32 %.0104158.unr
  br label %._crit_edge162

._crit_edge162:                                   ; preds = %.lr.ph161.epil, %113, %._crit_edge162.unr-lcssa
  %.1105.lcssa = phi i32 [ %.1105.lcssa.ph, %._crit_edge162.unr-lcssa ], [ %.0104158.unr, %.lr.ph161.epil ], [ %spec.select136.epil, %113 ]
  %.not131 = icmp eq i32 %.1105.lcssa, -1
  br i1 %.not131, label %.critedge139, label %.lr.ph166

.lr.ph161:                                        ; preds = %.lr.ph161.preheader, %134
  %indvars.iv192 = phi i64 [ %indvars.iv.next193.1, %134 ], [ 0, %.lr.ph161.preheader ]
  %.0103159 = phi i32 [ %.1.1, %134 ], [ 999999999, %.lr.ph161.preheader ]
  %.0104158 = phi i32 [ %.1105.1, %134 ], [ -1, %.lr.ph161.preheader ]
  %niter229 = phi i64 [ %niter229.next.1, %134 ], [ 0, %.lr.ph161.preheader ]
  %118 = getelementptr inbounds [510 x i8], ptr @visit, i64 0, i64 %indvars.iv192
  %119 = load i8, ptr %118, align 2, !tbaa !15, !range !17, !noundef !18
  %120 = icmp eq i8 %119, 0
  br i1 %120, label %121, label %.lr.ph161.1

121:                                              ; preds = %.lr.ph161
  %122 = getelementptr inbounds [510 x i32], ptr @Time, i64 0, i64 %indvars.iv192
  %123 = load i32, ptr %122, align 8, !tbaa !5
  %124 = icmp sgt i32 %.0103159, %123
  %125 = trunc nuw nsw i64 %indvars.iv192 to i32
  %spec.select136 = select i1 %124, i32 %125, i32 %.0104158
  %spec.select137 = call i32 @llvm.smin.i32(i32 %.0103159, i32 %123)
  br label %.lr.ph161.1

.lr.ph161.1:                                      ; preds = %121, %.lr.ph161
  %.1105 = phi i32 [ %.0104158, %.lr.ph161 ], [ %spec.select136, %121 ]
  %.1 = phi i32 [ %.0103159, %.lr.ph161 ], [ %spec.select137, %121 ]
  %indvars.iv.next193 = or disjoint i64 %indvars.iv192, 1
  %126 = getelementptr inbounds [510 x i8], ptr @visit, i64 0, i64 %indvars.iv.next193
  %127 = load i8, ptr %126, align 1, !tbaa !15, !range !17, !noundef !18
  %128 = icmp eq i8 %127, 0
  br i1 %128, label %129, label %134

129:                                              ; preds = %.lr.ph161.1
  %130 = getelementptr inbounds [510 x i32], ptr @Time, i64 0, i64 %indvars.iv.next193
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = icmp sgt i32 %.1, %131
  %133 = trunc nuw nsw i64 %indvars.iv.next193 to i32
  %spec.select136.1 = select i1 %132, i32 %133, i32 %.1105
  %spec.select137.1 = call i32 @llvm.smin.i32(i32 %.1, i32 %131)
  br label %134

134:                                              ; preds = %129, %.lr.ph161.1
  %.1105.1 = phi i32 [ %.1105, %.lr.ph161.1 ], [ %spec.select136.1, %129 ]
  %.1.1 = phi i32 [ %.1, %.lr.ph161.1 ], [ %spec.select137.1, %129 ]
  %indvars.iv.next193.1 = add nuw nsw i64 %indvars.iv192, 2
  %niter229.next.1 = add i64 %niter229, 2
  %niter229.ncmp.1 = icmp eq i64 %niter229.next.1, %unroll_iter228
  br i1 %niter229.ncmp.1, label %._crit_edge162.unr-lcssa, label %.lr.ph161, !llvm.loop !22

.lr.ph166:                                        ; preds = %._crit_edge162
  %135 = sext i32 %.1105.lcssa to i64
  %136 = getelementptr inbounds [510 x i8], ptr @visit, i64 0, i64 %135
  store i8 1, ptr %136, align 1, !tbaa !15
  %137 = getelementptr inbounds [510 x i32], ptr @Time, i64 0, i64 %135
  %138 = getelementptr inbounds [510 x i32], ptr @NodeNum, i64 0, i64 %135
  br label %139

139:                                              ; preds = %.lr.ph166, %167
  %indvars.iv197 = phi i64 [ 0, %.lr.ph166 ], [ %indvars.iv.next198, %167 ]
  %140 = getelementptr inbounds [510 x i8], ptr @visit, i64 0, i64 %indvars.iv197
  %141 = load i8, ptr %140, align 1, !tbaa !15, !range !17, !noundef !18
  %142 = icmp eq i8 %141, 0
  br i1 %142, label %143, label %167

143:                                              ; preds = %139
  %144 = getelementptr inbounds [510 x [510 x i32]], ptr @w, i64 0, i64 %135, i64 %indvars.iv197
  %145 = load i32, ptr %144, align 4, !tbaa !5
  %.not130 = icmp eq i32 %145, 999999999
  br i1 %.not130, label %167, label %146

146:                                              ; preds = %143
  %147 = load i32, ptr %137, align 4, !tbaa !5
  %148 = add nsw i32 %147, %145
  %149 = getelementptr inbounds [510 x i32], ptr @Time, i64 0, i64 %indvars.iv197
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = icmp slt i32 %148, %150
  br i1 %151, label %152, label %157

152:                                              ; preds = %146
  store i32 %148, ptr %149, align 4, !tbaa !5
  %153 = getelementptr inbounds [510 x i32], ptr @Timepre, i64 0, i64 %indvars.iv197
  store i32 %.1105.lcssa, ptr %153, align 4, !tbaa !5
  %154 = load i32, ptr %138, align 4, !tbaa !5
  %155 = add nsw i32 %154, 1
  %156 = getelementptr inbounds [510 x i32], ptr @NodeNum, i64 0, i64 %indvars.iv197
  store i32 %155, ptr %156, align 4, !tbaa !5
  br label %167

157:                                              ; preds = %146
  %158 = icmp eq i32 %148, %150
  br i1 %158, label %159, label %167

159:                                              ; preds = %157
  %160 = load i32, ptr %138, align 4, !tbaa !5
  %161 = add nsw i32 %160, 1
  %162 = getelementptr inbounds [510 x i32], ptr @NodeNum, i64 0, i64 %indvars.iv197
  %163 = load i32, ptr %162, align 4, !tbaa !5
  %164 = icmp slt i32 %161, %163
  br i1 %164, label %165, label %167

165:                                              ; preds = %159
  %166 = getelementptr inbounds [510 x i32], ptr @Timepre, i64 0, i64 %indvars.iv197
  store i32 %.1105.lcssa, ptr %166, align 4, !tbaa !5
  store i32 %161, ptr %162, align 4, !tbaa !5
  br label %167

167:                                              ; preds = %139, %143, %157, %159, %165, %152
  %indvars.iv.next198 = add nuw nsw i64 %indvars.iv197, 1
  %exitcond201.not = icmp eq i64 %indvars.iv.next198, %wide.trip.count200
  br i1 %exitcond201.not, label %._crit_edge167, label %139, !llvm.loop !23

._crit_edge167:                                   ; preds = %167
  %168 = add nuw nsw i32 %.0106168, 1
  %exitcond202.not = icmp eq i32 %168, %107
  br i1 %exitcond202.not, label %.critedge139, label %.lr.ph161.preheader, !llvm.loop !24

.critedge139:                                     ; preds = %._crit_edge167, %._crit_edge162, %.critedge
  %169 = load i32, ptr @fin, align 4, !tbaa !5
  call void @_Z11dfsTimepathi(i32 noundef %169)
  %170 = load i32, ptr @fin, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [510 x i32], ptr @dis, i64 0, i64 %171
  %173 = load i32, ptr %172, align 4, !tbaa !5
  %174 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %173)
  %175 = call noundef zeroext i1 @_ZSteqIiSaIiEEbRKSt6vectorIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(24) @dispath, ptr noundef nonnull align 8 dereferenceable(24) @Timepath)
  br i1 %175, label %._crit_edge174, label %176

176:                                              ; preds = %.critedge139
  %177 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  %178 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @dispath) #7
  %179 = trunc i64 %178 to i32
  %.0100170 = add i32 %179, -1
  %180 = icmp sgt i32 %.0100170, -1
  br i1 %180, label %.lr.ph173.preheader, label %._crit_edge174

.lr.ph173.preheader:                              ; preds = %176
  %181 = zext nneg i32 %.0100170 to i64
  %182 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @dispath, i64 noundef %181) #7
  %183 = load i32, ptr %182, align 4, !tbaa !5
  %184 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %183)
  %.not132214 = icmp eq i32 %.0100170, 0
  br i1 %.not132214, label %._crit_edge174, label %.lr.ph173

.lr.ph173:                                        ; preds = %.lr.ph173.preheader, %.lr.ph173
  %indvars.iv203215 = phi i64 [ %indvars.iv.next204, %.lr.ph173 ], [ %181, %.lr.ph173.preheader ]
  %185 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  %indvars.iv.next204 = add nsw i64 %indvars.iv203215, -1
  %186 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @dispath, i64 noundef %indvars.iv.next204) #7
  %187 = load i32, ptr %186, align 4, !tbaa !5
  %188 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %187)
  %.not132 = icmp eq i64 %indvars.iv.next204, 0
  br i1 %.not132, label %._crit_edge174, label %.lr.ph173, !llvm.loop !25

._crit_edge174:                                   ; preds = %.lr.ph173, %.lr.ph173.preheader, %176, %.critedge139
  %.str.10.sink = phi ptr [ @.str.6, %.critedge139 ], [ @.str.10, %176 ], [ @.str.10, %.lr.ph173.preheader ], [ @.str.10, %.lr.ph173 ]
  %189 = load i32, ptr @fin, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [510 x i32], ptr @Time, i64 0, i64 %190
  %192 = load i32, ptr %191, align 4, !tbaa !5
  %193 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.10.sink, i32 noundef %192)
  %194 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @Timepath) #7
  %195 = trunc i64 %194 to i32
  %.0175 = add i32 %195, -1
  %196 = icmp sgt i32 %.0175, -1
  br i1 %196, label %.lr.ph178.preheader, label %._crit_edge179

.lr.ph178.preheader:                              ; preds = %._crit_edge174
  %197 = zext nneg i32 %.0175 to i64
  %198 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Timepath, i64 noundef %197) #7
  %199 = load i32, ptr %198, align 4, !tbaa !5
  %200 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %199)
  %.not133217 = icmp eq i32 %.0175, 0
  br i1 %.not133217, label %._crit_edge179, label %.lr.ph178

._crit_edge179:                                   ; preds = %.lr.ph178, %.lr.ph178.preheader, %._crit_edge174
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0

.lr.ph178:                                        ; preds = %.lr.ph178.preheader, %.lr.ph178
  %indvars.iv206218 = phi i64 [ %indvars.iv.next207, %.lr.ph178 ], [ %197, %.lr.ph178.preheader ]
  %201 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  %indvars.iv.next207 = add nsw i64 %indvars.iv206218, -1
  %202 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Timepath, i64 noundef %indvars.iv.next207) #7
  %203 = load i32, ptr %202, align 4, !tbaa !5
  %204 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %203)
  %.not133 = icmp eq i64 %indvars.iv.next207, 0
  br i1 %.not133, label %._crit_edge179, label %.lr.ph178, !llvm.loop !26
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) 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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) 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: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZSteqIiSaIiEEbRKSt6vectorIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #5 align 2

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

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

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

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


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