// File: /workspace/github_c_makefile_star2_O3/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, 0xc(%rsp)
movl %ecx, %r15d
movl %edx, %r14d
movl %esi, %r12d
movl %edi, %ebx
xorl %eax, %eax
leaq 0x8(%rsp), %r8
movl %eax, (%r8)
callq 0x51d9
movl %eax, %ebp
leaq 0x20(%rsp), %r13
xorl %eax, %eax
movl %eax, (%r13)
movw $0x0, 0x4(%r13)
movl %r15d, %r15d
leaq 0x14086(%rip), %rax     # 0x160d0
movb (%rax,%r15,4), %al
movb %al, 0x1(%r13)
movb $0x1, 0x6(%r13)
movl %ebx, 0x10(%rsp)
movl %ebx, %edi
movl %r12d, 0x14(%rsp)
movl %r12d, %esi
movl %r14d, 0x18(%rsp)
movl %r14d, %edx
xorl %ecx, %ecx
movq %r13, %r8
callq 0xbb02
movl %eax, %ebx
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
movl %ebp, 0x1c(%rsp)
cmpl %ebx, %ebp
jne 0x20c9
cmpl %r13d, 0x8(%rsp)
jne 0x20c9
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x19cf0(%rip), %rax     # 0x1bdc0
movq (%rax,%r15,8), %rcx
leaq 0x1409d(%rip), %rdi     # 0x16178
leaq 0x142be(%rip), %rsi     # 0x163a0
movl $0x20, %edx
movl 0xc(%rsp), %r8d
xorl %eax, %eax
callq 0x1070
leaq 0x140a0(%rip), %rdi     # 0x1619a
xorl %eax, %eax
callq 0x1070
movl 0x10(%rsp), %edi
callq 0x15d5
movl $0xa, %edi
callq 0x1030
leaq 0x14085(%rip), %rdi     # 0x161a0
xorl %eax, %eax
callq 0x1070
movl 0x14(%rsp), %edi
callq 0x15d5
movl $0xa, %edi
callq 0x1030
leaq 0x14268(%rip), %rdi     # 0x163a4
xorl %eax, %eax
callq 0x1070
movl 0x18(%rsp), %edi
callq 0x15d5
movl $0xa, %edi
callq 0x1030
leaq 0x14049(%rip), %rdi     # 0x161a6
xorl %eax, %eax
callq 0x1070
movl %ebx, %edi
callq 0x15d5
leaq 0x1403a(%rip), %r14     # 0x161ac
movq %r14, %rdi
movl %r13d, %esi
xorl %eax, %eax
callq 0x1070
leaq 0x14036(%rip), %rdi     # 0x161bc
xorl %eax, %eax
callq 0x1070
movl 0x1c(%rsp), %edi
callq 0x15d5
movl 0x8(%rsp), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1070
movl $0x1, %edi
callq 0x10b0