; LLVM IR from UtkarshPathrabe/Competitive-Coding :: Model Algorithms/Graphs/Longest Path In a Directed Graph.ll (ZN5Graph11longestPathEi)

; 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 [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 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 void @_ZNSt14_List_iteratorI11AdjListNodeEC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

; 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 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 @_ZN5Graph11longestPathEi(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 %"class.std::stack", align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %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 %"struct.std::_List_iterator", align 8
  %18 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %19 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 80, ptr %5) #9
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  %20 = getelementptr inbounds %class.Graph, ptr %19, i32 0, i32 0
  %21 = load i32, ptr %20, align 8, !tbaa !11
  %22 = zext i32 %21 to i64
  %23 = call ptr @llvm.stacksave.p0()
  store ptr %23, ptr %6, align 8
  %24 = alloca i32, i64 %22, align 16
  store i64 %22, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #9
  %25 = getelementptr inbounds %class.Graph, ptr %19, i32 0, i32 0
  %26 = load i32, ptr %25, align 8, !tbaa !11
  %27 = sext i32 %26 to i64
  %28 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %27) #10
          to label %29 unwind label %36

29:                                               ; preds = %2
  store ptr %28, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #9
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %30

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

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

36:                                               ; preds = %81, %2
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %9, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %10, align 4
  br label %193

40:                                               ; preds = %30
  %41 = load ptr, ptr %8, align 8, !tbaa !5
  %42 = load i32, ptr %11, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds i8, ptr %41, i64 %43
  store i8 0, ptr %44, align 1, !tbaa !13
  %45 = load i32, ptr %11, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds i32, ptr %24, i64 %46
  store i32 -2147483648, ptr %47, align 4, !tbaa !9
  br label %48

48:                                               ; preds = %40
  %49 = load i32, ptr %11, align 4, !tbaa !9
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %11, align 4, !tbaa !9
  br label %30, !llvm.loop !15

51:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #9
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %52

52:                                               ; preds = %74, %51
  %53 = load i32, ptr %12, align 4, !tbaa !9
  %54 = getelementptr inbounds %class.Graph, ptr %19, i32 0, i32 0
  %55 = load i32, ptr %54, align 8, !tbaa !11
  %56 = icmp slt i32 %53, %55
  br i1 %56, label %58, label %57

57:                                               ; preds = %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  br label %77

58:                                               ; preds = %52
  %59 = load ptr, ptr %8, align 8, !tbaa !5
  %60 = load i32, ptr %12, align 4, !tbaa !9
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds i8, ptr %59, i64 %61
  %63 = load i8, ptr %62, align 1, !tbaa !13, !range !17, !noundef !18
  %64 = trunc i8 %63 to i1
  br i1 %64, label %73, label %65

65:                                               ; preds = %58
  %66 = load i32, ptr %12, align 4, !tbaa !9
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  invoke void @_ZN5Graph19topologicalSortUtilEiPbRSt5stackIiSt5dequeIiSaIiEEE(ptr noundef nonnull align 8 dereferenceable(16) %19, i32 noundef %66, ptr noundef %67, ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %68 unwind label %69

68:                                               ; preds = %65
  br label %73

69:                                               ; preds = %65
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %9, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  br label %193

73:                                               ; preds = %68, %58
  br label %74

74:                                               ; preds = %73
  %75 = load i32, ptr %12, align 4, !tbaa !9
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %12, align 4, !tbaa !9
  br label %52, !llvm.loop !19

77:                                               ; preds = %57
  %78 = load i32, ptr %4, align 4, !tbaa !9
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds i32, ptr %24, i64 %79
  store i32 0, ptr %80, align 4, !tbaa !9
  br label %81

81:                                               ; preds = %155, %77
  %82 = invoke noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %83 unwind label %36

83:                                               ; preds = %81
  %84 = xor i1 %82, true
  br i1 %84, label %85, label %157

85:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  %86 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %87 unwind label %142

87:                                               ; preds = %85
  %88 = load i32, ptr %86, align 4, !tbaa !9
  store i32 %88, ptr %13, align 4, !tbaa !9
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %89 unwind label %142

89:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #9
  call void @_ZNSt14_List_iteratorI11AdjListNodeEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #9
  %90 = load i32, ptr %13, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds i32, ptr %24, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !9
  %94 = icmp ne i32 %93, -2147483648
  br i1 %94, label %95, label %155

95:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #9
  %96 = getelementptr inbounds %class.Graph, ptr %19, i32 0, i32 1
  %97 = load ptr, ptr %96, align 8, !tbaa !20
  %98 = load i32, ptr %13, align 4, !tbaa !9
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds %"class.std::__cxx11::list", ptr %97, i64 %99
  %101 = call ptr @_ZNSt7__cxx114listI11AdjListNodeSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %100) #9
  %102 = getelementptr inbounds %"struct.std::_List_iterator", ptr %15, i32 0, i32 0
  store ptr %101, ptr %102, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 8 %15, i64 8, i1 false), !tbaa.struct !21
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  br label %103

103:                                              ; preds = %151, %95
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #9
  %104 = getelementptr inbounds %class.Graph, ptr %19, i32 0, i32 1
  %105 = load ptr, ptr %104, align 8, !tbaa !20
  %106 = load i32, ptr %13, align 4, !tbaa !9
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds %"class.std::__cxx11::list", ptr %105, i64 %107
  %109 = call ptr @_ZNSt7__cxx114listI11AdjListNodeSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %108) #9
  %110 = getelementptr inbounds %"struct.std::_List_iterator", ptr %16, i32 0, i32 0
  store ptr %109, ptr %110, align 8
  %111 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorI11AdjListNodeES3_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %16) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #9
  br i1 %111, label %112, label %154

112:                                              ; preds = %103
  %113 = call noundef ptr @_ZNKSt14_List_iteratorI11AdjListNodeEptEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #9
  %114 = invoke noundef i32 @_ZN11AdjListNode7getDestEv(ptr noundef nonnull align 4 dereferenceable(8) %113)
          to label %115 unwind label %146

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

125:                                              ; preds = %115
  %126 = add nsw i32 %122, %124
  %127 = icmp slt i32 %118, %126
  br i1 %127, label %128, label %150

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

135:                                              ; preds = %128
  %136 = add nsw i32 %132, %134
  %137 = call noundef ptr @_ZNKSt14_List_iteratorI11AdjListNodeEptEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #9
  %138 = invoke noundef i32 @_ZN11AdjListNode7getDestEv(ptr noundef nonnull align 4 dereferenceable(8) %137)
          to label %139 unwind label %146

139:                                              ; preds = %135
  %140 = sext i32 %138 to i64
  %141 = getelementptr inbounds i32, ptr %24, i64 %140
  store i32 %136, ptr %141, align 4, !tbaa !9
  br label %150

142:                                              ; preds = %87, %85
  %143 = landingpad { ptr, i32 }
          cleanup
  %144 = extractvalue { ptr, i32 } %143, 0
  store ptr %144, ptr %9, align 8
  %145 = extractvalue { ptr, i32 } %143, 1
  store i32 %145, ptr %10, align 4
  br label %156

146:                                              ; preds = %135, %128, %115, %112
  %147 = landingpad { ptr, i32 }
          cleanup
  %148 = extractvalue { ptr, i32 } %147, 0
  store ptr %148, ptr %9, align 8
  %149 = extractvalue { ptr, i32 } %147, 1
  store i32 %149, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #9
  br label %156

150:                                              ; preds = %139, %125
  br label %151

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

154:                                              ; preds = %103
  br label %155

155:                                              ; preds = %154, %89
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  br label %81, !llvm.loop !23

156:                                              ; preds = %146, %142
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  br label %193

157:                                              ; preds = %83
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #9
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %158

158:                                              ; preds = %184, %157
  %159 = load i32, ptr %18, align 4, !tbaa !9
  %160 = getelementptr inbounds %class.Graph, ptr %19, i32 0, i32 0
  %161 = load i32, ptr %160, align 8, !tbaa !11
  %162 = icmp slt i32 %159, %161
  br i1 %162, label %164, label %163

163:                                              ; preds = %158
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #9
  br label %191

164:                                              ; preds = %158
  %165 = load i32, ptr %18, align 4, !tbaa !9
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds i32, ptr %24, i64 %166
  %168 = load i32, ptr %167, align 4, !tbaa !9
  %169 = icmp eq i32 %168, -2147483648
  br i1 %169, label %170, label %173

170:                                              ; preds = %164
  %171 = 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 %172 unwind label %187

172:                                              ; preds = %170
  br label %182

173:                                              ; preds = %164
  %174 = load i32, ptr %18, align 4, !tbaa !9
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds i32, ptr %24, i64 %175
  %177 = load i32, ptr %176, align 4, !tbaa !9
  %178 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %177)
          to label %179 unwind label %187

179:                                              ; preds = %173
  %180 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %178, ptr noundef @.str.1)
          to label %181 unwind label %187

181:                                              ; preds = %179
  br label %182

182:                                              ; preds = %181, %172
  %183 = phi ptr [ %171, %172 ], [ %180, %181 ]
  br label %184

184:                                              ; preds = %182
  %185 = load i32, ptr %18, align 4, !tbaa !9
  %186 = add nsw i32 %185, 1
  store i32 %186, ptr %18, align 4, !tbaa !9
  br label %158, !llvm.loop !24

187:                                              ; preds = %179, %173, %170
  %188 = landingpad { ptr, i32 }
          cleanup
  %189 = extractvalue { ptr, i32 } %188, 0
  store ptr %189, ptr %9, align 8
  %190 = extractvalue { ptr, i32 } %188, 1
  store i32 %190, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #9
  br label %193

191:                                              ; preds = %163
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #9
  %192 = load ptr, ptr %6, align 8
  call void @llvm.stackrestore.p0(ptr %192)
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #9
  call void @llvm.lifetime.end.p0(i64 80, ptr %5) #9
  ret void

193:                                              ; preds = %187, %156, %69, %36
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #9
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #9
  call void @llvm.lifetime.end.p0(i64 80, ptr %5) #9
  br label %194

194:                                              ; preds = %193
  %195 = load ptr, ptr %9, align 8
  %196 = load i32, ptr %10, align 4
  %197 = insertvalue { ptr, i32 } poison, ptr %195, 0
  %198 = insertvalue { ptr, i32 } %197, i32 %196, 1
  resume { ptr, i32 } %198
}

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

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 ptr @_ZNKSt14_List_iteratorI11AdjListNodeEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #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) #6

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #8 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 nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nocallback nofree nosync nounwind willreturn }
attributes #6 = { 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 #7 = { "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 = { 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 #9 = { nounwind }
attributes #10 = { 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 = !{i64 0, i64 8, !5}
!22 = distinct !{!22, !16}
!23 = distinct !{!23, !16}
!24 = distinct !{!24, !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 [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 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 void @_ZNSt14_List_iteratorI11AdjListNodeEC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 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 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 @_ZN5Graph11longestPathEi(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
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %3) #9
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %6 = load i32, ptr %0, align 8, !tbaa !5
  %7 = zext i32 %6 to i64
  %8 = call ptr @llvm.stacksave.p0()
  %9 = alloca i32, i64 %7, align 16
  %10 = load i32, ptr %0, align 8, !tbaa !5
  %11 = sext i32 %10 to i64
  %12 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %11) #10
          to label %.preheader32 unwind label %18

.preheader32:                                     ; preds = %2
  %13 = icmp sgt i32 %10, 0
  br i1 %13, label %.lr.ph.preheader, label %._crit_edge

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

.lr.ph.preheader51:                               ; 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 %14, 2147483640
  br label %vector.body

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

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %14
  br i1 %cmp.n, label %.preheader31, label %.lr.ph.preheader51

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

18:                                               ; preds = %2
  %19 = landingpad { ptr, i32 }
          cleanup
  br label %92

.lr.ph:                                           ; preds = %.lr.ph.preheader51, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader51 ]
  %20 = getelementptr inbounds i32, ptr %9, i64 %indvars.iv
  store i32 -2147483648, ptr %20, align 4, !tbaa !13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %14
  br i1 %exitcond.not, label %.preheader31, label %.lr.ph, !llvm.loop !18

._crit_edge:                                      ; preds = %33, %.preheader32, %.preheader31
  %21 = sext i32 %1 to i64
  %22 = getelementptr inbounds i32, ptr %9, i64 %21
  store i32 0, ptr %22, align 4, !tbaa !13
  %23 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %23, label %.preheader, label %.lr.ph39

.lr.ph39:                                         ; preds = %._crit_edge
  %24 = getelementptr inbounds i8, ptr %0, i64 8
  br label %39

.lr.ph35:                                         ; preds = %.preheader31, %33
  %25 = phi i32 [ %34, %33 ], [ %10, %.preheader31 ]
  %indvars.iv44 = phi i64 [ %indvars.iv.next45, %33 ], [ 0, %.preheader31 ]
  %26 = getelementptr inbounds i8, ptr %12, i64 %indvars.iv44
  %27 = load i8, ptr %26, align 1, !tbaa !11, !range !19, !noundef !20
  %28 = trunc nuw i8 %27 to i1
  br i1 %28, label %33, label %29

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

._crit_edge50:                                    ; preds = %29
  %.pre = load i32, ptr %0, align 8, !tbaa !5
  br label %33

31:                                               ; preds = %29
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %92

33:                                               ; preds = %._crit_edge50, %.lr.ph35
  %34 = phi i32 [ %.pre, %._crit_edge50 ], [ %25, %.lr.ph35 ]
  %indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1
  %35 = sext i32 %34 to i64
  %36 = icmp slt i64 %indvars.iv.next45, %35
  br i1 %36, label %.lr.ph35, label %._crit_edge, !llvm.loop !21

.preheader:                                       ; preds = %.loopexit, %._crit_edge
  %37 = load i32, ptr %0, align 8, !tbaa !5
  %38 = icmp sgt i32 %37, 0
  br i1 %38, label %.lr.ph41, label %._crit_edge42

39:                                               ; preds = %.lr.ph39, %.loopexit
  %40 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %41 = load i32, ptr %40, align 4, !tbaa !13
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  call void @_ZNSt14_List_iteratorI11AdjListNodeEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #9
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds i32, ptr %9, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !13
  %.not = icmp eq i32 %44, -2147483648
  br i1 %.not, label %.loopexit, label %45

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

.lr.ph37:                                         ; preds = %45, %71
  %53 = call noundef ptr @_ZNKSt14_List_iteratorI11AdjListNodeEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #9
  %54 = call noundef i32 @_ZN11AdjListNode7getDestEv(ptr noundef nonnull align 4 dereferenceable(8) %53)
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds i32, ptr %9, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !13
  %58 = load i32, ptr %43, align 4, !tbaa !13
  %59 = call noundef ptr @_ZNKSt14_List_iteratorI11AdjListNodeEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #9
  %60 = call noundef i32 @_ZN11AdjListNode9getWeightEv(ptr noundef nonnull align 4 dereferenceable(8) %59)
  %61 = add nsw i32 %60, %58
  %62 = icmp slt i32 %57, %61
  br i1 %62, label %63, label %71

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

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

.loopexit:                                        ; preds = %71, %45, %39
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  %77 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %77, label %.preheader, label %39, !llvm.loop !25

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

.lr.ph41:                                         ; preds = %.preheader, %86
  %indvars.iv47 = phi i64 [ %indvars.iv.next48, %86 ], [ 0, %.preheader ]
  %78 = getelementptr inbounds i32, ptr %9, i64 %indvars.iv47
  %79 = load i32, ptr %78, align 4, !tbaa !13
  %80 = icmp eq i32 %79, -2147483648
  br i1 %80, label %.invoke, label %81

81:                                               ; preds = %.lr.ph41
  %82 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %79)
          to label %.invoke unwind label %90

.invoke:                                          ; preds = %81, %.lr.ph41
  %83 = phi ptr [ @_ZSt4cout, %.lr.ph41 ], [ %82, %81 ]
  %84 = phi ptr [ @.str, %.lr.ph41 ], [ @.str.1, %81 ]
  %85 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %83, ptr noundef nonnull %84)
          to label %86 unwind label %90

86:                                               ; preds = %.invoke
  %indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1
  %87 = load i32, ptr %0, align 8, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = icmp slt i64 %indvars.iv.next48, %88
  br i1 %89, label %.lr.ph41, label %._crit_edge42, !llvm.loop !26

90:                                               ; preds = %.invoke, %81
  %91 = landingpad { ptr, i32 }
          cleanup
  br label %92

92:                                               ; preds = %90, %31, %18
  %.pn = phi { ptr, i32 } [ %32, %31 ], [ %91, %90 ], [ %19, %18 ]
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #9
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #9
  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 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 @_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 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 = { nounwind }
attributes #10 = { 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, !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 = !{!10, !10, i64 0}
!24 = distinct !{!24, !15}
!25 = distinct !{!25, !15}
!26 = distinct !{!26, !15}


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