// File: /workspace/github_c_makefile_star2_O2/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
leaq 0x265f4(%rip), %rdi     # 0xcce34
callq 0xa670d
movq %rbx, %rdi
movq %rax, %rsi
callq 0x75141
movabsq $-0x69a05554ee793861, %rcx # imm = 0x965FAAAB1186C79F
cmpq %rcx, %rax
je 0xa689a
movabsq $0x6a72cf8f8250f179, %rcx # imm = 0x6A72CF8F8250F179
cmpq %rcx, %rax
jne 0xa697f
xorl %eax, %eax
callq 0x6f769
movq %rax, 0x72ba0(%rip)     # 0x119420
xorl %eax, %eax
callq 0x6f769
movq %rax, 0x72ba2(%rip)     # 0x119430
xorl %eax, %eax
callq 0x97abb
jmp 0xa6978
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0xa6942
cmpl $0x0, (%rax)
jle 0xa6942
callq 0xa6810
movq %rax, %rbx
callq 0x9536f
movq %rax, %r14
movq 0x72b59(%rip), %rdi     # 0x119420
callq 0x6f784
movq 0x72b5d(%rip), %rdi     # 0x119430
callq 0x6f784
movq 0x72b49(%rip), %rdi     # 0x119428
callq 0x97a8f
callq 0x9536f
movq %rax, %r15
leaq 0x26555(%rip), %rdi     # 0xcce48
movq %r14, %rsi
subq %rax, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x5fc08
cmpq %r15, %r14
jns 0xa6966
leaq 0x26583(%rip), %rdi     # 0xcce92
xorl %eax, %eax
callq 0x5fc08
leaq 0x265a9(%rip), %rdi     # 0xccec6
xorl %eax, %eax
callq 0x5fc08
leaq 0x265ce(%rip), %rdi     # 0xccef9
xorl %eax, %eax
callq 0x5fc08
leaq 0x265e7(%rip), %rdi     # 0xccf20
xorl %eax, %eax
callq 0x5fc08
jmp 0xa6966
movq 0x72ad7(%rip), %rdi     # 0x119420
callq 0x6f784
movq 0x72adb(%rip), %rdi     # 0x119430
callq 0x6f784
movq 0x72ac7(%rip), %rdi     # 0x119428
callq 0x97a8f
andq $0x0, 0x72ab2(%rip)     # 0x119420
andq $0x0, 0x72aba(%rip)     # 0x119430
xorl %eax, %eax
movq %rax, 0x72aa9(%rip)     # 0x119428
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop