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

    aSig1 = extractFloat128Frac1( a );
    aSig0 = extractFloat128Frac0( a );
    aExp = extractFloat128Exp( a );
    aSign = extractFloat128Sign( a );
    if ( aExp == 0x7FFF ) {
        if (aSig0 | aSig1) {
            return propagateFloat128NaN(a, a, status);
        }
        if ( ! aSign ) return a;
        goto invalid;
    }
    if ( aSign ) {
        if ( ( aExp | aSig0 | aSig1 ) == 0 ) return a;
 invalid:
        float_raise(float_flag_invalid, status);
        z.low = float128_default_nan_low;
        z.high = float128_default_nan_high;
        return z;
    }
    if ( aExp == 0 ) {
        if ( ( aSig0 | aSig1 ) == 0 ) return packFloat128( 0, 0, 0, 0 );
        normalizeFloat128Subnormal( aSig0, aSig1, &aExp, &aSig0, &aSig1 );
    }
    zExp = ( ( aExp - 0x3FFF )>>1 ) + 0x3FFE;
    aSig0 |= LIT64( 0x0001000000000000 );
    zSig0 = estimateSqrt32( aExp, aSig0>>17 );
    shortShift128Left( aSig0, aSig1, 13 - ( 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 & 0x1FFF ) <= 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 );
    }
    shift128ExtraRightJamming( zSig0, zSig1, 0, 14, &zSig0, &zSig1, &zSig2 );
    return roundAndPackFloat128(0, zExp, zSig0, zSig1, zSig2, status);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x20(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x28(%rbp)
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1e410
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1e430
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1e450
movl %eax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1e470
movb %al, -0x29(%rbp)
cmpl $0x7fff, -0x30(%rbp)    # imm = 0x7FFF
jne 0x21713
movq -0x40(%rbp), %rax
orq -0x48(%rbp), %rax
cmpq $0x0, %rax
je 0x216f6
movq -0x28(%rbp), %r8
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rcx
callq 0x1f480
movq %rax, -0x10(%rbp)
movq %rdx, -0x8(%rbp)
jmp 0x21ac6
cmpb $0x0, -0x29(%rbp)
jne 0x21711
movq -0x20(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x21ac6
jmp 0x21742
cmpb $0x0, -0x29(%rbp)
je 0x21787
movslq -0x30(%rbp), %rax
orq -0x40(%rbp), %rax
orq -0x48(%rbp), %rax
cmpq $0x0, %rax
jne 0x21740
movq -0x20(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x21ac6
jmp 0x21742
movq -0x28(%rbp), %rsi
movl $0x1, %edi
callq 0x11080
movq $0x0, -0xb8(%rbp)
movabsq $0x7fff800000000000, %rax # imm = 0x7FFF800000000000
movq %rax, -0xb0(%rbp)
movq -0xb8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x21ac6
cmpl $0x0, -0x30(%rbp)
jne 0x217d1
movq -0x40(%rbp), %rax
orq -0x48(%rbp), %rax
cmpq $0x0, %rax
jne 0x217b8
xorl %esi, %esi
xorl %eax, %eax
movl %eax, %ecx
movl %esi, %edi
movq %rcx, %rdx
callq 0x11a80
movq %rax, -0x10(%rbp)
movq %rdx, -0x8(%rbp)
jmp 0x21ac6
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
leaq -0x30(%rbp), %rdx
leaq -0x40(%rbp), %rcx
leaq -0x48(%rbp), %r8
callq 0x1ee00
movl -0x30(%rbp), %eax
subl $0x3fff, %eax           # imm = 0x3FFF
sarl %eax
addl $0x3ffe, %eax           # imm = 0x3FFE
movl %eax, -0x34(%rbp)
movabsq $0x1000000000000, %rax  # imm = 0x1000000000000
orq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movslq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rax
shrq $0x11, %rax
movl %eax, %esi
callq 0x157e0
movl %eax, %eax
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
movl -0x30(%rbp), %ecx
andl $0x1, %ecx
movl $0xd, %eax
subl %ecx, %eax
movslq %eax, %rdx
leaq -0x40(%rbp), %rcx
leaq -0x48(%rbp), %r8
callq 0x121c0
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, -0x68(%rbp)
movq -0x50(%rbp), %rdi
movq -0x50(%rbp), %rsi
leaq -0x90(%rbp), %rdx
leaq -0x98(%rbp), %rcx
callq 0x18730
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x90(%rbp), %rdx
movq -0x98(%rbp), %rcx
leaq -0x70(%rbp), %r8
leaq -0x78(%rbp), %r9
callq 0x18b70
cmpq $0x0, -0x70(%rbp)
jge 0x218e6
movq -0x50(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x50(%rbp)
movq -0x68(%rbp), %rax
subq $0x2, %rax
movq %rax, -0x68(%rbp)
movq -0x70(%rbp), %rdi
movq -0x78(%rbp), %rsi
movq -0x50(%rbp), %rdx
shrq $0x3f, %rdx
movq -0x68(%rbp), %rcx
orq $0x1, %rcx
leaq -0x70(%rbp), %r8
leaq -0x78(%rbp), %r9
callq 0x18bd0
jmp 0x218a0
movq -0x78(%rbp), %rdi
movq -0x68(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x14bf0
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
andq $0x1fff, %rax           # imm = 0x1FFF
cmpq $0x5, %rax
ja 0x21a7e
cmpq $0x0, -0x58(%rbp)
jne 0x2191e
movq $0x1, -0x58(%rbp)
movq -0x68(%rbp), %rdi
movq -0x58(%rbp), %rsi
leaq -0x98(%rbp), %rdx
leaq -0xa0(%rbp), %rcx
callq 0x18730
movq -0x78(%rbp), %rdi
movq -0x98(%rbp), %rdx
movq -0xa0(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
leaq -0x78(%rbp), %r8
leaq -0x80(%rbp), %r9
callq 0x18b70
movq -0x58(%rbp), %rdi
movq -0x58(%rbp), %rsi
leaq -0xa0(%rbp), %rdx
leaq -0xa8(%rbp), %rcx
callq 0x18730
movq -0x78(%rbp), %rdi
movq -0x80(%rbp), %rsi
movq -0xa0(%rbp), %r8
movq -0xa8(%rbp), %r9
xorl %eax, %eax
movl %eax, %ecx
leaq -0x78(%rbp), %r11
leaq -0x80(%rbp), %r10
leaq -0x88(%rbp), %rax
movq %rcx, %rdx
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x1d850
cmpq $0x0, -0x78(%rbp)
jge 0x21a59
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 -0xa0(%rbp), %rcx
leaq -0xa8(%rbp), %r8
callq 0x121c0
movq -0xa8(%rbp), %rax
orq $0x1, %rax
movq %rax, -0xa8(%rbp)
movq -0x68(%rbp), %rax
orq -0xa0(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x78(%rbp), %rdi
movq -0x80(%rbp), %rsi
movq -0x88(%rbp), %rdx
movq -0xa0(%rbp), %r8
movq -0xa8(%rbp), %r9
xorl %eax, %eax
movl %eax, %ecx
leaq -0x78(%rbp), %r11
leaq -0x80(%rbp), %r10
leaq -0x88(%rbp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x1d930
jmp 0x219b6
movq -0x78(%rbp), %rax
orq -0x80(%rbp), %rax
orq -0x88(%rbp), %rax
cmpq $0x0, %rax
setne %al
andb $0x1, %al
movzbl %al, %eax
cltq
orq -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movl $0xe, %ecx
leaq -0x50(%rbp), %r8
leaq -0x58(%rbp), %r9
leaq -0x60(%rbp), %rax
movq %rax, (%rsp)
callq 0x20420
movl -0x34(%rbp), %esi
movq -0x50(%rbp), %rdx
movq -0x58(%rbp), %rcx
movq -0x60(%rbp), %r8
movq -0x28(%rbp), %r9
xorl %edi, %edi
callq 0x20590
movq %rax, -0x10(%rbp)
movq %rdx, -0x8(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
addq $0xd0, %rsp
popq %rbp
retq
nopw (%rax,%rax)