// File: /workspace/github_c_makefile_star2_O2/mbitsnbites[P]SoftFP/softfloat.c
// Function: subFloat128Sigs
static float128 subFloat128Sigs(float128 a, float128 b, flag zSign,
                                float_status *status)
{
    int32 aExp, bExp, zExp;
    uint64_t aSig0, aSig1, bSig0, bSig1, zSig0, zSig1;
    int32 expDiff;
    float128 z;

    aSig1 = extractFloat128Frac1( a );
    aSig0 = extractFloat128Frac0( a );
    aExp = extractFloat128Exp( a );
    bSig1 = extractFloat128Frac1( b );
    bSig0 = extractFloat128Frac0( b );
    bExp = extractFloat128Exp( b );
    expDiff = aExp - bExp;
    shortShift128Left( aSig0, aSig1, 14, &aSig0, &aSig1 );
    shortShift128Left( bSig0, bSig1, 14, &bSig0, &bSig1 );
    if ( 0 < expDiff ) goto aExpBigger;
    if ( expDiff < 0 ) goto bExpBigger;
    if ( aExp == 0x7FFF ) {
        if ( aSig0 | aSig1 | bSig0 | bSig1 ) {
            return propagateFloat128NaN(a, b, status);
        }
        float_raise(float_flag_invalid, status);
        z.low = float128_default_nan_low;
        z.high = float128_default_nan_high;
        return z;
    }
    if ( aExp == 0 ) {
        aExp = 1;
        bExp = 1;
    }
    if ( bSig0 < aSig0 ) goto aBigger;
    if ( aSig0 < bSig0 ) goto bBigger;
    if ( bSig1 < aSig1 ) goto aBigger;
    if ( aSig1 < bSig1 ) goto bBigger;
    return packFloat128(status->float_rounding_mode == float_round_down,
                        0, 0, 0);
 bExpBigger:
    if ( bExp == 0x7FFF ) {
        if (bSig0 | bSig1) {
            return propagateFloat128NaN(a, b, status);
        }
        return packFloat128( zSign ^ 1, 0x7FFF, 0, 0 );
    }
    if ( aExp == 0 ) {
        ++expDiff;
    }
    else {
        aSig0 |= LIT64( 0x4000000000000000 );
    }
    shift128RightJamming( aSig0, aSig1, - expDiff, &aSig0, &aSig1 );
    bSig0 |= LIT64( 0x4000000000000000 );
 bBigger:
    sub128( bSig0, bSig1, aSig0, aSig1, &zSig0, &zSig1 );
    zExp = bExp;
    zSign ^= 1;
    goto normalizeRoundAndPack;
 aExpBigger:
    if ( aExp == 0x7FFF ) {
        if (aSig0 | aSig1) {
            return propagateFloat128NaN(a, b, status);
        }
        return a;
    }
    if ( bExp == 0 ) {
        --expDiff;
    }
    else {
        bSig0 |= LIT64( 0x4000000000000000 );
    }
    shift128RightJamming( bSig0, bSig1, expDiff, &bSig0, &bSig1 );
    aSig0 |= LIT64( 0x4000000000000000 );
 aBigger:
    sub128( aSig0, aSig1, bSig0, bSig1, &zSig0, &zSig1 );
    zExp = aExp;
 normalizeRoundAndPack:
    --zExp;
    return normalizeRoundAndPackFloat128(zSign, zExp - 14, zSig0, zSig1,
                                         status);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r11
movq %rsi, %rdx
movq %rdi, %rax
movabsq $0xffffffffffff, %r14   # imm = 0xFFFFFFFFFFFF
movq %rsi, %r15
andq %r14, %r15
movq %rsi, %rbp
shrq $0x30, %rbp
movl $0x7fff, %esi           # imm = 0x7FFF
andl %esi, %ebp
andq %rcx, %r14
movq %rcx, %rbx
shrq $0x30, %rbx
andl %esi, %ebx
movq %rdi, %r13
shlq $0xe, %r13
shldq $0xe, %rdi, %r15
movq %r11, %r12
shlq $0xe, %r12
shldq $0xe, %r11, %r14
movl %ebp, %r10d
movq %r13, 0x30(%rsp)
movq %r15, 0x20(%rsp)
movq %r12, 0x28(%rsp)
movq %r14, 0x18(%rsp)
subl %ebx, %r10d
jle 0x110e4
cmpl $0x7fff, %ebp           # imm = 0x7FFF
jne 0x11119
orq %r13, %r15
je 0x11254
movq %rax, %rdi
movq %rdx, %rsi
movq %r11, %rdx
movq %r9, %r8
callq 0x10ca1
jmp 0x11254
js 0x1113b
testl %ebp, %ebp
je 0x111b1
cmpl $0x7fff, %ebp           # imm = 0x7FFF
jne 0x111b6
orq %r13, %r15
orq %r12, %r15
orq %r14, %r15
jne 0x110ce
orb $0x1, 0x2(%r9)
movabsq $0x7fff800000000000, %rdx # imm = 0x7FFF800000000000
jmp 0x111d2
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
testl %ebx, %ebx
movq %r9, 0x10(%rsp)
movl %r8d, 0xc(%rsp)
je 0x11166
orq %rax, %r14
movq %r14, 0x18(%rsp)
jmp 0x11169
cmpl $0x7fff, %ebx           # imm = 0x7FFF
jne 0x111d6
orq %r12, %r14
jne 0x110ce
notb %r8b
movzbl %r8b, %eax
shlq $0x3f, %rax
movabsq $0x7fff000000000000, %rdx # imm = 0x7FFF000000000000
orq %rax, %rdx
jmp 0x111d2
decl %r10d
movq %rax, %rbx
movl %r10d, %edx
leaq 0x18(%rsp), %rcx
leaq 0x28(%rsp), %r8
movq %r14, %rdi
movq %r12, %rsi
movq %rcx, %r14
movq %r8, %r12
callq 0xdc4f
orq %rbx, %r15
movq (%r14), %r14
movq (%r12), %r12
movq 0x10(%rsp), %r9
movl 0xc(%rsp), %r8d
subq %r12, %r13
sbbq %r14, %r15
movq %r15, %r14
movq %r13, %r12
movl %ebp, %ebx
jmp 0x1123d
pushq $0x1
popq %rbp
movl %ebp, %ebx
cmpq %r15, %r14
jb 0x1119e
ja 0x11233
cmpq %r13, %r12
jb 0x1119e
ja 0x11233
xorl %edx, %edx
cmpb $0x1, 0x1(%r9)
sete %dl
shlq $0x3f, %rdx
xorl %eax, %eax
jmp 0x11254
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
testl %ebp, %ebp
movq %r9, 0x10(%rsp)
movl %r8d, 0xc(%rsp)
je 0x111f8
orq %rax, %r15
movq %r15, 0x20(%rsp)
jmp 0x111fb
incl %r10d
movq %rax, %rbp
negl %r10d
leaq 0x20(%rsp), %rcx
leaq 0x30(%rsp), %r8
movq %r15, %rdi
movq %r13, %rsi
movq %r10, %rdx
movq %rcx, %r15
movq %r8, %r13
callq 0xdc4f
orq %rbp, %r14
movq (%r15), %r15
movq (%r13), %r13
movq 0x10(%rsp), %r9
movl 0xc(%rsp), %r8d
subq %r13, %r12
sbbq %r15, %r14
xorb $0x1, %r8b
addl $-0xf, %ebx
movzbl %r8b, %edi
movl %ebx, %esi
movq %r14, %rdx
movq %r12, %rcx
movq %r9, %r8
callq 0x98e4
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq