// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/xoico/src/xoico.xo.c
// Function: xoico_builder_target_s_load
er_t xoico_builder_target_s_load( xoico_builder_target_s* o, bl_t readonly, sc_t path )
{
    // xoico_builder.x:198:1
    BLM_INIT_LEVEL(0);
    st_s* st_path = ((st_s*)BLM_LEVEL_T_PUSH(0,st_s,st_s_create()));
    st_s_copy_sc(st_path,path );
    
    if( st_path->sc[ 0 ] != '/' )
    {
        st_s* current_folder = ((st_s*)BLM_LEVEL_T_PUSH(0,st_s,st_s_create()));
        bcore_folder_get_current( current_folder );
        st_path = ((st_s*)BLM_LEVEL_T_PUSH(0,st_s,st_s_create_fa("#<sc_t>/#<sc_t>", current_folder->sc, st_path->sc )));
    }
    
    st_path = ((st_s*)BLM_LEVEL_T_PUSH(0,st_s,bcore_file_path_minimized(st_path->sc )));
    
    BLM_TRY(x_btcl_from_file(((x_btcl*)(o)),st_path->sc ))
    st_s_copy(&(o->full_path_),st_path );
    if( readonly ) o->readonly = true;
    
    if( !o->name ) BLM_RETURNV(er_t, bcore_error_push_fa(((tp_t)(TYPEOF_general_error)), "In target file: '#<sc_t>'\nTarget name must be specified.", st_path->sc ))
    
    /// check for dependency cycles
    if( o->parent_ )
    {
        const xoico_builder_target_s* match = xoico_builder_target_s_name_match(o->parent_,o->name->sc );
        if( match )
        {
            if( st_s_equal_st(&(match->full_path_),&(o->full_path_ )) )
            {
                BLM_RETURNV(er_t, bcore_error_push_fa(((tp_t)(TYPEOF_general_error)), "In target file: '#<sc_t>'\nCyclic dependency detected.", st_path->sc ))
            }
            else
            {
                BLM_RETURNV(er_t, bcore_error_push_fa(((tp_t)(TYPEOF_general_error)), "Same target name '#<sc_t>' used in different target files:\n#<sc_t>\n#<sc_t>", o->name->sc, st_path->sc, match->full_path_.sc ))
            }
        }
    }
    
    {const bcore_arr_st_s* __a=&(o->dependencies );if(__a)for(sz_t __i=0;__i<__a->size;__i++){st_s* e=__a->data[__i];
    {BLM_INIT_LEVEL(4);
        if( !o->dependencies_target_ ) o->dependencies_target_ = xoico_builder_arr_target_s_create();
    
        st_s* file_path = ((st_s*)BLM_LEVEL_T_PUSH(4,st_s,st_s_create()));
        if( e->sc[ 0 ] != '/' )
        {
            if( o->root_folder ) st_s_push_fa(file_path,"#<sc_t>/", o->root_folder->sc );
        }
    
        bl_t dep_readonly = o->readonly;
    
        x_source* source = ((x_source*)BLM_LEVEL_A_PUSH(4,x_source_create_from_sc(e->sc )));
        BLM_TRY(x_source_parse_fa(source," #:until':'", file_path ))
    
        /// remove trailing spaces
        while( file_path->sc[ 0 ] == ' ' || file_path->sc[ 0 ] == '\t' ) st_s_pop_char(file_path);
    
        if( x_source_parse_bl(source,"#?':'" ) )
        {
            if( x_source_parse_bl(source," #?w'readonly'" ) )
            {
                dep_readonly = true;
            }
            else
            {
                BLM_RETURNV(er_t, x_source_parse_error_fa(source,"Syntax error in dependency declaration." ))
            }
        }
    
        xoico_builder_target_s* target = ((xoico_builder_target_s*)(x_array_push_d(((x_array*)(o->dependencies_target_)),((x_inst*)(xoico_builder_target_s_create() )))));
        target->parent_ = o;
    
        BLM_TRY(xoico_builder_target_s_load(target,dep_readonly, file_path->sc ))
    BLM_DOWN();}
    
    }}BLM_RETURNV(er_t, 0)
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdx, %r15
movl %esi, 0x4(%rsp)
movq %rdi, %rbx
movabsq $-0x503db0e6e1c2e704, %r13 # imm = 0xAFC24F191E3D18FC
leaq 0xf0b28(%rip), %rbp     # 0x117dd0
movq (%rbp), %rsi
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x717f5
andq $0x0, 0x10(%r14)
xorl %eax, %eax
callq 0x8eb65
movq %r14, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %rax, %rcx
callq 0x71967
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
callq 0x8e611
movq 0x8(%r14), %rdi
cmpb $0x2f, (%rdi)
je 0x2733e
xorl %eax, %eax
callq 0x8eb65
leaq 0x8(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %rax, %rcx
callq 0x71967
movq %rax, %r12
movq %rax, %rdi
callq 0x65fd0
movq 0x8(%r12), %rsi
movq 0x8(%r14), %rdx
leaq 0x82d55(%rip), %rdi     # 0xaa078
xorl %eax, %eax
callq 0x8ec7d
movq %r15, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %rax, %rcx
callq 0x71967
movq 0x8(%rax), %rdi
callq 0x60ca2
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %rax, %rcx
callq 0x71967
movq %rax, %r12
movq 0x8(%rax), %r15
movq (%rbx), %r14
movq (%rbp), %rsi
leaq 0x38(%rsp), %r13
movq %r13, %rdi
callq 0x717f5
andq $0x0, 0x10(%r13)
movq %r15, %rdi
callq 0x2e24a
movq %r13, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x71a90
movq %rbp, %rcx
movq %rax, %rbp
movq (%rcx), %rsi
leaq 0x68(%rsp), %r15
movq %r15, %rdi
callq 0x717f5
andq $0x0, 0x10(%r15)
xorl %eax, %eax
callq 0x39919
movabsq $0x56270522f5daaafb, %rdx # imm = 0x56270522F5DAAAFB
movq %r15, %rdi
xorl %esi, %esi
movq %rax, %rcx
callq 0x71967
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq %rbp, %rcx
movq %r15, %rbp
callq 0x39954
movq %rax, %r14
movq %r15, %rdi
callq 0x71b64
movq %r13, %rdi
callq 0x71b64
testq %r14, %r14
jne 0x275e7
leaq 0xb8(%rbx), %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x8e4fd
cmpb $0x0, 0x4(%rsp)
je 0x27410
movb $0x1, 0x20(%rbx)
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x275c7
movq 0xa0(%rbx), %rdi
testq %rdi, %rdi
je 0x27462
movq 0x8(%rax), %rsi
callq 0x270fc
testq %rax, %rax
je 0x27462
movq %rax, %r13
leaq 0xb8(%rax), %rdi
movq %r14, %rsi
callq 0x1ad30
testb %al, %al
je 0x27606
movq 0x8(%r12), %rdx
leaq 0x877fa(%rip), %rsi     # 0xaec57
jmp 0x275d3
xorl %r13d, %r13d
cmpq 0x48(%rbx), %r13
jae 0x27634
movq 0x40(%rbx), %rax
movq (%rax,%r13,8), %r15
movq %rbp, 0x38(%rsp)
movq %rbp, %rdi
leaq 0x8(%rsp), %rsi
callq 0x717f5
movq 0x38(%rsp), %r14
movq $0x4, 0x10(%r14)
cmpq $0x0, 0xb0(%rbx)
jne 0x274ac
callq 0x26fd7
movq %rax, 0xb0(%rbx)
xorl %eax, %eax
callq 0x8eb65
movq %r14, %rdi
pushq $0x4
popq %rsi
movabsq $-0x503db0e6e1c2e704, %rdx # imm = 0xAFC24F191E3D18FC
movq %rax, %rcx
callq 0x71967
movq %rax, %r12
movq 0x8(%r15), %rdi
cmpb $0x2f, (%rdi)
je 0x274f9
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x274f9
movq 0x8(%rax), %rdx
movq %r12, %rdi
leaq 0x877ea(%rip), %rsi     # 0xaecd8
xorl %eax, %eax
callq 0x8f4ef
movq 0x8(%r15), %rdi
movb 0x20(%rbx), %r15b
callq 0x76c9e
movq %r14, %rdi
pushq $0x4
popq %rsi
movq %rax, %rdx
callq 0x71a90
movq %rax, %rbp
movq %rax, %rdi
leaq 0x877c4(%rip), %rsi     # 0xaece1
movq %r12, %rdx
xorl %eax, %eax
callq 0xd600
testq %rax, %rax
je 0x27539
jmp 0x27654
movq %r12, %rdi
callq 0x8f1bd
movq 0x8(%r12), %rax
movzbl (%rax), %eax
cmpl $0x20, %eax
je 0x27531
cmpl $0x9, %eax
je 0x27531
movq %rbp, %rdi
leaq 0x83a29(%rip), %rsi     # 0xaaf7e
callq 0xe5ff
testb %al, %al
je 0x27578
movq %rbp, %rdi
leaq 0x87785(%rip), %rsi     # 0xaeced
callq 0xe5ff
movb $0x1, %r15b
testb %al, %al
je 0x27643
movq 0xb0(%rbx), %r14
callq 0x27051
movq %r14, %rdi
movq %rax, %rsi
callq 0xf6dd
movq %rbx, 0xa0(%rax)
movq 0x8(%r12), %rdx
movzbl %r15b, %esi
movq %rax, %rdi
callq 0x2727c
testq %rax, %rax
jne 0x27654
leaq 0x38(%rsp), %rdi
callq 0x71b48
incq %r13
leaq 0x68(%rsp), %rbp
jmp 0x27465
movq 0x8(%r12), %rdx
leaq 0x8764b(%rip), %rsi     # 0xaec1e
movabsq $0x4d9e984c5b21faea, %rdi # imm = 0x4D9E984C5B21FAEA
xorl %eax, %eax
callq 0x605f4
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x71b64
movq %r14, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rdx
movq 0x8(%r12), %rcx
movq 0xc0(%r13), %r8
leaq 0x8766c(%rip), %rsi     # 0xaec8d
movabsq $0x4d9e984c5b21faea, %rdi # imm = 0x4D9E984C5B21FAEA
xorl %eax, %eax
callq 0x605f4
jmp 0x275e4
leaq 0x8(%rsp), %rdi
callq 0x71b64
xorl %r14d, %r14d
jmp 0x275f1
leaq 0x876b2(%rip), %rsi     # 0xaecfc
movq %rbp, %rdi
xorl %eax, %eax
callq 0xd7c4
movq %rax, %r14
movq 0x38(%rsp), %rdi
jmp 0x275ec