#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 */
double fabs(float);
int /*<<< orphan*/ printf(char *, int, char const *, ...);
int ntmtest_eqf(float got, float expected, int line, const char *filepath) {
  if (fabs(got - expected) < 0.0001) {
    printf("PASS\t%04d\t%s\n", line, filepath);
    return 0;
  }
  printf("FAIL\t%04d\t%s\tgot %f\texpected %f\n", line, filepath, got,
         expected);
  return 1;
}


x86 assembly (clang, -O0):
<ntmtest_eqf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
call   1040 <fabs@plt>
movaps %xmm0,%xmm1
movsd  0xead(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    117e <ntmtest_eqf+0x5e>
mov    -0x10(%rbp),%esi
mov    -0x18(%rbp),%rdx
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11ac <ntmtest_eqf+0x8c>
mov    -0x10(%rbp),%esi
mov    -0x18(%rbp),%rdx
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe78(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntmtest_eqf>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %edi,%ebp
movss  %xmm0,0x8(%rsp)
movss  %xmm1,0xc(%rsp)
subss  %xmm1,%xmm0
call   1040 <fabs@plt>
movsd  0xeb6(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1167 <ntmtest_eqf+0x47>
lea    0xeb1(%rip),%rdi
xor    %ebx,%ebx
mov    %ebp,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1193 <ntmtest_eqf+0x73>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0xc(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe94(%rip),%rdi
mov    %ebp,%esi
mov    %r14,%rdx
mov    $0x2,%al
call   1030 <printf@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"PASS\09%04d\09%s\0A\00"
@.str.1 = [33 x i8] c"FAIL\09%04d\09%s\09got %f\09expected %f\0A\00"
define i32 @ntmtest_eqf(float %0, float %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca float
%7 = alloca float
%8 = alloca i32
%9 = alloca i8*
store float %0, float* %6
store float %1, float* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
%10 = load float, float* %6
%11 = load float, float* %7
%12 = fsub float %10, %11
%13 = call double @fabs(float %12)
%14 = fcmp olt double %13, 1.000000e-04
br i1 %14, label %15, label %19
15: ; preds = %4
%16 = load i32, i32* %8
%17 = load i8*, i8** %9
%18 = call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %16, i8* %17)
store i32 0, i32* %5
br label %27
19: ; preds = %4
%20 = load i32, i32* %8
%21 = load i8*, i8** %9
%22 = load float, float* %6
%23 = fpext float %22 to double
%24 = load float, float* %7
%25 = fpext float %24 to double
%26 = call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %20, i8* %21, double %23, double %25)
store i32 1, i32* %5
br label %27
27: ; preds = %19, %15
%28 = load i32, i32* %5
ret i32 %28
}

LLVM IR (-O2):
@.str = [14 x i8] c"PASS\09%04d\09%s\0A\00"
@.str.1 = [33 x i8] c"FAIL\09%04d\09%s\09got %f\09expected %f\0A\00"
define i32 @ntmtest_eqf(float %0, float %1, i32 %2, i8* %3) {
%5 = fsub float %0, %1
%6 = tail call double @fabs(float %5)
%7 = fcmp olt double %6, 1.000000e-04
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %2, i8* %3)
br label %14
10: ; preds = %4
%11 = fpext float %0 to double
%12 = fpext float %1 to double
%13 = tail call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %2, i8* %3, double %11, double %12)
br label %14
14: ; preds = %10, %8
%15 = phi i32 [ 0, %8 ], [ 1, %10 ]
ret i32 %15
}