// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_flect.c
// Function: bcore_self_s_parse_src
bcore_self_s* bcore_self_s_parse_src( sr_s src, uz_t size_of, uz_t align_of, sc_t namespace, bl_t advanced_checks )
{
    bcore_life_s* l = bcore_life_s_create();
    src = bcore_life_s_push_sr( l, sr_cp( src, TYPEOF_bcore_source_s ) );
    bcore_self_s* o = bcore_self_s_create();

    st_s* identifier = st_s_create_l( l );

    if( bcore_source_r_parse_bl_fa( &src, " #?':'" ) )
    {
        ASSERT( namespace );
        st_s* name = st_s_create();
        bcore_source_r_parse_fa( &src, " #name", name );
        st_s_copy_fa( identifier, "#<sc_t>_#<sc_t>", namespace, name->sc );
        st_s_discard( name );
    }
    else
    {
        bcore_source_r_parse_fa( &src, " #name", identifier );
    }

    o->type = ( identifier->size > 0 ) ? entypeof( identifier->sc ) : 0;
    if( o->type ) bcore_source_r_parse_fa( &src, " =" );

    bl_t aware = bcore_source_r_parse_bl_fa( &src, " #?w'aware'" );

    bcore_source_r_parse_fa( &src, " #name", identifier );
    tp_t type2 = ( identifier->size > 0 ) ? entypeof( identifier->sc ) : 0;

    bcore_source_r_parse_fa( &src, " #name", identifier );
    tp_t type3 = ( identifier->size > 0 ) ? entypeof( identifier->sc ) : 0;

    if( aware || bcore_source_r_parse_bl_fa( &src, " #=?'{'" ) )
    {
        o->trait  = type2 ? type2 : typeof( "bcore_inst" );
        o->parent = type3;
        o->body = bcore_self_body_s_create();
        bcore_self_body_s_parse_src( o->body, src, o, aware, advanced_checks );

        if( !o->type )
        {
            o->type = bcore_self_body_s_fold_tp( o->body, bcore_tp_init() );
        }
    }
    else
    {
        if( !o->type ) bcore_source_r_parse_errf( &src, "Anonymous types need a body." );
        const bcore_self_s* self_l = bcore_flect_try_self( type2 );
        if( !self_l ) bcore_source_r_parse_errf( &src, "Type %s not defined.", ifnameof( type2 ) );
        o->trait = self_l->trait;
        o->parent = self_l->parent;
        o->body = bcore_self_body_s_clone( self_l->body );
        o->size = self_l->size;
    }

    o->size = size_of;
    o->align = align_of;
    bcore_life_s_discard( l );
    return o;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %ecx, 0x2c(%rsp)
movq %rdx, %r14
movq %rsi, 0x48(%rsp)
movq %rdi, 0x40(%rsp)
leaq 0xd0(%rsp), %r13
movabsq $-0x7e8ee9b9b4bbaa8, %r12 # imm = 0xF817116464B44558
xorl %eax, %eax
callq 0x717ac
movq %rax, %rbp
movq (%r13), %rbx
movq 0x8(%r13), %rdi
movq 0x10(%r13), %r15
movq %r12, %rsi
callq 0x7abc8
movq %rbx, 0x68(%rsp)
movq %rax, 0x70(%rsp)
movq %r15, 0x78(%rsp)
movq %r15, 0x10(%rsp)
movups 0x68(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r13, %rdi
movq %rbp, %rsi
callq 0x719e2
callq 0x63846
movq %rax, %r12
movq %rbp, 0x38(%rsp)
movq %rbp, %rdi
callq 0x8edb8
movq %rax, %rbx
leaq 0x4710a(%rip), %rsi     # 0xaaf7d
movq %r13, %rdi
callq 0x62eae
testb %al, %al
je 0x63eed
testq %r14, %r14
jne 0x63ead
leaq 0x467bc(%rip), %rdi     # 0xaa647
leaq 0x60e7e(%rip), %rsi     # 0xc4d10
leaq 0x5dad8(%rip), %rdx     # 0xc1971
leaq 0x5d51e(%rip), %rcx     # 0xc13be
movl $0x6fc, %r8d            # imm = 0x6FC
xorl %eax, %eax
callq 0x5ffac
xorl %eax, %eax
callq 0x8eb65
movq %rax, %r15
leaq 0x5e269(%rip), %rsi     # 0xc2127
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x89816
movq 0x8(%r15), %rcx
leaq 0x46ea6(%rip), %rsi     # 0xaad7c
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x8e7af
movq %r15, %rdi
callq 0x8edd4
jmp 0x63f01
leaq 0x5e233(%rip), %rsi     # 0xc2127
movq %r13, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x89816
cmpq $0x0, 0x10(%rbx)
je 0x63f3a
movq 0x8(%rbx), %rdi
callq 0x7227a
movq %r12, %rcx
addq $0x8, %rcx
movq %rcx, 0x20(%rsp)
movq %rax, 0x8(%r12)
testq %rax, %rax
je 0x63f4c
leaq 0x4810d(%rip), %rsi     # 0xac03b
movq %r13, %rdi
xorl %eax, %eax
callq 0x89816
jmp 0x63f4c
movq %r12, %rax
addq $0x8, %rax
movq %rax, 0x20(%rsp)
andq $0x0, 0x8(%r12)
leaq 0x46253(%rip), %rsi     # 0xaa1a6
movq %r13, %rdi
callq 0x62eae
movl %eax, %r14d
leaq 0x5e1c2(%rip), %rsi     # 0xc2127
xorl %ebp, %ebp
movq %r13, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x89816
cmpq $0x0, 0x10(%rbx)
je 0x63f87
movq 0x8(%rbx), %rdi
callq 0x7227a
movq %rax, %rbp
leaq 0x5e199(%rip), %rsi     # 0xc2127
xorl %r15d, %r15d
movq %r13, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x89816
cmpq $0x0, 0x10(%rbx)
je 0x63fb1
movq 0x8(%rbx), %rdi
callq 0x7227a
movq %rax, %r15
testb %r14b, %r14b
jne 0x63fcd
leaq 0x4660e(%rip), %rsi     # 0xaa5cb
movq %r13, %rdi
callq 0x62eae
testb %al, %al
je 0x6417f
movb %r14b, 0x1f(%rsp)
testq %rbp, %rbp
jne 0x63fe6
leaq 0x5dec7(%rip), %rdi     # 0xc1ea5
callq 0x64246
movq %rax, %rbp
movq %rbp, 0x10(%r12)
movq %r15, 0x18(%r12)
callq 0x63218
movq %rax, %rbx
movq %rax, 0x30(%r12)
movups (%r13), %xmm0
leaq 0x50(%rsp), %r15
movaps %xmm0, (%r15)
movq 0x10(%r13), %rax
movq %rax, 0x10(%r15)
xorl %eax, %eax
callq 0x717ac
movq %rax, %r14
movq (%r15), %r13
movq 0x8(%r15), %rdi
movq 0x10(%r15), %rbp
movabsq $-0x7e8ee9b9b4bbaa8, %rsi # imm = 0xF817116464B44558
callq 0x7abc8
movq %r13, 0x80(%rsp)
movq %rax, 0x88(%rsp)
movq %rbp, 0x90(%rsp)
movq %rbp, 0x10(%rsp)
movups 0x80(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r15, %rdi
movq %r14, 0x30(%rsp)
movq %r14, %rsi
callq 0x719e2
movq %rbx, %rdi
callq 0x63276
cmpb $0x0, 0x1f(%rsp)
je 0x640b7
callq 0x61245
movq %rax, %r14
movabsq $-0x388c46b188de83fe, %rax # imm = 0xC773B94E77217C02
movq %rax, (%r14)
leaq 0x49ad9(%rip), %rdi     # 0xadb74
callq 0x64246
movq %rax, 0x8(%r14)
movl $0x1, 0x10(%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x632b3
leaq 0x5eb31(%rip), %rsi     # 0xc2bef
leaq 0x50(%rsp), %rdi
callq 0x62eae
testb %al, %al
je 0x641e5
leaq 0x50(%rsp), %rbp
movzbl 0x2c(%rsp), %r13d
movq %rbp, %rdi
leaq 0x5eb12(%rip), %rsi     # 0xc2bf7
callq 0x62eae
testb %al, %al
jne 0x641e5
movq %rbp, %rdi
leaq 0x5eb03(%rip), %rsi     # 0xc2bff
callq 0x62eae
testb %al, %al
jne 0x641e1
callq 0x61245
movq %rax, %r15
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x50(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r15, %rdi
movq %r12, %rsi
movl %r13d, %edx
callq 0x615ad
testq %rax, %rax
je 0x64143
callq 0x609b0
xorl %eax, %eax
callq 0x5f9af
movq (%r15), %r14
leaq 0x5eabb(%rip), %rdi     # 0xc2c08
callq 0x64246
cmpq %rax, %r14
jne 0x6416f
cmpq $0x0, 0x8(%rbx)
je 0x6416f
movq %rbp, %rdi
leaq 0x5eaa8(%rip), %rsi     # 0xc2c10
xorl %eax, %eax
callq 0x89a41
movq %rbx, %rdi
movq %r15, %rsi
callq 0x632b3
jmp 0x640db
movq 0x20(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x6419b
leaq 0x5d7f7(%rip), %rsi     # 0xc1988
movq %r13, %rdi
xorl %eax, %eax
callq 0x8998c
movq %rbp, %rdi
callq 0x64b33
movq %rax, %rbx
testq %rax, %rax
jne 0x641c7
movq %rbp, %rdi
callq 0x6133a
leaq 0x5d7eb(%rip), %rsi     # 0xc19a5
movq %r13, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8998c
movups 0x10(%rbx), %xmm0
movups %xmm0, 0x10(%r12)
movq 0x30(%rbx), %rdi
callq 0x63248
movq %rax, 0x30(%r12)
jmp 0x64213
movb $0x0, 0x18(%rbx)
movq 0x30(%rsp), %rdi
callq 0x717c7
movq 0x20(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x64213
movq 0x30(%r12), %rdi
movabsq $-0x340d631b7bdddcdb, %rsi # imm = 0xCBF29CE484222325
callq 0x63400
movq %rax, 0x8(%r12)
movq 0x40(%rsp), %rax
movq %rax, 0x20(%r12)
movq 0x48(%rsp), %rax
movq %rax, 0x28(%r12)
movq 0x38(%rsp), %rdi
callq 0x717c7
movq %r12, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq