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

    aSig1 = extractFloat128Frac1( a );
    aSig0 = extractFloat128Frac0( a );
    aExp = extractFloat128Exp( a );
    bSig1 = extractFloat128Frac1( b );
    bSig0 = extractFloat128Frac0( b );
    bExp = extractFloat128Exp( b );
    expDiff = aExp - bExp;
    if ( 0 < expDiff ) {
        if ( aExp == 0x7FFF ) {
            if (aSig0 | aSig1) {
                return propagateFloat128NaN(a, b, status);
            }
            return a;
        }
        if ( bExp == 0 ) {
            --expDiff;
        }
        else {
            bSig0 |= LIT64( 0x0001000000000000 );
        }
        shift128ExtraRightJamming(
            bSig0, bSig1, 0, expDiff, &bSig0, &bSig1, &zSig2 );
        zExp = aExp;
    }
    else if ( expDiff < 0 ) {
        if ( bExp == 0x7FFF ) {
            if (bSig0 | bSig1) {
                return propagateFloat128NaN(a, b, status);
            }
            return packFloat128( zSign, 0x7FFF, 0, 0 );
        }
        if ( aExp == 0 ) {
            ++expDiff;
        }
        else {
            aSig0 |= LIT64( 0x0001000000000000 );
        }
        shift128ExtraRightJamming(
            aSig0, aSig1, 0, - expDiff, &aSig0, &aSig1, &zSig2 );
        zExp = bExp;
    }
    else {
        if ( aExp == 0x7FFF ) {
            if ( aSig0 | aSig1 | bSig0 | bSig1 ) {
                return propagateFloat128NaN(a, b, status);
            }
            return a;
        }
        add128( aSig0, aSig1, bSig0, bSig1, &zSig0, &zSig1 );
        if ( aExp == 0 ) {
            if (status->flush_to_zero) {
                if (zSig0 | zSig1) {
                    float_raise(float_flag_output_denormal, status);
                }
                return packFloat128(zSign, 0, 0, 0);
            }
            return packFloat128( zSign, 0, zSig0, zSig1 );
        }
        zSig2 = 0;
        zSig0 |= LIT64( 0x0002000000000000 );
        zExp = aExp;
        goto shiftRight1;
    }
    aSig0 |= LIT64( 0x0001000000000000 );
    add128( aSig0, aSig1, bSig0, bSig1, &zSig0, &zSig1 );
    --zExp;
    if ( zSig0 < LIT64( 0x0002000000000000 ) ) goto roundAndPack;
    ++zExp;
 shiftRight1:
    shift128ExtraRightJamming(
        zSig0, zSig1, zSig2, 1, &zSig0, &zSig1, &zSig2 );
 roundAndPack:
    return roundAndPackFloat128(zSign, zExp, zSig0, zSig1, zSig2, status);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %r8d, %r10d
movq %rdx, %rbx
movq %rsi, %rdx
movq %rdi, %r13
movabsq $0x1000000000000, %rsi  # imm = 0x1000000000000
movq %rdi, 0x40(%rsp)
leaq -0x1(%rsi), %r12
movq %rdx, %r15
andq %r12, %r15
movq %r15, 0x30(%rsp)
movq %rdx, %r14
shrq $0x30, %r14
movl $0x7fff, %eax           # imm = 0x7FFF
andl %eax, %r14d
movq %rbx, 0x38(%rsp)
andq %rcx, %r12
movq %r12, 0x28(%rsp)
movq %rcx, %rbp
shrq $0x30, %rbp
andl %eax, %ebp
movl %r14d, %eax
subl %ebp, %eax
jle 0x10e8b
cmpl $0x7fff, %r14d          # imm = 0x7FFF
jne 0x10ea9
orq %r13, %r15
jne 0x10ed6
jmp 0x10ea1
js 0x10ec1
cmpl $0x7fff, %r14d          # imm = 0x7FFF
jne 0x10eec
orq %r13, %r15
orq %rbx, %r15
orq %r12, %r15
jne 0x10ed6
movq %r13, %rbx
jmp 0x10f9d
testl %ebp, %ebp
movq %r9, 0x18(%rsp)
movl %r10d, 0x14(%rsp)
je 0x10f07
orq %rsi, %r12
movq %r12, 0x28(%rsp)
jmp 0x10f09
cmpl $0x7fff, %ebp           # imm = 0x7FFF
jne 0x10faf
orq %rbx, %r12
je 0x10fe3
movq %r13, %rdi
movq %rdx, %rsi
movq %rbx, %rdx
movq %r9, %r8
callq 0x10ca1
jmp 0x10f9a
addq %r13, %rbx
adcq %r15, %r12
testl %r14d, %r14d
je 0x10fc8
btsq $0x31, %r12
xorl %eax, %eax
movq %r12, %r15
jmp 0x10f70
decl %eax
movl %eax, %ecx
leaq 0x20(%rsp), %rax
movq %rax, (%rsp)
leaq 0x28(%rsp), %rbp
leaq 0x38(%rsp), %r9
movq %r12, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movq %rbp, %r8
movq %r9, %rbx
callq 0x1156d
movq (%rbp), %r12
movq (%rbx), %rbx
movabsq $0x1000000000000, %rax  # imm = 0x1000000000000
orq %rax, %r15
addq %r13, %rbx
adcq %r12, %r15
movq %r15, %rax
shrq $0x31, %rax
movq 0x20(%rsp), %r8
movq 0x18(%rsp), %r9
movl 0x14(%rsp), %r10d
jne 0x10f68
decl %r14d
jmp 0x10f88
xorl %eax, %eax
testq %r8, %r8
setne %al
movq %r15, %rcx
shldq $0x3f, %rbx, %rcx
shlq $0x3f, %rbx
orq %rax, %rbx
shrq %r15
movq %rbx, %r8
movq %rcx, %rbx
movzbl %r10b, %edi
movl %r14d, %esi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x115fc
movq %rax, %rbx
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %r14d, %r14d
movq %r9, 0x18(%rsp)
movl %r10d, 0x14(%rsp)
je 0x10ffc
orq %rsi, %r15
movq %r15, 0x30(%rsp)
jmp 0x10ffe
cmpb $0x0, 0x4(%r9)
je 0x11038
orq %rbx, %r12
je 0x10fd9
orb $-0x80, 0x2(%r9)
movzbl %r10b, %edx
shlq $0x3f, %rdx
jmp 0x10ff8
movzbl %r10b, %eax
shlq $0x3f, %rax
movabsq $0x7fff000000000000, %rdx # imm = 0x7FFF000000000000
orq %rax, %rdx
xorl %ebx, %ebx
jmp 0x10f9d
incl %eax
negl %eax
leaq 0x20(%rsp), %rcx
movq %rcx, (%rsp)
leaq 0x30(%rsp), %r14
leaq 0x40(%rsp), %r9
movq %r15, %rdi
movq %r13, %rsi
xorl %edx, %edx
movq %rax, %rcx
movq %r14, %r8
movq %r9, %r13
callq 0x1156d
movq (%r14), %r15
movq (%r13), %r13
movl %ebp, %r14d
jmp 0x10f38
movzbl %r10b, %edx
shlq $0x3f, %rdx
orq %r12, %rdx
jmp 0x10f9d