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

; 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.std::unique_lock" = type <{ ptr, i8, [7 x i8] }>
%"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 }
%"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::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.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.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::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 }

; 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
declare dso_local void @_ZNSt11unique_lockISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(9), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN2BT8TreeNode15waitValidStatusEv(ptr noundef nonnull align 8 dereferenceable(16) %0) #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.std::unique_lock", align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %6 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #4
  %7 = getelementptr inbounds %"class.BT::TreeNode", ptr %6, i32 0, i32 1
  %8 = call noundef ptr @_ZNKSt10unique_ptrIN2BT8TreeNode5PImplESt14default_deleteIS2_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  %9 = getelementptr inbounds %"struct.BT::TreeNode::PImpl", ptr %8, i32 0, i32 3
  call void @_ZNSt11unique_lockISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(9) %3, ptr noundef nonnull align 8 dereferenceable(40) %9)
  br label %10

10:                                               ; preds = %17, %1
  %11 = invoke noundef zeroext i1 @_ZNK2BT8TreeNode8isHaltedEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
          to label %12 unwind label %18

12:                                               ; preds = %10
  br i1 %11, label %13, label %22

13:                                               ; preds = %12
  %14 = getelementptr inbounds %"class.BT::TreeNode", ptr %6, i32 0, i32 1
  %15 = call noundef ptr @_ZNKSt10unique_ptrIN2BT8TreeNode5PImplESt14default_deleteIS2_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #4
  %16 = getelementptr inbounds %"struct.BT::TreeNode::PImpl", ptr %15, i32 0, i32 2
  invoke void @_ZNSt18condition_variable4waitERSt11unique_lockISt5mutexE(ptr noundef nonnull align 8 dereferenceable(48) %16, ptr noundef nonnull align 8 dereferenceable(9) %3)
          to label %17 unwind label %18

17:                                               ; preds = %13
  br label %10, !llvm.loop !9

18:                                               ; preds = %13, %10
  %19 = landingpad { ptr, i32 }
          cleanup
  %20 = extractvalue { ptr, i32 } %19, 0
  store ptr %20, ptr %4, align 8
  %21 = extractvalue { ptr, i32 } %19, 1
  store i32 %21, ptr %5, align 4
  call void @_ZNSt11unique_lockISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(9) %3) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #4
  br label %27

22:                                               ; preds = %12
  %23 = getelementptr inbounds %"class.BT::TreeNode", ptr %6, i32 0, i32 1
  %24 = call noundef ptr @_ZNKSt10unique_ptrIN2BT8TreeNode5PImplESt14default_deleteIS2_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %23) #4
  %25 = getelementptr inbounds %"struct.BT::TreeNode::PImpl", ptr %24, i32 0, i32 1
  %26 = load i32, ptr %25, align 8, !tbaa !11
  call void @_ZNSt11unique_lockISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(9) %3) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #4
  ret i32 %26

27:                                               ; preds = %18
  %28 = load ptr, ptr %4, align 8
  %29 = load i32, ptr %5, align 4
  %30 = insertvalue { ptr, i32 } poison, ptr %28, 0
  %31 = insertvalue { ptr, i32 } %30, i32 %29, 1
  resume { ptr, i32 } %31
}

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

declare void @_ZNSt18condition_variable4waitERSt11unique_lockISt5mutexE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(9)) #3

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

%"class.std::unique_lock" = type <{ ptr, i8, [7 x i8] }>

; 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
declare dso_local void @_ZNSt11unique_lockISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(9), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN2BT8TreeNode15waitValidStatusEv(ptr noundef nonnull align 8 dereferenceable(16) %0) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::unique_lock", align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #4
  %3 = getelementptr inbounds i8, ptr %0, i64 8
  %4 = tail call noundef ptr @_ZNKSt10unique_ptrIN2BT8TreeNode5PImplESt14default_deleteIS2_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  %5 = getelementptr inbounds i8, ptr %4, i64 88
  call void @_ZNSt11unique_lockISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(9) %2, ptr noundef nonnull align 8 dereferenceable(40) %5)
  br label %6

6:                                                ; preds = %9, %1
  %7 = call noundef zeroext i1 @_ZNK2BT8TreeNode8isHaltedEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
  %8 = call noundef ptr @_ZNKSt10unique_ptrIN2BT8TreeNode5PImplESt14default_deleteIS2_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  br i1 %7, label %9, label %13

9:                                                ; preds = %6
  %10 = getelementptr inbounds i8, ptr %8, i64 40
  invoke void @_ZNSt18condition_variable4waitERSt11unique_lockISt5mutexE(ptr noundef nonnull align 8 dereferenceable(48) %10, ptr noundef nonnull align 8 dereferenceable(9) %2)
          to label %6 unwind label %11, !llvm.loop !5

11:                                               ; preds = %9
  %12 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt11unique_lockISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(9) %2) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #4
  resume { ptr, i32 } %12

13:                                               ; preds = %6
  %14 = getelementptr inbounds i8, ptr %8, i64 32
  %15 = load i32, ptr %14, align 8, !tbaa !7
  call void @_ZNSt11unique_lockISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(9) %2) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #4
  ret i32 %15
}

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

declare void @_ZNSt18condition_variable4waitERSt11unique_lockISt5mutexE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(9)) local_unnamed_addr #3

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 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !15, i64 32}
!8 = !{!"_ZTSN2BT8TreeNode5PImplE", !9, i64 0, !15, i64 32, !16, i64 40, !18, i64 88, !20, i64 128, !25, i64 152, !9, i64 496, !50, i64 528, !52, i64 560, !53, i64 592, !18, i64 624, !54, i64 664, !56, i64 680, !56, i64 808}
!9 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !10, i64 0, !14, i64 8, !12, i64 16}
!10 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !11, i64 0}
!11 = !{!"any pointer", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"long", !12, i64 0}
!15 = !{!"_ZTSN2BT10NodeStatusE", !12, i64 0}
!16 = !{!"_ZTSSt18condition_variable", !17, i64 0}
!17 = !{!"_ZTSSt9__condvar", !12, i64 0}
!18 = !{!"_ZTSSt5mutex", !19, i64 0}
!19 = !{!"_ZTSSt12__mutex_base", !12, i64 0}
!20 = !{!"_ZTSN2BT6SignalIJNSt6chrono10time_pointINS1_3_V212system_clockENS1_8durationIlSt5ratioILl1ELl1000000000EEEEEERKNS_8TreeNodeENS_10NodeStatusESD_EEE", !21, i64 0}
!21 = !{!"_ZTSSt6vectorISt8weak_ptrISt8functionIFvNSt6chrono10time_pointINS2_3_V212system_clockENS2_8durationIlSt5ratioILl1ELl1000000000EEEEEERKN2BT8TreeNodeENSB_10NodeStatusESF_EEESaISI_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseISt8weak_ptrISt8functionIFvNSt6chrono10time_pointINS2_3_V212system_clockENS2_8durationIlSt5ratioILl1ELl1000000000EEEEEERKN2BT8TreeNodeENSB_10NodeStatusESF_EEESaISI_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseISt8weak_ptrISt8functionIFvNSt6chrono10time_pointINS2_3_V212system_clockENS2_8durationIlSt5ratioILl1ELl1000000000EEEEEERKN2BT8TreeNodeENSB_10NodeStatusESF_EEESaISI_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseISt8weak_ptrISt8functionIFvNSt6chrono10time_pointINS2_3_V212system_clockENS2_8durationIlSt5ratioILl1ELl1000000000EEEEEERKN2BT8TreeNodeENSB_10NodeStatusESF_EEESaISI_EE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!25 = !{!"_ZTSN2BT10NodeConfigE", !26, i64 0, !29, i64 16, !31, i64 32, !31, i64 88, !31, i64 144, !11, i64 200, !36, i64 208, !9, i64 216, !37, i64 248, !45, i64 296}
!26 = !{!"_ZTSSt10shared_ptrIN2BT10BlackboardEE", !27, i64 0}
!27 = !{!"_ZTSSt12__shared_ptrIN2BT10BlackboardELN9__gnu_cxx12_Lock_policyE2EE", !11, i64 0, !28, i64 8}
!28 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !11, i64 0}
!29 = !{!"_ZTSSt10shared_ptrISt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4hashIS6_ESt8equal_toIS6_ESaISt4pairIKS6_iEEEE", !30, i64 0}
!30 = !{!"_ZTSSt12__shared_ptrISt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4hashIS6_ESt8equal_toIS6_ESaISt4pairIKS6_iEEELN9__gnu_cxx12_Lock_policyE2EE", !11, i64 0, !28, i64 8}
!31 = !{!"_ZTSSt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES5_St4hashIS5_ESt8equal_toIS5_ESaISt4pairIKS5_S5_EEE", !32, i64 0}
!32 = !{!"_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", !11, i64 0, !14, i64 8, !33, i64 16, !14, i64 24, !34, i64 32, !11, i64 48}
!33 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !11, i64 0}
!34 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !35, i64 0, !14, i64 8}
!35 = !{!"float", !12, i64 0}
!36 = !{!"short", !12, i64 0}
!37 = !{!"_ZTSSt3mapIN2BT7PreCondENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS1_ESaISt4pairIKS1_S7_EEE", !38, i64 0}
!38 = !{!"_ZTSSt8_Rb_treeIN2BT7PreCondESt4pairIKS1_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEESt10_Select1stISA_ESt4lessIS1_ESaISA_EE", !39, i64 0}
!39 = !{!"_ZTSNSt8_Rb_treeIN2BT7PreCondESt4pairIKS1_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEESt10_Select1stISA_ESt4lessIS1_ESaISA_EE13_Rb_tree_implISE_Lb1EEE", !40, i64 0, !42, i64 8}
!40 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIN2BT7PreCondEEE", !41, i64 0}
!41 = !{!"_ZTSSt4lessIN2BT7PreCondEE"}
!42 = !{!"_ZTSSt15_Rb_tree_header", !43, i64 0, !14, i64 32}
!43 = !{!"_ZTSSt18_Rb_tree_node_base", !44, i64 0, !11, i64 8, !11, i64 16, !11, i64 24}
!44 = !{!"_ZTSSt14_Rb_tree_color", !12, i64 0}
!45 = !{!"_ZTSSt3mapIN2BT8PostCondENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4lessIS1_ESaISt4pairIKS1_S7_EEE", !46, i64 0}
!46 = !{!"_ZTSSt8_Rb_treeIN2BT8PostCondESt4pairIKS1_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEESt10_Select1stISA_ESt4lessIS1_ESaISA_EE", !47, i64 0}
!47 = !{!"_ZTSNSt8_Rb_treeIN2BT8PostCondESt4pairIKS1_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEESt10_Select1stISA_ESt4lessIS1_ESaISA_EE13_Rb_tree_implISE_Lb1EEE", !48, i64 0, !42, i64 8}
!48 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIN2BT8PostCondEEE", !49, i64 0}
!49 = !{!"_ZTSSt4lessIN2BT8PostCondEE"}
!50 = !{!"_ZTSSt8functionIFN2BT10NodeStatusERNS0_8TreeNodeEEE", !51, i64 0, !11, i64 24}
!51 = !{!"_ZTSSt14_Function_base", !12, i64 0, !11, i64 16}
!52 = !{!"_ZTSSt8functionIFN2BT10NodeStatusERNS0_8TreeNodeES1_EE", !51, i64 0, !11, i64 24}
!53 = !{!"_ZTSSt8functionIFvRN2BT8TreeNodeENS0_10NodeStatusENSt6chrono8durationIlSt5ratioILl1ELl1000000EEEEEE", !51, i64 0, !11, i64 24}
!54 = !{!"_ZTSSt10shared_ptrIN2BT12WakeUpSignalEE", !55, i64 0}
!55 = !{!"_ZTSSt12__shared_ptrIN2BT12WakeUpSignalELN9__gnu_cxx12_Lock_policyE2EE", !11, i64 0, !28, i64 8}
!56 = !{!"_ZTSSt5arrayISt8functionIFN2BT3AnyERNS1_3Ast11EnvironmentEEELm4EE", !12, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass