// File: /workspace/github_c_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
leaq 0x78(%rsp), %rbx
leaq 0x60(%rsp), %r14
movq %r14, %rdi
callq 0x112fb6
testb %al, %al
je 0xfe6d8
movq %rbx, %rdi
callq 0x112fb6
testb %al, %al
je 0xfe6d8
cmpq $0x0, (%r14)
je 0xfe6d8
cmpq $0x0, (%rbx)
je 0xfe6d8
movq %r14, %rdi
callq 0x112fda
testb %al, %al
jne 0xfe68e
movq %rbx, %rdi
callq 0x112fda
testb %al, %al
je 0xfe74e
movq %r14, %rdi
callq 0x1133ac
movsd %xmm0, 0x20(%rsp)
movq %rbx, %rdi
callq 0x1133ac
movsd 0x20(%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 0xfe835
movq 0x8(%r14), %rax
testq %rax, %rax
je 0xfe6e7
movq 0x8(%rax), %rdx
jmp 0xfe6e9
xorl %edx, %edx
movq 0x8(%rbx), %rcx
testq %rcx, %rcx
je 0xfe6f8
movq 0x8(%rcx), %rsi
jmp 0xfe6fa
xorl %esi, %esi
cmpq %rsi, %rdx
jne 0xfe721
xorl %r15d, %r15d
testq %rax, %rax
je 0xfe871
cmpq $0x0, 0x8(%rax)
je 0xfe871
testq %rax, %rax
je 0xfe786
movq 0x8(%rax), %r13
jmp 0xfe789
testq %rax, %rax
je 0xfe72c
movq 0x8(%rax), %rax
jmp 0xfe72e
xorl %eax, %eax
xorl %r15d, %r15d
testq %rcx, %rcx
je 0xfe73c
movq 0x8(%rcx), %rcx
jmp 0xfe73e
xorl %ecx, %ecx
cmpq %rcx, %rax
adcl $-0x1, %r15d
orl $0x1, %r15d
jmp 0xfe871
movq %r14, %rdi
callq 0x113022
movq %r14, %rdi
testb %al, %al
je 0xfe883
callq 0x1135dd
movq %rax, %r15
movq %rbx, %rdi
callq 0x113022
testb %al, %al
jne 0xfe897
movq %rbx, %rdi
callq 0x113836
jmp 0xfe89f
xorl %r13d, %r13d
movq (%r14), %r15
movq (%rbx), %r12
leaq 0xaa8a2(%rip), %rax     # 0x1a9038
movl 0xaa89c(%rip), %ecx     # 0x1a9038
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 0xfe7f4
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r13, %rdx
je 0xfe7f4
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r13, %rdx
je 0xfe7f4
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r13, %rdx
jne 0xfe8c3
movq (%rax,%rcx), %rbp
testq %rbp, %rbp
jne 0xfe824
movabsq $-0x12447a62f86214d4, %rdi # imm = 0xEDBB859D079DEB2C
movq %r13, %rsi
callq 0xf3f85
movq %rax, %rbp
leaq 0xaa81f(%rip), %rdi     # 0x1a9038
movq %r13, %rsi
movq %rax, %rdx
callq 0x12128c
movq %rbp, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xfe162
movl %eax, %r15d
testb $0x2, 0x10(%r14)
je 0xfe854
movq 0x10(%r14), %rax
movq %rax, 0x10(%rsp)
movupd (%r14), %xmm0
movupd %xmm0, (%rsp)
callq 0x112485
testb $0x2, 0x10(%rbx)
je 0xfe871
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movupd (%rbx), %xmm0
movupd %xmm0, (%rsp)
callq 0x112485
movl %r15d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x113836
movq %rax, %r15
movq %rbx, %rdi
callq 0x113022
testb %al, %al
je 0xfe8ad
movq %rbx, %rdi
callq 0x1135dd
cmpq %rax, %r15
sete %al
setb %cl
jmp 0xfe6c2
movq %rbx, %rdi
callq 0x113836
cmpq %rax, %r15
sete %al
setl %cl
jmp 0xfe6c2
xorl %ebp, %ebp
jmp 0xfe7f8