#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*/ printf(char *, float, ...);
void fcmp(float a, float b) {
  printf("%d %d %d %d %d %d\n", a == b, a != b, a<b, a> b, a >= b, a <= b);
  printf("%f"
         " "
         "%f"
         " "
         "%f"
         " "
         "%f"
         " "
         "%f"
         " "
         "%f"
         " "
         "%f"
         "\n",
         a, b, a + b, a - b, a * b, a / b, -a);
  printf("%f"
         "\n",
         ++a);
  printf("%f"
         "\n",
         a++);
  printf("%f"
         "\n",
         a);
}


x86 assembly (clang, -O0):
<fcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2ss %eax,%xmm0
movss  -0x4(%rbp),%xmm1
ucomiss -0x8(%rbp),%xmm1
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%esi
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
ucomiss %xmm2,%xmm1
seta   %al
and    $0x1,%al
movzbl %al,%edx
movss  -0x4(%rbp),%xmm1
ucomiss -0x8(%rbp),%xmm1
seta   %al
and    $0x1,%al
movzbl %al,%ecx
movss  -0x4(%rbp),%xmm1
ucomiss -0x8(%rbp),%xmm1
setae  %al
and    $0x1,%al
movzbl %al,%r8d
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
ucomiss %xmm2,%xmm1
setae  %al
and    $0x1,%al
movzbl %al,%r9d
lea    0xe5d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x4(%rbp),%xmm2
addss  -0x8(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movss  -0x4(%rbp),%xmm3
subss  -0x8(%rbp),%xmm3
cvtss2sd %xmm3,%xmm3
movss  -0x4(%rbp),%xmm4
mulss  -0x8(%rbp),%xmm4
cvtss2sd %xmm4,%xmm4
movss  -0x4(%rbp),%xmm5
divss  -0x8(%rbp),%xmm5
cvtss2sd %xmm5,%xmm5
movss  -0x4(%rbp),%xmm6
movd   %xmm6,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm6
cvtss2sd %xmm6,%xmm6
lea    0xe06(%rip),%rdi
mov    $0x7,%al
call   1030 <printf@plt>
movss  0xde0(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
lea    0xdf8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm0
movss  0xdbb(%rip),%xmm2
movaps %xmm0,%xmm1
addss  %xmm2,%xmm1
movss  %xmm1,-0x4(%rbp)
lea    0xdd1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm0
lea    0xdbe(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcmp>:
push   %rbx
sub    $0x30,%rsp
movss  %xmm1,0xc(%rsp)
movaps %xmm0,%xmm2
movaps %xmm0,0x10(%rsp)
cmpeqss %xmm1,%xmm0
movaps %xmm2,%xmm3
cmpneqss %xmm1,%xmm3
movd   %xmm3,%esi
and    $0x1,%esi
xor    %ecx,%ecx
xor    %r8d,%r8d
ucomiss %xmm1,%xmm2
movss  0xeb9(%rip),%xmm3
movaps %xmm3,0x20(%rsp)
seta   %cl
setae  %r8b
xor    %edx,%edx
xor    %r9d,%r9d
ucomiss %xmm2,%xmm1
andps  %xmm3,%xmm0
seta   %dl
setae  %r9b
lea    0xeb4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm5
xorps  %xmm1,%xmm1
cvtss2sd %xmm5,%xmm1
movaps 0x10(%rsp),%xmm0
movaps %xmm0,%xmm2
addss  %xmm5,%xmm2
cvtss2sd %xmm2,%xmm2
movaps %xmm0,%xmm3
subss  %xmm5,%xmm3
cvtss2sd %xmm3,%xmm3
movaps %xmm0,%xmm4
mulss  %xmm5,%xmm4
movaps %xmm5,%xmm6
cvtss2sd %xmm4,%xmm4
movaps %xmm0,%xmm5
divss  %xmm6,%xmm5
cvtss2sd %xmm5,%xmm5
movaps 0xe55(%rip),%xmm6
xorps  %xmm0,%xmm6
cvtss2sd %xmm6,%xmm6
lea    0xe6a(%rip),%rdi
mov    $0x7,%al
call   1030 <printf@plt>
movss  0xe28(%rip),%xmm0
movaps 0x10(%rsp),%xmm1
addss  %xmm0,%xmm1
movaps %xmm1,0x10(%rsp)
lea    0xe58(%rip),%rbx
mov    %rbx,%rdi
movaps %xmm1,%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
movaps 0x20(%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
addss  %xmm1,%xmm0
movaps %xmm0,0x20(%rsp)
mov    %rbx,%rdi
movaps %xmm1,%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
mov    %rbx,%rdi
movaps 0x20(%rsp),%xmm0
mov    $0x1,%al
add    $0x30,%rsp
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"%d %d %d %d %d %d\0A\00"
@.str.1 = [22 x i8] c"%f %f %f %f %f %f %f\0A\00"
@.str.2 = [4 x i8] c"%f\0A\00"
define void @fcmp(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 oeq float %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to float
%10 = load float, float* %3
%11 = load float, float* %4
%12 = fcmp une float %10, %11
%13 = zext i1 %12 to i32
%14 = load float, float* %3
%15 = load float, float* %4
%16 = fcmp olt float %14, %15
%17 = zext i1 %16 to i32
%18 = load float, float* %3
%19 = load float, float* %4
%20 = fcmp ogt float %18, %19
%21 = zext i1 %20 to i32
%22 = load float, float* %3
%23 = load float, float* %4
%24 = fcmp oge float %22, %23
%25 = zext i1 %24 to i32
%26 = load float, float* %3
%27 = load float, float* %4
%28 = fcmp ole float %26, %27
%29 = zext i1 %28 to i32
%30 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), float %9, i32 %13, i32 %17, i32 %21, i32 %25, i32 %29)
%31 = load float, float* %3
%32 = load float, float* %4
%33 = fpext float %32 to double
%34 = load float, float* %3
%35 = load float, float* %4
%36 = fadd float %34, %35
%37 = fpext float %36 to double
%38 = load float, float* %3
%39 = load float, float* %4
%40 = fsub float %38, %39
%41 = fpext float %40 to double
%42 = load float, float* %3
%43 = load float, float* %4
%44 = fmul float %42, %43
%45 = fpext float %44 to double
%46 = load float, float* %3
%47 = load float, float* %4
%48 = fdiv float %46, %47
%49 = fpext float %48 to double
%50 = load float, float* %3
%51 = fneg float %50
%52 = fpext float %51 to double
%53 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), float %31, double %33, double %37, double %41, double %45, double %49, double %52)
%54 = load float, float* %3
%55 = fadd float %54, 1.000000e+00
store float %55, float* %3
%56 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), float %55)
%57 = load float, float* %3
%58 = fadd float %57, 1.000000e+00
store float %58, float* %3
%59 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), float %57)
%60 = load float, float* %3
%61 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), float %60)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"%d %d %d %d %d %d\0A\00"
@.str.1 = [22 x i8] c"%f %f %f %f %f %f %f\0A\00"
@.str.2 = [4 x i8] c"%f\0A\00"
define void @fcmp(float %0, float %1) {
%3 = fcmp oeq float %0, %1
%4 = uitofp i1 %3 to float
%5 = fcmp une float %0, %1
%6 = zext i1 %5 to i32
%7 = fcmp olt float %0, %1
%8 = zext i1 %7 to i32
%9 = fcmp ogt float %0, %1
%10 = zext i1 %9 to i32
%11 = fcmp oge float %0, %1
%12 = zext i1 %11 to i32
%13 = fcmp ole float %0, %1
%14 = zext i1 %13 to i32
%15 = tail call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), float %4, i32 %6, i32 %8, i32 %10, i32 %12, i32 %14)
%16 = fpext float %1 to double
%17 = fadd float %0, %1
%18 = fpext float %17 to double
%19 = fsub float %0, %1
%20 = fpext float %19 to double
%21 = fmul float %0, %1
%22 = fpext float %21 to double
%23 = fdiv float %0, %1
%24 = fpext float %23 to double
%25 = fneg float %0
%26 = fpext float %25 to double
%27 = tail call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), float %0, double %16, double %18, double %20, double %22, double %24, double %26)
%28 = fadd float %0, 1.000000e+00
%29 = tail call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), float %28)
%30 = fadd float %28, 1.000000e+00
%31 = tail call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), float %28)
%32 = tail call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), float %30)
ret void
}