// File: /workspace/github_c_makefile_star2_O3/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 0x108085
testb %al, %al
je 0xf405d
movq %rbx, %rdi
callq 0x108085
testb %al, %al
je 0xf405d
cmpq $0x0, (%r14)
je 0xf405d
cmpq $0x0, (%rbx)
je 0xf405d
movq %r14, %rdi
callq 0x1080a9
testb %al, %al
jne 0xf4013
movq %rbx, %rdi
callq 0x1080a9
testb %al, %al
je 0xf41c1
movq %r14, %rdi
callq 0x10847b
movsd %xmm0, 0x20(%rsp)
movq %rbx, %rdi
callq 0x10847b
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 0xf4149
movq 0x8(%r14), %rax
testq %rax, %rax
je 0xf406c
movq 0x8(%rax), %rdx
jmp 0xf406e
xorl %edx, %edx
movq 0x8(%rbx), %rcx
testq %rcx, %rcx
je 0xf407d
movq 0x8(%rcx), %rsi
jmp 0xf407f
xorl %esi, %esi
cmpq %rsi, %rdx
jne 0xf4187
xorl %r15d, %r15d
testq %rax, %rax
je 0xf41af
movq 0x8(%rax), %r13
testq %r13, %r13
je 0xf41af
movq (%r14), %r15
movq (%rbx), %r12
leaq 0xa7f8a(%rip), %rax     # 0x19c038
movl 0xa7f84(%rip), %ecx     # 0x19c038
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 0xf4108
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r13, %rdx
je 0xf4108
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r13, %rdx
je 0xf4108
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r13, %rdx
jne 0xf4111
movq (%rax,%rcx), %rbp
testq %rbp, %rbp
jne 0xf4138
movabsq $-0x12447a62f86214d4, %rdi # imm = 0xEDBB859D079DEB2C
movq %r13, %rsi
callq 0xe9bc5
movq %rax, %rbp
leaq 0xa7f0b(%rip), %rdi     # 0x19c038
movq %r13, %rsi
movq %rax, %rdx
callq 0x115fac
movq %rbp, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xf3b1a
movl %eax, %r15d
testb $0x2, 0x10(%r14)
je 0xf4168
movq 0x10(%r14), %rax
movq %rax, 0x10(%rsp)
movupd (%r14), %xmm0
movupd %xmm0, (%rsp)
callq 0x107590
testb $0x2, 0x10(%rbx)
je 0xf41af
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movupd (%rbx), %xmm0
movupd %xmm0, (%rsp)
callq 0x107590
jmp 0xf41af
testq %rax, %rax
je 0xf4192
movq 0x8(%rax), %rax
jmp 0xf4194
xorl %eax, %eax
xorl %r15d, %r15d
testq %rcx, %rcx
je 0xf41a2
movq 0x8(%rcx), %rcx
jmp 0xf41a4
xorl %ecx, %ecx
cmpq %rcx, %rax
adcl $-0x1, %r15d
orl $0x1, %r15d
movl %r15d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0x1080f1
movq %r14, %rdi
testb %al, %al
je 0xf41ee
callq 0x1086af
movq %rax, %r15
movq %rbx, %rdi
callq 0x1080f1
testb %al, %al
jne 0xf4202
movq %rbx, %rdi
callq 0x1088f4
jmp 0xf420a
callq 0x1088f4
movq %rax, %r15
movq %rbx, %rdi
callq 0x1080f1
testb %al, %al
je 0xf4218
movq %rbx, %rdi
callq 0x1086af
cmpq %rax, %r15
sete %al
setb %cl
jmp 0xf4047
movq %rbx, %rdi
callq 0x1088f4
cmpq %rax, %r15
sete %al
setl %cl
jmp 0xf4047