// File: /workspace/github_c_makefile_star2_O2/mbitsnbites[P]SoftFP/./softfptest_template.h
// Function: test_op128
void test_op(FloatOpEnum op, F_UINT a, F_UINT b, RoundingModeEnum rm,
             int it)
{
    F_UINT ref, r;
    uint32_t fflags, ref_fflags;

    ref = exec_ref_op(&ref_fflags, op, a, b, rm);
    fflags = 0;
    switch(op) {
    case OP_FADD:
        r = glue(add_sf, F_SIZE)(a, b, rm, &fflags);
        break;
    case OP_FMUL:
        r = glue(mul_sf, F_SIZE)(a, b, rm, &fflags);
        break;
    case OP_FDIV:
        r = glue(div_sf, F_SIZE)(a, b, rm, &fflags);
        break;
    case OP_FSQRT:
        r = glue(sqrt_sf, F_SIZE)(a, rm, &fflags);
        break;
    case OP_FMIN:
        r = glue(min_sf, F_SIZE)(a, b, &fflags);
        break;
    case OP_FMAX:
        r = glue(max_sf, F_SIZE)(a, b, &fflags);
        break;
    default:
        abort();
    }
    if (r != ref || ref_fflags != fflags) {
        printf("ERROR op=%s size=%d rm=%s it=%d:\n", 
               op_to_str[op], F_SIZE, rm_to_str[rm], it);
        printf("a  = "); print_sf(a); printf("\n");
        if (op != OP_FSQRT) {
            printf("b  = "); print_sf(b); 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);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %r9d, %r14d
movq %r8, %r9
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %rbx
movl %edi, %ebp
movl %r14d, (%rsp)
leaq 0x24(%rsp), %rdi
movl %ebp, %esi
movq %rbx, %rdx
movq %r13, %rcx
movq %r12, %r8
movq %r9, 0x18(%rsp)
callq 0x3592
movq %rax, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
andl $0x0, 0x14(%rsp)
cmpl $0x5, %ebp
ja 0x3889
movl %ebp, %r15d
leaq 0x109eb(%rip), %rax     # 0x140b0
movslq (%rax,%r15,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x14(%rsp), %r9
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq 0x18(%rsp), %rcx
movl %r14d, %r8d
callq 0x6ee4
jmp 0x376f
leaq 0x14(%rsp), %r8
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq 0x18(%rsp), %rcx
callq 0x8055
jmp 0x376f
leaq 0x14(%rsp), %r9
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq 0x18(%rsp), %rcx
movl %r14d, %r8d
callq 0x7b20
jmp 0x376f
leaq 0x14(%rsp), %rcx
movq %rbx, %rdi
movq %r13, %rsi
movl %r14d, %edx
callq 0x7e67
jmp 0x376f
leaq 0x14(%rsp), %r9
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq 0x18(%rsp), %rcx
movl %r14d, %r8d
callq 0x716d
jmp 0x376f
leaq 0x14(%rsp), %r8
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq 0x18(%rsp), %rcx
callq 0x8127
movq %rax, %rsi
xorq 0x30(%rsp), %rsi
movq %rdx, %rcx
xorq 0x28(%rsp), %rcx
orq %rsi, %rcx
jne 0x379d
movl 0x24(%rsp), %ecx
cmpl 0x14(%rsp), %ecx
jne 0x379d
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, 0x38(%rsp)
movq %rax, 0x40(%rsp)
movl 0x80(%rsp), %r8d
leaq 0x185da(%rip), %rax     # 0x1bd90
movq (%rax,%r15,8), %rsi
movl %r14d, %eax
leaq 0x185fc(%rip), %rcx     # 0x1bdc0
movq (%rcx,%rax,8), %rcx
leaq 0x109a9(%rip), %rdi     # 0x14178
movl $0x80, %edx
xorl %eax, %eax
callq 0x1070
leaq 0x109b8(%rip), %rdi     # 0x1419a
xorl %eax, %eax
callq 0x1070
movq %rbx, %rdi
movq %r13, %rsi
callq 0x388e
pushq $0xa
popq %rdi
callq 0x1030
cmpl $0x3, %ebp
je 0x3824
leaq 0x10998(%rip), %rdi     # 0x141a0
xorl %eax, %eax
callq 0x1070
movq %r12, %rdi
movq 0x18(%rsp), %rsi
callq 0x388e
pushq $0xa
popq %rdi
callq 0x1030
leaq 0x1097b(%rip), %rdi     # 0x141a6
xorl %eax, %eax
callq 0x1070
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x388e
movl 0x24(%rsp), %esi
leaq 0x10960(%rip), %rbx     # 0x141ac
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1070
leaq 0x1095f(%rip), %rdi     # 0x141bc
xorl %eax, %eax
callq 0x1070
movq 0x40(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x388e
movl 0x14(%rsp), %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1070
pushq $0x1
popq %rdi
callq 0x10b0
callq 0x1040