// File: /workspace/github_c_makefile_star2_O1/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 0xf80bc
movq %rdx, %rbx
movq %rsi, %r14
movq 0x20(%rdi), %r15
leaq 0x5bac0(%rip), %rcx     # 0x153a64
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x5be87(%rip), %rdi     # 0x153e3b
leaq 0x5bbc5(%rip), %rsi     # 0x153b80
leaq 0x5bf4a(%rip), %rcx     # 0x153f0c
movl $0x4f8, %edx            # imm = 0x4F8
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0xc80f6
cmpq $0x0, 0x8(%r14,%r15)
je 0xf80b6
leaq 0x5be55(%rip), %rdi     # 0x153e3b
leaq 0x5bb93(%rip), %rsi     # 0x153b80
leaq 0x5bee0(%rip), %rcx     # 0x153ed4
movl $0x4f0, %edx            # imm = 0x4F0
jmp 0xf7fc7
movq 0x28(%rdi), %rax
cmpq %rbx, 0x8(%rax)
je 0xf80b6
leaq 0x5be2b(%rip), %rdi     # 0x153e3b
leaq 0x5bb69(%rip), %rsi     # 0x153b80
leaq 0x5be8e(%rip), %rcx     # 0x153eac
movl $0x4e0, %edx            # imm = 0x4E0
jmp 0xf7fc7
cmpq %rbx, 0x18(%r14,%r15)
je 0xf80b6
movq 0x8(%r14,%r15), %r8
testq %r8, %r8
je 0xf80b1
leaq 0x5bdfa(%rip), %rdi     # 0x153e3b
leaq 0x5bb38(%rip), %rsi     # 0x153b80
leaq 0x5be2d(%rip), %rcx     # 0x153e7c
movl $0x4e8, %edx            # imm = 0x4E8
jmp 0xf80aa
movq 0x28(%rdi), %rax
cmpq %rbx, 0x8(%rax)
je 0xf80b6
leaq 0x5bdd4(%rip), %rdi     # 0x153e3b
leaq 0x5bb12(%rip), %rsi     # 0x153b80
leaq 0x5bde4(%rip), %rcx     # 0x153e59
movl $0x4d0, %edx            # imm = 0x4D0
jmp 0xf7fc7
cmpq %rbx, 0x18(%r14,%r15)
je 0xf80b6
movq 0x8(%r14,%r15), %r8
testq %r8, %r8
je 0xf80b1
leaq 0x5bda4(%rip), %rdi     # 0x153e3b
leaq 0x5bae2(%rip), %rsi     # 0x153b80
leaq 0x5bdd7(%rip), %rcx     # 0x153e7c
movl $0x4d8, %edx            # imm = 0x4D8
xorl %eax, %eax
callq 0xc80f6
movq %rbx, 0x18(%r14,%r15)
popq %rbx
popq %r14
popq %r15
retq
leaq 0x5bd78(%rip), %rdi     # 0x153e3b
leaq 0x5bab6(%rip), %rsi     # 0x153b80
leaq 0x5baf0(%rip), %rcx     # 0x153bc1
movl $0x4fe, %edx            # imm = 0x4FE
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0xc80f6