; LLVM IR from yinqiwen/ardb :: src/common/channel (channel_service)

; 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.38" = type <{ ptr, i32, [4 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"class.ardb::ChannelService" = type { %"class.ardb::Runnable", %"struct.ardb::SoftSignalHandler", %"class.btree::btree_map", i32, ptr, ptr, ptr, ptr, %"class.std::__cxx11::list", %"class.ardb::MPSCQueue", i8, i32, %"class.std::vector", %"class.std::vector.6", i64, %"class.ardb::SPSCQueue", ptr, i32, ptr }
%"class.ardb::Runnable" = type { ptr }
%"struct.ardb::SoftSignalHandler" = type { 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 int, ardb::Channel *, std::less<unsigned int>, std::allocator<std::pair<const unsigned int, ardb::Channel *>>, 256>>::empty_base_handle" }
%"struct.btree::btree<btree::btree_map_params<unsigned int, ardb::Channel *, std::less<unsigned int>, std::allocator<std::pair<const unsigned int, ardb::Channel *>>, 256>>::empty_base_handle" = type { ptr }
%"class.std::__cxx11::list" = type { %"class.std::__cxx11::_List_base" }
%"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<unsigned int, std::allocator<unsigned int>>::_List_impl" }
%"struct.std::__cxx11::_List_base<unsigned int, std::allocator<unsigned int>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" }
%"struct.std::__detail::_List_node_header" = type { %"struct.std::__detail::_List_node_base", i64 }
%"struct.std::__detail::_List_node_base" = type { ptr, ptr }
%"class.ardb::MPSCQueue" = type { ptr, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<ardb::ChannelService *, std::allocator<ardb::ChannelService *>>::_Vector_impl" }
%"struct.std::_Vector_base<ardb::ChannelService *, std::allocator<ardb::ChannelService *>>::_Vector_impl" = type { %"struct.std::_Vector_base<ardb::ChannelService *, std::allocator<ardb::ChannelService *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<ardb::ChannelService *, std::allocator<ardb::ChannelService *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.6" = type { %"struct.std::_Vector_base.7" }
%"struct.std::_Vector_base.7" = type { %"struct.std::_Vector_base<ardb::Thread *, std::allocator<ardb::Thread *>>::_Vector_impl" }
%"struct.std::_Vector_base<ardb::Thread *, std::allocator<ardb::Thread *>>::_Vector_impl" = type { %"struct.std::_Vector_base<ardb::Thread *, std::allocator<ardb::Thread *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<ardb::Thread *, std::allocator<ardb::Thread *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.ardb::SPSCQueue" = type { ptr, [64 x i8], ptr, ptr, ptr }
%"struct.std::pair" = type { i32, 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 nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK5btree14btree_iteratorINS_10btree_nodeINS_16btree_map_paramsIjPN4ardb7ChannelESt4lessIjESaISt4pairIKjS5_EELi256EEEEERSA_PSA_EneERKNS0_IKSD_RKSA_PSI_EE(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef nonnull align 8 dereferenceable(12)) #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4ardb14ChannelService17CloseAllChannelFDERSt3setIPNS_7ChannelESt4lessIS3_ESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(288) %0, ptr noundef nonnull align 8 dereferenceable(48) %1) #2 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.38", align 8
  %7 = alloca %"struct.btree::btree_iterator", align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %10 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %11 = alloca %"struct.btree::btree_iterator", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %12 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #4
  %13 = getelementptr inbounds %"class.ardb::ChannelService", ptr %12, i32 0, i32 2
  call void @_ZN5btree15btree_containerINS_5btreeINS_16btree_map_paramsIjPN4ardb7ChannelESt4lessIjESaISt4pairIKjS5_EELi256EEEEEE5beginEv(ptr dead_on_unwind writable sret(%"struct.btree::btree_iterator") align 8 %5, ptr noundef nonnull align 8 dereferenceable(8) %13)
  br label %14

14:                                               ; preds = %41, %2
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #4
  %15 = getelementptr inbounds %"class.ardb::ChannelService", ptr %12, i32 0, i32 2
  call void @_ZN5btree15btree_containerINS_5btreeINS_16btree_map_paramsIjPN4ardb7ChannelESt4lessIjESaISt4pairIKjS5_EELi256EEEEEE3endEv(ptr dead_on_unwind writable sret(%"struct.btree::btree_iterator") align 8 %7, ptr noundef nonnull align 8 dereferenceable(8) %15)
  call void @_ZN5btree14btree_iteratorIKNS_10btree_nodeINS_16btree_map_paramsIjPN4ardb7ChannelESt4lessIjESaISt4pairIKjS5_EELi256EEEEERKSA_PSF_EC2ERKNS0_ISD_RSA_PSA_EE(ptr noundef nonnull align 8 dereferenceable(12) %6, ptr noundef nonnull align 8 dereferenceable(12) %7)
  %16 = call noundef zeroext i1 @_ZNK5btree14btree_iteratorINS_10btree_nodeINS_16btree_map_paramsIjPN4ardb7ChannelESt4lessIjESaISt4pairIKjS5_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) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #4
  br i1 %16, label %17, label %42

17:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %18 = call noundef ptr @_ZNK5btree14btree_iteratorINS_10btree_nodeINS_16btree_map_paramsIjPN4ardb7ChannelESt4lessIjESaISt4pairIKjS5_EELi256EEEEERSA_PSA_EptEv(ptr noundef nonnull align 8 dereferenceable(12) %5)
  %19 = getelementptr inbounds %"struct.std::pair", ptr %18, i32 0, i32 1
  %20 = load ptr, ptr %19, align 8, !tbaa !9
  store ptr %20, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = call ptr @_ZNSt3setIPN4ardb7ChannelESt4lessIS2_ESaIS2_EE4findERKS2_(ptr noundef nonnull align 8 dereferenceable(48) %21, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %23 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %9, i32 0, i32 0
  store ptr %22, ptr %23, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = call ptr @_ZNKSt3setIPN4ardb7ChannelESt4lessIS2_ESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %24) #4
  %26 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %10, i32 0, i32 0
  store ptr %25, ptr %26, align 8
  %27 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorIPN4ardb7ChannelEES5_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br i1 %27, label %28, label %41

28:                                               ; preds = %17
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = load ptr, ptr %29, align 8, !tbaa !12
  %31 = getelementptr inbounds ptr, ptr %30, i64 16
  %32 = load ptr, ptr %31, align 8
  %33 = call noundef i32 %32(ptr noundef nonnull align 8 dereferenceable(256) %29)
  %34 = call i32 @close(i32 noundef %33)
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  %36 = load ptr, ptr %35, align 8, !tbaa !12
  %37 = getelementptr inbounds ptr, ptr %36, i64 15
  %38 = load ptr, ptr %37, align 8
  %39 = call noundef i32 %38(ptr noundef nonnull align 8 dereferenceable(256) %35)
  %40 = call i32 @close(i32 noundef %39)
  br label %41

41:                                               ; preds = %28, %17
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #4
  call void @_ZN5btree14btree_iteratorINS_10btree_nodeINS_16btree_map_paramsIjPN4ardb7ChannelESt4lessIjESaISt4pairIKjS5_EELi256EEEEERSA_PSA_EppEi(ptr dead_on_unwind writable sret(%"struct.btree::btree_iterator") align 8 %11, ptr noundef nonnull align 8 dereferenceable(12) %5, i32 noundef 0)
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %14, !llvm.loop !14

42:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #4
  ret void
}

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

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

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

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

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

declare i32 @close(i32 noundef) #3

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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, !6, i64 8}
!10 = !{!"_ZTSSt4pairIKjPN4ardb7ChannelEE", !11, i64 0, !6, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"vtable pointer", !8, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

; 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 nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK5btree14btree_iteratorINS_10btree_nodeINS_16btree_map_paramsIjPN4ardb7ChannelESt4lessIjESaISt4pairIKjS5_EELi256EEEEERSA_PSA_EneERKNS0_IKSD_RKSA_PSI_EE(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4ardb14ChannelService17CloseAllChannelFDERSt3setIPNS_7ChannelESt4lessIS3_ESaIS3_EE(ptr noundef nonnull align 8 dereferenceable(288) %0, ptr noundef nonnull align 8 dereferenceable(48) %1) local_unnamed_addr #2 align 2 {
  %3 = alloca %"struct.btree::btree_iterator", align 8
  %4 = alloca %"struct.btree::btree_iterator.38", align 8
  %5 = alloca %"struct.btree::btree_iterator", align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %8 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %9 = alloca %"struct.btree::btree_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #4
  %10 = getelementptr inbounds i8, ptr %0, i64 16
  call void @_ZN5btree15btree_containerINS_5btreeINS_16btree_map_paramsIjPN4ardb7ChannelESt4lessIjESaISt4pairIKjS5_EELi256EEEEEE5beginEv(ptr dead_on_unwind nonnull writable sret(%"struct.btree::btree_iterator") align 8 %3, ptr noundef nonnull align 8 dereferenceable(8) %10)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #4
  call void @_ZN5btree15btree_containerINS_5btreeINS_16btree_map_paramsIjPN4ardb7ChannelESt4lessIjESaISt4pairIKjS5_EELi256EEEEEE3endEv(ptr dead_on_unwind nonnull writable sret(%"struct.btree::btree_iterator") align 8 %5, ptr noundef nonnull align 8 dereferenceable(8) %10)
  call void @_ZN5btree14btree_iteratorIKNS_10btree_nodeINS_16btree_map_paramsIjPN4ardb7ChannelESt4lessIjESaISt4pairIKjS5_EELi256EEEEERKSA_PSF_EC2ERKNS0_ISD_RSA_PSA_EE(ptr noundef nonnull align 8 dereferenceable(12) %4, ptr noundef nonnull align 8 dereferenceable(12) %5)
  %11 = call noundef zeroext i1 @_ZNK5btree14btree_iteratorINS_10btree_nodeINS_16btree_map_paramsIjPN4ardb7ChannelESt4lessIjESaISt4pairIKjS5_EELi256EEEEERSA_PSA_EneERKNS0_IKSD_RKSA_PSI_EE(ptr noundef nonnull align 8 dereferenceable(12) %3, ptr noundef nonnull align 8 dereferenceable(12) %4)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  br i1 %11, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2, %31
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %12 = call noundef ptr @_ZNK5btree14btree_iteratorINS_10btree_nodeINS_16btree_map_paramsIjPN4ardb7ChannelESt4lessIjESaISt4pairIKjS5_EELi256EEEEERSA_PSA_EptEv(ptr noundef nonnull align 8 dereferenceable(12) %3)
  %13 = getelementptr inbounds i8, ptr %12, i64 8
  %14 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %14, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  %15 = call ptr @_ZNSt3setIPN4ardb7ChannelESt4lessIS2_ESaIS2_EE4findERKS2_(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 8 dereferenceable(8) %6)
  store ptr %15, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  %16 = call ptr @_ZNKSt3setIPN4ardb7ChannelESt4lessIS2_ESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #4
  store ptr %16, ptr %8, align 8
  %17 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorIPN4ardb7ChannelEES5_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  br i1 %17, label %18, label %31

18:                                               ; preds = %.lr.ph
  %19 = load ptr, ptr %6, align 8, !tbaa !11
  %20 = load ptr, ptr %19, align 8, !tbaa !12
  %21 = getelementptr inbounds i8, ptr %20, i64 128
  %22 = load ptr, ptr %21, align 8
  %23 = call noundef i32 %22(ptr noundef nonnull align 8 dereferenceable(256) %19)
  %24 = call i32 @close(i32 noundef %23)
  %25 = load ptr, ptr %6, align 8, !tbaa !11
  %26 = load ptr, ptr %25, align 8, !tbaa !12
  %27 = getelementptr inbounds i8, ptr %26, i64 120
  %28 = load ptr, ptr %27, align 8
  %29 = call noundef i32 %28(ptr noundef nonnull align 8 dereferenceable(256) %25)
  %30 = call i32 @close(i32 noundef %29)
  br label %31

31:                                               ; preds = %18, %.lr.ph
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #4
  call void @_ZN5btree14btree_iteratorINS_10btree_nodeINS_16btree_map_paramsIjPN4ardb7ChannelESt4lessIjESaISt4pairIKjS5_EELi256EEEEERSA_PSA_EppEi(ptr dead_on_unwind nonnull writable sret(%"struct.btree::btree_iterator") align 8 %9, ptr noundef nonnull align 8 dereferenceable(12) %3, i32 noundef 0)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #4
  call void @_ZN5btree15btree_containerINS_5btreeINS_16btree_map_paramsIjPN4ardb7ChannelESt4lessIjESaISt4pairIKjS5_EELi256EEEEEE3endEv(ptr dead_on_unwind nonnull writable sret(%"struct.btree::btree_iterator") align 8 %5, ptr noundef nonnull align 8 dereferenceable(8) %10)
  call void @_ZN5btree14btree_iteratorIKNS_10btree_nodeINS_16btree_map_paramsIjPN4ardb7ChannelESt4lessIjESaISt4pairIKjS5_EELi256EEEEERKSA_PSF_EC2ERKNS0_ISD_RSA_PSA_EE(ptr noundef nonnull align 8 dereferenceable(12) %4, ptr noundef nonnull align 8 dereferenceable(12) %5)
  %32 = call noundef zeroext i1 @_ZNK5btree14btree_iteratorINS_10btree_nodeINS_16btree_map_paramsIjPN4ardb7ChannelESt4lessIjESaISt4pairIKjS5_EELi256EEEEERSA_PSA_EneERKNS0_IKSD_RKSA_PSI_EE(ptr noundef nonnull align 8 dereferenceable(12) %3, ptr noundef nonnull align 8 dereferenceable(12) %4)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  br i1 %32, label %.lr.ph, label %._crit_edge, !llvm.loop !14

._crit_edge:                                      ; preds = %31, %2
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #4
  ret void
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorIPN4ardb7ChannelEES5_(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 ptr @_ZNSt3setIPN4ardb7ChannelESt4lessIS2_ESaIS2_EE4findERKS2_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

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

declare i32 @close(i32 noundef) local_unnamed_addr #3

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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, !10, i64 8}
!6 = !{!"_ZTSSt4pairIKjPN4ardb7ChannelEE", !7, i64 0, !10, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!10, !10, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"vtable pointer", !9, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


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