// File: /workspace/github_c_makefile_star2_O1/johsteffens[P]beth/lib/bcore/bcore_spect_array.c
// Function: bcore_array_default_make_strong
void bcore_array_default_make_strong( const bcore_array_s* p, bcore_array* o )
{
    if( p->size_fix > 0 ) return;
    vd_t obj = ( u0_t* )o + p->caps_offset;
    if( ( ( bcore_array_dyn_head_s* )obj )->size <= ( ( bcore_array_dyn_head_s* )obj )->space ) return;
    switch( p->type_caps )
    {
        case BCORE_CAPS_ARRAY_DYN_SOLID_STATIC:
        {
            bcore_array_dyn_solid_static_s* arr = obj;
            const bcore_inst_s* instance_p = p->item_p;
            uz_t unit_size = instance_p->size;
            vc_t src_data = arr->data;
            arr->data = bcore_u_alloc( unit_size, NULL, arr->size, &arr->space );
            if( instance_p->move_flat )
            {
                bcore_u_memcpy( unit_size, arr->data, src_data, arr->size );
            }
            else
            {
                vd_t dst_data = arr->data;
                for( uz_t i = 0; i < arr->size; i++ )
                {
                    instance_p->copy( instance_p, dst_data, src_data );
                    dst_data = ( u0_t* )dst_data + unit_size;
                    src_data = ( u0_t* )src_data + unit_size;
                }
            }
        }
        break;

        case BCORE_CAPS_ARRAY_DYN_SOLID_TYPED:
        {
            bcore_array_dyn_solid_typed_s* arr = obj;
            if( !arr->type ) ERR( "attempt to take ownership of type-zero array" );
            const bcore_inst_s* instance_p = bcore_inst_s_get_typed( arr->type );
            uz_t unit_size = instance_p->size;
            vc_t src_data = arr->data;
            arr->data = bcore_u_alloc( unit_size, NULL, arr->size, &arr->space );
            if( instance_p->move_flat )
            {
                bcore_u_memcpy( unit_size, arr->data, src_data, arr->size );
            }
            else
            {
                vd_t dst_data = arr->data;
                for( uz_t i = 0; i < arr->size; i++ )
                {
                    instance_p->copy( instance_p, dst_data, src_data );
                    dst_data = ( u0_t* )dst_data + unit_size;
                    src_data = ( u0_t* )src_data + unit_size;
                }
            }
        }
        break;

        case BCORE_CAPS_ARRAY_DYN_LINK_STATIC:
        {
            bcore_array_dyn_link_static_s* arr = obj;
            const bcore_inst_s* instance_p = p->item_p;
            vd_t* src_data = arr->data;
            arr->data = bcore_u_alloc( sizeof( vd_t ), NULL, arr->size, &arr->space );
            vd_t* dst_data = arr->data;
            for( uz_t i = 0; i < arr->size; i++ ) *dst_data++ = instance_p->clone( instance_p, *src_data++ );
        }
        break;

        case BCORE_CAPS_ARRAY_DYN_LINK_TYPED:
        {
            bcore_array_dyn_link_typed_s* arr = obj;
            if( !arr->type ) ERR( "attempt to take ownership of type-zero array" );
            const bcore_inst_s* instance_p = bcore_inst_s_get_typed( arr->type );
            vd_t* src_data = arr->data;
            arr->data = bcore_u_alloc( sizeof( vd_t ), NULL, arr->size, &arr->space );
            vd_t* dst_data = arr->data;
            for( uz_t i = 0; i < arr->size; i++ ) *dst_data++ = instance_p->clone( instance_p, *src_data++ );
        }
        break;

        case BCORE_CAPS_ARRAY_DYN_LINK_AWARE:
        {
            bcore_array_dyn_link_aware_s* arr = obj;
            vd_t* src_data = arr->data;
            arr->data = bcore_u_alloc( sizeof( vd_t ), NULL, arr->size, &arr->space );
            vd_t* dst_data = arr->data;
            for( uz_t i = 0; i < arr->size; i++ ) *dst_data++ = bcore_inst_a_clone( *src_data++ );
        }
        break;

        default: ERR( "invalid type_caps (%"PRIu32")", ( u2_t )p->type_caps );
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpq $0x0, 0x18(%rdi)
jne 0xf633a
movq 0x20(%rdi), %rax
movq 0x8(%rsi,%rax), %rdx
cmpq 0x10(%rsi,%rax), %rdx
jbe 0xf633a
movq 0x10(%rdi), %r8
leaq -0x6(%r8), %rcx
cmpq $0x4, %rcx
ja 0xf62ba
leaq (%rsi,%rax), %rbp
leaq (%rsi,%rax), %rbx
addq $0x10, %rbx
leaq 0x5da92(%rip), %rax     # 0x1539a8
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x28(%rdi), %r12
movq 0x18(%r12), %r15
movq (%rbp), %r14
movq %r15, %rdi
xorl %esi, %esi
movq %rbx, %rcx
callq 0xc8339
movq %rax, %rbx
movq %rax, (%rbp)
movq 0x8(%rbp), %rcx
cmpb $0x0, 0x2c(%r12)
je 0xf62e9
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
jmp 0xf62a7
movq (%rbp), %rax
movq %rax, 0x10(%rsp)
movl $0x8, %edi
xorl %esi, %esi
movq %rbx, %rcx
callq 0xc8339
movq %rax, 0x8(%rsp)
movq %rax, (%rbp)
cmpq $0x0, 0x8(%rbp)
je 0xf633a
xorl %r14d, %r14d
leaq 0xb34d4(%rip), %r15     # 0x1a9468
movq 0x10(%rsp), %rax
movq (%rax,%r14,8), %r12
testq %r12, %r12
je 0xf6040
movq %rbp, %rbx
movq (%r12), %r13
movl (%r15), %eax
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%r15,%rax,8), %rcx
movq 0x18(%r15,%rax,8), %rdx
andq %r13, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r13, %rdx
je 0xf6003
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r13, %rdx
je 0xf6003
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r13, %rdx
je 0xf6003
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r13, %rdx
jne 0xf605d
movq (%rax,%rcx), %rbp
testq %rbp, %rbp
jne 0xf602f
movabsq $0x782b96602f424981, %rdi # imm = 0x782B96602F424981
movq %r13, %rsi
callq 0xf3f85
movq %rax, %rbp
movq %r15, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x12128c
movq %rbp, %rdi
movq %r12, %rsi
callq *0xc0(%rbp)
movq %rbx, %rbp
jmp 0xf6042
xorl %eax, %eax
movq 0x8(%rsp), %rcx
movq %rax, (%rcx,%r14,8)
incq %r14
cmpq 0x8(%rbp), %r14
jb 0xf5f94
jmp 0xf633a
xorl %ebp, %ebp
jmp 0xf6007
movq 0x28(%rdi), %r14
movq (%rbp), %r15
movl $0x8, %edi
xorl %esi, %esi
movq %rbx, %rcx
callq 0xc8339
movq %rax, (%rbp)
cmpq $0x0, 0x8(%rbp)
je 0xf633a
movq %rax, %rbx
xorl %r12d, %r12d
movq (%r15,%r12,8), %rsi
movq %r14, %rdi
callq *0xc0(%r14)
movq %rax, (%rbx,%r12,8)
incq %r12
cmpq 0x8(%rbp), %r12
jb 0xf608d
jmp 0xf633a
cmpq $0x0, 0x18(%rbp)
jne 0xf60d5
leaq 0x5daa5(%rip), %rdi     # 0x153b60
leaq 0x5dabe(%rip), %rsi     # 0x153b80
leaq 0x5dacb(%rip), %rcx     # 0x153b94
movl $0xa9, %edx
xorl %eax, %eax
callq 0xc80f6
movq 0x18(%rbp), %r14
leaq 0xb3388(%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 %r14, %rcx
shlq $0x4, %rcx
leaq (%rdx,%rcx), %rax
movq (%rdx,%rcx), %rdx
movl $0x8, %ecx
cmpq %r14, %rdx
je 0xf613a
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r14, %rdx
je 0xf613a
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r14, %rdx
je 0xf613a
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r14, %rdx
jne 0xf6349
movq (%rax,%rcx), %r15
testq %r15, %r15
jne 0xf616a
movabsq $0x782b96602f424981, %rdi # imm = 0x782B96602F424981
movq %r14, %rsi
callq 0xf3f85
movq %rax, %r15
leaq 0xb3309(%rip), %rdi     # 0x1a9468
movq %r14, %rsi
movq %rax, %rdx
callq 0x12128c
movq (%rbp), %r14
movq 0x8(%rbp), %rdx
movl $0x8, %edi
xorl %esi, %esi
movq %rbx, %rcx
callq 0xc8339
movq %rax, (%rbp)
cmpq $0x0, 0x8(%rbp)
je 0xf633a
movq %rax, %rbx
xorl %r12d, %r12d
movq (%r14,%r12,8), %rsi
movq %r15, %rdi
callq *0xc0(%r15)
movq %rax, (%rbx,%r12,8)
incq %r12
cmpq 0x8(%rbp), %r12
jb 0xf6196
jmp 0xf633a
cmpq $0x0, 0x18(%rbp)
jne 0xf61de
leaq 0x5d99c(%rip), %rdi     # 0x153b60
leaq 0x5d9b5(%rip), %rsi     # 0x153b80
leaq 0x5d9c2(%rip), %rcx     # 0x153b94
movl $0x85, %edx
xorl %eax, %eax
callq 0xc80f6
movq 0x18(%rbp), %r15
leaq 0xb327f(%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 %r15, %rcx
shlq $0x4, %rcx
leaq (%rdx,%rcx), %rax
movq (%rdx,%rcx), %rdx
movl $0x8, %ecx
cmpq %r15, %rdx
je 0xf6243
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r15, %rdx
je 0xf6243
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r15, %rdx
je 0xf6243
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r15, %rdx
jne 0xf6351
movq (%rax,%rcx), %r14
testq %r14, %r14
jne 0xf6273
movabsq $0x782b96602f424981, %rdi # imm = 0x782B96602F424981
movq %r15, %rsi
callq 0xf3f85
movq %rax, %r14
leaq 0xb3200(%rip), %rdi     # 0x1a9468
movq %r15, %rsi
movq %rax, %rdx
callq 0x12128c
movq 0x18(%r14), %r12
movq (%rbp), %r15
movq 0x8(%rbp), %rdx
movq %r12, %rdi
xorl %esi, %esi
movq %rbx, %rcx
callq 0xc8339
movq %rax, %rbx
movq %rax, (%rbp)
movq 0x8(%rbp), %rcx
cmpb $0x0, 0x2c(%r14)
je 0xf6313
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xc842f
leaq 0x5d89f(%rip), %rdi     # 0x153b60
leaq 0x5d8b8(%rip), %rsi     # 0x153b80
leaq 0x5d8f2(%rip), %rcx     # 0x153bc1
movl $0xbc, %edx
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xc80f6
testq %rcx, %rcx
je 0xf633a
xorl %r13d, %r13d
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *0x90(%r12)
addq %r15, %rbx
addq %r15, %r14
incq %r13
cmpq 0x8(%rbp), %r13
jb 0xf62f1
jmp 0xf633a
testq %rcx, %rcx
je 0xf633a
xorl %r13d, %r13d
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq *0x90(%r14)
addq %r12, %rbx
addq %r12, %r15
incq %r13
cmpq 0x8(%rbp), %r13
jb 0xf631b
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r15d, %r15d
jmp 0xf613e
xorl %r14d, %r14d
jmp 0xf6247