// File: /workspace/github_c_makefile_star2_O1/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 0xff1b0
movq %rsi, %r14
testq %rsi, %rsi
je 0xff1b5
movq %rdx, %rbx
testq %rdx, %rdx
je 0xff1bd
movq %rdi, %r12
movq 0x10(%rdi), %rdi
xorl %esi, %esi
callq 0x10decb
testb %al, %al
jne 0xff18f
movabsq $-0x503db0e6e1c2e704, %rax # imm = 0xAFC24F191E3D18FC
cmpq %rax, 0x8(%r12)
jne 0xff1d8
movq 0x8(%r12), %rdi
movq %r14, %rsi
movq %rbx, %rdx
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xfffcd
xorl %r15d, %r15d
jmp 0xff1c3
movl $0x1, %r15d
jmp 0xff1c3
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 0x10ded3
movq 0x10(%r12), %r12
testb %al, %al
je 0xff335
movq 0x8(%r12), %r13
leaq 0xa9c20(%rip), %rax     # 0x1a8e20
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 0xff25a
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r13, %rdx
je 0xff25a
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r13, %rdx
je 0xff25a
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r13, %rdx
jne 0xff3d2
movq (%rax,%rcx), %r12
testq %r12, %r12
jne 0xff28a
movabsq $-0x5073d588c3beb52e, %rdi # imm = 0xAF8C2A773C414AD2
movq %r13, %rsi
callq 0xf3f85
movq %rax, %r12
leaq 0xa9ba1(%rip), %rdi     # 0x1a8e20
movq %r13, %rsi
movq %rax, %rdx
callq 0x12128c
movq %r12, %rdi
movq %r14, %rsi
callq 0xf837b
movq %rax, %r13
movq %r12, %rdi
movq %rbx, %rsi
callq 0xf837b
cmpq %rax, %r13
jne 0xff3af
movq %r13, 0x30(%rsp)
testq %r13, %r13
je 0xff1c3
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 0xfe566
testl %eax, %eax
cmovnel %eax, %r13d
jne 0xff3ca
incq %rbp
xorl %r15d, %r15d
cmpq %rbp, 0x30(%rsp)
jne 0xff2bc
jmp 0xff1c3
cmpq $0x0, 0x20(%r12)
je 0xff1c3
xorl %r13d, %r13d
leaq 0x50(%rsp), %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0x10ca2c
leaq 0x38(%rsp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq %r13, %rcx
callq 0x10ca2c
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 0xfe566
testl %eax, %eax
cmovnel %eax, %ebp
jne 0xff3c2
incq %r13
xorl %r15d, %r15d
cmpq 0x20(%r12), %r13
jb 0xff344
jmp 0xff1c3
xorl %r15d, %r15d
cmpq %rax, %r13
adcl $-0x1, %r15d
orl $0x1, %r15d
jmp 0xff1c3
movl %ebp, %r15d
jmp 0xff1c3
movl %r13d, %r15d
jmp 0xff1c3
xorl %r12d, %r12d
jmp 0xff25e