; LLVM IR from yinqiwen/ardb :: src/common/channel/channel.ll (ZN4ardb7ChannelC2EPS0_RNS_14ChannelServiceE)

; 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::SpinMutexLock" = type { i32 }
%"class.ardb::LockGuard" = type <{ ptr, i8, [7 x i8] }>
%"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" }
%"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<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] }>

@_ZL18g_channel_id_mutex = external hidden global %"class.ardb::SpinMutexLock", align 4
@_ZTVN4ardb7ChannelE = external dso_local unnamed_addr constant { [24 x ptr] }, align 8
@_ZL14kChannelIDSeed = external hidden global i32, align 4

; 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 void @_ZN4ardb7ChannelC2EPS0_RNS_14ChannelServiceE(ptr noundef nonnull align 8 dereferenceable(256) %0, ptr noundef %1, ptr noundef nonnull align 8 dereferenceable(288) %2) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %"class.ardb::LockGuard", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %10 = load ptr, ptr %4, align 8
  call void @_ZN4ardb8RunnableC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  store ptr getelementptr inbounds inrange(-16, 176) ({ [24 x ptr] }, ptr @_ZTVN4ardb7ChannelE, i32 0, i32 0, i32 2), ptr %10, align 8, !tbaa !9
  %11 = getelementptr inbounds %"class.ardb::Channel", ptr %10, i32 0, i32 1
  invoke void @_ZN4ardb14ChannelOptionsC2Ev(ptr noundef nonnull align 4 dereferenceable(34) %11)
          to label %12 unwind label %41

12:                                               ; preds = %3
  %13 = getelementptr inbounds %"class.ardb::Channel", ptr %10, i32 0, i32 2
  store i8 0, ptr %13, align 4, !tbaa !11
  %14 = getelementptr inbounds %"class.ardb::Channel", ptr %10, i32 0, i32 3
  store i8 0, ptr %14, align 1, !tbaa !26
  %15 = getelementptr inbounds %"class.ardb::Channel", ptr %10, i32 0, i32 4
  store i32 0, ptr %15, align 8, !tbaa !27
  %16 = getelementptr inbounds %"class.ardb::Channel", ptr %10, i32 0, i32 5
  invoke void @_ZN4ardb15ChannelPipelineC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %16)
          to label %17 unwind label %41

17:                                               ; preds = %12
  %18 = getelementptr inbounds %"class.ardb::Channel", ptr %10, i32 0, i32 6
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %19, ptr %18, align 8, !tbaa !28
  %20 = getelementptr inbounds %"class.ardb::Channel", ptr %10, i32 0, i32 7
  store i32 0, ptr %20, align 8, !tbaa !29
  %21 = getelementptr inbounds %"class.ardb::Channel", ptr %10, i32 0, i32 8
  store i32 -1, ptr %21, align 4, !tbaa !30
  %22 = getelementptr inbounds %"class.ardb::Channel", ptr %10, i32 0, i32 9
  invoke void @_ZN4ardb6BufferC2Ev(ptr noundef nonnull align 8 dereferenceable(33) %22)
          to label %23 unwind label %45

23:                                               ; preds = %17
  %24 = getelementptr inbounds %"class.ardb::Channel", ptr %10, i32 0, i32 10
  invoke void @_ZN4ardb6BufferC2Ev(ptr noundef nonnull align 8 dereferenceable(33) %24)
          to label %25 unwind label %49

25:                                               ; preds = %23
  %26 = getelementptr inbounds %"class.ardb::Channel", ptr %10, i32 0, i32 11
  store i32 -1, ptr %26, align 8, !tbaa !31
  %27 = getelementptr inbounds %"class.ardb::Channel", ptr %10, i32 0, i32 12
  store ptr null, ptr %27, align 8, !tbaa !32
  %28 = getelementptr inbounds %"class.ardb::Channel", ptr %10, i32 0, i32 13
  store ptr null, ptr %28, align 8, !tbaa !33
  %29 = getelementptr inbounds %"class.ardb::Channel", ptr %10, i32 0, i32 14
  store ptr null, ptr %29, align 8, !tbaa !34
  %30 = getelementptr inbounds %"class.ardb::Channel", ptr %10, i32 0, i32 15
  store ptr null, ptr %30, align 8, !tbaa !35
  %31 = getelementptr inbounds %"class.ardb::Channel", ptr %10, i32 0, i32 16
  store i8 0, ptr %31, align 8, !tbaa !36
  %32 = getelementptr inbounds %"class.ardb::Channel", ptr %10, i32 0, i32 17
  store i8 0, ptr %32, align 1, !tbaa !37
  %33 = getelementptr inbounds %"class.ardb::Channel", ptr %10, i32 0, i32 18
  store i8 0, ptr %33, align 2, !tbaa !38
  %34 = getelementptr inbounds %"class.ardb::Channel", ptr %10, i32 0, i32 19
  store ptr null, ptr %34, align 8, !tbaa !39
  %35 = getelementptr inbounds %"class.ardb::Channel", ptr %10, i32 0, i32 20
  store ptr null, ptr %35, align 8, !tbaa !40
  %36 = getelementptr inbounds %"class.ardb::Channel", ptr %10, i32 0, i32 21
  store ptr null, ptr %36, align 8, !tbaa !41
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #7
  invoke void @_ZN4ardb9LockGuardINS_13SpinMutexLockEEC2ERS1_b(ptr noundef nonnull align 8 dereferenceable(9) %9, ptr noundef nonnull align 4 dereferenceable(4) @_ZL18g_channel_id_mutex, i1 noundef zeroext true)
          to label %37 unwind label %53

37:                                               ; preds = %25
  %38 = load volatile i32, ptr @_ZL14kChannelIDSeed, align 4, !tbaa !42
  %39 = icmp eq i32 %38, 268435455
  br i1 %39, label %40, label %57

40:                                               ; preds = %37
  store volatile i32 0, ptr @_ZL14kChannelIDSeed, align 4, !tbaa !42
  br label %57

41:                                               ; preds = %12, %3
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %7, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %8, align 4
  br label %77

45:                                               ; preds = %17
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %7, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %8, align 4
  br label %76

49:                                               ; preds = %23
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %7, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %8, align 4
  br label %75

53:                                               ; preds = %25
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %7, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #7
  br label %74

57:                                               ; preds = %40, %37
  %58 = load volatile i32, ptr @_ZL14kChannelIDSeed, align 4, !tbaa !42
  %59 = add i32 %58, 1
  store volatile i32 %59, ptr @_ZL14kChannelIDSeed, align 4, !tbaa !42
  %60 = load volatile i32, ptr @_ZL14kChannelIDSeed, align 4, !tbaa !42
  %61 = getelementptr inbounds %"class.ardb::Channel", ptr %10, i32 0, i32 7
  store i32 %60, ptr %61, align 8, !tbaa !29
  call void @_ZN4ardb9LockGuardINS_13SpinMutexLockEED2Ev(ptr noundef nonnull align 8 dereferenceable(9) %9) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #7
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = icmp ne ptr null, %62
  br i1 %63, label %64, label %73

64:                                               ; preds = %57
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = invoke noundef i32 @_ZN4ardb7Channel5GetIDEv(ptr noundef nonnull align 8 dereferenceable(256) %65)
          to label %67 unwind label %69

67:                                               ; preds = %64
  %68 = getelementptr inbounds %"class.ardb::Channel", ptr %10, i32 0, i32 4
  store i32 %66, ptr %68, align 8, !tbaa !27
  br label %73

69:                                               ; preds = %64
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %7, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %8, align 4
  br label %74

73:                                               ; preds = %67, %57
  ret void

74:                                               ; preds = %69, %53
  call void @_ZN4ardb6BufferD2Ev(ptr noundef nonnull align 8 dereferenceable(33) %24) #7
  br label %75

75:                                               ; preds = %74, %49
  call void @_ZN4ardb6BufferD2Ev(ptr noundef nonnull align 8 dereferenceable(33) %22) #7
  br label %76

76:                                               ; preds = %75, %45
  call void @_ZN4ardb15ChannelPipelineD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #7
  br label %77

77:                                               ; preds = %76, %41
  call void @_ZN4ardb8RunnableD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  br label %78

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4ardb14ChannelOptionsC2Ev(ptr noundef nonnull align 4 dereferenceable(34)) unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

declare void @_ZN4ardb15ChannelPipelineC1Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4ardb6BufferC2Ev(ptr noundef nonnull align 8 dereferenceable(33)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN4ardb9LockGuardINS_13SpinMutexLockEEC2ERS1_b(ptr noundef nonnull align 8 dereferenceable(9), ptr noundef nonnull align 4 dereferenceable(4), i1 noundef zeroext) unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4ardb9LockGuardINS_13SpinMutexLockEED2Ev(ptr noundef nonnull align 8 dereferenceable(9)) unnamed_addr #3 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: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4ardb6BufferD2Ev(ptr noundef nonnull align 8 dereferenceable(33)) unnamed_addr #2 align 2

; Function Attrs: nounwind
declare void @_ZN4ardb15ChannelPipelineD1Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #6

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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 = { 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 #6 = { 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 #7 = { 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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !16, i64 44}
!12 = !{!"_ZTSN4ardb7ChannelE", !13, i64 0, !14, i64 8, !16, i64 44, !16, i64 45, !15, i64 48, !17, i64 56, !6, i64 88, !15, i64 96, !15, i64 100, !24, i64 104, !24, i64 144, !15, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !16, i64 224, !16, i64 225, !16, i64 226, !6, i64 232, !6, i64 240, !6, i64 248}
!13 = !{!"_ZTSN4ardb8RunnableE"}
!14 = !{!"_ZTSN4ardb14ChannelOptionsE", !15, i64 0, !15, i64 4, !16, i64 8, !15, i64 12, !16, i64 16, !15, i64 20, !15, i64 24, !15, i64 28, !16, i64 32, !16, i64 33}
!15 = !{!"int", !7, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"_ZTSN4ardb15ChannelPipelineE", !6, i64 0, !6, i64 8, !6, i64 16, !18, i64 24}
!18 = !{!"_ZTSN5btree9btree_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS6_ESaISt4pairIKS6_S9_EELi256EEE", !19, i64 0}
!19 = !{!"_ZTSN5btree19btree_map_containerINS_5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS8_ESaISt4pairIKS8_SB_EELi256EEEEEEE", !20, i64 0}
!20 = !{!"_ZTSN5btree22btree_unique_containerINS_5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS8_ESaISt4pairIKS8_SB_EELi256EEEEEEE", !21, i64 0}
!21 = !{!"_ZTSN5btree15btree_containerINS_5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS8_ESaISt4pairIKS8_SB_EELi256EEEEEEE", !22, i64 0}
!22 = !{!"_ZTSN5btree5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS7_ESaISt4pairIKS7_SA_EELi256EEEEE", !23, i64 0}
!23 = !{!"_ZTSN5btree5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS7_ESaISt4pairIKS7_SA_EELi256EEEE17empty_base_handleIS6_PNS_10btree_nodeISH_EEEE", !6, i64 0}
!24 = !{!"_ZTSN4ardb6BufferE", !6, i64 0, !25, i64 8, !25, i64 16, !25, i64 24, !16, i64 32}
!25 = !{!"long", !7, i64 0}
!26 = !{!12, !16, i64 45}
!27 = !{!12, !15, i64 48}
!28 = !{!12, !6, i64 88}
!29 = !{!12, !15, i64 96}
!30 = !{!12, !15, i64 100}
!31 = !{!12, !15, i64 184}
!32 = !{!12, !6, i64 192}
!33 = !{!12, !6, i64 200}
!34 = !{!12, !6, i64 208}
!35 = !{!12, !6, i64 216}
!36 = !{!12, !16, i64 224}
!37 = !{!12, !16, i64 225}
!38 = !{!12, !16, i64 226}
!39 = !{!12, !6, i64 232}
!40 = !{!12, !6, i64 240}
!41 = !{!12, !6, i64 248}
!42 = !{!15, !15, 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"

%"class.ardb::SpinMutexLock" = type { i32 }
%"class.ardb::LockGuard" = type <{ ptr, i8, [7 x i8] }>

@_ZL18g_channel_id_mutex = external hidden global %"class.ardb::SpinMutexLock", align 4
@_ZTVN4ardb7ChannelE = external dso_local unnamed_addr constant { [24 x ptr] }, align 8
@_ZL14kChannelIDSeed = external hidden global i32, align 4

; 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 void @_ZN4ardb7ChannelC2EPS0_RNS_14ChannelServiceE(ptr noundef nonnull align 8 dereferenceable(256) %0, ptr noundef %1, ptr noundef nonnull align 8 dereferenceable(288) %2) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.ardb::LockGuard", align 8
  tail call void @_ZN4ardb8RunnableC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #8
  store ptr getelementptr inbounds inrange(-16, 176) (i8, ptr @_ZTVN4ardb7ChannelE, i64 16), ptr %0, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  tail call void @_ZN4ardb14ChannelOptionsC2Ev(ptr noundef nonnull align 4 dereferenceable(34) %5)
  %6 = getelementptr inbounds i8, ptr %0, i64 44
  store i8 0, ptr %6, align 4, !tbaa !8
  %7 = getelementptr inbounds i8, ptr %0, i64 45
  store i8 0, ptr %7, align 1, !tbaa !25
  %8 = getelementptr inbounds i8, ptr %0, i64 48
  store i32 0, ptr %8, align 8, !tbaa !26
  %9 = getelementptr inbounds i8, ptr %0, i64 56
  invoke void @_ZN4ardb15ChannelPipelineC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %10 unwind label %23

10:                                               ; preds = %3
  %11 = getelementptr inbounds i8, ptr %0, i64 88
  store ptr %2, ptr %11, align 8, !tbaa !27
  %12 = getelementptr inbounds i8, ptr %0, i64 96
  store i32 0, ptr %12, align 8, !tbaa !28
  %13 = getelementptr inbounds i8, ptr %0, i64 100
  store i32 -1, ptr %13, align 4, !tbaa !29
  %14 = getelementptr inbounds i8, ptr %0, i64 104
  tail call void @_ZN4ardb6BufferC2Ev(ptr noundef nonnull align 8 dereferenceable(33) %14)
  %15 = getelementptr inbounds i8, ptr %0, i64 144
  tail call void @_ZN4ardb6BufferC2Ev(ptr noundef nonnull align 8 dereferenceable(33) %15)
  %16 = getelementptr inbounds i8, ptr %0, i64 184
  store i32 -1, ptr %16, align 8, !tbaa !30
  %17 = getelementptr inbounds i8, ptr %0, i64 192
  %18 = getelementptr inbounds i8, ptr %0, i64 232
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(35) %17, i8 0, i64 35, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %18, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #8
  invoke void @_ZN4ardb9LockGuardINS_13SpinMutexLockEEC2ERS1_b(ptr noundef nonnull align 8 dereferenceable(9) %4, ptr noundef nonnull align 4 dereferenceable(4) @_ZL18g_channel_id_mutex, i1 noundef zeroext true)
          to label %19 unwind label %25

19:                                               ; preds = %10
  %20 = load volatile i32, ptr @_ZL14kChannelIDSeed, align 4, !tbaa !31
  %21 = icmp eq i32 %20, 268435455
  br i1 %21, label %22, label %27

22:                                               ; preds = %19
  store volatile i32 0, ptr @_ZL14kChannelIDSeed, align 4, !tbaa !31
  br label %27

23:                                               ; preds = %3
  %24 = landingpad { ptr, i32 }
          cleanup
  br label %34

25:                                               ; preds = %10
  %26 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #8
  call void @_ZN4ardb6BufferD2Ev(ptr noundef nonnull align 8 dereferenceable(33) %15) #8
  call void @_ZN4ardb6BufferD2Ev(ptr noundef nonnull align 8 dereferenceable(33) %14) #8
  call void @_ZN4ardb15ChannelPipelineD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #8
  br label %34

27:                                               ; preds = %22, %19
  %28 = load volatile i32, ptr @_ZL14kChannelIDSeed, align 4, !tbaa !31
  %29 = add i32 %28, 1
  store volatile i32 %29, ptr @_ZL14kChannelIDSeed, align 4, !tbaa !31
  %30 = load volatile i32, ptr @_ZL14kChannelIDSeed, align 4, !tbaa !31
  store i32 %30, ptr %12, align 8, !tbaa !28
  call void @_ZN4ardb9LockGuardINS_13SpinMutexLockEED2Ev(ptr noundef nonnull align 8 dereferenceable(9) %4) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #8
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %33, label %31

31:                                               ; preds = %27
  %32 = call noundef i32 @_ZN4ardb7Channel5GetIDEv(ptr noundef nonnull align 8 dereferenceable(256) %1)
  store i32 %32, ptr %8, align 8, !tbaa !26
  br label %33

33:                                               ; preds = %31, %27
  ret void

34:                                               ; preds = %25, %23
  %.pn = phi { ptr, i32 } [ %26, %25 ], [ %24, %23 ]
  call void @_ZN4ardb8RunnableD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #8
  resume { ptr, i32 } %.pn
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4ardb14ChannelOptionsC2Ev(ptr noundef nonnull align 4 dereferenceable(34)) unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

declare void @_ZN4ardb15ChannelPipelineC1Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4ardb6BufferC2Ev(ptr noundef nonnull align 8 dereferenceable(33)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN4ardb9LockGuardINS_13SpinMutexLockEEC2ERS1_b(ptr noundef nonnull align 8 dereferenceable(9), ptr noundef nonnull align 4 dereferenceable(4), i1 noundef zeroext) unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4ardb9LockGuardINS_13SpinMutexLockEED2Ev(ptr noundef nonnull align 8 dereferenceable(9)) unnamed_addr #3 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: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4ardb6BufferD2Ev(ptr noundef nonnull align 8 dereferenceable(33)) unnamed_addr #2 align 2

; Function Attrs: nounwind
declare void @_ZN4ardb15ChannelPipelineD1Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #6

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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 = { 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 #6 = { 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 #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !14, i64 44}
!9 = !{!"_ZTSN4ardb7ChannelE", !10, i64 0, !11, i64 8, !14, i64 44, !14, i64 45, !12, i64 48, !15, i64 56, !16, i64 88, !12, i64 96, !12, i64 100, !23, i64 104, !23, i64 144, !12, i64 184, !16, i64 192, !16, i64 200, !16, i64 208, !16, i64 216, !14, i64 224, !14, i64 225, !14, i64 226, !16, i64 232, !16, i64 240, !16, i64 248}
!10 = !{!"_ZTSN4ardb8RunnableE"}
!11 = !{!"_ZTSN4ardb14ChannelOptionsE", !12, i64 0, !12, i64 4, !14, i64 8, !12, i64 12, !14, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !14, i64 32, !14, i64 33}
!12 = !{!"int", !13, i64 0}
!13 = !{!"omnipotent char", !7, i64 0}
!14 = !{!"bool", !13, i64 0}
!15 = !{!"_ZTSN4ardb15ChannelPipelineE", !16, i64 0, !16, i64 8, !16, i64 16, !17, i64 24}
!16 = !{!"any pointer", !13, i64 0}
!17 = !{!"_ZTSN5btree9btree_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS6_ESaISt4pairIKS6_S9_EELi256EEE", !18, i64 0}
!18 = !{!"_ZTSN5btree19btree_map_containerINS_5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS8_ESaISt4pairIKS8_SB_EELi256EEEEEEE", !19, i64 0}
!19 = !{!"_ZTSN5btree22btree_unique_containerINS_5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS8_ESaISt4pairIKS8_SB_EELi256EEEEEEE", !20, i64 0}
!20 = !{!"_ZTSN5btree15btree_containerINS_5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS8_ESaISt4pairIKS8_SB_EELi256EEEEEEE", !21, i64 0}
!21 = !{!"_ZTSN5btree5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS7_ESaISt4pairIKS7_SA_EELi256EEEEE", !22, i64 0}
!22 = !{!"_ZTSN5btree5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS7_ESaISt4pairIKS7_SA_EELi256EEEE17empty_base_handleIS6_PNS_10btree_nodeISH_EEEE", !16, i64 0}
!23 = !{!"_ZTSN4ardb6BufferE", !16, i64 0, !24, i64 8, !24, i64 16, !24, i64 24, !14, i64 32}
!24 = !{!"long", !13, i64 0}
!25 = !{!9, !14, i64 45}
!26 = !{!9, !12, i64 48}
!27 = !{!9, !16, i64 88}
!28 = !{!9, !12, i64 96}
!29 = !{!9, !12, i64 100}
!30 = !{!9, !12, i64 184}
!31 = !{!12, !12, i64 0}


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