// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_ps_s_status
st_s* bcore_btree_ps_s_status( bcore_btree_ps_s* o )
{
    uz_t blocks = 0;
    uz_t nodes = 0;
    uz_t deleted_nodes = 0;
    if( o->chain_beg )
    {
        bcore_btree_node_ps_s* chain_beg = o->chain_beg;
        while( chain_beg )
        {
            chain_beg = *( bcore_btree_node_ps_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_ps_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_ps_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_ps_s_keys( o->root ) ) / used_nodes : 0 );
    st_s_pushf( string, "depth .......... %lu\n", bcore_btree_node_ps_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 %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x124835
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x12480a
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x30(%rcx), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x1247db
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
imulq 0x30(%rcx), %rax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
movq -0x8(%rbp), %rdx
movq 0x18(%rdx), %rdx
subq %rdx, %rcx
sarq $0x6, %rcx
subq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x12486f
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x12486d
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x12484c
jmp 0x12486f
movb $0x0, %al
callq 0xff2e0
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
subq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x122b50
movq -0x50(%rbp), %rdi
movq %rax, %rdx
leaq 0x34913(%rip), %rsi     # 0x1591bb
movb $0x0, %al
callq 0x100120
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rdx
leaq 0x2b104(%rip), %rsi     # 0x14f9c2
movb $0x0, %al
callq 0x100120
movq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x40(%rbp)
jbe 0x12492a
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x122b50
movq %rax, %xmm0
movaps 0x1a614(%rip), %xmm3    # 0x13ef00
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x1a618(%rip), %xmm2    # 0x13ef10
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq -0x40(%rbp), %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0x124934
xorps %xmm0, %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0x124934
movq -0x48(%rbp), %rdi
movsd -0x58(%rbp), %xmm0
leaq 0x2b094(%rip), %rsi     # 0x14f9d8
movb $0x1, %al
callq 0x100120
movq -0x38(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x122c00
movq -0x60(%rbp), %rdi
movq %rax, %rdx
leaq 0x34864(%rip), %rsi     # 0x1591d1
movb $0x0, %al
callq 0x100120
movq -0x38(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdx
leaq 0x34860(%rip), %rsi     # 0x1591e7
movb $0x0, %al
callq 0x100120
movq -0x38(%rbp), %rdi
movq -0x10(%rbp), %rdx
leaq 0x34860(%rip), %rsi     # 0x1591fd
movb $0x0, %al
callq 0x100120
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0x34860(%rip), %rsi     # 0x159213
movb $0x0, %al
callq 0x100120
movq -0x38(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)