#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*/ eq(float, double);
int test() {
  float x = 2.0f;
  double y = 3.0, z;
  z = x + y;
  if (!eq(z, 5.0))
    return 1;
  z = x - y;
  if (!eq(z, -1.0))
    return 2;
  z = x * y;
  if (!eq(z, 6.0))
    return 3;
  z = x / y;
  if (!eq(z, 0.666))
    return 4;
  x += 2.0f;
  if (!eq(x, 4.0))
    return 5;
  x -= 1.0f;
  if (!eq(x, 3.0))
    return 6;
  x *= 2.0f;
  if (!eq(x, 6.0))
    return 7;
  x /= 3.0f;
  if (!eq(x, 2.0))
    return 8;
  return 0;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  0xf18(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movsd  0xeaa(%rip),%xmm1
call   1030 <eq@plt>
cmp    $0x0,%eax
jne    1170 <test+0x60>
movl   $0x1,-0x4(%rbp)
jmp    131d <test+0x20d>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movsd  0xe7c(%rip),%xmm1
call   1030 <eq@plt>
cmp    $0x0,%eax
jne    11ae <test+0x9e>
movl   $0x2,-0x4(%rbp)
jmp    131d <test+0x20d>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movsd  0xe46(%rip),%xmm1
call   1030 <eq@plt>
cmp    $0x0,%eax
jne    11ec <test+0xdc>
movl   $0x3,-0x4(%rbp)
jmp    131d <test+0x20d>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movsd  0xe10(%rip),%xmm1
call   1030 <eq@plt>
cmp    $0x0,%eax
jne    122a <test+0x11a>
movl   $0x4,-0x4(%rbp)
jmp    131d <test+0x20d>
movss  0xe06(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movsd  0xddf(%rip),%xmm1
call   1030 <eq@plt>
cmp    $0x0,%eax
jne    1263 <test+0x153>
movl   $0x5,-0x4(%rbp)
jmp    131d <test+0x20d>
movss  -0x8(%rbp),%xmm0
movss  0xdcc(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movsd  0xd82(%rip),%xmm1
call   1030 <eq@plt>
cmp    $0x0,%eax
jne    12a0 <test+0x190>
movl   $0x6,-0x4(%rbp)
jmp    131d <test+0x20d>
movss  0xd90(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movsd  0xd59(%rip),%xmm1
call   1030 <eq@plt>
cmp    $0x0,%eax
jne    12d9 <test+0x1c9>
movl   $0x7,-0x4(%rbp)
jmp    131d <test+0x20d>
movss  -0x8(%rbp),%xmm0
movss  0xd5a(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movsd  0xd34(%rip),%xmm1
call   1030 <eq@plt>
cmp    $0x0,%eax
jne    1316 <test+0x206>
movl   $0x8,-0x4(%rbp)
jmp    131d <test+0x20d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
movss  0xee7(%rip),%xmm0
movsd  0xeff(%rip),%xmm1
call   1030 <eq@plt>
test   %eax,%eax
je     11f3 <test+0xe3>
movss  0xece(%rip),%xmm0
movsd  0xeea(%rip),%xmm1
call   1030 <eq@plt>
test   %eax,%eax
je     11fa <test+0xea>
movss  0xeb5(%rip),%xmm0
movsd  0xed5(%rip),%xmm1
call   1030 <eq@plt>
test   %eax,%eax
je     1201 <test+0xf1>
movss  0xe9c(%rip),%xmm0
movsd  0xec0(%rip),%xmm1
call   1030 <eq@plt>
test   %eax,%eax
je     1208 <test+0xf8>
movss  0xe83(%rip),%xmm0
movsd  0xeab(%rip),%xmm1
call   1030 <eq@plt>
test   %eax,%eax
je     120f <test+0xff>
movss  0xe6e(%rip),%xmm0
movsd  0xe9a(%rip),%xmm1
call   1030 <eq@plt>
test   %eax,%eax
je     1216 <test+0x106>
movss  0xe49(%rip),%xmm0
movsd  0xe69(%rip),%xmm1
call   1030 <eq@plt>
test   %eax,%eax
je     121d <test+0x10d>
movss  0xe40(%rip),%xmm0
movsd  0xe70(%rip),%xmm1
call   1030 <eq@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
shl    $0x3,%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret
mov    $0x2,%eax
pop    %rcx
ret
mov    $0x3,%eax
pop    %rcx
ret
mov    $0x4,%eax
pop    %rcx
ret
mov    $0x5,%eax
pop    %rcx
ret
mov    $0x6,%eax
pop    %rcx
ret
mov    $0x7,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test() {
%1 = alloca i32
%2 = alloca float
%3 = alloca double
%4 = alloca double
store float 2.000000e+00, float* %2
store double 3.000000e+00, double* %3
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = load double, double* %3
%8 = fadd double %6, %7
store double %8, double* %4
%9 = load double, double* %4
%10 = fptrunc double %9 to float
%11 = call i32 @eq(float %10, double 5.000000e+00)
%12 = icmp ne i32 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %0
store i32 1, i32* %1
br label %73
14: ; preds = %0
%15 = load float, float* %2
%16 = fpext float %15 to double
%17 = load double, double* %3
%18 = fsub double %16, %17
store double %18, double* %4
%19 = load double, double* %4
%20 = fptrunc double %19 to float
%21 = call i32 @eq(float %20, double -1.000000e+00)
%22 = icmp ne i32 %21, 0
br i1 %22, label %24, label %23
23: ; preds = %14
store i32 2, i32* %1
br label %73
24: ; preds = %14
%25 = load float, float* %2
%26 = fpext float %25 to double
%27 = load double, double* %3
%28 = fmul double %26, %27
store double %28, double* %4
%29 = load double, double* %4
%30 = fptrunc double %29 to float
%31 = call i32 @eq(float %30, double 6.000000e+00)
%32 = icmp ne i32 %31, 0
br i1 %32, label %34, label %33
33: ; preds = %24
store i32 3, i32* %1
br label %73
34: ; preds = %24
%35 = load float, float* %2
%36 = fpext float %35 to double
%37 = load double, double* %3
%38 = fdiv double %36, %37
store double %38, double* %4
%39 = load double, double* %4
%40 = fptrunc double %39 to float
%41 = call i32 @eq(float %40, double 6.660000e-01)
%42 = icmp ne i32 %41, 0
br i1 %42, label %44, label %43
43: ; preds = %34
store i32 4, i32* %1
br label %73
44: ; preds = %34
%45 = load float, float* %2
%46 = fadd float %45, 2.000000e+00
store float %46, float* %2
%47 = load float, float* %2
%48 = call i32 @eq(float %47, double 4.000000e+00)
%49 = icmp ne i32 %48, 0
br i1 %49, label %51, label %50
50: ; preds = %44
store i32 5, i32* %1
br label %73
51: ; preds = %44
%52 = load float, float* %2
%53 = fsub float %52, 1.000000e+00
store float %53, float* %2
%54 = load float, float* %2
%55 = call i32 @eq(float %54, double 3.000000e+00)
%56 = icmp ne i32 %55, 0
br i1 %56, label %58, label %57
57: ; preds = %51
store i32 6, i32* %1
br label %73
58: ; preds = %51
%59 = load float, float* %2
%60 = fmul float %59, 2.000000e+00
store float %60, float* %2
%61 = load float, float* %2
%62 = call i32 @eq(float %61, double 6.000000e+00)
%63 = icmp ne i32 %62, 0
br i1 %63, label %65, label %64
64: ; preds = %58
store i32 7, i32* %1
br label %73
65: ; preds = %58
%66 = load float, float* %2
%67 = fdiv float %66, 3.000000e+00
store float %67, float* %2
%68 = load float, float* %2
%69 = call i32 @eq(float %68, double 2.000000e+00)
%70 = icmp ne i32 %69, 0
br i1 %70, label %72, label %71
71: ; preds = %65
store i32 8, i32* %1
br label %73
72: ; preds = %65
store i32 0, i32* %1
br label %73
73: ; preds = %72, %71, %64, %57, %50, %43, %33, %23, %13
%74 = load i32, i32* %1
ret i32 %74
}

LLVM IR (-O2):
define i32 @test() {
%1 = tail call i32 @eq(float 5.000000e+00, double 5.000000e+00)
%2 = icmp eq i32 %1, 0
br i1 %2, label %25, label %3
3: ; preds = %0
%4 = tail call i32 @eq(float -1.000000e+00, double -1.000000e+00)
%5 = icmp eq i32 %4, 0
br i1 %5, label %25, label %6
6: ; preds = %3
%7 = tail call i32 @eq(float 6.000000e+00, double 6.000000e+00)
%8 = icmp eq i32 %7, 0
br i1 %8, label %25, label %9
9: ; preds = %6
%10 = tail call i32 @eq(float 0x3FE5555560000000, double 6.660000e-01)
%11 = icmp eq i32 %10, 0
br i1 %11, label %25, label %12
12: ; preds = %9
%13 = tail call i32 @eq(float 4.000000e+00, double 4.000000e+00)
%14 = icmp eq i32 %13, 0
br i1 %14, label %25, label %15
15: ; preds = %12
%16 = tail call i32 @eq(float 3.000000e+00, double 3.000000e+00)
%17 = icmp eq i32 %16, 0
br i1 %17, label %25, label %18
18: ; preds = %15
%19 = tail call i32 @eq(float 6.000000e+00, double 6.000000e+00)
%20 = icmp eq i32 %19, 0
br i1 %20, label %25, label %21
21: ; preds = %18
%22 = tail call i32 @eq(float 2.000000e+00, double 2.000000e+00)
%23 = icmp eq i32 %22, 0
%24 = select i1 %23, i32 8, i32 0
br label %25
25: ; preds = %21, %18, %15, %12, %9, %6, %3, %0
%26 = phi i32 [ 1, %0 ], [ 2, %3 ], [ 3, %6 ], [ 4, %9 ], [ 5, %12 ], [ 6, %15 ], [ 7, %18 ], [ %24, %21 ]
ret i32 %26
}