#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ abort();
float nextafterf(float, float);
int /*<<< orphan*/ printf(char *, char const *, int, char const *, float,
                          float);
void mu_assert_eq_float_impl(const char *file, int line, const char *func,
                             float a, float b) {
  if (nextafterf(a, b) != b) {
    printf("%s:%d in %s: %.10g != %.10g\n", file, line, func, a, b);
    abort();
  }
}


x86 assembly (clang, -O0):
<mu_assert_eq_float_impl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movss  %xmm0,-0x1c(%rbp)
movss  %xmm1,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  -0x20(%rbp),%xmm1
call   1050 <nextafterf@plt>
ucomiss -0x20(%rbp),%xmm0
jne    1171 <mu_assert_eq_float_impl+0x41>
jp     1171 <mu_assert_eq_float_impl+0x41>
jmp    1199 <mu_assert_eq_float_impl+0x69>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
movss  -0x1c(%rbp),%xmm0
movss  -0x20(%rbp),%xmm1
lea    0xe73(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mu_assert_eq_float_impl>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
movss  %xmm1,0xc(%rsp)
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
movss  %xmm0,0x8(%rsp)
call   1050 <nextafterf@plt>
movss  0xc(%rsp),%xmm1
ucomiss %xmm1,%xmm0
jne    1167 <mu_assert_eq_float_impl+0x37>
jp     1167 <mu_assert_eq_float_impl+0x37>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0xe92(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %r14,%rcx
movss  0x8(%rsp),%xmm0
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"%s:%d in %s: %.10g != %.10g\0A\00"
define void @mu_assert_eq_float_impl(i8* %0, i32 %1, i8* %2, float %3, float %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca float
%10 = alloca float
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store float %3, float* %9
store float %4, float* %10
%11 = load float, float* %9
%12 = load float, float* %10
%13 = call float @nextafterf(float %11, float %12)
%14 = load float, float* %10
%15 = fcmp une float %13, %14
br i1 %15, label %16, label %24
16: ; preds = %5
%17 = load i8*, i8** %6
%18 = load i32, i32* %7
%19 = load i8*, i8** %8
%20 = load float, float* %9
%21 = load float, float* %10
%22 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %17, i32 %18, i8* %19, float %20, float %21)
%23 = call i32 (...) @abort()
unreachable
24: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"%s:%d in %s: %.10g != %.10g\0A\00"
define void @mu_assert_eq_float_impl(i8* %0, i32 %1, i8* %2, float %3, float %4) {
%6 = tail call float @nextafterf(float %3, float %4)
%7 = fcmp une float %6, %4
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2, float %3, float %4)
%10 = tail call i32 (...) @abort()
unreachable
11: ; preds = %5
ret void
}