// File: /workspace/github_c_makefile_star2_O2/mbitsnbites[P]SoftFP/softfloat.c
// Function: float128_div
float128 float128_div(float128 a, float128 b, float_status *status)
{
    flag aSign, bSign, zSign;
    int32 aExp, bExp, zExp;
    uint64_t aSig0, aSig1, bSig0, bSig1, zSig0, zSig1, zSig2;
    uint64_t rem0, rem1, rem2, rem3, term0, term1, term2, term3;
    float128 z;

    aSig1 = extractFloat128Frac1( a );
    aSig0 = extractFloat128Frac0( a );
    aExp = extractFloat128Exp( a );
    aSign = extractFloat128Sign( a );
    bSig1 = extractFloat128Frac1( b );
    bSig0 = extractFloat128Frac0( b );
    bExp = extractFloat128Exp( b );
    bSign = extractFloat128Sign( b );
    zSign = aSign ^ bSign;
    if ( aExp == 0x7FFF ) {
        if (aSig0 | aSig1) {
            return propagateFloat128NaN(a, b, status);
        }
        if ( bExp == 0x7FFF ) {
            if (bSig0 | bSig1) {
                return propagateFloat128NaN(a, b, status);
            }
            goto invalid;
        }
        return packFloat128( zSign, 0x7FFF, 0, 0 );
    }
    if ( bExp == 0x7FFF ) {
        if (bSig0 | bSig1) {
            return propagateFloat128NaN(a, b, status);
        }
        return packFloat128( zSign, 0, 0, 0 );
    }
    if ( bExp == 0 ) {
        if ( ( bSig0 | bSig1 ) == 0 ) {
            if ( ( aExp | aSig0 | aSig1 ) == 0 ) {
 invalid:
                float_raise(float_flag_invalid, status);
                z.low = float128_default_nan_low;
                z.high = float128_default_nan_high;
                return z;
            }
            float_raise(float_flag_divbyzero, status);
            return packFloat128( zSign, 0x7FFF, 0, 0 );
        }
        normalizeFloat128Subnormal( bSig0, bSig1, &bExp, &bSig0, &bSig1 );
    }
    if ( aExp == 0 ) {
        if ( ( aSig0 | aSig1 ) == 0 ) return packFloat128( zSign, 0, 0, 0 );
        normalizeFloat128Subnormal( aSig0, aSig1, &aExp, &aSig0, &aSig1 );
    }
    zExp = aExp - bExp + 0x3FFD;
    shortShift128Left(
        aSig0 | LIT64( 0x0001000000000000 ), aSig1, 15, &aSig0, &aSig1 );
    shortShift128Left(
        bSig0 | LIT64( 0x0001000000000000 ), bSig1, 15, &bSig0, &bSig1 );
    if ( le128( bSig0, bSig1, aSig0, aSig1 ) ) {
        shift128Right( aSig0, aSig1, 1, &aSig0, &aSig1 );
        ++zExp;
    }
    zSig0 = estimateDiv128To64( aSig0, aSig1, bSig0 );
    mul128By64To192( bSig0, bSig1, zSig0, &term0, &term1, &term2 );
    sub192( aSig0, aSig1, 0, term0, term1, term2, &rem0, &rem1, &rem2 );
    while ( (int64_t) rem0 < 0 ) {
        --zSig0;
        add192( rem0, rem1, rem2, 0, bSig0, bSig1, &rem0, &rem1, &rem2 );
    }
    zSig1 = estimateDiv128To64( rem1, rem2, bSig0 );
    if ( ( zSig1 & 0x3FFF ) <= 4 ) {
        mul128By64To192( bSig0, bSig1, zSig1, &term1, &term2, &term3 );
        sub192( rem1, rem2, 0, term1, term2, term3, &rem1, &rem2, &rem3 );
        while ( (int64_t) rem1 < 0 ) {
            --zSig1;
            add192( rem1, rem2, rem3, 0, bSig0, bSig1, &rem1, &rem2, &rem3 );
        }
        zSig1 |= ( ( rem1 | rem2 | rem3 ) != 0 );
    }
    shift128ExtraRightJamming( zSig0, zSig1, 0, 15, &zSig0, &zSig1, &zSig2 );
    return roundAndPackFloat128(zSign, zExp, zSig0, zSig1, zSig2, status);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %r8, %r15
movq %rdi, %rbx
movq %rdi, 0x58(%rsp)
movabsq $0xffffffffffff, %rdi   # imm = 0xFFFFFFFFFFFF
movq %rsi, %r14
andq %rdi, %r14
movq %r14, 0x60(%rsp)
movq %rsi, %rax
shrq $0x30, %rax
movl $0x7fff, %r9d           # imm = 0x7FFF
movl %eax, %r10d
andl %r9d, %r10d
movl %r10d, 0x1c(%rsp)
movq %rdx, 0x30(%rsp)
andq %rcx, %rdi
movq %rdi, 0x38(%rsp)
movq %rcx, %r8
shrq $0x30, %r8
andl %r9d, %r8d
movl %r8d, 0xc(%rsp)
movq %rcx, %r12
xorq %rsi, %r12
cmpl %r9d, %r10d
jne 0x118c2
orq %rbx, %r14
jne 0x118d9
cmpl $0x7fff, %r8d           # imm = 0x7FFF
jne 0x11b1e
orq %rdx, %rdi
jne 0x118d9
jmp 0x11b3a
testl %r8d, %r8d
je 0x118e9
cmpl $0x7fff, %r8d           # imm = 0x7FFF
jne 0x11915
orq %rdx, %rdi
je 0x11afd
movq %rbx, %rdi
movq %r15, %r8
callq 0x10ca1
jmp 0x11b55
movq %rdi, %rcx
orq %rdx, %rcx
je 0x11b0c
leaq 0xc(%rsp), %rax
leaq 0x38(%rsp), %rcx
leaq 0x30(%rsp), %r8
movq %rdx, %rsi
movq %rax, %rdx
movl %r10d, %ebp
callq 0x1092e
movl %ebp, %r10d
movabsq $-0x8000000000000000, %rbp # imm = 0x8000000000000000
testl %r10d, %r10d
je 0x1192b
movq %r15, 0x20(%rsp)
jmp 0x1196c
movq %r14, %rax
orq %rbx, %rax
je 0x11b4d
movq %r15, 0x20(%rsp)
leaq 0x1c(%rsp), %r15
leaq 0x60(%rsp), %rax
leaq 0x58(%rsp), %r13
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %rax, %rbx
movq %rax, %rcx
movq %r13, %r8
callq 0x1092e
movl (%r15), %r10d
movq (%rbx), %r14
movq (%r13), %rbx
shrq $0x3f, %r12
movq %r12, 0x40(%rsp)
subl 0xc(%rsp), %r10d
movq %rbx, %r15
shlq $0xf, %r15
shldq $0xf, %rbx, %r14
orq %rbp, %r14
movq 0x38(%rsp), %r12
movq 0x30(%rsp), %r13
shldq $0xf, %r13, %r12
shlq $0xf, %r13
orq %rbp, %r12
cmpq %r14, %r12
setne %al
cmpq %r15, %r13
seta %cl
cmpq %r14, %r12
jb 0x119bd
orb %al, %cl
je 0x119bd
addl $0x3ffd, %r10d          # imm = 0x3FFD
jmp 0x119d0
shrq $0x31, %rbx
shrq %r14
shrdq $0x1, %rbx, %r15
addl $0x3ffe, %r10d          # imm = 0x3FFE
movl %r10d, 0x8(%rsp)
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xadbc
movq %rax, %rbx
leaq 0x50(%rsp), %rcx
leaq 0x28(%rsp), %rbp
leaq 0x10(%rsp), %r9
movq %r12, %rdi
movq %r13, %rsi
movq %rax, %rdx
movq %rbp, %r8
callq 0x11b64
xorl %eax, %eax
subq (%rbp), %r15
setb %al
leaq 0x50(%rsp), %rcx
subq (%rcx), %r14
xorl %ebp, %ebp
leaq 0x10(%rsp), %rcx
subq (%rcx), %rbp
sbbq $0x0, %r15
sbbq %rax, %r14
testq %r14, %r14
jns 0x11a3c
decq %rbx
addq %r13, %rbp
adcq %r12, %r15
adcq $0x0, %r14
jmp 0x11a28
movq %r15, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0xadbc
movq %rax, %r14
andl $0x3fff, %eax           # imm = 0x3FFF
cmpl $0x4, %eax
ja 0x11ad2
leaq 0x28(%rsp), %rcx
leaq 0x10(%rsp), %r8
leaq 0x48(%rsp), %r9
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x11b64
leaq 0x10(%rsp), %rax
movq (%rax), %rcx
leaq 0x48(%rsp), %rax
movq (%rax), %rdx
xorl %esi, %esi
movq %rbp, %rdi
subq %rcx, %rdi
setb %sil
leaq 0x28(%rsp), %rax
subq (%rax), %r15
xorl %eax, %eax
cmpq %rdx, %rax
sbbq %rcx, %rbp
subq %rdx, %rax
sbbq $0x0, %rdi
sbbq %rsi, %r15
movl 0x8(%rsp), %esi
testq %r15, %r15
jns 0x11ac2
decq %r14
addq %r13, %rax
adcq %r12, %rbp
adcq $0x0, %r15
jmp 0x11aae
orq %r15, %rbp
xorl %ecx, %ecx
orq %rax, %rbp
setne %cl
orq %rcx, %r14
jmp 0x11ad6
movl 0x8(%rsp), %esi
movq %rbx, %rcx
shldq $0x31, %r14, %rcx
shlq $0x31, %r14
shrq $0xf, %rbx
movzbl 0x40(%rsp), %edi
movq %rbx, %rdx
movq %r14, %r8
movq 0x20(%rsp), %r9
callq 0x115fc
jmp 0x11b55
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
andq %rax, %r12
jmp 0x11b50
andl $0x7fff, %eax           # imm = 0x7FFF
orq %rbx, %rax
orq %r14, %rax
je 0x11b3a
orb $0x4, 0x2(%r15)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
andq %rax, %r12
movabsq $0x7fff000000000000, %rdx # imm = 0x7FFF000000000000
orq %r12, %rdx
jmp 0x11b49
orb $0x1, 0x2(%r15)
movabsq $0x7fff800000000000, %rdx # imm = 0x7FFF800000000000
xorl %eax, %eax
jmp 0x11b55
andq %rbp, %r12
xorl %eax, %eax
movq %r12, %rdx
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq