; LLVM IR from upupming/algorithm :: upupming (1111)

; 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::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@l = external dso_local global [510 x [510 x i32]], align 16
@t = external dso_local global [510 x [510 x i32]], align 16
@src = external dso_local global i32, align 4
@dest = external dso_local global i32, align 4
@dist = external dso_local global [510 x i32], align 16
@ti = external dso_local global [510 x i32], align 16
@visited = external dso_local global [510 x i8], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.1 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [8 x i8], align 1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5printB5cxx11i(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, i32 noundef) #1

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0 align 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 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i8, align 1
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %"class.std::__cxx11::basic_string", align 8
  %19 = alloca i32, align 4
  %20 = alloca i8, align 1
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca %"class.std::__cxx11::basic_string", align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 2147483647, ptr %2, align 4, !tbaa !5
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef @l, ptr noundef getelementptr inbounds (i32, ptr @l, i64 260100), ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 2147483647, ptr %3, align 4, !tbaa !5
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef @t, ptr noundef getelementptr inbounds (i32, ptr @t, i64 260100), ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %30, ptr noundef nonnull align 4 dereferenceable(4) @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %88, %0
  %33 = load i32, ptr %9, align 4, !tbaa !5
  %34 = load i32, ptr @m, align 4, !tbaa !5
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %37, label %36

36:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %91

37:                                               ; preds = %32
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %38, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %39, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %41 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %40, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %42 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %41, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %43 = load i32, ptr %6, align 4, !tbaa !5
  %44 = icmp ne i32 %43, 0
  br i1 %44, label %45, label %60

45:                                               ; preds = %37
  %46 = load i32, ptr %7, align 4, !tbaa !5
  %47 = load i32, ptr %4, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [510 x [510 x i32]], ptr @l, i64 0, i64 %48
  %50 = load i32, ptr %5, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [510 x i32], ptr %49, i64 0, i64 %51
  store i32 %46, ptr %52, align 4, !tbaa !5
  %53 = load i32, ptr %8, align 4, !tbaa !5
  %54 = load i32, ptr %4, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [510 x [510 x i32]], ptr @t, i64 0, i64 %55
  %57 = load i32, ptr %5, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [510 x i32], ptr %56, i64 0, i64 %58
  store i32 %53, ptr %59, align 4, !tbaa !5
  br label %87

60:                                               ; preds = %37
  %61 = load i32, ptr %7, align 4, !tbaa !5
  %62 = load i32, ptr %5, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [510 x [510 x i32]], ptr @l, i64 0, i64 %63
  %65 = load i32, ptr %4, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [510 x i32], ptr %64, i64 0, i64 %66
  store i32 %61, ptr %67, align 4, !tbaa !5
  %68 = load i32, ptr %4, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [510 x [510 x i32]], ptr @l, i64 0, i64 %69
  %71 = load i32, ptr %5, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [510 x i32], ptr %70, i64 0, i64 %72
  store i32 %61, ptr %73, align 4, !tbaa !5
  %74 = load i32, ptr %8, align 4, !tbaa !5
  %75 = load i32, ptr %5, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [510 x [510 x i32]], ptr @t, i64 0, i64 %76
  %78 = load i32, ptr %4, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [510 x i32], ptr %77, i64 0, i64 %79
  store i32 %74, ptr %80, align 4, !tbaa !5
  %81 = load i32, ptr %4, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [510 x [510 x i32]], ptr @t, i64 0, i64 %82
  %84 = load i32, ptr %5, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [510 x i32], ptr %83, i64 0, i64 %85
  store i32 %74, ptr %86, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %60, %45
  br label %88

88:                                               ; preds = %87
  %89 = load i32, ptr %9, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %9, align 4, !tbaa !5
  br label %32, !llvm.loop !9

91:                                               ; preds = %36
  %92 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @src)
  %93 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %92, ptr noundef nonnull align 4 dereferenceable(4) @dest)
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #7
  store i8 0, ptr %10, align 1, !tbaa !11
  call void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef @visited, ptr noundef getelementptr inbounds (i8, ptr @visited, i64 510), ptr noundef nonnull align 1 dereferenceable(1) %10)
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 2147483647, ptr %11, align 4, !tbaa !5
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef @dist, ptr noundef getelementptr inbounds (i32, ptr @dist, i64 510), ptr noundef nonnull align 4 dereferenceable(4) %11)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 2147483647, ptr %12, align 4, !tbaa !5
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef @ti, ptr noundef getelementptr inbounds (i32, ptr @ti, i64 510), ptr noundef nonnull align 4 dereferenceable(4) %12)
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  %94 = load i32, ptr @src, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [510 x i32], ptr @dist, i64 0, i64 %95
  store i32 0, ptr %96, align 4, !tbaa !5
  br label %97

97:                                               ; preds = %179, %91
  br label %98

98:                                               ; preds = %97
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 2147483647, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 -1, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %99

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

103:                                              ; preds = %99
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %127

104:                                              ; preds = %99
  %105 = load i32, ptr %15, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [510 x i8], ptr @visited, i64 0, i64 %106
  %108 = load i8, ptr %107, align 1, !tbaa !11, !range !13, !noundef !14
  %109 = trunc i8 %108 to i1
  br i1 %109, label %123, label %110

110:                                              ; preds = %104
  %111 = load i32, ptr %15, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [510 x i32], ptr @dist, i64 0, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = load i32, ptr %13, align 4, !tbaa !5
  %116 = icmp slt i32 %114, %115
  br i1 %116, label %117, label %123

117:                                              ; preds = %110
  %118 = load i32, ptr %15, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [510 x i32], ptr @dist, i64 0, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !5
  store i32 %121, ptr %13, align 4, !tbaa !5
  %122 = load i32, ptr %15, align 4, !tbaa !5
  store i32 %122, ptr %14, align 4, !tbaa !5
  br label %123

123:                                              ; preds = %117, %110, %104
  br label %124

124:                                              ; preds = %123
  %125 = load i32, ptr %15, align 4, !tbaa !5
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %15, align 4, !tbaa !5
  br label %99, !llvm.loop !15

127:                                              ; preds = %103
  %128 = load i32, ptr %14, align 4, !tbaa !5
  %129 = icmp eq i32 %128, -1
  br i1 %129, label %130, label %131

130:                                              ; preds = %127
  store i32 6, ptr %16, align 4
  br label %177

131:                                              ; preds = %127
  %132 = load i32, ptr %14, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [510 x i8], ptr @visited, i64 0, i64 %133
  store i8 1, ptr %134, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %135

135:                                              ; preds = %173, %131
  %136 = load i32, ptr %17, align 4, !tbaa !5
  %137 = load i32, ptr @n, align 4, !tbaa !5
  %138 = icmp slt i32 %136, %137
  br i1 %138, label %140, label %139

139:                                              ; preds = %135
  store i32 10, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %176

140:                                              ; preds = %135
  %141 = load i32, ptr %17, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [510 x i8], ptr @visited, i64 0, i64 %142
  %144 = load i8, ptr %143, align 1, !tbaa !11, !range !13, !noundef !14
  %145 = trunc i8 %144 to i1
  br i1 %145, label %172, label %146

146:                                              ; preds = %140
  %147 = load i32, ptr %14, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [510 x [510 x i32]], ptr @l, i64 0, i64 %148
  %150 = load i32, ptr %17, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [510 x i32], ptr %149, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = icmp ne i32 %153, 2147483647
  br i1 %154, label %155, label %172

155:                                              ; preds = %146
  %156 = load i32, ptr %14, align 4, !tbaa !5
  %157 = load i32, ptr %17, align 4, !tbaa !5
  %158 = load i32, ptr %14, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [510 x [510 x i32]], ptr @l, i64 0, i64 %159
  %161 = load i32, ptr %17, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [510 x i32], ptr %160, i64 0, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = load i32, ptr %14, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [510 x [510 x i32]], ptr @t, i64 0, i64 %166
  %168 = load i32, ptr %17, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [510 x i32], ptr %167, i64 0, i64 %169
  %171 = load i32, ptr %170, align 4, !tbaa !5
  call void @_Z5relaxiiiiPiS_(i32 noundef %156, i32 noundef %157, i32 noundef %164, i32 noundef %171, ptr noundef @dist, ptr noundef @ti)
  br label %172

172:                                              ; preds = %155, %146, %140
  br label %173

173:                                              ; preds = %172
  %174 = load i32, ptr %17, align 4, !tbaa !5
  %175 = add nsw i32 %174, 1
  store i32 %175, ptr %17, align 4, !tbaa !5
  br label %135, !llvm.loop !16

176:                                              ; preds = %139
  store i32 0, ptr %16, align 4
  br label %177

177:                                              ; preds = %176, %130
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  %178 = load i32, ptr %16, align 4
  switch i32 %178, label %347 [
    i32 0, label %179
    i32 6, label %180
  ]

179:                                              ; preds = %177
  br label %97, !llvm.loop !17

180:                                              ; preds = %177
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #7
  %181 = load i32, ptr @dest, align 4, !tbaa !5
  call void @_Z5printB5cxx11i(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %18, i32 noundef %181)
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %182 = load i32, ptr @dest, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [510 x i32], ptr @dist, i64 0, i64 %183
  %185 = load i32, ptr %184, align 4, !tbaa !5
  store i32 %185, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %20) #7
  store i8 0, ptr %20, align 1, !tbaa !11
  invoke void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef @visited, ptr noundef getelementptr inbounds (i8, ptr @visited, i64 510), ptr noundef nonnull align 1 dereferenceable(1) %20)
          to label %186 unwind label %199

186:                                              ; preds = %180
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  store i32 2147483647, ptr %23, align 4, !tbaa !5
  invoke void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef @dist, ptr noundef getelementptr inbounds (i32, ptr @dist, i64 510), ptr noundef nonnull align 4 dereferenceable(4) %23)
          to label %187 unwind label %203

187:                                              ; preds = %186
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  store i32 2147483647, ptr %24, align 4, !tbaa !5
  invoke void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef @ti, ptr noundef getelementptr inbounds (i32, ptr @ti, i64 510), ptr noundef nonnull align 4 dereferenceable(4) %24)
          to label %188 unwind label %207

188:                                              ; preds = %187
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  %189 = load i32, ptr @src, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [510 x i32], ptr @dist, i64 0, i64 %190
  store i32 0, ptr %191, align 4, !tbaa !5
  br label %192

192:                                              ; preds = %279, %188
  br label %193

193:                                              ; preds = %192
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  store i32 2147483647, ptr %25, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  store i32 -1, ptr %26, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  store i32 0, ptr %27, align 4, !tbaa !5
  br label %194

194:                                              ; preds = %231, %193
  %195 = load i32, ptr %27, align 4, !tbaa !5
  %196 = load i32, ptr @n, align 4, !tbaa !5
  %197 = icmp slt i32 %195, %196
  br i1 %197, label %211, label %198

198:                                              ; preds = %194
  store i32 15, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  br label %234

199:                                              ; preds = %180
  %200 = landingpad { ptr, i32 }
          cleanup
  %201 = extractvalue { ptr, i32 } %200, 0
  store ptr %201, ptr %21, align 8
  %202 = extractvalue { ptr, i32 } %200, 1
  store i32 %202, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #7
  br label %341

203:                                              ; preds = %186
  %204 = landingpad { ptr, i32 }
          cleanup
  %205 = extractvalue { ptr, i32 } %204, 0
  store ptr %205, ptr %21, align 8
  %206 = extractvalue { ptr, i32 } %204, 1
  store i32 %206, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  br label %341

207:                                              ; preds = %187
  %208 = landingpad { ptr, i32 }
          cleanup
  %209 = extractvalue { ptr, i32 } %208, 0
  store ptr %209, ptr %21, align 8
  %210 = extractvalue { ptr, i32 } %208, 1
  store i32 %210, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %341

211:                                              ; preds = %194
  %212 = load i32, ptr %27, align 4, !tbaa !5
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [510 x i8], ptr @visited, i64 0, i64 %213
  %215 = load i8, ptr %214, align 1, !tbaa !11, !range !13, !noundef !14
  %216 = trunc i8 %215 to i1
  br i1 %216, label %230, label %217

217:                                              ; preds = %211
  %218 = load i32, ptr %27, align 4, !tbaa !5
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds [510 x i32], ptr @dist, i64 0, i64 %219
  %221 = load i32, ptr %220, align 4, !tbaa !5
  %222 = load i32, ptr %25, align 4, !tbaa !5
  %223 = icmp slt i32 %221, %222
  br i1 %223, label %224, label %230

224:                                              ; preds = %217
  %225 = load i32, ptr %27, align 4, !tbaa !5
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds [510 x i32], ptr @dist, i64 0, i64 %226
  %228 = load i32, ptr %227, align 4, !tbaa !5
  store i32 %228, ptr %25, align 4, !tbaa !5
  %229 = load i32, ptr %27, align 4, !tbaa !5
  store i32 %229, ptr %26, align 4, !tbaa !5
  br label %230

230:                                              ; preds = %224, %217, %211
  br label %231

231:                                              ; preds = %230
  %232 = load i32, ptr %27, align 4, !tbaa !5
  %233 = add nsw i32 %232, 1
  store i32 %233, ptr %27, align 4, !tbaa !5
  br label %194, !llvm.loop !18

234:                                              ; preds = %198
  %235 = load i32, ptr %26, align 4, !tbaa !5
  %236 = icmp eq i32 %235, -1
  br i1 %236, label %237, label %238

237:                                              ; preds = %234
  store i32 14, ptr %16, align 4
  br label %277

238:                                              ; preds = %234
  %239 = load i32, ptr %26, align 4, !tbaa !5
  %240 = sext i32 %239 to i64
  %241 = getelementptr inbounds [510 x i8], ptr @visited, i64 0, i64 %240
  store i8 1, ptr %241, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #7
  store i32 0, ptr %28, align 4, !tbaa !5
  br label %242

242:                                              ; preds = %273, %238
  %243 = load i32, ptr %28, align 4, !tbaa !5
  %244 = load i32, ptr @n, align 4, !tbaa !5
  %245 = icmp slt i32 %243, %244
  br i1 %245, label %247, label %246

246:                                              ; preds = %242
  store i32 18, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  br label %276

247:                                              ; preds = %242
  %248 = load i32, ptr %28, align 4, !tbaa !5
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds [510 x i8], ptr @visited, i64 0, i64 %249
  %251 = load i8, ptr %250, align 1, !tbaa !11, !range !13, !noundef !14
  %252 = trunc i8 %251 to i1
  br i1 %252, label %272, label %253

253:                                              ; preds = %247
  %254 = load i32, ptr %26, align 4, !tbaa !5
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [510 x [510 x i32]], ptr @t, i64 0, i64 %255
  %257 = load i32, ptr %28, align 4, !tbaa !5
  %258 = sext i32 %257 to i64
  %259 = getelementptr inbounds [510 x i32], ptr %256, i64 0, i64 %258
  %260 = load i32, ptr %259, align 4, !tbaa !5
  %261 = icmp ne i32 %260, 2147483647
  br i1 %261, label %262, label %272

262:                                              ; preds = %253
  %263 = load i32, ptr %26, align 4, !tbaa !5
  %264 = load i32, ptr %28, align 4, !tbaa !5
  %265 = load i32, ptr %26, align 4, !tbaa !5
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds [510 x [510 x i32]], ptr @t, i64 0, i64 %266
  %268 = load i32, ptr %28, align 4, !tbaa !5
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds [510 x i32], ptr %267, i64 0, i64 %269
  %271 = load i32, ptr %270, align 4, !tbaa !5
  call void @_Z5relaxiiiiPiS_(i32 noundef %263, i32 noundef %264, i32 noundef %271, i32 noundef 1, ptr noundef @dist, ptr noundef @ti)
  br label %272

272:                                              ; preds = %262, %253, %247
  br label %273

273:                                              ; preds = %272
  %274 = load i32, ptr %28, align 4, !tbaa !5
  %275 = add nsw i32 %274, 1
  store i32 %275, ptr %28, align 4, !tbaa !5
  br label %242, !llvm.loop !19

276:                                              ; preds = %246
  store i32 0, ptr %16, align 4
  br label %277

277:                                              ; preds = %276, %237
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  %278 = load i32, ptr %16, align 4
  switch i32 %278, label %347 [
    i32 0, label %279
    i32 14, label %280
  ]

279:                                              ; preds = %277
  br label %192, !llvm.loop !20

280:                                              ; preds = %277
  call void @llvm.lifetime.start.p0(i64 32, ptr %29) #7
  %281 = load i32, ptr @dest, align 4, !tbaa !5
  invoke void @_Z5printB5cxx11i(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %29, i32 noundef %281)
          to label %282 unwind label %304

282:                                              ; preds = %280
  %283 = call noundef zeroext i1 @_ZSteqIcEN9__gnu_cxx11__enable_ifIXsr9__is_charIT_EE7__valueEbE6__typeERKNSt7__cxx1112basic_stringIS2_St11char_traitsIS2_ESaIS2_EEESC_(ptr noundef nonnull align 8 dereferenceable(32) %18, ptr noundef nonnull align 8 dereferenceable(32) %29) #7
  br i1 %283, label %284, label %312

284:                                              ; preds = %282
  %285 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
          to label %286 unwind label %308

286:                                              ; preds = %284
  %287 = load i32, ptr %19, align 4, !tbaa !5
  %288 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %285, i32 noundef %287)
          to label %289 unwind label %308

289:                                              ; preds = %286
  %290 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %288, ptr noundef @.str.2)
          to label %291 unwind label %308

291:                                              ; preds = %289
  %292 = load i32, ptr @dest, align 4, !tbaa !5
  %293 = sext i32 %292 to i64
  %294 = getelementptr inbounds [510 x i32], ptr @dist, i64 0, i64 %293
  %295 = load i32, ptr %294, align 4, !tbaa !5
  %296 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %290, i32 noundef %295)
          to label %297 unwind label %308

297:                                              ; preds = %291
  %298 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %296, ptr noundef @.str.3)
          to label %299 unwind label %308

299:                                              ; preds = %297
  %300 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %298, ptr noundef nonnull align 8 dereferenceable(32) %29)
          to label %301 unwind label %308

301:                                              ; preds = %299
  %302 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %300, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %303 unwind label %308

303:                                              ; preds = %301
  br label %338

304:                                              ; preds = %280
  %305 = landingpad { ptr, i32 }
          cleanup
  %306 = extractvalue { ptr, i32 } %305, 0
  store ptr %306, ptr %21, align 8
  %307 = extractvalue { ptr, i32 } %305, 1
  store i32 %307, ptr %22, align 4
  br label %340

308:                                              ; preds = %335, %333, %331, %325, %323, %321, %319, %317, %314, %312, %301, %299, %297, %291, %289, %286, %284
  %309 = landingpad { ptr, i32 }
          cleanup
  %310 = extractvalue { ptr, i32 } %309, 0
  store ptr %310, ptr %21, align 8
  %311 = extractvalue { ptr, i32 } %309, 1
  store i32 %311, ptr %22, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %29) #7
  br label %340

312:                                              ; preds = %282
  %313 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
          to label %314 unwind label %308

314:                                              ; preds = %312
  %315 = load i32, ptr %19, align 4, !tbaa !5
  %316 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %313, i32 noundef %315)
          to label %317 unwind label %308

317:                                              ; preds = %314
  %318 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %316, ptr noundef @.str.3)
          to label %319 unwind label %308

319:                                              ; preds = %317
  %320 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %318, ptr noundef nonnull align 8 dereferenceable(32) %18)
          to label %321 unwind label %308

321:                                              ; preds = %319
  %322 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %320, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %323 unwind label %308

323:                                              ; preds = %321
  %324 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.4)
          to label %325 unwind label %308

325:                                              ; preds = %323
  %326 = load i32, ptr @dest, align 4, !tbaa !5
  %327 = sext i32 %326 to i64
  %328 = getelementptr inbounds [510 x i32], ptr @dist, i64 0, i64 %327
  %329 = load i32, ptr %328, align 4, !tbaa !5
  %330 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %324, i32 noundef %329)
          to label %331 unwind label %308

331:                                              ; preds = %325
  %332 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %330, ptr noundef @.str.3)
          to label %333 unwind label %308

333:                                              ; preds = %331
  %334 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %332, ptr noundef nonnull align 8 dereferenceable(32) %29)
          to label %335 unwind label %308

335:                                              ; preds = %333
  %336 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %334, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %337 unwind label %308

337:                                              ; preds = %335
  br label %338

338:                                              ; preds = %337, %303
  store i32 0, ptr %1, align 4
  store i32 1, ptr %16, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %29) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  %339 = load i32, ptr %1, align 4
  ret i32 %339

340:                                              ; preds = %308, %304
  call void @llvm.lifetime.end.p0(i64 32, ptr %29) #7
  br label %341

341:                                              ; preds = %340, %207, %203, %199
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %342

342:                                              ; preds = %341
  %343 = load ptr, ptr %21, align 8
  %344 = load i32, ptr %22, align 4
  %345 = insertvalue { ptr, i32 } poison, ptr %343, 0
  %346 = insertvalue { ptr, i32 } %345, i32 %344, 1
  resume { ptr, i32 } %346

347:                                              ; preds = %277, %177
  unreachable
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #5

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(32)) #4

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #5

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !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::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@l = external dso_local global [510 x [510 x i32]], align 16
@t = external dso_local global [510 x [510 x i32]], align 16
@src = external dso_local global i32, align 4
@dest = external dso_local global i32, align 4
@dist = external dso_local global [510 x i32], align 16
@ti = external dso_local global [510 x i32], align 16
@visited = external dso_local global [510 x i8], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.1 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [8 x i8], align 1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5printB5cxx11i(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, 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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0 align 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 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i8, align 1
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"class.std::__cxx11::basic_string", align 8
  %12 = alloca i8, align 1
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %"class.std::__cxx11::basic_string", align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  store i32 2147483647, ptr %1, align 4, !tbaa !5
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull @l, ptr noundef nonnull getelementptr inbounds (i8, ptr @l, i64 1040400), ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  store i32 2147483647, ptr %2, align 4, !tbaa !5
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull @t, ptr noundef nonnull getelementptr inbounds (i8, ptr @t, i64 1040400), ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 4 dereferenceable(4) @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #8
  %18 = load i32, ptr @m, align 4, !tbaa !5
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %51, %0
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @src)
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 4 dereferenceable(4) @dest)
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #8
  store i8 0, ptr %8, align 1, !tbaa !9
  call void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef nonnull @visited, ptr noundef nonnull getelementptr inbounds (i8, ptr @visited, i64 510), ptr noundef nonnull align 1 dereferenceable(1) %8)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #8
  store i32 2147483647, ptr %9, align 4, !tbaa !5
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull @dist, ptr noundef nonnull getelementptr inbounds (i8, ptr @dist, i64 2040), ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #8
  store i32 2147483647, ptr %10, align 4, !tbaa !5
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull @ti, ptr noundef nonnull getelementptr inbounds (i8, ptr @ti, i64 2040), ptr noundef nonnull align 4 dereferenceable(4) %10)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #8
  %22 = load i32, ptr @src, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [510 x i32], ptr @dist, i64 0, i64 %23
  store i32 0, ptr %24, align 4, !tbaa !5
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  %25 = icmp sgt i32 %.pre, 0
  br i1 %25, label %.lr.ph87.preheader, label %._crit_edge88.thread

.lr.ph:                                           ; preds = %0, %51
  %.06282 = phi i32 [ %52, %51 ], [ 0, %0 ]
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %29, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %31 = load i32, ptr %5, align 4, !tbaa !5
  %.not70 = icmp eq i32 %31, 0
  %32 = load i32, ptr %6, align 4, !tbaa !5
  br i1 %.not70, label %41, label %33

33:                                               ; preds = %.lr.ph
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [510 x [510 x i32]], ptr @l, i64 0, i64 %35, i64 %37
  store i32 %32, ptr %38, align 4, !tbaa !5
  %39 = load i32, ptr %7, align 4, !tbaa !5
  %40 = getelementptr inbounds [510 x [510 x i32]], ptr @t, i64 0, i64 %35, i64 %37
  store i32 %39, ptr %40, align 4, !tbaa !5
  br label %51

41:                                               ; preds = %.lr.ph
  %42 = load i32, ptr %4, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [510 x [510 x i32]], ptr @l, i64 0, i64 %43, i64 %45
  store i32 %32, ptr %46, align 4, !tbaa !5
  %47 = getelementptr inbounds [510 x [510 x i32]], ptr @l, i64 0, i64 %45, i64 %43
  store i32 %32, ptr %47, align 4, !tbaa !5
  %48 = load i32, ptr %7, align 4, !tbaa !5
  %49 = getelementptr inbounds [510 x [510 x i32]], ptr @t, i64 0, i64 %43, i64 %45
  store i32 %48, ptr %49, align 4, !tbaa !5
  %50 = getelementptr inbounds [510 x [510 x i32]], ptr @t, i64 0, i64 %45, i64 %43
  store i32 %48, ptr %50, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %33, %41
  %52 = add nuw nsw i32 %.06282, 1
  %53 = load i32, ptr @m, align 4, !tbaa !5
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.loopexit81:                                      ; preds = %102, %88
  %55 = phi i32 [ %60, %88 ], [ %103, %102 ]
  %56 = phi i32 [ %59, %88 ], [ %103, %102 ]
  %57 = icmp sgt i32 %56, 0
  br i1 %57, label %.lr.ph87.preheader, label %._crit_edge88.thread

.lr.ph87.preheader:                               ; preds = %._crit_edge, %.loopexit81
  %58 = phi i1 [ %57, %.loopexit81 ], [ %25, %._crit_edge ]
  %59 = phi i32 [ %56, %.loopexit81 ], [ %.pre, %._crit_edge ]
  %60 = phi i32 [ %55, %.loopexit81 ], [ %.pre, %._crit_edge ]
  %wide.trip.count = zext nneg i32 %59 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %61 = icmp eq i32 %59, 1
  br i1 %61, label %._crit_edge88.unr-lcssa, label %.lr.ph87.preheader.new

.lr.ph87.preheader.new:                           ; preds = %.lr.ph87.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  br label %.lr.ph87

._crit_edge88.unr-lcssa:                          ; preds = %87, %.lr.ph87.preheader
  %.159.lcssa.ph = phi i32 [ poison, %.lr.ph87.preheader ], [ %.159.1, %87 ]
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph87.preheader ], [ %indvars.iv.next.1, %87 ]
  %.05884.unr = phi i32 [ -1, %.lr.ph87.preheader ], [ %.159.1, %87 ]
  %.06083.unr = phi i32 [ 2147483647, %.lr.ph87.preheader ], [ %.161.1, %87 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge88, label %.lr.ph87.epil

.lr.ph87.epil:                                    ; preds = %._crit_edge88.unr-lcssa
  %62 = getelementptr inbounds [510 x i8], ptr @visited, i64 0, i64 %indvars.iv.unr
  %63 = load i8, ptr %62, align 1, !tbaa !9, !range !13, !noundef !14
  %64 = trunc nuw i8 %63 to i1
  br i1 %64, label %._crit_edge88, label %65

65:                                               ; preds = %.lr.ph87.epil
  %66 = getelementptr inbounds [510 x i32], ptr @dist, i64 0, i64 %indvars.iv.unr
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = icmp slt i32 %67, %.06083.unr
  %69 = trunc nuw nsw i64 %indvars.iv.unr to i32
  %spec.select71.epil = select i1 %68, i32 %69, i32 %.05884.unr
  br label %._crit_edge88

._crit_edge88:                                    ; preds = %.lr.ph87.epil, %65, %._crit_edge88.unr-lcssa
  %.159.lcssa = phi i32 [ %.159.lcssa.ph, %._crit_edge88.unr-lcssa ], [ %.05884.unr, %.lr.ph87.epil ], [ %spec.select71.epil, %65 ]
  %70 = icmp eq i32 %.159.lcssa, -1
  br i1 %70, label %._crit_edge88.thread, label %88

.lr.ph87:                                         ; preds = %87, %.lr.ph87.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph87.preheader.new ], [ %indvars.iv.next.1, %87 ]
  %.05884 = phi i32 [ -1, %.lr.ph87.preheader.new ], [ %.159.1, %87 ]
  %.06083 = phi i32 [ 2147483647, %.lr.ph87.preheader.new ], [ %.161.1, %87 ]
  %niter = phi i64 [ 0, %.lr.ph87.preheader.new ], [ %niter.next.1, %87 ]
  %71 = getelementptr inbounds [510 x i8], ptr @visited, i64 0, i64 %indvars.iv
  %72 = load i8, ptr %71, align 2, !tbaa !9, !range !13, !noundef !14
  %73 = trunc nuw i8 %72 to i1
  br i1 %73, label %.lr.ph87.1, label %74

74:                                               ; preds = %.lr.ph87
  %75 = getelementptr inbounds [510 x i32], ptr @dist, i64 0, i64 %indvars.iv
  %76 = load i32, ptr %75, align 8, !tbaa !5
  %77 = icmp slt i32 %76, %.06083
  %spec.select = call i32 @llvm.smin.i32(i32 %76, i32 %.06083)
  %78 = trunc nuw nsw i64 %indvars.iv to i32
  %spec.select71 = select i1 %77, i32 %78, i32 %.05884
  br label %.lr.ph87.1

.lr.ph87.1:                                       ; preds = %74, %.lr.ph87
  %.161 = phi i32 [ %.06083, %.lr.ph87 ], [ %spec.select, %74 ]
  %.159 = phi i32 [ %.05884, %.lr.ph87 ], [ %spec.select71, %74 ]
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %79 = getelementptr inbounds [510 x i8], ptr @visited, i64 0, i64 %indvars.iv.next
  %80 = load i8, ptr %79, align 1, !tbaa !9, !range !13, !noundef !14
  %81 = trunc nuw i8 %80 to i1
  br i1 %81, label %87, label %82

82:                                               ; preds = %.lr.ph87.1
  %83 = getelementptr inbounds [510 x i32], ptr @dist, i64 0, i64 %indvars.iv.next
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = icmp slt i32 %84, %.161
  %spec.select.1 = call i32 @llvm.smin.i32(i32 %84, i32 %.161)
  %86 = trunc nuw nsw i64 %indvars.iv.next to i32
  %spec.select71.1 = select i1 %85, i32 %86, i32 %.159
  br label %87

87:                                               ; preds = %82, %.lr.ph87.1
  %.161.1 = phi i32 [ %.161, %.lr.ph87.1 ], [ %spec.select.1, %82 ]
  %.159.1 = phi i32 [ %.159, %.lr.ph87.1 ], [ %spec.select71.1, %82 ]
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 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_edge88.unr-lcssa, label %.lr.ph87, !llvm.loop !15

88:                                               ; preds = %._crit_edge88
  %89 = sext i32 %.159.lcssa to i64
  %90 = getelementptr inbounds [510 x i8], ptr @visited, i64 0, i64 %89
  store i8 1, ptr %90, align 1, !tbaa !9
  br i1 %58, label %.lr.ph91, label %.loopexit81

.lr.ph91:                                         ; preds = %88, %102
  %91 = phi i32 [ %103, %102 ], [ %60, %88 ]
  %indvars.iv103 = phi i64 [ %indvars.iv.next104, %102 ], [ 0, %88 ]
  %92 = getelementptr inbounds [510 x i8], ptr @visited, i64 0, i64 %indvars.iv103
  %93 = load i8, ptr %92, align 1, !tbaa !9, !range !13, !noundef !14
  %94 = trunc nuw i8 %93 to i1
  br i1 %94, label %102, label %95

95:                                               ; preds = %.lr.ph91
  %96 = getelementptr inbounds [510 x [510 x i32]], ptr @l, i64 0, i64 %89, i64 %indvars.iv103
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %.not = icmp eq i32 %97, 2147483647
  br i1 %.not, label %102, label %98

98:                                               ; preds = %95
  %99 = getelementptr inbounds [510 x [510 x i32]], ptr @t, i64 0, i64 %89, i64 %indvars.iv103
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = trunc nuw nsw i64 %indvars.iv103 to i32
  call void @_Z5relaxiiiiPiS_(i32 noundef %.159.lcssa, i32 noundef %101, i32 noundef %97, i32 noundef %100, ptr noundef nonnull @dist, ptr noundef nonnull @ti)
  %.pre114 = load i32, ptr @n, align 4, !tbaa !5
  br label %102

102:                                              ; preds = %.lr.ph91, %95, %98
  %103 = phi i32 [ %91, %.lr.ph91 ], [ %91, %95 ], [ %.pre114, %98 ]
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
  %104 = sext i32 %103 to i64
  %105 = icmp slt i64 %indvars.iv.next104, %104
  br i1 %105, label %.lr.ph91, label %.loopexit81, !llvm.loop !16

._crit_edge88.thread:                             ; preds = %._crit_edge88, %.loopexit81, %._crit_edge
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #8
  %106 = load i32, ptr @dest, align 4, !tbaa !5
  call void @_Z5printB5cxx11i(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %11, i32 noundef %106)
  %107 = load i32, ptr @dest, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [510 x i32], ptr @dist, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %12) #8
  store i8 0, ptr %12, align 1, !tbaa !9
  invoke void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef nonnull @visited, ptr noundef nonnull getelementptr inbounds (i8, ptr @visited, i64 510), ptr noundef nonnull align 1 dereferenceable(1) %12)
          to label %111 unwind label %134

111:                                              ; preds = %._crit_edge88.thread
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %12) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #8
  store i32 2147483647, ptr %13, align 4, !tbaa !5
  invoke void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull @dist, ptr noundef nonnull getelementptr inbounds (i8, ptr @dist, i64 2040), ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %112 unwind label %136

112:                                              ; preds = %111
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #8
  store i32 2147483647, ptr %14, align 4, !tbaa !5
  invoke void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull @ti, ptr noundef nonnull getelementptr inbounds (i8, ptr @ti, i64 2040), ptr noundef nonnull align 4 dereferenceable(4) %14)
          to label %113 unwind label %138

113:                                              ; preds = %112
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #8
  %114 = load i32, ptr @src, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [510 x i32], ptr @dist, i64 0, i64 %115
  store i32 0, ptr %116, align 4, !tbaa !5
  %.pre115 = load i32, ptr @n, align 4, !tbaa !5
  %117 = icmp sgt i32 %.pre115, 0
  br i1 %117, label %.lr.ph96.preheader, label %._crit_edge97.thread

.loopexit:                                        ; preds = %169, %157
  %118 = phi i32 [ %123, %157 ], [ %170, %169 ]
  %119 = phi i32 [ %122, %157 ], [ %170, %169 ]
  %120 = icmp sgt i32 %119, 0
  br i1 %120, label %.lr.ph96.preheader, label %._crit_edge97.thread

.lr.ph96.preheader:                               ; preds = %113, %.loopexit
  %121 = phi i1 [ %120, %.loopexit ], [ %117, %113 ]
  %122 = phi i32 [ %119, %.loopexit ], [ %.pre115, %113 ]
  %123 = phi i32 [ %118, %.loopexit ], [ %.pre115, %113 ]
  %wide.trip.count109 = zext nneg i32 %122 to i64
  %xtraiter128 = and i64 %wide.trip.count109, 1
  %124 = icmp eq i32 %122, 1
  br i1 %124, label %._crit_edge97.unr-lcssa, label %.lr.ph96.preheader.new

.lr.ph96.preheader.new:                           ; preds = %.lr.ph96.preheader
  %unroll_iter131 = and i64 %wide.trip.count109, 2147483646
  br label %.lr.ph96

._crit_edge97.unr-lcssa:                          ; preds = %156, %.lr.ph96.preheader
  %.1.lcssa.ph = phi i32 [ poison, %.lr.ph96.preheader ], [ %.1.1, %156 ]
  %indvars.iv106.unr = phi i64 [ 0, %.lr.ph96.preheader ], [ %indvars.iv.next107.1, %156 ]
  %.04793.unr = phi i32 [ -1, %.lr.ph96.preheader ], [ %.1.1, %156 ]
  %.04892.unr = phi i32 [ 2147483647, %.lr.ph96.preheader ], [ %.149.1, %156 ]
  %lcmp.mod129.not = icmp eq i64 %xtraiter128, 0
  br i1 %lcmp.mod129.not, label %._crit_edge97, label %.lr.ph96.epil

.lr.ph96.epil:                                    ; preds = %._crit_edge97.unr-lcssa
  %125 = getelementptr inbounds [510 x i8], ptr @visited, i64 0, i64 %indvars.iv106.unr
  %126 = load i8, ptr %125, align 1, !tbaa !9, !range !13, !noundef !14
  %127 = trunc nuw i8 %126 to i1
  br i1 %127, label %._crit_edge97, label %128

128:                                              ; preds = %.lr.ph96.epil
  %129 = getelementptr inbounds [510 x i32], ptr @dist, i64 0, i64 %indvars.iv106.unr
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = icmp slt i32 %130, %.04892.unr
  %132 = trunc nuw nsw i64 %indvars.iv106.unr to i32
  %spec.select73.epil = select i1 %131, i32 %132, i32 %.04793.unr
  br label %._crit_edge97

._crit_edge97:                                    ; preds = %.lr.ph96.epil, %128, %._crit_edge97.unr-lcssa
  %.1.lcssa = phi i32 [ %.1.lcssa.ph, %._crit_edge97.unr-lcssa ], [ %.04793.unr, %.lr.ph96.epil ], [ %spec.select73.epil, %128 ]
  %133 = icmp eq i32 %.1.lcssa, -1
  br i1 %133, label %._crit_edge97.thread, label %157

134:                                              ; preds = %._crit_edge88.thread
  %135 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %12) #8
  br label %207

136:                                              ; preds = %111
  %137 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #8
  br label %207

138:                                              ; preds = %112
  %139 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #8
  br label %207

.lr.ph96:                                         ; preds = %156, %.lr.ph96.preheader.new
  %indvars.iv106 = phi i64 [ 0, %.lr.ph96.preheader.new ], [ %indvars.iv.next107.1, %156 ]
  %.04793 = phi i32 [ -1, %.lr.ph96.preheader.new ], [ %.1.1, %156 ]
  %.04892 = phi i32 [ 2147483647, %.lr.ph96.preheader.new ], [ %.149.1, %156 ]
  %niter132 = phi i64 [ 0, %.lr.ph96.preheader.new ], [ %niter132.next.1, %156 ]
  %140 = getelementptr inbounds [510 x i8], ptr @visited, i64 0, i64 %indvars.iv106
  %141 = load i8, ptr %140, align 2, !tbaa !9, !range !13, !noundef !14
  %142 = trunc nuw i8 %141 to i1
  br i1 %142, label %.lr.ph96.1, label %143

143:                                              ; preds = %.lr.ph96
  %144 = getelementptr inbounds [510 x i32], ptr @dist, i64 0, i64 %indvars.iv106
  %145 = load i32, ptr %144, align 8, !tbaa !5
  %146 = icmp slt i32 %145, %.04892
  %spec.select72 = call i32 @llvm.smin.i32(i32 %145, i32 %.04892)
  %147 = trunc nuw nsw i64 %indvars.iv106 to i32
  %spec.select73 = select i1 %146, i32 %147, i32 %.04793
  br label %.lr.ph96.1

.lr.ph96.1:                                       ; preds = %143, %.lr.ph96
  %.149 = phi i32 [ %.04892, %.lr.ph96 ], [ %spec.select72, %143 ]
  %.1 = phi i32 [ %.04793, %.lr.ph96 ], [ %spec.select73, %143 ]
  %indvars.iv.next107 = or disjoint i64 %indvars.iv106, 1
  %148 = getelementptr inbounds [510 x i8], ptr @visited, i64 0, i64 %indvars.iv.next107
  %149 = load i8, ptr %148, align 1, !tbaa !9, !range !13, !noundef !14
  %150 = trunc nuw i8 %149 to i1
  br i1 %150, label %156, label %151

151:                                              ; preds = %.lr.ph96.1
  %152 = getelementptr inbounds [510 x i32], ptr @dist, i64 0, i64 %indvars.iv.next107
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = icmp slt i32 %153, %.149
  %spec.select72.1 = call i32 @llvm.smin.i32(i32 %153, i32 %.149)
  %155 = trunc nuw nsw i64 %indvars.iv.next107 to i32
  %spec.select73.1 = select i1 %154, i32 %155, i32 %.1
  br label %156

156:                                              ; preds = %151, %.lr.ph96.1
  %.149.1 = phi i32 [ %.149, %.lr.ph96.1 ], [ %spec.select72.1, %151 ]
  %.1.1 = phi i32 [ %.1, %.lr.ph96.1 ], [ %spec.select73.1, %151 ]
  %indvars.iv.next107.1 = add nuw nsw i64 %indvars.iv106, 2
  %niter132.next.1 = add i64 %niter132, 2
  %niter132.ncmp.1 = icmp eq i64 %niter132.next.1, %unroll_iter131
  br i1 %niter132.ncmp.1, label %._crit_edge97.unr-lcssa, label %.lr.ph96, !llvm.loop !17

157:                                              ; preds = %._crit_edge97
  %158 = sext i32 %.1.lcssa to i64
  %159 = getelementptr inbounds [510 x i8], ptr @visited, i64 0, i64 %158
  store i8 1, ptr %159, align 1, !tbaa !9
  br i1 %121, label %.lr.ph101, label %.loopexit

.lr.ph101:                                        ; preds = %157, %169
  %160 = phi i32 [ %170, %169 ], [ %123, %157 ]
  %indvars.iv111 = phi i64 [ %indvars.iv.next112, %169 ], [ 0, %157 ]
  %161 = getelementptr inbounds [510 x i8], ptr @visited, i64 0, i64 %indvars.iv111
  %162 = load i8, ptr %161, align 1, !tbaa !9, !range !13, !noundef !14
  %163 = trunc nuw i8 %162 to i1
  br i1 %163, label %169, label %164

164:                                              ; preds = %.lr.ph101
  %165 = getelementptr inbounds [510 x [510 x i32]], ptr @t, i64 0, i64 %158, i64 %indvars.iv111
  %166 = load i32, ptr %165, align 4, !tbaa !5
  %.not67 = icmp eq i32 %166, 2147483647
  br i1 %.not67, label %169, label %167

167:                                              ; preds = %164
  %168 = trunc nuw nsw i64 %indvars.iv111 to i32
  call void @_Z5relaxiiiiPiS_(i32 noundef %.1.lcssa, i32 noundef %168, i32 noundef %166, i32 noundef 1, ptr noundef nonnull @dist, ptr noundef nonnull @ti)
  %.pre116 = load i32, ptr @n, align 4, !tbaa !5
  br label %169

169:                                              ; preds = %.lr.ph101, %164, %167
  %170 = phi i32 [ %160, %.lr.ph101 ], [ %160, %164 ], [ %.pre116, %167 ]
  %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
  %171 = sext i32 %170 to i64
  %172 = icmp slt i64 %indvars.iv.next112, %171
  br i1 %172, label %.lr.ph101, label %.loopexit, !llvm.loop !18

._crit_edge97.thread:                             ; preds = %._crit_edge97, %.loopexit, %113
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %15) #8
  %173 = load i32, ptr @dest, align 4, !tbaa !5
  invoke void @_Z5printB5cxx11i(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %15, i32 noundef %173)
          to label %174 unwind label %180

174:                                              ; preds = %._crit_edge97.thread
  %175 = call noundef zeroext i1 @_ZSteqIcEN9__gnu_cxx11__enable_ifIXsr9__is_charIT_EE7__valueEbE6__typeERKNSt7__cxx1112basic_stringIS2_St11char_traitsIS2_ESaIS2_EEESC_(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 8 dereferenceable(32) %15) #8
  br i1 %175, label %176, label %184

176:                                              ; preds = %174
  %177 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
          to label %178 unwind label %182

178:                                              ; preds = %176
  %179 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %177, i32 noundef %110)
          to label %.invoke124 unwind label %182

180:                                              ; preds = %._crit_edge97.thread
  %181 = landingpad { ptr, i32 }
          cleanup
  br label %206

182:                                              ; preds = %.invoke124, %.invoke122, %.invoke121, %.invoke120, %.invoke, %192, %190, %188, %186, %184, %178, %176
  %183 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #8
  br label %206

184:                                              ; preds = %174
  %185 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
          to label %186 unwind label %182

186:                                              ; preds = %184
  %187 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %185, i32 noundef %110)
          to label %188 unwind label %182

188:                                              ; preds = %186
  %189 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %187, ptr noundef nonnull @.str.3)
          to label %190 unwind label %182

190:                                              ; preds = %188
  %191 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %189, ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %192 unwind label %182

192:                                              ; preds = %190
  %193 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %191, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %.invoke124 unwind label %182

.invoke124:                                       ; preds = %178, %192
  %194 = phi ptr [ @_ZSt4cout, %192 ], [ %179, %178 ]
  %195 = phi ptr [ @.str.4, %192 ], [ @.str.2, %178 ]
  %196 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %194, ptr noundef nonnull %195)
          to label %.invoke122 unwind label %182

.invoke122:                                       ; preds = %.invoke124
  %197 = load i32, ptr @dest, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [510 x i32], ptr @dist, i64 0, i64 %198
  %200 = load i32, ptr %199, align 4, !tbaa !5
  %201 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %196, i32 noundef %200)
          to label %.invoke121 unwind label %182

.invoke121:                                       ; preds = %.invoke122
  %202 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %201, ptr noundef nonnull @.str.3)
          to label %.invoke120 unwind label %182

.invoke120:                                       ; preds = %.invoke121
  %203 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %202, ptr noundef nonnull align 8 dereferenceable(32) %15)
          to label %.invoke unwind label %182

.invoke:                                          ; preds = %.invoke120
  %204 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %203, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %205 unwind label %182

205:                                              ; preds = %.invoke
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %15) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  ret i32 0

206:                                              ; preds = %182, %180
  %.pn = phi { ptr, i32 } [ %183, %182 ], [ %181, %180 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %15) #8
  br label %207

207:                                              ; preds = %206, %138, %136, %134
  %.pn.pn = phi { ptr, i32 } [ %.pn, %206 ], [ %139, %138 ], [ %137, %136 ], [ %135, %134 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  resume { ptr, i32 } %.pn.pn
}

; 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 #4

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

; 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 #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

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

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

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass