; LLVM IR from UtkarshPathrabe/Competitive-Coding :: Model Algorithms/Graphs (Single Source Shortest Path in Directed Acyclic Graphs)

; 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_ostream" = type { ptr, %"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::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::_List_iterator" = type { ptr }
%class.Graph = type { i32, ptr }
%"class.std::__cxx11::list" = type { %"class.std::__cxx11::_List_base" }
%"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<AdjListNode, std::allocator<AdjListNode>>::_List_impl" }
%"struct.std::__cxx11::_List_base<AdjListNode, std::allocator<AdjListNode>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" }
%"struct.std::__detail::_List_node_header" = type { %"struct.std::__detail::_List_node_base", i64 }
%"struct.std::__detail::_List_node_base" = type { ptr, ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [54 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Graph19topologicalSortUtilEiPbRSt5stackIiSt5dequeIiSaIiEEE(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(80)) #2 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN11AdjListNode7getDestEv(ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt14_List_iteratorI11AdjListNodeEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5Graph12shortestPathEi(ptr noundef nonnull align 8 dereferenceable(16) %0, i32 noundef %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca %"class.std::stack", align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::_List_iterator", align 8
  %15 = alloca %"struct.std::_List_iterator", align 8
  %16 = alloca %"struct.std::_List_iterator", align 8
  %17 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %18 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  %19 = getelementptr inbounds %class.Graph, ptr %18, i32 0, i32 0
  %20 = load i32, ptr %19, align 8, !tbaa !11
  %21 = sext i32 %20 to i64
  %22 = call noalias noundef nonnull ptr @_Znam(i64 noundef %21) #9
  store ptr %22, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 80, ptr %6) #8
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  %23 = getelementptr inbounds %class.Graph, ptr %18, i32 0, i32 0
  %24 = load i32, ptr %23, align 8, !tbaa !11
  %25 = zext i32 %24 to i64
  %26 = call ptr @llvm.stacksave.p0()
  store ptr %26, ptr %7, align 8
  %27 = alloca i32, i64 %25, align 16
  store i64 %25, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %28

28:                                               ; preds = %42, %2
  %29 = load i32, ptr %9, align 4, !tbaa !9
  %30 = getelementptr inbounds %class.Graph, ptr %18, i32 0, i32 0
  %31 = load i32, ptr %30, align 8, !tbaa !11
  %32 = icmp slt i32 %29, %31
  br i1 %32, label %34, label %33

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

34:                                               ; preds = %28
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = load i32, ptr %9, align 4, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds i8, ptr %35, i64 %37
  store i8 0, ptr %38, align 1, !tbaa !13
  %39 = load i32, ptr %9, align 4, !tbaa !9
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds i32, ptr %27, i64 %40
  store i32 2147483647, ptr %41, align 4, !tbaa !9
  br label %42

42:                                               ; preds = %34
  %43 = load i32, ptr %9, align 4, !tbaa !9
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %9, align 4, !tbaa !9
  br label %28, !llvm.loop !15

45:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %46

46:                                               ; preds = %68, %45
  %47 = load i32, ptr %10, align 4, !tbaa !9
  %48 = getelementptr inbounds %class.Graph, ptr %18, i32 0, i32 0
  %49 = load i32, ptr %48, align 8, !tbaa !11
  %50 = icmp slt i32 %47, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %46
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %71

52:                                               ; preds = %46
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = load i32, ptr %10, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds i8, ptr %53, i64 %55
  %57 = load i8, ptr %56, align 1, !tbaa !13, !range !17, !noundef !18
  %58 = trunc i8 %57 to i1
  br i1 %58, label %67, label %59

59:                                               ; preds = %52
  %60 = load i32, ptr %10, align 4, !tbaa !9
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  invoke void @_ZN5Graph19topologicalSortUtilEiPbRSt5stackIiSt5dequeIiSaIiEEE(ptr noundef nonnull align 8 dereferenceable(16) %18, i32 noundef %60, ptr noundef %61, ptr noundef nonnull align 8 dereferenceable(80) %6)
          to label %62 unwind label %63

62:                                               ; preds = %59
  br label %67

63:                                               ; preds = %59
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %11, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %211

67:                                               ; preds = %62, %52
  br label %68

68:                                               ; preds = %67
  %69 = load i32, ptr %10, align 4, !tbaa !9
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %10, align 4, !tbaa !9
  br label %46, !llvm.loop !19

71:                                               ; preds = %51
  %72 = load i32, ptr %4, align 4, !tbaa !9
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds i32, ptr %27, i64 %73
  store i32 0, ptr %74, align 4, !tbaa !9
  br label %75

75:                                               ; preds = %154, %71
  %76 = invoke noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
          to label %77 unwind label %107

77:                                               ; preds = %75
  %78 = xor i1 %76, true
  br i1 %78, label %79, label %156

79:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %80 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
          to label %81 unwind label %111

81:                                               ; preds = %79
  %82 = load i32, ptr %80, align 4, !tbaa !9
  store i32 %82, ptr %13, align 4, !tbaa !9
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
          to label %83 unwind label %111

83:                                               ; preds = %81
  %84 = load i32, ptr %13, align 4, !tbaa !9
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds i32, ptr %27, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !9
  %88 = icmp ne i32 %87, 2147483647
  br i1 %88, label %89, label %154

89:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %90 = getelementptr inbounds %class.Graph, ptr %18, i32 0, i32 1
  %91 = load ptr, ptr %90, align 8, !tbaa !20
  %92 = load i32, ptr %13, align 4, !tbaa !9
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds %"class.std::__cxx11::list", ptr %91, i64 %93
  %95 = call ptr @_ZNSt7__cxx114listI11AdjListNodeSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %94) #8
  %96 = getelementptr inbounds %"struct.std::_List_iterator", ptr %14, i32 0, i32 0
  store ptr %95, ptr %96, align 8
  br label %97

97:                                               ; preds = %150, %89
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %98 = getelementptr inbounds %class.Graph, ptr %18, i32 0, i32 1
  %99 = load ptr, ptr %98, align 8, !tbaa !20
  %100 = load i32, ptr %13, align 4, !tbaa !9
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds %"class.std::__cxx11::list", ptr %99, i64 %101
  %103 = call ptr @_ZNSt7__cxx114listI11AdjListNodeSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %102) #8
  %104 = getelementptr inbounds %"struct.std::_List_iterator", ptr %15, i32 0, i32 0
  store ptr %103, ptr %104, align 8
  %105 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorI11AdjListNodeES3_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  br i1 %105, label %115, label %106

106:                                              ; preds = %97
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %153

107:                                              ; preds = %163, %161, %158, %156, %75
  %108 = landingpad { ptr, i32 }
          cleanup
  %109 = extractvalue { ptr, i32 } %108, 0
  store ptr %109, ptr %11, align 8
  %110 = extractvalue { ptr, i32 } %108, 1
  store i32 %110, ptr %12, align 4
  br label %211

111:                                              ; preds = %81, %79
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %11, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %12, align 4
  br label %155

115:                                              ; preds = %97
  %116 = call noundef ptr @_ZNKSt14_List_iteratorI11AdjListNodeEptEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #8
  %117 = invoke noundef i32 @_ZN11AdjListNode7getDestEv(ptr noundef nonnull align 4 dereferenceable(8) %116)
          to label %118 unwind label %145

118:                                              ; preds = %115
  %119 = sext i32 %117 to i64
  %120 = getelementptr inbounds i32, ptr %27, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !9
  %122 = load i32, ptr %13, align 4, !tbaa !9
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds i32, ptr %27, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !9
  %126 = call noundef ptr @_ZNKSt14_List_iteratorI11AdjListNodeEptEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #8
  %127 = invoke noundef i32 @_ZN11AdjListNode9getWeightEv(ptr noundef nonnull align 4 dereferenceable(8) %126)
          to label %128 unwind label %145

128:                                              ; preds = %118
  %129 = add nsw i32 %125, %127
  %130 = icmp sgt i32 %121, %129
  br i1 %130, label %131, label %149

131:                                              ; preds = %128
  %132 = load i32, ptr %13, align 4, !tbaa !9
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds i32, ptr %27, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !9
  %136 = call noundef ptr @_ZNKSt14_List_iteratorI11AdjListNodeEptEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #8
  %137 = invoke noundef i32 @_ZN11AdjListNode9getWeightEv(ptr noundef nonnull align 4 dereferenceable(8) %136)
          to label %138 unwind label %145

138:                                              ; preds = %131
  %139 = add nsw i32 %135, %137
  %140 = call noundef ptr @_ZNKSt14_List_iteratorI11AdjListNodeEptEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #8
  %141 = invoke noundef i32 @_ZN11AdjListNode7getDestEv(ptr noundef nonnull align 4 dereferenceable(8) %140)
          to label %142 unwind label %145

142:                                              ; preds = %138
  %143 = sext i32 %141 to i64
  %144 = getelementptr inbounds i32, ptr %27, i64 %143
  store i32 %139, ptr %144, align 4, !tbaa !9
  br label %149

145:                                              ; preds = %138, %131, %118, %115
  %146 = landingpad { ptr, i32 }
          cleanup
  %147 = extractvalue { ptr, i32 } %146, 0
  store ptr %147, ptr %11, align 8
  %148 = extractvalue { ptr, i32 } %146, 1
  store i32 %148, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %155

149:                                              ; preds = %142, %128
  br label %150

150:                                              ; preds = %149
  %151 = call ptr @_ZNSt14_List_iteratorI11AdjListNodeEppEi(ptr noundef nonnull align 8 dereferenceable(8) %14, i32 noundef 0) #8
  %152 = getelementptr inbounds %"struct.std::_List_iterator", ptr %16, i32 0, i32 0
  store ptr %151, ptr %152, align 8
  br label %97, !llvm.loop !21

153:                                              ; preds = %106
  br label %154

154:                                              ; preds = %153, %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %75, !llvm.loop !22

155:                                              ; preds = %145, %111
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %211

156:                                              ; preds = %77
  %157 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
          to label %158 unwind label %107

158:                                              ; preds = %156
  %159 = load i32, ptr %4, align 4, !tbaa !9
  %160 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %157, i32 noundef %159)
          to label %161 unwind label %107

161:                                              ; preds = %158
  %162 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %160, ptr noundef @.str.1)
          to label %163 unwind label %107

163:                                              ; preds = %161
  %164 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %162, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %165 unwind label %107

165:                                              ; preds = %163
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %166

166:                                              ; preds = %202, %165
  %167 = load i32, ptr %17, align 4, !tbaa !9
  %168 = getelementptr inbounds %class.Graph, ptr %18, i32 0, i32 0
  %169 = load i32, ptr %168, align 8, !tbaa !11
  %170 = icmp slt i32 %167, %169
  br i1 %170, label %172, label %171

171:                                              ; preds = %166
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %209

172:                                              ; preds = %166
  %173 = load i32, ptr %17, align 4, !tbaa !9
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds i32, ptr %27, i64 %174
  %176 = load i32, ptr %175, align 4, !tbaa !9
  %177 = icmp eq i32 %176, 2147483647
  br i1 %177, label %178, label %186

178:                                              ; preds = %172
  %179 = load i32, ptr %17, align 4, !tbaa !9
  %180 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %179)
          to label %181 unwind label %205

181:                                              ; preds = %178
  %182 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %180, ptr noundef @.str.2)
          to label %183 unwind label %205

183:                                              ; preds = %181
  %184 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %182, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %185 unwind label %205

185:                                              ; preds = %183
  br label %200

186:                                              ; preds = %172
  %187 = load i32, ptr %17, align 4, !tbaa !9
  %188 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %187)
          to label %189 unwind label %205

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

191:                                              ; preds = %189
  %192 = load i32, ptr %17, align 4, !tbaa !9
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds i32, ptr %27, i64 %193
  %195 = load i32, ptr %194, align 4, !tbaa !9
  %196 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %190, i32 noundef %195)
          to label %197 unwind label %205

197:                                              ; preds = %191
  %198 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %196, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %199 unwind label %205

199:                                              ; preds = %197
  br label %200

200:                                              ; preds = %199, %185
  %201 = phi ptr [ %184, %185 ], [ %198, %199 ]
  br label %202

202:                                              ; preds = %200
  %203 = load i32, ptr %17, align 4, !tbaa !9
  %204 = add nsw i32 %203, 1
  store i32 %204, ptr %17, align 4, !tbaa !9
  br label %166, !llvm.loop !23

205:                                              ; preds = %197, %191, %189, %186, %183, %181, %178
  %206 = landingpad { ptr, i32 }
          cleanup
  %207 = extractvalue { ptr, i32 } %206, 0
  store ptr %207, ptr %11, align 8
  %208 = extractvalue { ptr, i32 } %206, 1
  store i32 %208, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %211

209:                                              ; preds = %171
  %210 = load ptr, ptr %7, align 8
  call void @llvm.stackrestore.p0(ptr %210)
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  ret void

211:                                              ; preds = %205, %155, %107, %63
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  br label %212

212:                                              ; preds = %211
  %213 = load ptr, ptr %11, align 8
  %214 = load i32, ptr %12, align 4
  %215 = insertvalue { ptr, i32 } poison, ptr %213, 0
  %216 = insertvalue { ptr, i32 } %215, i32 %214, 1
  resume { ptr, i32 } %216
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #2 align 2

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN11AdjListNode9getWeightEv(ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

; 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) #5

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #2 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)) #5

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #7 align 2

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

!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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTS5Graph", !10, i64 0, !6, i64 8}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = distinct !{!19, !16}
!20 = !{!12, !6, i64 8}
!21 = distinct !{!21, !16}
!22 = distinct !{!22, !16}
!23 = distinct !{!23, !16}


; 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_ostream" = type { ptr, %"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::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::_List_iterator" = type { ptr }
%"class.std::__cxx11::list" = type { %"class.std::__cxx11::_List_base" }
%"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<AdjListNode, std::allocator<AdjListNode>>::_List_impl" }
%"struct.std::__cxx11::_List_base<AdjListNode, std::allocator<AdjListNode>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" }
%"struct.std::__detail::_List_node_header" = type { %"struct.std::__detail::_List_node_base", i64 }
%"struct.std::__detail::_List_node_base" = type { ptr, ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [54 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5Graph19topologicalSortUtilEiPbRSt5stackIiSt5dequeIiSaIiEEE(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN11AdjListNode7getDestEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt14_List_iteratorI11AdjListNodeEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5Graph12shortestPathEi(ptr noundef nonnull align 8 dereferenceable(16) %0, i32 noundef %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::stack", align 8
  %4 = alloca %"struct.std::_List_iterator", align 8
  %5 = alloca %"struct.std::_List_iterator", align 8
  %6 = load i32, ptr %0, align 8, !tbaa !5
  %7 = sext i32 %6 to i64
  %8 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %7) #9
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %3) #10
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %9 = load i32, ptr %0, align 8, !tbaa !5
  %10 = zext i32 %9 to i64
  %11 = call ptr @llvm.stacksave.p0()
  %12 = alloca i32, i64 %10, align 16
  %13 = load i32, ptr %0, align 8, !tbaa !5
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %2
  %15 = zext nneg i32 %13 to i64
  call void @llvm.memset.p0.i64(ptr nonnull align 1 %8, i8 0, i64 %15, i1 false), !tbaa !11
  %min.iters.check = icmp ult i32 %13, 8
  br i1 %min.iters.check, label %.lr.ph.preheader53, label %vector.ph

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

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %15, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %16 = getelementptr inbounds i32, ptr %12, i64 %index
  %17 = getelementptr inbounds i8, ptr %16, i64 16
  store <4 x i32> <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, ptr %16, align 16, !tbaa !13
  store <4 x i32> <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, ptr %17, align 16, !tbaa !13
  %index.next = add nuw i64 %index, 8
  %18 = icmp eq i64 %index.next, %n.vec
  br i1 %18, label %middle.block, label %vector.body, !llvm.loop !14

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %15
  br i1 %cmp.n, label %.preheader32, label %.lr.ph.preheader53

.preheader32:                                     ; preds = %.lr.ph, %middle.block
  br i1 %14, label %.lr.ph35, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph.preheader53, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader53 ]
  %19 = getelementptr inbounds i32, ptr %12, i64 %indvars.iv
  store i32 2147483647, ptr %19, align 4, !tbaa !13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %15
  br i1 %exitcond.not, label %.preheader32, label %.lr.ph, !llvm.loop !18

._crit_edge:                                      ; preds = %32, %2, %.preheader32
  %20 = sext i32 %1 to i64
  %21 = getelementptr inbounds i32, ptr %12, i64 %20
  store i32 0, ptr %21, align 4, !tbaa !13
  %22 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %22, label %._crit_edge41, label %.lr.ph40

.lr.ph40:                                         ; preds = %._crit_edge
  %23 = getelementptr inbounds i8, ptr %0, i64 8
  br label %36

.lr.ph35:                                         ; preds = %.preheader32, %32
  %24 = phi i32 [ %33, %32 ], [ %13, %.preheader32 ]
  %indvars.iv46 = phi i64 [ %indvars.iv.next47, %32 ], [ 0, %.preheader32 ]
  %25 = getelementptr inbounds i8, ptr %8, i64 %indvars.iv46
  %26 = load i8, ptr %25, align 1, !tbaa !11, !range !19, !noundef !20
  %27 = trunc nuw i8 %26 to i1
  br i1 %27, label %32, label %28

28:                                               ; preds = %.lr.ph35
  %29 = trunc nuw nsw i64 %indvars.iv46 to i32
  invoke void @_ZN5Graph19topologicalSortUtilEiPbRSt5stackIiSt5dequeIiSaIiEEE(ptr noundef nonnull align 8 dereferenceable(16) %0, i32 noundef %29, ptr noundef nonnull %8, ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %._crit_edge52 unwind label %30

._crit_edge52:                                    ; preds = %28
  %.pre = load i32, ptr %0, align 8, !tbaa !5
  br label %32

30:                                               ; preds = %28
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %109

32:                                               ; preds = %._crit_edge52, %.lr.ph35
  %33 = phi i32 [ %.pre, %._crit_edge52 ], [ %24, %.lr.ph35 ]
  %indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1
  %34 = sext i32 %33 to i64
  %35 = icmp slt i64 %indvars.iv.next47, %34
  br i1 %35, label %.lr.ph35, label %._crit_edge, !llvm.loop !21

36:                                               ; preds = %.lr.ph40, %76
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %38 = load i32, ptr %37, align 4, !tbaa !13
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds i32, ptr %12, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !13
  %.not = icmp eq i32 %41, 2147483647
  br i1 %.not, label %76, label %42

42:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #10
  %43 = load ptr, ptr %23, align 8, !tbaa !22
  %44 = getelementptr inbounds %"class.std::__cxx11::list", ptr %43, i64 %39
  %45 = call ptr @_ZNSt7__cxx114listI11AdjListNodeSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %44) #10
  store ptr %45, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #10
  %46 = load ptr, ptr %23, align 8, !tbaa !22
  %47 = getelementptr inbounds %"class.std::__cxx11::list", ptr %46, i64 %39
  %48 = call ptr @_ZNSt7__cxx114listI11AdjListNodeSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %47) #10
  store ptr %48, ptr %5, align 8
  %49 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorI11AdjListNodeES3_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #10
  br i1 %49, label %.lr.ph37, label %._crit_edge38

._crit_edge38:                                    ; preds = %70, %42
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #10
  br label %76

50:                                               ; preds = %83, %81, %79, %._crit_edge41
  %51 = landingpad { ptr, i32 }
          cleanup
  br label %109

.lr.ph37:                                         ; preds = %42, %70
  %52 = call noundef ptr @_ZNKSt14_List_iteratorI11AdjListNodeEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #10
  %53 = call noundef i32 @_ZN11AdjListNode7getDestEv(ptr noundef nonnull align 4 dereferenceable(8) %52)
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds i32, ptr %12, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !13
  %57 = load i32, ptr %40, align 4, !tbaa !13
  %58 = call noundef ptr @_ZNKSt14_List_iteratorI11AdjListNodeEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #10
  %59 = call noundef i32 @_ZN11AdjListNode9getWeightEv(ptr noundef nonnull align 4 dereferenceable(8) %58)
  %60 = add nsw i32 %59, %57
  %61 = icmp sgt i32 %56, %60
  br i1 %61, label %62, label %70

62:                                               ; preds = %.lr.ph37
  %63 = call noundef ptr @_ZNKSt14_List_iteratorI11AdjListNodeEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #10
  %64 = call noundef i32 @_ZN11AdjListNode9getWeightEv(ptr noundef nonnull align 4 dereferenceable(8) %63)
  %65 = add nsw i32 %64, %57
  %66 = call noundef ptr @_ZNKSt14_List_iteratorI11AdjListNodeEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #10
  %67 = call noundef i32 @_ZN11AdjListNode7getDestEv(ptr noundef nonnull align 4 dereferenceable(8) %66)
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds i32, ptr %12, i64 %68
  store i32 %65, ptr %69, align 4, !tbaa !13
  br label %70

70:                                               ; preds = %.lr.ph37, %62
  %71 = call ptr @_ZNSt14_List_iteratorI11AdjListNodeEppEi(ptr noundef nonnull align 8 dereferenceable(8) %4, i32 noundef 0) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #10
  %72 = load ptr, ptr %23, align 8, !tbaa !22
  %73 = getelementptr inbounds %"class.std::__cxx11::list", ptr %72, i64 %39
  %74 = call ptr @_ZNSt7__cxx114listI11AdjListNodeSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %73) #10
  store ptr %74, ptr %5, align 8
  %75 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorI11AdjListNodeES3_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #10
  br i1 %75, label %.lr.ph37, label %._crit_edge38, !llvm.loop !23

76:                                               ; preds = %._crit_edge38, %36
  %77 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %77, label %._crit_edge41, label %36, !llvm.loop !24

._crit_edge41:                                    ; preds = %76, %._crit_edge
  %78 = 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)
          to label %79 unwind label %50

79:                                               ; preds = %._crit_edge41
  %80 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %78, i32 noundef %1)
          to label %81 unwind label %50

81:                                               ; preds = %79
  %82 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %80, ptr noundef nonnull @.str.1)
          to label %83 unwind label %50

83:                                               ; preds = %81
  %84 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %82, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %.preheader unwind label %50

.preheader:                                       ; preds = %83
  %85 = load i32, ptr %0, align 8, !tbaa !5
  %86 = icmp sgt i32 %85, 0
  br i1 %86, label %.lr.ph43, label %._crit_edge44

._crit_edge44:                                    ; preds = %103, %.preheader
  call void @llvm.stackrestore.p0(ptr %11)
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #10
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #10
  ret void

.lr.ph43:                                         ; preds = %.preheader, %103
  %indvars.iv49 = phi i64 [ %indvars.iv.next50, %103 ], [ 0, %.preheader ]
  %87 = getelementptr inbounds i32, ptr %12, i64 %indvars.iv49
  %88 = load i32, ptr %87, align 4, !tbaa !13
  %89 = icmp eq i32 %88, 2147483647
  %90 = trunc nuw nsw i64 %indvars.iv49 to i32
  br i1 %89, label %91, label %95

91:                                               ; preds = %.lr.ph43
  %92 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %90)
          to label %93 unwind label %107

93:                                               ; preds = %91
  %94 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %92, ptr noundef nonnull @.str.2)
          to label %.invoke unwind label %107

95:                                               ; preds = %.lr.ph43
  %96 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %90)
          to label %97 unwind label %107

97:                                               ; preds = %95
  %98 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %96, ptr noundef nonnull @.str.3)
          to label %99 unwind label %107

99:                                               ; preds = %97
  %100 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %98, i32 noundef %88)
          to label %.invoke unwind label %107

.invoke:                                          ; preds = %99, %93
  %101 = phi ptr [ %94, %93 ], [ %100, %99 ]
  %102 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %101, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %103 unwind label %107

103:                                              ; preds = %.invoke
  %indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1
  %104 = load i32, ptr %0, align 8, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = icmp slt i64 %indvars.iv.next50, %105
  br i1 %106, label %.lr.ph43, label %._crit_edge44, !llvm.loop !25

107:                                              ; preds = %.invoke, %99, %97, %95, %93, %91
  %108 = landingpad { ptr, i32 }
          cleanup
  br label %109

109:                                              ; preds = %107, %50, %30
  %.pn = phi { ptr, i32 } [ %31, %30 ], [ %108, %107 ], [ %51, %50 ]
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #10
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #10
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN11AdjListNode9getWeightEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3 align 2

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

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

; 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 #2 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)) #5

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #7 align 2

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

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


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