// File: /workspace/github_c_makefile_star2_O1/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_vd_s_status
st_s* bcore_btree_vd_s_status( bcore_btree_vd_s* o )
{
    uz_t blocks = 0;
    uz_t nodes = 0;
    uz_t deleted_nodes = 0;
    if( o->chain_beg )
    {
        bcore_btree_node_vd_s* chain_beg = o->chain_beg;
        while( chain_beg )
        {
            chain_beg = *( bcore_btree_node_vd_s** )( chain_beg + o->block_size );
            blocks++;
        }
        nodes = blocks * o->block_size - ( o->chain_end - o->chain_ins );
    }
    if( o->del_chain )
    {
        bcore_btree_node_vd_s* del_chain = o->del_chain;
        while( del_chain )
        {
            del_chain = del_chain->parent;
            deleted_nodes++;
        }
    }

    st_s* string = st_s_create();
    uz_t used_nodes = nodes - deleted_nodes;
    st_s_pushf( string, "keys ........... %lu\n", bcore_btree_node_vd_s_keys( o->root ) );
    st_s_pushf( string, "nodes .......... %lu\n", used_nodes );
    st_s_pushf( string, "keys/nodes ..... %5.4f\n", used_nodes > 0 ? ( double )( bcore_btree_node_vd_s_keys( o->root ) ) / used_nodes : 0 );
    st_s_pushf( string, "depth .......... %lu\n", bcore_btree_node_vd_s_depth( o->root ) );
    st_s_pushf( string, "block size ..... %lu\n", o->block_size );
    st_s_pushf( string, "blocks ......... %lu\n", blocks );
    st_s_pushf( string, "deleted nodes .. %lu\n", deleted_nodes );
    return string;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %r14
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x1320dc
movq 0x30(%r14), %rcx
xorl %ebx, %ebx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
movq (%rax,%rcx), %rax
incq %rbx
testq %rax, %rax
jne 0x1320a9
movq 0x30(%r14), %rax
imulq %rbx, %rax
movq 0x10(%r14), %rcx
subq 0x18(%r14), %rcx
sarq $0x4, %rcx
movabsq $0x5555555555555555, %r13 # imm = 0x5555555555555555
imulq %rcx, %r13
addq %rax, %r13
jmp 0x1320e1
xorl %r13d, %r13d
xorl %ebx, %ebx
movq 0x20(%r14), %rax
xorl %r15d, %r15d
testq %rax, %rax
je 0x1320f6
movq 0x10(%rax), %rax
incq %r15
jmp 0x1320e8
xorl %eax, %eax
callq 0x114bbb
movq %rax, %r12
movq (%r14), %rdi
callq 0x1310cd
leaq 0x2784e(%rip), %rsi     # 0x15995d
movq %r12, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1156f6
leaq 0x1e581(%rip), %rsi     # 0x1506a4
movq %r13, %rdx
subq %r15, %rdx
movq %r12, %rdi
xorl %eax, %eax
callq 0x1156f6
xorpd %xmm0, %xmm0
subq %r15, %r13
je 0x13218a
movq (%r14), %rdi
callq 0x1310cd
movq %rax, %xmm1
movq 0x1013f(%rip), %xmm2    # 0x142290
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x10143(%rip), %xmm3    # 0x1422a0
subpd %xmm3, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movq %r13, %xmm1
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
subpd %xmm3, %xmm1
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
leaq 0x1e529(%rip), %rsi     # 0x1506ba
movq %r12, %rdi
movb $0x1, %al
callq 0x1156f6
movq (%r14), %rdi
callq 0x13114a
leaq 0x277c9(%rip), %rsi     # 0x159973
movq %r12, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1156f6
movq 0x30(%r14), %rdx
leaq 0x277c7(%rip), %rsi     # 0x159989
movq %r12, %rdi
xorl %eax, %eax
callq 0x1156f6
leaq 0x277cc(%rip), %rsi     # 0x15999f
movq %r12, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1156f6
leaq 0x277ce(%rip), %rsi     # 0x1599b5
movq %r12, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x1156f6
movq %r12, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq