; LLVM IR from BehaviorTree/BehaviorTree.CPP :: src/actions/test_node.ll (ZN2BT8TestNode11onCompletedEv)

; 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.BT::Ast::Environment" = type { %"class.std::shared_ptr.7", %"class.std::shared_ptr.10" }
%"class.std::shared_ptr.7" = type { %"class.std::__shared_ptr.8" }
%"class.std::__shared_ptr.8" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::shared_ptr.10" = type { %"class.std::__shared_ptr.11" }
%"class.std::__shared_ptr.11" = type { ptr, %"class.std::__shared_count" }
%"class.BT::Any" = type { %"class.linb::any", %"struct.std::type_index" }
%"class.linb::any" = type { %"union.linb::any::storage_union", ptr }
%"union.linb::any::storage_union" = type { ptr, [8 x i8] }
%"struct.std::type_index" = type { ptr }
%"struct.BT::NodeConfig" = type { %"class.std::shared_ptr.7", %"class.std::shared_ptr.10", %"class.std::unordered_map", %"class.std::unordered_map", %"class.std::unordered_map", ptr, i16, %"class.std::__cxx11::basic_string", %"class.std::map", %"class.std::map.21" }
%"class.std::unordered_map" = 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::__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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<BT::PreCond, std::pair<const BT::PreCond, std::__cxx11::basic_string<char>>, std::_Select1st<std::pair<const BT::PreCond, std::__cxx11::basic_string<char>>>, std::less<BT::PreCond>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<BT::PreCond, std::pair<const BT::PreCond, std::__cxx11::basic_string<char>>, std::_Select1st<std::pair<const BT::PreCond, std::__cxx11::basic_string<char>>>, std::less<BT::PreCond>>::_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::map.21" = type { %"class.std::_Rb_tree.22" }
%"class.std::_Rb_tree.22" = type { %"struct.std::_Rb_tree<BT::PostCond, std::pair<const BT::PostCond, std::__cxx11::basic_string<char>>, std::_Select1st<std::pair<const BT::PostCond, std::__cxx11::basic_string<char>>>, std::less<BT::PostCond>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<BT::PostCond, std::pair<const BT::PostCond, std::__cxx11::basic_string<char>>, std::_Select1st<std::pair<const BT::PostCond, std::__cxx11::basic_string<char>>>, std::less<BT::PostCond>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.BT::TestNode" = type <{ %"class.BT::StatefulActionNode.base", [7 x i8], %"class.std::shared_ptr", %"class.std::function.2", %"class.std::function.2", %"class.std::function.2", %"class.BT::TimerQueue", %"struct.std::atomic", [7 x i8] }>
%"class.BT::StatefulActionNode.base" = type <{ %"class.BT::ActionNodeBase", %"struct.std::atomic" }>
%"class.BT::ActionNodeBase" = type { %"class.BT::LeafNode" }
%"class.BT::LeafNode" = type { %"class.BT::TreeNode" }
%"class.BT::TreeNode" = type { ptr, %"class.std::unique_ptr" }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.1" }
%"struct.std::_Head_base.1" = type { ptr }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::function.2" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%"class.BT::TimerQueue" = type { %"class.BT::details::Semaphore", %"class.std::thread", i8, i64, %"class.std::mutex", %"class.BT::TimerQueue<>::Queue" }
%"class.BT::details::Semaphore" = type <{ %"class.std::mutex", %"class.std::condition_variable", i32, %"struct.std::atomic", [3 x i8] }>
%"class.std::condition_variable" = type { %"class.std::__condvar" }
%"class.std::__condvar" = type { %union.pthread_cond_t }
%union.pthread_cond_t = type { %struct.__pthread_cond_s }
%struct.__pthread_cond_s = type { %union.__atomic_wide_counter, %union.__atomic_wide_counter, [2 x i32], [2 x i32], i32, i32, [2 x i32] }
%union.__atomic_wide_counter = type { i64 }
%"class.std::thread" = type { %"class.std::thread::id" }
%"class.std::thread::id" = type { i64 }
%"class.std::mutex" = type { %"class.std::__mutex_base" }
%"class.std::__mutex_base" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.BT::TimerQueue<>::Queue" = type { %"class.std::priority_queue.base", [7 x i8] }
%"class.std::priority_queue.base" = type <{ %"class.std::vector", i8 }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<BT::TimerQueue<>::WorkItem, std::allocator<BT::TimerQueue<>::WorkItem>>::_Vector_impl" }
%"struct.std::_Vector_base<BT::TimerQueue<>::WorkItem, std::allocator<BT::TimerQueue<>::WorkItem>>::_Vector_impl" = type { %"struct.std::_Vector_base<BT::TimerQueue<>::WorkItem, std::allocator<BT::TimerQueue<>::WorkItem>>::_Vector_impl_data" }
%"struct.std::_Vector_base<BT::TimerQueue<>::WorkItem, std::allocator<BT::TimerQueue<>::WorkItem>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i8 }
%"struct.BT::TestNodeConfig" = type { i32, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", %"class.std::chrono::duration", %"class.std::function" }
%"class.std::chrono::duration" = type { i64 }
%"class.std::function" = type { %"class.std::_Function_base", ptr }

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN2BT8TestNode11onCompletedEv(ptr noundef nonnull align 8 dereferenceable(329) %0) #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"struct.BT::Ast::Environment", align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"class.BT::Any", align 8
  %8 = alloca %"class.BT::Any", align 8
  %9 = alloca %"class.BT::Any", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %10 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr %3) #5
  %11 = getelementptr inbounds %"struct.BT::Ast::Environment", ptr %3, i32 0, i32 0
  %12 = call noundef nonnull align 8 dereferenceable(344) ptr @_ZN2BT8TreeNode6configEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  %13 = getelementptr inbounds %"struct.BT::NodeConfig", ptr %12, i32 0, i32 0
  call void @_ZNSt10shared_ptrIN2BT10BlackboardEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(16) %13) #5
  %14 = getelementptr inbounds %"struct.BT::Ast::Environment", ptr %3, i32 0, i32 1
  %15 = invoke noundef nonnull align 8 dereferenceable(344) ptr @_ZN2BT8TreeNode6configEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
          to label %16 unwind label %43

16:                                               ; preds = %1
  %17 = getelementptr inbounds %"struct.BT::NodeConfig", ptr %15, i32 0, i32 1
  call void @_ZNSt10shared_ptrISt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4hashIS6_ESt8equal_toIS6_ESaISt4pairIKS6_iEEEEC2ERKSG_(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(16) %17) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %18 = getelementptr inbounds %"class.BT::TestNode", ptr %10, i32 0, i32 2
  %19 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN2BT14TestNodeConfigELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %18) #5
  %20 = getelementptr inbounds %"struct.BT::TestNodeConfig", ptr %19, i32 0, i32 5
  %21 = call noundef zeroext i1 @_ZNKSt8functionIFN2BT10NodeStatusEvEEcvbEv(ptr noundef nonnull align 8 dereferenceable(32) %20) #5
  br i1 %21, label %22, label %28

22:                                               ; preds = %16
  %23 = getelementptr inbounds %"class.BT::TestNode", ptr %10, i32 0, i32 2
  %24 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN2BT14TestNodeConfigELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %23) #5
  %25 = getelementptr inbounds %"struct.BT::TestNodeConfig", ptr %24, i32 0, i32 5
  %26 = invoke noundef i32 @_ZNKSt8functionIFN2BT10NodeStatusEvEEclEv(ptr noundef nonnull align 8 dereferenceable(32) %25)
          to label %27 unwind label %47

27:                                               ; preds = %22
  br label %33

28:                                               ; preds = %16
  %29 = getelementptr inbounds %"class.BT::TestNode", ptr %10, i32 0, i32 2
  %30 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN2BT14TestNodeConfigELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %29) #5
  %31 = getelementptr inbounds %"struct.BT::TestNodeConfig", ptr %30, i32 0, i32 0
  %32 = load i32, ptr %31, align 8, !tbaa !9
  br label %33

33:                                               ; preds = %28, %27
  %34 = phi i32 [ %26, %27 ], [ %32, %28 ]
  store i32 %34, ptr %6, align 4, !tbaa !18
  %35 = load i32, ptr %6, align 4, !tbaa !18
  %36 = icmp eq i32 %35, 2
  br i1 %36, label %37, label %51

37:                                               ; preds = %33
  %38 = getelementptr inbounds %"class.BT::TestNode", ptr %10, i32 0, i32 3
  %39 = call noundef zeroext i1 @_ZNKSt8functionIFN2BT3AnyERNS0_3Ast11EnvironmentEEEcvbEv(ptr noundef nonnull align 8 dereferenceable(32) %38) #5
  br i1 %39, label %40, label %51

40:                                               ; preds = %37
  %41 = getelementptr inbounds %"class.BT::TestNode", ptr %10, i32 0, i32 3
  invoke void @_ZNKSt8functionIFN2BT3AnyERNS0_3Ast11EnvironmentEEEclES4_(ptr dead_on_unwind writable sret(%"class.BT::Any") align 8 %7, ptr noundef nonnull align 8 dereferenceable(32) %41, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %42 unwind label %47

42:                                               ; preds = %40
  call void @_ZN2BT3AnyD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  br label %61

43:                                               ; preds = %1
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %4, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %5, align 4
  call void @_ZNSt12__shared_ptrIN2BT10BlackboardELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #5
  br label %69

47:                                               ; preds = %64, %57, %40, %22
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %4, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @_ZN2BT3Ast11EnvironmentD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  br label %69

51:                                               ; preds = %37, %33
  %52 = load i32, ptr %6, align 4, !tbaa !18
  %53 = icmp eq i32 %52, 3
  br i1 %53, label %54, label %60

54:                                               ; preds = %51
  %55 = getelementptr inbounds %"class.BT::TestNode", ptr %10, i32 0, i32 4
  %56 = call noundef zeroext i1 @_ZNKSt8functionIFN2BT3AnyERNS0_3Ast11EnvironmentEEEcvbEv(ptr noundef nonnull align 8 dereferenceable(32) %55) #5
  br i1 %56, label %57, label %60

57:                                               ; preds = %54
  %58 = getelementptr inbounds %"class.BT::TestNode", ptr %10, i32 0, i32 4
  invoke void @_ZNKSt8functionIFN2BT3AnyERNS0_3Ast11EnvironmentEEEclES4_(ptr dead_on_unwind writable sret(%"class.BT::Any") align 8 %8, ptr noundef nonnull align 8 dereferenceable(32) %58, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %59 unwind label %47

59:                                               ; preds = %57
  call void @_ZN2BT3AnyD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  br label %60

60:                                               ; preds = %59, %54, %51
  br label %61

61:                                               ; preds = %60, %42
  %62 = getelementptr inbounds %"class.BT::TestNode", ptr %10, i32 0, i32 5
  %63 = call noundef zeroext i1 @_ZNKSt8functionIFN2BT3AnyERNS0_3Ast11EnvironmentEEEcvbEv(ptr noundef nonnull align 8 dereferenceable(32) %62) #5
  br i1 %63, label %64, label %67

64:                                               ; preds = %61
  %65 = getelementptr inbounds %"class.BT::TestNode", ptr %10, i32 0, i32 5
  invoke void @_ZNKSt8functionIFN2BT3AnyERNS0_3Ast11EnvironmentEEEclES4_(ptr dead_on_unwind writable sret(%"class.BT::Any") align 8 %9, ptr noundef nonnull align 8 dereferenceable(32) %65, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %66 unwind label %47

66:                                               ; preds = %64
  call void @_ZN2BT3AnyD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #5
  br label %67

67:                                               ; preds = %66, %61
  %68 = load i32, ptr %6, align 4, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @_ZN2BT3Ast11EnvironmentD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #5
  ret i32 %68

69:                                               ; preds = %47, %43
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #5
  br label %70

70:                                               ; preds = %69
  %71 = load ptr, ptr %4, align 8
  %72 = load i32, ptr %5, align 4
  %73 = insertvalue { ptr, i32 } poison, ptr %71, 0
  %74 = insertvalue { ptr, i32 } %73, i32 %72, 1
  resume { ptr, i32 } %74
}

declare noundef nonnull align 8 dereferenceable(344) ptr @_ZN2BT8TreeNode6configEv(ptr noundef nonnull align 8 dereferenceable(16)) #3

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNKSt8functionIFN2BT3AnyERNS0_3Ast11EnvironmentEEEclES4_(ptr dead_on_unwind noalias writable sret(%"class.BT::Any") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #2 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN2BT3Ast11EnvironmentD2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4 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 = { 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 = { "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 }

!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, !11, i64 0}
!10 = !{!"_ZTSN2BT14TestNodeConfigE", !11, i64 0, !12, i64 8, !12, i64 40, !12, i64 72, !15, i64 104, !16, i64 112}
!11 = !{!"_ZTSN2BT10NodeStatusE", !7, i64 0}
!12 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !13, i64 0, !14, i64 8, !7, i64 16}
!13 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!"_ZTSNSt6chrono8durationIlSt5ratioILl1ELl1000EEEE", !14, i64 0}
!16 = !{!"_ZTSSt8functionIFN2BT10NodeStatusEvEE", !17, i64 0, !6, i64 24}
!17 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!18 = !{!11, !11, i64 0}


; 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.BT::Ast::Environment" = type { %"class.std::shared_ptr.7", %"class.std::shared_ptr.10" }
%"class.std::shared_ptr.7" = type { %"class.std::__shared_ptr.8" }
%"class.std::__shared_ptr.8" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::shared_ptr.10" = type { %"class.std::__shared_ptr.11" }
%"class.std::__shared_ptr.11" = type { ptr, %"class.std::__shared_count" }
%"class.BT::Any" = type { %"class.linb::any", %"struct.std::type_index" }
%"class.linb::any" = type { %"union.linb::any::storage_union", ptr }
%"union.linb::any::storage_union" = type { ptr, [8 x i8] }
%"struct.std::type_index" = type { ptr }

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN2BT8TestNode11onCompletedEv(ptr noundef nonnull align 8 dereferenceable(329) %0) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"struct.BT::Ast::Environment", align 8
  %3 = alloca %"class.BT::Any", align 8
  %4 = alloca %"class.BT::Any", align 8
  %5 = alloca %"class.BT::Any", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #5
  %6 = tail call noundef nonnull align 8 dereferenceable(344) ptr @_ZN2BT8TreeNode6configEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
  call void @_ZNSt10shared_ptrIN2BT10BlackboardEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(16) %6) #5
  %7 = invoke noundef nonnull align 8 dereferenceable(344) ptr @_ZN2BT8TreeNode6configEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
          to label %8 unwind label %27

8:                                                ; preds = %1
  %9 = getelementptr inbounds i8, ptr %2, i64 16
  %10 = getelementptr inbounds i8, ptr %7, i64 16
  call void @_ZNSt10shared_ptrISt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4hashIS6_ESt8equal_toIS6_ESaISt4pairIKS6_iEEEEC2ERKSG_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %10) #5
  %11 = getelementptr inbounds i8, ptr %0, i64 24
  %12 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN2BT14TestNodeConfigELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %11) #5
  %13 = getelementptr inbounds i8, ptr %12, i64 112
  %14 = call noundef zeroext i1 @_ZNKSt8functionIFN2BT10NodeStatusEvEEcvbEv(ptr noundef nonnull align 8 dereferenceable(32) %13) #5
  %15 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN2BT14TestNodeConfigELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %11) #5
  br i1 %14, label %16, label %19

16:                                               ; preds = %8
  %17 = getelementptr inbounds i8, ptr %15, i64 112
  %18 = invoke noundef i32 @_ZNKSt8functionIFN2BT10NodeStatusEvEEclEv(ptr noundef nonnull align 8 dereferenceable(32) %17)
          to label %21 unwind label %29

19:                                               ; preds = %8
  %20 = load i32, ptr %15, align 8, !tbaa !5
  br label %21

21:                                               ; preds = %16, %19
  %22 = phi i32 [ %20, %19 ], [ %18, %16 ]
  switch i32 %22, label %35 [
    i32 2, label %23
    i32 3, label %31
  ]

23:                                               ; preds = %21
  %24 = getelementptr inbounds i8, ptr %0, i64 40
  %25 = call noundef zeroext i1 @_ZNKSt8functionIFN2BT3AnyERNS0_3Ast11EnvironmentEEEcvbEv(ptr noundef nonnull align 8 dereferenceable(32) %24) #5
  br i1 %25, label %26, label %35

26:                                               ; preds = %23
  invoke void @_ZNKSt8functionIFN2BT3AnyERNS0_3Ast11EnvironmentEEEclES4_(ptr dead_on_unwind nonnull writable sret(%"class.BT::Any") align 8 %3, ptr noundef nonnull align 8 dereferenceable(32) %24, ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %.sink.split unwind label %29

27:                                               ; preds = %1
  %28 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt12__shared_ptrIN2BT10BlackboardELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #5
  br label %41

29:                                               ; preds = %38, %34, %26, %16
  %30 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN2BT3Ast11EnvironmentD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  br label %41

31:                                               ; preds = %21
  %32 = getelementptr inbounds i8, ptr %0, i64 72
  %33 = call noundef zeroext i1 @_ZNKSt8functionIFN2BT3AnyERNS0_3Ast11EnvironmentEEEcvbEv(ptr noundef nonnull align 8 dereferenceable(32) %32) #5
  br i1 %33, label %34, label %35

34:                                               ; preds = %31
  invoke void @_ZNKSt8functionIFN2BT3AnyERNS0_3Ast11EnvironmentEEEclES4_(ptr dead_on_unwind nonnull writable sret(%"class.BT::Any") align 8 %4, ptr noundef nonnull align 8 dereferenceable(32) %32, ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %.sink.split unwind label %29

.sink.split:                                      ; preds = %34, %26
  %.sink = phi ptr [ %3, %26 ], [ %4, %34 ]
  call void @_ZN2BT3AnyD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %.sink) #5
  br label %35

35:                                               ; preds = %.sink.split, %23, %21, %31
  %36 = getelementptr inbounds i8, ptr %0, i64 104
  %37 = call noundef zeroext i1 @_ZNKSt8functionIFN2BT3AnyERNS0_3Ast11EnvironmentEEEcvbEv(ptr noundef nonnull align 8 dereferenceable(32) %36) #5
  br i1 %37, label %38, label %40

38:                                               ; preds = %35
  invoke void @_ZNKSt8functionIFN2BT3AnyERNS0_3Ast11EnvironmentEEEclES4_(ptr dead_on_unwind nonnull writable sret(%"class.BT::Any") align 8 %5, ptr noundef nonnull align 8 dereferenceable(32) %36, ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %39 unwind label %29

39:                                               ; preds = %38
  call void @_ZN2BT3AnyD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  br label %40

40:                                               ; preds = %39, %35
  call void @_ZN2BT3Ast11EnvironmentD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #5
  ret i32 %22

41:                                               ; preds = %29, %27
  %.pn = phi { ptr, i32 } [ %30, %29 ], [ %28, %27 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #5
  resume { ptr, i32 } %.pn
}

declare noundef nonnull align 8 dereferenceable(344) ptr @_ZN2BT8TreeNode6configEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNKSt8functionIFN2BT3AnyERNS0_3Ast11EnvironmentEEEclES4_(ptr dead_on_unwind noalias writable sret(%"class.BT::Any") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN2BT3Ast11EnvironmentD2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4 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 = { 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 = { "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 }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTSN2BT14TestNodeConfigE", !7, i64 0, !10, i64 8, !10, i64 40, !10, i64 72, !14, i64 104, !15, i64 112}
!7 = !{!"_ZTSN2BT10NodeStatusE", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !11, i64 0, !13, i64 8, !8, i64 16}
!11 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !12, i64 0}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!"long", !8, i64 0}
!14 = !{!"_ZTSNSt6chrono8durationIlSt5ratioILl1ELl1000EEEE", !13, i64 0}
!15 = !{!"_ZTSSt8functionIFN2BT10NodeStatusEvEE", !16, i64 0, !12, i64 24}
!16 = !{!"_ZTSSt14_Function_base", !8, i64 0, !12, i64 16}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass,TailCallElimPass