// File: /workspace/github_c_makefile_star2_O2/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
leaq 0x8(%rsp), %rcx
andl $0x0, (%rcx)
callq 0x862b
movq %rax, %rbx
leaq 0x10(%rsp), %rdx
andl $0x0, (%rdx)
andw $0x0, 0x4(%rdx)
movl %r12d, %ebp
leaq 0x105ca(%rip), %rax     # 0x140d0
movb (%rax,%rbp,4), %r13b
movb %r13b, 0x1(%rdx)
movb $0x1, 0x6(%rdx)
movq %r15, %rdi
movq %r14, %rsi
callq 0x106f2
movq %rax, %r12
cmpq %rax, %rbx
jne 0x3baa
leaq 0x10(%rsp), %rdi
callq 0x137c
cmpl 0x8(%rsp), %eax
jne 0x3baa
leaq 0x8(%rsp), %rsi
andl $0x0, (%rsi)
movq %rbx, %rdi
callq 0x8566
leaq 0x10(%rsp), %rsi
andl $0x0, (%rsi)
andw $0x0, 0x4(%rsi)
movq %rax, %r14
movq %rdx, %r15
movb %r13b, 0x1(%rsi)
movb $0x1, 0x6(%rsi)
movq %rbx, %rdi
callq 0xc916
movq %rax, %r12
movq %rdx, %r13
movq %r15, %rax
xorq %rdx, %rax
movq %r14, %rcx
xorq %r12, %rcx
orq %rax, %rcx
jne 0x3c26
leaq 0x10(%rsp), %rdi
callq 0x137c
cmpl 0x8(%rsp), %eax
jne 0x3c26
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1820f(%rip), %rax     # 0x1bdc0
movq (%rax,%rbp,8), %rdx
leaq 0x1086e(%rip), %rdi     # 0x1442a
movl $0x80, %esi
movl 0xc(%rsp), %ecx
xorl %eax, %eax
callq 0x1070
leaq 0x105c7(%rip), %rdi     # 0x1419a
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movq %r14, %rsi
callq 0x388e
pushq $0xa
popq %rbp
movl %ebp, %edi
callq 0x1030
leaq 0x105b0(%rip), %rdi     # 0x141a6
xorl %eax, %eax
callq 0x1070
movq %r12, %rdi
callq 0x2653
movl %ebp, %edi
callq 0x1030
leaq 0x105a9(%rip), %rdi     # 0x141bc
xorl %eax, %eax
callq 0x1070
movq %rbx, %rdi
callq 0x2653
movl %ebp, %edi
jmp 0x3ca3
leaq 0x18193(%rip), %rax     # 0x1bdc0
movq (%rax,%rbp,8), %rdx
leaq 0x1081d(%rip), %rdi     # 0x14455
movl $0x80, %esi
movl 0xc(%rsp), %ecx
xorl %eax, %eax
callq 0x1070
leaq 0x1054b(%rip), %rdi     # 0x1419a
xorl %eax, %eax
callq 0x1070
movq %rbx, %rdi
callq 0x2653
pushq $0xa
popq %rbx
movl %ebx, %edi
callq 0x1030
leaq 0x10537(%rip), %rdi     # 0x141a6
xorl %eax, %eax
callq 0x1070
movq %r12, %rdi
movq %r13, %rsi
callq 0x388e
movl %ebx, %edi
callq 0x1030
leaq 0x1052d(%rip), %rdi     # 0x141bc
xorl %eax, %eax
callq 0x1070
movq %r14, %rdi
movq %r15, %rsi
callq 0x388e
movl %ebx, %edi
callq 0x1030
pushq $0x1
popq %rdi
callq 0x10b0