// File: /workspace/github_c_makefile_star2_O3/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 0xf2459
leaq 0x56e2b(%rip), %rdi     # 0x149267
leaq 0x56765(%rip), %rsi     # 0x148ba8
leaq 0x56dc5(%rip), %rcx     # 0x14920f
movl $0x32d, %edx            # imm = 0x32D
movq %rbx, %r8
xorl %eax, %eax
callq 0xbe6f9
leaq 0x40(%rsp), %rbp
addq 0x20(%r15), %r14
movq (%r14,%rbx,8), %r15
testq %r15, %r15
je 0xf250c
movq (%r15), %r12
leaq 0xa9fef(%rip), %rax     # 0x19c468
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 0xf24cf
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r12, %rdx
je 0xf24cf
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r12, %rdx
je 0xf24cf
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r12, %rdx
jne 0xf24d8
movq (%rax,%rcx), %r13
testq %r13, %r13
jne 0xf24ff
movabsq $0x782b96602f424981, %rdi # imm = 0x782B96602F424981
movq %r12, %rsi
callq 0xe9bc5
movq %rax, %r13
leaq 0xa9f74(%rip), %rdi     # 0x19c468
movq %r12, %rsi
movq %rax, %rdx
callq 0x115fac
movq %r13, %rdi
movq %r15, %rsi
callq *0xb8(%r13)
movq $0x0, (%r14,%rbx,8)
movq (%rbp), %r15
testq %r15, %r15
je 0xf25be
movq 0x8(%rbp), %r12
testq %r12, %r12
je 0xf255a
movabsq $0x782b96602f424981, %rax # imm = 0x782B96602F424981
movq %r12, %rdi
cmpq %rax, (%r12)
je 0xf254d
movq 0x8(%r12), %rsi
movq %rax, %rdi
callq 0xe9bc5
movq %rax, %rdi
cmpb $0x0, 0x28(%rdi)
jne 0xf2566
movq 0x8(%r12), %rdi
jmp 0xf258a
xorl %edi, %edi
cmpb $0x1, 0x28
jne 0xf258a
movq 0x10(%rbp), %r12
testb $0x2, %r12b
jne 0xf257c
movq %r15, %rsi
callq *0xc0(%rdi)
movq %rax, %r15
movq %r15, (%r14,%rbx,8)
andq $-0x3, %r12
movq %r12, 0x10(%rbp)
jmp 0xf25be
callq 0xd6ec4
testq %rax, %rax
leaq 0x5617c(%rip), %r8      # 0x148715
cmovneq %rax, %r8
leaq 0x56cc3(%rip), %rdi     # 0x149267
leaq 0x565fd(%rip), %rsi     # 0x148ba8
leaq 0x56c1f(%rip), %rcx     # 0x1491d1
movl $0x33d, %edx            # imm = 0x33D
xorl %eax, %eax
callq 0xbe592
testb $0x2, 0x10(%rbp)
jne 0xf25d3
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 0x107590