// File: /workspace/github_c_makefile_star2_O3/johsteffens[P]beth/lib/bcore/bcore_spect_compare.c
// Function: compare_generic
static s2_t compare_generic( const bcore_compare_s* p, vc_t obj1, vc_t obj2 )
{
    if( obj1 == obj2 ) return  0;
    if( obj1 == NULL ) return  1;
    if( obj2 == NULL ) return -1;
    if( bcore_via_p_is_leaf( p->via, NULL ) || p->o_type == TYPEOF_st_s )
    {
        return compare_leaf_or_string( p->o_type, obj1, obj2 );
    }

    if( bcore_via_p_is_pure_array( p->via, NULL ) )
    {
        const bcore_array_s* arr_p = bcore_array_s_get_typed( p->via->header.o_type );
        uz_t size1 = bcore_array_p_get_size( arr_p, obj1 );
        uz_t size2 = bcore_array_p_get_size( arr_p, obj2 );
        if( size1 != size2 ) return size1 < size2 ? 1 : -1;
        for( uz_t j = 0; j < size1; j++ )
        {
            s2_t c = bcore_compare_sr( arr_p->get( arr_p, obj1, j ), arr_p->get( arr_p, obj2, j ) );
            if( c != 0 ) return c;
        }
        return 0;
    }

    const bcore_via_s* via = p->via;
    for( uz_t i = 0; i < via->size; i++ )
    {
        s2_t c = bcore_compare_sr( bcore_via_p_iget( via, obj1, i ), bcore_via_p_iget( via, obj2, i ) );
        if( c != 0 ) return c;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
cmpq %rdx, %rsi
je 0xf4aba
movq %rsi, %r14
testq %rsi, %rsi
je 0xf4abf
movq %rdx, %rbx
testq %rdx, %rdx
je 0xf4ac7
movq %rdi, %r12
movq 0x10(%rdi), %rdi
xorl %esi, %esi
callq 0x10326d
movq 0x8(%r12), %rdi
testb %al, %al
jne 0xf4a9e
movabsq $-0x503db0e6e1c2e704, %rax # imm = 0xAFC24F191E3D18FC
cmpq %rax, %rdi
movq %rax, %rdi
jne 0xf4ae2
movq %r14, %rsi
movq %rbx, %rdx
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf585d
xorl %r15d, %r15d
jmp 0xf4acd
movl $0x1, %r15d
jmp 0xf4acd
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movl %r15d, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%r12), %rdi
xorl %r15d, %r15d
xorl %esi, %esi
callq 0x103275
movq 0x10(%r12), %r12
testb %al, %al
je 0xf4c30
movq 0x8(%r12), %r13
leaq 0xa7316(%rip), %rax     # 0x19be20
movl (%rax), %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x20(%rax,%rcx,8), %rdx
movq 0x18(%rax,%rcx,8), %rcx
andq %r13, %rcx
shlq $0x4, %rcx
leaq (%rdx,%rcx), %rax
movq (%rdx,%rcx), %rdx
movl $0x8, %ecx
cmpq %r13, %rdx
je 0xf4b60
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r13, %rdx
je 0xf4b60
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r13, %rdx
je 0xf4b60
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r13, %rdx
jne 0xf4b69
movq (%rax,%rcx), %r12
testq %r12, %r12
jne 0xf4b90
movabsq $-0x5073d588c3beb52e, %rdi # imm = 0xAF8C2A773C414AD2
movq %r13, %rsi
callq 0xe9bc5
movq %rax, %r12
leaq 0xa729b(%rip), %rdi     # 0x19be20
movq %r13, %rsi
movq %rax, %rdx
callq 0x115fac
movq %r12, %rdi
movq %r14, %rsi
callq 0xede4d
movq %rax, %r13
movq %r12, %rdi
movq %rbx, %rsi
callq 0xede4d
cmpq %rax, %r13
jne 0xf4caa
testq %r13, %r13
je 0xf4acd
xorl %ebp, %ebp
leaq 0x80(%rsp), %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %rbp, %rcx
callq *0x30(%r12)
leaq 0x68(%rsp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %rbp, %rcx
callq *0x30(%r12)
movq 0x78(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0x68(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x80(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xf3ef6
testl %eax, %eax
jne 0xf4cbd
incq %rbp
xorl %r15d, %r15d
cmpq %rbp, %r13
jne 0xf4bbd
jmp 0xf4acd
cmpq $0x0, 0x20(%r12)
je 0xf4acd
xorl %r13d, %r13d
leaq 0x38(%rsp), %rbp
leaq 0x50(%rsp), %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0x101e10
movq %rbp, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %r13, %rcx
callq 0x101e10
movq 0x48(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x50(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xf3ef6
testl %eax, %eax
jne 0xf4cbd
incq %r13
xorl %r15d, %r15d
cmpq 0x20(%r12), %r13
jb 0xf4c44
jmp 0xf4acd
xorl %r15d, %r15d
cmpq %rax, %r13
adcl $-0x1, %r15d
orl $0x1, %r15d
jmp 0xf4acd
movl %eax, %r15d
jmp 0xf4acd