// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/xoico/src/xoico.xo.c
// Function: xoico_compiler_s_parse
er_t xoico_compiler_s_parse( xoico_compiler_s* o, sc_t target_name, sc_t target_ext, const st_s* target_output_folder, sc_t source_path, sc_t group_name, sc_t trait_name, tp_t embed_method, sz_t* p_target_index )
{
    // xoico_compiler.x:464:1
    BLM_INIT_LEVEL(0);
    const st_s* source_folder = ((st_s*)BLM_LEVEL_T_PUSH(0,st_s,bcore_file_folder_path(source_path )));
    const st_s* output_folder = target_output_folder ? target_output_folder : source_folder;
    st_s* target_output_path = ((st_s*)BLM_LEVEL_T_PUSH(0,st_s,st_s_create_fa("#<sc_t>/#<sc_t>.#<sc_t>", output_folder->sc, target_name, target_ext )));
    
    sz_t target_index = -1;
    for(sz_t i = 0; i < o->size; i++ )
    {
        if( sc_t_equal( target_name, o->data[ i ]->name.sc ) )
        {
            target_index = i;
            break;
        }
    }
    
    if( target_index == -1 )
    {
        xoico_target_s* target = xoico_target_s_create();
        target->compiler = o;
        st_s_copy_sc(&(target->name        ),target_name );
        st_s_copy_sc(&(target->ext         ),target_ext );
        st_s_copy_fa(&(target->include_path),"#<sc_t>.#<sc_t>", target_name, target_ext );
        st_s_copy(&(target->output_path),target_output_path );
        xoico_compiler_s_push_d(o,target );
        target_index = o->size - 1;
    }
    
    xoico_target_s* target = o->data[ target_index ];
    
    /// check paths and extensions
    if( !st_s_equal_sc(&(target->ext),target_ext ) )
    {
        ERR_fa( "Target '#<sc_t>': Assigned extension '#<sc_t>' differs from requested extension '#<sc_t>'.", target->name.sc, target->ext.sc, target_ext );
    }
    if( !st_s_equal_st(&(target->output_path),target_output_path ) )
    {
        ERR_fa( "Target '#<sc_t>': Assigned output path '#<sc_t>' differs from requested output path '#<sc_t>'.", target->name.sc, target->output_path.sc, target_output_path->sc );
    }
    
    BLM_TRY(xoico_target_s_parse_from_path(target,source_path, group_name, trait_name, embed_method ))
    if( p_target_index ) (*(p_target_index)) = target_index;
    
    BLM_RETURNV(er_t, 0)
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r9, 0x20(%rsp)
movq %r8, %r14
movq %rcx, %rbx
movq %rdx, 0x10(%rsp)
movq %rsi, %r12
movq %rdi, %rbp
leaq 0xfb93a(%rip), %rax     # 0x117dd0
movq (%rax), %rsi
leaq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0x717f5
andq $0x0, 0x10(%r15)
movq %r14, 0x18(%rsp)
movq %r14, %rdi
callq 0x60c15
xorl %r13d, %r13d
movabsq $-0x503db0e6e1c2e704, %r14 # imm = 0xAFC24F191E3D18FC
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rdx
movq %rax, %rcx
callq 0x71967
testq %rbx, %rbx
cmovneq %rbx, %rax
movq 0x8(%rax), %rsi
leaq 0x90b59(%rip), %rdi     # 0xad040
movq %r12, %rdx
movq 0x10(%rsp), %rbx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x8ec7d
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rdx
movq %rbx, %r14
movq %rax, %rcx
callq 0x71967
movq %rax, %r15
cmpq 0x10(%rbp), %r13
jae 0x1c532
movq 0x8(%rbp), %rax
movq (%rax,%r13,8), %rax
movq 0x10(%rax), %rsi
movq %r12, %rdi
callq 0x16421
testb %al, %al
jne 0x1c58f
incq %r13
jmp 0x1c50f
callq 0x1a393
movq %rax, %rbx
movq %rbp, 0x138(%rax)
leaq 0x8(%rax), %rdi
movq %r12, %rsi
callq 0x8e611
leaq 0x28(%rbx), %rdi
movq %r14, %rsi
callq 0x8e611
leaq 0x58(%rbx), %rdi
leaq 0x90ae4(%rip), %rsi     # 0xad048
movq %r12, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x8e7af
leaq 0x78(%rbx), %rdi
movq %r15, %rsi
callq 0x8e4fd
movq %rbp, %rdi
movq %rbx, %rsi
callq 0xf6dd
movq 0x10(%rbp), %r13
decq %r13
movq 0x8(%rbp), %rax
movq (%rax,%r13,8), %r12
leaq 0x28(%r12), %rdi
movq %r14, %rsi
callq 0x19c6c
testb %al, %al
jne 0x1c5d7
movq 0x10(%r12), %r8
movq 0x30(%r12), %r9
movq %r14, (%rsp)
leaq 0x90a9b(%rip), %rdi     # 0xad058
leaq 0x8dccc(%rip), %rsi     # 0xaa290
leaq 0x90aa4(%rip), %rcx     # 0xad06f
movl $0x17f2, %edx           # imm = 0x17F2
xorl %eax, %eax
callq 0x60186
leaq 0x78(%r12), %rdi
movq %r15, %rsi
callq 0x1ad30
testb %al, %al
jne 0x1c61e
movq 0x10(%r12), %r8
movq 0x80(%r12), %r9
movq 0x8(%r15), %rax
movq %rax, (%rsp)
leaq 0x90a54(%rip), %rdi     # 0xad058
leaq 0x8dc85(%rip), %rsi     # 0xaa290
leaq 0x90ab8(%rip), %rcx     # 0xad0ca
movl $0x17f6, %edx           # imm = 0x17F6
xorl %eax, %eax
callq 0x60186
movq %r12, %rdi
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x90(%rsp), %rcx
movq 0x98(%rsp), %r8
callq 0x1a4c9
movq %rax, %rbx
testq %rax, %rax
setne %al
movq 0xa0(%rsp), %rdx
testq %rdx, %rdx
sete %cl
orb %al, %cl
jne 0x1c65e
movq %r13, (%rdx)
leaq 0x28(%rsp), %rdi
callq 0x71b64
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq