// File: /workspace/github_c_makefile_star2_O3/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 0xdfce3
movabsq $-0x69a05554ee793861, %rcx # imm = 0x965FAAAB1186C79F
cmpq %rcx, %rax
je 0x128bda
movabsq $0x6a72cf8f8250f179, %rcx # imm = 0x6A72CF8F8250F179
cmpq %rcx, %rax
jne 0x128cd3
xorl %eax, %eax
callq 0xd4084
movq %rax, 0x74860(%rip)     # 0x19d420
xorl %eax, %eax
callq 0xd4084
movq %rax, 0x74862(%rip)     # 0x19d430
xorl %eax, %eax
callq 0x114286
jmp 0x128ccc
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0x128c98
cmpl $0x0, (%rax)
jle 0x128c98
movq 0x74829(%rip), %rdi     # 0x19d420
callq 0xd4711
movq %rax, %rbx
movq 0x7482a(%rip), %rdi     # 0x19d430
callq 0xd4711
addq %rax, %rbx
callq 0x111248
movq %rax, %r14
movq 0x74803(%rip), %rdi     # 0x19d420
callq 0xd40b3
movq 0x74807(%rip), %rdi     # 0x19d430
callq 0xd40b3
movq 0x747f3(%rip), %rdi     # 0x19d428
callq 0x11424b
callq 0x111248
movq %rax, %r15
leaq 0x26166(%rip), %rdi     # 0x14edaf
movq %r14, %rsi
subq %rax, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xbe364
cmpq %r15, %r14
jns 0x128cbc
leaq 0x26194(%rip), %rdi     # 0x14edf9
xorl %eax, %eax
callq 0xbe364
leaq 0x261ba(%rip), %rdi     # 0x14ee2d
xorl %eax, %eax
callq 0xbe364
leaq 0x261df(%rip), %rdi     # 0x14ee60
xorl %eax, %eax
callq 0xbe364
leaq 0x261f8(%rip), %rdi     # 0x14ee87
xorl %eax, %eax
callq 0xbe364
jmp 0x128cbc
movq 0x74781(%rip), %rdi     # 0x19d420
callq 0xd40b3
movq 0x74785(%rip), %rdi     # 0x19d430
callq 0xd40b3
movq 0x74771(%rip), %rdi     # 0x19d428
callq 0x11424b
xorl %eax, %eax
movq %rax, 0x7475b(%rip)     # 0x19d420
movq %rax, 0x74764(%rip)     # 0x19d430
movq %rax, 0x74755(%rip)     # 0x19d428
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
nop