// File: /workspace/github_c_makefile_star2_O1/johsteffens[P]beth/lib/bcore/bcore_spect_array.c
// Function: set_fix_link_aware
static void set_fix_link_aware( const bcore_array_s* p, vd_t o, uz_t index, sr_s src )
{
    if( index >= p->size_fix ) ERR_fa( "Index '#<uz_t>' exceeds range of fixed-size-array of size '#<uz_t>'", index, p->size_fix );
    vd_t* arr = obj_vd( p, o );
    vd_t* dst = &arr[ index ];
    if( *dst ) bcore_inst_a_discard( *dst );
    *dst = NULL;

    if( src.o )
    {
        const bcore_inst_s* inst_p = sr_s_get_spect( TYPEOF_bcore_inst_s, &src );
        if( inst_p->aware )
        {
            *dst = sr_s_is_strong( &src ) ? src.o : bcore_inst_p_clone( inst_p, src.o );
           src = sr_cw( src );
        }
        else
        {
            ERR( "Cannot convert '%s' to self-aware object", ifnameof( sr_s_type( &src ) ) );
        }
    }

    sr_down( src );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x18(%rdi), %r9
cmpq %rdx, %r9
ja 0xfca6e
leaq 0x577ee(%rip), %rdi     # 0x15423f
leaq 0x57128(%rip), %rsi     # 0x153b80
leaq 0x57788(%rip), %rcx     # 0x1541e7
movl $0x32d, %edx            # imm = 0x32D
movq %rbx, %r8
xorl %eax, %eax
callq 0xc825d
leaq 0x40(%rsp), %rbp
addq 0x20(%r15), %r14
movq (%r14,%rbx,8), %r15
testq %r15, %r15
je 0xfcb25
movq (%r15), %r12
leaq 0xac9da(%rip), %rax     # 0x1a9468
movl (%rax), %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x20(%rax,%rcx,8), %rdx
movq 0x18(%rax,%rcx,8), %rcx
andq %r12, %rcx
shlq $0x4, %rcx
leaq (%rdx,%rcx), %rax
movq (%rdx,%rcx), %rdx
movl $0x8, %ecx
cmpq %r12, %rdx
je 0xfcae8
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r12, %rdx
je 0xfcae8
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r12, %rdx
je 0xfcae8
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r12, %rdx
jne 0xfcbfb
movq (%rax,%rcx), %r13
testq %r13, %r13
jne 0xfcb18
movabsq $0x782b96602f424981, %rdi # imm = 0x782B96602F424981
movq %r12, %rsi
callq 0xf3f85
movq %rax, %r13
leaq 0xac95b(%rip), %rdi     # 0x1a9468
movq %r12, %rsi
movq %rax, %rdx
callq 0x12128c
movq %r13, %rdi
movq %r15, %rsi
callq *0xb8(%r13)
movq $0x0, (%r14,%rbx,8)
movq (%rbp), %r15
testq %r15, %r15
je 0xfcbd3
movq 0x8(%rbp), %r12
testq %r12, %r12
je 0xfcb62
movabsq $0x782b96602f424981, %rdi # imm = 0x782B96602F424981
movq %r12, %rax
cmpq %rdi, (%r12)
je 0xfcb64
movq 0x8(%r12), %rsi
callq 0xf3f85
jmp 0xfcb64
xorl %eax, %eax
cmpb $0x1, 0x28(%rax)
jne 0xfcb91
movq 0x10(%rbp), %r12
testb $0x2, %r12b
jne 0xfcb83
movq %rax, %rdi
movq %r15, %rsi
callq *0xc0(%rax)
movq %rax, %r15
movq %r15, (%r14,%rbx,8)
andq $-0x3, %r12
movq %r12, 0x10(%rbp)
jmp 0xfcbd3
testq %r12, %r12
je 0xfcb9d
movq 0x8(%r12), %rdi
jmp 0xfcb9f
xorl %edi, %edi
callq 0xe0cbc
testq %rax, %rax
leaq 0x56b41(%rip), %r8      # 0x1536ef
cmovneq %rax, %r8
leaq 0x57686(%rip), %rdi     # 0x15423f
leaq 0x56fc0(%rip), %rsi     # 0x153b80
leaq 0x575e2(%rip), %rcx     # 0x1541a9
movl $0x33d, %edx            # imm = 0x33D
xorl %eax, %eax
callq 0xc80f6
testb $0x2, 0x10(%rbp)
jne 0xfcbe8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x112485
xorl %r13d, %r13d
jmp 0xfcaec