; LLVM IR from BehaviorTree/BehaviorTree.CPP :: src/decorators/updated_decorator.ll (ZN2BT21EntryUpdatedDecorator4tickEv)

; 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::shared_ptr.20" = type { %"class.std::__shared_ptr.21" }
%"class.std::__shared_ptr.21" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::unique_lock" = type <{ ptr, i8, [7 x i8] }>
%"class.BT::EntryUpdatedDecorator" = type { %"class.BT::DecoratorNode", i64, %"class.std::__cxx11::basic_string", i8, i32 }
%"class.BT::DecoratorNode" = type { %"class.BT::TreeNode", ptr }
%"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.2" }
%"struct.std::_Head_base.2" = type { ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"struct.BT::NodeConfig" = type { %"class.std::shared_ptr", %"class.std::shared_ptr.3", %"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.14" }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::shared_ptr.3" = type { %"class.std::__shared_ptr.4" }
%"class.std::__shared_ptr.4" = 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.14" = type { %"class.std::_Rb_tree.15" }
%"class.std::_Rb_tree.15" = 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" }
%"struct.BT::Blackboard::Entry" = type { %"class.BT::Any", %"class.BT::TypeInfo", %"class.std::function", %"class.std::mutex", i64, %"class.std::chrono::duration" }
%"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.BT::TypeInfo" = type { %"struct.std::type_index", %"class.std::function", %"class.std::__cxx11::basic_string" }
%"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::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::chrono::duration" = type { i64 }

; 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 uwtable
define dso_local noundef i32 @_ZN2BT21EntryUpdatedDecorator4tickEv(ptr noundef nonnull align 8 dereferenceable(72) %0) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::shared_ptr.20", align 8
  %6 = alloca %"class.std::unique_lock", align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %13 = load ptr, ptr %3, align 8
  %14 = getelementptr inbounds %"class.BT::EntryUpdatedDecorator", ptr %13, i32 0, i32 3
  %15 = load i8, ptr %14, align 8, !tbaa !9, !range !24, !noundef !25
  %16 = trunc i8 %15 to i1
  br i1 %16, label %17, label %28

17:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  %18 = call noundef ptr @_ZN2BT13DecoratorNode5childEv(ptr noundef nonnull align 8 dereferenceable(24) %13)
  %19 = load ptr, ptr %18, align 8, !tbaa !26
  %20 = getelementptr inbounds ptr, ptr %19, i64 2
  %21 = load ptr, ptr %20, align 8
  %22 = call noundef i32 %21(ptr noundef nonnull align 8 dereferenceable(16) %18)
  store i32 %22, ptr %4, align 4, !tbaa !28
  %23 = load i32, ptr %4, align 4, !tbaa !28
  %24 = icmp eq i32 %23, 1
  %25 = getelementptr inbounds %"class.BT::EntryUpdatedDecorator", ptr %13, i32 0, i32 3
  %26 = zext i1 %24 to i8
  store i8 %26, ptr %25, align 8, !tbaa !9
  %27 = load i32, ptr %4, align 4, !tbaa !28
  store i32 %27, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %76

28:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #4
  %29 = call noundef nonnull align 8 dereferenceable(344) ptr @_ZN2BT8TreeNode6configEv(ptr noundef nonnull align 8 dereferenceable(16) %13)
  %30 = getelementptr inbounds %"struct.BT::NodeConfig", ptr %29, i32 0, i32 0
  %31 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN2BT10BlackboardELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %30) #4
  %32 = getelementptr inbounds %"class.BT::EntryUpdatedDecorator", ptr %13, i32 0, i32 2
  call void @_ZN2BT10Blackboard8getEntryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.20") align 8 %5, ptr noundef nonnull align 8 dereferenceable(217) %31, ptr noundef nonnull align 8 dereferenceable(32) %32)
  %33 = call noundef zeroext i1 @_ZNKSt12__shared_ptrIN2BT10Blackboard5EntryELN9__gnu_cxx12_Lock_policyE2EEcvbEv(ptr noundef nonnull align 8 dereferenceable(16) %5) #4
  br i1 %33, label %34, label %59

34:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #4
  %35 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN2BT10Blackboard5EntryELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %5) #4
  %36 = getelementptr inbounds %"struct.BT::Blackboard::Entry", ptr %35, i32 0, i32 3
  invoke void @_ZNSt11unique_lockISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(9) %6, ptr noundef nonnull align 8 dereferenceable(40) %36)
          to label %37 unwind label %51

37:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %38 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN2BT10Blackboard5EntryELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %5) #4
  %39 = getelementptr inbounds %"struct.BT::Blackboard::Entry", ptr %38, i32 0, i32 4
  %40 = load i64, ptr %39, align 8, !tbaa !29
  store i64 %40, ptr %9, align 8, !tbaa !40
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %41 = getelementptr inbounds %"class.BT::EntryUpdatedDecorator", ptr %13, i32 0, i32 1
  %42 = load i64, ptr %41, align 8, !tbaa !41
  store i64 %42, ptr %10, align 8, !tbaa !40
  %43 = load i64, ptr %9, align 8, !tbaa !40
  %44 = getelementptr inbounds %"class.BT::EntryUpdatedDecorator", ptr %13, i32 0, i32 1
  store i64 %43, ptr %44, align 8, !tbaa !41
  %45 = load i64, ptr %10, align 8, !tbaa !40
  %46 = load i64, ptr %9, align 8, !tbaa !40
  %47 = icmp eq i64 %45, %46
  br i1 %47, label %48, label %55

48:                                               ; preds = %37
  %49 = getelementptr inbounds %"class.BT::EntryUpdatedDecorator", ptr %13, i32 0, i32 4
  %50 = load i32, ptr %49, align 4, !tbaa !42
  store i32 %50, ptr %2, align 4
  store i32 1, ptr %11, align 4
  br label %56

51:                                               ; preds = %34
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %7, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #4
  call void @_ZNSt12__shared_ptrIN2BT10Blackboard5EntryELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #4
  br label %78

55:                                               ; preds = %37
  store i32 0, ptr %11, align 4
  br label %56

56:                                               ; preds = %55, %48
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @_ZNSt11unique_lockISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(9) %6) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #4
  %57 = load i32, ptr %11, align 4
  switch i32 %57, label %63 [
    i32 0, label %58
  ]

58:                                               ; preds = %56
  br label %62

59:                                               ; preds = %28
  %60 = getelementptr inbounds %"class.BT::EntryUpdatedDecorator", ptr %13, i32 0, i32 4
  %61 = load i32, ptr %60, align 4, !tbaa !42
  store i32 %61, ptr %2, align 4
  store i32 1, ptr %11, align 4
  br label %63

62:                                               ; preds = %58
  store i32 0, ptr %11, align 4
  br label %63

63:                                               ; preds = %62, %59, %56
  call void @_ZNSt12__shared_ptrIN2BT10Blackboard5EntryELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #4
  %64 = load i32, ptr %11, align 4
  switch i32 %64, label %83 [
    i32 0, label %65
    i32 1, label %76
  ]

65:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %66 = call noundef ptr @_ZN2BT13DecoratorNode5childEv(ptr noundef nonnull align 8 dereferenceable(24) %13)
  %67 = load ptr, ptr %66, align 8, !tbaa !26
  %68 = getelementptr inbounds ptr, ptr %67, i64 2
  %69 = load ptr, ptr %68, align 8
  %70 = call noundef i32 %69(ptr noundef nonnull align 8 dereferenceable(16) %66)
  store i32 %70, ptr %12, align 4, !tbaa !28
  %71 = load i32, ptr %12, align 4, !tbaa !28
  %72 = icmp eq i32 %71, 1
  %73 = getelementptr inbounds %"class.BT::EntryUpdatedDecorator", ptr %13, i32 0, i32 3
  %74 = zext i1 %72 to i8
  store i8 %74, ptr %73, align 8, !tbaa !9
  %75 = load i32, ptr %12, align 4, !tbaa !28
  store i32 %75, ptr %2, align 4
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %76

76:                                               ; preds = %65, %63, %17
  %77 = load i32, ptr %2, align 4
  ret i32 %77

78:                                               ; preds = %51
  %79 = load ptr, ptr %7, align 8
  %80 = load i32, ptr %8, align 4
  %81 = insertvalue { ptr, i32 } poison, ptr %79, 0
  %82 = insertvalue { ptr, i32 } %81, i32 %80, 1
  resume { ptr, i32 } %82

83:                                               ; preds = %63
  unreachable
}

declare noundef ptr @_ZN2BT13DecoratorNode5childEv(ptr noundef nonnull align 8 dereferenceable(24)) #2

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

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

declare void @_ZN2BT10Blackboard8getEntryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.20") align 8, ptr noundef nonnull align 8 dereferenceable(217), ptr noundef nonnull align 8 dereferenceable(32)) #2

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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, !22, i64 64}
!10 = !{!"_ZTSN2BT21EntryUpdatedDecoratorE", !11, i64 0, !19, i64 24, !20, i64 32, !22, i64 64, !23, i64 68}
!11 = !{!"_ZTSN2BT13DecoratorNodeE", !12, i64 0, !6, i64 16}
!12 = !{!"_ZTSN2BT8TreeNodeE", !13, i64 8}
!13 = !{!"_ZTSSt10unique_ptrIN2BT8TreeNode5PImplESt14default_deleteIS2_EE", !14, i64 0}
!14 = !{!"_ZTSSt15__uniq_ptr_dataIN2BT8TreeNode5PImplESt14default_deleteIS2_ELb1ELb1EE", !15, i64 0}
!15 = !{!"_ZTSSt15__uniq_ptr_implIN2BT8TreeNode5PImplESt14default_deleteIS2_EE", !16, i64 0}
!16 = !{!"_ZTSSt5tupleIJPN2BT8TreeNode5PImplESt14default_deleteIS2_EEE", !17, i64 0}
!17 = !{!"_ZTSSt11_Tuple_implILm0EJPN2BT8TreeNode5PImplESt14default_deleteIS2_EEE", !18, i64 0}
!18 = !{!"_ZTSSt10_Head_baseILm0EPN2BT8TreeNode5PImplELb0EE", !6, i64 0}
!19 = !{!"long", !7, i64 0}
!20 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !21, i64 0, !19, i64 8, !7, i64 16}
!21 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!22 = !{!"bool", !7, i64 0}
!23 = !{!"_ZTSN2BT10NodeStatusE", !7, i64 0}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = !{!27, !27, i64 0}
!27 = !{!"vtable pointer", !8, i64 0}
!28 = !{!23, !23, i64 0}
!29 = !{!30, !19, i64 176}
!30 = !{!"_ZTSN2BT10Blackboard5EntryE", !31, i64 0, !34, i64 32, !35, i64 104, !37, i64 136, !19, i64 176, !39, i64 184}
!31 = !{!"_ZTSN2BT3AnyE", !32, i64 0, !33, i64 24}
!32 = !{!"_ZTSN4linb3anyE", !7, i64 0, !6, i64 16}
!33 = !{!"_ZTSSt10type_index", !6, i64 0}
!34 = !{!"_ZTSN2BT8TypeInfoE", !33, i64 0, !35, i64 8, !20, i64 40}
!35 = !{!"_ZTSSt8functionIFN2BT3AnyESt17basic_string_viewIcSt11char_traitsIcEEEE", !36, i64 0, !6, i64 24}
!36 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!37 = !{!"_ZTSSt5mutex", !38, i64 0}
!38 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!39 = !{!"_ZTSNSt6chrono8durationIlSt5ratioILl1ELl1000000000EEEE", !19, i64 0}
!40 = !{!19, !19, i64 0}
!41 = !{!10, !19, i64 24}
!42 = !{!10, !23, i64 68}


; 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::shared_ptr.20" = type { %"class.std::__shared_ptr.21" }
%"class.std::__shared_ptr.21" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"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 uwtable
define dso_local noundef i32 @_ZN2BT21EntryUpdatedDecorator4tickEv(ptr noundef nonnull align 8 dereferenceable(72) %0) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::shared_ptr.20", align 8
  %3 = alloca %"class.std::unique_lock", align 8
  %4 = getelementptr inbounds i8, ptr %0, i64 64
  %5 = load i8, ptr %4, align 8, !tbaa !5, !range !23, !noundef !24
  %6 = trunc nuw i8 %5 to i1
  br i1 %6, label %7, label %15

7:                                                ; preds = %1
  %8 = tail call noundef ptr @_ZN2BT13DecoratorNode5childEv(ptr noundef nonnull align 8 dereferenceable(24) %0)
  %9 = load ptr, ptr %8, align 8, !tbaa !25
  %10 = getelementptr inbounds i8, ptr %9, i64 16
  %11 = load ptr, ptr %10, align 8
  %12 = tail call noundef i32 %11(ptr noundef nonnull align 8 dereferenceable(16) %8)
  %13 = icmp eq i32 %12, 1
  %14 = zext i1 %13 to i8
  store i8 %14, ptr %4, align 8, !tbaa !5
  br label %45

15:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #4
  %16 = tail call noundef nonnull align 8 dereferenceable(344) ptr @_ZN2BT8TreeNode6configEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
  %17 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN2BT10BlackboardELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %16) #4
  %18 = getelementptr inbounds i8, ptr %0, i64 32
  call void @_ZN2BT10Blackboard8getEntryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.20") align 8 %2, ptr noundef nonnull align 8 dereferenceable(217) %17, ptr noundef nonnull align 8 dereferenceable(32) %18)
  %19 = call noundef zeroext i1 @_ZNKSt12__shared_ptrIN2BT10Blackboard5EntryELN9__gnu_cxx12_Lock_policyE2EEcvbEv(ptr noundef nonnull align 8 dereferenceable(16) %2) #4
  br i1 %19, label %20, label %34

20:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #4
  %21 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN2BT10Blackboard5EntryELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %2) #4
  %22 = getelementptr inbounds i8, ptr %21, i64 136
  invoke void @_ZNSt11unique_lockISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(9) %3, ptr noundef nonnull align 8 dereferenceable(40) %22)
          to label %23 unwind label %32

23:                                               ; preds = %20
  %24 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN2BT10Blackboard5EntryELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %2) #4
  %25 = getelementptr inbounds i8, ptr %24, i64 176
  %26 = load i64, ptr %25, align 8, !tbaa !27
  %27 = getelementptr inbounds i8, ptr %0, i64 24
  %28 = load i64, ptr %27, align 8, !tbaa !38
  store i64 %26, ptr %27, align 8, !tbaa !38
  %29 = icmp eq i64 %28, %26
  %30 = getelementptr inbounds i8, ptr %0, i64 68
  %31 = load i32, ptr %30, align 4
  call void @_ZNSt11unique_lockISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(9) %3) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #4
  br i1 %29, label %.thread, label %37

32:                                               ; preds = %20
  %33 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #4
  call void @_ZNSt12__shared_ptrIN2BT10Blackboard5EntryELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #4
  resume { ptr, i32 } %33

34:                                               ; preds = %15
  %35 = getelementptr inbounds i8, ptr %0, i64 68
  %36 = load i32, ptr %35, align 4, !tbaa !39
  br label %.thread

.thread:                                          ; preds = %34, %23
  %.1.ph = phi i32 [ %36, %34 ], [ %31, %23 ]
  call void @_ZNSt12__shared_ptrIN2BT10Blackboard5EntryELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #4
  br label %45

37:                                               ; preds = %23
  call void @_ZNSt12__shared_ptrIN2BT10Blackboard5EntryELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %2) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #4
  %38 = call noundef ptr @_ZN2BT13DecoratorNode5childEv(ptr noundef nonnull align 8 dereferenceable(24) %0)
  %39 = load ptr, ptr %38, align 8, !tbaa !25
  %40 = getelementptr inbounds i8, ptr %39, i64 16
  %41 = load ptr, ptr %40, align 8
  %42 = call noundef i32 %41(ptr noundef nonnull align 8 dereferenceable(16) %38)
  %43 = icmp eq i32 %42, 1
  %44 = zext i1 %43 to i8
  store i8 %44, ptr %4, align 8, !tbaa !5
  br label %45

45:                                               ; preds = %.thread, %37, %7
  %.2 = phi i32 [ %12, %7 ], [ %42, %37 ], [ %.1.ph, %.thread ]
  ret i32 %.2
}

declare noundef ptr @_ZN2BT13DecoratorNode5childEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2

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

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

declare void @_ZN2BT10Blackboard8getEntryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.20") align 8, ptr noundef nonnull align 8 dereferenceable(217), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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, !21, i64 64}
!6 = !{!"_ZTSN2BT21EntryUpdatedDecoratorE", !7, i64 0, !18, i64 24, !19, i64 32, !21, i64 64, !22, i64 68}
!7 = !{!"_ZTSN2BT13DecoratorNodeE", !8, i64 0, !15, i64 16}
!8 = !{!"_ZTSN2BT8TreeNodeE", !9, i64 8}
!9 = !{!"_ZTSSt10unique_ptrIN2BT8TreeNode5PImplESt14default_deleteIS2_EE", !10, i64 0}
!10 = !{!"_ZTSSt15__uniq_ptr_dataIN2BT8TreeNode5PImplESt14default_deleteIS2_ELb1ELb1EE", !11, i64 0}
!11 = !{!"_ZTSSt15__uniq_ptr_implIN2BT8TreeNode5PImplESt14default_deleteIS2_EE", !12, i64 0}
!12 = !{!"_ZTSSt5tupleIJPN2BT8TreeNode5PImplESt14default_deleteIS2_EEE", !13, i64 0}
!13 = !{!"_ZTSSt11_Tuple_implILm0EJPN2BT8TreeNode5PImplESt14default_deleteIS2_EEE", !14, i64 0}
!14 = !{!"_ZTSSt10_Head_baseILm0EPN2BT8TreeNode5PImplELb0EE", !15, i64 0}
!15 = !{!"any pointer", !16, i64 0}
!16 = !{!"omnipotent char", !17, i64 0}
!17 = !{!"Simple C++ TBAA"}
!18 = !{!"long", !16, i64 0}
!19 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !20, i64 0, !18, i64 8, !16, i64 16}
!20 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !15, i64 0}
!21 = !{!"bool", !16, i64 0}
!22 = !{!"_ZTSN2BT10NodeStatusE", !16, i64 0}
!23 = !{i8 0, i8 2}
!24 = !{}
!25 = !{!26, !26, i64 0}
!26 = !{!"vtable pointer", !17, i64 0}
!27 = !{!28, !18, i64 176}
!28 = !{!"_ZTSN2BT10Blackboard5EntryE", !29, i64 0, !32, i64 32, !33, i64 104, !35, i64 136, !18, i64 176, !37, i64 184}
!29 = !{!"_ZTSN2BT3AnyE", !30, i64 0, !31, i64 24}
!30 = !{!"_ZTSN4linb3anyE", !16, i64 0, !15, i64 16}
!31 = !{!"_ZTSSt10type_index", !15, i64 0}
!32 = !{!"_ZTSN2BT8TypeInfoE", !31, i64 0, !33, i64 8, !19, i64 40}
!33 = !{!"_ZTSSt8functionIFN2BT3AnyESt17basic_string_viewIcSt11char_traitsIcEEEE", !34, i64 0, !15, i64 24}
!34 = !{!"_ZTSSt14_Function_base", !16, i64 0, !15, i64 16}
!35 = !{!"_ZTSSt5mutex", !36, i64 0}
!36 = !{!"_ZTSSt12__mutex_base", !16, i64 0}
!37 = !{!"_ZTSNSt6chrono8durationIlSt5ratioILl1ELl1000000000EEEE", !18, i64 0}
!38 = !{!6, !18, i64 24}
!39 = !{!6, !22, i64 68}


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