// File: /workspace/github_c_makefile_star2_O0/mbitsnbites[P]SoftFP/softfloat.c
// Function: float64_div
float64 float64_div(float64 a, float64 b, float_status *status)
{
    flag aSign, bSign, zSign;
    int_fast16_t aExp, bExp, zExp;
    uint64_t aSig, bSig, zSig;
    uint64_t rem0, rem1;
    uint64_t term0, term1;
    a = float64_squash_input_denormal(a, status);
    b = float64_squash_input_denormal(b, status);

    aSig = extractFloat64Frac( a );
    aExp = extractFloat64Exp( a );
    aSign = extractFloat64Sign( a );
    bSig = extractFloat64Frac( b );
    bExp = extractFloat64Exp( b );
    bSign = extractFloat64Sign( b );
    zSign = aSign ^ bSign;
    if ( aExp == 0x7FF ) {
        if (aSig) {
            return propagateFloat64NaN(a, b, status);
        }
        if ( bExp == 0x7FF ) {
            if (bSig) {
                return propagateFloat64NaN(a, b, status);
            }
            float_raise(float_flag_invalid, status);
            return float64_default_nan;
        }
        return packFloat64( zSign, 0x7FF, 0 );
    }
    if ( bExp == 0x7FF ) {
        if (bSig) {
            return propagateFloat64NaN(a, b, status);
        }
        return packFloat64( zSign, 0, 0 );
    }
    if ( bExp == 0 ) {
        if ( bSig == 0 ) {
            if ( ( aExp | aSig ) == 0 ) {
                float_raise(float_flag_invalid, status);
                return float64_default_nan;
            }
            float_raise(float_flag_divbyzero, status);
            return packFloat64( zSign, 0x7FF, 0 );
        }
        normalizeFloat64Subnormal( bSig, &bExp, &bSig );
    }
    if ( aExp == 0 ) {
        if ( aSig == 0 ) return packFloat64( zSign, 0, 0 );
        normalizeFloat64Subnormal( aSig, &aExp, &aSig );
    }
    zExp = aExp - bExp + 0x3FD;
    aSig = ( aSig | LIT64( 0x0010000000000000 ) )<<10;
    bSig = ( bSig | LIT64( 0x0010000000000000 ) )<<11;
    if ( bSig <= ( aSig + aSig ) ) {
        aSig >>= 1;
        ++zExp;
    }
    zSig = estimateDiv128To64( aSig, 0, bSig );
    if ( ( zSig & 0x1FF ) <= 2 ) {
        mul64To128( bSig, zSig, &term0, &term1 );
        sub128( aSig, 0, term0, term1, &rem0, &rem1 );
        while ( (int64_t) rem0 < 0 ) {
            --zSig;
            add128( rem0, rem1, 0, bSig, &rem0, &rem1 );
        }
        zSig |= ( rem1 != 0 );
    }
    return roundAndPackFloat64(zSign, zExp, zSig, status);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x11610
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x11610
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x116a0
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
callq 0x11680
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0x168f0
movb %al, -0x21(%rbp)
movq -0x18(%rbp), %rdi
callq 0x116a0
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rdi
callq 0x11680
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
callq 0x168f0
movb %al, -0x22(%rbp)
movzbl -0x21(%rbp), %eax
movzbl -0x22(%rbp), %ecx
xorl %ecx, %eax
movb %al, -0x23(%rbp)
cmpq $0x7ff, -0x30(%rbp)     # imm = 0x7FF
jne 0x18948
cmpq $0x0, -0x48(%rbp)
je 0x188e1
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x17f70
movq %rax, -0x8(%rbp)
jmp 0x18b5c
cmpq $0x7ff, -0x38(%rbp)     # imm = 0x7FF
jne 0x1892d
cmpq $0x0, -0x50(%rbp)
je 0x1890c
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x17f70
movq %rax, -0x8(%rbp)
jmp 0x18b5c
movq -0x20(%rbp), %rsi
movl $0x1, %edi
callq 0x11080
movabsq $0x7ff8000000000000, %rax # imm = 0x7FF8000000000000
movq %rax, -0x8(%rbp)
jmp 0x18b5c
movl $0x7ff, %esi            # imm = 0x7FF
xorl %eax, %eax
movl %eax, %edx
movzbl -0x23(%rbp), %edi
callq 0x118b0
movq %rax, -0x8(%rbp)
jmp 0x18b5c
cmpq $0x7ff, -0x38(%rbp)     # imm = 0x7FF
jne 0x1898c
cmpq $0x0, -0x50(%rbp)
je 0x18973
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x17f70
movq %rax, -0x8(%rbp)
jmp 0x18b5c
xorl %eax, %eax
movl %eax, %edx
movzbl -0x23(%rbp), %edi
movq %rdx, %rsi
callq 0x118b0
movq %rax, -0x8(%rbp)
jmp 0x18b5c
cmpq $0x0, -0x38(%rbp)
jne 0x18a03
cmpq $0x0, -0x50(%rbp)
jne 0x189f2
movq -0x30(%rbp), %rax
orq -0x48(%rbp), %rax
cmpq $0x0, %rax
jne 0x189c9
movq -0x20(%rbp), %rsi
movl $0x1, %edi
callq 0x11080
movabsq $0x7ff8000000000000, %rax # imm = 0x7FF8000000000000
movq %rax, -0x8(%rbp)
jmp 0x18b5c
movq -0x20(%rbp), %rsi
movl $0x4, %edi
callq 0x11080
movl $0x7ff, %esi            # imm = 0x7FF
xorl %eax, %eax
movl %eax, %edx
movzbl -0x23(%rbp), %edi
callq 0x118b0
movq %rax, -0x8(%rbp)
jmp 0x18b5c
movq -0x50(%rbp), %rdi
leaq -0x38(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x17a20
cmpq $0x0, -0x30(%rbp)
jne 0x18a3b
cmpq $0x0, -0x48(%rbp)
jne 0x18a2a
xorl %eax, %eax
movl %eax, %edx
movzbl -0x23(%rbp), %edi
movq %rdx, %rsi
callq 0x118b0
movq %rax, -0x8(%rbp)
jmp 0x18b5c
movq -0x48(%rbp), %rdi
leaq -0x30(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0x17a20
movq -0x30(%rbp), %rax
subq -0x38(%rbp), %rax
addq $0x3fd, %rax            # imm = 0x3FD
movq %rax, -0x40(%rbp)
movabsq $0x10000000000000, %rax # imm = 0x10000000000000
orq -0x48(%rbp), %rax
shlq $0xa, %rax
movq %rax, -0x48(%rbp)
movabsq $0x10000000000000, %rax # imm = 0x10000000000000
orq -0x50(%rbp), %rax
shlq $0xb, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq -0x48(%rbp), %rcx
addq -0x48(%rbp), %rcx
cmpq %rcx, %rax
ja 0x18aa1
movq -0x48(%rbp), %rax
shrq %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x48(%rbp), %rdi
movq -0x50(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x14bf0
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
andq $0x1ff, %rax            # imm = 0x1FF
cmpq $0x2, %rax
ja 0x18b41
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
leaq -0x70(%rbp), %rdx
leaq -0x78(%rbp), %rcx
callq 0x18730
movq -0x48(%rbp), %rdi
movq -0x70(%rbp), %rdx
movq -0x78(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
leaq -0x60(%rbp), %r8
leaq -0x68(%rbp), %r9
callq 0x18b70
cmpq $0x0, -0x60(%rbp)
jge 0x18b2a
movq -0x58(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x58(%rbp)
movq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq -0x50(%rbp), %rcx
xorl %eax, %eax
movl %eax, %edx
leaq -0x60(%rbp), %r8
leaq -0x68(%rbp), %r9
callq 0x18bd0
jmp 0x18af8
cmpq $0x0, -0x68(%rbp)
setne %al
andb $0x1, %al
movzbl %al, %eax
cltq
orq -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
movb -0x23(%rbp), %al
movq -0x40(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq -0x20(%rbp), %rcx
movzbl %al, %edi
callq 0x12390
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)