// File: /workspace/github_c_makefile_star2_O3/johsteffens[P]beth/xoico/src/xoico.xo.c
// Function: xoico_target_s_parse_from_path
er_t xoico_target_s_parse_from_path( xoico_target_s* o, sc_t source_path, sc_t group_name, sc_t trait_name, tp_t embed_method )
{
    // xoico_target.x:120:1
    BLM_INIT_LEVEL(0);
    bl_t source_exists = false;
    
    {const xoico_target_s* __a=o ;if(__a)for(sz_t __i=0;__i<__a->size;__i++){xoico_source_s* e=__a->data[__i];
    {
        if( sc_t_equal( e->full_path.sc, source_path ) )
        {
            source_exists = true;
            break;
        }
    }
    
    }}if( !source_exists )
    {BLM_INIT_LEVEL(1);
        xoico_source_s* xsource = ((xoico_source_s*)BLM_LEVEL_T_PUSH(0,xoico_source_s,xoico_source_s_create()));
        xsource->target = o;
    
        sc_t file_extension = bcore_file_extension(source_path );
    
        st_s_copy_sc(&(xsource->full_path),source_path );
        st_s_copy_sc(&(xsource->name),((st_s*)BLM_LEVEL_T_PUSH(1,st_s,bcore_file_strip_extension(bcore_file_name(source_path ) )))->sc );
        st_s_copy_sc(&(xsource->ext),file_extension );
    
        if( bcore_file_exists(source_path ) )
        {
            BLM_TRY(xoico_source_s_parse(xsource,((const xoico_host*)(o)),((x_source*)( ((bcore_source*)BLM_LEVEL_A_PUSH(0,bcore_file_open_source(source_path ))))), group_name, trait_name, embed_method ))
        }
        else
        {
            BLM_RETURNV(er_t, bcore_error_push_fa(((tp_t)(TYPEOF_general_error)), "Could not open '#<sc_t>'.", source_path ))
        }
    
        xoico_target_s_push_d(o,((xoico_source_s*)bcore_fork(xsource)) );
    BLM_DOWN();}
    
    BLM_RETURNV(er_t, 0)
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %rbp
movq %rsi, %r13
movq %rdi, %rbx
leaq 0x16e756(%rip), %rax    # 0x19bdd0
movq (%rax), %rsi
leaq 0x58(%rsp), %r14
movq %r14, %rdi
callq 0xd6675
movq $0x0, 0x10(%r14)
testq %rbx, %rbx
je 0x2d6cf
cmpq $0x0, 0xa0(%rbx)
je 0x2d6cf
xorl %r14d, %r14d
movq 0x98(%rbx), %rax
movq (%rax,%r14,8), %rax
movq 0x10(%rax), %rdi
movq %r13, %rsi
callq 0xdfa34
testl %eax, %eax
je 0x2d7e8
incq %r14
cmpq 0xa0(%rbx), %r14
jb 0x2d6a4
movq %rbp, 0x8(%rsp)
movq %r12, 0x10(%rsp)
movq %r15, 0x18(%rsp)
leaq 0x28(%rsp), %r14
movq %r14, 0x20(%rsp)
leaq 0x58(%rsp), %rsi
movq %r14, %rdi
callq 0xd6675
movq $0x1, 0x10(%r14)
callq 0x2bbc1
movabsq $0x11bbcc12ff458d9d, %rdx # imm = 0x11BBCC12FF458D9D
movq %r14, %rdi
xorl %esi, %esi
movq %rax, %rcx
callq 0xd68a8
movq %rax, %rbp
movq %rbx, 0x90(%rax)
movq %r13, %rdi
callq 0xbf476
movq %rax, %r15
leaq 0x8(%rbp), %rdi
movq %r13, %rsi
callq 0x109612
leaq 0x28(%rbp), %r12
movq %r13, %rdi
callq 0xbf4cf
movq %rax, %rdi
callq 0xbf518
movabsq $-0x503db0e6e1c2e704, %rdx # imm = 0xAFC24F191E3D18FC
movl $0x1, %esi
movq %r14, %rdi
movq %rax, %rcx
callq 0xd68a8
movq 0x8(%rax), %rsi
movq %r12, %rdi
callq 0x109612
leaq 0x48(%rbp), %rdi
movq %r15, %rsi
callq 0x109612
movq %r13, %rdi
callq 0xbf581
testb %al, %al
je 0x2d7f7
movq %r13, %rdi
callq 0xbf75a
leaq 0x28(%rsp), %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0xd6b17
movq %rbp, %rdi
movq %rbx, %rsi
movq %rax, %rdx
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %r8
movq 0x18(%rsp), %r9
callq 0x2c8dc
movq %rax, %r14
testq %rax, %rax
jne 0x2d815
movq %rbp, %rdi
callq 0xbe7e4
movq (%rbx), %rsi
movq %rbx, %rdi
movq %rax, %rdx
callq 0x55b79
leaq 0x20(%rsp), %rdi
callq 0xd6d0d
leaq 0x58(%rsp), %rdi
callq 0xd6d2c
xorl %r14d, %r14d
jmp 0x2d81f
leaq 0x101b88(%rip), %rsi    # 0x12f386
movabsq $0x4d9e984c5b21faea, %rdi # imm = 0x4D9E984C5B21FAEA
movq %r13, %rdx
xorl %eax, %eax
callq 0xbec3c
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0xd6d2c
movq %r14, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq