// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/xoico/src/xoico.xo.c
// Function: xoico_target_s_set_dependencies
er_t xoico_target_s_set_dependencies( xoico_target_s* o, const bcore_arr_sz_s* dependencies )
{
    // xoico_target.x:215:1
    BLM_INIT_LEVEL(0);
    sz_t targets = o->compiler->size;
    
    /// sort, remove duplicates, copy
    bcore_arr_sz_s* dst =&( o->dependencies);
    bcore_arr_sz_s_set_size(dst,0 );
    bcore_arr_sz_s* src = bcore_arr_sz_s_sort(((bcore_arr_sz_s*)BLM_LEVEL_T_PUSH(0,bcore_arr_sz_s,bcore_arr_sz_s_clone(dependencies))),1 );
    for(sz_t i = 0; i < src->size; i++ )
    {
        if( i == 0 || src->data[ i ] != src->data[ i - 1 ] )
        {
            sz_t idx = src->data[ i ];
            ASSERT( idx >= 0 && idx < targets );
            bcore_arr_sz_s_push(dst,idx );
        }
    }
    
    if( xoico_target_s_is_cyclic(o) )
    {
        BLM_RETURNV(er_t, bcore_error_push_fa(((tp_t)(TYPEOF_general_error)), "Cyclic dependencies found in target '#<sc_t>'.", o->name.sc ))
    }
    
    BLM_RETURNV(er_t, 0)
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
leaq 0x194276(%rip), %rax    # 0x1b2330
movq (%rax), %rax
movq %rax, -0x20(%rbp)
leaq -0x50(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xbfe80
movq -0x58(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x10(%rbp), %rax
movq 0x138(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
addq $0xd8, %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8ec70
movq -0x20(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x18(%rbp), %rdi
callq 0x8ead0
movq -0x98(%rbp), %rdi
movq %rax, %rcx
xorl %eax, %eax
movl %eax, %esi
movabsq $0x3d19b4fc81c235e4, %rdx # imm = 0x3D19B4FC81C235E4
callq 0xc01a0
movq %rax, %rdi
movl $0x1, %esi
callq 0x8f200
movq %rax, -0x70(%rbp)
movq $0x0, -0x78(%rbp)
movq -0x78(%rbp), %rax
movq -0x70(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x1e20f
cmpq $0x0, -0x78(%rbp)
je 0x1e1a1
movq -0x70(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x78(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x70(%rbp), %rcx
movq 0x8(%rcx), %rcx
movq -0x78(%rbp), %rdx
subq $0x1, %rdx
cmpq (%rcx,%rdx,8), %rax
je 0x1e1fc
movq -0x70(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x78(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x80(%rbp)
cmpq $0x0, -0x80(%rbp)
jl 0x1e1c6
movq -0x80(%rbp), %rax
cmpq -0x60(%rbp), %rax
jl 0x1e1ef
leaq 0x1157d2(%rip), %rdi    # 0x13399f
leaq 0x1174df(%rip), %rsi    # 0x1356b3
leaq 0x1174f2(%rip), %rdx    # 0x1356cd
leaq 0x115406(%rip), %rcx    # 0x1335e8
movl $0x1442, %r8d           # imm = 0x1442
movb $0x0, %al
callq 0x9cea0
movq -0x68(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x8ee00
jmp 0x1e1fe
movq -0x78(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x78(%rbp)
jmp 0x1e162
movq -0x10(%rbp), %rdi
callq 0x1dff0
testb $0x1, %al
jne 0x1e21e
jmp 0x1e25b
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdx
movabsq $0x4d9e984c5b21faea, %rdi # imm = 0x4D9E984C5B21FAEA
leaq 0x1174b6(%rip), %rsi    # 0x1356ed
movb $0x0, %al
callq 0x9e090
movq %rax, -0x88(%rbp)
movq -0x58(%rbp), %rdi
callq 0xc0720
movq -0x88(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1e27a
movq $0x0, -0x90(%rbp)
movq -0x58(%rbp), %rdi
callq 0xc0720
movq -0x90(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
nopw (%rax,%rax)