// File: /workspace/github_c_makefile_star2_O0/mbitsnbites[P]SoftFP/softfloat.c
// Function: float64_log2
float64 float64_log2(float64 a, float_status *status)
{
    flag aSign, zSign;
    int_fast16_t aExp;
    uint64_t aSig, aSig0, aSig1, zSig, i;
    a = float64_squash_input_denormal(a, status);

    aSig = extractFloat64Frac( a );
    aExp = extractFloat64Exp( a );
    aSign = extractFloat64Sign( a );

    if ( aExp == 0 ) {
        if ( aSig == 0 ) return packFloat64( 1, 0x7FF, 0 );
        normalizeFloat64Subnormal( aSig, &aExp, &aSig );
    }
    if ( aSign ) {
        float_raise(float_flag_invalid, status);
        return float64_default_nan;
    }
    if ( aExp == 0x7FF ) {
        if (aSig) {
            return propagateFloat64NaN(a, float64_zero, status);
        }
        return a;
    }

    aExp -= 0x3FF;
    aSig |= LIT64( 0x0010000000000000 );
    zSign = aExp < 0;
    zSig = (uint64_t)aExp << 52;
    for (i = 1LL << 51; i > 0; i >>= 1) {
        mul64To128( aSig, aSig, &aSig0, &aSig1 );
        aSig = ( aSig0 << 12 ) | ( aSig1 >> 52 );
        if ( aSig & LIT64( 0x0020000000000000 ) ) {
            aSig >>= 1;
            zSig |= i;
        }
    }

    if ( zSign )
        zSig = -zSig;
    return normalizeRoundAndPackFloat64(zSign, 0x408, zSig, status);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %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, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0x11680
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x168f0
movb %al, -0x19(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x1a0b2
cmpq $0x0, -0x30(%rbp)
jne 0x1a0a1
movl $0x1, %edi
movl $0x7ff, %esi            # imm = 0x7FF
xorl %eax, %eax
movl %eax, %edx
callq 0x118b0
movq %rax, -0x8(%rbp)
jmp 0x1a1f4
movq -0x30(%rbp), %rdi
leaq -0x28(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x17a20
cmpb $0x0, -0x19(%rbp)
je 0x1a0d9
movq -0x18(%rbp), %rsi
movl $0x1, %edi
callq 0x11080
movabsq $0x7ff8000000000000, %rax # imm = 0x7FF8000000000000
movq %rax, -0x8(%rbp)
jmp 0x1a1f4
cmpq $0x7ff, -0x28(%rbp)     # imm = 0x7FF
jne 0x1a111
cmpq $0x0, -0x30(%rbp)
je 0x1a104
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x17f70
movq %rax, -0x8(%rbp)
jmp 0x1a1f4
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1a1f4
movq -0x28(%rbp), %rax
subq $0x3ff, %rax            # imm = 0x3FF
movq %rax, -0x28(%rbp)
movabsq $0x10000000000000, %rax # imm = 0x10000000000000
orq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x28(%rbp)
setl %al
andb $0x1, %al
movzbl %al, %eax
movb %al, -0x1a(%rbp)
movq -0x28(%rbp), %rax
shlq $0x34, %rax
movq %rax, -0x48(%rbp)
movabsq $0x8000000000000, %rax  # imm = 0x8000000000000
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jbe 0x1a1c8
movq -0x30(%rbp), %rdi
movq -0x30(%rbp), %rsi
leaq -0x38(%rbp), %rdx
leaq -0x40(%rbp), %rcx
callq 0x18730
movq -0x38(%rbp), %rax
shlq $0xc, %rax
movq -0x40(%rbp), %rcx
shrq $0x34, %rcx
orq %rcx, %rax
movq %rax, -0x30(%rbp)
movabsq $0x20000000000000, %rax # imm = 0x20000000000000
andq -0x30(%rbp), %rax
cmpq $0x0, %rax
je 0x1a1b9
movq -0x30(%rbp), %rax
shrq %rax
movq %rax, -0x30(%rbp)
movq -0x50(%rbp), %rax
orq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x1a1bb
movq -0x50(%rbp), %rax
shrq %rax
movq %rax, -0x50(%rbp)
jmp 0x1a15b
cmpb $0x0, -0x1a(%rbp)
je 0x1a1d8
xorl %eax, %eax
subq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movb -0x1a(%rbp), %al
movq -0x48(%rbp), %rdx
movq -0x18(%rbp), %rcx
movl $0x408, %esi            # imm = 0x408
movzbl %al, %edi
callq 0x11fa0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nop