// File: /workspace/github_c_makefile_star2_O0/mbitsnbites[P]SoftFP/softfloat.c
// Function: float32_log2
float32 float32_log2(float32 a, float_status *status)
{
    flag aSign, zSign;
    int_fast16_t aExp;
    uint32_t aSig, zSig, i;

    a = float32_squash_input_denormal(a, status);
    aSig = extractFloat32Frac( a );
    aExp = extractFloat32Exp( a );
    aSign = extractFloat32Sign( a );

    if ( aExp == 0 ) {
        if ( aSig == 0 ) return packFloat32( 1, 0xFF, 0 );
        normalizeFloat32Subnormal( aSig, &aExp, &aSig );
    }
    if ( aSign ) {
        float_raise(float_flag_invalid, status);
        return float32_default_nan;
    }
    if ( aExp == 0xFF ) {
        if (aSig) {
            return propagateFloat32NaN(a, float32_zero, status);
        }
        return a;
    }

    aExp -= 0x7F;
    aSig |= 0x00800000;
    zSign = aExp < 0;
    zSig = aExp << 23;

    for (i = 1 << 22; i > 0; i >>= 1) {
        aSig = ( (uint64_t)aSig * aSig ) >> 23;
        if ( aSig & 0x01000000 ) {
            aSig >>= 1;
            zSig |= i;
        }
    }

    if ( zSign )
        zSig = -zSig;

    return normalizeRoundAndPackFloat32(zSign, 0x85, zSig, status);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %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, -0x24(%rbp)
movl -0x8(%rbp), %edi
callq 0x115d0
movq %rax, -0x20(%rbp)
movl -0x8(%rbp), %edi
callq 0x12810
movb %al, -0x11(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x15f86
cmpl $0x0, -0x24(%rbp)
jne 0x15f76
movl $0x1, %edi
movl $0xff, %esi
xorl %edx, %edx
callq 0x11750
movl %eax, -0x4(%rbp)
jmp 0x16079
movl -0x24(%rbp), %edi
leaq -0x20(%rbp), %rsi
leaq -0x24(%rbp), %rdx
callq 0x135b0
cmpb $0x0, -0x11(%rbp)
je 0x15fa6
movq -0x10(%rbp), %rsi
movl $0x1, %edi
callq 0x11080
movl $0x7fc00000, -0x4(%rbp) # imm = 0x7FC00000
jmp 0x16079
cmpq $0xff, -0x20(%rbp)
jne 0x15fd7
cmpl $0x0, -0x24(%rbp)
je 0x15fcc
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rdx
xorl %esi, %esi
callq 0x13be0
movl %eax, -0x4(%rbp)
jmp 0x16079
movl -0x8(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x16079
movq -0x20(%rbp), %rax
subq $0x7f, %rax
movq %rax, -0x20(%rbp)
movl -0x24(%rbp), %eax
orl $0x800000, %eax         # imm = 0x800000
movl %eax, -0x24(%rbp)
cmpq $0x0, -0x20(%rbp)
setl %al
andb $0x1, %al
movzbl %al, %eax
movb %al, -0x12(%rbp)
movq -0x20(%rbp), %rax
shlq $0x17, %rax
movl %eax, -0x28(%rbp)
movl $0x400000, -0x2c(%rbp)  # imm = 0x400000
cmpl $0x0, -0x2c(%rbp)
jbe 0x16051
movl -0x24(%rbp), %eax
movl -0x24(%rbp), %ecx
imulq %rcx, %rax
shrq $0x17, %rax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
andl $0x1000000, %eax        # imm = 0x1000000
cmpl $0x0, %eax
je 0x16045
movl -0x24(%rbp), %eax
shrl %eax
movl %eax, -0x24(%rbp)
movl -0x2c(%rbp), %eax
orl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
jmp 0x16047
movl -0x2c(%rbp), %eax
shrl %eax
movl %eax, -0x2c(%rbp)
jmp 0x16010
cmpb $0x0, -0x12(%rbp)
je 0x1605f
xorl %eax, %eax
subl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movb -0x12(%rbp), %al
movl -0x28(%rbp), %edx
movq -0x10(%rbp), %rcx
movl $0x85, %esi
movzbl %al, %edi
callq 0x11780
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)