// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_flect.c
// Function: bcore_self_item_s_struct_to_sink
bl_t bcore_self_item_s_struct_to_sink( const bcore_self_item_s* o, bcore_sink* sink )
{
    sc_t type = ifnameof( o->type );
    sc_t name = ifnameof( o->name );

    bl_t ret = true;

    switch( o->caps )
    {
        case BCORE_CAPS_SOLID_STATIC:
        {
            bcore_sink_a_push_fa( sink, "#<sc_t> #<sc_t>;", type, name );
        }
        break;

        case BCORE_CAPS_LINK_STATIC:
        {
            bcore_sink_a_push_fa( sink, "#<sc_t>* #<sc_t>;", type, name );
        }
        break;

        case BCORE_CAPS_LINK_TYPED:
        {
            if( o->type )
            {
                bcore_sink_a_push_fa( sink, "BCORE_LINK_TYPED_VIRTUAL_S( #<sc_t>, #<sc_t> );", type, name );
            }
            else
            {
                bcore_sink_a_push_fa( sink, "BCORE_LINK_TYPED_S( #<sc_t> );", name );
            }
        }
        break;

        case BCORE_CAPS_LINK_AWARE:
        {
            if( o->type )
            {
                bcore_sink_a_push_fa( sink, "#<sc_t>* #<sc_t>;", type, name );
            }
            else
            {
                bcore_sink_a_push_fa( sink, "vd_t #<sc_t>;", name );
            }
        }
        break;

        case BCORE_CAPS_POINTER:
        {
            if( o->type )
            {
                bcore_sink_a_push_fa( sink, "#<sc_t>* #<sc_t>;", type, name );
            }
            else
            {
                bcore_sink_a_push_fa( sink, "vd_t #<sc_t>;", name );
            }
        }
        break;

        case BCORE_CAPS_ARRAY_DYN_SOLID_STATIC:
        {
            bcore_sink_a_push_fa( sink, "BCORE_ARRAY_DYN_SOLID_STATIC_S( #<sc_t>, #<sc_t>#<sc_t>);", type, name, name[ 0 ] ? "_ " : "" );
        }
        break;

        case BCORE_CAPS_ARRAY_DYN_SOLID_TYPED:
        {
            if( o->type )
            {
                bcore_sink_a_push_fa( sink, "BCORE_ARRAY_DYN_SOLID_TYPED_VIRTUAL_S( #<sc_t>, #<sc_t>#<sc_t>);", type, name, name[ 0 ] ? "_ " : "" );
            }
            else
            {
                bcore_sink_a_push_fa( sink, "BCORE_ARRAY_DYN_SOLID_TYPED_S( #<sc_t>#<sc_t>);", name, name[ 0 ] ? "_ " : "" );
            }
        }
        break;

        case BCORE_CAPS_ARRAY_DYN_LINK_STATIC:
        {
            bcore_sink_a_push_fa( sink, "BCORE_ARRAY_DYN_LINK_STATIC_S( #<sc_t>, #<sc_t>#<sc_t>);", type, name, name[ 0 ] ? "_ " : "" );
        }
        break;

        case BCORE_CAPS_ARRAY_DYN_LINK_TYPED:
        {
            if( o->type )
            {
                bcore_sink_a_push_fa( sink, "BCORE_ARRAY_DYN_LINK_TYPED_VITUAL_S( #<sc_t>, #<sc_t>#<sc_t>);", type, name, name[ 0 ] ? "_ " : "" );
            }
            else
            {
                bcore_sink_a_push_fa( sink, "BCORE_ARRAY_DYN_LINK_TYPED_S( #<sc_t>#<sc_t>);", name, name[ 0 ] ? "_ " : "" );
            }
        }
        break;

        case BCORE_CAPS_ARRAY_DYN_LINK_AWARE:
        {
            if( o->type )
            {
                /// We can represent a virtual type via BCORE_ARRAY_DYN_LINK_STATIC
                bcore_sink_a_push_fa( sink, "BCORE_ARRAY_DYN_LINK_STATIC_S( #<sc_t>, #<sc_t>#<sc_t>);", type, name, name[ 0 ] ? "_ " : "" );
            }
            else
            {
                bcore_sink_a_push_fa( sink, "BCORE_ARRAY_DYN_LINK_AWARE_S( #<sc_t>#<sc_t>);", name, name[ 0 ] ? "_ " : "" );
            }
        }
        break;

        case BCORE_CAPS_ARRAY_FIX_SOLID_STATIC:
        {
            bcore_sink_a_push_fa( sink, "#<sc_t> #<sc_t>[ #<sz_t> ];", type, name, o->default_sz );
        }
        break;

        case BCORE_CAPS_ARRAY_FIX_LINK_STATIC:
        {
            bcore_sink_a_push_fa( sink, "#<sc_t>* #<sc_t>[ #<sz_t> ];", type, name, o->default_sz );
        }
        break;

        case BCORE_CAPS_ARRAY_FIX_LINK_AWARE:
        {
            if( o->type )
            {
                bcore_sink_a_push_fa( sink, "#<sc_t>* #<sc_t>[ #<sz_t> ];", type, name, o->default_sz );
            }
            else
            {
                bcore_sink_a_push_fa( sink, "vd_t #<sc_t>[ #<sz_t> ];", name, o->default_sz );
            }
        }
        break;

        case BCORE_CAPS_EXTERNAL_FUNC:
        {
            /* nothing to do */
            ret = false;
        }
        break;

        default:
        {
            ERR_fa( "Unhandled capsulation '#<u2_t>", o->caps );
        }
        break;
    }

    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0xa0a30
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xa0a30
movq %rax, -0x20(%rbp)
movb $0x1, -0x21(%rbp)
movq -0x8(%rbp), %rax
movl 0x10(%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x30(%rbp)
subl $0xd, %eax
ja 0xa4842
movq -0x30(%rbp), %rax
leaq 0xa92bc(%rip), %rcx     # 0x14d774
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq 0x8fbca(%rip), %rsi     # 0x13409e
movb $0x0, %al
callq 0xf0e20
jmp 0xa486b
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq 0xa93e3(%rip), %rsi     # 0x14d8d6
movb $0x0, %al
callq 0xf0e20
jmp 0xa486b
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0xa4525
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq 0xa93cc(%rip), %rsi     # 0x14d8e8
movb $0x0, %al
callq 0xf0e20
jmp 0xa453b
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0xa93e4(%rip), %rsi     # 0x14d918
movb $0x0, %al
callq 0xf0e20
jmp 0xa486b
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0xa4566
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq 0xa9379(%rip), %rsi     # 0x14d8d6
movb $0x0, %al
callq 0xf0e20
jmp 0xa457c
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0xa93c2(%rip), %rsi     # 0x14d937
movb $0x0, %al
callq 0xf0e20
jmp 0xa486b
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0xa45a7
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq 0xa9338(%rip), %rsi     # 0x14d8d6
movb $0x0, %al
callq 0xf0e20
jmp 0xa45bd
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0xa9381(%rip), %rsi     # 0x14d937
movb $0x0, %al
callq 0xf0e20
jmp 0xa486b
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x20(%rbp), %rax
movsbl (%rax), %esi
leaq 0xae446(%rip), %r8      # 0x152a22
leaq 0xa939c(%rip), %rax     # 0x14d97f
cmpl $0x0, %esi
cmovneq %rax, %r8
leaq 0xa9354(%rip), %rsi     # 0x14d945
movb $0x0, %al
callq 0xf0e20
jmp 0xa486b
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0xa463f
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x20(%rbp), %rax
movsbl (%rax), %esi
leaq 0xae401(%rip), %r8      # 0x152a22
leaq 0xa9357(%rip), %rax     # 0x14d97f
cmpl $0x0, %esi
cmovneq %rax, %r8
leaq 0xa934c(%rip), %rsi     # 0x14d982
movb $0x0, %al
callq 0xf0e20
jmp 0xa4671
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rdx
movq -0x20(%rbp), %rax
movsbl (%rax), %esi
leaq 0xae3cd(%rip), %rcx     # 0x152a22
leaq 0xa9323(%rip), %rax     # 0x14d97f
cmpl $0x0, %esi
cmovneq %rax, %rcx
leaq 0xa9359(%rip), %rsi     # 0x14d9c3
movb $0x0, %al
callq 0xf0e20
jmp 0xa486b
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x20(%rbp), %rax
movsbl (%rax), %esi
leaq 0xae392(%rip), %r8      # 0x152a22
leaq 0xa92e8(%rip), %rax     # 0x14d97f
cmpl $0x0, %esi
cmovneq %rax, %r8
leaq 0xa934e(%rip), %rsi     # 0x14d9f3
movb $0x0, %al
callq 0xf0e20
jmp 0xa486b
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0xa46f3
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x20(%rbp), %rax
movsbl (%rax), %esi
leaq 0xae34d(%rip), %r8      # 0x152a22
leaq 0xa92a3(%rip), %rax     # 0x14d97f
cmpl $0x0, %esi
cmovneq %rax, %r8
leaq 0xa9342(%rip), %rsi     # 0x14da2c
movb $0x0, %al
callq 0xf0e20
jmp 0xa4725
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rdx
movq -0x20(%rbp), %rax
movsbl (%rax), %esi
leaq 0xae319(%rip), %rcx     # 0x152a22
leaq 0xa926f(%rip), %rax     # 0x14d97f
cmpl $0x0, %esi
cmovneq %rax, %rcx
leaq 0xa934d(%rip), %rsi     # 0x14da6b
movb $0x0, %al
callq 0xf0e20
jmp 0xa486b
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0xa476c
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x20(%rbp), %rax
movsbl (%rax), %esi
leaq 0xae2d4(%rip), %r8      # 0x152a22
leaq 0xa922a(%rip), %rax     # 0x14d97f
cmpl $0x0, %esi
cmovneq %rax, %r8
leaq 0xa9290(%rip), %rsi     # 0x14d9f3
movb $0x0, %al
callq 0xf0e20
jmp 0xa479e
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rdx
movq -0x20(%rbp), %rax
movsbl (%rax), %esi
leaq 0xae2a0(%rip), %rcx     # 0x152a22
leaq 0xa91f6(%rip), %rax     # 0x14d97f
cmpl $0x0, %esi
cmovneq %rax, %rcx
leaq 0xa9303(%rip), %rsi     # 0x14da9a
movb $0x0, %al
callq 0xf0e20
jmp 0xa486b
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %r8
leaq 0xa930b(%rip), %rsi     # 0x14dac9
movb $0x0, %al
callq 0xf0e20
jmp 0xa486b
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %r8
leaq 0xa9300(%rip), %rsi     # 0x14dae5
movb $0x0, %al
callq 0xf0e20
jmp 0xa486b
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0xa481c
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %r8
leaq 0xa92d2(%rip), %rsi     # 0x14dae5
movb $0x0, %al
callq 0xf0e20
jmp 0xa483a
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rcx
leaq 0xa92cf(%rip), %rsi     # 0x14db02
movb $0x0, %al
callq 0xf0e20
jmp 0xa486b
movb $0x0, -0x21(%rbp)
jmp 0xa486b
movq -0x8(%rbp), %rax
movl 0x10(%rax), %r8d
leaq 0xa92ca(%rip), %rdi     # 0x14db1b
leaq 0xa8f6a(%rip), %rsi     # 0x14d7c2
movl $0x485, %edx            # imm = 0x485
leaq 0xa92d8(%rip), %rcx     # 0x14db3c
movb $0x0, %al
callq 0x9d0f0
movb -0x21(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)