// File: /workspace/github_c_makefile_star2_O3/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_pp_s_status
st_s* bcore_btree_pp_s_status( bcore_btree_pp_s* o )
{
    uz_t blocks = 0;
    uz_t nodes = 0;
    uz_t deleted_nodes = 0;
    if( o->chain_beg )
    {
        bcore_btree_node_pp_s* chain_beg = o->chain_beg;
        while( chain_beg )
        {
            chain_beg = *( bcore_btree_node_pp_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_pp_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_push_fa( string, "keys ........... #<uz_t>\n", bcore_btree_node_pp_s_keys( o->root ) );
    st_s_push_fa( string, "nodes .......... #<uz_t>\n", used_nodes );
    st_s_push_fa( string, "keys/nodes ..... #<f3_t>\n", used_nodes > 0 ? ( f3_t )( bcore_btree_node_pp_s_keys( o->root ) ) / used_nodes : 0 );
    st_s_push_fa( string, "depth .......... #<uz_t>\n", bcore_btree_node_pp_s_depth( o->root ) );
    st_s_push_fa( string, "block size ..... #<uz_t>\n", o->block_size );
    st_s_push_fa( string, "blocks ......... #<uz_t>\n", blocks );
    st_s_push_fa( string, "deleted nodes .. #<uz_t>\n", deleted_nodes );
    return string;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x12576f
movq 0x30(%rbx), %rcx
xorl %r13d, %r13d
movq %rcx, %rdx
shlq $0x6, %rdx
xorl %r14d, %r14d
movq (%rax,%rdx), %rax
incq %r14
addq %rcx, %r13
testq %rax, %rax
jne 0x12574f
movq 0x10(%rbx), %rax
subq 0x18(%rbx), %rax
sarq $0x6, %rax
subq %rax, %r13
jmp 0x125775
xorl %r13d, %r13d
xorl %r14d, %r14d
movq 0x20(%rbx), %rax
xorl %r15d, %r15d
testq %rax, %rax
je 0x12578a
movq 0x20(%rax), %rax
incq %r15
jmp 0x12577c
xorl %eax, %eax
callq 0x109c82
movq %rax, %r12
movq (%rbx), %rdi
callq 0x124602
leaq 0x29123(%rip), %rsi     # 0x14e8c6
movq %r12, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x10a8a5
leaq 0x29129(%rip), %rsi     # 0x14e8e0
movq %r13, %rdx
subq %r15, %rdx
movq %r12, %rdi
xorl %eax, %eax
callq 0x10a8a5
xorpd %xmm0, %xmm0
subq %r15, %r13
je 0x12581e
movq (%rbx), %rdi
callq 0x124602
movq %rax, %xmm1
movq 0x11afb(%rip), %xmm2    # 0x1372e0
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x11aff(%rip), %xmm3    # 0x1372f0
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 0x13f70(%rip), %rsi     # 0x139795
movq %r12, %rdi
movb $0x1, %al
callq 0x10a8a5
movq (%rbx), %rax
testq %rax, %rax
sete %dl
leaq 0x77b71(%rip), %rcx     # 0x19d3b0
cmpq %rcx, %rax
sete %sil
orb %dl, %sil
je 0x12584f
xorl %edx, %edx
jmp 0x125862
xorl %edx, %edx
movq 0x28(%rax), %rax
incq %rdx
testq %rax, %rax
je 0x125862
cmpq %rcx, %rax
jne 0x125851
leaq 0x29091(%rip), %rsi     # 0x14e8fa
movq %r12, %rdi
xorl %eax, %eax
callq 0x10a8a5
movq 0x30(%rbx), %rdx
leaq 0x29096(%rip), %rsi     # 0x14e914
movq %r12, %rdi
xorl %eax, %eax
callq 0x10a8a5
leaq 0x2909f(%rip), %rsi     # 0x14e92e
movq %r12, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x10a8a5
leaq 0x290a5(%rip), %rsi     # 0x14e948
movq %r12, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x10a8a5
movq %r12, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq