; LLVM IR from BehaviorTree/BehaviorTree.CPP :: src/tree_node.ll (ZN2BT8TreeNode18checkPreConditionsB5cxx11Ev)

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

%"class.nonstd::expected_lite::expected" = type { %"class.nonstd::expected_lite::detail::storage_t" }
%"class.nonstd::expected_lite::detail::storage_t" = type { %"class.nonstd::expected_lite::detail::storage_t_impl.base", [7 x i8] }
%"class.nonstd::expected_lite::detail::storage_t_impl.base" = type <{ %union.anon.34, i8 }>
%union.anon.34 = type { %"class.std::__cxx11::basic_string" }
%"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] }
%"struct.BT::Ast::Environment" = type { %"class.std::shared_ptr", %"class.std::shared_ptr.0" }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::shared_ptr.0" = type { %"class.std::__shared_ptr.1" }
%"class.std::__shared_ptr.1" = 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 }
%"class.nonstd::expected_lite::unexpected_type" = type { ptr }
%"struct.BT::NodeConfig" = type { %"class.std::shared_ptr", %"class.std::shared_ptr.0", %"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.11" }
%"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::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.11" = type { %"class.std::_Rb_tree.12" }
%"class.std::_Rb_tree.12" = 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::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.18" }
%"struct.std::_Head_base.18" = type { ptr }
%"struct.BT::TreeNode::PImpl" = type { %"class.std::__cxx11::basic_string", i32, %"class.std::condition_variable", %"class.std::mutex", %"class.BT::Signal", %"struct.BT::NodeConfig", %"class.std::__cxx11::basic_string", %"class.std::function", %"class.std::function.22", %"class.std::function.25", %"class.std::mutex", %"class.std::shared_ptr.27", %"struct.std::array.30", %"struct.std::array.30" }
%"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.BT::Signal" = type { %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::weak_ptr<std::function<void (std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1, 1000000000>>>, const BT::TreeNode &, BT::NodeStatus, BT::NodeStatus)>>, std::allocator<std::weak_ptr<std::function<void (std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1, 1000000000>>>, const BT::TreeNode &, BT::NodeStatus, BT::NodeStatus)>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::weak_ptr<std::function<void (std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1, 1000000000>>>, const BT::TreeNode &, BT::NodeStatus, BT::NodeStatus)>>, std::allocator<std::weak_ptr<std::function<void (std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1, 1000000000>>>, const BT::TreeNode &, BT::NodeStatus, BT::NodeStatus)>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::weak_ptr<std::function<void (std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1, 1000000000>>>, const BT::TreeNode &, BT::NodeStatus, BT::NodeStatus)>>, std::allocator<std::weak_ptr<std::function<void (std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1, 1000000000>>>, const BT::TreeNode &, BT::NodeStatus, BT::NodeStatus)>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::weak_ptr<std::function<void (std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1, 1000000000>>>, const BT::TreeNode &, BT::NodeStatus, BT::NodeStatus)>>, std::allocator<std::weak_ptr<std::function<void (std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1, 1000000000>>>, const BT::TreeNode &, BT::NodeStatus, BT::NodeStatus)>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::function" = 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.std::function.22" = type { %"class.std::_Function_base", ptr }
%"class.std::function.25" = type { %"class.std::_Function_base", ptr }
%"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.std::shared_ptr.27" = type { %"class.std::__shared_ptr.28" }
%"class.std::__shared_ptr.28" = type { ptr, %"class.std::__shared_count" }
%"struct.std::array.30" = type { [4 x %"class.std::function.31"] }
%"class.std::function.31" = type { %"class.std::_Function_base", ptr }

@.str.13 = external hidden unnamed_addr constant [1 x i8], align 1

; 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 @_ZNKSt10unique_ptrIN2BT8TreeNode5PImplESt14default_deleteIS2_EEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2BT8TreeNode18checkPreConditionsB5cxx11Ev(ptr dead_on_unwind noalias writable sret(%"class.nonstd::expected_lite::expected") align 8 %0, ptr noundef nonnull align 8 dereferenceable(16) %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"struct.BT::Ast::Environment", align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %"class.BT::Any", align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %"class.BT::Any", align 8
  %18 = alloca i32, align 4
  %19 = alloca %"class.nonstd::expected_lite::unexpected_type", align 8
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  %20 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #4
  %21 = getelementptr inbounds %"struct.BT::Ast::Environment", ptr %5, i32 0, i32 0
  %22 = call noundef nonnull align 8 dereferenceable(344) ptr @_ZN2BT8TreeNode6configEv(ptr noundef nonnull align 8 dereferenceable(16) %20)
  %23 = getelementptr inbounds %"struct.BT::NodeConfig", ptr %22, i32 0, i32 0
  call void @_ZNSt10shared_ptrIN2BT10BlackboardEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(16) %23) #4
  %24 = getelementptr inbounds %"struct.BT::Ast::Environment", ptr %5, i32 0, i32 1
  %25 = invoke noundef nonnull align 8 dereferenceable(344) ptr @_ZN2BT8TreeNode6configEv(ptr noundef nonnull align 8 dereferenceable(16) %20)
          to label %26 unwind label %32

26:                                               ; preds = %2
  %27 = getelementptr inbounds %"struct.BT::NodeConfig", ptr %25, i32 0, i32 1
  call void @_ZNSt10shared_ptrISt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4hashIS6_ESt8equal_toIS6_ESaISt4pairIKS6_iEEEEC2ERKSG_(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 8 dereferenceable(16) %27) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  store i64 0, ptr %8, align 8, !tbaa !9
  br label %28

28:                                               ; preds = %131, %26
  %29 = load i64, ptr %8, align 8, !tbaa !9
  %30 = icmp ult i64 %29, 4
  br i1 %30, label %36, label %31

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

32:                                               ; preds = %2
  %33 = landingpad { ptr, i32 }
          cleanup
  %34 = extractvalue { ptr, i32 } %33, 0
  store ptr %34, ptr %6, align 8
  %35 = extractvalue { ptr, i32 } %33, 1
  store i32 %35, ptr %7, align 4
  call void @_ZNSt12__shared_ptrIN2BT10BlackboardELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %21) #4
  br label %148

36:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %37 = getelementptr inbounds %"class.BT::TreeNode", ptr %20, i32 0, i32 1
  %38 = call noundef ptr @_ZNKSt10unique_ptrIN2BT8TreeNode5PImplESt14default_deleteIS2_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %37) #4
  %39 = getelementptr inbounds %"struct.BT::TreeNode::PImpl", ptr %38, i32 0, i32 12
  %40 = load i64, ptr %8, align 8, !tbaa !9
  %41 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt5arrayISt8functionIFN2BT3AnyERNS1_3Ast11EnvironmentEEELm4EEixEm(ptr noundef nonnull align 8 dereferenceable(128) %39, i64 noundef %40) #4
  store ptr %41, ptr %10, align 8, !tbaa !5
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  %43 = call noundef zeroext i1 @_ZNKSt8functionIFN2BT3AnyERNS0_3Ast11EnvironmentEEEcvbEv(ptr noundef nonnull align 8 dereferenceable(32) %42) #4
  br i1 %43, label %45, label %44

44:                                               ; preds = %36
  store i32 4, ptr %9, align 4
  br label %128

45:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %46 = load i64, ptr %8, align 8, !tbaa !9
  %47 = trunc i64 %46 to i32
  store i32 %47, ptr %11, align 4, !tbaa !11
  %48 = getelementptr inbounds %"class.BT::TreeNode", ptr %20, i32 0, i32 1
  %49 = call noundef ptr @_ZNKSt10unique_ptrIN2BT8TreeNode5PImplESt14default_deleteIS2_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %48) #4
  %50 = getelementptr inbounds %"struct.BT::TreeNode::PImpl", ptr %49, i32 0, i32 1
  %51 = load i32, ptr %50, align 8, !tbaa !13
  %52 = icmp eq i32 %51, 0
  br i1 %52, label %59, label %53

53:                                               ; preds = %45
  %54 = getelementptr inbounds %"class.BT::TreeNode", ptr %20, i32 0, i32 1
  %55 = call noundef ptr @_ZNKSt10unique_ptrIN2BT8TreeNode5PImplESt14default_deleteIS2_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %54) #4
  %56 = getelementptr inbounds %"struct.BT::TreeNode::PImpl", ptr %55, i32 0, i32 1
  %57 = load i32, ptr %56, align 8, !tbaa !13
  %58 = icmp eq i32 %57, 4
  br i1 %58, label %59, label %94

59:                                               ; preds = %53, %45
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #4
  %60 = load ptr, ptr %10, align 8, !tbaa !5
  invoke void @_ZNKSt8functionIFN2BT3AnyERNS0_3Ast11EnvironmentEEEclES4_(ptr dead_on_unwind writable sret(%"class.BT::Any") align 8 %12, ptr noundef nonnull align 8 dereferenceable(32) %60, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %61 unwind label %68

61:                                               ; preds = %59
  %62 = invoke noundef zeroext i1 @_ZNK2BT3Any4castIbEET_v(ptr noundef nonnull align 8 dereferenceable(32) %12)
          to label %63 unwind label %72

63:                                               ; preds = %61
  call void @_ZN2BT3AnyD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #4
  br i1 %62, label %64, label %88

64:                                               ; preds = %63
  %65 = load i32, ptr %11, align 4, !tbaa !11
  %66 = icmp eq i32 %65, 0
  br i1 %66, label %67, label %77

67:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 3, ptr %13, align 4, !tbaa !59
  call void @_ZN6nonstd13expected_lite8expectedIN2BT10NodeStatusENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IS3_TnNSt9enable_ifIXaaaaaaaasr3std16is_constructibleIS3_OT_EE5valuentsr3std7is_sameINS0_5std2012remove_cvrefISD_E4typeESt10in_place_tEE5valuentsr3std7is_sameISA_SI_EE5valuentsr3std7is_sameINS0_15unexpected_typeIS9_EESI_EE5valuesr3std14is_convertibleISE_S3_EE5valueEiE4typeELi0EEESE_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 4 dereferenceable(4) %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  store i32 1, ptr %9, align 4
  br label %127

68:                                               ; preds = %59
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %6, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %7, align 4
  br label %76

72:                                               ; preds = %61
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %6, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %7, align 4
  call void @_ZN2BT3AnyD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #4
  br label %76

76:                                               ; preds = %72, %68
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #4
  br label %134

77:                                               ; preds = %64
  %78 = load i32, ptr %11, align 4, !tbaa !11
  %79 = icmp eq i32 %78, 1
  br i1 %79, label %80, label %81

80:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 2, ptr %14, align 4, !tbaa !59
  call void @_ZN6nonstd13expected_lite8expectedIN2BT10NodeStatusENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IS3_TnNSt9enable_ifIXaaaaaaaasr3std16is_constructibleIS3_OT_EE5valuentsr3std7is_sameINS0_5std2012remove_cvrefISD_E4typeESt10in_place_tEE5valuentsr3std7is_sameISA_SI_EE5valuentsr3std7is_sameINS0_15unexpected_typeIS9_EESI_EE5valuesr3std14is_convertibleISE_S3_EE5valueEiE4typeELi0EEESE_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 4 dereferenceable(4) %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  store i32 1, ptr %9, align 4
  br label %127

81:                                               ; preds = %77
  %82 = load i32, ptr %11, align 4, !tbaa !11
  %83 = icmp eq i32 %82, 2
  br i1 %83, label %84, label %85

84:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store i32 4, ptr %15, align 4, !tbaa !59
  call void @_ZN6nonstd13expected_lite8expectedIN2BT10NodeStatusENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IS3_TnNSt9enable_ifIXaaaaaaaasr3std16is_constructibleIS3_OT_EE5valuentsr3std7is_sameINS0_5std2012remove_cvrefISD_E4typeESt10in_place_tEE5valuentsr3std7is_sameISA_SI_EE5valuentsr3std7is_sameINS0_15unexpected_typeIS9_EESI_EE5valuesr3std14is_convertibleISE_S3_EE5valueEiE4typeELi0EEESE_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 4 dereferenceable(4) %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  store i32 1, ptr %9, align 4
  br label %127

85:                                               ; preds = %81
  br label %86

86:                                               ; preds = %85
  br label %87

87:                                               ; preds = %86
  br label %93

88:                                               ; preds = %63
  %89 = load i32, ptr %11, align 4, !tbaa !11
  %90 = icmp eq i32 %89, 3
  br i1 %90, label %91, label %92

91:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store i32 4, ptr %16, align 4, !tbaa !59
  call void @_ZN6nonstd13expected_lite8expectedIN2BT10NodeStatusENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IS3_TnNSt9enable_ifIXaaaaaaaasr3std16is_constructibleIS3_OT_EE5valuentsr3std7is_sameINS0_5std2012remove_cvrefISD_E4typeESt10in_place_tEE5valuentsr3std7is_sameISA_SI_EE5valuentsr3std7is_sameINS0_15unexpected_typeIS9_EESI_EE5valuesr3std14is_convertibleISE_S3_EE5valueEiE4typeELi0EEESE_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 4 dereferenceable(4) %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  store i32 1, ptr %9, align 4
  br label %127

92:                                               ; preds = %88
  br label %93

93:                                               ; preds = %92, %87
  br label %126

94:                                               ; preds = %53
  %95 = getelementptr inbounds %"class.BT::TreeNode", ptr %20, i32 0, i32 1
  %96 = call noundef ptr @_ZNKSt10unique_ptrIN2BT8TreeNode5PImplESt14default_deleteIS2_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %95) #4
  %97 = getelementptr inbounds %"struct.BT::TreeNode::PImpl", ptr %96, i32 0, i32 1
  %98 = load i32, ptr %97, align 8, !tbaa !13
  %99 = icmp eq i32 %98, 1
  br i1 %99, label %100, label %125

100:                                              ; preds = %94
  %101 = load i32, ptr %11, align 4, !tbaa !11
  %102 = icmp eq i32 %101, 3
  br i1 %102, label %103, label %125

103:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 32, ptr %17) #4
  %104 = load ptr, ptr %10, align 8, !tbaa !5
  invoke void @_ZNKSt8functionIFN2BT3AnyERNS0_3Ast11EnvironmentEEEclES4_(ptr dead_on_unwind writable sret(%"class.BT::Any") align 8 %17, ptr noundef nonnull align 8 dereferenceable(32) %104, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %105 unwind label %111

105:                                              ; preds = %103
  %106 = invoke noundef zeroext i1 @_ZNK2BT3Any4castIbEET_v(ptr noundef nonnull align 8 dereferenceable(32) %17)
          to label %107 unwind label %115

107:                                              ; preds = %105
  %108 = xor i1 %106, true
  call void @_ZN2BT3AnyD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #4
  br i1 %108, label %109, label %124

109:                                              ; preds = %107
  invoke void @_ZN2BT8TreeNode8haltNodeEv(ptr noundef nonnull align 8 dereferenceable(16) %20)
          to label %110 unwind label %120

110:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  store i32 4, ptr %18, align 4, !tbaa !59
  call void @_ZN6nonstd13expected_lite8expectedIN2BT10NodeStatusENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IS3_TnNSt9enable_ifIXaaaaaaaasr3std16is_constructibleIS3_OT_EE5valuentsr3std7is_sameINS0_5std2012remove_cvrefISD_E4typeESt10in_place_tEE5valuentsr3std7is_sameISA_SI_EE5valuentsr3std7is_sameINS0_15unexpected_typeIS9_EESI_EE5valuesr3std14is_convertibleISE_S3_EE5valueEiE4typeELi0EEESE_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 4 dereferenceable(4) %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  store i32 1, ptr %9, align 4
  br label %127

111:                                              ; preds = %103
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %6, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %7, align 4
  br label %119

115:                                              ; preds = %105
  %116 = landingpad { ptr, i32 }
          cleanup
  %117 = extractvalue { ptr, i32 } %116, 0
  store ptr %117, ptr %6, align 8
  %118 = extractvalue { ptr, i32 } %116, 1
  store i32 %118, ptr %7, align 4
  call void @_ZN2BT3AnyD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #4
  br label %119

119:                                              ; preds = %115, %111
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #4
  br label %134

120:                                              ; preds = %109
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %6, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %7, align 4
  br label %134

124:                                              ; preds = %107
  br label %125

125:                                              ; preds = %124, %100, %94
  br label %126

126:                                              ; preds = %125, %93
  store i32 0, ptr %9, align 4
  br label %127

127:                                              ; preds = %126, %110, %91, %84, %80, %67
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %128

128:                                              ; preds = %127, %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  %129 = load i32, ptr %9, align 4
  switch i32 %129, label %135 [
    i32 0, label %130
    i32 4, label %131
  ]

130:                                              ; preds = %128
  br label %131

131:                                              ; preds = %130, %128
  %132 = load i64, ptr %8, align 8, !tbaa !9
  %133 = add i64 %132, 1
  store i64 %133, ptr %8, align 8, !tbaa !9
  br label %28, !llvm.loop !60

134:                                              ; preds = %120, %119, %76
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %147

135:                                              ; preds = %128, %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  %136 = load i32, ptr %9, align 4
  switch i32 %136, label %146 [
    i32 2, label %137
  ]

137:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %138 = invoke ptr @_ZN6nonstd13expected_lite15make_unexpectedIRA1_KcEENS0_15unexpected_typeINSt5decayIT_E4typeEEEOS7_(ptr noundef nonnull align 1 dereferenceable(1) @.str.13)
          to label %139 unwind label %142

139:                                              ; preds = %137
  %140 = getelementptr inbounds %"class.nonstd::expected_lite::unexpected_type", ptr %19, i32 0, i32 0
  store ptr %138, ptr %140, align 8
  invoke void @_ZN6nonstd13expected_lite8expectedIN2BT10NodeStatusENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IPKcTnNSt9enable_ifIXaasr3std16is_constructibleIS9_OT_EE5valuesr3std14is_convertibleISG_S9_EE5valueEiE4typeELi0EEEONS0_15unexpected_typeISF_EE(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(8) %19)
          to label %141 unwind label %142

141:                                              ; preds = %139
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  store i32 1, ptr %9, align 4
  br label %146

142:                                              ; preds = %139, %137
  %143 = landingpad { ptr, i32 }
          cleanup
  %144 = extractvalue { ptr, i32 } %143, 0
  store ptr %144, ptr %6, align 8
  %145 = extractvalue { ptr, i32 } %143, 1
  store i32 %145, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  br label %147

146:                                              ; preds = %141, %135
  call void @_ZN2BT3Ast11EnvironmentD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #4
  ret void

147:                                              ; preds = %142, %134
  call void @_ZN2BT3Ast11EnvironmentD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #4
  br label %148

148:                                              ; preds = %147, %32
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #4
  br label %149

149:                                              ; preds = %148
  %150 = load ptr, ptr %6, align 8
  %151 = load i32, ptr %7, align 4
  %152 = insertvalue { ptr, i32 } poison, ptr %150, 0
  %153 = insertvalue { ptr, i32 } %152, i32 %151, 1
  resume { ptr, i32 } %153
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt5arrayISt8functionIFN2BT3AnyERNS1_3Ast11EnvironmentEEELm4EEixEm(ptr noundef nonnull align 8 dereferenceable(128), i64 noundef) #1 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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(344) ptr @_ZN2BT8TreeNode6configEv(ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6nonstd13expected_lite8expectedIN2BT10NodeStatusENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IPKcTnNSt9enable_ifIXaasr3std16is_constructibleIS9_OT_EE5valuesr3std14is_convertibleISG_S9_EE5valueEiE4typeELi0EEEONS0_15unexpected_typeISF_EE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #2 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 = { 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 #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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTSN2BT7PreCondE", !7, i64 0}
!13 = !{!14, !17, i64 32}
!14 = !{!"_ZTSN2BT8TreeNode5PImplE", !15, i64 0, !17, i64 32, !18, i64 40, !20, i64 88, !22, i64 128, !27, i64 152, !15, i64 496, !52, i64 528, !54, i64 560, !55, i64 592, !20, i64 624, !56, i64 664, !58, i64 680, !58, i64 808}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !16, i64 0, !10, i64 8, !7, i64 16}
!16 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!17 = !{!"_ZTSN2BT10NodeStatusE", !7, i64 0}
!18 = !{!"_ZTSSt18condition_variable", !19, i64 0}
!19 = !{!"_ZTSSt9__condvar", !7, i64 0}
!20 = !{!"_ZTSSt5mutex", !21, i64 0}
!21 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!22 = !{!"_ZTSN2BT6SignalIJNSt6chrono10time_pointINS1_3_V212system_clockENS1_8durationIlSt5ratioILl1ELl1000000000EEEEEERKNS_8TreeNodeENS_10NodeStatusESD_EEE", !23, i64 0}
!23 = !{!"_ZTSSt6vectorISt8weak_ptrISt8functionIFvNSt6chrono10time_pointINS2_3_V212system_clockENS2_8durationIlSt5ratioILl1ELl1000000000EEEEEERKN2BT8TreeNodeENSB_10NodeStatusESF_EEESaISI_EE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseISt8weak_ptrISt8functionIFvNSt6chrono10time_pointINS2_3_V212system_clockENS2_8durationIlSt5ratioILl1ELl1000000000EEEEEERKN2BT8TreeNodeENSB_10NodeStatusESF_EEESaISI_EE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseISt8weak_ptrISt8functionIFvNSt6chrono10time_pointINS2_3_V212system_clockENS2_8durationIlSt5ratioILl1ELl1000000000EEEEEERKN2BT8TreeNodeENSB_10NodeStatusESF_EEESaISI_EE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseISt8weak_ptrISt8functionIFvNSt6chrono10time_pointINS2_3_V212system_clockENS2_8durationIlSt5ratioILl1ELl1000000000EEEEEERKN2BT8TreeNodeENSB_10NodeStatusESF_EEESaISI_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!27 = !{!"_ZTSN2BT10NodeConfigE", !28, i64 0, !31, i64 16, !33, i64 32, !33, i64 88, !33, i64 144, !6, i64 200, !38, i64 208, !15, i64 216, !39, i64 248, !47, i64 296}
!28 = !{!"_ZTSSt10shared_ptrIN2BT10BlackboardEE", !29, i64 0}
!29 = !{!"_ZTSSt12__shared_ptrIN2BT10BlackboardELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !30, i64 8}
!30 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!31 = !{!"_ZTSSt10shared_ptrISt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4hashIS6_ESt8equal_toIS6_ESaISt4pairIKS6_iEEEE", !32, i64 0}
!32 = !{!"_ZTSSt12__shared_ptrISt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4hashIS6_ESt8equal_toIS6_ESaISt4pairIKS6_iEEELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !30, i64 8}
!33 = !{!"_ZTSSt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES5_St4hashIS5_ESt8equal_toIS5_ESaISt4pairIKS5_S5_EEE", !34, i64 0}
!34 = !{!"_ZTSSt10_HashtableINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_S5_ESaIS8_ENSt8__detail10_Select1stESt8equal_toIS5_ESt4hashIS5_ENSA_18_Mod_range_hashingENSA_20_Default_ranged_hashENSA_20_Prime_rehash_policyENSA_17_Hashtable_traitsILb1ELb0ELb1EEEE", !6, i64 0, !10, i64 8, !35, i64 16, !10, i64 24, !36, i64 32, !6, i64 48}
!35 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !6, i64 0}
!36 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !37, i64 0, !10, i64 8}
!37 = !{!"float", !7, i64 0}
!38 = !{!"short", !7, i64 0}
!39 = !{!"_ZTSSt3mapIN2BT7PreCondENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS1_ESaISt4pairIKS1_S7_EEE", !40, i64 0}
!40 = !{!"_ZTSSt8_Rb_treeIN2BT7PreCondESt4pairIKS1_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEESt10_Select1stISA_ESt4lessIS1_ESaISA_EE", !41, i64 0}
!41 = !{!"_ZTSNSt8_Rb_treeIN2BT7PreCondESt4pairIKS1_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEESt10_Select1stISA_ESt4lessIS1_ESaISA_EE13_Rb_tree_implISE_Lb1EEE", !42, i64 0, !44, i64 8}
!42 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIN2BT7PreCondEEE", !43, i64 0}
!43 = !{!"_ZTSSt4lessIN2BT7PreCondEE"}
!44 = !{!"_ZTSSt15_Rb_tree_header", !45, i64 0, !10, i64 32}
!45 = !{!"_ZTSSt18_Rb_tree_node_base", !46, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!46 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!47 = !{!"_ZTSSt3mapIN2BT8PostCondENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS1_ESaISt4pairIKS1_S7_EEE", !48, i64 0}
!48 = !{!"_ZTSSt8_Rb_treeIN2BT8PostCondESt4pairIKS1_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEESt10_Select1stISA_ESt4lessIS1_ESaISA_EE", !49, i64 0}
!49 = !{!"_ZTSNSt8_Rb_treeIN2BT8PostCondESt4pairIKS1_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEESt10_Select1stISA_ESt4lessIS1_ESaISA_EE13_Rb_tree_implISE_Lb1EEE", !50, i64 0, !44, i64 8}
!50 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIN2BT8PostCondEEE", !51, i64 0}
!51 = !{!"_ZTSSt4lessIN2BT8PostCondEE"}
!52 = !{!"_ZTSSt8functionIFN2BT10NodeStatusERNS0_8TreeNodeEEE", !53, i64 0, !6, i64 24}
!53 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!54 = !{!"_ZTSSt8functionIFN2BT10NodeStatusERNS0_8TreeNodeES1_EE", !53, i64 0, !6, i64 24}
!55 = !{!"_ZTSSt8functionIFvRN2BT8TreeNodeENS0_10NodeStatusENSt6chrono8durationIlSt5ratioILl1ELl1000000EEEEEE", !53, i64 0, !6, i64 24}
!56 = !{!"_ZTSSt10shared_ptrIN2BT12WakeUpSignalEE", !57, i64 0}
!57 = !{!"_ZTSSt12__shared_ptrIN2BT12WakeUpSignalELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !30, i64 8}
!58 = !{!"_ZTSSt5arrayISt8functionIFN2BT3AnyERNS1_3Ast11EnvironmentEEELm4EE", !7, i64 0}
!59 = !{!17, !17, i64 0}
!60 = distinct !{!60, !61}
!61 = !{!"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"

%"class.nonstd::expected_lite::expected" = type { %"class.nonstd::expected_lite::detail::storage_t" }
%"class.nonstd::expected_lite::detail::storage_t" = type { %"class.nonstd::expected_lite::detail::storage_t_impl.base", [7 x i8] }
%"class.nonstd::expected_lite::detail::storage_t_impl.base" = type <{ %union.anon.34, i8 }>
%union.anon.34 = type { %"class.std::__cxx11::basic_string" }
%"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] }
%"struct.BT::Ast::Environment" = type { %"class.std::shared_ptr", %"class.std::shared_ptr.0" }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::shared_ptr.0" = type { %"class.std::__shared_ptr.1" }
%"class.std::__shared_ptr.1" = 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 }
%"class.nonstd::expected_lite::unexpected_type" = type { ptr }

@.str.13 = external hidden unnamed_addr constant [1 x i8], align 1

; 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 @_ZNKSt10unique_ptrIN2BT8TreeNode5PImplESt14default_deleteIS2_EEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2BT8TreeNode18checkPreConditionsB5cxx11Ev(ptr dead_on_unwind noalias writable sret(%"class.nonstd::expected_lite::expected") align 8 %0, ptr noundef nonnull align 8 dereferenceable(16) %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"struct.BT::Ast::Environment", align 8
  %4 = alloca %"class.BT::Any", align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.BT::Any", align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.nonstd::expected_lite::unexpected_type", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #4
  %12 = tail call noundef nonnull align 8 dereferenceable(344) ptr @_ZN2BT8TreeNode6configEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  call void @_ZNSt10shared_ptrIN2BT10BlackboardEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %12) #4
  %13 = getelementptr inbounds i8, ptr %3, i64 16
  %14 = call noundef nonnull align 8 dereferenceable(344) ptr @_ZN2BT8TreeNode6configEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %15 = getelementptr inbounds i8, ptr %14, i64 16
  call void @_ZNSt10shared_ptrISt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4hashIS6_ESt8equal_toIS6_ESaISt4pairIKS6_iEEEEC2ERKSG_(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(16) %15) #4
  %16 = getelementptr inbounds i8, ptr %1, i64 8
  %17 = call noundef ptr @_ZNKSt10unique_ptrIN2BT8TreeNode5PImplESt14default_deleteIS2_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  %18 = getelementptr inbounds i8, ptr %17, i64 680
  %19 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt5arrayISt8functionIFN2BT3AnyERNS1_3Ast11EnvironmentEEELm4EEixEm(ptr noundef nonnull align 8 dereferenceable(128) %18, i64 noundef 0) #4
  %20 = call noundef zeroext i1 @_ZNKSt8functionIFN2BT3AnyERNS0_3Ast11EnvironmentEEEcvbEv(ptr noundef nonnull align 8 dereferenceable(32) %19) #4
  br i1 %20, label %21, label %55

21:                                               ; preds = %2
  %22 = call noundef ptr @_ZNKSt10unique_ptrIN2BT8TreeNode5PImplESt14default_deleteIS2_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  %23 = getelementptr inbounds i8, ptr %22, i64 32
  %24 = load i32, ptr %23, align 8, !tbaa !5
  %25 = icmp eq i32 %24, 0
  br i1 %25, label %31, label %26

26:                                               ; preds = %21
  %27 = call noundef ptr @_ZNKSt10unique_ptrIN2BT8TreeNode5PImplESt14default_deleteIS2_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  %28 = getelementptr inbounds i8, ptr %27, i64 32
  %29 = load i32, ptr %28, align 8, !tbaa !5
  %30 = icmp eq i32 %29, 4
  br i1 %30, label %31, label %44

31:                                               ; preds = %26, %21
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #4
  invoke void @_ZNKSt8functionIFN2BT3AnyERNS0_3Ast11EnvironmentEEEclES4_(ptr dead_on_unwind nonnull writable sret(%"class.BT::Any") align 8 %4, ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %32 unwind label %36

32:                                               ; preds = %31
  %33 = invoke noundef zeroext i1 @_ZNK2BT3Any4castIbEET_v(ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %34 unwind label %38

34:                                               ; preds = %32
  call void @_ZN2BT3AnyD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  br i1 %33, label %35, label %55

35:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  store i32 3, ptr %5, align 4, !tbaa !55
  call void @_ZN6nonstd13expected_lite8expectedIN2BT10NodeStatusENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IS3_TnNSt9enable_ifIXaaaaaaaasr3std16is_constructibleIS3_OT_EE5valuentsr3std7is_sameINS0_5std2012remove_cvrefISD_E4typeESt10in_place_tEE5valuentsr3std7is_sameISA_SI_EE5valuentsr3std7is_sameINS0_15unexpected_typeIS9_EESI_EE5valuesr3std14is_convertibleISE_S3_EE5valueEiE4typeELi0EEESE_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 4 dereferenceable(4) %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  br label %130

36:                                               ; preds = %121, %93, %72, %31
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %40

38:                                               ; preds = %122, %94, %73, %32
  %39 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN2BT3AnyD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  br label %40

40:                                               ; preds = %38, %36
  %.pn27 = phi { ptr, i32 } [ %39, %38 ], [ %37, %36 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  br label %131

41:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  store i32 2, ptr %6, align 4, !tbaa !55
  call void @_ZN6nonstd13expected_lite8expectedIN2BT10NodeStatusENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IS3_TnNSt9enable_ifIXaaaaaaaasr3std16is_constructibleIS3_OT_EE5valuentsr3std7is_sameINS0_5std2012remove_cvrefISD_E4typeESt10in_place_tEE5valuentsr3std7is_sameISA_SI_EE5valuentsr3std7is_sameINS0_15unexpected_typeIS9_EESI_EE5valuesr3std14is_convertibleISE_S3_EE5valueEiE4typeELi0EEESE_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 4 dereferenceable(4) %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  br label %130

42:                                               ; preds = %96
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  store i32 4, ptr %7, align 4, !tbaa !55
  call void @_ZN6nonstd13expected_lite8expectedIN2BT10NodeStatusENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IS3_TnNSt9enable_ifIXaaaaaaaasr3std16is_constructibleIS3_OT_EE5valuentsr3std7is_sameINS0_5std2012remove_cvrefISD_E4typeESt10in_place_tEE5valuentsr3std7is_sameISA_SI_EE5valuentsr3std7is_sameINS0_15unexpected_typeIS9_EESI_EE5valuesr3std14is_convertibleISE_S3_EE5valueEiE4typeELi0EEESE_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 4 dereferenceable(4) %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  br label %130

43:                                               ; preds = %124
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #4
  store i32 4, ptr %8, align 4, !tbaa !55
  call void @_ZN6nonstd13expected_lite8expectedIN2BT10NodeStatusENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IS3_TnNSt9enable_ifIXaaaaaaaasr3std16is_constructibleIS3_OT_EE5valuentsr3std7is_sameINS0_5std2012remove_cvrefISD_E4typeESt10in_place_tEE5valuentsr3std7is_sameISA_SI_EE5valuentsr3std7is_sameINS0_15unexpected_typeIS9_EESI_EE5valuesr3std14is_convertibleISE_S3_EE5valueEiE4typeELi0EEESE_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 4 dereferenceable(4) %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  br label %130

44:                                               ; preds = %26
  %45 = call noundef ptr @_ZNKSt10unique_ptrIN2BT8TreeNode5PImplESt14default_deleteIS2_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  br label %55

46:                                               ; preds = %120
  invoke void @_ZN2BT8TreeNode8haltNodeEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
          to label %47 unwind label %53

47:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #4
  store i32 4, ptr %10, align 4, !tbaa !55
  call void @_ZN6nonstd13expected_lite8expectedIN2BT10NodeStatusENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IS3_TnNSt9enable_ifIXaaaaaaaasr3std16is_constructibleIS3_OT_EE5valuentsr3std7is_sameINS0_5std2012remove_cvrefISD_E4typeESt10in_place_tEE5valuentsr3std7is_sameISA_SI_EE5valuentsr3std7is_sameINS0_15unexpected_typeIS9_EESI_EE5valuesr3std14is_convertibleISE_S3_EE5valueEiE4typeELi0EEESE_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 4 dereferenceable(4) %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #4
  br label %130

48:                                               ; preds = %117
  %49 = landingpad { ptr, i32 }
          cleanup
  br label %52

50:                                               ; preds = %118
  %51 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN2BT3AnyD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #4
  br label %52

52:                                               ; preds = %50, %48
  %.pn = phi { ptr, i32 } [ %51, %50 ], [ %49, %48 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #4
  br label %131

53:                                               ; preds = %46
  %54 = landingpad { ptr, i32 }
          cleanup
  br label %131

55:                                               ; preds = %34, %44, %2
  %56 = call noundef ptr @_ZNKSt10unique_ptrIN2BT8TreeNode5PImplESt14default_deleteIS2_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  %57 = getelementptr inbounds i8, ptr %56, i64 680
  %58 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt5arrayISt8functionIFN2BT3AnyERNS1_3Ast11EnvironmentEEELm4EEixEm(ptr noundef nonnull align 8 dereferenceable(128) %57, i64 noundef 1) #4
  %59 = call noundef zeroext i1 @_ZNKSt8functionIFN2BT3AnyERNS0_3Ast11EnvironmentEEEcvbEv(ptr noundef nonnull align 8 dereferenceable(32) %58) #4
  br i1 %59, label %60, label %76

60:                                               ; preds = %55
  %61 = call noundef ptr @_ZNKSt10unique_ptrIN2BT8TreeNode5PImplESt14default_deleteIS2_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  %62 = getelementptr inbounds i8, ptr %61, i64 32
  %63 = load i32, ptr %62, align 8, !tbaa !5
  %64 = icmp eq i32 %63, 0
  br i1 %64, label %72, label %65

65:                                               ; preds = %60
  %66 = call noundef ptr @_ZNKSt10unique_ptrIN2BT8TreeNode5PImplESt14default_deleteIS2_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  %67 = getelementptr inbounds i8, ptr %66, i64 32
  %68 = load i32, ptr %67, align 8, !tbaa !5
  %69 = icmp eq i32 %68, 4
  br i1 %69, label %72, label %70

70:                                               ; preds = %65
  %71 = call noundef ptr @_ZNKSt10unique_ptrIN2BT8TreeNode5PImplESt14default_deleteIS2_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  br label %76

72:                                               ; preds = %65, %60
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #4
  invoke void @_ZNKSt8functionIFN2BT3AnyERNS0_3Ast11EnvironmentEEEclES4_(ptr dead_on_unwind nonnull writable sret(%"class.BT::Any") align 8 %4, ptr noundef nonnull align 8 dereferenceable(32) %58, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %73 unwind label %36

73:                                               ; preds = %72
  %74 = invoke noundef zeroext i1 @_ZNK2BT3Any4castIbEET_v(ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %75 unwind label %38

75:                                               ; preds = %73
  call void @_ZN2BT3AnyD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  br i1 %74, label %41, label %76

76:                                               ; preds = %75, %70, %55
  %77 = call noundef ptr @_ZNKSt10unique_ptrIN2BT8TreeNode5PImplESt14default_deleteIS2_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  %78 = getelementptr inbounds i8, ptr %77, i64 680
  %79 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt5arrayISt8functionIFN2BT3AnyERNS1_3Ast11EnvironmentEEELm4EEixEm(ptr noundef nonnull align 8 dereferenceable(128) %78, i64 noundef 2) #4
  %80 = call noundef zeroext i1 @_ZNKSt8functionIFN2BT3AnyERNS0_3Ast11EnvironmentEEEcvbEv(ptr noundef nonnull align 8 dereferenceable(32) %79) #4
  br i1 %80, label %81, label %97

81:                                               ; preds = %76
  %82 = call noundef ptr @_ZNKSt10unique_ptrIN2BT8TreeNode5PImplESt14default_deleteIS2_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  %83 = getelementptr inbounds i8, ptr %82, i64 32
  %84 = load i32, ptr %83, align 8, !tbaa !5
  %85 = icmp eq i32 %84, 0
  br i1 %85, label %93, label %86

86:                                               ; preds = %81
  %87 = call noundef ptr @_ZNKSt10unique_ptrIN2BT8TreeNode5PImplESt14default_deleteIS2_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  %88 = getelementptr inbounds i8, ptr %87, i64 32
  %89 = load i32, ptr %88, align 8, !tbaa !5
  %90 = icmp eq i32 %89, 4
  br i1 %90, label %93, label %91

91:                                               ; preds = %86
  %92 = call noundef ptr @_ZNKSt10unique_ptrIN2BT8TreeNode5PImplESt14default_deleteIS2_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  br label %97

93:                                               ; preds = %86, %81
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #4
  invoke void @_ZNKSt8functionIFN2BT3AnyERNS0_3Ast11EnvironmentEEEclES4_(ptr dead_on_unwind nonnull writable sret(%"class.BT::Any") align 8 %4, ptr noundef nonnull align 8 dereferenceable(32) %79, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %94 unwind label %36

94:                                               ; preds = %93
  %95 = invoke noundef zeroext i1 @_ZNK2BT3Any4castIbEET_v(ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %96 unwind label %38

96:                                               ; preds = %94
  call void @_ZN2BT3AnyD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  br i1 %95, label %42, label %97

97:                                               ; preds = %96, %91, %76
  %98 = call noundef ptr @_ZNKSt10unique_ptrIN2BT8TreeNode5PImplESt14default_deleteIS2_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  %99 = getelementptr inbounds i8, ptr %98, i64 680
  %100 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt5arrayISt8functionIFN2BT3AnyERNS1_3Ast11EnvironmentEEELm4EEixEm(ptr noundef nonnull align 8 dereferenceable(128) %99, i64 noundef 3) #4
  %101 = call noundef zeroext i1 @_ZNKSt8functionIFN2BT3AnyERNS0_3Ast11EnvironmentEEEcvbEv(ptr noundef nonnull align 8 dereferenceable(32) %100) #4
  br i1 %101, label %102, label %.critedge

102:                                              ; preds = %97
  %103 = call noundef ptr @_ZNKSt10unique_ptrIN2BT8TreeNode5PImplESt14default_deleteIS2_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  %104 = getelementptr inbounds i8, ptr %103, i64 32
  %105 = load i32, ptr %104, align 8, !tbaa !5
  %106 = icmp eq i32 %105, 0
  br i1 %106, label %121, label %107

107:                                              ; preds = %102
  %108 = call noundef ptr @_ZNKSt10unique_ptrIN2BT8TreeNode5PImplESt14default_deleteIS2_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  %109 = getelementptr inbounds i8, ptr %108, i64 32
  %110 = load i32, ptr %109, align 8, !tbaa !5
  %111 = icmp eq i32 %110, 4
  br i1 %111, label %121, label %112

112:                                              ; preds = %107
  %113 = call noundef ptr @_ZNKSt10unique_ptrIN2BT8TreeNode5PImplESt14default_deleteIS2_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  %114 = getelementptr inbounds i8, ptr %113, i64 32
  %115 = load i32, ptr %114, align 8, !tbaa !5
  %116 = icmp eq i32 %115, 1
  br i1 %116, label %117, label %.critedge

117:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #4
  invoke void @_ZNKSt8functionIFN2BT3AnyERNS0_3Ast11EnvironmentEEEclES4_(ptr dead_on_unwind nonnull writable sret(%"class.BT::Any") align 8 %9, ptr noundef nonnull align 8 dereferenceable(32) %100, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %118 unwind label %48

118:                                              ; preds = %117
  %119 = invoke noundef zeroext i1 @_ZNK2BT3Any4castIbEET_v(ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %120 unwind label %50

120:                                              ; preds = %118
  call void @_ZN2BT3AnyD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #4
  br i1 %119, label %.critedge, label %46

121:                                              ; preds = %107, %102
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #4
  invoke void @_ZNKSt8functionIFN2BT3AnyERNS0_3Ast11EnvironmentEEEclES4_(ptr dead_on_unwind nonnull writable sret(%"class.BT::Any") align 8 %4, ptr noundef nonnull align 8 dereferenceable(32) %100, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %122 unwind label %36

122:                                              ; preds = %121
  %123 = invoke noundef zeroext i1 @_ZNK2BT3Any4castIbEET_v(ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %124 unwind label %38

124:                                              ; preds = %122
  call void @_ZN2BT3AnyD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  br i1 %123, label %.critedge, label %43

.critedge:                                        ; preds = %124, %120, %112, %97
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #4
  %125 = invoke ptr @_ZN6nonstd13expected_lite15make_unexpectedIRA1_KcEENS0_15unexpected_typeINSt5decayIT_E4typeEEEOS7_(ptr noundef nonnull align 1 dereferenceable(1) @.str.13)
          to label %126 unwind label %128

126:                                              ; preds = %.critedge
  store ptr %125, ptr %11, align 8
  invoke void @_ZN6nonstd13expected_lite8expectedIN2BT10NodeStatusENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IPKcTnNSt9enable_ifIXaasr3std16is_constructibleIS9_OT_EE5valuesr3std14is_convertibleISG_S9_EE5valueEiE4typeELi0EEEONS0_15unexpected_typeISF_EE(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %127 unwind label %128

127:                                              ; preds = %126
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  br label %130

128:                                              ; preds = %126, %.critedge
  %129 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  br label %131

130:                                              ; preds = %47, %43, %42, %41, %35, %127
  call void @_ZN2BT3Ast11EnvironmentD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #4
  ret void

131:                                              ; preds = %40, %52, %53, %128
  %.pn30 = phi { ptr, i32 } [ %129, %128 ], [ %.pn27, %40 ], [ %54, %53 ], [ %.pn, %52 ]
  call void @_ZN2BT3Ast11EnvironmentD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #4
  resume { ptr, i32 } %.pn30
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt5arrayISt8functionIFN2BT3AnyERNS1_3Ast11EnvironmentEEELm4EEixEm(ptr noundef nonnull align 8 dereferenceable(128), i64 noundef) local_unnamed_addr #1 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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(344) ptr @_ZN2BT8TreeNode6configEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6nonstd13expected_lite8expectedIN2BT10NodeStatusENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEC2IPKcTnNSt9enable_ifIXaasr3std16is_constructibleIS9_OT_EE5valuesr3std14is_convertibleISG_S9_EE5valueEiE4typeELi0EEEONS0_15unexpected_typeISF_EE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #2 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 = { 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 #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, !13, i64 32}
!6 = !{!"_ZTSN2BT8TreeNode5PImplE", !7, i64 0, !13, i64 32, !14, i64 40, !16, i64 88, !18, i64 128, !23, i64 152, !7, i64 496, !48, i64 528, !50, i64 560, !51, i64 592, !16, i64 624, !52, i64 664, !54, i64 680, !54, i64 808}
!7 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !8, i64 0, !12, i64 8, !10, i64 16}
!8 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"long", !10, i64 0}
!13 = !{!"_ZTSN2BT10NodeStatusE", !10, i64 0}
!14 = !{!"_ZTSSt18condition_variable", !15, i64 0}
!15 = !{!"_ZTSSt9__condvar", !10, i64 0}
!16 = !{!"_ZTSSt5mutex", !17, i64 0}
!17 = !{!"_ZTSSt12__mutex_base", !10, i64 0}
!18 = !{!"_ZTSN2BT6SignalIJNSt6chrono10time_pointINS1_3_V212system_clockENS1_8durationIlSt5ratioILl1ELl1000000000EEEEEERKNS_8TreeNodeENS_10NodeStatusESD_EEE", !19, i64 0}
!19 = !{!"_ZTSSt6vectorISt8weak_ptrISt8functionIFvNSt6chrono10time_pointINS2_3_V212system_clockENS2_8durationIlSt5ratioILl1ELl1000000000EEEEEERKN2BT8TreeNodeENSB_10NodeStatusESF_EEESaISI_EE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseISt8weak_ptrISt8functionIFvNSt6chrono10time_pointINS2_3_V212system_clockENS2_8durationIlSt5ratioILl1ELl1000000000EEEEEERKN2BT8TreeNodeENSB_10NodeStatusESF_EEESaISI_EE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseISt8weak_ptrISt8functionIFvNSt6chrono10time_pointINS2_3_V212system_clockENS2_8durationIlSt5ratioILl1ELl1000000000EEEEEERKN2BT8TreeNodeENSB_10NodeStatusESF_EEESaISI_EE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseISt8weak_ptrISt8functionIFvNSt6chrono10time_pointINS2_3_V212system_clockENS2_8durationIlSt5ratioILl1ELl1000000000EEEEEERKN2BT8TreeNodeENSB_10NodeStatusESF_EEESaISI_EE17_Vector_impl_dataE", !9, i64 0, !9, i64 8, !9, i64 16}
!23 = !{!"_ZTSN2BT10NodeConfigE", !24, i64 0, !27, i64 16, !29, i64 32, !29, i64 88, !29, i64 144, !9, i64 200, !34, i64 208, !7, i64 216, !35, i64 248, !43, i64 296}
!24 = !{!"_ZTSSt10shared_ptrIN2BT10BlackboardEE", !25, i64 0}
!25 = !{!"_ZTSSt12__shared_ptrIN2BT10BlackboardELN9__gnu_cxx12_Lock_policyE2EE", !9, i64 0, !26, i64 8}
!26 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !9, i64 0}
!27 = !{!"_ZTSSt10shared_ptrISt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4hashIS6_ESt8equal_toIS6_ESaISt4pairIKS6_iEEEE", !28, i64 0}
!28 = !{!"_ZTSSt12__shared_ptrISt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4hashIS6_ESt8equal_toIS6_ESaISt4pairIKS6_iEEELN9__gnu_cxx12_Lock_policyE2EE", !9, i64 0, !26, i64 8}
!29 = !{!"_ZTSSt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES5_St4hashIS5_ESt8equal_toIS5_ESaISt4pairIKS5_S5_EEE", !30, i64 0}
!30 = !{!"_ZTSSt10_HashtableINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_S5_ESaIS8_ENSt8__detail10_Select1stESt8equal_toIS5_ESt4hashIS5_ENSA_18_Mod_range_hashingENSA_20_Default_ranged_hashENSA_20_Prime_rehash_policyENSA_17_Hashtable_traitsILb1ELb0ELb1EEEE", !9, i64 0, !12, i64 8, !31, i64 16, !12, i64 24, !32, i64 32, !9, i64 48}
!31 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !9, i64 0}
!32 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !33, i64 0, !12, i64 8}
!33 = !{!"float", !10, i64 0}
!34 = !{!"short", !10, i64 0}
!35 = !{!"_ZTSSt3mapIN2BT7PreCondENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS1_ESaISt4pairIKS1_S7_EEE", !36, i64 0}
!36 = !{!"_ZTSSt8_Rb_treeIN2BT7PreCondESt4pairIKS1_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEESt10_Select1stISA_ESt4lessIS1_ESaISA_EE", !37, i64 0}
!37 = !{!"_ZTSNSt8_Rb_treeIN2BT7PreCondESt4pairIKS1_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEESt10_Select1stISA_ESt4lessIS1_ESaISA_EE13_Rb_tree_implISE_Lb1EEE", !38, i64 0, !40, i64 8}
!38 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIN2BT7PreCondEEE", !39, i64 0}
!39 = !{!"_ZTSSt4lessIN2BT7PreCondEE"}
!40 = !{!"_ZTSSt15_Rb_tree_header", !41, i64 0, !12, i64 32}
!41 = !{!"_ZTSSt18_Rb_tree_node_base", !42, i64 0, !9, i64 8, !9, i64 16, !9, i64 24}
!42 = !{!"_ZTSSt14_Rb_tree_color", !10, i64 0}
!43 = !{!"_ZTSSt3mapIN2BT8PostCondENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS1_ESaISt4pairIKS1_S7_EEE", !44, i64 0}
!44 = !{!"_ZTSSt8_Rb_treeIN2BT8PostCondESt4pairIKS1_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEESt10_Select1stISA_ESt4lessIS1_ESaISA_EE", !45, i64 0}
!45 = !{!"_ZTSNSt8_Rb_treeIN2BT8PostCondESt4pairIKS1_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEESt10_Select1stISA_ESt4lessIS1_ESaISA_EE13_Rb_tree_implISE_Lb1EEE", !46, i64 0, !40, i64 8}
!46 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIN2BT8PostCondEEE", !47, i64 0}
!47 = !{!"_ZTSSt4lessIN2BT8PostCondEE"}
!48 = !{!"_ZTSSt8functionIFN2BT10NodeStatusERNS0_8TreeNodeEEE", !49, i64 0, !9, i64 24}
!49 = !{!"_ZTSSt14_Function_base", !10, i64 0, !9, i64 16}
!50 = !{!"_ZTSSt8functionIFN2BT10NodeStatusERNS0_8TreeNodeES1_EE", !49, i64 0, !9, i64 24}
!51 = !{!"_ZTSSt8functionIFvRN2BT8TreeNodeENS0_10NodeStatusENSt6chrono8durationIlSt5ratioILl1ELl1000000EEEEEE", !49, i64 0, !9, i64 24}
!52 = !{!"_ZTSSt10shared_ptrIN2BT12WakeUpSignalEE", !53, i64 0}
!53 = !{!"_ZTSSt12__shared_ptrIN2BT12WakeUpSignalELN9__gnu_cxx12_Lock_policyE2EE", !9, i64 0, !26, i64 8}
!54 = !{!"_ZTSSt5arrayISt8functionIFN2BT3AnyERNS1_3Ast11EnvironmentEEELm4EE", !10, i64 0}
!55 = !{!13, !13, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass