#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*/ test(int);
void foo() {
  float f, f2;
  typedef double mydouble;
  mydouble d;
  double d2;
  test(f == f);
  test(d == d);
  test(f != f);
  test(d != d);
  test(f != d);
  test(d == (d - f));
  test(f == f2);
  test(d == d2);
  test(d + 1 == d);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  -0x4(%rbp),%xmm0
ucomiss -0x4(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test@plt>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test@plt>
movss  -0x4(%rbp),%xmm0
ucomiss -0x4(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test@plt>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test@plt>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
subsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test@plt>
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test@plt>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test@plt>
movsd  0xdee(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
xor    %edi,%edi
call   1030 <test@plt>
xor    %edi,%edi
call   1030 <test@plt>
mov    $0x1,%edi
call   1030 <test@plt>
mov    $0x1,%edi
call   1030 <test@plt>
mov    $0x1,%edi
call   1030 <test@plt>
xor    %edi,%edi
call   1030 <test@plt>
xor    %edi,%edi
call   1030 <test@plt>
xor    %edi,%edi
call   1030 <test@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <test@plt>

LLVM IR (-O0):
define void @foo() {
%1 = alloca float
%2 = alloca float
%3 = alloca double
%4 = alloca double
%5 = load float, float* %1
%6 = load float, float* %1
%7 = fcmp oeq float %5, %6
%8 = zext i1 %7 to i32
%9 = call i32 @test(i32 %8)
%10 = load double, double* %3
%11 = load double, double* %3
%12 = fcmp oeq double %10, %11
%13 = zext i1 %12 to i32
%14 = call i32 @test(i32 %13)
%15 = load float, float* %1
%16 = load float, float* %1
%17 = fcmp une float %15, %16
%18 = zext i1 %17 to i32
%19 = call i32 @test(i32 %18)
%20 = load double, double* %3
%21 = load double, double* %3
%22 = fcmp une double %20, %21
%23 = zext i1 %22 to i32
%24 = call i32 @test(i32 %23)
%25 = load float, float* %1
%26 = fpext float %25 to double
%27 = load double, double* %3
%28 = fcmp une double %26, %27
%29 = zext i1 %28 to i32
%30 = call i32 @test(i32 %29)
%31 = load double, double* %3
%32 = load double, double* %3
%33 = load float, float* %1
%34 = fpext float %33 to double
%35 = fsub double %32, %34
%36 = fcmp oeq double %31, %35
%37 = zext i1 %36 to i32
%38 = call i32 @test(i32 %37)
%39 = load float, float* %1
%40 = load float, float* %2
%41 = fcmp oeq float %39, %40
%42 = zext i1 %41 to i32
%43 = call i32 @test(i32 %42)
%44 = load double, double* %3
%45 = load double, double* %4
%46 = fcmp oeq double %44, %45
%47 = zext i1 %46 to i32
%48 = call i32 @test(i32 %47)
%49 = load double, double* %3
%50 = fadd double %49, 1.000000e+00
%51 = load double, double* %3
%52 = fcmp oeq double %50, %51
%53 = zext i1 %52 to i32
%54 = call i32 @test(i32 %53)
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 @test(i32 0)
%2 = tail call i32 @test(i32 0)
%3 = tail call i32 @test(i32 1)
%4 = tail call i32 @test(i32 1)
%5 = tail call i32 @test(i32 1)
%6 = tail call i32 @test(i32 0)
%7 = tail call i32 @test(i32 0)
%8 = tail call i32 @test(i32 0)
%9 = tail call i32 @test(i32 0)
ret void
}