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

    aSig = extractFloat64Frac( a );
    aExp = extractFloat64Exp( a );
    aSign = extractFloat64Sign( a );
    if ( aExp == 0x7FF ) {
        if (aSig) {
            return propagateFloat64NaN(a, a, status);
        }
        if ( ! aSign ) return a;
        float_raise(float_flag_invalid, status);
        return float64_default_nan;
    }
    if ( aSign ) {
        if ( ( aExp | aSig ) == 0 ) return a;
        float_raise(float_flag_invalid, status);
        return float64_default_nan;
    }
    if ( aExp == 0 ) {
        if ( aSig == 0 ) return float64_zero;
        normalizeFloat64Subnormal( aSig, &aExp, &aSig );
    }
    zExp = ( ( aExp - 0x3FF )>>1 ) + 0x3FE;
    aSig |= LIT64( 0x0010000000000000 );
    zSig = estimateSqrt32( aExp, aSig>>21 );
    aSig <<= 9 - ( aExp & 1 );
    zSig = estimateDiv128To64( aSig, 0, zSig<<32 ) + ( zSig<<30 );
    if ( ( zSig & 0x1FF ) <= 5 ) {
        doubleZSig = zSig<<1;
        mul64To128( zSig, zSig, &term0, &term1 );
        sub128( aSig, 0, term0, term1, &rem0, &rem1 );
        while ( (int64_t) rem0 < 0 ) {
            --zSig;
            doubleZSig -= 2;
            add128( rem0, rem1, zSig>>63, doubleZSig | 1, &rem0, &rem1 );
        }
        zSig |= ( ( rem0 | rem1 ) != 0 );
    }
    return roundAndPackFloat64(0, zExp, zSig, status);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x11610
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x116a0
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
callq 0x11680
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x168f0
movb %al, -0x19(%rbp)
cmpq $0x7ff, -0x28(%rbp)     # imm = 0x7FF
jne 0x19e66
cmpq $0x0, -0x38(%rbp)
je 0x19e32
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x17f70
movq %rax, -0x8(%rbp)
jmp 0x1a021
cmpb $0x0, -0x19(%rbp)
jne 0x19e45
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1a021
movq -0x18(%rbp), %rsi
movl $0x1, %edi
callq 0x11080
movabsq $0x7ff8000000000000, %rax # imm = 0x7FF8000000000000
movq %rax, -0x8(%rbp)
jmp 0x1a021
cmpb $0x0, -0x19(%rbp)
je 0x19ea8
movq -0x28(%rbp), %rax
orq -0x38(%rbp), %rax
cmpq $0x0, %rax
jne 0x19e87
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1a021
movq -0x18(%rbp), %rsi
movl $0x1, %edi
callq 0x11080
movabsq $0x7ff8000000000000, %rax # imm = 0x7FF8000000000000
movq %rax, -0x8(%rbp)
jmp 0x1a021
cmpq $0x0, -0x28(%rbp)
jne 0x19ed4
cmpq $0x0, -0x38(%rbp)
jne 0x19ec3
movq $0x0, -0x8(%rbp)
jmp 0x1a021
movq -0x38(%rbp), %rdi
leaq -0x28(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0x17a20
movq -0x28(%rbp), %rax
subq $0x3ff, %rax            # imm = 0x3FF
sarq %rax
addq $0x3fe, %rax            # imm = 0x3FE
movq %rax, -0x30(%rbp)
movabsq $0x10000000000000, %rax # imm = 0x10000000000000
orq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rax
shrq $0x15, %rax
movl %eax, %esi
callq 0x157e0
movl %eax, %eax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rax
andq $0x1, %rax
movl $0x9, %ecx
subq %rax, %rcx
movq -0x38(%rbp), %rax
shlq %cl, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rdx
shlq $0x20, %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x14bf0
movq -0x40(%rbp), %rcx
shlq $0x1e, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
andq $0x1ff, %rax            # imm = 0x1FF
cmpq $0x5, %rax
ja 0x1a00a
movq -0x40(%rbp), %rax
shlq %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rdi
movq -0x40(%rbp), %rsi
leaq -0x60(%rbp), %rdx
leaq -0x68(%rbp), %rcx
callq 0x18730
movq -0x38(%rbp), %rdi
movq -0x60(%rbp), %rdx
movq -0x68(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
leaq -0x50(%rbp), %r8
leaq -0x58(%rbp), %r9
callq 0x18b70
cmpq $0x0, -0x50(%rbp)
jge 0x19fec
movq -0x40(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x48(%rbp), %rax
subq $0x2, %rax
movq %rax, -0x48(%rbp)
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x40(%rbp), %rdx
shrq $0x3f, %rdx
movq -0x48(%rbp), %rcx
orq $0x1, %rcx
leaq -0x50(%rbp), %r8
leaq -0x58(%rbp), %r9
callq 0x18bd0
jmp 0x19fa6
movq -0x50(%rbp), %rax
orq -0x58(%rbp), %rax
cmpq $0x0, %rax
setne %al
andb $0x1, %al
movzbl %al, %eax
cltq
orq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x18(%rbp), %rcx
xorl %edi, %edi
callq 0x12390
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)