// File: /workspace/github_c_makefile_star2_O3/mbitsnbites[P]SoftFP/./softfptest_template.h
// Function: test_cvt_sf32_sf64
void test_cvt_sf32_sf(F_UINT a, RoundingModeEnum rm, int it)
{
    uint32_t a32, a32_ref;
    float_status st;
    uint32_t fflags;
    F_UINT a_ref;

    /* to 32 bit */
    fflags = 0;
    a32 = glue(glue(cvt_sf, F_SIZE), _sf32)(a, rm, &fflags);

    softfloat_init_ctx(&st, rm);
    a32_ref = softfloat_to_sf32(glue(glue(float, F_SIZE), _to_float32)(sf_to_softfloat(a), &st));
    if (a32 != a32_ref || softfloat_to_fflags(&st) != fflags) {
        printf("ERROR op=cvt_sf_sf32 size=%d rm=%s it=%d:\n",
               F_SIZE, rm_to_str[rm], it);
        printf("a  = "); print_sf(a); printf("\n");
        printf("ref= "); print_sf32(a32_ref); printf("\n");
        printf("r  = "); print_sf32(a32); printf("\n");
        exit(1);
    }
    
    /* from 32 bit */
    fflags = 0;
    a = glue(cvt_sf32_sf, F_SIZE)(a32, &fflags);
    
    softfloat_init_ctx(&st, rm);
    a_ref = softfloat_to_sf(glue(float32_to_float, F_SIZE)(sf_to_softfloat32(a32), &st));
    if (a != a_ref || softfloat_to_fflags(&st) != fflags) {
        printf("ERROR op=cvt_sf32_sf size=%d rm=%s it=%d\n",
               F_SIZE, rm_to_str[rm], it);
        printf("a  = "); print_sf32(a32); 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 %edx, %ebp
movl %esi, %r15d
movq %rdi, %r14
xorl %r12d, %r12d
leaq 0xc(%rsp), %rdx
movl %r12d, (%rdx)
callq 0x724f
movl %eax, %ebx
leaq 0x10(%rsp), %rsi
movl %r12d, (%rsi)
movw $0x0, 0x4(%rsi)
movl %r15d, %r12d
leaq 0x136d4(%rip), %rax     # 0x160d0
movb (%rax,%r12,4), %r13b
movb %r13b, 0x1(%rsi)
movb $0x1, 0x6(%rsi)
movq %r14, %rdi
callq 0xc69b
movl %eax, %r15d
cmpl %eax, %ebx
jne 0x2ade
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, 0xc(%rsp)
jne 0x2ade
xorl %r15d, %r15d
leaq 0xc(%rsp), %rsi
movl %r15d, (%rsi)
movl %ebx, %edi
callq 0x71bc
movq %rax, %r14
leaq 0x10(%rsp), %rsi
movl %r15d, (%rsi)
movw $0x0, 0x4(%rsi)
movb %r13b, 0x1(%rsi)
movb $0x1, 0x6(%rsi)
movl %ebx, %edi
callq 0xab29
movq %rax, %r15
cmpq %rax, %r14
jne 0x2b55
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, 0xc(%rsp)
jne 0x2b55
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x192db(%rip), %rax     # 0x1bdc0
movq (%rax,%r12,8), %rdx
leaq 0x138e5(%rip), %rdi     # 0x163d5
movl $0x40, %esi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x1070
leaq 0x13695(%rip), %rdi     # 0x1619a
xorl %eax, %eax
callq 0x1070
movq %r14, %rdi
callq 0x2970
movl $0xa, %edi
callq 0x1030
leaq 0x13681(%rip), %rdi     # 0x161a6
xorl %eax, %eax
callq 0x1070
movl %r15d, %edi
callq 0x15d5
movl $0xa, %edi
callq 0x1030
leaq 0x13677(%rip), %rdi     # 0x161bc
xorl %eax, %eax
callq 0x1070
movl %ebx, %edi
callq 0x15d5
jmp 0x2bca
leaq 0x19264(%rip), %rax     # 0x1bdc0
movq (%rax,%r12,8), %rdx
leaq 0x13899(%rip), %rdi     # 0x16400
movl $0x40, %esi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x1070
leaq 0x1361e(%rip), %rdi     # 0x1619a
xorl %eax, %eax
callq 0x1070
movl %ebx, %edi
callq 0x15d5
movl $0xa, %edi
callq 0x1030
leaq 0x1360b(%rip), %rdi     # 0x161a6
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
callq 0x2970
movl $0xa, %edi
callq 0x1030
leaq 0x13601(%rip), %rdi     # 0x161bc
xorl %eax, %eax
callq 0x1070
movq %r14, %rdi
callq 0x2970
movl $0xa, %edi
callq 0x1030
movl $0x1, %edi
callq 0x10b0