// File: /workspace/github_c_makefile_star2_O3/mbitsnbites[P]SoftFP/./softfptest_template.h
// Function: test_cvt_sf64_sf128
void test_cvt_sf64_sf(F_UINT a, RoundingModeEnum rm, int it)
{
    uint64_t a64, a64_ref;
    float_status st;
    uint32_t fflags;
    F_UINT a_ref;

    /* to 64 bit */
    fflags = 0;
    a64 = glue(glue(cvt_sf, F_SIZE), _sf64)(a, rm, &fflags);

    softfloat_init_ctx(&st, rm);
    a64_ref = softfloat_to_sf64(glue(glue(float, F_SIZE), _to_float64)(sf_to_softfloat(a), &st));
    if (a64 != a64_ref || softfloat_to_fflags(&st) != fflags) {
        printf("ERROR op=cvt_sf_sf64 size=%d rm=%s it=%d:\n",
               F_SIZE, rm_to_str[rm], it);
        printf("a  = "); print_sf(a); printf("\n");
        printf("ref= "); print_sf64(a64_ref); printf("\n");
        printf("r  = "); print_sf64(a64); printf("\n");
        exit(1);
    }
    
    /* from 64 bit */
    fflags = 0;
    a = glue(cvt_sf64_sf, F_SIZE)(a64, &fflags);
    
    softfloat_init_ctx(&st, rm);
    a_ref = softfloat_to_sf(glue(float64_to_float, F_SIZE)(sf_to_softfloat64(a64), &st));
    if (a != a_ref || softfloat_to_fflags(&st) != fflags) {
        printf("ERROR op=cvt_sf64_sf size=%d rm=%s it=%d\n",
               F_SIZE, rm_to_str[rm], it);
        printf("a  = "); print_sf64(a64); printf("\n");
        printf("ref= "); print_sf(a_ref); printf("\n");
        printf("r  = "); print_sf(a); printf("\n");
        exit(1);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, 0xc(%rsp)
movl %edx, %r12d
movq %rsi, %r14
movq %rdi, %r15
xorl %ebp, %ebp
leaq 0x8(%rsp), %rcx
movl %ebp, (%rcx)
callq 0x90ec
movq %rax, %rbx
leaq 0x10(%rsp), %rdx
movl %ebp, (%rdx)
movw $0x0, 0x4(%rdx)
movl %r12d, %ebp
leaq 0x11f2c(%rip), %rax     # 0x160d0
movb (%rax,%rbp,4), %r13b
movb %r13b, 0x1(%rdx)
movb $0x1, 0x6(%rdx)
movq %r15, %rdi
movq %r14, %rsi
callq 0x11cd2
movq %rax, %r12
cmpq %rax, %rbx
jne 0x429e
movb 0x12(%rsp), %al
movl %eax, %ecx
shlb $0x4, %cl
andb $0x10, %cl
leal (%rax,%rax), %edx
andb $0x8, %dl
orb %cl, %dl
movl %eax, %ecx
shrb %cl
andb $0x4, %cl
orb %dl, %cl
movl %eax, %edx
shrb $0x3, %dl
andb $0x2, %dl
orb %cl, %dl
shrb $0x5, %al
andb $0x1, %al
orb %dl, %al
movzbl %al, %eax
cmpl %eax, 0x8(%rsp)
jne 0x429e
xorl %r12d, %r12d
leaq 0x8(%rsp), %rsi
movl %r12d, (%rsi)
movq %rbx, %rdi
callq 0x9025
movq %rax, %r14
movq %rdx, %r15
leaq 0x10(%rsp), %rsi
movl %r12d, (%rsi)
movw $0x0, 0x4(%rsi)
movb %r13b, 0x1(%rsi)
movb $0x1, 0x6(%rsi)
movq %rbx, %rdi
callq 0xd90b
movq %rax, %r12
movq %rdx, %r13
movq %r15, %rax
xorq %rdx, %rax
movq %r14, %rcx
xorq %r12, %rcx
orq %rax, %rcx
jne 0x431b
movb 0x12(%rsp), %al
movl %eax, %ecx
shlb $0x4, %cl
andb $0x10, %cl
leal (%rax,%rax), %edx
andb $0x8, %dl
orb %cl, %dl
movl %eax, %ecx
shrb %cl
andb $0x4, %cl
orb %dl, %cl
movl %eax, %edx
shrb $0x3, %dl
andb $0x2, %dl
orb %cl, %dl
shrb $0x5, %al
andb $0x1, %al
orb %dl, %al
movzbl %al, %eax
cmpl %eax, 0x8(%rsp)
jne 0x431b
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x17b1b(%rip), %rax     # 0x1bdc0
movq (%rax,%rbp,8), %rdx
leaq 0x1217a(%rip), %rdi     # 0x1642a
movl $0x80, %esi
movl 0xc(%rsp), %ecx
xorl %eax, %eax
callq 0x1070
leaq 0x11ed3(%rip), %rdi     # 0x1619a
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movq %r14, %rsi
callq 0x3ec3
movl $0xa, %edi
callq 0x1030
leaq 0x11ebc(%rip), %rdi     # 0x161a6
xorl %eax, %eax
callq 0x1070
movq %r12, %rdi
callq 0x2970
movl $0xa, %edi
callq 0x1030
leaq 0x11eb2(%rip), %rdi     # 0x161bc
xorl %eax, %eax
callq 0x1070
movq %rbx, %rdi
callq 0x2970
jmp 0x4399
leaq 0x17a9e(%rip), %rax     # 0x1bdc0
movq (%rax,%rbp,8), %rdx
leaq 0x12128(%rip), %rdi     # 0x16455
movl $0x80, %esi
movl 0xc(%rsp), %ecx
xorl %eax, %eax
callq 0x1070
leaq 0x11e56(%rip), %rdi     # 0x1619a
xorl %eax, %eax
callq 0x1070
movq %rbx, %rdi
callq 0x2970
movl $0xa, %edi
callq 0x1030
leaq 0x11e42(%rip), %rdi     # 0x161a6
xorl %eax, %eax
callq 0x1070
movq %r12, %rdi
movq %r13, %rsi
callq 0x3ec3
movl $0xa, %edi
callq 0x1030
leaq 0x11e35(%rip), %rdi     # 0x161bc
xorl %eax, %eax
callq 0x1070
movq %r14, %rdi
movq %r15, %rsi
callq 0x3ec3
movl $0xa, %edi
callq 0x1030
movl $0x1, %edi
callq 0x10b0