// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_spect.c
// Function: bcore_spect_status
st_s* bcore_spect_status()
{
    bcore_life_s* l = bcore_life_s_create();
    assert( hmap_s_g != NULL );
    const bcore_hmap_u3vd_s* map  = &hmap_s_g->map;
    bcore_hmap_tpuz_s* hist = bcore_life_s_push_aware( l, bcore_hmap_tpuz_s_create() );
    st_s* log = st_s_create();

    {
        st_s* s = st_s_create();
        st_s_push_sc( s, "registered perspectives " );
        st_s_push_char_n( s, '.', 32 - s->size );
        bcore_mutex_s_lock( &hmap_s_g->mutex );
        st_s_pushf( s, "% 4zu\n", bcore_hmap_u3vd_s_keys( map ) );
        bcore_mutex_s_unlock( &hmap_s_g->mutex );
        st_s_push_st_d( log, s );
    }

    for( uz_t i = 0; i < map->size; i++ )
    {
        bcore_mutex_s_lock( &hmap_s_g->mutex );
        vd_t val = bcore_hmap_u3vd_s_idx_val( map, i );
        bcore_mutex_s_unlock( &hmap_s_g->mutex );
        if( val ) ( *bcore_hmap_tpuz_s_fget( hist, *( aware_t* )val, 0 ) )++;
    }

    sr_s nc_arr = sr_cl( bcore_inst_t_create_sr( bcore_flect_type_parse_fa( "{ { uz_t count; tp_t type; } [] arr; }" ) ), l );

    for( uz_t i = 0; i < hist->size; i++ )
    {
        tp_t key   = bcore_hmap_tpuz_s_idx_key( hist, i );
        uz_t count = bcore_hmap_tpuz_s_idx_val( hist, i );
        if( key )
        {
            bcore_array_x_push( nc_arr, sr_null() );
            sr_s pair = sr_cl( bcore_array_x_get_last( nc_arr ), l );
            bcore_via_x_nset_tp( pair, typeof( "type" ),  key   );
            bcore_via_x_nset_uz( pair, typeof( "count" ), count );
        }
    }

    bcore_array_x_sort( nc_arr, 0, -1, -1 );

    for( uz_t i = 0; i < bcore_array_x_get_size( nc_arr ); i++ )
    {
        sr_s pair = sr_cl( bcore_array_x_get( nc_arr, i ), l );
        const tp_t* p_type  = sr_cl( bcore_via_x_nget( pair, typeof( "type"  ) ), l ).o;
        const uz_t* p_count = sr_cl( bcore_via_x_nget( pair, typeof( "count" ) ), l ).o;
        st_s* s = st_s_create();
        st_s_pushf( s, "  %s ", ifnameof( *p_type ) );
        sz_t padding = 32 - s->size;
        padding = padding < 0 ? 0 : padding;
        st_s_push_char_n( s, '.', padding );
        st_s_pushf( s, "% 4zu\n", *p_count );
        st_s_push_st_d( log, s );
    }

    st_s_push_fa( log, "spect mananger cache:\n" );
    st_s_push_fa( log, "   keys: #<uz_t>\n", bcore_tp_fastmap_s_keys( &hmap_s_g->cache ) );
    st_s_push_fa( log, "   size: #<uz_t>\n", bcore_tp_fastmap_s_size( &hmap_s_g->cache ) );

    bcore_life_s_discard( l );
    return log;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x717ac
movq %rax, %rbx
movq 0x9d932(%rip), %rbp     # 0x117e08
leaq 0x20(%rbp), %r12
xorl %eax, %eax
callq 0x67602
movq %rbx, %rdi
movq %rax, %rsi
callq 0x71a4d
movq %rax, %r15
xorl %eax, %eax
callq 0x8eb65
movq %rax, 0x60(%rsp)
xorl %eax, %eax
callq 0x8eb65
movq %rax, %r13
leaq 0x4c19a(%rip), %rsi     # 0xc66a6
movq %rax, %rdi
callq 0x8f392
pushq $0x20
popq %rdx
subq 0x10(%r13), %rdx
pushq $0x2e
popq %rsi
movq %r13, %rdi
callq 0x8f175
movq 0x9d8db(%rip), %rdi     # 0x117e08
addq $0x60, %rdi
callq 0x97ae2
movq %r12, %rdi
callq 0x672a4
leaq 0x4c17a(%rip), %rsi     # 0xc66bf
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
movq 0x9d8af(%rip), %rdi     # 0x117e08
addq $0x60, %rdi
callq 0x97b12
movq 0x60(%rsp), %rdi
movq %r13, %rsi
callq 0x8f2e5
cmpq 0x30(%rbp), %r14
jae 0x7a5be
movq 0x9d88c(%rip), %rdi     # 0x117e08
addq $0x60, %rdi
callq 0x97ae2
movq %r12, %rdi
movq %r14, %rsi
callq 0x672e5
movq %rax, %r13
movq 0x9d86e(%rip), %rdi     # 0x117e08
addq $0x60, %rdi
callq 0x97b12
testq %r13, %r13
je 0x7a5b9
movq (%r13), %rsi
movq %r15, %rdi
xorl %edx, %edx
callq 0x6791c
incq (%rax)
incq %r14
jmp 0x7a56f
movabsq $-0x5073d588c3beb52e, %rbp # imm = 0xAF8C2A773C414AD2
leaq 0x4c0f7(%rip), %rdi     # 0xc66c6
xorl %r12d, %r12d
xorl %eax, %eax
callq 0x65093
movq %rax, %rdi
callq 0x7a3ce
movq %rax, %r14
movq %rax, %rdi
callq *0xa8(%rax)
movq %rax, 0x80(%rsp)
movq %r14, 0x88(%rsp)
pushq $0x2
popq %rax
movq %rax, 0x90(%rsp)
movq %rax, 0x10(%rsp)
movups 0x80(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x68(%rsp), %rdi
movq %rbx, %rsi
callq 0x8ced9
cmpq 0x18(%r15), %r12
jae 0x7a849
movq %r15, %rdi
movq %r12, %rsi
callq 0x67b53
movq %rax, %r13
movq %r15, %rdi
movq %r12, %rsi
callq 0x67b60
testq %r13, %r13
je 0x7a841
movq %rax, %r14
andq $0x0, 0x30(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movups 0x68(%rsp), %xmm0
movaps %xmm0, 0x40(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x48(%rsp), %rdi
movq 0x8(%rdi), %rax
cmpq %rbp, %rax
je 0x7a690
movq %rax, %rdi
callq 0x7adf2
movq %rax, %rdi
movq 0x40(%rsp), %rsi
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x7c34a
testb $0x2, 0x50(%rsp)
je 0x7a6cc
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x40(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x8cdc1
movups 0x68(%rsp), %xmm0
movaps %xmm0, 0x20(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x28(%rsp), %rsi
movq 0x8(%rsi), %rdi
cmpq %rbp, %rdi
je 0x7a6f6
callq 0x7adf2
movq %rax, %rsi
movq 0x20(%rsp), %rdx
leaq 0xe0(%rsp), %rdi
callq 0x7c326
testb $0x2, 0x30(%rsp)
je 0x7a727
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x8cdc1
movq 0xf0(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0xe0(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x40(%rsp), %rdi
movq %rbx, %rsi
callq 0x8ced9
leaq 0x3d1e8(%rip), %rdi     # 0xb793c
callq 0x7ab4b
movq %rax, %rbp
movups 0x40(%rsp), %xmm0
movaps %xmm0, 0x20(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x28(%rsp), %rdi
movq 0x8(%rdi), %rax
movabsq $0x541d0401d4dcff33, %rcx # imm = 0x541D0401D4DCFF33
cmpq %rcx, %rax
je 0x7a793
movq %rax, %rdi
callq 0x7ae42
movq %rax, %rdi
movq 0x20(%rsp), %rsi
movq %rbp, %rdx
movq %r13, %rcx
callq 0x8b056
testb $0x2, 0x30(%rsp)
je 0x7a7c2
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x8cdc1
leaq 0x4bf24(%rip), %rdi     # 0xc66ed
callq 0x7ab4b
movq %rax, %r13
movups 0x40(%rsp), %xmm0
movaps %xmm0, 0x20(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x28(%rsp), %rdi
movq 0x8(%rdi), %rax
movabsq $0x541d0401d4dcff33, %rcx # imm = 0x541D0401D4DCFF33
cmpq %rcx, %rax
movabsq $-0x5073d588c3beb52e, %rbp # imm = 0xAF8C2A773C414AD2
je 0x7a812
movq %rax, %rdi
callq 0x7ae42
movq %rax, %rdi
movq 0x20(%rsp), %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x8afd4
testb $0x2, 0x30(%rsp)
je 0x7a841
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x8cdc1
incq %r12
jmp 0x7a626
movups 0x68(%rsp), %xmm0
movaps %xmm0, 0x20(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x28(%rsp), %rdi
movq 0x8(%rdi), %rax
cmpq %rbp, %rax
je 0x7a876
movq %rax, %rdi
callq 0x7adf2
movq %rax, %rdi
movq 0x20(%rsp), %rsi
pushq $-0x1
popq %rcx
pushq $-0x1
popq %r8
xorl %edx, %edx
callq 0x7d56c
testb $0x2, 0x30(%rsp)
je 0x7a8a8
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x8cdc1
leaq 0x4be10(%rip), %r15     # 0xc66bf
xorl %r12d, %r12d
movups 0x68(%rsp), %xmm0
movaps %xmm0, 0x20(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x28(%rsp), %rdi
movq 0x8(%rdi), %rax
cmpq %rbp, %rax
je 0x7a8df
movq %rax, %rdi
callq 0x7adf2
movq %rax, %rdi
movq 0x20(%rsp), %rsi
callq 0x7c954
movq %rax, %r13
testb $0x2, 0x30(%rsp)
je 0x7a90b
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x8cdc1
cmpq %r13, %r12
jae 0x7aacc
movups 0x68(%rsp), %xmm0
movaps %xmm0, 0x20(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x28(%rsp), %rsi
movq 0x8(%rsi), %rdi
cmpq %rbp, %rdi
je 0x7a93e
callq 0x7adf2
movq %rax, %rsi
movq 0x20(%rsp), %rdx
leaq 0xc8(%rsp), %rdi
movq %r12, %rcx
callq 0x7c97c
testb $0x2, 0x30(%rsp)
je 0x7a972
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x8cdc1
movq 0xd8(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0xc8(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x8ced9
leaq 0x3cf9d(%rip), %rdi     # 0xb793c
callq 0x7ab4b
movq 0x30(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movups 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0xb0(%rsp), %rdi
movq %rax, %rsi
callq 0x7ab5d
movq 0xc0(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0xb0(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x110(%rsp), %rdi
movq %rbx, %rsi
callq 0x8ced9
movq 0x110(%rsp), %rbp
leaq 0x4bcee(%rip), %rdi     # 0xc66ed
callq 0x7ab4b
movq 0x30(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movups 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x98(%rsp), %rdi
movq %rax, %rsi
callq 0x7ab5d
movq 0xa8(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x98(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0xf8(%rsp), %rdi
movq %rbx, %rsi
callq 0x8ced9
movq 0xf8(%rsp), %r14
xorl %eax, %eax
callq 0x8eb65
movq %rax, %r13
movq (%rbp), %rdi
callq 0x79d59
movq %r13, %rdi
leaq 0x4bc7e(%rip), %rsi     # 0xc66f3
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f42b
pushq $0x20
popq %rdx
subq 0x10(%r13), %rdx
testq %rdx, %rdx
movl $0x0, %eax
cmovleq %rax, %rdx
movq %r13, %rdi
pushq $0x2e
popq %rsi
callq 0x8f175
movq (%r14), %rdx
movq %r13, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x8f42b
movq 0x60(%rsp), %rdi
movq %r13, %rsi
callq 0x8f2e5
incq %r12
movabsq $-0x5073d588c3beb52e, %rbp # imm = 0xAF8C2A773C414AD2
jmp 0x7a8b2
leaq 0x4bc26(%rip), %rsi     # 0xc66f9
movq 0x60(%rsp), %r15
movq %r15, %rdi
xorl %eax, %eax
callq 0x8f4ef
movl $0x88, %r14d
movq 0x9d319(%rip), %rdi     # 0x117e08
addq %r14, %rdi
callq 0x98e3a
leaq 0x4bc12(%rip), %rsi     # 0xc6710
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f4ef
addq 0x9d2f6(%rip), %r14     # 0x117e08
movq %r14, %rdi
callq 0x98e03
leaq 0x4bc01(%rip), %rsi     # 0xc6722
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8f4ef
movq %rbx, %rdi
callq 0x717c7
movq %r15, %rax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq