; LLVM IR from NervanaSystems/ngraph :: src/ngraph/pass/memory_layout.ll (ZN6ngraph4pass13MemoryManager9first_fitEm)

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

%"struct.std::_List_iterator" = type { ptr }
%"struct.std::_List_const_iterator" = type { ptr }
%"class.ngraph::pass::MemoryManager::node" = type <{ i64, i32, [4 x i8] }>
%"class.ngraph::pass::MemoryManager" = type { %"class.std::__cxx11::list", i64, i32, i64 }
%"class.std::__cxx11::list" = type { %"class.std::__cxx11::_List_base" }
%"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<ngraph::pass::MemoryManager::node, std::allocator<ngraph::pass::MemoryManager::node>>::_List_impl" }
%"struct.std::__cxx11::_List_base<ngraph::pass::MemoryManager::node, std::allocator<ngraph::pass::MemoryManager::node>>::_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 }

@_ZTISt9bad_alloc = external constant ptr

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

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

declare ptr @__cxa_allocate_exception(i64)

declare void @__cxa_throw(ptr, ptr, ptr)

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZN6ngraph4pass13MemoryManager9first_fitEm(ptr noundef nonnull align 8 dereferenceable(48) %0, i64 noundef %1) #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i8, align 1
  %7 = alloca %"struct.std::_List_iterator", align 8
  %8 = alloca %"struct.std::_List_iterator", align 8
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::_List_const_iterator", align 8
  %11 = alloca %"class.ngraph::pass::MemoryManager::node", align 8
  %12 = alloca %"struct.std::_List_iterator", align 8
  %13 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i64 %1, ptr %4, align 8, !tbaa !9
  %14 = load ptr, ptr %3, align 8
  %15 = load i64, ptr %4, align 8, !tbaa !9
  %16 = getelementptr inbounds %"class.ngraph::pass::MemoryManager", ptr %14, i32 0, i32 1
  %17 = load i64, ptr %16, align 8, !tbaa !11
  %18 = call noundef i64 @_ZN6ngraph4pass13MemoryManager5alignEmm(i64 noundef %15, i64 noundef %17)
  store i64 %18, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  store i64 0, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #5
  store i8 0, ptr %6, align 1, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %19 = getelementptr inbounds %"class.ngraph::pass::MemoryManager", ptr %14, i32 0, i32 0
  %20 = call ptr @_ZNSt7__cxx114listIN6ngraph4pass13MemoryManager4nodeESaIS4_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #5
  %21 = getelementptr inbounds %"struct.std::_List_iterator", ptr %7, i32 0, i32 0
  store ptr %20, ptr %21, align 8
  br label %22

22:                                               ; preds = %67, %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %23 = getelementptr inbounds %"class.ngraph::pass::MemoryManager", ptr %14, i32 0, i32 0
  %24 = call ptr @_ZNSt7__cxx114listIN6ngraph4pass13MemoryManager4nodeESaIS4_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %23) #5
  %25 = getelementptr inbounds %"struct.std::_List_iterator", ptr %8, i32 0, i32 0
  store ptr %24, ptr %25, align 8
  %26 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEES6_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br i1 %26, label %28, label %27

27:                                               ; preds = %22
  store i32 2, ptr %9, align 4
  br label %69

28:                                               ; preds = %22
  %29 = call noundef ptr @_ZNKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  %30 = getelementptr inbounds %"class.ngraph::pass::MemoryManager::node", ptr %29, i32 0, i32 1
  %31 = load i32, ptr %30, align 8, !tbaa !21
  %32 = icmp eq i32 %31, 0
  br i1 %32, label %33, label %61

33:                                               ; preds = %28
  %34 = call noundef ptr @_ZNKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  %35 = getelementptr inbounds %"class.ngraph::pass::MemoryManager::node", ptr %34, i32 0, i32 0
  %36 = load i64, ptr %35, align 8, !tbaa !24
  %37 = load i64, ptr %4, align 8, !tbaa !9
  %38 = icmp uge i64 %36, %37
  br i1 %38, label %39, label %61

39:                                               ; preds = %33
  %40 = call noundef ptr @_ZNKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  %41 = getelementptr inbounds %"class.ngraph::pass::MemoryManager::node", ptr %40, i32 0, i32 0
  %42 = load i64, ptr %41, align 8, !tbaa !24
  %43 = load i64, ptr %4, align 8, !tbaa !9
  %44 = icmp ugt i64 %42, %43
  br i1 %44, label %45, label %57

45:                                               ; preds = %39
  %46 = getelementptr inbounds %"class.ngraph::pass::MemoryManager", ptr %14, i32 0, i32 0
  call void @_ZNSt20_List_const_iteratorIN6ngraph4pass13MemoryManager4nodeEEC2ERKSt14_List_iteratorIS3_E(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #5
  %47 = load i64, ptr %4, align 8, !tbaa !9
  call void @_ZN6ngraph4pass13MemoryManager4nodeC1EmNS1_11block_stateE(ptr noundef nonnull align 8 dereferenceable(12) %11, i64 noundef %47, i32 noundef 1)
  %48 = getelementptr inbounds %"struct.std::_List_const_iterator", ptr %10, i32 0, i32 0
  %49 = load ptr, ptr %48, align 8
  %50 = call ptr @_ZNSt7__cxx114listIN6ngraph4pass13MemoryManager4nodeESaIS4_EE6insertESt20_List_const_iteratorIS4_EOS4_(ptr noundef nonnull align 8 dereferenceable(24) %46, ptr %49, ptr noundef nonnull align 8 dereferenceable(12) %11)
  %51 = getelementptr inbounds %"struct.std::_List_iterator", ptr %12, i32 0, i32 0
  store ptr %50, ptr %51, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #5
  %52 = load i64, ptr %4, align 8, !tbaa !9
  %53 = call noundef ptr @_ZNKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  %54 = getelementptr inbounds %"class.ngraph::pass::MemoryManager::node", ptr %53, i32 0, i32 0
  %55 = load i64, ptr %54, align 8, !tbaa !24
  %56 = sub i64 %55, %52
  store i64 %56, ptr %54, align 8, !tbaa !24
  br label %60

57:                                               ; preds = %39
  %58 = call noundef ptr @_ZNKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  %59 = getelementptr inbounds %"class.ngraph::pass::MemoryManager::node", ptr %58, i32 0, i32 1
  store i32 1, ptr %59, align 8, !tbaa !21
  br label %60

60:                                               ; preds = %57, %45
  store i8 1, ptr %6, align 1, !tbaa !19
  store i32 2, ptr %9, align 4
  br label %69

61:                                               ; preds = %33, %28
  %62 = call noundef ptr @_ZNKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  %63 = getelementptr inbounds %"class.ngraph::pass::MemoryManager::node", ptr %62, i32 0, i32 0
  %64 = load i64, ptr %63, align 8, !tbaa !24
  %65 = load i64, ptr %5, align 8, !tbaa !9
  %66 = add i64 %65, %64
  store i64 %66, ptr %5, align 8, !tbaa !9
  br label %67

67:                                               ; preds = %61
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  br label %22, !llvm.loop !25

69:                                               ; preds = %60, %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %70

70:                                               ; preds = %69
  %71 = load i8, ptr %6, align 1, !tbaa !19, !range !27, !noundef !28
  %72 = trunc i8 %71 to i1
  br i1 %72, label %75, label %73

73:                                               ; preds = %70
  %74 = call ptr @__cxa_allocate_exception(i64 8) #5
  call void @_ZNSt9bad_allocC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %74) #5
  call void @__cxa_throw(ptr %74, ptr @_ZTISt9bad_alloc, ptr @_ZNSt9bad_allocD1Ev) #6
  unreachable

75:                                               ; preds = %70
  %76 = getelementptr inbounds %"class.ngraph::pass::MemoryManager", ptr %14, i32 0, i32 3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %77 = load i64, ptr %5, align 8, !tbaa !9
  %78 = load i64, ptr %4, align 8, !tbaa !9
  %79 = add i64 %77, %78
  store i64 %79, ptr %13, align 8, !tbaa !9
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %76, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %81 = load i64, ptr %80, align 8, !tbaa !9
  %82 = getelementptr inbounds %"class.ngraph::pass::MemoryManager", ptr %14, i32 0, i32 3
  store i64 %81, ptr %82, align 8, !tbaa !29
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  %83 = load i64, ptr %5, align 8, !tbaa !9
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret i64 %83
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN6ngraph4pass13MemoryManager5alignEmm(i64 noundef, i64 noundef) #1 align 2

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

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

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

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

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

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

; Function Attrs: nounwind
declare void @_ZNSt9bad_allocD1Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3

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

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

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

declare void @_ZN6ngraph4pass13MemoryManager4nodeC1EmNS1_11block_stateE(ptr, i64, i32)

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

!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 = !{!"long", !7, i64 0}
!11 = !{!12, !10, i64 24}
!12 = !{!"_ZTSN6ngraph4pass13MemoryManagerE", !13, i64 0, !10, i64 24, !18, i64 32, !10, i64 40}
!13 = !{!"_ZTSNSt7__cxx114listIN6ngraph4pass13MemoryManager4nodeESaIS4_EEE", !14, i64 0}
!14 = !{!"_ZTSNSt7__cxx1110_List_baseIN6ngraph4pass13MemoryManager4nodeESaIS4_EEE", !15, i64 0}
!15 = !{!"_ZTSNSt7__cxx1110_List_baseIN6ngraph4pass13MemoryManager4nodeESaIS4_EE10_List_implE", !16, i64 0}
!16 = !{!"_ZTSNSt8__detail17_List_node_headerE", !17, i64 0, !10, i64 16}
!17 = !{!"_ZTSNSt8__detail15_List_node_baseE", !6, i64 0, !6, i64 8}
!18 = !{!"_ZTSN6ngraph4pass13MemoryManager17allocation_schemeE", !7, i64 0}
!19 = !{!20, !20, i64 0}
!20 = !{!"bool", !7, i64 0}
!21 = !{!22, !23, i64 8}
!22 = !{!"_ZTSN6ngraph4pass13MemoryManager4nodeE", !10, i64 0, !23, i64 8}
!23 = !{!"_ZTSN6ngraph4pass13MemoryManager11block_stateE", !7, i64 0}
!24 = !{!22, !10, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{i8 0, i8 2}
!28 = !{}
!29 = !{!12, !10, i64 40}


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

%"struct.std::_List_iterator" = type { ptr }
%"struct.std::_List_const_iterator" = type { ptr }
%"class.ngraph::pass::MemoryManager::node" = type <{ i64, i32, [4 x i8] }>

@_ZTISt9bad_alloc = external constant ptr

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

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

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZN6ngraph4pass13MemoryManager9first_fitEm(ptr noundef nonnull align 8 dereferenceable(48) %0, i64 noundef %1) local_unnamed_addr #1 align 2 {
  %3 = alloca %"struct.std::_List_iterator", align 8
  %4 = alloca %"struct.std::_List_iterator", align 8
  %5 = alloca %"struct.std::_List_const_iterator", align 8
  %6 = alloca %"class.ngraph::pass::MemoryManager::node", align 8
  %7 = alloca i64, align 8
  %8 = getelementptr inbounds i8, ptr %0, i64 24
  %9 = load i64, ptr %8, align 8, !tbaa !5
  %10 = tail call noundef i64 @_ZN6ngraph4pass13MemoryManager5alignEmm(i64 noundef %1, i64 noundef %9)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %11 = tail call ptr @_ZNSt7__cxx114listIN6ngraph4pass13MemoryManager4nodeESaIS4_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  store ptr %11, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %12 = tail call ptr @_ZNSt7__cxx114listIN6ngraph4pass13MemoryManager4nodeESaIS4_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  store ptr %12, ptr %4, align 8
  %13 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEES6_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br i1 %13, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2, %34
  %.01013 = phi i64 [ %37, %34 ], [ 0, %2 ]
  %14 = call noundef ptr @_ZNKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %15 = getelementptr inbounds i8, ptr %14, i64 8
  %16 = load i32, ptr %15, align 8, !tbaa !17
  %17 = icmp eq i32 %16, 0
  br i1 %17, label %18, label %34

18:                                               ; preds = %.lr.ph
  %19 = call noundef ptr @_ZNKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %20 = load i64, ptr %19, align 8, !tbaa !20
  %.not = icmp ult i64 %20, %10
  br i1 %.not, label %34, label %21

21:                                               ; preds = %18
  %22 = call noundef ptr @_ZNKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %23 = load i64, ptr %22, align 8, !tbaa !20
  %24 = icmp ugt i64 %23, %10
  br i1 %24, label %25, label %31

25:                                               ; preds = %21
  call void @_ZNSt20_List_const_iteratorIN6ngraph4pass13MemoryManager4nodeEEC2ERKSt14_List_iteratorIS3_E(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #5
  call void @_ZN6ngraph4pass13MemoryManager4nodeC1EmNS1_11block_stateE(ptr noundef nonnull align 8 dereferenceable(12) %6, i64 noundef %10, i32 noundef 1)
  %26 = load ptr, ptr %5, align 8
  %27 = call ptr @_ZNSt7__cxx114listIN6ngraph4pass13MemoryManager4nodeESaIS4_EE6insertESt20_List_const_iteratorIS4_EOS4_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr %26, ptr noundef nonnull align 8 dereferenceable(12) %6)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  %28 = call noundef ptr @_ZNKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %29 = load i64, ptr %28, align 8, !tbaa !20
  %30 = sub i64 %29, %10
  store i64 %30, ptr %28, align 8, !tbaa !20
  br label %42

31:                                               ; preds = %21
  %32 = call noundef ptr @_ZNKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %33 = getelementptr inbounds i8, ptr %32, i64 8
  store i32 1, ptr %33, align 8, !tbaa !17
  br label %42

34:                                               ; preds = %18, %.lr.ph
  %35 = call noundef ptr @_ZNKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  %36 = load i64, ptr %35, align 8, !tbaa !20
  %37 = add i64 %36, %.01013
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %39 = call ptr @_ZNSt7__cxx114listIN6ngraph4pass13MemoryManager4nodeESaIS4_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  store ptr %39, ptr %4, align 8
  %40 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEES6_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br i1 %40, label %.lr.ph, label %._crit_edge, !llvm.loop !21

._crit_edge:                                      ; preds = %34, %2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  %41 = call ptr @__cxa_allocate_exception(i64 8) #5
  call void @_ZNSt9bad_allocC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %41) #5
  call void @__cxa_throw(ptr nonnull %41, ptr nonnull @_ZTISt9bad_alloc, ptr nonnull @_ZNSt9bad_allocD1Ev) #6
  unreachable

42:                                               ; preds = %31, %25
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  %43 = getelementptr inbounds i8, ptr %0, i64 40
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %44 = add i64 %.01013, %10
  store i64 %44, ptr %7, align 8, !tbaa !23
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %43, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %46 = load i64, ptr %45, align 8, !tbaa !23
  store i64 %46, ptr %43, align 8, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  ret i64 %.01013
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN6ngraph4pass13MemoryManager5alignEmm(i64 noundef, i64 noundef) local_unnamed_addr #1 align 2

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

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

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

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

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

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

; Function Attrs: nounwind
declare void @_ZNSt9bad_allocD1Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3

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

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

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

declare void @_ZN6ngraph4pass13MemoryManager4nodeC1EmNS1_11block_stateE(ptr, i64, i32) local_unnamed_addr

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

!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, !15, i64 24}
!6 = !{!"_ZTSN6ngraph4pass13MemoryManagerE", !7, i64 0, !15, i64 24, !16, i64 32, !15, i64 40}
!7 = !{!"_ZTSNSt7__cxx114listIN6ngraph4pass13MemoryManager4nodeESaIS4_EEE", !8, i64 0}
!8 = !{!"_ZTSNSt7__cxx1110_List_baseIN6ngraph4pass13MemoryManager4nodeESaIS4_EEE", !9, i64 0}
!9 = !{!"_ZTSNSt7__cxx1110_List_baseIN6ngraph4pass13MemoryManager4nodeESaIS4_EE10_List_implE", !10, i64 0}
!10 = !{!"_ZTSNSt8__detail17_List_node_headerE", !11, i64 0, !15, i64 16}
!11 = !{!"_ZTSNSt8__detail15_List_node_baseE", !12, i64 0, !12, i64 8}
!12 = !{!"any pointer", !13, i64 0}
!13 = !{!"omnipotent char", !14, i64 0}
!14 = !{!"Simple C++ TBAA"}
!15 = !{!"long", !13, i64 0}
!16 = !{!"_ZTSN6ngraph4pass13MemoryManager17allocation_schemeE", !13, i64 0}
!17 = !{!18, !19, i64 8}
!18 = !{!"_ZTSN6ngraph4pass13MemoryManager4nodeE", !15, i64 0, !19, i64 8}
!19 = !{!"_ZTSN6ngraph4pass13MemoryManager11block_stateE", !13, i64 0}
!20 = !{!18, !15, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!15, !15, i64 0}
!24 = !{!6, !15, i64 40}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass