; LLVM IR from UtkarshPathrabe/Competitive-Coding :: Stanford Competetive Programming/TDBFS.ll (Z3BFSi)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Nodes, std::allocator<Nodes>>::_Vector_impl" }
%"struct.std::_Vector_base<Nodes, std::allocator<Nodes>>::_Vector_impl" = type { %"struct.std::_Vector_base<Nodes, std::allocator<Nodes>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Nodes, std::allocator<Nodes>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<Edges, std::allocator<Edges>>::_Vector_impl" }
%"struct.std::_Vector_base<Edges, std::allocator<Edges>>::_Vector_impl" = type { %"struct.std::_Vector_base<Edges, std::allocator<Edges>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Edges, std::allocator<Edges>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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::__cxx11::list" = type { %"class.std::__cxx11::_List_base" }
%"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<int, std::allocator<int>>::_List_impl" }
%"struct.std::__cxx11::_List_base<int, std::allocator<int>>::_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 }
%struct.Nodes = type { i8, i32 }
%struct.Edges = type { i32, i32 }

@Node = external dso_local global %"class.std::vector", align 8
@Edge = external dso_local global %"class.std::vector.0", align 8
@n = external dso_local global i32, align 4
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3BFSi(i32 noundef %0) #0 personality ptr @__gxx_personality_v0 {
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::__cxx11::list", align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #5
  call void @_ZNSt7__cxx114listIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %8 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI5NodesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Node, i64 noundef 0) #5
  %9 = getelementptr inbounds %struct.Nodes, ptr %8, i32 0, i32 0
  store i8 1, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %10

10:                                               ; preds = %20, %1
  %11 = load i32, ptr %4, align 4, !tbaa !5
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %13 = icmp sle i32 %11, %12
  br i1 %13, label %15, label %14

14:                                               ; preds = %10
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %23

15:                                               ; preds = %10
  %16 = load i32, ptr %4, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI5NodesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Node, i64 noundef %17) #5
  %19 = getelementptr inbounds %struct.Nodes, ptr %18, i32 0, i32 0
  store i8 0, ptr %19, align 4, !tbaa !9
  br label %20

20:                                               ; preds = %15
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = add nsw i32 %21, 1
  store i32 %22, ptr %4, align 4, !tbaa !5
  br label %10, !llvm.loop !12

23:                                               ; preds = %14
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI5NodesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Node, i64 noundef %25) #5
  %27 = getelementptr inbounds %struct.Nodes, ptr %26, i32 0, i32 0
  store i8 1, ptr %27, align 4, !tbaa !9
  invoke void @_ZNSt7__cxx114listIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %28 unwind label %49

28:                                               ; preds = %23
  br label %29

29:                                               ; preds = %89, %28
  %30 = call noundef zeroext i1 @_ZNKSt7__cxx114listIiSaIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %31 = xor i1 %30, true
  br i1 %31, label %32, label %90

32:                                               ; preds = %29
  %33 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt7__cxx114listIiSaIiEE5frontEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %34 = load i32, ptr %33, align 4, !tbaa !5
  store i32 %34, ptr %2, align 4, !tbaa !5
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %35)
          to label %37 unwind label %49

37:                                               ; preds = %32
  %38 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %36, ptr noundef @.str)
          to label %39 unwind label %49

39:                                               ; preds = %37
  call void @_ZNSt7__cxx114listIiSaIiEE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI5NodesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Node, i64 noundef %41) #5
  %43 = getelementptr inbounds %struct.Nodes, ptr %42, i32 0, i32 1
  %44 = load i32, ptr %43, align 4, !tbaa !14
  store i32 %44, ptr %7, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %83, %39
  %46 = load i32, ptr %7, align 4, !tbaa !5
  %47 = icmp ne i32 %46, -1
  br i1 %47, label %53, label %48

48:                                               ; preds = %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %89

49:                                               ; preds = %37, %32, %23
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %5, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %6, align 4
  br label %91

53:                                               ; preds = %45
  %54 = load i32, ptr %7, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI5EdgesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Edge, i64 noundef %55) #5
  %57 = getelementptr inbounds %struct.Edges, ptr %56, i32 0, i32 0
  %58 = load i32, ptr %57, align 4, !tbaa !15
  %59 = sext i32 %58 to i64
  %60 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI5NodesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Node, i64 noundef %59) #5
  %61 = getelementptr inbounds %struct.Nodes, ptr %60, i32 0, i32 0
  %62 = load i8, ptr %61, align 4, !tbaa !9, !range !17, !noundef !18
  %63 = trunc i8 %62 to i1
  br i1 %63, label %82, label %64

64:                                               ; preds = %53
  %65 = load i32, ptr %7, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI5EdgesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Edge, i64 noundef %66) #5
  %68 = getelementptr inbounds %struct.Edges, ptr %67, i32 0, i32 0
  %69 = load i32, ptr %68, align 4, !tbaa !15
  %70 = sext i32 %69 to i64
  %71 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI5NodesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Node, i64 noundef %70) #5
  %72 = getelementptr inbounds %struct.Nodes, ptr %71, i32 0, i32 0
  store i8 1, ptr %72, align 4, !tbaa !9
  %73 = load i32, ptr %7, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI5EdgesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Edge, i64 noundef %74) #5
  %76 = getelementptr inbounds %struct.Edges, ptr %75, i32 0, i32 0
  invoke void @_ZNSt7__cxx114listIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(4) %76)
          to label %77 unwind label %78

77:                                               ; preds = %64
  br label %82

78:                                               ; preds = %64
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %5, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %91

82:                                               ; preds = %77, %53
  br label %83

83:                                               ; preds = %82
  %84 = load i32, ptr %7, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI5EdgesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Edge, i64 noundef %85) #5
  %87 = getelementptr inbounds %struct.Edges, ptr %86, i32 0, i32 1
  %88 = load i32, ptr %87, align 4, !tbaa !19
  store i32 %88, ptr %7, align 4, !tbaa !5
  br label %45, !llvm.loop !20

89:                                               ; preds = %48
  br label %29, !llvm.loop !21

90:                                               ; preds = %29
  call void @_ZNSt7__cxx1110_List_baseIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  ret void

91:                                               ; preds = %78, %49
  call void @_ZNSt7__cxx1110_List_baseIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  br label %92

92:                                               ; preds = %91
  %93 = load ptr, ptr %5, align 8
  %94 = load i32, ptr %6, align 4
  %95 = insertvalue { ptr, i32 } poison, ptr %93, 0
  %96 = insertvalue { ptr, i32 } %95, i32 %94, 1
  resume { ptr, i32 } %96
}

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

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

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

; 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 @_ZNSt7__cxx114listIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #0 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt7__cxx114listIiSaIiEE5frontEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 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) #3

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

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

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

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

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

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

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


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Nodes, std::allocator<Nodes>>::_Vector_impl" }
%"struct.std::_Vector_base<Nodes, std::allocator<Nodes>>::_Vector_impl" = type { %"struct.std::_Vector_base<Nodes, std::allocator<Nodes>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Nodes, std::allocator<Nodes>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<Edges, std::allocator<Edges>>::_Vector_impl" }
%"struct.std::_Vector_base<Edges, std::allocator<Edges>>::_Vector_impl" = type { %"struct.std::_Vector_base<Edges, std::allocator<Edges>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Edges, std::allocator<Edges>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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::__cxx11::list" = type { %"class.std::__cxx11::_List_base" }
%"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<int, std::allocator<int>>::_List_impl" }
%"struct.std::__cxx11::_List_base<int, std::allocator<int>>::_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 }

@Node = external dso_local global %"class.std::vector", align 8
@Edge = external dso_local global %"class.std::vector.0", align 8
@n = external dso_local local_unnamed_addr global i32, align 4
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3BFSi(i32 noundef %0) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::__cxx11::list", align 8
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #5
  call void @_ZNSt7__cxx114listIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %4 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI5NodesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Node, i64 noundef 0) #5
  store i8 1, ptr %4, align 4, !tbaa !9
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %.not16 = icmp slt i32 %5, 1
  br i1 %.not16, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %1
  %6 = sext i32 %0 to i64
  %7 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI5NodesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Node, i64 noundef %6) #5
  store i8 1, ptr %7, align 4, !tbaa !9
  invoke void @_ZNSt7__cxx114listIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %.preheader unwind label %.loopexit.split-lp

.preheader:                                       ; preds = %._crit_edge
  %8 = call noundef zeroext i1 @_ZNKSt7__cxx114listIiSaIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  br i1 %8, label %._crit_edge25, label %.lr.ph24

.lr.ph:                                           ; preds = %1, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %1 ]
  %9 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI5NodesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Node, i64 noundef %indvars.iv) #5
  store i8 0, ptr %9, align 4, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %10 = load i32, ptr @n, align 4, !tbaa !5
  %11 = sext i32 %10 to i64
  %.not.not = icmp slt i64 %indvars.iv, %11
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !12

.loopexit:                                        ; preds = %37, %18
  %12 = call noundef zeroext i1 @_ZNKSt7__cxx114listIiSaIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  br i1 %12, label %._crit_edge25, label %.lr.ph24, !llvm.loop !14

.lr.ph24:                                         ; preds = %.preheader, %.loopexit
  %13 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt7__cxx114listIiSaIiEE5frontEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %14 = load i32, ptr %13, align 4, !tbaa !5
  store i32 %14, ptr %2, align 4, !tbaa !5
  %15 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %14)
          to label %16 unwind label %.loopexit15

16:                                               ; preds = %.lr.ph24
  %17 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull @.str)
          to label %18 unwind label %.loopexit15

18:                                               ; preds = %16
  call void @_ZNSt7__cxx114listIiSaIiEE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI5NodesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Node, i64 noundef %20) #5
  %.0.in18 = getelementptr inbounds i8, ptr %21, i64 4
  %.019 = load i32, ptr %.0.in18, align 4, !tbaa !5
  %.not1220 = icmp eq i32 %.019, -1
  br i1 %.not1220, label %.loopexit, label %.lr.ph23

.loopexit15:                                      ; preds = %.lr.ph24, %16
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %39

.loopexit.split-lp:                               ; preds = %._crit_edge
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %39

.lr.ph23:                                         ; preds = %18, %37
  %.021 = phi i32 [ %.0, %37 ], [ %.019, %18 ]
  %22 = sext i32 %.021 to i64
  %23 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI5EdgesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Edge, i64 noundef %22) #5
  %24 = load i32, ptr %23, align 4, !tbaa !15
  %25 = sext i32 %24 to i64
  %26 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI5NodesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Node, i64 noundef %25) #5
  %27 = load i8, ptr %26, align 4, !tbaa !9, !range !17, !noundef !18
  %28 = trunc nuw i8 %27 to i1
  br i1 %28, label %37, label %29

29:                                               ; preds = %.lr.ph23
  %30 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI5EdgesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Edge, i64 noundef %22) #5
  %31 = load i32, ptr %30, align 4, !tbaa !15
  %32 = sext i32 %31 to i64
  %33 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI5NodesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Node, i64 noundef %32) #5
  store i8 1, ptr %33, align 4, !tbaa !9
  %34 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI5EdgesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Edge, i64 noundef %22) #5
  invoke void @_ZNSt7__cxx114listIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(4) %34)
          to label %37 unwind label %35

35:                                               ; preds = %29
  %36 = landingpad { ptr, i32 }
          cleanup
  br label %39

37:                                               ; preds = %.lr.ph23, %29
  %38 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI5EdgesSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @Edge, i64 noundef %22) #5
  %.0.in = getelementptr inbounds i8, ptr %38, i64 4
  %.0 = load i32, ptr %.0.in, align 4, !tbaa !5
  %.not12 = icmp eq i32 %.0, -1
  br i1 %.not12, label %.loopexit, label %.lr.ph23, !llvm.loop !19

._crit_edge25:                                    ; preds = %.loopexit, %.preheader
  call void @_ZNSt7__cxx1110_List_baseIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  ret void

39:                                               ; preds = %.loopexit15, %.loopexit.split-lp, %35
  %.pn = phi { ptr, i32 } [ %36, %35 ], [ %lpad.loopexit, %.loopexit15 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZNSt7__cxx1110_List_baseIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  resume { ptr, i32 } %.pn
}

; 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 nounwind uwtable
declare dso_local void @_ZNSt7__cxx114listIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

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

; 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 @_ZNSt7__cxx114listIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt7__cxx114listIiSaIiEE5frontEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 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 #3

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

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

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

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

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

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

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass