; LLVM IR from BehaviorTree/BehaviorTree.CPP :: tests/src/action_test_node.ll (ZN2BT15AsyncActionTest4tickEv)

; 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::chrono::time_point" = type { %"class.std::chrono::duration" }
%"class.std::chrono::duration" = type { i64 }
%"class.std::chrono::duration.25" = type { i64 }
%"class.BT::AsyncActionTest" = type { %"class.BT::ThreadedAction", %"class.std::chrono::duration", %"struct.std::atomic.2", %"struct.std::atomic.3", i32, i32 }
%"class.BT::ThreadedAction" = type { %"class.BT::ActionNodeBase", %"class.std::__exception_ptr::exception_ptr", %"struct.std::atomic", %"class.std::future", %"class.std::mutex" }
%"class.BT::ActionNodeBase" = type { %"class.BT::LeafNode" }
%"class.BT::LeafNode" = type { %"class.BT::TreeNode" }
%"class.BT::TreeNode" = type { ptr, %"class.std::unique_ptr" }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.1" }
%"struct.std::_Head_base.1" = type { ptr }
%"class.std::__exception_ptr::exception_ptr" = type { ptr }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i8 }
%"class.std::future" = type { %"class.std::__basic_future" }
%"class.std::__basic_future" = type { %"class.std::shared_ptr" }
%"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::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 }
%"struct.std::atomic.2" = type { i32 }
%"struct.std::atomic.3" = type { %"struct.std::__atomic_base.4" }
%"struct.std::__atomic_base.4" = type { i32 }

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

; 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 @_ZN2BT15AsyncActionTest4tickEv(ptr noundef nonnull align 8 dereferenceable(112) %0) unnamed_addr #1 align 2 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca %"class.std::chrono::time_point", align 8
  %5 = alloca %"class.std::chrono::time_point", align 8
  %6 = alloca %"class.std::chrono::time_point", align 8
  %7 = alloca %"class.std::chrono::duration.25", align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %10 = load ptr, ptr %3, align 8
  %11 = getelementptr inbounds %"class.BT::AsyncActionTest", ptr %10, i32 0, i32 3
  %12 = call noundef i32 @_ZNSt13__atomic_baseIiEppEi(ptr noundef nonnull align 4 dereferenceable(4) %11, i32 noundef 0) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %13 = call i64 @_ZNSt6chrono3_V212system_clock3nowEv() #5
  %14 = getelementptr inbounds %"class.std::chrono::time_point", ptr %4, i32 0, i32 0
  %15 = getelementptr inbounds %"class.std::chrono::duration", ptr %14, i32 0, i32 0
  store i64 %13, ptr %15, align 8
  br label %16

16:                                               ; preds = %29, %1
  %17 = call noundef zeroext i1 @_ZNK2BT14ThreadedAction15isHaltRequestedEv(ptr noundef nonnull align 8 dereferenceable(88) %10)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  br i1 %17, label %27, label %18

18:                                               ; preds = %16
  %19 = call i64 @_ZNSt6chrono3_V212system_clock3nowEv() #5
  %20 = getelementptr inbounds %"class.std::chrono::time_point", ptr %5, i32 0, i32 0
  %21 = getelementptr inbounds %"class.std::chrono::duration", ptr %20, i32 0, i32 0
  store i64 %19, ptr %21, align 8
  %22 = getelementptr inbounds %"class.BT::AsyncActionTest", ptr %10, i32 0, i32 1
  %23 = call i64 @_ZNSt6chronoplINS_3_V212system_clockENS_8durationIlSt5ratioILl1ELl1000000000EEEElS5_EENS_10time_pointIT_NSt11common_typeIJT0_NS3_IT1_T2_EEEE4typeEEERKNS7_IS8_SA_EERKSD_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %22)
  %24 = getelementptr inbounds %"class.std::chrono::time_point", ptr %6, i32 0, i32 0
  %25 = getelementptr inbounds %"class.std::chrono::duration", ptr %24, i32 0, i32 0
  store i64 %23, ptr %25, align 8
  %26 = call noundef zeroext i1 @_ZNSt6chronoltINS_3_V212system_clockENS_8durationIlSt5ratioILl1ELl1000000000EEEES6_EEbRKNS_10time_pointIT_T0_EERKNS7_IS8_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
  br label %27

27:                                               ; preds = %18, %16
  %28 = phi i1 [ false, %16 ], [ %26, %18 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br i1 %28, label %29, label %30

29:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 1, ptr %8, align 4, !tbaa !9
  call void @_ZNSt6chrono8durationIlSt5ratioILl1ELl1000EEEC2IivEERKT_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @_ZNSt11this_thread9sleep_forIlSt5ratioILl1ELl1000EEEEvRKNSt6chrono8durationIT_T0_EE(ptr noundef nonnull align 8 dereferenceable(8) %7)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %16, !llvm.loop !11

30:                                               ; preds = %27
  %31 = call noundef zeroext i1 @_ZNK2BT14ThreadedAction15isHaltRequestedEv(ptr noundef nonnull align 8 dereferenceable(88) %10)
  br i1 %31, label %32, label %33

32:                                               ; preds = %30
  store i32 0, ptr %2, align 4
  store i32 1, ptr %9, align 4
  br label %53

33:                                               ; preds = %30
  %34 = getelementptr inbounds %"class.BT::AsyncActionTest", ptr %10, i32 0, i32 2
  %35 = call noundef i32 @_ZNKSt6atomicIN2BT10NodeStatusEEcvS1_Ev(ptr noundef nonnull align 4 dereferenceable(4) %34) #5
  %36 = icmp eq i32 %35, 2
  br i1 %36, label %37, label %41

37:                                               ; preds = %33
  %38 = getelementptr inbounds %"class.BT::AsyncActionTest", ptr %10, i32 0, i32 4
  %39 = load i32, ptr %38, align 8, !tbaa !13
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %38, align 8, !tbaa !13
  br label %50

41:                                               ; preds = %33
  %42 = getelementptr inbounds %"class.BT::AsyncActionTest", ptr %10, i32 0, i32 2
  %43 = call noundef i32 @_ZNKSt6atomicIN2BT10NodeStatusEEcvS1_Ev(ptr noundef nonnull align 4 dereferenceable(4) %42) #5
  %44 = icmp eq i32 %43, 3
  br i1 %44, label %45, label %49

45:                                               ; preds = %41
  %46 = getelementptr inbounds %"class.BT::AsyncActionTest", ptr %10, i32 0, i32 5
  %47 = load i32, ptr %46, align 4, !tbaa !42
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %46, align 4, !tbaa !42
  br label %49

49:                                               ; preds = %45, %41
  br label %50

50:                                               ; preds = %49, %37
  %51 = getelementptr inbounds %"class.BT::AsyncActionTest", ptr %10, i32 0, i32 2
  %52 = call noundef i32 @_ZNKSt6atomicIN2BT10NodeStatusEEcvS1_Ev(ptr noundef nonnull align 4 dereferenceable(4) %51) #5
  store i32 %52, ptr %2, align 4
  store i32 1, ptr %9, align 4
  br label %53

53:                                               ; preds = %50, %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  %54 = load i32, ptr %2, align 4
  ret i32 %54
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNSt13__atomic_baseIiEppEi(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #2 align 2

; Function Attrs: nounwind
declare i64 @_ZNSt6chrono3_V212system_clock3nowEv() #3

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZNSt6chronoplINS_3_V212system_clockENS_8durationIlSt5ratioILl1ELl1000000000EEEElS5_EENS_10time_pointIT_NSt11common_typeIJT0_NS3_IT1_T2_EEEE4typeEEERKNS7_IS8_SA_EERKSD_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNSt11this_thread9sleep_forIlSt5ratioILl1ELl1000EEEEvRKNSt6chrono8durationIT_T0_EE(ptr noundef nonnull align 8 dereferenceable(8)) #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNKSt6atomicIN2BT10NodeStatusEEcvS1_Ev(ptr noundef nonnull align 4 dereferenceable(4)) #2 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 = { 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 #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !10, i64 104}
!14 = !{!"_ZTSN2BT15AsyncActionTestE", !15, i64 0, !36, i64 88, !38, i64 96, !40, i64 100, !10, i64 104, !10, i64 108}
!15 = !{!"_ZTSN2BT14ThreadedActionE", !16, i64 0, !25, i64 16, !26, i64 24, !29, i64 32, !34, i64 48}
!16 = !{!"_ZTSN2BT14ActionNodeBaseE", !17, i64 0}
!17 = !{!"_ZTSN2BT8LeafNodeE", !18, i64 0}
!18 = !{!"_ZTSN2BT8TreeNodeE", !19, i64 8}
!19 = !{!"_ZTSSt10unique_ptrIN2BT8TreeNode5PImplESt14default_deleteIS2_EE", !20, i64 0}
!20 = !{!"_ZTSSt15__uniq_ptr_dataIN2BT8TreeNode5PImplESt14default_deleteIS2_ELb1ELb1EE", !21, i64 0}
!21 = !{!"_ZTSSt15__uniq_ptr_implIN2BT8TreeNode5PImplESt14default_deleteIS2_EE", !22, i64 0}
!22 = !{!"_ZTSSt5tupleIJPN2BT8TreeNode5PImplESt14default_deleteIS2_EEE", !23, i64 0}
!23 = !{!"_ZTSSt11_Tuple_implILm0EJPN2BT8TreeNode5PImplESt14default_deleteIS2_EEE", !24, i64 0}
!24 = !{!"_ZTSSt10_Head_baseILm0EPN2BT8TreeNode5PImplELb0EE", !6, i64 0}
!25 = !{!"_ZTSNSt15__exception_ptr13exception_ptrE", !6, i64 0}
!26 = !{!"_ZTSSt6atomicIbE", !27, i64 0}
!27 = !{!"_ZTSSt13__atomic_baseIbE", !28, i64 0}
!28 = !{!"bool", !7, i64 0}
!29 = !{!"_ZTSSt6futureIvE", !30, i64 0}
!30 = !{!"_ZTSSt14__basic_futureIvE", !31, i64 0}
!31 = !{!"_ZTSSt10shared_ptrINSt13__future_base13_State_baseV2EE", !32, i64 0}
!32 = !{!"_ZTSSt12__shared_ptrINSt13__future_base13_State_baseV2ELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !33, i64 8}
!33 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!34 = !{!"_ZTSSt5mutex", !35, i64 0}
!35 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!36 = !{!"_ZTSNSt6chrono8durationIlSt5ratioILl1ELl1000000000EEEE", !37, i64 0}
!37 = !{!"long", !7, i64 0}
!38 = !{!"_ZTSSt6atomicIN2BT10NodeStatusEE", !39, i64 0}
!39 = !{!"_ZTSN2BT10NodeStatusE", !7, i64 0}
!40 = !{!"_ZTSSt6atomicIiE", !41, i64 0}
!41 = !{!"_ZTSSt13__atomic_baseIiE", !10, i64 0}
!42 = !{!14, !10, i64 108}


; 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::chrono::time_point" = type { %"class.std::chrono::duration" }
%"class.std::chrono::duration" = type { i64 }
%"class.std::chrono::duration.25" = type { i64 }

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

; Function Attrs: mustprogress 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 @_ZN2BT15AsyncActionTest4tickEv(ptr noundef nonnull align 8 dereferenceable(112) %0) unnamed_addr #1 align 2 {
  %2 = alloca %"class.std::chrono::time_point", align 8
  %3 = alloca %"class.std::chrono::time_point", align 8
  %4 = alloca %"class.std::chrono::time_point", align 8
  %5 = alloca %"class.std::chrono::duration.25", align 8
  %6 = alloca i32, align 4
  %7 = getelementptr inbounds i8, ptr %0, i64 100
  %8 = tail call noundef i32 @_ZNSt13__atomic_baseIiEppEi(ptr noundef nonnull align 4 dereferenceable(4) %7, i32 noundef 0) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %9 = tail call i64 @_ZNSt6chrono3_V212system_clock3nowEv() #5
  store i64 %9, ptr %2, align 8
  %10 = tail call noundef zeroext i1 @_ZNK2BT14ThreadedAction15isHaltRequestedEv(ptr noundef nonnull align 8 dereferenceable(88) %0)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  br i1 %10, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %1
  %11 = getelementptr inbounds i8, ptr %0, i64 88
  br label %12

12:                                               ; preds = %.lr.ph, %16
  %13 = call i64 @_ZNSt6chrono3_V212system_clock3nowEv() #5
  store i64 %13, ptr %3, align 8
  %14 = call i64 @_ZNSt6chronoplINS_3_V212system_clockENS_8durationIlSt5ratioILl1ELl1000000000EEEElS5_EENS_10time_pointIT_NSt11common_typeIJT0_NS3_IT1_T2_EEEE4typeEEERKNS7_IS8_SA_EERKSD_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %11)
  store i64 %14, ptr %4, align 8
  %15 = call noundef zeroext i1 @_ZNSt6chronoltINS_3_V212system_clockENS_8durationIlSt5ratioILl1ELl1000000000EEEES6_EEbRKNS_10time_pointIT_T0_EERKNS7_IS8_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  br i1 %15, label %16, label %.loopexit

16:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  store i32 1, ptr %6, align 4, !tbaa !5
  call void @_ZNSt6chrono8durationIlSt5ratioILl1ELl1000EEEC2IivEERKT_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @_ZNSt11this_thread9sleep_forIlSt5ratioILl1ELl1000EEEEvRKNSt6chrono8durationIT_T0_EE(ptr noundef nonnull align 8 dereferenceable(8) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  %17 = call noundef zeroext i1 @_ZNK2BT14ThreadedAction15isHaltRequestedEv(ptr noundef nonnull align 8 dereferenceable(88) %0)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  br i1 %17, label %.critedge, label %12, !llvm.loop !9

.critedge:                                        ; preds = %16, %1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  br label %.loopexit

.loopexit:                                        ; preds = %12, %.critedge
  %18 = call noundef zeroext i1 @_ZNK2BT14ThreadedAction15isHaltRequestedEv(ptr noundef nonnull align 8 dereferenceable(88) %0)
  br i1 %18, label %36, label %19

19:                                               ; preds = %.loopexit
  %20 = getelementptr inbounds i8, ptr %0, i64 96
  %21 = call noundef i32 @_ZNKSt6atomicIN2BT10NodeStatusEEcvS1_Ev(ptr noundef nonnull align 4 dereferenceable(4) %20) #5
  %22 = icmp eq i32 %21, 2
  br i1 %22, label %23, label %27

23:                                               ; preds = %19
  %24 = getelementptr inbounds i8, ptr %0, i64 104
  %25 = load i32, ptr %24, align 8, !tbaa !11
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr %24, align 8, !tbaa !11
  br label %34

27:                                               ; preds = %19
  %28 = call noundef i32 @_ZNKSt6atomicIN2BT10NodeStatusEEcvS1_Ev(ptr noundef nonnull align 4 dereferenceable(4) %20) #5
  %29 = icmp eq i32 %28, 3
  br i1 %29, label %30, label %34

30:                                               ; preds = %27
  %31 = getelementptr inbounds i8, ptr %0, i64 108
  %32 = load i32, ptr %31, align 4, !tbaa !41
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %31, align 4, !tbaa !41
  br label %34

34:                                               ; preds = %27, %30, %23
  %35 = call noundef i32 @_ZNKSt6atomicIN2BT10NodeStatusEEcvS1_Ev(ptr noundef nonnull align 4 dereferenceable(4) %20) #5
  br label %36

36:                                               ; preds = %.loopexit, %34
  %.0 = phi i32 [ %35, %34 ], [ 0, %.loopexit ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  ret i32 %.0
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNSt13__atomic_baseIiEppEi(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: nounwind
declare i64 @_ZNSt6chrono3_V212system_clock3nowEv() local_unnamed_addr #3

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZNSt6chronoplINS_3_V212system_clockENS_8durationIlSt5ratioILl1ELl1000000000EEEElS5_EENS_10time_pointIT_NSt11common_typeIJT0_NS3_IT1_T2_EEEE4typeEEERKNS7_IS8_SA_EERKSD_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNSt11this_thread9sleep_forIlSt5ratioILl1ELl1000EEEEvRKNSt6chrono8durationIT_T0_EE(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNKSt6atomicIN2BT10NodeStatusEEcvS1_Ev(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 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 = { 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 #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !6, i64 104}
!12 = !{!"_ZTSN2BT15AsyncActionTestE", !13, i64 0, !35, i64 88, !37, i64 96, !39, i64 100, !6, i64 104, !6, i64 108}
!13 = !{!"_ZTSN2BT14ThreadedActionE", !14, i64 0, !24, i64 16, !25, i64 24, !28, i64 32, !33, i64 48}
!14 = !{!"_ZTSN2BT14ActionNodeBaseE", !15, i64 0}
!15 = !{!"_ZTSN2BT8LeafNodeE", !16, i64 0}
!16 = !{!"_ZTSN2BT8TreeNodeE", !17, i64 8}
!17 = !{!"_ZTSSt10unique_ptrIN2BT8TreeNode5PImplESt14default_deleteIS2_EE", !18, i64 0}
!18 = !{!"_ZTSSt15__uniq_ptr_dataIN2BT8TreeNode5PImplESt14default_deleteIS2_ELb1ELb1EE", !19, i64 0}
!19 = !{!"_ZTSSt15__uniq_ptr_implIN2BT8TreeNode5PImplESt14default_deleteIS2_EE", !20, i64 0}
!20 = !{!"_ZTSSt5tupleIJPN2BT8TreeNode5PImplESt14default_deleteIS2_EEE", !21, i64 0}
!21 = !{!"_ZTSSt11_Tuple_implILm0EJPN2BT8TreeNode5PImplESt14default_deleteIS2_EEE", !22, i64 0}
!22 = !{!"_ZTSSt10_Head_baseILm0EPN2BT8TreeNode5PImplELb0EE", !23, i64 0}
!23 = !{!"any pointer", !7, i64 0}
!24 = !{!"_ZTSNSt15__exception_ptr13exception_ptrE", !23, i64 0}
!25 = !{!"_ZTSSt6atomicIbE", !26, i64 0}
!26 = !{!"_ZTSSt13__atomic_baseIbE", !27, i64 0}
!27 = !{!"bool", !7, i64 0}
!28 = !{!"_ZTSSt6futureIvE", !29, i64 0}
!29 = !{!"_ZTSSt14__basic_futureIvE", !30, i64 0}
!30 = !{!"_ZTSSt10shared_ptrINSt13__future_base13_State_baseV2EE", !31, i64 0}
!31 = !{!"_ZTSSt12__shared_ptrINSt13__future_base13_State_baseV2ELN9__gnu_cxx12_Lock_policyE2EE", !23, i64 0, !32, i64 8}
!32 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !23, i64 0}
!33 = !{!"_ZTSSt5mutex", !34, i64 0}
!34 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!35 = !{!"_ZTSNSt6chrono8durationIlSt5ratioILl1ELl1000000000EEEE", !36, i64 0}
!36 = !{!"long", !7, i64 0}
!37 = !{!"_ZTSSt6atomicIN2BT10NodeStatusEE", !38, i64 0}
!38 = !{!"_ZTSN2BT10NodeStatusE", !7, i64 0}
!39 = !{!"_ZTSSt6atomicIiE", !40, i64 0}
!40 = !{!"_ZTSSt13__atomic_baseIiE", !6, i64 0}
!41 = !{!12, !6, i64 108}


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