// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_spect_array.c
// Function: bcore_array_default_set_gtype
void bcore_array_default_set_gtype( const bcore_array_s* p, bcore_array* o, tp_t type )
{
    vd_t obj = obj_vd( p, o );
    switch( p->type_caps )
    {
        case BCORE_CAPS_ARRAY_DYN_SOLID_STATIC:
        {
            if( p->item_p->header.o_type == type ) break;
            ERR( "cannot change type on static-array" );
        }
        break;

        case BCORE_CAPS_ARRAY_DYN_SOLID_TYPED:
        {
            bcore_array_dyn_solid_typed_s* arr = obj;
            if( arr->type == type ) break;
            if( arr->size > 0 ) ERR( "array size (%zu) must be zero for a type change", arr->size );
            arr->type = type;
        }
        break;

        case BCORE_CAPS_ARRAY_DYN_LINK_STATIC:
        {
            if( p->item_p->header.o_type == type ) break;
            ERR( "cannot change type on static-link-array" );
        }
        break;

        case BCORE_CAPS_ARRAY_DYN_LINK_TYPED:
        {
            bcore_array_dyn_link_typed_s* arr = obj;
            if( arr->type == type ) break;
            if( arr->size > 0 ) ERR( "array size (%zu) must be zero for a type change", arr->size );
            arr->type = type;
        }
        break;

        case BCORE_CAPS_ARRAY_DYN_LINK_AWARE:
        {
            bcore_array_dyn_link_aware_s* arr = obj;
            if( arr->size > 0 ) ERR( "cannot change type on aware-link-array of non-zero size" );
        }
        break;

        case BCORE_CAPS_ARRAY_FIX_SOLID_STATIC:
        case BCORE_CAPS_ARRAY_FIX_LINK_STATIC:
        case BCORE_CAPS_ARRAY_FIX_LINK_AWARE:
        {
            ERR( "cannot change type on fixed-size-array" );
        }
        break;

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

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x10(%rdi), %r8
leaq -0x6(%r8), %rax
cmpq $0x7, %rax
ja 0x7c72d
movq %rdx, %rbx
movq %rsi, %r14
movq 0x20(%rdi), %r15
leaq 0x4a33f(%rip), %rcx     # 0xc6954
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x4a706(%rip), %rdi     # 0xc6d2b
leaq 0x4a444(%rip), %rsi     # 0xc6a70
leaq 0x4a7c9(%rip), %rcx     # 0xc6dfc
movl $0x4f8, %edx            # imm = 0x4F8
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x60031
cmpq $0x0, 0x8(%r14,%r15)
je 0x7c727
leaq 0x4a6d4(%rip), %rdi     # 0xc6d2b
leaq 0x4a412(%rip), %rsi     # 0xc6a70
leaq 0x4a75f(%rip), %rcx     # 0xc6dc4
movl $0x4f0, %edx            # imm = 0x4F0
jmp 0x7c638
movq 0x28(%rdi), %rax
cmpq %rbx, 0x8(%rax)
je 0x7c727
leaq 0x4a6aa(%rip), %rdi     # 0xc6d2b
leaq 0x4a3e8(%rip), %rsi     # 0xc6a70
leaq 0x4a70d(%rip), %rcx     # 0xc6d9c
movl $0x4e0, %edx            # imm = 0x4E0
jmp 0x7c638
cmpq %rbx, 0x18(%r14,%r15)
je 0x7c727
movq 0x8(%r14,%r15), %r8
testq %r8, %r8
je 0x7c722
leaq 0x4a679(%rip), %rdi     # 0xc6d2b
leaq 0x4a3b7(%rip), %rsi     # 0xc6a70
leaq 0x4a6ac(%rip), %rcx     # 0xc6d6c
movl $0x4e8, %edx            # imm = 0x4E8
jmp 0x7c71b
movq 0x28(%rdi), %rax
cmpq %rbx, 0x8(%rax)
je 0x7c727
leaq 0x4a653(%rip), %rdi     # 0xc6d2b
leaq 0x4a391(%rip), %rsi     # 0xc6a70
leaq 0x4a663(%rip), %rcx     # 0xc6d49
movl $0x4d0, %edx            # imm = 0x4D0
jmp 0x7c638
cmpq %rbx, 0x18(%r14,%r15)
je 0x7c727
movq 0x8(%r14,%r15), %r8
testq %r8, %r8
je 0x7c722
leaq 0x4a623(%rip), %rdi     # 0xc6d2b
leaq 0x4a361(%rip), %rsi     # 0xc6a70
leaq 0x4a656(%rip), %rcx     # 0xc6d6c
movl $0x4d8, %edx            # imm = 0x4D8
xorl %eax, %eax
callq 0x60031
movq %rbx, 0x18(%r14,%r15)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x4a5f7(%rip), %rdi     # 0xc6d2b
leaq 0x4a335(%rip), %rsi     # 0xc6a70
leaq 0x4a36f(%rip), %rcx     # 0xc6ab1
movl $0x4fe, %edx            # imm = 0x4FE
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x60031