#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 assert_hex_eq(char *, char *, int, int, char const *, int);
int /*<<< orphan*/ printf(char *, float, float);
int assert_flt_eq(float a, float b, const char *testcase, int line) {
  int ret = assert_hex_eq((char *)&a, (char *)&b, sizeof(float), sizeof(float),
                          testcase, line);
  if (ret)
    printf("#expected=%f actual %f\n", a, b);
  return ret;
}


x86 assembly (clang, -O0):
<assert_flt_eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%r8
mov    -0x14(%rbp),%r9d
mov    $0x4,%ecx
mov    %ecx,%edx
call   1030 <assert_hex_eq@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1178 <assert_flt_eq+0x58>
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_flt_eq>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%r9d
mov    %rdi,%r8
movss  %xmm0,0xc(%rsp)
movss  %xmm1,0x8(%rsp)
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0x4,%edx
mov    $0x4,%ecx
call   1030 <assert_hex_eq@plt>
mov    %eax,%ebx
test   %eax,%eax
je     116e <assert_flt_eq+0x4e>
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"#expected=%f actual %f\0A\00"
define i32 @assert_flt_eq(float %0, float %1, i8* %2, i32 %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store float %0, float* %5
store float %1, float* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = bitcast float* %5 to i8*
%11 = bitcast float* %6 to i8*
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = call i32 @assert_hex_eq(i8* %10, i8* %11, i32 4, i32 4, i8* %12, i32 %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %4
%18 = load float, float* %5
%19 = load float, float* %6
%20 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), float %18, float %19)
br label %21
21: ; preds = %17, %4
%22 = load i32, i32* %9
ret i32 %22
}

LLVM IR (-O2):
@.str = [24 x i8] c"#expected=%f actual %f\0A\00"
define i32 @assert_flt_eq(float %0, float %1, i8* %2, i32 %3) {
%5 = alloca float
%6 = alloca float
store float %0, float* %5
store float %1, float* %6
%7 = bitcast float* %5 to i8*
%8 = bitcast float* %6 to i8*
%9 = call i32 @assert_hex_eq(i8* %7, i8* %8, i32 4, i32 4, i8* %2, i32 %3)
%10 = icmp eq i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %4
%12 = load float, float* %5
%13 = load float, float* %6
%14 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), float %12, float %13)
br label %15
15: ; preds = %11, %4
ret i32 %9
}