// File: /workspace/github_c_makefile_star2_O0/mbitsnbites[P]SoftFP/softfloat.c
// Function: floatx80_sqrt
floatx80 floatx80_sqrt(floatx80 a, float_status *status)
{
    flag aSign;
    int32 aExp, zExp;
    uint64_t aSig0, aSig1, zSig0, zSig1, doubleZSig0;
    uint64_t rem0, rem1, rem2, rem3, term0, term1, term2, term3;
    floatx80 z;

    aSig0 = extractFloatx80Frac( a );
    aExp = extractFloatx80Exp( a );
    aSign = extractFloatx80Sign( a );
    if ( aExp == 0x7FFF ) {
        if ((uint64_t)(aSig0 << 1)) {
            return propagateFloatx80NaN(a, a, status);
        }
        if ( ! aSign ) return a;
        goto invalid;
    }
    if ( aSign ) {
        if ( ( aExp | aSig0 ) == 0 ) return a;
 invalid:
        float_raise(float_flag_invalid, status);
        z.low = floatx80_default_nan_low;
        z.high = floatx80_default_nan_high;
        return z;
    }
    if ( aExp == 0 ) {
        if ( aSig0 == 0 ) return packFloatx80( 0, 0, 0 );
        normalizeFloatx80Subnormal( aSig0, &aExp, &aSig0 );
    }
    zExp = ( ( aExp - 0x3FFF )>>1 ) + 0x3FFF;
    zSig0 = estimateSqrt32( aExp, aSig0>>32 );
    shift128Right( aSig0, 0, 2 + ( aExp & 1 ), &aSig0, &aSig1 );
    zSig0 = estimateDiv128To64( aSig0, aSig1, zSig0<<32 ) + ( zSig0<<30 );
    doubleZSig0 = zSig0<<1;
    mul64To128( zSig0, zSig0, &term0, &term1 );
    sub128( aSig0, aSig1, term0, term1, &rem0, &rem1 );
    while ( (int64_t) rem0 < 0 ) {
        --zSig0;
        doubleZSig0 -= 2;
        add128( rem0, rem1, zSig0>>63, doubleZSig0 | 1, &rem0, &rem1 );
    }
    zSig1 = estimateDiv128To64( rem1, 0, doubleZSig0 );
    if ( ( zSig1 & LIT64( 0x3FFFFFFFFFFFFFFF ) ) <= 5 ) {
        if ( zSig1 == 0 ) zSig1 = 1;
        mul64To128( doubleZSig0, zSig1, &term1, &term2 );
        sub128( rem1, 0, term1, term2, &rem1, &rem2 );
        mul64To128( zSig1, zSig1, &term2, &term3 );
        sub192( rem1, rem2, 0, 0, term2, term3, &rem1, &rem2, &rem3 );
        while ( (int64_t) rem1 < 0 ) {
            --zSig1;
            shortShift128Left( 0, zSig1, 1, &term2, &term3 );
            term3 |= 1;
            term2 |= doubleZSig0;
            add192( rem1, rem2, rem3, 0, term2, term3, &rem1, &rem2, &rem3 );
        }
        zSig1 |= ( ( rem1 | rem2 | rem3 ) != 0 );
    }
    shortShift128Left( 0, zSig1, 1, &zSig0, &zSig1 );
    zSig0 |= doubleZSig0;
    return roundAndPackFloatx80(status->floatx80_rounding_precision,
                                0, zExp, zSig0, zSig1, status);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movw %si, %ax
movq %rdi, -0x20(%rbp)
movw %ax, -0x18(%rbp)
movq %rdx, -0x28(%rbp)
movq -0x20(%rbp), %rdi
movzwl -0x18(%rbp), %esi
callq 0x1ab30
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rdi
movzwl -0x18(%rbp), %esi
callq 0x1ab50
movl %eax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
movzwl -0x18(%rbp), %esi
callq 0x1ab70
movb %al, -0x29(%rbp)
cmpl $0x7fff, -0x30(%rbp)    # imm = 0x7FFF
jne 0x1d4b7
movq -0x40(%rbp), %rax
shlq %rax
cmpq $0x0, %rax
je 0x1d49a
movq -0x28(%rbp), %r8
movq -0x20(%rbp), %rdi
movw -0x18(%rbp), %ax
movq -0x20(%rbp), %rdx
movzwl %ax, %esi
movzwl -0x18(%rbp), %ecx
callq 0x1b670
movq %rax, -0x10(%rbp)
movw %dx, -0x8(%rbp)
jmp 0x1d83a
cmpb $0x0, -0x29(%rbp)
jne 0x1d4b5
movq -0x20(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1d83a
jmp 0x1d4e2
cmpb $0x0, -0x29(%rbp)
je 0x1d525
movslq -0x30(%rbp), %rax
orq -0x40(%rbp), %rax
cmpq $0x0, %rax
jne 0x1d4e0
movq -0x20(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1d83a
jmp 0x1d4e2
movq -0x28(%rbp), %rsi
movl $0x1, %edi
callq 0x11080
movabsq $-0x4000000000000000, %rax # imm = 0xC000000000000000
movq %rax, -0xb0(%rbp)
movw $0xffff, -0xa8(%rbp)    # imm = 0xFFFF
movq -0xb0(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0xa8(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1d83a
cmpl $0x0, -0x30(%rbp)
jne 0x1d55d
cmpq $0x0, -0x40(%rbp)
jne 0x1d54c
xorl %esi, %esi
xorl %eax, %eax
movl %eax, %edx
movl %esi, %edi
callq 0x11990
movq %rax, -0x10(%rbp)
movw %dx, -0x8(%rbp)
jmp 0x1d83a
movq -0x40(%rbp), %rdi
leaq -0x30(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x1c210
movl -0x30(%rbp), %eax
subl $0x3fff, %eax           # imm = 0x3FFF
sarl %eax
addl $0x3fff, %eax           # imm = 0x3FFF
movl %eax, -0x34(%rbp)
movslq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rax
shrq $0x20, %rax
movl %eax, %esi
callq 0x157e0
movl %eax, %eax
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rdi
movl -0x30(%rbp), %eax
andl $0x1, %eax
addl $0x2, %eax
movslq %eax, %rdx
xorl %eax, %eax
movl %eax, %esi
leaq -0x40(%rbp), %rcx
leaq -0x48(%rbp), %r8
callq 0x17be0
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x50(%rbp), %rdx
shlq $0x20, %rdx
callq 0x14bf0
movq -0x50(%rbp), %rcx
shlq $0x1e, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
shlq %rax
movq %rax, -0x60(%rbp)
movq -0x50(%rbp), %rdi
movq -0x50(%rbp), %rsi
leaq -0x88(%rbp), %rdx
leaq -0x90(%rbp), %rcx
callq 0x18730
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x88(%rbp), %rdx
movq -0x90(%rbp), %rcx
leaq -0x68(%rbp), %r8
leaq -0x70(%rbp), %r9
callq 0x18b70
cmpq $0x0, -0x68(%rbp)
jge 0x1d65c
movq -0x50(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x50(%rbp)
movq -0x60(%rbp), %rax
subq $0x2, %rax
movq %rax, -0x60(%rbp)
movq -0x68(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0x50(%rbp), %rdx
shrq $0x3f, %rdx
movq -0x60(%rbp), %rcx
orq $0x1, %rcx
leaq -0x68(%rbp), %r8
leaq -0x70(%rbp), %r9
callq 0x18bd0
jmp 0x1d616
movq -0x70(%rbp), %rdi
movq -0x60(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x14bf0
movq %rax, -0x58(%rbp)
movabsq $0x3fffffffffffffff, %rax # imm = 0x3FFFFFFFFFFFFFFF
andq -0x58(%rbp), %rax
cmpq $0x5, %rax
ja 0x1d7ec
cmpq $0x0, -0x58(%rbp)
jne 0x1d698
movq $0x1, -0x58(%rbp)
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rsi
leaq -0x90(%rbp), %rdx
leaq -0x98(%rbp), %rcx
callq 0x18730
movq -0x70(%rbp), %rdi
movq -0x90(%rbp), %rdx
movq -0x98(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
leaq -0x70(%rbp), %r8
leaq -0x78(%rbp), %r9
callq 0x18b70
movq -0x58(%rbp), %rdi
movq -0x58(%rbp), %rsi
leaq -0x98(%rbp), %rdx
leaq -0xa0(%rbp), %rcx
callq 0x18730
movq -0x70(%rbp), %rdi
movq -0x78(%rbp), %rsi
movq -0x98(%rbp), %r8
movq -0xa0(%rbp), %r9
xorl %eax, %eax
movl %eax, %ecx
leaq -0x70(%rbp), %r11
leaq -0x78(%rbp), %r10
leaq -0x80(%rbp), %rax
movq %rcx, %rdx
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x1d850
cmpq $0x0, -0x70(%rbp)
jge 0x1d7ca
movq -0x58(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edi
movl $0x1, %edx
leaq -0x98(%rbp), %rcx
leaq -0xa0(%rbp), %r8
callq 0x121c0
movq -0xa0(%rbp), %rax
orq $0x1, %rax
movq %rax, -0xa0(%rbp)
movq -0x60(%rbp), %rax
orq -0x98(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x70(%rbp), %rdi
movq -0x78(%rbp), %rsi
movq -0x80(%rbp), %rdx
movq -0x98(%rbp), %r8
movq -0xa0(%rbp), %r9
xorl %eax, %eax
movl %eax, %ecx
leaq -0x70(%rbp), %r11
leaq -0x78(%rbp), %r10
leaq -0x80(%rbp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x1d930
jmp 0x1d72d
movq -0x70(%rbp), %rax
orq -0x78(%rbp), %rax
orq -0x80(%rbp), %rax
cmpq $0x0, %rax
setne %al
andb $0x1, %al
movzbl %al, %eax
cltq
orq -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edi
movl $0x1, %edx
leaq -0x50(%rbp), %rcx
leaq -0x58(%rbp), %r8
callq 0x121c0
movq -0x60(%rbp), %rax
orq -0x50(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x28(%rbp), %rax
movb 0x3(%rax), %al
movl -0x34(%rbp), %edx
movq -0x50(%rbp), %rcx
movq -0x58(%rbp), %r8
movq -0x28(%rbp), %r9
xorl %esi, %esi
movsbl %al, %edi
callq 0x1c260
movq %rax, -0x10(%rbp)
movw %dx, -0x8(%rbp)
movq -0x10(%rbp), %rax
movw -0x8(%rbp), %dx
addq $0xd0, %rsp
popq %rbp
retq
nopl (%rax,%rax)