// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: bcore_tbman_s_status
st_s* bcore_tbman_s_status( bcore_tbman_s* o, int detail_level )
{
    if( detail_level <= 0 ) return NULL;

    st_s* str = st_s_create();
    st_s_pushf( str, "main manager\n" );
    st_s_pushf( str, "  pool_size ........... %zu\n", o->pool_size );
    st_s_pushf( str, "  block managers ...... %zu\n", o->size );
    st_s_pushf( str, "  token managers ...... %zu\n", bcore_btree_vd_s_count( o->internal_btree, NULL, NULL ) );
    st_s_pushf( str, "  external allocs ..... %zu\n", bcore_btree_pp_s_count( o->external_manager.ex_btree, NULL, NULL ) );
    st_s_pushf( str, "  internal_btree depth  %zu\n", bcore_btree_vd_s_depth( o->internal_btree ) );
    st_s_pushf( str, "  external_btree depth  %zu\n", bcore_btree_pp_s_depth( o->external_manager.ex_btree ) );
    st_s_pushf( str, "  min_block_size ...... %zu\n", o->size > 0 ? o->data[ 0 ]->block_size : 0 );
    st_s_pushf( str, "  max_block_size ...... %zu\n", o->size > 0 ? o->data[ o->size - 1 ]->block_size : 0 );
    st_s_pushf( str, "  aligned ............. %s\n",  o->aligned ? "true" : "false" );

    st_s_pushf( str, "external manager\n" );
    st_s_pushf( str, "  pool_size ........... %zu\n", o->external_manager.pool_size );
    st_s_pushf( str, "  token managers ...... %zu\n", bcore_btree_vd_s_count( o->external_manager.tm_btree, NULL, NULL ) );
    st_s_pushf( str, "  aligned ............. %s\n",  o->external_manager.aligned ? "true" : "false" );
    st_s_pushf( str, "  item size ........... %zu\n", sizeof( ext_s ) );
    st_s_pushf( str, "  items ............... %zu\n", block_manager_s_total_alloc( &o->external_manager.bm_ext ) / sizeof( ext_s ) );
    st_s_pushf( str, "  alloc ............... %zu\n", block_manager_s_total_alloc( &o->external_manager.bm_ext ) );
    st_s_pushf( str, "  space ............... %zu\n", block_manager_s_total_space( &o->external_manager.bm_ext ) );

    st_s_pushf( str, "down manager\n" );
    st_s_pushf( str, "  pool_size ........... %zu\n", o->down_manager.pool_size );
    st_s_pushf( str, "  token managers ...... %zu\n", bcore_btree_vd_s_count( o->down_manager.tm_btree, NULL, NULL ) );
    st_s_pushf( str, "  aligned ............. %s\n",  o->down_manager.aligned ? "true" : "false" );
    st_s_pushf( str, "  down_obj_s size ..... %zu\n", sizeof( down_obj_s ) );
    st_s_pushf( str, "  down_obj_s items .... %zu\n", block_manager_s_total_alloc( &o->down_manager.bm_down_obj ) / sizeof( down_obj_s ) );
    st_s_pushf( str, "  down_obj_s alloc .... %zu\n", block_manager_s_total_alloc( &o->down_manager.bm_down_obj ) );
    st_s_pushf( str, "  down_obj_s space .... %zu\n", block_manager_s_total_space( &o->down_manager.bm_down_obj ) );
    st_s_pushf( str, "  down_arg_s size ..... %zu\n", sizeof( down_arg_s ) );
    st_s_pushf( str, "  down_arg_s items .... %zu\n", block_manager_s_total_alloc( &o->down_manager.bm_down_arg ) / sizeof( down_arg_s ) );
    st_s_pushf( str, "  down_arg_s alloc .... %zu\n", block_manager_s_total_alloc( &o->down_manager.bm_down_arg ) );
    st_s_pushf( str, "  down_arg_s space .... %zu\n", block_manager_s_total_space( &o->down_manager.bm_down_arg ) );
    st_s_pushf( str, "  down_obj_arr_s size   %zu\n", sizeof( down_obj_arr_s ) );
    st_s_pushf( str, "  down_obj_arr_s items  %zu\n", block_manager_s_total_alloc( &o->down_manager.bm_down_obj_arr ) / sizeof( down_obj_arr_s ) );
    st_s_pushf( str, "  down_obj_arr_s alloc  %zu\n", block_manager_s_total_alloc( &o->down_manager.bm_down_obj_arr ) );
    st_s_pushf( str, "  down_obj_arr_s space  %zu\n", block_manager_s_total_space( &o->down_manager.bm_down_obj_arr ) );
    st_s_pushf( str, "  down_arg_arr_s size   %zu\n", sizeof( down_arg_arr_s ) );
    st_s_pushf( str, "  down_arg_arr_s items  %zu\n", block_manager_s_total_alloc( &o->down_manager.bm_down_arg_arr ) / sizeof( down_arg_arr_s ) );
    st_s_pushf( str, "  down_arg_arr_s alloc  %zu\n", block_manager_s_total_alloc( &o->down_manager.bm_down_arg_arr ) );
    st_s_pushf( str, "  down_arg_arr_s space  %zu\n", block_manager_s_total_space( &o->down_manager.bm_down_arg_arr ) );

    st_s_pushf( str, "overall allocations\n" );
    st_s_pushf( str, "  total bytes granted . %zu\n", tbman_s_total_alloc( o ) );
    st_s_pushf( str, "    external .......... %zu\n", external_manager_s_total_alloc( &o->external_manager ) );
    st_s_pushf( str, "    internal .......... %zu\n", tbman_s_internal_total_alloc( o ) );
    st_s_pushf( str, "  internal used ....... %zu\n", tbman_s_total_space( o ) );
    st_s_pushf( str, "  total instances ..... %zu\n", tbman_s_total_instances( o ) );
    st_s_pushf( str, "    external .......... %zu\n", external_manager_s_total_instances( &o->external_manager ) );
    st_s_pushf( str, "    internal .......... %zu\n", tbman_s_internal_total_instances( o ) );
    st_s_pushf( str, "  total references .... %zu\n", tbman_s_total_references( o ) );
    st_s_pushf( str, "    external .......... %zu\n", external_manager_s_total_references( &o->external_manager ) );
    st_s_pushf( str, "    internal .......... %zu\n", tbman_s_internal_total_references( o ) );
    if( detail_level > 1 )
    {
        for( uz_t i = 0; i < o->size; i++ )
        {
            st_s_pushf( str, "\nblock manager %zu:\n", i );
            st_s_push_st_d( str, block_manager_s_status( o->data[ i ], detail_level - 1 ) );
        }
    }

    return str;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, 0x1c(%rsp)
testl %esi, %esi
jle 0x95c0d
movq %rdi, %r15
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x8eb65
movq %rax, %r13
leaq 0x3598e(%rip), %rsi     # 0xcad6f
movq %rax, %rdi
xorl %eax, %eax
callq 0x8f42b
movq 0x10(%r15), %rdx
leaq 0x35987(%rip), %rsi     # 0xcad7d
movq %r13, %rdi
xorl %eax, %eax
callq 0x8f42b
movq 0x8(%r15), %rdx
leaq 0x3598f(%rip), %rsi     # 0xcad9a
movq %r13, %rdi
xorl %eax, %eax
callq 0x8f42b
movq 0x38(%r15), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xa4a4f
leaq 0x3598e(%rip), %rsi     # 0xcadb7
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
movq 0xb8(%r15), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xa36f9
leaq 0x35987(%rip), %rsi     # 0xcadd4
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
movq 0x38(%r15), %rdi
callq 0xa4a57
leaq 0x35987(%rip), %rsi     # 0xcadf1
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
movq 0xb8(%r15), %rdi
callq 0xa3701
leaq 0x35984(%rip), %rsi     # 0xcae0e
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
cmpq $0x0, 0x8(%r15)
je 0x954a8
movq (%r15), %rax
movq (%rax), %rax
movq 0x8(%rax), %rbx
leaq 0x40(%r15), %rax
movq %rax, 0x10(%rsp)
leaq 0x35973(%rip), %rsi     # 0xcae2b
xorl %r14d, %r14d
movq %r13, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x8f42b
movq 0x8(%r15), %rax
testq %rax, %rax
je 0x954dd
movq (%r15), %rcx
movq -0x8(%rcx,%rax,8), %rax
movq 0x8(%rax), %r14
leaq 0x35964(%rip), %rsi     # 0xcae48
xorl %r12d, %r12d
movq %r13, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x8f42b
leaq 0x371d7(%rip), %r14     # 0xcc6d2
cmpb $0x0, 0x28(%r15)
leaq 0x1b4b1(%rip), %rbx     # 0xb09b8
movq %rbx, %rdx
cmovneq %r14, %rdx
leaq 0x35950(%rip), %rbp     # 0xcae65
movq %r13, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x8f42b
leaq 0x35958(%rip), %rsi     # 0xcae81
movq %r13, %rdi
xorl %eax, %eax
callq 0x8f42b
movq 0xc0(%r15), %rdx
leaq 0x3583c(%rip), %rsi     # 0xcad7d
movq %r13, %rdi
xorl %eax, %eax
callq 0x8f42b
movq 0xb0(%r15), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xa4a4f
movq %r13, 0x8(%rsp)
leaq 0x35850(%rip), %rsi     # 0xcadb7
movq 0x8(%rsp), %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
cmpb $0x0, 0xc8(%r15)
movq %rbx, %rdx
cmovneq %r14, %rdx
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x8f42b
leaq 0x358f8(%rip), %rsi     # 0xcae93
pushq $0x18
popq %rbp
movq 0x8(%rsp), %rdi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x8f42b
movq 0x10(%rsp), %r13
movq %r13, %rdi
callq 0x95c21
xorl %edx, %edx
divq %rbp
leaq 0x358ea(%rip), %rsi     # 0xcaeb0
movq 0x8(%rsp), %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
movq %r13, %rdi
callq 0x95c21
leaq 0x358e9(%rip), %rsi     # 0xcaecd
movq 0x8(%rsp), %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
movq %r13, %rdi
callq 0x95c49
leaq 0x358e8(%rip), %rsi     # 0xcaeea
movq 0x8(%rsp), %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
leaq 0x358ef(%rip), %rsi     # 0xcaf07
movq 0x8(%rsp), %rdi
xorl %eax, %eax
callq 0x8f42b
leaq 0xe0(%r15), %r13
movq 0x2a8(%r15), %rdx
movq 0x8(%rsp), %rdi
leaq 0x3573f(%rip), %rsi     # 0xcad7d
xorl %eax, %eax
callq 0x8f42b
movq 0x2a0(%r15), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xa4a4f
movq 0x8(%rsp), %rdi
leaq 0x35756(%rip), %rsi     # 0xcadb7
movq 0x8(%rsp), %rbp
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
cmpb $0x0, 0x2b0(%r15)
cmovneq %r14, %rbx
movq %rbp, %rdi
leaq 0x357df(%rip), %rsi     # 0xcae65
movq %rbx, %rdx
xorl %eax, %eax
callq 0x8f42b
leaq 0x3587e(%rip), %rsi     # 0xcaf15
pushq $0x10
popq %rdx
movq %rbp, %rdi
xorl %eax, %eax
callq 0x8f42b
movq %r13, %rdi
callq 0x95c21
shrq $0x4, %rax
leaq 0x3587b(%rip), %rsi     # 0xcaf32
movq %rbp, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
movq %r13, %rdi
callq 0x95c21
leaq 0x3587c(%rip), %rsi     # 0xcaf4f
movq %rbp, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
movq %r13, %rdi
callq 0x95c49
leaq 0x3587d(%rip), %rsi     # 0xcaf6c
movq %rbp, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
leaq 0x35886(%rip), %rsi     # 0xcaf89
movq %rbp, %rdi
pushq $0x18
popq %rbx
movq %rbx, %rdx
xorl %eax, %eax
callq 0x8f42b
leaq 0x150(%r15), %r14
movq %r14, %rdi
callq 0x95c21
xorl %edx, %edx
divq %rbx
leaq 0x35878(%rip), %rsi     # 0xcafa6
movq %rbp, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
movq %r14, %rdi
callq 0x95c21
leaq 0x35879(%rip), %rsi     # 0xcafc3
movq %rbp, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
movq %r14, %rdi
callq 0x95c49
leaq 0x3587a(%rip), %rsi     # 0xcafe0
movq %rbp, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
leaq 0x35883(%rip), %rsi     # 0xcaffd
pushq $0x20
popq %rdx
movq %rbp, %rdi
xorl %eax, %eax
callq 0x8f42b
leaq 0x1c0(%r15), %rbx
movq %rbx, %rdi
callq 0x95c21
shrq $0x5, %rax
leaq 0x35879(%rip), %rsi     # 0xcb01a
movq %rbp, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
movq %rbx, %rdi
callq 0x95c21
leaq 0x3587a(%rip), %rsi     # 0xcb037
movq %rbp, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
movq %rbx, %rdi
callq 0x95c49
leaq 0x3587b(%rip), %rsi     # 0xcb054
movq %rbp, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
leaq 0x35884(%rip), %rsi     # 0xcb071
pushq $0x28
popq %r14
movq %rbp, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x8f42b
leaq 0x230(%r15), %rbx
movq %rbx, %rdi
callq 0x95c21
xorl %edx, %edx
divq %r14
leaq 0x35875(%rip), %rsi     # 0xcb08e
movq %rbp, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
movq %rbx, %rdi
callq 0x95c21
leaq 0x35876(%rip), %rsi     # 0xcb0ab
movq %rbp, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
movq %rbx, %rdi
callq 0x95c49
leaq 0x35877(%rip), %rsi     # 0xcb0c8
movq %rbp, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
leaq 0x35880(%rip), %rsi     # 0xcb0e5
movq %rbp, %rdi
xorl %eax, %eax
callq 0x8f42b
movq %r15, %rdi
callq 0x950fd
leaq 0x3587c(%rip), %rsi     # 0xcb0fa
movq %rbp, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
movq 0x10(%rsp), %rdi
callq 0x95c70
leaq 0x3587b(%rip), %rsi     # 0xcb117
movq %rbp, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
movq %r15, %rdi
callq 0x95c9a
leaq 0x3587c(%rip), %rsi     # 0xcb134
movq %rbp, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
movq 0x8(%r15), %rbx
xorl %r14d, %r14d
cmpq %r14, %rbx
je 0x958e5
movq (%r15), %rax
movq (%rax,%r14,8), %rdi
callq 0x95c49
addq %rax, %r12
incq %r14
jmp 0x958cc
movq 0x10(%rsp), %r13
movq %r13, %rdi
callq 0x95c49
addq %rax, %r12
leaq 0x35855(%rip), %rsi     # 0xcb151
movq %rbp, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x8f42b
movq %r15, %rdi
callq 0x95157
leaq 0x35856(%rip), %rsi     # 0xcb16e
movq %rbp, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
movq %r13, %rdi
callq 0x95cd7
leaq 0x357e3(%rip), %rbx     # 0xcb117
movq %rbp, %rdi
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
movq %r15, %rdi
callq 0x95d01
leaq 0x357e1(%rip), %r14     # 0xcb134
movq %rbp, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
movq %r15, %rdi
callq 0x951b1
leaq 0x35819(%rip), %rsi     # 0xcb18b
movq %rbp, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
movq %r13, %rdi
callq 0x95d42
movq %rbp, %rdi
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
movq %r15, %rdi
callq 0x95d6c
movq %rbp, %rdi
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
cmpl $0x1, 0x1c(%rsp)
je 0x95c0f
movq %r15, 0x20(%rsp)
leaq 0x35d6a(%rip), %r13     # 0xcb730
xorl %r14d, %r14d
movq 0x20(%rsp), %rbx
cmpq 0x8(%rbx), %r14
jae 0x95c0f
movq %rbp, %rdi
leaq 0x357c6(%rip), %rsi     # 0xcb1a8
movq %r14, %rdx
xorl %eax, %eax
callq 0x8f42b
movq (%rbx), %rax
movq %r14, 0x10(%rsp)
movq (%rax,%r14,8), %rbp
xorl %eax, %eax
callq 0x8eb65
movq %rax, %rbx
movq (%rbp), %rdx
movq %rax, %rdi
leaq 0x35bbe(%rip), %rsi     # 0xcb5ce
xorl %eax, %eax
callq 0x8f42b
movq 0x8(%rbp), %rdx
movq %rbx, %rdi
leaq 0x35bc2(%rip), %rsi     # 0xcb5e7
xorl %eax, %eax
callq 0x8f42b
movsd 0x38(%rbp), %xmm0
movq %rbx, %rdi
leaq 0x35bc5(%rip), %rsi     # 0xcb600
movb $0x1, %al
callq 0x8f42b
cmpb $0x0, 0x40(%rbp)
leaq 0x1af6b(%rip), %rdx     # 0xb09b8
leaq 0x36c7e(%rip), %rax     # 0xcc6d2
cmovneq %rax, %rdx
movq %rbx, %rdi
leaq 0x35bb6(%rip), %rsi     # 0xcb618
xorl %eax, %eax
callq 0x8f42b
movq 0x20(%rbp), %rdx
movq %rbx, %rdi
leaq 0x35bb9(%rip), %rsi     # 0xcb630
xorl %eax, %eax
callq 0x8f42b
movq 0x30(%rbp), %rdx
movq %rbx, %rdi
leaq 0x35bbd(%rip), %rsi     # 0xcb649
xorl %eax, %eax
callq 0x8f42b
movq %rbp, %rdi
callq 0x971a6
movq %rbx, %rdi
leaq 0x35bbd(%rip), %rsi     # 0xcb662
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
movq %rbp, %rdi
callq 0x95c21
movq %rbx, %rdi
leaq 0x35bba(%rip), %rsi     # 0xcb67b
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
movq %rbp, %rdi
callq 0x95c49
movq %rbx, %rdi
leaq 0x35bb7(%rip), %rsi     # 0xcb694
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
cmpl $0x3, 0x1c(%rsp)
jl 0x95bf0
xorl %r14d, %r14d
cmpq 0x20(%rbp), %r14
jae 0x95bf0
movq %rbx, %rdi
leaq 0x3569f(%rip), %rsi     # 0xcb1a8
movq %r14, %rdx
xorl %eax, %eax
callq 0x8f42b
movq 0x18(%rbp), %rax
movq (%rax,%r14,8), %r12
xorl %eax, %eax
callq 0x8eb65
movq %rax, %r15
movq (%r12), %rdx
movq %rax, %rdi
leaq 0x35b7a(%rip), %rsi     # 0xcb6ad
xorl %eax, %eax
callq 0x8f42b
movq 0x8(%r12), %rdx
movq %r15, %rdi
leaq 0x35b7a(%rip), %rsi     # 0xcb6c3
xorl %eax, %eax
callq 0x8f42b
movzwl 0x10(%r12), %edx
movq %r15, %rdi
leaq 0x35b79(%rip), %rsi     # 0xcb6d9
xorl %eax, %eax
callq 0x8f42b
cmpb $0x0, 0x14(%r12)
leaq 0x1ae44(%rip), %rdx     # 0xb09b8
leaq 0x36b57(%rip), %rax     # 0xcc6d2
cmovneq %rax, %rdx
movq %r15, %rdi
leaq 0x35b66(%rip), %rsi     # 0xcb6ef
xorl %eax, %eax
callq 0x8f42b
movzwl 0x12(%r12), %edx
movq %r15, %rdi
leaq 0x35b64(%rip), %rsi     # 0xcb704
xorl %eax, %eax
callq 0x8f42b
movzwl 0x12(%r12), %edx
imulq 0x8(%r12), %rdx
movq %r15, %rdi
leaq 0x35b5d(%rip), %rsi     # 0xcb71a
xorl %eax, %eax
callq 0x8f42b
movzwl 0x10(%r12), %edx
addl %edx, %edx
addq (%r12), %rdx
movq %r15, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x8f42b
movq %rbx, %rdi
movq %r15, %rsi
callq 0x8f2e5
incq %r14
jmp 0x95af5
movq 0x8(%rsp), %rbp
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x8f2e5
movq 0x10(%rsp), %r14
incq %r14
jmp 0x959c9
xorl %ebp, %ebp
movq %rbp, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq