// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_flect.c
// Function: bcore_flect_signal_handler
vd_t bcore_flect_signal_handler( const bcore_signal_s* o )
{
    switch( bcore_signal_s_handle_type( o, typeof( "bcore_flect" ) ) )
    {
        case TYPEOF_init0:
        {
            flect_open();
        }
        break;

        case TYPEOF_init1:
        {
            // some basic traits
            bcore_trait_set( entypeof( "root"             ), 0 ); // root trait (all traits should end in root)
            bcore_trait_set( entypeof( "bcore_inst"       ), typeof( "root" ) ); // all (instantiable) reflections should inherit bcore_inst
            bcore_trait_set( entypeof( "leaf"             ), typeof( "bcore_inst" ) ); // leaf trait
            bcore_trait_set( entypeof( "function_pointer" ), typeof( "leaf" ) );       // type of trait function_pointer can be casted to fp_t
            bcore_trait_set( entypeof( "num"              ), typeof( "leaf" ) );       // a number is a leaf type
            bcore_trait_set( entypeof( "type"             ), typeof( "num"  ) );       // type is encoded as number

            flect_define_basics();
            BCORE_REGISTER_OBJECT( bcore_link_static_s );
            BCORE_REGISTER_OBJECT( bcore_link_typed_s );
            BCORE_REGISTER_OBJECT( bcore_link_aware_s );
            BCORE_REGISTER_OBJECT( bcore_array_dyn_solid_static_s );
            BCORE_REGISTER_OBJECT( bcore_array_dyn_solid_typed_s );
            BCORE_REGISTER_OBJECT( bcore_array_dyn_link_static_s );
            BCORE_REGISTER_OBJECT( bcore_array_dyn_link_typed_s );
            BCORE_REGISTER_OBJECT( bcore_array_dyn_link_aware_s );
        }
        break;

        case TYPEOF_down0:
        {
            s2_t verbosity = o->object ? *( s2_t* )o->object : 0;
            if( verbosity > 0 )
            {
                uz_t count = bcore_flect_size();
                uz_t space = bcore_tbman_total_granted_space();
                flect_close();
                space -= bcore_tbman_total_granted_space();

                bcore_msg( "  reflection mananger . % 7zu (by % 4zu reflections  )\n", space, count );
            }
            else
            {
                flect_close();
            }
        }
        break;

        case TYPEOF_selftest:
        {
            flect_test_create_struct();
            return flect_selftest();
        }
        break;

        default: break;
    }
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq 0xa641b(%rip), %rdi     # 0x14e336
callq 0xa63d0
movq -0x38(%rbp), %rdi
movq %rax, %rsi
callq 0xc7f40
movq %rax, %rcx
movq %rcx, -0x30(%rbp)
movabsq $-0x69a05554ee793861, %rcx # imm = 0x965FAAAB1186C79F
subq %rcx, %rax
je 0xa815a
jmp 0xa7f48
movq -0x30(%rbp), %rax
movabsq $0x6a72ce8f8250efc6, %rcx # imm = 0x6A72CE8F8250EFC6
subq %rcx, %rax
je 0xa7f98
jmp 0xa7f5d
movq -0x30(%rbp), %rax
movabsq $0x6a72cf8f8250f179, %rcx # imm = 0x6A72CF8F8250F179
subq %rcx, %rax
je 0xa7f8e
jmp 0xa7f72
movq -0x30(%rbp), %rax
movabsq $0x7ee758bbfced33e3, %rcx # imm = 0x7EE758BBFCED33E3
subq %rcx, %rax
je 0xa81d0
jmp 0xa81e0
callq 0xa8bc0
jmp 0xa81e2
leaq 0xa63a3(%rip), %rdi     # 0x14e342
callq 0xa0b50
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1134f0
leaq 0xa5e41(%rip), %rdi     # 0x14ddf8
callq 0xa0b50
movq %rax, -0x60(%rbp)
leaq 0xa637b(%rip), %rdi     # 0x14e342
callq 0xa63d0
movq -0x60(%rbp), %rdi
movq %rax, %rsi
callq 0x1134f0
leaq 0xb1067(%rip), %rdi     # 0x159046
callq 0xa0b50
movq %rax, -0x58(%rbp)
leaq 0xa5e09(%rip), %rdi     # 0x14ddf8
callq 0xa63d0
movq -0x58(%rbp), %rdi
movq %rax, %rsi
callq 0x1134f0
leaq 0xa6340(%rip), %rdi     # 0x14e347
callq 0xa0b50
movq %rax, -0x50(%rbp)
leaq 0xb102f(%rip), %rdi     # 0x159046
callq 0xa63d0
movq -0x50(%rbp), %rdi
movq %rax, %rsi
callq 0x1134f0
leaq 0xa6329(%rip), %rdi     # 0x14e358
callq 0xa0b50
movq %rax, -0x48(%rbp)
leaq 0xb1007(%rip), %rdi     # 0x159046
callq 0xa63d0
movq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x1134f0
leaq 0x9a1a5(%rip), %rdi     # 0x1421fc
callq 0xa0b50
movq %rax, -0x40(%rbp)
leaq 0xa62f1(%rip), %rdi     # 0x14e358
callq 0xa63d0
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0x1134f0
callq 0xa8be0
leaq 0xa62d8(%rip), %rdi     # 0x14e35c
callq 0xa63d0
movq %rax, %rdi
leaq 0x16d(%rip), %rsi       # 0xa8200
callq 0xa7b60
leaq 0xa62d1(%rip), %rdi     # 0x14e370
callq 0xa63d0
movq %rax, %rdi
leaq 0x172(%rip), %rsi       # 0xa8220
callq 0xa7b60
leaq 0xa62c9(%rip), %rdi     # 0x14e383
callq 0xa63d0
movq %rax, %rdi
leaq 0x177(%rip), %rsi       # 0xa8240
callq 0xa7b60
leaq 0xa62c1(%rip), %rdi     # 0x14e396
callq 0xa63d0
movq %rax, %rdi
leaq 0x17c(%rip), %rsi       # 0xa8260
callq 0xa7b60
leaq 0xa62c5(%rip), %rdi     # 0x14e3b5
callq 0xa63d0
movq %rax, %rdi
leaq 0x181(%rip), %rsi       # 0xa8280
callq 0xa7b60
leaq 0xa62c8(%rip), %rdi     # 0x14e3d3
callq 0xa63d0
movq %rax, %rdi
leaq 0x186(%rip), %rsi       # 0xa82a0
callq 0xa7b60
leaq 0xa62cb(%rip), %rdi     # 0x14e3f1
callq 0xa63d0
movq %rax, %rdi
leaq 0x18b(%rip), %rsi       # 0xa82c0
callq 0xa7b60
leaq 0xa62cd(%rip), %rdi     # 0x14e40e
callq 0xa63d0
movq %rax, %rdi
leaq 0x190(%rip), %rsi       # 0xa82e0
callq 0xa7b60
jmp 0xa81e2
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0xa8174
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl (%rax), %eax
movl %eax, -0x64(%rbp)
jmp 0xa817b
xorl %eax, %eax
movl %eax, -0x64(%rbp)
jmp 0xa817b
movl -0x64(%rbp), %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jle 0xa81c9
callq 0xa7140
movq %rax, -0x20(%rbp)
callq 0x109a60
movq %rax, -0x28(%rbp)
callq 0xa9410
callq 0x109a60
movq %rax, %rcx
movq -0x28(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq 0xa626b(%rip), %rdi     # 0x14e42b
movb $0x0, %al
callq 0x9c910
jmp 0xa81ce
callq 0xa9410
jmp 0xa81e2
callq 0xa7ea0
callq 0xa8300
movq %rax, -0x8(%rbp)
jmp 0xa81ea
jmp 0xa81e2
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)