// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/xoico/src/xoico.xo.c
// Function: xoico_source_s_parse
er_t xoico_source_s_parse( xoico_source_s* o, const xoico_host* host, x_source* source, sc_t group_name, sc_t trait_name, tp_t embed_method )
{
    // xoico_source.x:227:1
    BLM_INIT_LEVEL(0);
    xoico_compiler_s* compiler = o->target->compiler;
    
    if( embed_method == TYPEOF_as_header )
    {
        while( !x_source_eos(source) )
        {
            if( x_source_parse_bl(source," #?w'XOILA_DEFINE_GROUP'" ) )
            {BLM_INIT_LEVEL(3);
                st_s st_trait_name;BLM_T_INIT_SPUSH(st_s, &st_trait_name);;
                st_s st_group_name;BLM_T_INIT_SPUSH(st_s, &st_group_name);;
                BLM_TRY(x_source_parse_fa(source," ( #name , #name", (&(st_group_name)), (&(st_trait_name)) ))
                xoico_group_s* group = NULL;
                BLM_TRY(xoico_source_s_get_group_if_preexsting(o,host, source, st_group_name.sc, st_trait_name.sc, (&(group)) ))
                if( !group )
                {
                    group = xoico_source_s_push_d(o,xoico_group_s_create() );
                    group->xoico_source = o;
                    group->compiler = compiler;
                    xoico_group_s_set_name_sc(group,host, st_group_name.sc );
                    group->trait_name = xoico_compiler_s_entypeof(compiler,st_trait_name.sc );
                }
    
                if( x_source_parse_bl(source," #=?','" ) )
                {
                    while( x_source_parse_bl(source," #?','" ) )
                    {BLM_INIT_LEVEL(5);
                        st_s* embed_file = ((st_s*)BLM_LEVEL_T_PUSH(5,st_s,st_s_create()));
                        BLM_TRY(x_source_parse_fa(source," #string", embed_file ))
                        x_source* embed_source = NULL;
                        BLM_TRY(xoico_embed_file_open(source, embed_file->sc, (&(embed_source)) ))
                        ((x_source*)BLM_LEVEL_A_PUSH(0,embed_source));
                        bcore_arr_st_s_push_st(&(group->explicit_embeddings),embed_file );
                        BLM_TRY(xoico_group_s_parse(group,((const xoico_host*)(o)), false, embed_source ))
                    BLM_DOWN();}
                    BLM_TRY(x_source_parse_fa(source," )" ))
                }
                else
                {
                    BLM_TRY(x_source_parse_fa(source," )" ))
                    BLM_TRY(xoico_group_s_parse(group,((const xoico_host*)(o)), false, source ))
                }
                BLM_TRY(xoico_compiler_s_register_group(o->target->compiler,group ))
            BLM_DOWN();}
            else
            {
                x_source_get_u0(source);
            }
        }
    }
    else
    {
        xoico_group_s* group = NULL;
    
        BLM_TRY(xoico_source_s_get_group_if_preexsting(o,host, source, group_name, trait_name, (&(group)) ))
        if( group )
        {
            if( group->xoico_source != o )
            {BLM_INIT_LEVEL(3);
                bcore_arr_st_s_push_st(&(group->explicit_embeddings),((st_s*)BLM_LEVEL_T_PUSH(3,st_s,st_s_create_fa("#<sc_t>.#<sc_t>", o->name.sc, o->ext.sc ))) );
            BLM_DOWN();}
        }
        else
        {
            group = xoico_source_s_push_d(o,xoico_group_s_create() );
            group->xoico_source = o;
            group->compiler = compiler;
            xoico_group_s_set_name_sc(group,host, group_name );
            group->trait_name = xoico_compiler_s_entypeof(compiler,trait_name );
            group->is_manifesto = true;
        }
    
        if( embed_method == TYPEOF_as_group )
        {
            BLM_TRY(xoico_group_s_parse(group,((const xoico_host*)(o)), false, source ))
        }
        else
        {
            BLM_TRY(xoico_group_s_parse_embed(group,((const xoico_host*)(o)), source, embed_method ))
        }
    
        BLM_TRY(xoico_compiler_s_register_group(compiler,group ))
    }
    
    BLM_RETURNV(er_t, 0)
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %r9, %rbp
movq %r8, %rbx
movq %rcx, %r13
movq %rdx, %r14
movq %rsi, 0x38(%rsp)
movq %rdi, %r12
leaq 0xfdf5e(%rip), %rax     # 0x117dd0
movq (%rax), %rsi
leaq 0x68(%rsp), %r15
movq %r15, %rdi
callq 0x717f5
andq $0x0, 0x10(%r15)
movq 0x90(%r12), %rax
movq 0x138(%rax), %r15
movabsq $-0x9b90fe183067569, %rax # imm = 0xF646F01E7CF98A97
movq %rbp, 0x10(%rsp)
cmpq %rax, %rbp
movq %r12, 0x18(%rsp)
movq %r15, 0x30(%rsp)
jne 0x1a1a0
leaq 0x140(%r15), %rax
movq %rax, 0x10(%rsp)
leaq 0x9245c(%rip), %rbx     # 0xac327
leaq 0xe8(%rsp), %rbp
movq %r12, %r15
movq %r14, %rdi
callq 0xe626
testb %al, %al
jne 0x1a345
movq %r14, %rdi
movq %rbx, %rsi
callq 0xe5ff
testb %al, %al
je 0x1a10c
movq %rbp, 0x8(%rsp)
movq %rbp, %rdi
leaq 0x68(%rsp), %rsi
callq 0x717f5
movq 0x8(%rsp), %rbx
movq $0x3, 0x10(%rbx)
leaq 0x48(%rsp), %rbp
movq %rbp, %rdi
callq 0x8e048
movq %rbx, %rdi
movabsq $-0x503db0e6e1c2e704, %r12 # imm = 0xAFC24F191E3D18FC
movq %r12, %rsi
movq %rbp, %rdx
callq 0x71998
leaq 0x98(%rsp), %r13
movq %r13, %rdi
callq 0x8e048
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x71998
movq %r14, %rdi
leaq 0x923db(%rip), %rsi     # 0xac340
movq %r13, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0xd600
testq %rax, %rax
jne 0x1a278
andq $0x0, 0x28(%rsp)
movq 0xa0(%rsp), %rcx
movq 0x50(%rsp), %r8
movq %r15, %rdi
movq 0x38(%rsp), %r13
movq %r13, %rsi
movq %r14, %rdx
leaq 0x28(%rsp), %r9
callq 0x162d3
testq %rax, %rax
jne 0x1a278
movq 0x28(%rsp), %rbp
testq %rbp, %rbp
jne 0x1a00d
callq 0x13814
movq %r15, %rdi
movq %rax, %rsi
callq 0xf6dd
movq %rax, %rbp
movq %rax, 0x28(%rsp)
movq %r15, 0x138(%rax)
movq 0x30(%rsp), %rax
movq %rax, 0x140(%rbp)
movq 0xa0(%rsp), %rdx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x1384f
movq 0x50(%rsp), %rsi
movq 0x10(%rsp), %rdi
callq 0x6f48c
movq %rax, 0xb0(%rbp)
movq %r14, %rdi
leaq 0x9233a(%rip), %rsi     # 0xac351
callq 0xe5ff
testb %al, %al
je 0x1a119
leaq 0x68(%rbp), %r13
movq %r14, %rdi
leaq 0x92327(%rip), %rsi     # 0xac359
callq 0xe5ff
testb %al, %al
je 0x1a14d
movq 0x8(%rsp), %rsi
leaq 0xb8(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x717f5
movq 0x20(%rsp), %rbx
movq $0x5, 0x10(%rbx)
xorl %eax, %eax
callq 0x8eb65
movq %rbx, %rdi
pushq $0x5
popq %rsi
movabsq $-0x503db0e6e1c2e704, %rdx # imm = 0xAFC24F191E3D18FC
movq %rax, %rcx
callq 0x71967
movq %rax, %r15
movq %r14, %rdi
leaq 0x911cc(%rip), %rsi     # 0xab25b
movq %rax, %rdx
xorl %eax, %eax
callq 0xd600
testq %rax, %rax
jne 0x1a26b
andq $0x0, 0x40(%rsp)
movq 0x8(%r15), %rsi
movq %r14, %rdi
leaq 0x40(%rsp), %rdx
callq 0xd6c1
testq %rax, %rax
jne 0x1a26b
movq 0x40(%rsp), %r12
movq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x71a90
movq %r13, %rdi
movq %r15, %rsi
callq 0x5c504
movq %rbp, %rdi
movq 0x18(%rsp), %r15
movq %r15, %rsi
xorl %edx, %edx
movq %r12, %rcx
callq 0x14352
testq %rax, %rax
jne 0x1a26b
leaq 0x20(%rsp), %rdi
callq 0x71b48
jmp 0x1a028
movq %r14, %rdi
callq 0x104d1
jmp 0x19ed6
movq %r14, %rdi
leaq 0xaedc3(%rip), %rsi     # 0xc8ee6
xorl %eax, %eax
callq 0xd600
testq %rax, %rax
jne 0x1a278
movq %rbp, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %r14, %rcx
callq 0x14352
testq %rax, %rax
je 0x1a16c
jmp 0x1a278
movq %r14, %rdi
leaq 0xaed8f(%rip), %rsi     # 0xc8ee6
xorl %eax, %eax
callq 0xd600
testq %rax, %rax
jne 0x1a278
movq 0x28(%rsp), %rbp
movq 0x90(%r15), %rax
movq 0x138(%rax), %rdi
movq %rbp, %rsi
callq 0x163e4
leaq 0x8(%rsp), %rdi
callq 0x71b48
leaq 0x92194(%rip), %rbx     # 0xac327
leaq 0xe8(%rsp), %rbp
jmp 0x19ed6
leaq 0xb8(%rsp), %r9
andq $0x0, (%r9)
movq %r12, %rdi
movq 0x38(%rsp), %rbp
movq %rbp, %rsi
movq %r14, %rdx
movq %r13, %rcx
movq %rbx, %r8
callq 0x162d3
testq %rax, %rax
jne 0x1a316
movq %r13, %r15
movq %rbp, %r13
movq 0xb8(%rsp), %rbp
testq %rbp, %rbp
je 0x1a285
movq 0x18(%rsp), %r12
cmpq %r12, 0x138(%rbp)
je 0x1a2dc
movq %rbp, %rbx
leaq 0xe8(%rsp), %rbp
leaq 0x48(%rsp), %r15
movq %rbp, (%r15)
leaq 0x68(%rsp), %rsi
movq %rbp, %rdi
callq 0x717f5
movq $0x3, 0x10(%rbp)
leaq 0x68(%rbx), %r13
movq 0x30(%r12), %rsi
movq 0x50(%r12), %rdx
leaq 0x92e14(%rip), %rdi     # 0xad048
xorl %eax, %eax
callq 0x8ec7d
pushq $0x3
popq %rsi
movabsq $-0x503db0e6e1c2e704, %rdx # imm = 0xAFC24F191E3D18FC
movq %rbp, %rdi
movq %rbx, %rbp
movq %rax, %rcx
callq 0x71967
movq %r13, %rdi
movq %rax, %rsi
callq 0x5c504
movq %r15, %rdi
callq 0x71b48
jmp 0x1a2dc
movq %rax, %r12
movq 0x20(%rsp), %rdi
jmp 0x1a31e
movq %rax, %r12
movq 0x8(%rsp), %rdi
jmp 0x1a31e
callq 0x13814
movq 0x18(%rsp), %r12
movq %r12, %rdi
movq %rax, %rsi
callq 0xf6dd
movq %rax, %rbp
movq %r12, 0x138(%rax)
movq 0x30(%rsp), %r12
movq %r12, 0x140(%rax)
movq %rax, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x1384f
leaq 0x140(%r12), %rdi
movq %rbx, %rsi
callq 0x6f48c
movq %rax, 0xb0(%rbp)
movb $0x1, 0xc9(%rbp)
movq 0x10(%rsp), %rcx
movabsq $0x56176620137ff69, %rax # imm = 0x56176620137FF69
movq %rbp, %rdi
cmpq %rax, %rcx
jne 0x1a304
movq 0x18(%rsp), %rsi
xorl %edx, %edx
movq %r14, %rcx
callq 0x14352
jmp 0x1a311
movq 0x18(%rsp), %rsi
movq %r14, %rdx
callq 0x1642e
testq %rax, %rax
je 0x1a338
movq %rax, %r12
leaq 0x68(%rsp), %rdi
callq 0x71b64
movq %r12, %rax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x30(%rsp), %rdi
movq %rbp, %rsi
callq 0x163e4
leaq 0x68(%rsp), %rdi
callq 0x71b64
xorl %r12d, %r12d
jmp 0x1a323