// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_global_manager.c
// Function: bcore_global_manager_signal_handler
vd_t bcore_global_manager_signal_handler( const bcore_signal_s* o )
{
    switch( bcore_signal_s_handle_type( o, typeof( "bcore_global_manager" ) ) )
    {
        case TYPEOF_init0:
        {
            hmap_g = bcore_hmap_tp_sr_s_create();
            mutex_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_global_size();
                sz_t space1 = bcore_tbman_total_granted_space();
                bcore_hmap_tp_sr_s_discard( hmap_g );
                bcore_mutex_s_discard( mutex_g );
                sz_t space2 = bcore_tbman_total_granted_space();
                sz_t space = space1 - space2;
                bcore_msg_fa( " global manager ....... #pl7 {#<sz_t>} (by #pl4 {#<sz_t>} objects      )\n", space, count );
            }
            else
            {
                bcore_hmap_tp_sr_s_discard( hmap_g );
                bcore_mutex_s_discard( mutex_g );
            }
            hmap_g = NULL;
            mutex_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 0x2c56d(%rip), %rdi     # 0x159708
callq 0x12d310
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 0x12d249
jmp 0x12d1c8
movq -0x38(%rbp), %rax
movabsq $-0x69a05554ee793861, %rcx # imm = 0x965FAAAB1186C79F
subq %rcx, %rax
je 0x12d24e
jmp 0x12d1dd
movq -0x38(%rbp), %rax
movabsq $0x6a72ce8f8250efc6, %rcx # imm = 0x6A72CE8F8250EFC6
subq %rcx, %rax
je 0x12d244
jmp 0x12d1f2
movq -0x38(%rbp), %rax
movabsq $0x6a72cf8f8250f179, %rcx # imm = 0x6A72CF8F8250F179
subq %rcx, %rax
je 0x12d223
jmp 0x12d207
movq -0x38(%rbp), %rax
movabsq $0x7ee758bbfced33e3, %rcx # imm = 0x7EE758BBFCED33E3
subq %rcx, %rax
je 0x12d302
jmp 0x12d304
movb $0x0, %al
callq 0xbb7c0
movq %rax, 0x8676f(%rip)     # 0x1b39a0
movb $0x0, %al
callq 0x10fba0
movq %rax, 0x86759(%rip)     # 0x1b3998
jmp 0x12d306
jmp 0x12d306
jmp 0x12d306
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x12d268
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl (%rax), %eax
movl %eax, -0x44(%rbp)
jmp 0x12d26f
xorl %eax, %eax
movl %eax, -0x44(%rbp)
jmp 0x12d26f
movl -0x44(%rbp), %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jle 0x12d2d2
callq 0x12d140
movq %rax, -0x18(%rbp)
callq 0x109a60
movq %rax, -0x20(%rbp)
movq 0x8670c(%rip), %rdi     # 0x1b39a0
callq 0xbb7f0
movq 0x866f8(%rip), %rdi     # 0x1b3998
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 0x2c454(%rip), %rdi     # 0x15971d
movb $0x0, %al
callq 0x9c9e0
jmp 0x12d2ea
movq 0x866c7(%rip), %rdi     # 0x1b39a0
callq 0xbb7f0
movq 0x866b3(%rip), %rdi     # 0x1b3998
callq 0x10fb40
movq $0x0, 0x866ab(%rip) # 0x1b39a0
movq $0x0, 0x86698(%rip) # 0x1b3998
jmp 0x12d306
jmp 0x12d306
jmp 0x12d306
xorl %eax, %eax
addq $0x50, %rsp
popq %rbp
retq
nop