// File: /workspace/github_c_makefile_star2_O3/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();
            flect_test_create_struct_nasc();
            return flect_selftest();
        }
        break;

        default: break;
    }
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movabsq $0x764eadbd04532d53, %rsi # imm = 0x764EADBD04532D53
callq 0xdfce3
movabsq $0x6a72cf8f8250f178, %rcx # imm = 0x6A72CF8F8250F178
cmpq %rcx, %rax
jg 0xc5e43
movabsq $-0x69a05554ee793861, %rcx # imm = 0x965FAAAB1186C79F
cmpq %rcx, %rax
je 0xc5e7d
movabsq $0x6a72ce8f8250efc6, %rcx # imm = 0x6A72CE8F8250EFC6
cmpq %rcx, %rax
jne 0xc5f6b
leaq 0x7e8ee(%rip), %rdi     # 0x144165
callq 0xd7476
movq %rax, %rdi
xorl %esi, %esi
callq 0x1168a7
leaq 0x7e876(%rip), %rdi     # 0x144103
callq 0xd7476
movabsq $-0x5cab02e00f3b983b, %rbx # imm = 0xA354FD1FF0C467C5
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1168a7
leaq 0x88f9a(%rip), %rdi     # 0x14e848
callq 0xd7476
movabsq $-0x55a2d062927a0ff9, %rsi # imm = 0xAA5D2F9D6D85F007
movq %rax, %rdi
callq 0x1168a7
leaq 0x7e89e(%rip), %rdi     # 0x14416a
callq 0xd7476
movabsq $0x24ad84ada20208d5, %r14 # imm = 0x24AD84ADA20208D5
movq %rax, %rdi
movq %r14, %rsi
callq 0x1168a7
leaq 0x75d9d(%rip), %rdi     # 0x13b68a
callq 0xd7476
movq %rax, %rdi
movq %r14, %rsi
callq 0x1168a7
leaq 0x74bf2(%rip), %rdi     # 0x13a4f6
callq 0xd7476
movabsq $0x2102bb192543fb93, %r15 # imm = 0x2102BB192543FB93
movq %rax, %rdi
movq %r15, %rsi
callq 0x1168a7
leaq 0x67c0b(%rip), %rdi     # 0x12d530
callq 0xd7476
movq %rax, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xc3677
movq %rax, %rdi
callq 0xc5089
leaq 0x7f498(%rip), %rdi     # 0x144de0
callq 0xd7476
movl $0x1, %edx
movl $0x1, %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0xc3677
movq %rax, %rdi
callq 0xc5089
leaq 0x7f474(%rip), %rdi     # 0x144de5
callq 0xd7476
movl $0x2, %edx
movl $0x2, %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0xc3677
movq %rax, %rdi
callq 0xc5089
leaq 0x7f450(%rip), %rdi     # 0x144dea
callq 0xd7476
movl $0x4, %edx
movl $0x4, %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0xc3677
movq %rax, %rdi
callq 0xc5089
leaq 0x86dfe(%rip), %rdi     # 0x14c7c1
callq 0xd7476
movl $0x8, %edx
movl $0x8, %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0xc3677
movq %rax, %rdi
callq 0xc5089
leaq 0x7f403(%rip), %rdi     # 0x144def
callq 0xd7476
movl $0x8, %edx
movl $0x8, %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0xc3677
movq %rax, %rdi
callq 0xc5089
leaq 0x7f3df(%rip), %rdi     # 0x144df4
callq 0xd7476
movl $0x8, %edx
movl $0x8, %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0xc3677
movq %rax, %rdi
callq 0xc5089
leaq 0x7f3bd(%rip), %rdi     # 0x144dfb
callq 0xd7476
movl $0x1, %edx
movl $0x1, %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0xc3677
movq %rax, %rdi
callq 0xc5089
leaq 0x7f399(%rip), %rdi     # 0x144e00
callq 0xd7476
movl $0x2, %edx
movl $0x2, %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0xc3677
movq %rax, %rdi
callq 0xc5089
leaq 0x7f375(%rip), %rdi     # 0x144e05
callq 0xd7476
movl $0x4, %edx
movl $0x4, %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0xc3677
movq %rax, %rdi
callq 0xc5089
leaq 0x71a8b(%rip), %rdi     # 0x137544
callq 0xd7476
movl $0x8, %edx
movl $0x8, %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0xc3677
movq %rax, %rdi
callq 0xc5089
leaq 0x7f328(%rip), %rdi     # 0x144e0a
callq 0xd7476
movl $0x8, %edx
movl $0x8, %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0xc3677
movq %rax, %rdi
callq 0xc5089
leaq 0x7f304(%rip), %rdi     # 0x144e0f
callq 0xd7476
movl $0x8, %edx
movl $0x8, %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0xc3677
movq %rax, %rdi
callq 0xc5089
leaq 0x7f2e2(%rip), %rdi     # 0x144e16
callq 0xd7476
movl $0x4, %edx
movl $0x4, %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0xc3677
movq %rax, %rdi
callq 0xc5089
leaq 0x7f2be(%rip), %rdi     # 0x144e1b
callq 0xd7476
movl $0x8, %edx
movl $0x8, %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0xc3677
movq %rax, %rdi
callq 0xc5089
leaq 0x7f29a(%rip), %rdi     # 0x144e20
callq 0xd7476
movl $0x1, %edx
movl $0x1, %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0xc3677
movq %rax, %rdi
callq 0xc5089
leaq 0x7f276(%rip), %rdi     # 0x144e25
callq 0xd7476
movl $0x8, %edx
movl $0x8, %ecx
movq %rax, %rdi
movq %r14, %rsi
callq 0xc3677
movq %rax, %rdi
callq 0xc5089
leaq 0x78651(%rip), %rdi     # 0x13e229
callq 0xd7476
movl $0x8, %edx
movl $0x8, %ecx
movq %rax, %rdi
movq %r14, %rsi
callq 0xc3677
movq %rax, %rdi
callq 0xc5089
leaq 0x7f229(%rip), %rdi     # 0x144e2a
callq 0xd7476
movl $0x8, %edx
movl $0x8, %ecx
movq %rax, %rdi
movq %r14, %rsi
callq 0xc3677
movq %rax, %rdi
callq 0xc5089
leaq 0x7f205(%rip), %rdi     # 0x144e2f
callq 0xd7476
movl $0x8, %edx
movl $0x8, %ecx
movq %rax, %rdi
movq %r14, %rsi
callq 0xc3677
movq %rax, %rdi
callq 0xc5089
leaq 0x7f1e1(%rip), %rdi     # 0x144e34
callq 0xd7476
movl $0x8, %edx
movl $0x8, %ecx
movq %rax, %rdi
movq %r14, %rsi
callq 0xc3677
movq %rax, %rdi
callq 0xc5089
leaq 0x7f1bd(%rip), %rdi     # 0x144e39
callq 0xd7476
movl $0x8, %edx
movl $0x8, %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0xc3677
movq %rax, %rdi
callq 0xc5089
leaq 0x82cf0(%rip), %rdi     # 0x148995
callq 0xd7476
movabsq $-0x586bc610840563d3, %r14 # imm = 0xA79439EF7BFA9C2D
movl $0x8, %edx
movl $0x8, %ecx
movq %rax, %rdi
movq %r14, %rsi
callq 0xc3677
movq %rax, %rdi
callq 0xc5089
leaq 0x7f16a(%rip), %rdi     # 0x144e42
callq 0xd7476
movl $0x8, %edx
movl $0x8, %ecx
movq %rax, %rdi
movq %r14, %rsi
callq 0xc3677
movq %rax, %rdi
callq 0xc5089
leaq 0x7f073(%rip), %rdi     # 0x144d74
callq 0xd7476
movl $0x8, %edx
movl $0x8, %ecx
movq %rax, %rdi
movq %r14, %rsi
callq 0xc3677
movq %rax, %rdi
callq 0xc5089
leaq 0x7f11d(%rip), %rdi     # 0x144e47
callq 0xd7476
movl $0x4, %edx
movl $0x4, %ecx
movq %rax, %rdi
movq %rbx, %rsi
callq 0xc3677
movq %rax, %rdi
callq 0xc5089
leaq 0x397(%rip), %rsi       # 0xc60ea
movabsq $0x1a76aac8b75a6b47, %rdi # imm = 0x1A76AAC8B75A6B47
callq 0xc5545
leaq 0x488(%rip), %rsi       # 0xc61f1
movabsq $-0x5129cc02bde65b7c, %rdi # imm = 0xAED633FD4219A484
callq 0xc5545
leaq 0x53f(%rip), %rsi       # 0xc62be
movabsq $-0x4b706df6ad0a9f1, %rdi # imm = 0xFB48F920952F560F
callq 0xc5545
leaq 0x1de(%rip), %rsi       # 0xc5f73
movabsq $-0x61391648b75cb9b0, %rdi # imm = 0x9EC6E9B748A34650
callq 0xc5545
leaq 0x1de(%rip), %rsi       # 0xc5f89
movabsq $0x17edc0ef9e1ca3fe, %rdi # imm = 0x17EDC0EF9E1CA3FE
callq 0xc5545
leaq 0x1de(%rip), %rsi       # 0xc5f9f
movabsq $0x787e597899d65e08, %rdi # imm = 0x787E597899D65E08
callq 0xc5545
leaq 0x1de(%rip), %rsi       # 0xc5fb5
movabsq $-0x5f990d95af34bba7, %rdi # imm = 0xA066F26A50CB4459
callq 0xc5545
leaq 0x1de(%rip), %rsi       # 0xc5fcb
movabsq $0x72d477d53e64ab9, %rdi # imm = 0x72D477D53E64AB9
callq 0xc5545
leaq 0x1de(%rip), %rsi       # 0xc5fe1
movabsq $-0x588198200862953e, %rdi # imm = 0xA77E67DFF79D6AC2
callq 0xc5545
leaq 0x1de(%rip), %rsi       # 0xc5ff7
movabsq $0x21249c2761f660b4, %rdi # imm = 0x21249C2761F660B4
callq 0xc5545
leaq 0x1de(%rip), %rsi       # 0xc600d
movabsq $-0x1f264e2c468e2e92, %rdi # imm = 0xE0D9B1D3B971D16E
callq 0xc5545
jmp 0xc5f6b
movabsq $0x7ee758bbfced33e3, %rcx # imm = 0x7EE758BBFCED33E3
cmpq %rcx, %rax
je 0xc5ec9
movabsq $0x6a72cf8f8250f179, %rcx # imm = 0x6A72CF8F8250F179
cmpq %rcx, %rax
jne 0xc5f6b
leaq 0xd5f4c(%rip), %rdi     # 0x19bdb8
leaq -0x12e8(%rip), %rsi     # 0xc4b8b
callq 0x11465b
jmp 0xc5f6b
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0xc5f66
cmpl $0x0, (%rax)
jle 0xc5f66
callq 0xc4cbd
movq %rax, %rbx
callq 0x111248
movq %rax, %r14
callq 0xc4bf4
callq 0x111248
subq %rax, %r14
leaq 0x7e2c4(%rip), %rdi     # 0x14417b
movq %r14, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xbe2ad
jmp 0xc5f6b
callq 0xc57a6
callq 0xc57d7
leaq 0x7f2d1(%rip), %rdi     # 0x1451ab
callq 0xc517e
leaq 0x7f2fd(%rip), %rdi     # 0x1451e3
callq 0xc517e
leaq 0x7f330(%rip), %rdi     # 0x145222
callq 0xc517e
leaq 0x7f377(%rip), %rdi     # 0x145275
callq 0xc517e
leaq 0x7f37f(%rip), %rbx     # 0x145289
movq %rbx, %rdi
callq 0xc5415
movq %rax, %r14
leaq 0x7f397(%rip), %rdi     # 0x1452b3
movq %rax, %rsi
xorl %eax, %eax
callq 0xc549d
movq %rax, %rdi
callq 0xc5028
movq %rbx, %rdi
callq 0xc5415
cmpq %rax, %r14
je 0xc5f6b
leaq 0x67705(%rip), %rdi     # 0x12d647
leaq 0x7f39c(%rip), %rsi     # 0x1452e5
leaq 0x7f3ab(%rip), %rdx     # 0x1452fb
leaq 0x7d6d7(%rip), %rcx     # 0x14362e
movl $0xa57, %r8d            # imm = 0xA57
xorl %eax, %eax
callq 0xbe4ef
jmp 0xc5f6b
callq 0xc4bf4
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq