// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_spect_compare.c
// Function: bcore_compare_num_dominant_sr
s2_t bcore_compare_num_dominant_sr( sr_s sr_a, sr_s sr_b )
{
    if( sr_s_is_numeric( &sr_a ) && sr_s_is_numeric( &sr_b ) && sr_a.o && sr_b.o )
    {
        s2_t c = 0;
        if( sr_s_is_float( &sr_a ) || sr_s_is_float( &sr_b ) )
        {
            f3_t fa = sr_s_to_f3( &sr_a );
            f3_t fb = sr_s_to_f3( &sr_b );
            c = ( fa == fb ) ? 0 : ( fa < fb ) ? 1 : -1;
        }
        else if( sr_s_is_unsigned( &sr_a ) )
        {
            u3_t ua = sr_s_to_u3( &sr_a );
            if( sr_s_is_unsigned( &sr_b ) )
            {
                u3_t ub = sr_s_to_u3( &sr_b );
                c = ( ua == ub ) ? 0 : ( ua < ub ) ? 1 : -1;
            }
            else
            {
                s3_t sb = sr_s_to_s3( &sr_b );
                c = ( ua == sb ) ? 0 : ( ua < sb ) ? 1 : -1;
            }
        }
        else
        {
            s3_t sa = sr_s_to_s3( &sr_a );
            if( sr_s_is_unsigned( &sr_b ) )
            {
                u3_t ub = sr_s_to_u3( &sr_b );
                c = ( sa == ub ) ? 0 : ( sa < ub ) ? 1 : -1;
            }
            else
            {
                s3_t sb = sr_s_to_s3( &sr_b );
                c = ( sa == sb ) ? 0 : ( sa < sb ) ? 1 : -1;
            }
        }
        sr_down( sr_a );
        sr_down( sr_b );
        return c;
    }
    else
    {
        if( sr_s_type( &sr_a ) != sr_s_type( &sr_b ) ) return ( sr_s_type( &sr_a ) < sr_s_type( &sr_b ) ) ? 1 : -1;
        if( sr_s_type( &sr_a ) == 0 ) return 0;
        s2_t c = bcore_compare_num_dominant_typed( sr_s_type( &sr_a ), sr_a.o, sr_b.o );
        sr_down( sr_a );
        sr_down( sr_b );
        return c;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
leaq 0x58(%rsp), %rbx
leaq 0x40(%rsp), %r14
movq %r14, %rdi
callq 0x8d3ab
testb %al, %al
je 0x81107
movq %rbx, %rdi
callq 0x8d3ab
testb %al, %al
je 0x81107
cmpq $0x0, (%r14)
je 0x81107
cmpq $0x0, (%rbx)
je 0x81107
movq %r14, %rdi
callq 0x8d3cf
testb %al, %al
jne 0x810c0
movq %rbx, %rdi
callq 0x8d3cf
testb %al, %al
je 0x811c0
movq %r14, %rdi
callq 0x8d63e
movsd %xmm0, 0x18(%rsp)
movq %rbx, %rdi
callq 0x8d63e
movsd 0x18(%rsp), %xmm2
movapd %xmm2, %xmm1
cmpeqsd %xmm0, %xmm1
movq %xmm1, %rax
andl $0x1, %eax
ucomisd %xmm2, %xmm0
seta %cl
movzbl %cl, %ecx
decl %ecx
orl $0x1, %ecx
xorl %r15d, %r15d
testb %al, %al
cmovel %ecx, %r15d
jmp 0x8114d
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x81116
movq 0x8(%rax), %rdx
jmp 0x81118
xorl %edx, %edx
movq 0x8(%rbx), %rcx
testq %rcx, %rcx
je 0x81127
movq 0x8(%rcx), %rsi
jmp 0x81129
xorl %esi, %esi
cmpq %rsi, %rdx
jne 0x8118b
xorl %r15d, %r15d
testq %rax, %rax
je 0x811b3
movq 0x8(%rax), %rdi
testq %rdi, %rdi
je 0x811b3
movq (%r14), %rsi
movq (%rbx), %rdx
callq 0x80f84
movl %eax, %r15d
testb $0x2, 0x10(%r14)
je 0x8116c
movq 0x10(%r14), %rax
movq %rax, 0x10(%rsp)
movupd (%r14), %xmm0
movupd %xmm0, (%rsp)
callq 0x8cdc1
testb $0x2, 0x10(%rbx)
je 0x811b3
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movupd (%rbx), %xmm0
movupd %xmm0, (%rsp)
callq 0x8cdc1
jmp 0x811b3
testq %rax, %rax
je 0x81196
movq 0x8(%rax), %rax
jmp 0x81198
xorl %eax, %eax
xorl %r15d, %r15d
testq %rcx, %rcx
je 0x811a6
movq 0x8(%rcx), %rcx
jmp 0x811a8
xorl %ecx, %ecx
cmpq %rcx, %rax
adcl $-0x1, %r15d
orl $0x1, %r15d
movl %r15d, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %r14, %rdi
callq 0x8d417
movq %r14, %rdi
testb %al, %al
je 0x811ed
callq 0x8d813
movq %rax, %r15
movq %rbx, %rdi
callq 0x8d417
testb %al, %al
jne 0x81201
movq %rbx, %rdi
callq 0x8d9e8
jmp 0x81209
callq 0x8d9e8
movq %rax, %r15
movq %rbx, %rdi
callq 0x8d417
testb %al, %al
je 0x81217
movq %rbx, %rdi
callq 0x8d813
cmpq %rax, %r15
sete %al
setb %cl
jmp 0x810f4
movq %rbx, %rdi
callq 0x8d9e8
cmpq %rax, %r15
sete %al
setl %cl
jmp 0x810f4