// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xd5d70
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
addq $-0x6, %rax
movq %rax, -0x40(%rbp)
subq $0x7, %rax
ja 0xd7636
movq -0x40(%rbp), %rax
leaq 0x7b912(%rip), %rcx     # 0x152dac
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rax
cmpq -0x18(%rbp), %rax
jne 0xd74ba
jmp 0xd7662
leaq 0x7bcf2(%rip), %rdi     # 0x1531b3
leaq 0x7ba30(%rip), %rsi     # 0x152ef8
movl $0x4d0, %edx            # imm = 0x4D0
leaq 0x7bcfd(%rip), %rcx     # 0x1531d1
movb $0x0, %al
callq 0x9cf40
jmp 0xd7662
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
cmpq -0x18(%rbp), %rax
jne 0xd74fb
jmp 0xd7662
movq -0x28(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jbe 0xd752f
movq -0x28(%rbp), %rax
movq 0x8(%rax), %r8
leaq 0x7bc9e(%rip), %rdi     # 0x1531b3
leaq 0x7b9dc(%rip), %rsi     # 0x152ef8
movl $0x4d8, %edx            # imm = 0x4D8
leaq 0x7bccc(%rip), %rcx     # 0x1531f4
movb $0x0, %al
callq 0x9cf40
movq -0x18(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0xd7662
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rax
cmpq -0x18(%rbp), %rax
jne 0xd7557
jmp 0xd7662
leaq 0x7bc55(%rip), %rdi     # 0x1531b3
leaq 0x7b993(%rip), %rsi     # 0x152ef8
movl $0x4e0, %edx            # imm = 0x4E0
leaq 0x7bcb3(%rip), %rcx     # 0x153224
movb $0x0, %al
callq 0x9cf40
jmp 0xd7662
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
cmpq -0x18(%rbp), %rax
jne 0xd7598
jmp 0xd7662
movq -0x30(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jbe 0xd75cc
movq -0x30(%rbp), %rax
movq 0x8(%rax), %r8
leaq 0x7bc01(%rip), %rdi     # 0x1531b3
leaq 0x7b93f(%rip), %rsi     # 0x152ef8
movl $0x4e8, %edx            # imm = 0x4E8
leaq 0x7bc2f(%rip), %rcx     # 0x1531f4
movb $0x0, %al
callq 0x9cf40
movq -0x18(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0xd7662
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jbe 0xd7611
leaq 0x7bbbc(%rip), %rdi     # 0x1531b3
leaq 0x7b8fa(%rip), %rsi     # 0x152ef8
movl $0x4f0, %edx            # imm = 0x4F0
leaq 0x7bc42(%rip), %rcx     # 0x15324c
movb $0x0, %al
callq 0x9cf40
jmp 0xd7662
leaq 0x7bb99(%rip), %rdi     # 0x1531b3
leaq 0x7b8d7(%rip), %rsi     # 0x152ef8
movl $0x4f8, %edx            # imm = 0x4F8
leaq 0x7bc57(%rip), %rcx     # 0x153284
movb $0x0, %al
callq 0x9cf40
jmp 0xd7662
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl %eax, %r8d
leaq 0x7bb6b(%rip), %rdi     # 0x1531b3
leaq 0x7b8a9(%rip), %rsi     # 0x152ef8
movl $0x4fe, %edx            # imm = 0x4FE
leaq 0x7b8de(%rip), %rcx     # 0x152f39
movb $0x0, %al
callq 0x9cf40
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)