; 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"

%"class.ardb::Channel" = type { %"class.ardb::Runnable", %"struct.ardb::ChannelOptions", i8, i8, i32, %"class.ardb::ChannelPipeline", ptr, i32, i32, %"class.ardb::Buffer", %"class.ardb::Buffer", i32, ptr, ptr, ptr, ptr, i8, i8, i8, ptr, ptr, ptr }
%"class.ardb::Runnable" = type { ptr }
%"struct.ardb::ChannelOptions" = type <{ i32, i32, i8, [3 x i8], i32, i8, [3 x i8], i32, i32, i32, i8, i8, [2 x i8] }>
%"class.ardb::ChannelPipeline" = type { ptr, ptr, ptr, %"class.btree::btree_map.14" }
%"class.btree::btree_map.14" = type { %"class.btree::btree_map_container.15" }
%"class.btree::btree_map_container.15" = type { %"class.btree::btree_unique_container.16" }
%"class.btree::btree_unique_container.16" = type { %"class.btree::btree_container.17" }
%"class.btree::btree_container.17" = type { %"class.btree::btree.18" }
%"class.btree::btree.18" = type { %"struct.btree::btree<btree::btree_map_params<std::__cxx11::basic_string<char>, ardb::ChannelHandlerContext *, std::less<std::__cxx11::basic_string<char>>, std::allocator<std::pair<const std::__cxx11::basic_string<char>, ardb::ChannelHandlerContext *>>, 256>>::empty_base_handle" }
%"struct.btree::btree<btree::btree_map_params<std::__cxx11::basic_string<char>, ardb::ChannelHandlerContext *, std::less<std::__cxx11::basic_string<char>>, std::allocator<std::pair<const std::__cxx11::basic_string<char>, ardb::ChannelHandlerContext *>>, 256>>::empty_base_handle" = type { ptr }
%"class.ardb::Buffer" = type <{ ptr, i64, i64, i64, i8, [7 x i8] }>
%"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 }
%"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 }

@.str = external hidden unnamed_addr constant [86 x i8], align 1
@__FUNCTION__._ZN4ardb14ChannelService13AttachChannelEPNS_7ChannelEb = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [75 x i8], align 1

; 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 noundef i64 @_ZNK5btree22btree_unique_containerINS_5btreeINS_16btree_map_paramsIjPN4ardb7ChannelESt4lessIjESaISt4pairIKjS5_EELi256EEEEEE5countERS9_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4ardb7Channel5GetIDEv(ptr noundef nonnull align 8 dereferenceable(256)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN4ardb14ChannelService13AttachChannelEPNS_7ChannelEb(ptr noundef nonnull align 8 dereferenceable(288) %0, ptr noundef %1, i1 noundef zeroext %2) #1 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i8, align 1
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  %11 = zext i1 %2 to i8
  store i8 %11, ptr %7, align 1, !tbaa !9
  %12 = load ptr, ptr %5, align 8
  br label %13

13:                                               ; preds = %3
  %14 = load ptr, ptr %6, align 8, !tbaa !5
  %15 = icmp eq ptr null, %14
  br i1 %15, label %16, label %17

16:                                               ; preds = %13
  store ptr null, ptr %4, align 8
  br label %88

17:                                               ; preds = %13
  br label %18

18:                                               ; preds = %17
  %19 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %20 = trunc i8 %19 to i1
  br i1 %20, label %21, label %35

21:                                               ; preds = %18
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = getelementptr inbounds %"class.ardb::Channel", ptr %22, i32 0, i32 6
  store ptr %12, ptr %23, align 8, !tbaa !13
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = load ptr, ptr %24, align 8, !tbaa !27
  %26 = getelementptr inbounds ptr, ptr %25, i64 18
  %27 = load ptr, ptr %26, align 8
  %28 = call noundef zeroext i1 %27(ptr noundef nonnull align 8 dereferenceable(256) %24)
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = getelementptr inbounds %"class.ardb::ChannelService", ptr %12, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = call noundef i32 @_ZN4ardb7Channel5GetIDEv(ptr noundef nonnull align 8 dereferenceable(256) %31)
  store i32 %32, ptr %8, align 4, !tbaa !29
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN5btree19btree_map_containerINS_5btreeINS_16btree_map_paramsIjPN4ardb7ChannelESt4lessIjESaISt4pairIKjS5_EELi256EEEEEEixERS9_(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull align 4 dereferenceable(4) %8)
  store ptr %29, ptr %33, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %34, ptr %4, align 8
  br label %88

35:                                               ; preds = %18
  %36 = getelementptr inbounds %"class.ardb::ChannelService", ptr %12, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = call noundef i32 @_ZN4ardb7Channel5GetIDEv(ptr noundef nonnull align 8 dereferenceable(256) %37)
  store i32 %38, ptr %9, align 4, !tbaa !29
  %39 = call noundef i64 @_ZNK5btree22btree_unique_containerINS_5btreeINS_16btree_map_paramsIjPN4ardb7ChannelESt4lessIjESaISt4pairIKjS5_EELi256EEEEEE5countERS9_(ptr noundef nonnull align 8 dereferenceable(8) %36, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %40 = icmp sgt i64 %39, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br i1 %40, label %41, label %42

41:                                               ; preds = %35
  store ptr null, ptr %4, align 8
  br label %88

42:                                               ; preds = %35
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = load ptr, ptr %43, align 8, !tbaa !27
  %45 = getelementptr inbounds ptr, ptr %44, i64 19
  %46 = load ptr, ptr %45, align 8
  call void %46(ptr noundef nonnull align 8 dereferenceable(256) %43)
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = load ptr, ptr %47, align 8, !tbaa !27
  %49 = getelementptr inbounds ptr, ptr %48, i64 16
  %50 = load ptr, ptr %49, align 8
  %51 = call noundef i32 %50(ptr noundef nonnull align 8 dereferenceable(256) %47)
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = load ptr, ptr %52, align 8, !tbaa !27
  %54 = getelementptr inbounds ptr, ptr %53, i64 15
  %55 = load ptr, ptr %54, align 8
  %56 = call noundef i32 %55(ptr noundef nonnull align 8 dereferenceable(256) %52)
  %57 = icmp ne i32 %51, %56
  br i1 %57, label %58, label %66

58:                                               ; preds = %42
  br label %59

59:                                               ; preds = %58
  %60 = call noundef ptr @_ZN4ardb10ArdbLogger13GetLogCheckerEv()
  %61 = call noundef zeroext i1 %60(i32 noundef 2)
  br i1 %61, label %62, label %64

62:                                               ; preds = %59
  %63 = call noundef ptr @_ZN4ardb10ArdbLogger13GetLogHandlerEv()
  call void (i32, ptr, ptr, i32, ptr, ...) %63(i32 noundef 2, ptr noundef @.str, ptr noundef @__FUNCTION__._ZN4ardb14ChannelService13AttachChannelEPNS_7ChannelEb, i32 noundef 248, ptr noundef @.str.1)
  br label %64

64:                                               ; preds = %62, %59
  br label %65

65:                                               ; preds = %64
  store ptr null, ptr %4, align 8
  br label %88

66:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %67 = load ptr, ptr %6, align 8, !tbaa !5
  %68 = call noundef ptr @_ZN4ardb14ChannelService12CloneChannelEPNS_7ChannelE(ptr noundef nonnull align 8 dereferenceable(288) %12, ptr noundef %67)
  store ptr %68, ptr %10, align 8, !tbaa !5
  %69 = load ptr, ptr %10, align 8, !tbaa !5
  %70 = icmp ne ptr null, %69
  br i1 %70, label %71, label %86

71:                                               ; preds = %66
  %72 = load ptr, ptr %10, align 8, !tbaa !5
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = load ptr, ptr %73, align 8, !tbaa !27
  %75 = getelementptr inbounds ptr, ptr %74, i64 16
  %76 = load ptr, ptr %75, align 8
  %77 = call noundef i32 %76(ptr noundef nonnull align 8 dereferenceable(256) %73)
  %78 = load ptr, ptr %72, align 8, !tbaa !27
  %79 = getelementptr inbounds ptr, ptr %78, i64 17
  %80 = load ptr, ptr %79, align 8
  %81 = call noundef zeroext i1 %80(ptr noundef nonnull align 8 dereferenceable(256) %72, i32 noundef %77)
  %82 = load ptr, ptr %10, align 8, !tbaa !5
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = getelementptr inbounds %"class.ardb::Channel", ptr %83, i32 0, i32 1
  %85 = call noundef zeroext i1 @_ZN4ardb7Channel9ConfigureERKNS_14ChannelOptionsE(ptr noundef nonnull align 8 dereferenceable(256) %82, ptr noundef nonnull align 4 dereferenceable(34) %84)
  br label %86

86:                                               ; preds = %71, %66
  %87 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %87, ptr %4, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  br label %88

88:                                               ; preds = %86, %65, %41, %21, %16
  %89 = load ptr, ptr %4, align 8
  ret ptr %89
}

declare noundef ptr @_ZN4ardb10ArdbLogger13GetLogCheckerEv() #3

declare noundef ptr @_ZN4ardb10ArdbLogger13GetLogHandlerEv() #3

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

declare noundef zeroext i1 @_ZN4ardb7Channel9ConfigureERKNS_14ChannelOptionsE(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef nonnull align 4 dereferenceable(34)) #3

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 = { inlinehint 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 = { 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 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !6, i64 88}
!14 = !{!"_ZTSN4ardb7ChannelE", !15, i64 0, !16, i64 8, !10, i64 44, !10, i64 45, !17, i64 48, !18, i64 56, !6, i64 88, !17, i64 96, !17, i64 100, !25, i64 104, !25, i64 144, !17, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !10, i64 224, !10, i64 225, !10, i64 226, !6, i64 232, !6, i64 240, !6, i64 248}
!15 = !{!"_ZTSN4ardb8RunnableE"}
!16 = !{!"_ZTSN4ardb14ChannelOptionsE", !17, i64 0, !17, i64 4, !10, i64 8, !17, i64 12, !10, i64 16, !17, i64 20, !17, i64 24, !17, i64 28, !10, i64 32, !10, i64 33}
!17 = !{!"int", !7, i64 0}
!18 = !{!"_ZTSN4ardb15ChannelPipelineE", !6, i64 0, !6, i64 8, !6, i64 16, !19, i64 24}
!19 = !{!"_ZTSN5btree9btree_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS6_ESaISt4pairIKS6_S9_EELi256EEE", !20, i64 0}
!20 = !{!"_ZTSN5btree19btree_map_containerINS_5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS8_ESaISt4pairIKS8_SB_EELi256EEEEEEE", !21, i64 0}
!21 = !{!"_ZTSN5btree22btree_unique_containerINS_5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS8_ESaISt4pairIKS8_SB_EELi256EEEEEEE", !22, i64 0}
!22 = !{!"_ZTSN5btree15btree_containerINS_5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS8_ESaISt4pairIKS8_SB_EELi256EEEEEEE", !23, i64 0}
!23 = !{!"_ZTSN5btree5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS7_ESaISt4pairIKS7_SA_EELi256EEEEE", !24, i64 0}
!24 = !{!"_ZTSN5btree5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS7_ESaISt4pairIKS7_SA_EELi256EEEE17empty_base_handleIS6_PNS_10btree_nodeISH_EEEE", !6, i64 0}
!25 = !{!"_ZTSN4ardb6BufferE", !6, i64 0, !26, i64 8, !26, i64 16, !26, i64 24, !10, i64 32}
!26 = !{!"long", !7, i64 0}
!27 = !{!28, !28, i64 0}
!28 = !{!"vtable pointer", !8, i64 0}
!29 = !{!17, !17, 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"

@.str = external hidden unnamed_addr constant [86 x i8], align 1
@__FUNCTION__._ZN4ardb14ChannelService13AttachChannelEPNS_7ChannelEb = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [75 x i8], align 1

; 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 noundef i64 @_ZNK5btree22btree_unique_containerINS_5btreeINS_16btree_map_paramsIjPN4ardb7ChannelESt4lessIjESaISt4pairIKjS5_EELi256EEEEEE5countERS9_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4ardb7Channel5GetIDEv(ptr noundef nonnull align 8 dereferenceable(256)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN4ardb14ChannelService13AttachChannelEPNS_7ChannelEb(ptr noundef nonnull align 8 dereferenceable(288) %0, ptr noundef %1, i1 noundef zeroext %2) local_unnamed_addr #1 align 2 {
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = icmp eq ptr %1, null
  br i1 %6, label %52, label %7

7:                                                ; preds = %3
  br i1 %2, label %8, label %17

8:                                                ; preds = %7
  %9 = getelementptr inbounds i8, ptr %1, i64 88
  store ptr %0, ptr %9, align 8, !tbaa !5
  %10 = load ptr, ptr %1, align 8, !tbaa !23
  %11 = getelementptr inbounds i8, ptr %10, i64 144
  %12 = load ptr, ptr %11, align 8
  %13 = tail call noundef zeroext i1 %12(ptr noundef nonnull align 8 dereferenceable(256) %1)
  %14 = getelementptr inbounds i8, ptr %0, i64 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  %15 = tail call noundef i32 @_ZN4ardb7Channel5GetIDEv(ptr noundef nonnull align 8 dereferenceable(256) %1)
  store i32 %15, ptr %4, align 4, !tbaa !25
  %16 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN5btree19btree_map_containerINS_5btreeINS_16btree_map_paramsIjPN4ardb7ChannelESt4lessIjESaISt4pairIKjS5_EELi256EEEEEEixERS9_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 4 dereferenceable(4) %4)
  store ptr %1, ptr %16, align 8, !tbaa !26
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  br label %52

17:                                               ; preds = %7
  %18 = getelementptr inbounds i8, ptr %0, i64 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  %19 = tail call noundef i32 @_ZN4ardb7Channel5GetIDEv(ptr noundef nonnull align 8 dereferenceable(256) %1)
  store i32 %19, ptr %5, align 4, !tbaa !25
  %20 = call noundef i64 @_ZNK5btree22btree_unique_containerINS_5btreeINS_16btree_map_paramsIjPN4ardb7ChannelESt4lessIjESaISt4pairIKjS5_EELi256EEEEEE5countERS9_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %21 = icmp sgt i64 %20, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  br i1 %21, label %52, label %22

22:                                               ; preds = %17
  %23 = load ptr, ptr %1, align 8, !tbaa !23
  %24 = getelementptr inbounds i8, ptr %23, i64 152
  %25 = load ptr, ptr %24, align 8
  call void %25(ptr noundef nonnull align 8 dereferenceable(256) %1)
  %26 = load ptr, ptr %1, align 8, !tbaa !23
  %27 = getelementptr inbounds i8, ptr %26, i64 128
  %28 = load ptr, ptr %27, align 8
  %29 = call noundef i32 %28(ptr noundef nonnull align 8 dereferenceable(256) %1)
  %30 = load ptr, ptr %1, align 8, !tbaa !23
  %31 = getelementptr inbounds i8, ptr %30, i64 120
  %32 = load ptr, ptr %31, align 8
  %33 = call noundef i32 %32(ptr noundef nonnull align 8 dereferenceable(256) %1)
  %.not = icmp eq i32 %29, %33
  br i1 %.not, label %39, label %34

34:                                               ; preds = %22
  %35 = call noundef ptr @_ZN4ardb10ArdbLogger13GetLogCheckerEv()
  %36 = call noundef zeroext i1 %35(i32 noundef 2)
  br i1 %36, label %37, label %52

37:                                               ; preds = %34
  %38 = call noundef ptr @_ZN4ardb10ArdbLogger13GetLogHandlerEv()
  call void (i32, ptr, ptr, i32, ptr, ...) %38(i32 noundef 2, ptr noundef nonnull @.str, ptr noundef nonnull @__FUNCTION__._ZN4ardb14ChannelService13AttachChannelEPNS_7ChannelEb, i32 noundef 248, ptr noundef nonnull @.str.1)
  br label %52

39:                                               ; preds = %22
  %40 = call noundef ptr @_ZN4ardb14ChannelService12CloneChannelEPNS_7ChannelE(ptr noundef nonnull align 8 dereferenceable(288) %0, ptr noundef nonnull %1)
  %.not21 = icmp eq ptr %40, null
  br i1 %.not21, label %52, label %41

41:                                               ; preds = %39
  %42 = load ptr, ptr %1, align 8, !tbaa !23
  %43 = getelementptr inbounds i8, ptr %42, i64 128
  %44 = load ptr, ptr %43, align 8
  %45 = call noundef i32 %44(ptr noundef nonnull align 8 dereferenceable(256) %1)
  %46 = load ptr, ptr %40, align 8, !tbaa !23
  %47 = getelementptr inbounds i8, ptr %46, i64 136
  %48 = load ptr, ptr %47, align 8
  %49 = call noundef zeroext i1 %48(ptr noundef nonnull align 8 dereferenceable(256) %40, i32 noundef %45)
  %50 = getelementptr inbounds i8, ptr %1, i64 8
  %51 = call noundef zeroext i1 @_ZN4ardb7Channel9ConfigureERKNS_14ChannelOptionsE(ptr noundef nonnull align 8 dereferenceable(256) %40, ptr noundef nonnull align 4 dereferenceable(34) %50)
  br label %52

52:                                               ; preds = %39, %41, %37, %34, %17, %3, %8
  %.0 = phi ptr [ %1, %8 ], [ null, %3 ], [ null, %17 ], [ null, %34 ], [ null, %37 ], [ %40, %41 ], [ null, %39 ]
  ret ptr %.0
}

declare noundef ptr @_ZN4ardb10ArdbLogger13GetLogCheckerEv() local_unnamed_addr #3

declare noundef ptr @_ZN4ardb10ArdbLogger13GetLogHandlerEv() local_unnamed_addr #3

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

declare noundef zeroext i1 @_ZN4ardb7Channel9ConfigureERKNS_14ChannelOptionsE(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef nonnull align 4 dereferenceable(34)) local_unnamed_addr #3

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 = { inlinehint 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 = { 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, !14, i64 88}
!6 = !{!"_ZTSN4ardb7ChannelE", !7, i64 0, !8, i64 8, !12, i64 44, !12, i64 45, !9, i64 48, !13, i64 56, !14, i64 88, !9, i64 96, !9, i64 100, !21, i64 104, !21, i64 144, !9, i64 184, !14, i64 192, !14, i64 200, !14, i64 208, !14, i64 216, !12, i64 224, !12, i64 225, !12, i64 226, !14, i64 232, !14, i64 240, !14, i64 248}
!7 = !{!"_ZTSN4ardb8RunnableE"}
!8 = !{!"_ZTSN4ardb14ChannelOptionsE", !9, i64 0, !9, i64 4, !12, i64 8, !9, i64 12, !12, i64 16, !9, i64 20, !9, i64 24, !9, i64 28, !12, i64 32, !12, i64 33}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"bool", !10, i64 0}
!13 = !{!"_ZTSN4ardb15ChannelPipelineE", !14, i64 0, !14, i64 8, !14, i64 16, !15, i64 24}
!14 = !{!"any pointer", !10, i64 0}
!15 = !{!"_ZTSN5btree9btree_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS6_ESaISt4pairIKS6_S9_EELi256EEE", !16, i64 0}
!16 = !{!"_ZTSN5btree19btree_map_containerINS_5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS8_ESaISt4pairIKS8_SB_EELi256EEEEEEE", !17, i64 0}
!17 = !{!"_ZTSN5btree22btree_unique_containerINS_5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS8_ESaISt4pairIKS8_SB_EELi256EEEEEEE", !18, i64 0}
!18 = !{!"_ZTSN5btree15btree_containerINS_5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS8_ESaISt4pairIKS8_SB_EELi256EEEEEEE", !19, i64 0}
!19 = !{!"_ZTSN5btree5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS7_ESaISt4pairIKS7_SA_EELi256EEEEE", !20, i64 0}
!20 = !{!"_ZTSN5btree5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS7_ESaISt4pairIKS7_SA_EELi256EEEE17empty_base_handleIS6_PNS_10btree_nodeISH_EEEE", !14, i64 0}
!21 = !{!"_ZTSN4ardb6BufferE", !14, i64 0, !22, i64 8, !22, i64 16, !22, i64 24, !12, i64 32}
!22 = !{!"long", !10, i64 0}
!23 = !{!24, !24, i64 0}
!24 = !{!"vtable pointer", !11, i64 0}
!25 = !{!9, !9, i64 0}
!26 = !{!14, !14, i64 0}


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