// File: /workspace/github_c_makefile_star2_O0/mbitsnbites[P]SoftFP/softfloat.c
// Function: float32_sqrt
float32 float32_sqrt(float32 a, float_status *status)
{
    flag aSign;
    int_fast16_t aExp, zExp;
    uint32_t aSig, zSig;
    uint64_t rem, term;
    a = float32_squash_input_denormal(a, status);

    aSig = extractFloat32Frac( a );
    aExp = extractFloat32Exp( a );
    aSign = extractFloat32Sign( a );
    if ( aExp == 0xFF ) {
        if (aSig) {
            return propagateFloat32NaN(a, float32_zero, status);
        }
        if ( ! aSign ) return a;
        float_raise(float_flag_invalid, status);
        return float32_default_nan;
    }
    if ( aSign ) {
        if ( ( aExp | aSig ) == 0 ) return a;
        float_raise(float_flag_invalid, status);
        return float32_default_nan;
    }
    if ( aExp == 0 ) {
        if ( aSig == 0 ) return float32_zero;
        normalizeFloat32Subnormal( aSig, &aExp, &aSig );
    }
    zExp = ( ( aExp - 0x7F )>>1 ) + 0x7E;
    aSig = ( aSig | 0x00800000 )<<8;
    zSig = estimateSqrt32( aExp, aSig ) + 2;
    if ( ( zSig & 0x7F ) <= 5 ) {
        if ( zSig < 2 ) {
            zSig = 0x7FFFFFFF;
            goto roundAndPack;
        }
        aSig >>= aExp & 1;
        term = ( (uint64_t) zSig ) * zSig;
        rem = ( ( (uint64_t) aSig )<<32 ) - term;
        while ( (int64_t) rem < 0 ) {
            --zSig;
            rem += ( ( (uint64_t) zSig )<<1 ) | 1;
        }
        zSig |= ( rem != 0 );
    }
    shift32RightJamming( zSig, 1, &zSig );
 roundAndPack:
    return roundAndPackFloat32(0, zExp, zSig, status);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x11570
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %edi
callq 0x115f0
movl %eax, -0x2c(%rbp)
movl -0x8(%rbp), %edi
callq 0x115d0
movq %rax, -0x20(%rbp)
movl -0x8(%rbp), %edi
callq 0x12810
movb %al, -0x11(%rbp)
cmpq $0xff, -0x20(%rbp)
jne 0x15691
cmpl $0x0, -0x2c(%rbp)
je 0x15666
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rdx
xorl %esi, %esi
callq 0x13be0
movl %eax, -0x4(%rbp)
jmp 0x157cc
cmpb $0x0, -0x11(%rbp)
jne 0x15677
movl -0x8(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x157cc
movq -0x10(%rbp), %rsi
movl $0x1, %edi
callq 0x11080
movl $0x7fc00000, -0x4(%rbp) # imm = 0x7FC00000
jmp 0x157cc
cmpb $0x0, -0x11(%rbp)
je 0x156cc
movq -0x20(%rbp), %rax
movl -0x2c(%rbp), %ecx
orq %rcx, %rax
cmpq $0x0, %rax
jne 0x156b2
movl -0x8(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x157cc
movq -0x10(%rbp), %rsi
movl $0x1, %edi
callq 0x11080
movl $0x7fc00000, -0x4(%rbp) # imm = 0x7FC00000
jmp 0x157cc
cmpq $0x0, -0x20(%rbp)
jne 0x156f5
cmpl $0x0, -0x2c(%rbp)
jne 0x156e5
movl $0x0, -0x4(%rbp)
jmp 0x157cc
movl -0x2c(%rbp), %edi
leaq -0x20(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
callq 0x135b0
movq -0x20(%rbp), %rax
subq $0x7f, %rax
sarq %rax
addq $0x7e, %rax
movq %rax, -0x28(%rbp)
movl -0x2c(%rbp), %eax
orl $0x800000, %eax         # imm = 0x800000
shll $0x8, %eax
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0x157e0
addl $0x2, %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
andl $0x7f, %eax
cmpl $0x5, %eax
ja 0x157a6
cmpl $0x2, -0x30(%rbp)
jae 0x15742
movl $0x7fffffff, -0x30(%rbp) # imm = 0x7FFFFFFF
jmp 0x157b7
movq -0x20(%rbp), %rcx
andq $0x1, %rcx
movl -0x2c(%rbp), %eax
shrl %cl, %eax
movl %eax, -0x2c(%rbp)
movl -0x30(%rbp), %eax
movl -0x30(%rbp), %ecx
imulq %rcx, %rax
movq %rax, -0x40(%rbp)
movl -0x2c(%rbp), %eax
shlq $0x20, %rax
subq -0x40(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jge 0x15793
movl -0x30(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
shlq %rax
orq $0x1, %rax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x1576f
cmpq $0x0, -0x38(%rbp)
setne %al
andb $0x1, %al
movzbl %al, %eax
orl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %edi
movl $0x1, %esi
leaq -0x30(%rbp), %rdx
callq 0x158d0
movq -0x28(%rbp), %rsi
movl -0x30(%rbp), %edx
movq -0x10(%rbp), %rcx
xorl %edi, %edi
callq 0x11cb0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)