// File: /workspace/github_c_makefile_star2_O1/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 0x71e6
movl %eax, %ebx
leaq 0x10(%rsp), %rsi
movl %r12d, (%rsi)
movl %r12d, 0x3(%rsi)
movl %r15d, %r12d
leaq 0x136fd(%rip), %rax     # 0x160d0
movb (%rax,%r12,4), %r13b
movb %r13b, 0x1(%rsi)
movb $0x1, 0x6(%rsi)
movq %r14, %rdi
callq 0xc5d4
movl %eax, %r15d
cmpl %eax, %ebx
jne 0x2ab3
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 0x2ab3
xorl %r15d, %r15d
leaq 0xc(%rsp), %rsi
movl %r15d, (%rsi)
movl %ebx, %edi
callq 0x7153
movq %rax, %r14
leaq 0x10(%rsp), %rsi
movl %r15d, (%rsi)
movl %r15d, 0x3(%rsi)
movb %r13b, 0x1(%rsi)
movb $0x1, 0x6(%rsi)
movl %ebx, %edi
callq 0xaa7f
movq %rax, %r15
cmpq %rax, %r14
jne 0x2b2a
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 0x2b2a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x19306(%rip), %rax     # 0x1bdc0
movq (%rax,%r12,8), %rdx
leaq 0x13910(%rip), %rdi     # 0x163d5
movl $0x40, %esi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x1070
leaq 0x136c0(%rip), %rdi     # 0x1619a
xorl %eax, %eax
callq 0x1070
movq %r14, %rdi
callq 0x2949
movl $0xa, %edi
callq 0x1030
leaq 0x136ac(%rip), %rdi     # 0x161a6
xorl %eax, %eax
callq 0x1070
movl %r15d, %edi
callq 0x15d0
movl $0xa, %edi
callq 0x1030
leaq 0x136a2(%rip), %rdi     # 0x161bc
xorl %eax, %eax
callq 0x1070
movl %ebx, %edi
callq 0x15d0
jmp 0x2b9f
leaq 0x1928f(%rip), %rax     # 0x1bdc0
movq (%rax,%r12,8), %rdx
leaq 0x138c4(%rip), %rdi     # 0x16400
movl $0x40, %esi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x1070
leaq 0x13649(%rip), %rdi     # 0x1619a
xorl %eax, %eax
callq 0x1070
movl %ebx, %edi
callq 0x15d0
movl $0xa, %edi
callq 0x1030
leaq 0x13636(%rip), %rdi     # 0x161a6
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
callq 0x2949
movl $0xa, %edi
callq 0x1030
leaq 0x1362c(%rip), %rdi     # 0x161bc
xorl %eax, %eax
callq 0x1070
movq %r14, %rdi
callq 0x2949
movl $0xa, %edi
callq 0x1030
movl $0x1, %edi
callq 0x10b0