// File: /workspace/github_c_makefile_star2_O1/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 0xe9c93
movabsq $0x6a72cf8f8250f178, %rcx # imm = 0x6A72CF8F8250F178
cmpq %rcx, %rax
jg 0xd0030
movabsq $-0x69a05554ee793861, %rcx # imm = 0x965FAAAB1186C79F
cmpq %rcx, %rax
je 0xd006a
movabsq $0x6a72ce8f8250efc6, %rcx # imm = 0x6A72CE8F8250EFC6
cmpq %rcx, %rax
jne 0xd0158
leaq 0x7f6f0(%rip), %rdi     # 0x14f154
callq 0xe1270
movq %rax, %rdi
xorl %esi, %esi
callq 0x121b6d
leaq 0x7f678(%rip), %rdi     # 0x14f0f2
callq 0xe1270
movabsq $-0x5cab02e00f3b983b, %rbx # imm = 0xA354FD1FF0C467C5
movq %rax, %rdi
movq %rbx, %rsi
callq 0x121b6d
leaq 0x89d4d(%rip), %rdi     # 0x1597e8
callq 0xe1270
movabsq $-0x55a2d062927a0ff9, %rsi # imm = 0xAA5D2F9D6D85F007
movq %rax, %rdi
callq 0x121b6d
leaq 0x7f6a0(%rip), %rdi     # 0x14f159
callq 0xe1270
movabsq $0x24ad84ada20208d5, %r14 # imm = 0x24AD84ADA20208D5
movq %rax, %rdi
movq %r14, %rsi
callq 0x121b6d
leaq 0x76d38(%rip), %rdi     # 0x146812
callq 0xe1270
movq %rax, %rdi
movq %r14, %rsi
callq 0x121b6d
leaq 0x75b8d(%rip), %rdi     # 0x14567e
callq 0xe1270
movabsq $0x2102bb192543fb93, %r15 # imm = 0x2102BB192543FB93
movq %rax, %rdi
movq %r15, %rsi
callq 0x121b6d
leaq 0x68a1e(%rip), %rdi     # 0x138530
callq 0xe1270
movq %rax, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0xcd779
movq %rax, %rdi
callq 0xcf203
leaq 0x8029a(%rip), %rdi     # 0x14fdcf
callq 0xe1270
movl $0x1, %edx
movl $0x1, %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0xcd779
movq %rax, %rdi
callq 0xcf203
leaq 0x80276(%rip), %rdi     # 0x14fdd4
callq 0xe1270
movl $0x2, %edx
movl $0x2, %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0xcd779
movq %rax, %rdi
callq 0xcf203
leaq 0x80252(%rip), %rdi     # 0x14fdd9
callq 0xe1270
movl $0x4, %edx
movl $0x4, %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0xcd779
movq %rax, %rdi
callq 0xcf203
leaq 0x87be9(%rip), %rdi     # 0x157799
callq 0xe1270
movl $0x8, %edx
movl $0x8, %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0xcd779
movq %rax, %rdi
callq 0xcf203
leaq 0x80205(%rip), %rdi     # 0x14fdde
callq 0xe1270
movl $0x8, %edx
movl $0x8, %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0xcd779
movq %rax, %rdi
callq 0xcf203
leaq 0x801e1(%rip), %rdi     # 0x14fde3
callq 0xe1270
movl $0x8, %edx
movl $0x8, %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0xcd779
movq %rax, %rdi
callq 0xcf203
leaq 0x801bf(%rip), %rdi     # 0x14fdea
callq 0xe1270
movl $0x1, %edx
movl $0x1, %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0xcd779
movq %rax, %rdi
callq 0xcf203
leaq 0x8019b(%rip), %rdi     # 0x14fdef
callq 0xe1270
movl $0x2, %edx
movl $0x2, %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0xcd779
movq %rax, %rdi
callq 0xcf203
leaq 0x80177(%rip), %rdi     # 0x14fdf4
callq 0xe1270
movl $0x4, %edx
movl $0x4, %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0xcd779
movq %rax, %rdi
callq 0xcf203
leaq 0x72a26(%rip), %rdi     # 0x1426cc
callq 0xe1270
movl $0x8, %edx
movl $0x8, %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0xcd779
movq %rax, %rdi
callq 0xcf203
leaq 0x8012a(%rip), %rdi     # 0x14fdf9
callq 0xe1270
movl $0x8, %edx
movl $0x8, %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0xcd779
movq %rax, %rdi
callq 0xcf203
leaq 0x80106(%rip), %rdi     # 0x14fdfe
callq 0xe1270
movl $0x8, %edx
movl $0x8, %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0xcd779
movq %rax, %rdi
callq 0xcf203
leaq 0x800e4(%rip), %rdi     # 0x14fe05
callq 0xe1270
movl $0x4, %edx
movl $0x4, %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0xcd779
movq %rax, %rdi
callq 0xcf203
leaq 0x800c0(%rip), %rdi     # 0x14fe0a
callq 0xe1270
movl $0x8, %edx
movl $0x8, %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0xcd779
movq %rax, %rdi
callq 0xcf203
leaq 0x8009c(%rip), %rdi     # 0x14fe0f
callq 0xe1270
movl $0x1, %edx
movl $0x1, %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0xcd779
movq %rax, %rdi
callq 0xcf203
leaq 0x80078(%rip), %rdi     # 0x14fe14
callq 0xe1270
movl $0x8, %edx
movl $0x8, %ecx
movq %rax, %rdi
movq %r14, %rsi
callq 0xcd779
movq %rax, %rdi
callq 0xcf203
leaq 0x795ec(%rip), %rdi     # 0x1493b1
callq 0xe1270
movl $0x8, %edx
movl $0x8, %ecx
movq %rax, %rdi
movq %r14, %rsi
callq 0xcd779
movq %rax, %rdi
callq 0xcf203
leaq 0x8002b(%rip), %rdi     # 0x14fe19
callq 0xe1270
movl $0x8, %edx
movl $0x8, %ecx
movq %rax, %rdi
movq %r14, %rsi
callq 0xcd779
movq %rax, %rdi
callq 0xcf203
leaq 0x80007(%rip), %rdi     # 0x14fe1e
callq 0xe1270
movl $0x8, %edx
movl $0x8, %ecx
movq %rax, %rdi
movq %r14, %rsi
callq 0xcd779
movq %rax, %rdi
callq 0xcf203
leaq 0x7ffe3(%rip), %rdi     # 0x14fe23
callq 0xe1270
movl $0x8, %edx
movl $0x8, %ecx
movq %rax, %rdi
movq %r14, %rsi
callq 0xcd779
movq %rax, %rdi
callq 0xcf203
leaq 0x7ffbf(%rip), %rdi     # 0x14fe28
callq 0xe1270
movl $0x8, %edx
movl $0x8, %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0xcd779
movq %rax, %rdi
callq 0xcf203
leaq 0x83add(%rip), %rdi     # 0x15396f
callq 0xe1270
movabsq $-0x586bc610840563d3, %r14 # imm = 0xA79439EF7BFA9C2D
movl $0x8, %edx
movl $0x8, %ecx
movq %rax, %rdi
movq %r14, %rsi
callq 0xcd779
movq %rax, %rdi
callq 0xcf203
leaq 0x7ff6c(%rip), %rdi     # 0x14fe31
callq 0xe1270
movl $0x8, %edx
movl $0x8, %ecx
movq %rax, %rdi
movq %r14, %rsi
callq 0xcd779
movq %rax, %rdi
callq 0xcf203
leaq 0x7fe75(%rip), %rdi     # 0x14fd63
callq 0xe1270
movl $0x8, %edx
movl $0x8, %ecx
movq %rax, %rdi
movq %r14, %rsi
callq 0xcd779
movq %rax, %rdi
callq 0xcf203
leaq 0x7ff1f(%rip), %rdi     # 0x14fe36
callq 0xe1270
movl $0x4, %edx
movl $0x4, %ecx
movq %rax, %rdi
movq %rbx, %rsi
callq 0xcd779
movq %rax, %rdi
callq 0xcf203
leaq 0x397(%rip), %rsi       # 0xd02d7
movabsq $0x1a76aac8b75a6b47, %rdi # imm = 0x1A76AAC8B75A6B47
callq 0xcf6c4
leaq 0x488(%rip), %rsi       # 0xd03de
movabsq $-0x5129cc02bde65b7c, %rdi # imm = 0xAED633FD4219A484
callq 0xcf6c4
leaq 0x53f(%rip), %rsi       # 0xd04ab
movabsq $-0x4b706df6ad0a9f1, %rdi # imm = 0xFB48F920952F560F
callq 0xcf6c4
leaq 0x1de(%rip), %rsi       # 0xd0160
movabsq $-0x61391648b75cb9b0, %rdi # imm = 0x9EC6E9B748A34650
callq 0xcf6c4
leaq 0x1de(%rip), %rsi       # 0xd0176
movabsq $0x17edc0ef9e1ca3fe, %rdi # imm = 0x17EDC0EF9E1CA3FE
callq 0xcf6c4
leaq 0x1de(%rip), %rsi       # 0xd018c
movabsq $0x787e597899d65e08, %rdi # imm = 0x787E597899D65E08
callq 0xcf6c4
leaq 0x1de(%rip), %rsi       # 0xd01a2
movabsq $-0x5f990d95af34bba7, %rdi # imm = 0xA066F26A50CB4459
callq 0xcf6c4
leaq 0x1de(%rip), %rsi       # 0xd01b8
movabsq $0x72d477d53e64ab9, %rdi # imm = 0x72D477D53E64AB9
callq 0xcf6c4
leaq 0x1de(%rip), %rsi       # 0xd01ce
movabsq $-0x588198200862953e, %rdi # imm = 0xA77E67DFF79D6AC2
callq 0xcf6c4
leaq 0x1de(%rip), %rsi       # 0xd01e4
movabsq $0x21249c2761f660b4, %rdi # imm = 0x21249C2761F660B4
callq 0xcf6c4
leaq 0x1de(%rip), %rsi       # 0xd01fa
movabsq $-0x1f264e2c468e2e92, %rdi # imm = 0xE0D9B1D3B971D16E
callq 0xcf6c4
jmp 0xd0158
movabsq $0x7ee758bbfced33e3, %rcx # imm = 0x7EE758BBFCED33E3
cmpq %rcx, %rax
je 0xd00b6
movabsq $0x6a72cf8f8250f179, %rcx # imm = 0x6A72CF8F8250F179
cmpq %rcx, %rax
jne 0xd0158
leaq 0xd8d5f(%rip), %rdi     # 0x1a8db8
leaq -0x1353(%rip), %rsi     # 0xced0d
callq 0x11f8a7
jmp 0xd0158
movq 0x10(%rbx), %rax
testq %rax, %rax
je 0xd0153
cmpl $0x0, (%rax)
jle 0xd0153
callq 0xcee3f
movq %rax, %rbx
callq 0x11c4a0
movq %rax, %r14
callq 0xced76
callq 0x11c4a0
subq %rax, %r14
leaq 0x7f0c6(%rip), %rdi     # 0x14f16a
movq %r14, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xc7e11
jmp 0xd0158
callq 0xcf993
callq 0xcf9c4
leaq 0x800d3(%rip), %rdi     # 0x15019a
callq 0xcf2f8
leaq 0x800ff(%rip), %rdi     # 0x1501d2
callq 0xcf2f8
leaq 0x80132(%rip), %rdi     # 0x150211
callq 0xcf2f8
leaq 0x80179(%rip), %rdi     # 0x150264
callq 0xcf2f8
leaq 0x80181(%rip), %rbx     # 0x150278
movq %rbx, %rdi
callq 0xcf594
movq %rax, %r14
leaq 0x80199(%rip), %rdi     # 0x1502a2
movq %rax, %rsi
xorl %eax, %eax
callq 0xcf61c
movq %rax, %rdi
callq 0xcf1a2
movq %rbx, %rdi
callq 0xcf594
cmpq %rax, %r14
je 0xd0158
leaq 0x68518(%rip), %rdi     # 0x138647
leaq 0x8019e(%rip), %rsi     # 0x1502d4
leaq 0x801ad(%rip), %rdx     # 0x1502ea
leaq 0x7e4aa(%rip), %rcx     # 0x14e5ee
movl $0xa57, %r8d            # imm = 0xA57
xorl %eax, %eax
callq 0xc8053
jmp 0xd0158
callq 0xced76
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq