// File: /workspace/github_c_makefile_star2_O1/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, %r12
movq %rdi, %rbx
movq %rdi, 0x8(%rsp)
movabsq $0xffffffffffff, %rdi   # imm = 0xFFFFFFFFFFFF
movq %rsi, %r14
andq %rdi, %r14
movq %r14, 0x10(%rsp)
movq %rsi, %rax
shrq $0x30, %rax
movl $0x7fff, %r9d           # imm = 0x7FFF
movl %eax, %ebp
andl %r9d, %ebp
movl %ebp, 0x1c(%rsp)
movq %rdx, 0x30(%rsp)
andq %rcx, %rdi
movq %rdi, 0x38(%rsp)
movq %rcx, %r8
shrq $0x30, %r8
andl %r9d, %r8d
movl %r8d, 0x18(%rsp)
movq %rcx, %r13
xorq %rsi, %r13
cmpl %r9d, %ebp
jne 0x13064
orq %rbx, %r14
jne 0x1307b
cmpl $0x7fff, %r8d           # imm = 0x7FFF
jne 0x133ec
orq %rdx, %rdi
jne 0x1307b
jmp 0x13408
testl %r8d, %r8d
je 0x1308b
cmpl $0x7fff, %r8d           # imm = 0x7FFF
jne 0x130b1
orq %rdx, %rdi
je 0x133c7
movq %rbx, %rdi
movq %r12, %r8
callq 0x12261
jmp 0x13494
movq %rdi, %rcx
orq %rdx, %rcx
je 0x133d9
leaq 0x18(%rsp), %rax
leaq 0x38(%rsp), %rcx
leaq 0x30(%rsp), %r8
movq %rdx, %rsi
movq %rax, %rdx
callq 0x11f08
movabsq $-0x8000000000000000, %r15 # imm = 0x8000000000000000
testl %ebp, %ebp
jne 0x130e5
movq %r14, %rax
orq %rbx, %rax
je 0x1348c
leaq 0x1c(%rsp), %rdx
leaq 0x10(%rsp), %rcx
leaq 0x8(%rsp), %r8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x11f08
movl 0x1c(%rsp), %r8d
subl 0x18(%rsp), %r8d
movq 0x10(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, %r9
shlq $0xf, %r9
shldq $0xf, %rcx, %rax
orq %r15, %rax
movq 0x38(%rsp), %rsi
movq 0x30(%rsp), %r14
movq %r14, %rbp
shlq $0xf, %rbp
shlq $0xf, %rsi
orq %r15, %rsi
movq %r14, %rdx
shrq $0x31, %rdx
movq %rsi, 0x28(%rsp)
orq %rsi, %rdx
cmpq %rax, %rdx
setne %sil
cmpq %r9, %rbp
seta %dil
movq %r9, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movq %rbp, 0x30(%rsp)
movq %rdx, 0x38(%rsp)
cmpq %rax, %rdx
movq %r12, 0x60(%rsp)
jb 0x13169
orb %sil, %dil
je 0x13169
addl $0x3ffd, %r8d           # imm = 0x3FFD
jmp 0x13186
shrq $0x31, %rcx
shldq $0x3f, %r9, %rcx
shrq %rax
movq %rcx, 0x8(%rsp)
movq %rax, 0x10(%rsp)
addl $0x3ffe, %r8d           # imm = 0x3FFE
movl %r8d, 0x4(%rsp)
shrq $0x3f, %r13
movq %r13, 0x58(%rsp)
movq 0x10(%rsp), %rbx
movq 0x8(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rsi
movq %rdx, 0x20(%rsp)
callq 0xb99f
movq %rax, %r15
movq %rbp, %rdx
shrq $0x20, %rdx
movq %rax, %r8
shrq $0x20, %r8
movl %ebp, %esi
andl $0xffff8000, %esi       # imm = 0xFFFF8000
movl %r15d, %ecx
movq %r8, %rax
movq %rsi, 0x48(%rsp)
imulq %rsi, %rax
movq %rcx, %rsi
imulq %rdx, %rsi
movq %r8, %r13
movq %rdx, 0x50(%rsp)
imulq %rdx, %r13
xorl %edi, %edi
addq %rax, %rsi
setb %dil
shlq $0x20, %rdi
movq %rsi, %r9
shrq $0x20, %r9
shlq $0x20, %rsi
movq %r15, %rax
imulq %rbp, %rax
movq 0x28(%rsp), %rdx
shrq $0x20, %rdx
movl 0x20(%rsp), %r11d
movq %r8, %r10
movq %r11, 0x40(%rsp)
imulq %r11, %r10
imulq %rdx, %rcx
movq %rdx, 0x28(%rsp)
imulq %rdx, %r8
xorl %r11d, %r11d
addq %r10, %rcx
setae %r11b
movq %rcx, %r10
shrq $0x20, %r10
addq %r8, %r10
subq %r10, %rbx
shlq $0x20, %r11
addq %r11, %rbx
movq 0x20(%rsp), %rdx
movq %r15, %r8
imulq %rdx, %r8
addq %r8, %r13
addq %r9, %r13
shlq $0x20, %rcx
cmpq %rsi, %rax
adcq %rdi, %r13
xorl %esi, %esi
cmpq %r8, %r13
setb %sil
movabsq $-0x100000000, %rdi     # imm = 0xFFFFFFFF00000000
addq %rdi, %rbx
cmpq %rcx, %r8
sbbq $0x0, %rbx
subq %r13, %r12
sbbq %rsi, %rbx
negq %rax
sbbq $0x0, %r12
sbbq $0x0, %rbx
js 0x1329e
movq %rax, %r13
jmp 0x132d6
movq %r15, %rsi
shlq $0xf, %rsi
movl $0x8000, %ecx           # imm = 0x8000
subq %rsi, %rcx
imulq %r14, %rcx
decq %r15
xorl %esi, %esi
addq %rdx, %r12
setb %sil
cmpq %rax, %rcx
adcq $0x0, %r12
adcq %rsi, %rbx
leaq (%rax,%rbp), %r13
addq %rbp, %rcx
movq %r13, %rax
testq %rbx, %rbx
js 0x132b1
movq %r12, %rdi
movq %r13, %rsi
callq 0xb99f
movl %eax, %ecx
andl $0x3fff, %ecx           # imm = 0x3FFF
cmpl $0x4, %ecx
ja 0x133be
movabsq $0x100000000, %rdi      # imm = 0x100000000
movq %rax, %rsi
shrq $0x20, %rsi
movl %eax, %edx
movq 0x48(%rsp), %rcx
imulq %rsi, %rcx
movq %rdx, %r8
movq 0x50(%rsp), %rbx
imulq %rbx, %r8
imulq %rsi, %rbx
xorl %r9d, %r9d
addq %rcx, %r8
cmovaeq %r9, %rdi
movq %r8, %r10
shrq $0x20, %r10
shlq $0x20, %r8
movq 0x40(%rsp), %r11
imulq %rsi, %r11
movq 0x28(%rsp), %rcx
imulq %rcx, %rdx
imulq %rcx, %rsi
movq %rax, %rcx
imulq %rbp, %rcx
addq %r11, %rdx
movabsq $-0x100000000, %r11     # imm = 0xFFFFFFFF00000000
cmovaeq %r9, %r11
movq %rax, %r9
imulq 0x20(%rsp), %r9
addq %r9, %rbx
addq %r10, %rbx
movq %rdx, %r10
shrq $0x20, %r10
shlq $0x20, %rdx
cmpq %r8, %rcx
adcq %rdi, %rbx
xorl %edi, %edi
cmpq %r9, %rbx
setb %dil
addq %rsi, %r10
subq %r10, %r12
addq %r11, %r12
cmpq %rdx, %r9
sbbq $0x0, %r12
subq %rbx, %r13
sbbq %rdi, %r12
negq %rcx
sbbq $0x0, %r13
sbbq $0x0, %r12
movq 0x20(%rsp), %rbx
js 0x1341c
movq %rcx, %rdx
movl 0x4(%rsp), %esi
jmp 0x13457
movl 0x4(%rsp), %esi
jmp 0x13465
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
andq %rax, %r13
jmp 0x1348f
andl $0x7fff, %eax           # imm = 0x7FFF
orq %rbx, %rax
orq %r14, %rax
je 0x13408
orb $0x4, 0x2(%r12)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
andq %rax, %r13
movabsq $0x7fff000000000000, %rdx # imm = 0x7FFF000000000000
orq %r13, %rdx
jmp 0x13418
orb $0x1, 0x2(%r12)
movabsq $0x7fff800000000000, %rdx # imm = 0x7FFF800000000000
xorl %eax, %eax
jmp 0x13494
movq %rax, %rdx
shlq $0xf, %rdx
movl $0x8000, %esi           # imm = 0x8000
subq %rdx, %rsi
imulq %rsi, %r14
movl 0x4(%rsp), %esi
decq %rax
xorl %edx, %edx
addq %rbx, %r13
setb %dl
cmpq %rcx, %r14
adcq $0x0, %r13
adcq %rdx, %r12
leaq (%rcx,%rbp), %rdx
addq %rbp, %r14
movq %rdx, %rcx
testq %r12, %r12
js 0x13433
orq %r13, %r12
xorl %ecx, %ecx
orq %rdx, %r12
setne %cl
orq %rcx, %rax
movq %r15, %rcx
shldq $0x31, %rax, %rcx
shlq $0x31, %rax
shrq $0xf, %r15
movzbl 0x58(%rsp), %edi
movq %r15, %rdx
movq %rax, %r8
movq 0x60(%rsp), %r9
callq 0x12d7b
jmp 0x13494
andq %r15, %r13
xorl %eax, %eax
movq %r13, %rdx
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq