// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
leaq 0x2d97e(%rip), %rdi     # 0x1595b9
callq 0x12b950
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0xc7f40
movq %rax, %rcx
movq %rcx, -0x38(%rbp)
movabsq $-0x69a05654ee793a14, %rcx # imm = 0x965FA9AB1186C5EC
subq %rcx, %rax
je 0x12bcfb
jmp 0x12bc68
movq -0x38(%rbp), %rax
movabsq $-0x69a05554ee793861, %rcx # imm = 0x965FAAAB1186C79F
subq %rcx, %rax
je 0x12bd00
jmp 0x12bc81
movq -0x38(%rbp), %rax
movabsq $0x6a72ce8f8250efc6, %rcx # imm = 0x6A72CE8F8250EFC6
subq %rcx, %rax
je 0x12bcf6
jmp 0x12bc96
movq -0x38(%rbp), %rax
movabsq $0x6a72cf8f8250f179, %rcx # imm = 0x6A72CF8F8250F179
subq %rcx, %rax
je 0x12bcc7
jmp 0x12bcab
movq -0x38(%rbp), %rax
movabsq $0x7ee758bbfced33e3, %rcx # imm = 0x7EE758BBFCED33E3
subq %rcx, %rax
je 0x12be1a
jmp 0x12be1c
movb $0x0, %al
callq 0xbb7c0
movq %rax, 0x87cab(%rip)     # 0x1b3980
movb $0x0, %al
callq 0xbb7c0
movq %rax, 0x87cad(%rip)     # 0x1b3990
movb $0x0, %al
callq 0x10fba0
movq %rax, 0x87c97(%rip)     # 0x1b3988
jmp 0x12be1e
jmp 0x12be1e
jmp 0x12be1e
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x12bd1a
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl (%rax), %eax
movl %eax, -0x44(%rbp)
jmp 0x12bd21
xorl %eax, %eax
movl %eax, -0x44(%rbp)
jmp 0x12bd21
movl -0x44(%rbp), %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jle 0x12bdd3
callq 0x12bbe0
movq %rax, -0x18(%rbp)
callq 0x109a60
movq %rax, -0x20(%rbp)
movq 0x87c36(%rip), %rdi     # 0x1b3980
callq 0xbb7f0
movq 0x87c3a(%rip), %rdi     # 0x1b3990
callq 0xbb7f0
movq 0x87c26(%rip), %rdi     # 0x1b3988
callq 0x10fb40
callq 0x109a60
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
subq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq 0x2d842(%rip), %rdi     # 0x1595cd
movb $0x0, %al
callq 0x9c9e0
cmpq $0x0, -0x30(%rbp)
jge 0x12bdd1
leaq 0x2d877(%rip), %rdi     # 0x159617
movb $0x0, %al
callq 0x9c9e0
leaq 0x2d89d(%rip), %rdi     # 0x15964b
movb $0x0, %al
callq 0x9c9e0
leaq 0x2d8c2(%rip), %rdi     # 0x15967e
movb $0x0, %al
callq 0x9c9e0
leaq 0x2d8db(%rip), %rdi     # 0x1596a5
movb $0x0, %al
callq 0x9c9e0
jmp 0x12bdf7
movq 0x87ba6(%rip), %rdi     # 0x1b3980
callq 0xbb7f0
movq 0x87baa(%rip), %rdi     # 0x1b3990
callq 0xbb7f0
movq 0x87b96(%rip), %rdi     # 0x1b3988
callq 0x10fb40
movq $0x0, 0x87b7e(%rip) # 0x1b3980
movq $0x0, 0x87b83(%rip) # 0x1b3990
movq $0x0, 0x87b70(%rip) # 0x1b3988
jmp 0x12be1e
jmp 0x12be1e
jmp 0x12be1e
xorl %eax, %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)