// File: /workspace/github_c_makefile_star2_O0/mbitsnbites[P]SoftFP/./softfp_template.h
// Function: cvt_sf128_sf64
uint64_t glue(glue(cvt_sf, F_SIZE), _sf64)(F_UINT a, RoundingModeEnum rm,
                                               uint32_t *pfflags)
{
    uint32_t a_sign;
    int32_t a_exp;
    F_UINT a_mant;

    a_mant = unpack_sf(&a_sign, &a_exp, a);
    if (a_exp == EXP_MASK) {
        if (a_mant != 0) {
            /* NaN */
            if (issignan_sf(a)) {
                *pfflags |= FFLAG_INVALID_OP;
            }
            return F_QNAN64;
        } else {
            /* infinity */
            return pack_sf64(a_sign, 0x7ff, 0);
        }
    }
    if (a_exp == 0) {
        if (a_mant == 0)
            return pack_sf64(a_sign, 0, 0); /* zero */
        normalize_subnormal_sf(&a_exp, a_mant);
    } else {
        a_mant |= (F_UINT)1 << MANT_SIZE;
    }
    /* convert the exponent value */
    a_exp = a_exp - (EXP_MASK / 2) + 0x3ff;
    /* shift the mantissa */
    a_mant = rshift_rnd(a_mant, MANT_SIZE - (64 - 2));
    return normalize_sf64(a_sign, a_exp, a_mant, rm, pfflags);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x20(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rsi
movq %rsi, -0x28(%rbp)
movq %rax, -0x30(%rbp)
movl %edx, -0x34(%rbp)
movq %rcx, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq -0x28(%rbp), %rcx
movq %rcx, -0x68(%rbp)
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdx
movq -0x68(%rbp), %rcx
leaq -0x44(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0xf460
movq %rax, -0x80(%rbp)
movq %rdx, -0x78(%rbp)
movq -0x80(%rbp), %rax
movq -0x78(%rbp), %rcx
movq %rcx, -0x58(%rbp)
movq %rax, -0x60(%rbp)
cmpl $0x7fff, -0x48(%rbp)    # imm = 0x7FFF
jne 0xf775
movq -0x60(%rbp), %rax
movq -0x58(%rbp), %rcx
orq %rcx, %rax
je 0xf75b
jmp 0xf70f
movq -0x30(%rbp), %rax
movq -0x28(%rbp), %rcx
movq %rcx, -0x88(%rbp)
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rdi
movq -0x88(%rbp), %rsi
callq 0xb780
cmpl $0x0, %eax
je 0xf748
movq -0x40(%rbp), %rax
movl (%rax), %ecx
orl $0x10, %ecx
movl %ecx, (%rax)
movabsq $0x7ff8000000000000, %rax # imm = 0x7FF8000000000000
movq %rax, -0x8(%rbp)
jmp 0xf85d
movl -0x44(%rbp), %edi
movl $0x7ff, %esi            # imm = 0x7FF
xorl %eax, %eax
movl %eax, %edx
callq 0x9420
movq %rax, -0x8(%rbp)
jmp 0xf85d
cmpl $0x0, -0x48(%rbp)
jne 0xf7de
movq -0x60(%rbp), %rax
movq -0x58(%rbp), %rcx
orq %rcx, %rax
jne 0xf7a1
jmp 0xf78a
movl -0x44(%rbp), %edi
xorl %esi, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x9420
movq %rax, -0x8(%rbp)
jmp 0xf85d
movq -0x60(%rbp), %rax
movq -0x58(%rbp), %rcx
movq %rcx, -0x98(%rbp)
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rsi
movq -0x98(%rbp), %rdx
leaq -0x48(%rbp), %rdi
callq 0xc510
movq %rax, -0xb0(%rbp)
movq %rdx, -0xa8(%rbp)
jmp 0xf7e6
movb -0x52(%rbp), %al
orb $0x1, %al
movb %al, -0x52(%rbp)
movl -0x48(%rbp), %eax
addl $0xffffc400, %eax       # imm = 0xFFFFC400
movl %eax, -0x48(%rbp)
movq -0x60(%rbp), %rax
movq -0x58(%rbp), %rcx
movq %rcx, -0xb8(%rbp)
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rdi
movq -0xb8(%rbp), %rsi
movl $0x32, %edx
callq 0xbc10
movq %rax, -0xd0(%rbp)
movq %rdx, -0xc8(%rbp)
movq -0xd0(%rbp), %rax
movq -0xc8(%rbp), %rcx
movq %rcx, -0x58(%rbp)
movq %rax, -0x60(%rbp)
movl -0x44(%rbp), %edi
movl -0x48(%rbp), %esi
movq -0x60(%rbp), %rdx
movl -0x34(%rbp), %ecx
movq -0x40(%rbp), %r8
callq 0x9100
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xd0, %rsp
popq %rbp
retq
nopw (%rax,%rax)