#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*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void expectf(float a, float b) {
  if (a != b) {
    printf(" [ERROR]\n");
    printf("    Expected: %f\n", b);
    printf("    Result:   %f\n", a);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<expectf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jne    114c <expectf+0x2c>
jp     114c <expectf+0x2c>
jmp    1192 <expectf+0x72>
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expectf>:
ucomiss %xmm1,%xmm0
jne    1138 <expectf+0x8>
jp     1138 <expectf+0x8>
ret
push   %rax
lea    0xee4(%rip),%rdi
movss  %xmm0,0x4(%rsp)
movss  %xmm1,(%rsp)
call   1030 <puts@plt>
movss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea0(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9a(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c" [ERROR]\0A\00"
@.str.1 = [18 x i8] c" Expected: %f\0A\00"
@.str.2 = [18 x i8] c" Result: %f\0A\00"
define void @expectf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp une float %5, %6
br i1 %7, label %8, label %17
8: ; preds = %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%10 = load float, float* %4
%11 = fpext float %10 to double
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %11)
%13 = load float, float* %3
%14 = fpext float %13 to double
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), double %14)
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str.1 = [18 x i8] c" Expected: %f\0A\00"
@.str.2 = [18 x i8] c" Result: %f\0A\00"
@str = [9 x i8] c" [ERROR]\00"
define void @expectf(float %0, float %1) {
%3 = fcmp une float %0, %1
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%6 = fpext float %1 to double
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %6)
%8 = fpext float %0 to double
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), double %8)
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %2
ret void
}