// File: /workspace/github_c_makefile_star2_O1/johsteffens[P]beth/lib/bcore/bcore_const_manager.c
// Function: bcore_const_manager_signal_handler
vd_t bcore_const_manager_signal_handler( const bcore_signal_s* o )
{
    switch( bcore_signal_s_handle_type( o, typeof( "bcore_const_manager" ) ) )
    {
        case TYPEOF_init0:
        {
            hmap_sr_g = bcore_hmap_tp_sr_s_create();
            hmap_st_g = bcore_hmap_tp_sr_s_create();
            mutex_st_g = bcore_mutex_s_create();

        }
        break;

        case TYPEOF_init1:
        {
        }
        break;

        case TYPEOF_down1:
        {
        }
        break;

        case TYPEOF_down0:
        {
            s2_t verbosity = o->object ? *( s2_t* )o->object : 0;
            if( verbosity > 0 )
            {
                sz_t count = bcore_const_size();
                sz_t space1 = bcore_tbman_total_granted_space();
                bcore_hmap_tp_sr_s_discard( hmap_sr_g );
                bcore_hmap_tp_sr_s_discard( hmap_st_g );
                bcore_mutex_s_discard( mutex_st_g );
                sz_t space2 = bcore_tbman_total_granted_space();
                sz_t space = space1 - space2;
                bcore_msg_fa( "  const manager ....... #pl7 {#<sz_t>} (by #pl4 {#<sz_t>} constants    )\n", space, count );
                if( space < 0 )
                {
                    bcore_msg_fa( "    A negative memory balance in the const-manager\n" );
                    bcore_msg_fa( "    can occur when previously unused perspectives\n" );
                    bcore_msg_fa( "    are invoked to shut down objects.\n" );
                    bcore_msg_fa( "    This is no error.\n" );
                }
            }
            else
            {
                bcore_hmap_tp_sr_s_discard( hmap_sr_g );
                bcore_hmap_tp_sr_s_discard( hmap_st_g );
                bcore_mutex_s_discard( mutex_st_g );
            }
            hmap_sr_g = NULL;
            hmap_st_g = NULL;
            mutex_st_g = NULL;
        }
        break;

        case TYPEOF_selftest:
        {
        }
        break;

        default: break;
    }

    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movabsq $-0x1529221d715ae61e, %rsi # imm = 0xEAD6DDE28EA519E2
callq 0xe9c93
movabsq $-0x69a05554ee793861, %rcx # imm = 0x965FAAAB1186C79F
cmpq %rcx, %rax
je 0x1340d5
movabsq $0x6a72cf8f8250f179, %rcx # imm = 0x6A72CF8F8250F179
cmpq %rcx, %rax
jne 0x1341ce
xorl %eax, %eax
callq 0xdde48
movq %rax, 0x76365(%rip)     # 0x1aa420
xorl %eax, %eax
callq 0xdde48
movq %rax, 0x76367(%rip)     # 0x1aa430
xorl %eax, %eax
callq 0x11f4d2
jmp 0x1341c7
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x134193
cmpl $0x0, (%rax)
jle 0x134193
movq 0x7632e(%rip), %rdi     # 0x1aa420
callq 0xde485
movq %rax, %rbx
movq 0x7632f(%rip), %rdi     # 0x1aa430
callq 0xde485
addq %rax, %rbx
callq 0x11c4a0
movq %rax, %r14
movq 0x76308(%rip), %rdi     # 0x1aa420
callq 0xdde77
movq 0x7630c(%rip), %rdi     # 0x1aa430
callq 0xdde77
movq 0x762f8(%rip), %rdi     # 0x1aa428
callq 0x11f497
callq 0x11c4a0
movq %rax, %r15
leaq 0x25c0b(%rip), %rdi     # 0x159d4f
movq %r14, %rsi
subq %rax, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xc7ec8
cmpq %r15, %r14
jns 0x1341b7
leaq 0x25c39(%rip), %rdi     # 0x159d99
xorl %eax, %eax
callq 0xc7ec8
leaq 0x25c5f(%rip), %rdi     # 0x159dcd
xorl %eax, %eax
callq 0xc7ec8
leaq 0x25c84(%rip), %rdi     # 0x159e00
xorl %eax, %eax
callq 0xc7ec8
leaq 0x25c9d(%rip), %rdi     # 0x159e27
xorl %eax, %eax
callq 0xc7ec8
jmp 0x1341b7
movq 0x76286(%rip), %rdi     # 0x1aa420
callq 0xdde77
movq 0x7628a(%rip), %rdi     # 0x1aa430
callq 0xdde77
movq 0x76276(%rip), %rdi     # 0x1aa428
callq 0x11f497
xorl %eax, %eax
movq %rax, 0x76260(%rip)     # 0x1aa420
movq %rax, 0x76269(%rip)     # 0x1aa430
movq %rax, 0x7625a(%rip)     # 0x1aa428
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop