; LLVM IR from yinqiwen/ardb :: src/common/coro/scheduler.ll (ZN4ardb9Scheduler11DestroyCoroEPNS_9CoroutineE)

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

%"struct.btree::btree_iterator" = type <{ ptr, i32, [4 x i8] }>
%"struct.btree::btree_iterator.6" = type <{ ptr, i32, [4 x i8] }>
%"class.ardb::Scheduler" = type { %"class.std::stack", %"class.std::stack", %"class.btree::btree_map", %"class.btree::btree_map", ptr }
%"class.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<ardb::Coroutine *, std::allocator<ardb::Coroutine *>>::_Deque_impl" }
%"struct.std::_Deque_base<ardb::Coroutine *, std::allocator<ardb::Coroutine *>>::_Deque_impl" = type { %"struct.std::_Deque_base<ardb::Coroutine *, std::allocator<ardb::Coroutine *>>::_Deque_impl_data" }
%"struct.std::_Deque_base<ardb::Coroutine *, std::allocator<ardb::Coroutine *>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.btree::btree_map" = type { %"class.btree::btree_map_container" }
%"class.btree::btree_map_container" = type { %"class.btree::btree_unique_container" }
%"class.btree::btree_unique_container" = type { %"class.btree::btree_container" }
%"class.btree::btree_container" = type { %"class.btree::btree" }
%"class.btree::btree" = type { %"struct.btree::btree<btree::btree_map_params<unsigned long, ardb::Coroutine *, std::less<unsigned long>, std::allocator<std::pair<const unsigned long, ardb::Coroutine *>>, 256>>::empty_base_handle" }
%"struct.btree::btree<btree::btree_map_params<unsigned long, ardb::Coroutine *, std::less<unsigned long>, std::allocator<std::pair<const unsigned long, ardb::Coroutine *>>, 256>>::empty_base_handle" = type { ptr }
%"struct.ardb::Coroutine" = type { i64, ptr, %struct.coro_context, %struct.coro_stack }
%struct.coro_context = type { ptr }
%struct.coro_stack = type { ptr, i64 }
%"struct.std::pair" = type { i64, ptr }

; 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
declare dso_local void @_ZN4ardb9Scheduler5CleanEv(ptr noundef nonnull align 8 dereferenceable(184)) #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIPN4ardb9CoroutineESt5dequeIS2_SaIS2_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80)) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIPN4ardb9CoroutineESt5dequeIS2_SaIS2_EEE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

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

declare void @coro_transfer(ptr noundef, ptr noundef) #3

; Function Attrs: noreturn nounwind
declare void @abort() #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4ardb9Scheduler11DestroyCoroEPNS_9CoroutineE(ptr noundef nonnull align 8 dereferenceable(184) %0, ptr noundef %1) #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"struct.btree::btree_iterator", align 8
  %6 = alloca %"struct.btree::btree_iterator.6", align 8
  %7 = alloca %"struct.btree::btree_iterator", align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"struct.btree::btree_iterator", align 8
  %10 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %11 = load ptr, ptr %3, align 8
  call void @_ZN4ardb9Scheduler5CleanEv(ptr noundef nonnull align 8 dereferenceable(184) %11)
  %12 = getelementptr inbounds %"class.ardb::Scheduler", ptr %11, i32 0, i32 3
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = getelementptr inbounds %"struct.ardb::Coroutine", ptr %13, i32 0, i32 0
  %15 = call noundef i32 @_ZN5btree22btree_unique_containerINS_5btreeINS_16btree_map_paramsImPN4ardb9CoroutineESt4lessImESaISt4pairIKmS5_EELi256EEEEEE5eraseERS9_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %14)
  %16 = getelementptr inbounds %"class.ardb::Scheduler", ptr %11, i32 0, i32 1
  call void @_ZNSt5stackIPN4ardb9CoroutineESt5dequeIS2_SaIS2_EEE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(80) %16, ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #5
  %17 = getelementptr inbounds %"class.ardb::Scheduler", ptr %11, i32 0, i32 2
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %"struct.ardb::Coroutine", ptr %18, i32 0, i32 0
  call void @_ZN5btree22btree_unique_containerINS_5btreeINS_16btree_map_paramsImPN4ardb9CoroutineESt4lessImESaISt4pairIKmS5_EELi256EEEEEE4findERS9_(ptr dead_on_unwind writable sret(%"struct.btree::btree_iterator") align 8 %5, ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %19)
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #5
  %20 = getelementptr inbounds %"class.ardb::Scheduler", ptr %11, i32 0, i32 2
  call void @_ZN5btree15btree_containerINS_5btreeINS_16btree_map_paramsImPN4ardb9CoroutineESt4lessImESaISt4pairIKmS5_EELi256EEEEEE3endEv(ptr dead_on_unwind writable sret(%"struct.btree::btree_iterator") align 8 %7, ptr noundef nonnull align 8 dereferenceable(8) %20)
  call void @_ZN5btree14btree_iteratorIKNS_10btree_nodeINS_16btree_map_paramsImPN4ardb9CoroutineESt4lessImESaISt4pairIKmS5_EELi256EEEEERKSA_PSF_EC2ERKNS0_ISD_RSA_PSA_EE(ptr noundef nonnull align 8 dereferenceable(12) %6, ptr noundef nonnull align 8 dereferenceable(12) %7)
  %21 = call noundef zeroext i1 @_ZNK5btree14btree_iteratorINS_10btree_nodeINS_16btree_map_paramsImPN4ardb9CoroutineESt4lessImESaISt4pairIKmS5_EELi256EEEEERSA_PSA_EneERKNS0_IKSD_RKSA_PSI_EE(ptr noundef nonnull align 8 dereferenceable(12) %5, ptr noundef nonnull align 8 dereferenceable(12) %6)
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #5
  br i1 %21, label %22, label %32

22:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %23 = call noundef ptr @_ZNK5btree14btree_iteratorINS_10btree_nodeINS_16btree_map_paramsImPN4ardb9CoroutineESt4lessImESaISt4pairIKmS5_EELi256EEEEERSA_PSA_EptEv(ptr noundef nonnull align 8 dereferenceable(12) %5)
  %24 = getelementptr inbounds %"struct.std::pair", ptr %23, i32 0, i32 1
  %25 = load ptr, ptr %24, align 8, !tbaa !9
  store ptr %25, ptr %8, align 8, !tbaa !5
  %26 = getelementptr inbounds %"class.ardb::Scheduler", ptr %11, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #5
  call void @_ZN5btree22btree_unique_containerINS_5btreeINS_16btree_map_paramsImPN4ardb9CoroutineESt4lessImESaISt4pairIKmS5_EELi256EEEEEE5eraseERKNS_14btree_iteratorINS_10btree_nodeISC_EERSA_PSA_EE(ptr dead_on_unwind writable sret(%"struct.btree::btree_iterator") align 8 %9, ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull align 8 dereferenceable(12) %5)
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #5
  %27 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN4ardb9Scheduler19SetCurrentCoroutineEPNS_9CoroutineE(ptr noundef nonnull align 8 dereferenceable(184) %11, ptr noundef %27)
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = getelementptr inbounds %"struct.ardb::Coroutine", ptr %28, i32 0, i32 2
  %30 = load ptr, ptr %8, align 8, !tbaa !5
  %31 = getelementptr inbounds %"struct.ardb::Coroutine", ptr %30, i32 0, i32 2
  call void @coro_transfer(ptr noundef %29, ptr noundef %31)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %47

32:                                               ; preds = %2
  %33 = getelementptr inbounds %"class.ardb::Scheduler", ptr %11, i32 0, i32 0
  %34 = call noundef zeroext i1 @_ZNKSt5stackIPN4ardb9CoroutineESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %33)
  br i1 %34, label %45, label %35

35:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %36 = getelementptr inbounds %"class.ardb::Scheduler", ptr %11, i32 0, i32 0
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIPN4ardb9CoroutineESt5dequeIS2_SaIS2_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %36)
  %38 = load ptr, ptr %37, align 8, !tbaa !5
  store ptr %38, ptr %10, align 8, !tbaa !5
  %39 = getelementptr inbounds %"class.ardb::Scheduler", ptr %11, i32 0, i32 0
  call void @_ZNSt5stackIPN4ardb9CoroutineESt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %39)
  %40 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN4ardb9Scheduler19SetCurrentCoroutineEPNS_9CoroutineE(ptr noundef nonnull align 8 dereferenceable(184) %11, ptr noundef %40)
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %"struct.ardb::Coroutine", ptr %41, i32 0, i32 2
  %43 = load ptr, ptr %10, align 8, !tbaa !5
  %44 = getelementptr inbounds %"struct.ardb::Coroutine", ptr %43, i32 0, i32 2
  call void @coro_transfer(ptr noundef %42, ptr noundef %44)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %46

45:                                               ; preds = %32
  call void @abort() #6
  unreachable

46:                                               ; preds = %35
  br label %47

47:                                               ; preds = %46, %22
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #5
  ret void
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5btree22btree_unique_containerINS_5btreeINS_16btree_map_paramsImPN4ardb9CoroutineESt4lessImESaISt4pairIKmS5_EELi256EEEEEE4findERS9_(ptr dead_on_unwind noalias writable sret(%"struct.btree::btree_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5btree15btree_containerINS_5btreeINS_16btree_map_paramsImPN4ardb9CoroutineESt4lessImESaISt4pairIKmS5_EELi256EEEEEE3endEv(ptr dead_on_unwind noalias writable sret(%"struct.btree::btree_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5btree22btree_unique_containerINS_5btreeINS_16btree_map_paramsImPN4ardb9CoroutineESt4lessImESaISt4pairIKmS5_EELi256EEEEEE5eraseERKNS_14btree_iteratorINS_10btree_nodeISC_EERSA_PSA_EE(ptr dead_on_unwind noalias writable sret(%"struct.btree::btree_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(12)) #1 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 = { "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 = { noreturn 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 #5 = { nounwind }
attributes #6 = { noreturn 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, !6, i64 8}
!10 = !{!"_ZTSSt4pairIKmPN4ardb9CoroutineEE", !11, i64 0, !6, i64 8}
!11 = !{!"long", !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"

%"struct.btree::btree_iterator" = type <{ ptr, i32, [4 x i8] }>
%"struct.btree::btree_iterator.6" = type <{ ptr, i32, [4 x i8] }>

; 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
declare dso_local void @_ZN4ardb9Scheduler5CleanEv(ptr noundef nonnull align 8 dereferenceable(184)) local_unnamed_addr #1 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIPN4ardb9CoroutineESt5dequeIS2_SaIS2_EEE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4ardb9Scheduler19SetCurrentCoroutineEPNS_9CoroutineE(ptr noundef nonnull align 8 dereferenceable(184), ptr noundef) local_unnamed_addr #2 align 2

declare void @coro_transfer(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4ardb9Scheduler11DestroyCoroEPNS_9CoroutineE(ptr noundef nonnull align 8 dereferenceable(184) %0, ptr noundef %1) local_unnamed_addr #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca %"struct.btree::btree_iterator", align 8
  %5 = alloca %"struct.btree::btree_iterator.6", align 8
  %6 = alloca %"struct.btree::btree_iterator", align 8
  %7 = alloca %"struct.btree::btree_iterator", align 8
  store ptr %1, ptr %3, align 8, !tbaa !5
  tail call void @_ZN4ardb9Scheduler5CleanEv(ptr noundef nonnull align 8 dereferenceable(184) %0)
  %8 = getelementptr inbounds i8, ptr %0, i64 168
  %9 = tail call noundef i32 @_ZN5btree22btree_unique_containerINS_5btreeINS_16btree_map_paramsImPN4ardb9CoroutineESt4lessImESaISt4pairIKmS5_EELi256EEEEEE5eraseERS9_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %10 = getelementptr inbounds i8, ptr %0, i64 80
  call void @_ZNSt5stackIPN4ardb9CoroutineESt5dequeIS2_SaIS2_EEE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(80) %10, ptr noundef nonnull align 8 dereferenceable(8) %3)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  %11 = getelementptr inbounds i8, ptr %0, i64 160
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  call void @_ZN5btree22btree_unique_containerINS_5btreeINS_16btree_map_paramsImPN4ardb9CoroutineESt4lessImESaISt4pairIKmS5_EELi256EEEEEE4findERS9_(ptr dead_on_unwind nonnull writable sret(%"struct.btree::btree_iterator") align 8 %4, ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #5
  call void @_ZN5btree15btree_containerINS_5btreeINS_16btree_map_paramsImPN4ardb9CoroutineESt4lessImESaISt4pairIKmS5_EELi256EEEEEE3endEv(ptr dead_on_unwind nonnull writable sret(%"struct.btree::btree_iterator") align 8 %6, ptr noundef nonnull align 8 dereferenceable(8) %11)
  call void @_ZN5btree14btree_iteratorIKNS_10btree_nodeINS_16btree_map_paramsImPN4ardb9CoroutineESt4lessImESaISt4pairIKmS5_EELi256EEEEERKSA_PSF_EC2ERKNS0_ISD_RSA_PSA_EE(ptr noundef nonnull align 8 dereferenceable(12) %5, ptr noundef nonnull align 8 dereferenceable(12) %6)
  %13 = call noundef zeroext i1 @_ZNK5btree14btree_iteratorINS_10btree_nodeINS_16btree_map_paramsImPN4ardb9CoroutineESt4lessImESaISt4pairIKmS5_EELi256EEEEERSA_PSA_EneERKNS0_IKSD_RKSA_PSI_EE(ptr noundef nonnull align 8 dereferenceable(12) %4, ptr noundef nonnull align 8 dereferenceable(12) %5)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  br i1 %13, label %14, label %18

14:                                               ; preds = %2
  %15 = call noundef ptr @_ZNK5btree14btree_iteratorINS_10btree_nodeINS_16btree_map_paramsImPN4ardb9CoroutineESt4lessImESaISt4pairIKmS5_EELi256EEEEERSA_PSA_EptEv(ptr noundef nonnull align 8 dereferenceable(12) %4)
  %16 = getelementptr inbounds i8, ptr %15, i64 8
  %17 = load ptr, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #5
  call void @_ZN5btree22btree_unique_containerINS_5btreeINS_16btree_map_paramsImPN4ardb9CoroutineESt4lessImESaISt4pairIKmS5_EELi256EEEEEE5eraseERKNS_14btree_iteratorINS_10btree_nodeISC_EERSA_PSA_EE(ptr dead_on_unwind nonnull writable sret(%"struct.btree::btree_iterator") align 8 %7, ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(12) %4)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #5
  br label %24

18:                                               ; preds = %2
  %19 = call noundef zeroext i1 @_ZNKSt5stackIPN4ardb9CoroutineESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
  br i1 %19, label %23, label %20

20:                                               ; preds = %18
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIPN4ardb9CoroutineESt5dequeIS2_SaIS2_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
  %22 = load ptr, ptr %21, align 8, !tbaa !5
  call void @_ZNSt5stackIPN4ardb9CoroutineESt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
  br label %24

23:                                               ; preds = %18
  call void @abort() #6
  unreachable

24:                                               ; preds = %20, %14
  %.sink = phi ptr [ %22, %20 ], [ %17, %14 ]
  call void @_ZN4ardb9Scheduler19SetCurrentCoroutineEPNS_9CoroutineE(ptr noundef nonnull align 8 dereferenceable(184) %0, ptr noundef %.sink)
  %.sink7 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %.sink7, i64 16
  %26 = getelementptr inbounds i8, ptr %.sink, i64 16
  call void @coro_transfer(ptr noundef nonnull %25, ptr noundef nonnull %26)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  ret void
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5btree22btree_unique_containerINS_5btreeINS_16btree_map_paramsImPN4ardb9CoroutineESt4lessImESaISt4pairIKmS5_EELi256EEEEEE4findERS9_(ptr dead_on_unwind noalias writable sret(%"struct.btree::btree_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5btree15btree_containerINS_5btreeINS_16btree_map_paramsImPN4ardb9CoroutineESt4lessImESaISt4pairIKmS5_EELi256EEEEEE3endEv(ptr dead_on_unwind noalias writable sret(%"struct.btree::btree_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5btree22btree_unique_containerINS_5btreeINS_16btree_map_paramsImPN4ardb9CoroutineESt4lessImESaISt4pairIKmS5_EELi256EEEEEE5eraseERKNS_14btree_iteratorINS_10btree_nodeISC_EERSA_PSA_EE(ptr dead_on_unwind noalias writable sret(%"struct.btree::btree_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #1 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 = { "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 = { noreturn 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 #5 = { nounwind }
attributes #6 = { noreturn 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, !6, i64 8}
!10 = !{!"_ZTSSt4pairIKmPN4ardb9CoroutineEE", !11, i64 0, !6, i64 8}
!11 = !{!"long", !7, i64 0}


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