// File: /workspace/github_c_makefile_star2_O1/mbitsnbites[P]SoftFP/./softfptest_template.h
// Function: test_fma32
void test_fma(F_UINT a, F_UINT b, F_UINT c, RoundingModeEnum rm, int it)
{
#if F_SIZE <= 64
    F_UINT r, ref;
    float_status st;
    uint32_t fflags, ref_fflags;

    fflags = 0;
    r = glue(fma_sf, F_SIZE)(a, b, c, rm, &fflags);
    
    softfloat_init_ctx(&st, rm);

    ref = softfloat_to_sf(glue(glue(float, F_SIZE), _muladd)(
                sf_to_softfloat(a),
                sf_to_softfloat(b),
                sf_to_softfloat(c),
                0, &st));
    ref_fflags = softfloat_to_fflags(&st);

    if (r != ref || ref_fflags != fflags) {
        printf("ERROR op=%s size=%d rm=%s it=%d:\n", 
               "fma", F_SIZE, rm_to_str[rm], it);
        printf("a  = "); print_sf(a); printf("\n");
        printf("b  = "); print_sf(b); printf("\n");
        printf("c  = "); print_sf(c); printf("\n");
        printf("ref= "); print_sf(ref);
        printf(" fflags=0x%02x\n", ref_fflags);
        printf("r  = "); print_sf(r);
        printf(" fflags=0x%02x\n", fflags);
        exit(1);
    }

#endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r8d, 0x10(%rsp)
movl %ecx, %r15d
movl %edx, %r14d
movl %esi, %r12d
movl %edi, %ebp
xorl %ebx, %ebx
leaq 0xc(%rsp), %r8
movl %ebx, (%r8)
callq 0x517d
movl %eax, 0x8(%rsp)
leaq 0x20(%rsp), %r13
movl %ebx, (%r13)
movl %ebx, 0x3(%r13)
movl %r15d, %ebx
leaq 0x1409f(%rip), %rax     # 0x160d0
movb (%rax,%rbx,4), %al
movb %al, 0x1(%r13)
movb $0x1, 0x6(%r13)
movl %ebp, 0x14(%rsp)
movl %ebp, %edi
movl %r12d, 0x18(%rsp)
movl %r12d, %esi
movl %r14d, 0x1c(%rsp)
movl %r14d, %edx
xorl %ecx, %ecx
movq %r13, %r8
callq 0xba76
movl %eax, %r15d
movb 0x2(%r13), %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, %r13d
cmpl %r15d, 0x8(%rsp)
jne 0x20af
cmpl %r13d, 0xc(%rsp)
jne 0x20af
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x19d0a(%rip), %rax     # 0x1bdc0
movq (%rax,%rbx,8), %rcx
leaq 0x140b7(%rip), %rdi     # 0x16178
leaq 0x142d8(%rip), %rsi     # 0x163a0
movl $0x20, %edx
movl 0x10(%rsp), %r8d
xorl %eax, %eax
callq 0x1070
leaq 0x140ba(%rip), %rdi     # 0x1619a
xorl %eax, %eax
callq 0x1070
movl 0x14(%rsp), %edi
callq 0x15d0
movl $0xa, %edi
callq 0x1030
leaq 0x1409f(%rip), %rdi     # 0x161a0
xorl %eax, %eax
callq 0x1070
movl 0x18(%rsp), %edi
callq 0x15d0
movl $0xa, %edi
callq 0x1030
leaq 0x14282(%rip), %rdi     # 0x163a4
xorl %eax, %eax
callq 0x1070
movl 0x1c(%rsp), %edi
callq 0x15d0
movl $0xa, %edi
callq 0x1030
leaq 0x14063(%rip), %rdi     # 0x161a6
xorl %eax, %eax
callq 0x1070
movl %r15d, %edi
callq 0x15d0
leaq 0x14053(%rip), %r14     # 0x161ac
movq %r14, %rdi
movl %r13d, %esi
xorl %eax, %eax
callq 0x1070
leaq 0x1404f(%rip), %rdi     # 0x161bc
xorl %eax, %eax
callq 0x1070
movl 0x8(%rsp), %edi
callq 0x15d0
movl 0xc(%rsp), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1070
movl $0x1, %edi
callq 0x10b0