// File: /workspace/github_c_makefile_star2_O0/mbitsnbites[P]SoftFP/softfloat.c
// Function: floatx80_div
floatx80 floatx80_div(floatx80 a, floatx80 b, float_status *status)
{
    flag aSign, bSign, zSign;
    int32 aExp, bExp, zExp;
    uint64_t aSig, bSig, zSig0, zSig1;
    uint64_t rem0, rem1, rem2, term0, term1, term2;
    floatx80 z;

    aSig = extractFloatx80Frac( a );
    aExp = extractFloatx80Exp( a );
    aSign = extractFloatx80Sign( a );
    bSig = extractFloatx80Frac( b );
    bExp = extractFloatx80Exp( b );
    bSign = extractFloatx80Sign( b );
    zSign = aSign ^ bSign;
    if ( aExp == 0x7FFF ) {
        if ((uint64_t)(aSig << 1)) {
            return propagateFloatx80NaN(a, b, status);
        }
        if ( bExp == 0x7FFF ) {
            if ((uint64_t)(bSig << 1)) {
                return propagateFloatx80NaN(a, b, status);
            }
            goto invalid;
        }
        return packFloatx80( zSign, 0x7FFF, LIT64( 0x8000000000000000 ) );
    }
    if ( bExp == 0x7FFF ) {
        if ((uint64_t)(bSig << 1)) {
            return propagateFloatx80NaN(a, b, status);
        }
        return packFloatx80( zSign, 0, 0 );
    }
    if ( bExp == 0 ) {
        if ( bSig == 0 ) {
            if ( ( aExp | aSig ) == 0 ) {
 invalid:
                float_raise(float_flag_invalid, status);
                z.low = floatx80_default_nan_low;
                z.high = floatx80_default_nan_high;
                return z;
            }
            float_raise(float_flag_divbyzero, status);
            return packFloatx80( zSign, 0x7FFF, LIT64( 0x8000000000000000 ) );
        }
        normalizeFloatx80Subnormal( bSig, &bExp, &bSig );
    }
    if ( aExp == 0 ) {
        if ( aSig == 0 ) return packFloatx80( zSign, 0, 0 );
        normalizeFloatx80Subnormal( aSig, &aExp, &aSig );
    }
    zExp = aExp - bExp + 0x3FFE;
    rem1 = 0;
    if ( bSig <= aSig ) {
        shift128Right( aSig, 0, 1, &aSig, &rem1 );
        ++zExp;
    }
    zSig0 = estimateDiv128To64( aSig, rem1, bSig );
    mul64To128( bSig, zSig0, &term0, &term1 );
    sub128( aSig, rem1, term0, term1, &rem0, &rem1 );
    while ( (int64_t) rem0 < 0 ) {
        --zSig0;
        add128( rem0, rem1, 0, bSig, &rem0, &rem1 );
    }
    zSig1 = estimateDiv128To64( rem1, 0, bSig );
    if ( (uint64_t) ( zSig1<<1 ) <= 8 ) {
        mul64To128( bSig, zSig1, &term1, &term2 );
        sub128( rem1, 0, term1, term2, &rem1, &rem2 );
        while ( (int64_t) rem1 < 0 ) {
            --zSig1;
            add128( rem1, rem2, 0, bSig, &rem1, &rem2 );
        }
        zSig1 |= ( ( rem1 | rem2 ) != 0 );
    }
    return roundAndPackFloatx80(status->floatx80_rounding_precision,
                                zSign, zExp, zSig0, zSig1, status);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movw %cx, %ax
movw %si, %cx
movq %rdi, -0x20(%rbp)
movw %cx, -0x18(%rbp)
movq %rdx, -0x30(%rbp)
movw %ax, -0x28(%rbp)
movq %r8, -0x38(%rbp)
movq -0x20(%rbp), %rdi
movzwl -0x18(%rbp), %esi
callq 0x1ab30
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rdi
movzwl -0x18(%rbp), %esi
callq 0x1ab50
movl %eax, -0x40(%rbp)
movq -0x20(%rbp), %rdi
movzwl -0x18(%rbp), %esi
callq 0x1ab70
movb %al, -0x39(%rbp)
movq -0x30(%rbp), %rdi
movzwl -0x28(%rbp), %esi
callq 0x1ab30
movq %rax, -0x58(%rbp)
movq -0x30(%rbp), %rdi
movzwl -0x28(%rbp), %esi
callq 0x1ab50
movl %eax, -0x44(%rbp)
movq -0x30(%rbp), %rdi
movzwl -0x28(%rbp), %esi
callq 0x1ab70
movb %al, -0x3a(%rbp)
movzbl -0x39(%rbp), %eax
movzbl -0x3a(%rbp), %ecx
xorl %ecx, %eax
movb %al, -0x3b(%rbp)
cmpl $0x7fff, -0x40(%rbp)    # imm = 0x7FFF
jne 0x1cad0
movq -0x50(%rbp), %rax
shlq %rax
cmpq $0x0, %rax
je 0x1ca67
movq -0x38(%rbp), %r8
movq -0x20(%rbp), %rdi
movw -0x18(%rbp), %ax
movq -0x30(%rbp), %rdx
movzwl %ax, %esi
movzwl -0x28(%rbp), %ecx
callq 0x1b670
movq %rax, -0x10(%rbp)
movw %dx, -0x8(%rbp)
jmp 0x1cdbb
cmpl $0x7fff, -0x44(%rbp)    # imm = 0x7FFF
jne 0x1caab
movq -0x58(%rbp), %rax
shlq %rax
cmpq $0x0, %rax
je 0x1caa6
movq -0x38(%rbp), %r8
movq -0x20(%rbp), %rdi
movw -0x18(%rbp), %ax
movq -0x30(%rbp), %rdx
movzwl %ax, %esi
movzwl -0x28(%rbp), %ecx
callq 0x1b670
movq %rax, -0x10(%rbp)
movw %dx, -0x8(%rbp)
jmp 0x1cdbb
jmp 0x1cb50
movl $0x7fff, %esi           # imm = 0x7FFF
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
movzbl -0x3b(%rbp), %edi
callq 0x11990
movq %rax, -0x10(%rbp)
movw %dx, -0x8(%rbp)
jmp 0x1cdbb
cmpl $0x7fff, -0x44(%rbp)    # imm = 0x7FFF
jne 0x1cb2b
movq -0x58(%rbp), %rax
shlq %rax
cmpq $0x0, %rax
je 0x1cb0f
movq -0x38(%rbp), %r8
movq -0x20(%rbp), %rdi
movw -0x18(%rbp), %ax
movq -0x30(%rbp), %rdx
movzwl %ax, %esi
movzwl -0x28(%rbp), %ecx
callq 0x1b670
movq %rax, -0x10(%rbp)
movw %dx, -0x8(%rbp)
jmp 0x1cdbb
xorl %esi, %esi
xorl %eax, %eax
movl %eax, %edx
movzbl -0x3b(%rbp), %edi
callq 0x11990
movq %rax, -0x10(%rbp)
movw %dx, -0x8(%rbp)
jmp 0x1cdbb
cmpl $0x0, -0x44(%rbp)
jne 0x1cbd7
cmpq $0x0, -0x58(%rbp)
jne 0x1cbc6
movslq -0x40(%rbp), %rax
orq -0x50(%rbp), %rax
cmpq $0x0, %rax
jne 0x1cb93
jmp 0x1cb50
movq -0x38(%rbp), %rsi
movl $0x1, %edi
callq 0x11080
movabsq $-0x4000000000000000, %rax # imm = 0xC000000000000000
movq %rax, -0xa8(%rbp)
movw $0xffff, -0xa0(%rbp)    # imm = 0xFFFF
movq -0xa8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1cdbb
movq -0x38(%rbp), %rsi
movl $0x4, %edi
callq 0x11080
movl $0x7fff, %esi           # imm = 0x7FFF
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
movzbl -0x3b(%rbp), %edi
callq 0x11990
movq %rax, -0x10(%rbp)
movw %dx, -0x8(%rbp)
jmp 0x1cdbb
movq -0x58(%rbp), %rdi
leaq -0x44(%rbp), %rsi
leaq -0x58(%rbp), %rdx
callq 0x1c210
cmpl $0x0, -0x40(%rbp)
jne 0x1cc11
cmpq $0x0, -0x50(%rbp)
jne 0x1cc00
xorl %esi, %esi
xorl %eax, %eax
movl %eax, %edx
movzbl -0x3b(%rbp), %edi
callq 0x11990
movq %rax, -0x10(%rbp)
movw %dx, -0x8(%rbp)
jmp 0x1cdbb
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x1c210
movl -0x40(%rbp), %eax
subl -0x44(%rbp), %eax
addl $0x3ffe, %eax           # imm = 0x3FFE
movl %eax, -0x48(%rbp)
movq $0x0, -0x78(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x50(%rbp), %rax
ja 0x1cc54
movq -0x50(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
leaq -0x50(%rbp), %rcx
leaq -0x78(%rbp), %r8
callq 0x17be0
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
movq -0x50(%rbp), %rdi
movq -0x78(%rbp), %rsi
movq -0x58(%rbp), %rdx
callq 0x14bf0
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rdi
movq -0x60(%rbp), %rsi
leaq -0x88(%rbp), %rdx
leaq -0x90(%rbp), %rcx
callq 0x18730
movq -0x50(%rbp), %rdi
movq -0x78(%rbp), %rsi
movq -0x88(%rbp), %rdx
movq -0x90(%rbp), %rcx
leaq -0x70(%rbp), %r8
leaq -0x78(%rbp), %r9
callq 0x18b70
cmpq $0x0, -0x70(%rbp)
jge 0x1ccd9
movq -0x60(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x60(%rbp)
movq -0x70(%rbp), %rdi
movq -0x78(%rbp), %rsi
movq -0x58(%rbp), %rcx
xorl %eax, %eax
movl %eax, %edx
leaq -0x70(%rbp), %r8
leaq -0x78(%rbp), %r9
callq 0x18bd0
jmp 0x1cca7
movq -0x78(%rbp), %rdi
movq -0x58(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x14bf0
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
shlq %rax
cmpq $0x8, %rax
ja 0x1cd8d
movq -0x58(%rbp), %rdi
movq -0x68(%rbp), %rsi
leaq -0x90(%rbp), %rdx
leaq -0x98(%rbp), %rcx
callq 0x18730
movq -0x78(%rbp), %rdi
movq -0x90(%rbp), %rdx
movq -0x98(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
leaq -0x78(%rbp), %r8
leaq -0x80(%rbp), %r9
callq 0x18b70
cmpq $0x0, -0x78(%rbp)
jge 0x1cd6f
movq -0x68(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x68(%rbp)
movq -0x78(%rbp), %rdi
movq -0x80(%rbp), %rsi
movq -0x58(%rbp), %rcx
xorl %eax, %eax
movl %eax, %edx
leaq -0x78(%rbp), %r8
leaq -0x80(%rbp), %r9
callq 0x18bd0
jmp 0x1cd3d
movq -0x78(%rbp), %rax
orq -0x80(%rbp), %rax
cmpq $0x0, %rax
setne %al
andb $0x1, %al
movzbl %al, %eax
cltq
orq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x38(%rbp), %rax
movb 0x3(%rax), %sil
movb -0x3b(%rbp), %al
movl -0x48(%rbp), %edx
movq -0x60(%rbp), %rcx
movq -0x68(%rbp), %r8
movq -0x38(%rbp), %r9
movsbl %sil, %edi
movzbl %al, %esi
callq 0x1c260
movq %rax, -0x10(%rbp)
movw %dx, -0x8(%rbp)
movq -0x10(%rbp), %rax
movw -0x8(%rbp), %dx
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax)