; LLVM IR from NervanaSystems/ngraph :: src/ngraph/node.ll (ZN6ngraph4Node11safe_deleteERSt6vectorISt10shared_ptrIS0_ESaIS3_EEb)

; 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::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.std::shared_ptr.74" = type { %"class.std::__shared_ptr.75" }
%"class.std::__shared_ptr.75" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.ngraph::Node" = type { ptr, %"class.std::enable_shared_from_this", %"class.std::unordered_set", %"class.std::unordered_set", %"class.std::vector", %"class.std::vector.5", %"class.std::__cxx11::basic_string", i64, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", %"class.std::unordered_set.13", %"class.std::set", %"class.std::deque", %"class.std::deque.39", %"class.std::unordered_map", i32, %"class.std::shared_ptr", %"class.std::map" }
%"class.std::enable_shared_from_this" = type { %"class.std::weak_ptr" }
%"class.std::weak_ptr" = type { %"class.std::__weak_ptr" }
%"class.std::__weak_ptr" = type { ptr, %"class.std::__weak_count" }
%"class.std::__weak_count" = type { ptr }
%"class.std::unordered_set" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<ngraph::Node *, std::allocator<ngraph::Node *>>::_Vector_impl" }
%"struct.std::_Vector_base<ngraph::Node *, std::allocator<ngraph::Node *>>::_Vector_impl" = type { %"struct.std::_Vector_base<ngraph::Node *, std::allocator<ngraph::Node *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<ngraph::Node *, std::allocator<ngraph::Node *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<std::shared_ptr<ngraph::Node>, std::allocator<std::shared_ptr<ngraph::Node>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::shared_ptr<ngraph::Node>, std::allocator<std::shared_ptr<ngraph::Node>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::shared_ptr<ngraph::Node>, std::allocator<std::shared_ptr<ngraph::Node>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::shared_ptr<ngraph::Node>, std::allocator<std::shared_ptr<ngraph::Node>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::unordered_set.13" = type { %"class.std::_Hashtable.14" }
%"class.std::_Hashtable.14" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::shared_ptr<ngraph::Node>, std::shared_ptr<ngraph::Node>, std::_Identity<std::shared_ptr<ngraph::Node>>, std::less<std::shared_ptr<ngraph::Node>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::shared_ptr<ngraph::Node>, std::shared_ptr<ngraph::Node>, std::_Identity<std::shared_ptr<ngraph::Node>>, std::less<std::shared_ptr<ngraph::Node>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<ngraph::descriptor::Input, std::allocator<ngraph::descriptor::Input>>::_Deque_impl" }
%"struct.std::_Deque_base<ngraph::descriptor::Input, std::allocator<ngraph::descriptor::Input>>::_Deque_impl" = type { %"struct.std::_Deque_base<ngraph::descriptor::Input, std::allocator<ngraph::descriptor::Input>>::_Deque_impl_data" }
%"struct.std::_Deque_base<ngraph::descriptor::Input, std::allocator<ngraph::descriptor::Input>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"class.std::deque.39" = type { %"class.std::_Deque_base.40" }
%"class.std::_Deque_base.40" = type { %"struct.std::_Deque_base<ngraph::descriptor::Output, std::allocator<ngraph::descriptor::Output>>::_Deque_impl" }
%"struct.std::_Deque_base<ngraph::descriptor::Output, std::allocator<ngraph::descriptor::Output>>::_Deque_impl" = type { %"struct.std::_Deque_base<ngraph::descriptor::Output, std::allocator<ngraph::descriptor::Output>>::_Deque_impl_data" }
%"struct.std::_Deque_base<ngraph::descriptor::Output, std::allocator<ngraph::descriptor::Output>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator.44", %"struct.std::_Deque_iterator.44" }
%"struct.std::_Deque_iterator.44" = type { ptr, ptr, ptr, ptr }
%"class.std::unordered_map" = type { %"class.std::_Hashtable.45" }
%"class.std::_Hashtable.45" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::map" = type { %"class.std::_Rb_tree.64" }
%"class.std::_Rb_tree.64" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, std::shared_ptr<ngraph::Variant>>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, std::shared_ptr<ngraph::Variant>>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, std::shared_ptr<ngraph::Variant>>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, std::shared_ptr<ngraph::Variant>>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5dequeIN6ngraph10descriptor5InputESaIS2_EE5beginEv(ptr dead_on_unwind noalias writable sret(%"struct.std::_Deque_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(80)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5dequeIN6ngraph10descriptor5InputESaIS2_EE3endEv(ptr dead_on_unwind noalias writable sret(%"struct.std::_Deque_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(80)) #1 align 2

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

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

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

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

declare void @_ZNK6ngraph10descriptor6Output8get_nodeEv(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.74") align 8, ptr noundef nonnull align 8 dereferenceable(56)) #2

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

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

declare void @_ZN6ngraph10descriptor5Input13remove_outputEv(ptr noundef nonnull align 8 dereferenceable(42)) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6ngraph4Node11safe_deleteERSt6vectorISt10shared_ptrIS0_ESaIS3_EEb(ptr noundef nonnull align 8 dereferenceable(680) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, i1 noundef zeroext %2) #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  %7 = alloca ptr, align 8
  %8 = alloca %"struct.std::_Deque_iterator", align 8
  %9 = alloca %"struct.std::_Deque_iterator", align 8
  %10 = alloca ptr, align 8
  %11 = alloca %"class.std::shared_ptr.74", align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"class.std::shared_ptr.74", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %15 = zext i1 %2 to i8
  store i8 %15, ptr %6, align 1, !tbaa !9
  %16 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %17 = getelementptr inbounds %"class.ngraph::Node", ptr %16, i32 0, i32 12
  store ptr %17, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #4
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZNSt5dequeIN6ngraph10descriptor5InputESaIS2_EE5beginEv(ptr dead_on_unwind writable sret(%"struct.std::_Deque_iterator") align 8 %8, ptr noundef nonnull align 8 dereferenceable(80) %18) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #4
  %19 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZNSt5dequeIN6ngraph10descriptor5InputESaIS2_EE3endEv(ptr dead_on_unwind writable sret(%"struct.std::_Deque_iterator") align 8 %9, ptr noundef nonnull align 8 dereferenceable(80) %19) #4
  br label %20

20:                                               ; preds = %43, %3
  %21 = call noundef zeroext i1 @_ZStneRKSt15_Deque_iteratorIN6ngraph10descriptor5InputERS2_PS2_ES7_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull align 8 dereferenceable(32) %9) #4
  br i1 %21, label %23, label %22

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

23:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %24 = call noundef nonnull align 8 dereferenceable(42) ptr @_ZNKSt15_Deque_iteratorIN6ngraph10descriptor5InputERS2_PS2_EdeEv(ptr noundef nonnull align 8 dereferenceable(32) %8) #4
  store ptr %24, ptr %10, align 8, !tbaa !5
  %25 = load ptr, ptr %10, align 8, !tbaa !5
  %26 = call noundef zeroext i1 @_ZNK6ngraph10descriptor5Input10has_outputEv(ptr noundef nonnull align 8 dereferenceable(42) %25)
  br i1 %26, label %27, label %42

27:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #4
  %28 = load ptr, ptr %10, align 8, !tbaa !5
  %29 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZN6ngraph10descriptor5Input10get_outputEv(ptr noundef nonnull align 8 dereferenceable(42) %28)
  call void @_ZNK6ngraph10descriptor6Output8get_nodeEv(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.74") align 8 %11, ptr noundef nonnull align 8 dereferenceable(56) %29)
  %30 = call noundef i64 @_ZNKSt12__shared_ptrIN6ngraph4NodeELN9__gnu_cxx12_Lock_policyE2EE9use_countEv(ptr noundef nonnull align 8 dereferenceable(16) %11) #4
  %31 = icmp eq i64 %30, 2
  br i1 %31, label %32, label %39

32:                                               ; preds = %27
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  invoke void @_ZNSt6vectorISt10shared_ptrIN6ngraph4NodeEESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %33, ptr noundef nonnull align 8 dereferenceable(16) %11)
          to label %34 unwind label %35

34:                                               ; preds = %32
  br label %39

35:                                               ; preds = %39, %32
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %12, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %13, align 4
  call void @_ZNSt12__shared_ptrIN6ngraph4NodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  br label %66

39:                                               ; preds = %34, %27
  %40 = load ptr, ptr %10, align 8, !tbaa !5
  invoke void @_ZN6ngraph10descriptor5Input13remove_outputEv(ptr noundef nonnull align 8 dereferenceable(42) %40)
          to label %41 unwind label %35

41:                                               ; preds = %39
  call void @_ZNSt12__shared_ptrIN6ngraph4NodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #4
  br label %42

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

43:                                               ; preds = %42
  %44 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt15_Deque_iteratorIN6ngraph10descriptor5InputERS2_PS2_EppEv(ptr noundef nonnull align 8 dereferenceable(32) %8) #4
  br label %20

45:                                               ; preds = %22
  %46 = load i8, ptr %6, align 1, !tbaa !9, !range !11, !noundef !12
  %47 = trunc i8 %46 to i1
  br i1 %47, label %48, label %65

48:                                               ; preds = %45
  br label %49

49:                                               ; preds = %59, %48
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = call noundef i64 @_ZNKSt6vectorISt10shared_ptrIN6ngraph4NodeEESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %50) #4
  %52 = icmp ugt i64 %51, 0
  br i1 %52, label %53, label %64

53:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #4
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt10shared_ptrIN6ngraph4NodeEESaIS3_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %54) #4
  call void @_ZNSt10shared_ptrIN6ngraph4NodeEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(16) %55) #4
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZNSt6vectorISt10shared_ptrIN6ngraph4NodeEESaIS3_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %56) #4
  %57 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN6ngraph4NodeELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %14) #4
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  invoke void @_ZN6ngraph4Node11safe_deleteERSt6vectorISt10shared_ptrIS0_ESaIS3_EEb(ptr noundef nonnull align 8 dereferenceable(680) %57, ptr noundef nonnull align 8 dereferenceable(24) %58, i1 noundef zeroext false)
          to label %59 unwind label %60

59:                                               ; preds = %53
  call void @_ZNSt12__shared_ptrIN6ngraph4NodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #4
  br label %49, !llvm.loop !13

60:                                               ; preds = %53
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %12, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %13, align 4
  call void @_ZNSt12__shared_ptrIN6ngraph4NodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #4
  br label %66

64:                                               ; preds = %49
  br label %65

65:                                               ; preds = %64, %45
  ret void

66:                                               ; preds = %60, %35
  %67 = load ptr, ptr %12, align 8
  %68 = load i32, ptr %13, align 4
  %69 = insertvalue { ptr, i32 } poison, ptr %67, 0
  %70 = insertvalue { ptr, i32 } %69, i32 %68, 1
  resume { ptr, i32 } %70
}

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

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

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

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

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 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 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


; 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::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.std::shared_ptr.74" = type { %"class.std::__shared_ptr.75" }
%"class.std::__shared_ptr.75" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }

declare i32 @__gxx_personality_v0(...)

; 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 nounwind uwtable
declare dso_local void @_ZNSt5dequeIN6ngraph10descriptor5InputESaIS2_EE5beginEv(ptr dead_on_unwind noalias writable sret(%"struct.std::_Deque_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5dequeIN6ngraph10descriptor5InputESaIS2_EE3endEv(ptr dead_on_unwind noalias writable sret(%"struct.std::_Deque_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #1 align 2

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

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

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

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

declare void @_ZNK6ngraph10descriptor6Output8get_nodeEv(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.74") align 8, ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #2

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

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

declare void @_ZN6ngraph10descriptor5Input13remove_outputEv(ptr noundef nonnull align 8 dereferenceable(42)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6ngraph4Node11safe_deleteERSt6vectorISt10shared_ptrIS0_ESaIS3_EEb(ptr noundef nonnull align 8 dereferenceable(680) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, i1 noundef zeroext %2) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"struct.std::_Deque_iterator", align 8
  %5 = alloca %"struct.std::_Deque_iterator", align 8
  %6 = alloca %"class.std::shared_ptr.74", align 8
  %7 = alloca %"class.std::shared_ptr.74", align 8
  %8 = getelementptr inbounds i8, ptr %0, i64 392
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #4
  call void @_ZNSt5dequeIN6ngraph10descriptor5InputESaIS2_EE5beginEv(ptr dead_on_unwind nonnull writable sret(%"struct.std::_Deque_iterator") align 8 %4, ptr noundef nonnull align 8 dereferenceable(80) %8) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #4
  call void @_ZNSt5dequeIN6ngraph10descriptor5InputESaIS2_EE3endEv(ptr dead_on_unwind nonnull writable sret(%"struct.std::_Deque_iterator") align 8 %5, ptr noundef nonnull align 8 dereferenceable(80) %8) #4
  %9 = call noundef zeroext i1 @_ZStneRKSt15_Deque_iteratorIN6ngraph10descriptor5InputERS2_PS2_ES7_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(32) %5) #4
  br i1 %9, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %22, %3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  br i1 %2, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %._crit_edge
  %10 = call noundef i64 @_ZNKSt6vectorISt10shared_ptrIN6ngraph4NodeEESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #4
  %.not15 = icmp eq i64 %10, 0
  br i1 %.not15, label %.loopexit, label %.lr.ph16

.lr.ph:                                           ; preds = %3, %22
  %11 = call noundef nonnull align 8 dereferenceable(42) ptr @_ZNKSt15_Deque_iteratorIN6ngraph10descriptor5InputERS2_PS2_EdeEv(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  %12 = call noundef zeroext i1 @_ZNK6ngraph10descriptor5Input10has_outputEv(ptr noundef nonnull align 8 dereferenceable(42) %11)
  br i1 %12, label %13, label %22

13:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #4
  %14 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZN6ngraph10descriptor5Input10get_outputEv(ptr noundef nonnull align 8 dereferenceable(42) %11)
  call void @_ZNK6ngraph10descriptor6Output8get_nodeEv(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.74") align 8 %6, ptr noundef nonnull align 8 dereferenceable(56) %14)
  %15 = call noundef i64 @_ZNKSt12__shared_ptrIN6ngraph4NodeELN9__gnu_cxx12_Lock_policyE2EE9use_countEv(ptr noundef nonnull align 8 dereferenceable(16) %6) #4
  %16 = icmp eq i64 %15, 2
  br i1 %16, label %17, label %20

17:                                               ; preds = %13
  invoke void @_ZNSt6vectorISt10shared_ptrIN6ngraph4NodeEESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(16) %6)
          to label %20 unwind label %18

18:                                               ; preds = %20, %17
  %19 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt12__shared_ptrIN6ngraph4NodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  br label %31

20:                                               ; preds = %17, %13
  invoke void @_ZN6ngraph10descriptor5Input13remove_outputEv(ptr noundef nonnull align 8 dereferenceable(42) %11)
          to label %21 unwind label %18

21:                                               ; preds = %20
  call void @_ZNSt12__shared_ptrIN6ngraph4NodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #4
  br label %22

22:                                               ; preds = %21, %.lr.ph
  %23 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt15_Deque_iteratorIN6ngraph10descriptor5InputERS2_PS2_EppEv(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  %24 = call noundef zeroext i1 @_ZStneRKSt15_Deque_iteratorIN6ngraph10descriptor5InputERS2_PS2_ES7_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(32) %5) #4
  br i1 %24, label %.lr.ph, label %._crit_edge

.lr.ph16:                                         ; preds = %.preheader, %27
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #4
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt10shared_ptrIN6ngraph4NodeEESaIS3_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #4
  call void @_ZNSt10shared_ptrIN6ngraph4NodeEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(16) %25) #4
  call void @_ZNSt6vectorISt10shared_ptrIN6ngraph4NodeEESaIS3_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #4
  %26 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN6ngraph4NodeELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %7) #4
  invoke void @_ZN6ngraph4Node11safe_deleteERSt6vectorISt10shared_ptrIS0_ESaIS3_EEb(ptr noundef nonnull align 8 dereferenceable(680) %26, ptr noundef nonnull align 8 dereferenceable(24) %1, i1 noundef zeroext false)
          to label %27 unwind label %29

27:                                               ; preds = %.lr.ph16
  call void @_ZNSt12__shared_ptrIN6ngraph4NodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #4
  %28 = call noundef i64 @_ZNKSt6vectorISt10shared_ptrIN6ngraph4NodeEESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #4
  %.not = icmp eq i64 %28, 0
  br i1 %.not, label %.loopexit, label %.lr.ph16, !llvm.loop !5

29:                                               ; preds = %.lr.ph16
  %30 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt12__shared_ptrIN6ngraph4NodeELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #4
  br label %31

.loopexit:                                        ; preds = %27, %.preheader, %._crit_edge
  ret void

31:                                               ; preds = %29, %18
  %.pn = phi { ptr, i32 } [ %19, %18 ], [ %30, %29 ]
  resume { ptr, i32 } %.pn
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt10shared_ptrIN6ngraph4NodeEESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 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 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


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