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

; 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" = 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 }
%"class.ngraph::pass::MemoryManager::node" = type <{ i64, i32, [4 x i8] }>

@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@_ZTISt13runtime_error = 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 i32 @__gxx_personality_v0(...)

declare void @__cxa_free_exception(ptr)

declare void @__cxa_throw(ptr, ptr, ptr)

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

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

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

31:                                               ; preds = %26
  store i32 2, ptr %9, align 4
  br label %107

32:                                               ; preds = %26
  %33 = load i64, ptr %4, align 8, !tbaa !9
  %34 = load i64, ptr %5, align 8, !tbaa !9
  %35 = icmp eq i64 %33, %34
  br i1 %35, label %36, label %99

36:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 %7, i64 8, i1 false), !tbaa.struct !13
  %37 = getelementptr inbounds %"struct.std::_List_iterator", ptr %11, i32 0, i32 0
  %38 = load ptr, ptr %37, align 8
  %39 = call ptr @_ZSt4nextISt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEET_S6_NSt15iterator_traitsIS6_E15difference_typeE(ptr %38, i64 noundef 1)
  %40 = getelementptr inbounds %"struct.std::_List_iterator", ptr %10, i32 0, i32 0
  store ptr %39, ptr %40, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %41 = getelementptr inbounds %"class.ngraph::pass::MemoryManager", ptr %22, i32 0, i32 0
  %42 = call ptr @_ZNSt7__cxx114listIN6ngraph4pass13MemoryManager4nodeESaIS4_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %41) #7
  %43 = getelementptr inbounds %"struct.std::_List_iterator", ptr %12, i32 0, i32 0
  store ptr %42, ptr %43, align 8
  %44 = call noundef zeroext i1 @_ZSteqRKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEES6_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br i1 %44, label %45, label %48

45:                                               ; preds = %36
  %46 = call noundef ptr @_ZNKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %47 = getelementptr inbounds %"class.ngraph::pass::MemoryManager::node", ptr %46, i32 0, i32 1
  store i32 0, ptr %47, align 8, !tbaa !14
  br label %71

48:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 8 %7, i64 8, i1 false), !tbaa.struct !13
  %49 = getelementptr inbounds %"struct.std::_List_iterator", ptr %14, i32 0, i32 0
  %50 = load ptr, ptr %49, align 8
  %51 = call ptr @_ZSt4prevISt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEET_S6_NSt15iterator_traitsIS6_E15difference_typeE(ptr %50, i64 noundef 1)
  %52 = getelementptr inbounds %"struct.std::_List_iterator", ptr %13, i32 0, i32 0
  store ptr %51, ptr %52, align 8
  %53 = call noundef ptr @_ZNKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  %54 = getelementptr inbounds %"class.ngraph::pass::MemoryManager::node", ptr %53, i32 0, i32 1
  %55 = load i32, ptr %54, align 8, !tbaa !14
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %57, label %70

57:                                               ; preds = %48
  %58 = call noundef ptr @_ZNKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  %59 = getelementptr inbounds %"class.ngraph::pass::MemoryManager::node", ptr %58, i32 0, i32 0
  %60 = load i64, ptr %59, align 8, !tbaa !17
  %61 = call noundef ptr @_ZNKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %62 = getelementptr inbounds %"class.ngraph::pass::MemoryManager::node", ptr %61, i32 0, i32 0
  %63 = load i64, ptr %62, align 8, !tbaa !17
  %64 = add i64 %63, %60
  store i64 %64, ptr %62, align 8, !tbaa !17
  %65 = getelementptr inbounds %"class.ngraph::pass::MemoryManager", ptr %22, i32 0, i32 0
  call void @_ZNSt20_List_const_iteratorIN6ngraph4pass13MemoryManager4nodeEEC2ERKSt14_List_iteratorIS3_E(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  %66 = getelementptr inbounds %"struct.std::_List_const_iterator", ptr %15, i32 0, i32 0
  %67 = load ptr, ptr %66, align 8
  %68 = call ptr @_ZNSt7__cxx114listIN6ngraph4pass13MemoryManager4nodeESaIS4_EE5eraseESt20_List_const_iteratorIS4_E(ptr noundef nonnull align 8 dereferenceable(24) %65, ptr %67) #7
  %69 = getelementptr inbounds %"struct.std::_List_iterator", ptr %16, i32 0, i32 0
  store ptr %68, ptr %69, align 8
  br label %70

70:                                               ; preds = %57, %48
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %71

71:                                               ; preds = %70, %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %72 = getelementptr inbounds %"class.ngraph::pass::MemoryManager", ptr %22, i32 0, i32 0
  %73 = call ptr @_ZNSt7__cxx114listIN6ngraph4pass13MemoryManager4nodeESaIS4_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %72) #7
  %74 = getelementptr inbounds %"struct.std::_List_iterator", ptr %17, i32 0, i32 0
  store ptr %73, ptr %74, align 8
  %75 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEES6_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  br i1 %75, label %76, label %81

76:                                               ; preds = %71
  %77 = call noundef ptr @_ZNKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  %78 = getelementptr inbounds %"class.ngraph::pass::MemoryManager::node", ptr %77, i32 0, i32 1
  %79 = load i32, ptr %78, align 8, !tbaa !14
  %80 = icmp eq i32 %79, 0
  br label %81

81:                                               ; preds = %76, %71
  %82 = phi i1 [ false, %71 ], [ %80, %76 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br i1 %82, label %83, label %96

83:                                               ; preds = %81
  %84 = call noundef ptr @_ZNKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  %85 = getelementptr inbounds %"class.ngraph::pass::MemoryManager::node", ptr %84, i32 0, i32 0
  %86 = load i64, ptr %85, align 8, !tbaa !17
  %87 = call noundef ptr @_ZNKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %88 = getelementptr inbounds %"class.ngraph::pass::MemoryManager::node", ptr %87, i32 0, i32 0
  %89 = load i64, ptr %88, align 8, !tbaa !17
  %90 = add i64 %89, %86
  store i64 %90, ptr %88, align 8, !tbaa !17
  %91 = getelementptr inbounds %"class.ngraph::pass::MemoryManager", ptr %22, i32 0, i32 0
  call void @_ZNSt20_List_const_iteratorIN6ngraph4pass13MemoryManager4nodeEEC2ERKSt14_List_iteratorIS3_E(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  %92 = getelementptr inbounds %"struct.std::_List_const_iterator", ptr %18, i32 0, i32 0
  %93 = load ptr, ptr %92, align 8
  %94 = call ptr @_ZNSt7__cxx114listIN6ngraph4pass13MemoryManager4nodeESaIS4_EE5eraseESt20_List_const_iteratorIS4_E(ptr noundef nonnull align 8 dereferenceable(24) %91, ptr %93) #7
  %95 = getelementptr inbounds %"struct.std::_List_iterator", ptr %19, i32 0, i32 0
  store ptr %94, ptr %95, align 8
  br label %96

96:                                               ; preds = %83, %81
  %97 = call noundef ptr @_ZNKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %98 = getelementptr inbounds %"class.ngraph::pass::MemoryManager::node", ptr %97, i32 0, i32 1
  store i32 0, ptr %98, align 8, !tbaa !14
  store i8 1, ptr %6, align 1, !tbaa !11
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %107

99:                                               ; preds = %32
  %100 = call noundef ptr @_ZNKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %101 = getelementptr inbounds %"class.ngraph::pass::MemoryManager::node", ptr %100, i32 0, i32 0
  %102 = load i64, ptr %101, align 8, !tbaa !17
  %103 = load i64, ptr %5, align 8, !tbaa !9
  %104 = add i64 %103, %102
  store i64 %104, ptr %5, align 8, !tbaa !9
  br label %105

105:                                              ; preds = %99
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  br label %26, !llvm.loop !18

107:                                              ; preds = %96, %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %108

108:                                              ; preds = %107
  %109 = load i8, ptr %6, align 1, !tbaa !11, !range !20, !noundef !21
  %110 = trunc i8 %109 to i1
  br i1 %110, label %118, label %111

111:                                              ; preds = %108
  %112 = call ptr @__cxa_allocate_exception(i64 16) #7
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %112, ptr noundef @.str.3)
          to label %113 unwind label %114

113:                                              ; preds = %111
  call void @__cxa_throw(ptr %112, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #8
  unreachable

114:                                              ; preds = %111
  %115 = landingpad { ptr, i32 }
          cleanup
  %116 = extractvalue { ptr, i32 } %115, 0
  store ptr %116, ptr %20, align 8
  %117 = extractvalue { ptr, i32 } %115, 1
  store i32 %117, ptr %21, align 4
  call void @__cxa_free_exception(ptr %112) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %119

118:                                              ; preds = %108
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  ret void

119:                                              ; preds = %114
  %120 = load ptr, ptr %20, align 8
  %121 = load i32, ptr %21, align 4
  %122 = insertvalue { ptr, i32 } poison, ptr %120, 0
  %123 = insertvalue { ptr, i32 } %122, i32 %121, 1
  resume { ptr, i32 } %123
}

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

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

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

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

; 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 #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt4nextISt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEET_S6_NSt15iterator_traitsIS6_E15difference_typeE(ptr, i64 noundef) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt4prevISt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEET_S6_NSt15iterator_traitsIS6_E15difference_typeE(ptr, i64 noundef) #4

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

declare void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #5

; Function Attrs: nounwind
declare void @_ZNSt13runtime_errorD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #6

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree 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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { nounwind }
attributes #8 = { 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, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i64 0, i64 8, !5}
!14 = !{!15, !16, i64 8}
!15 = !{!"_ZTSN6ngraph4pass13MemoryManager4nodeE", !10, i64 0, !16, i64 8}
!16 = !{!"_ZTSN6ngraph4pass13MemoryManager11block_stateE", !7, i64 0}
!17 = !{!15, !10, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{i8 0, i8 2}
!21 = !{}


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

@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@_ZTISt13runtime_error = 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 i32 @__gxx_personality_v0(...)

declare void @__cxa_free_exception(ptr) local_unnamed_addr

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6ngraph4pass13MemoryManager4freeEm(ptr noundef nonnull align 8 dereferenceable(48) %0, i64 noundef %1) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"struct.std::_List_iterator", align 8
  %4 = alloca %"struct.std::_List_iterator", align 8
  %5 = alloca %"struct.std::_List_iterator", align 8
  %6 = alloca %"struct.std::_List_iterator", align 8
  %7 = alloca %"struct.std::_List_iterator", align 8
  %8 = alloca %"struct.std::_List_const_iterator", align 8
  %9 = alloca %"struct.std::_List_iterator", align 8
  %10 = alloca %"struct.std::_List_const_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %11 = tail call ptr @_ZNSt7__cxx114listIN6ngraph4pass13MemoryManager4nodeESaIS4_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  store ptr %11, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %12 = tail call ptr @_ZNSt7__cxx114listIN6ngraph4pass13MemoryManager4nodeESaIS4_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  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) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br i1 %13, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2, %53
  %.012 = phi i64 [ %56, %53 ], [ 0, %2 ]
  %14 = icmp eq i64 %.012, %1
  br i1 %14, label %15, label %53

15:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %.sroa.03.0.copyload = load ptr, ptr %3, align 8, !tbaa !5
  %16 = call ptr @_ZSt4nextISt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEET_S6_NSt15iterator_traitsIS6_E15difference_typeE(ptr %.sroa.03.0.copyload, i64 noundef 1)
  store ptr %16, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %17 = call ptr @_ZNSt7__cxx114listIN6ngraph4pass13MemoryManager4nodeESaIS4_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  store ptr %17, ptr %6, align 8
  %18 = call noundef zeroext i1 @_ZSteqRKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEES6_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br i1 %18, label %19, label %22

19:                                               ; preds = %15
  %20 = call noundef ptr @_ZNKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %21 = getelementptr inbounds i8, ptr %20, i64 8
  store i32 0, ptr %21, align 8, !tbaa !9
  br label %37

22:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %.sroa.02.0.copyload = load ptr, ptr %3, align 8, !tbaa !5
  %23 = call ptr @_ZSt4prevISt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEET_S6_NSt15iterator_traitsIS6_E15difference_typeE(ptr %.sroa.02.0.copyload, i64 noundef 1)
  store ptr %23, ptr %7, align 8
  %24 = call noundef ptr @_ZNKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %25 = getelementptr inbounds i8, ptr %24, i64 8
  %26 = load i32, ptr %25, align 8, !tbaa !9
  %27 = icmp eq i32 %26, 0
  br i1 %27, label %28, label %36

28:                                               ; preds = %22
  %29 = call noundef ptr @_ZNKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %30 = load i64, ptr %29, align 8, !tbaa !13
  %31 = call noundef ptr @_ZNKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %32 = load i64, ptr %31, align 8, !tbaa !13
  %33 = add i64 %32, %30
  store i64 %33, ptr %31, align 8, !tbaa !13
  call void @_ZNSt20_List_const_iteratorIN6ngraph4pass13MemoryManager4nodeEEC2ERKSt14_List_iteratorIS3_E(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %34 = load ptr, ptr %8, align 8
  %35 = call ptr @_ZNSt7__cxx114listIN6ngraph4pass13MemoryManager4nodeESaIS4_EE5eraseESt20_List_const_iteratorIS4_E(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr %34) #6
  br label %36

36:                                               ; preds = %28, %22
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br label %37

37:                                               ; preds = %36, %19
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %38 = call ptr @_ZNSt7__cxx114listIN6ngraph4pass13MemoryManager4nodeESaIS4_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  store ptr %38, ptr %9, align 8
  %39 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEES6_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  br i1 %39, label %40, label %.critedge

40:                                               ; preds = %37
  %41 = call noundef ptr @_ZNKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  %42 = getelementptr inbounds i8, ptr %41, i64 8
  %43 = load i32, ptr %42, align 8, !tbaa !9
  %44 = icmp eq i32 %43, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  br i1 %44, label %45, label %64

45:                                               ; preds = %40
  %46 = call noundef ptr @_ZNKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  %47 = load i64, ptr %46, align 8, !tbaa !13
  %48 = call noundef ptr @_ZNKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %49 = load i64, ptr %48, align 8, !tbaa !13
  %50 = add i64 %49, %47
  store i64 %50, ptr %48, align 8, !tbaa !13
  call void @_ZNSt20_List_const_iteratorIN6ngraph4pass13MemoryManager4nodeEEC2ERKSt14_List_iteratorIS3_E(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  %51 = load ptr, ptr %10, align 8
  %52 = call ptr @_ZNSt7__cxx114listIN6ngraph4pass13MemoryManager4nodeESaIS4_EE5eraseESt20_List_const_iteratorIS4_E(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr %51) #6
  br label %64

.critedge:                                        ; preds = %37
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  br label %64

53:                                               ; preds = %.lr.ph
  %54 = call noundef ptr @_ZNKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %55 = load i64, ptr %54, align 8, !tbaa !13
  %56 = add i64 %55, %.012
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %58 = call ptr @_ZNSt7__cxx114listIN6ngraph4pass13MemoryManager4nodeESaIS4_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  store ptr %58, ptr %4, align 8
  %59 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEES6_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br i1 %59, label %.lr.ph, label %._crit_edge, !llvm.loop !14

._crit_edge:                                      ; preds = %53, %2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  %60 = call ptr @__cxa_allocate_exception(i64 16) #6
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %60, ptr noundef nonnull @.str.3)
          to label %61 unwind label %62

61:                                               ; preds = %._crit_edge
  call void @__cxa_throw(ptr nonnull %60, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #7
  unreachable

62:                                               ; preds = %._crit_edge
  %63 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %60) #6
  resume { ptr, i32 } %63

64:                                               ; preds = %40, %45, %.critedge
  %65 = call noundef ptr @_ZNKSt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %66 = getelementptr inbounds i8, ptr %65, i64 8
  store i32 0, ptr %66, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  ret void
}

; 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 noundef zeroext i1 @_ZSteqRKSt14_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 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 uwtable
declare dso_local ptr @_ZSt4nextISt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEET_S6_NSt15iterator_traitsIS6_E15difference_typeE(ptr, i64 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt4prevISt14_List_iteratorIN6ngraph4pass13MemoryManager4nodeEEET_S6_NSt15iterator_traitsIS6_E15difference_typeE(ptr, i64 noundef) local_unnamed_addr #3

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

declare void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #4

; Function Attrs: nounwind
declare void @_ZNSt13runtime_errorD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #5

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 = { 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 "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 = { nounwind }
attributes #7 = { 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, !12, i64 8}
!10 = !{!"_ZTSN6ngraph4pass13MemoryManager4nodeE", !11, i64 0, !12, i64 8}
!11 = !{!"long", !7, i64 0}
!12 = !{!"_ZTSN6ngraph4pass13MemoryManager11block_stateE", !7, i64 0}
!13 = !{!10, !11, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


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