#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 *, double, ...);
void dcmp(double a, double 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):
<dcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
movsd  -0x8(%rbp),%xmm1
ucomisd -0x10(%rbp),%xmm1
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%esi
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
ucomisd %xmm2,%xmm1
seta   %al
and    $0x1,%al
movzbl %al,%edx
movsd  -0x8(%rbp),%xmm1
ucomisd -0x10(%rbp),%xmm1
seta   %al
and    $0x1,%al
movzbl %al,%ecx
movsd  -0x8(%rbp),%xmm1
ucomisd -0x10(%rbp),%xmm1
setae  %al
and    $0x1,%al
movzbl %al,%r8d
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
ucomisd %xmm2,%xmm1
setae  %al
and    $0x1,%al
movzbl %al,%r9d
lea    0xe5b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
addsd  -0x10(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm3
subsd  -0x10(%rbp),%xmm3
movsd  -0x8(%rbp),%xmm4
mulsd  -0x10(%rbp),%xmm4
movsd  -0x8(%rbp),%xmm5
divsd  -0x10(%rbp),%xmm5
movsd  -0x8(%rbp),%xmm6
movq   %xmm6,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm6
lea    0xe12(%rip),%rdi
mov    $0x7,%al
call   1030 <printf@plt>
movsd  0xde8(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
lea    0xe04(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  0xdc3(%rip),%xmm2
movaps %xmm0,%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm1,-0x8(%rbp)
lea    0xddd(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
lea    0xdca(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcmp>:
push   %rbx
sub    $0x30,%rsp
movsd  %xmm1,0x28(%rsp)
movapd %xmm0,%xmm3
movapd %xmm0,(%rsp)
cmpeqsd %xmm1,%xmm0
movapd %xmm3,%xmm2
cmpneqsd %xmm1,%xmm2
movq   %xmm2,%rsi
and    $0x1,%esi
xor    %ecx,%ecx
xor    %r8d,%r8d
ucomisd %xmm1,%xmm3
movsd  0xeb5(%rip),%xmm2
movapd %xmm2,0x10(%rsp)
seta   %cl
setae  %r8b
xor    %edx,%edx
xor    %r9d,%r9d
ucomisd %xmm3,%xmm1
andpd  %xmm2,%xmm0
seta   %dl
setae  %r9b
lea    0xead(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movapd (%rsp),%xmm0
movapd %xmm0,%xmm2
movsd  0x28(%rsp),%xmm1
addsd  %xmm1,%xmm2
movapd %xmm0,%xmm3
subsd  %xmm1,%xmm3
movapd %xmm0,%xmm4
mulsd  %xmm1,%xmm4
movapd %xmm0,%xmm5
divsd  %xmm1,%xmm5
movapd 0xe63(%rip),%xmm6
xorpd  %xmm0,%xmm6
lea    0xe7b(%rip),%rdi
mov    $0x7,%al
call   1030 <printf@plt>
movsd  0xe39(%rip),%xmm0
movapd (%rsp),%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,(%rsp)
lea    0xe69(%rip),%rbx
mov    %rbx,%rdi
movapd %xmm1,%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
movapd 0x10(%rsp),%xmm0
movapd (%rsp),%xmm1
addsd  %xmm1,%xmm0
movapd %xmm0,0x10(%rsp)
mov    %rbx,%rdi
movapd %xmm1,%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
mov    %rbx,%rdi
movaps 0x10(%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 @dcmp(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp oeq double %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to double
%10 = load double, double* %3
%11 = load double, double* %4
%12 = fcmp une double %10, %11
%13 = zext i1 %12 to i32
%14 = load double, double* %3
%15 = load double, double* %4
%16 = fcmp olt double %14, %15
%17 = zext i1 %16 to i32
%18 = load double, double* %3
%19 = load double, double* %4
%20 = fcmp ogt double %18, %19
%21 = zext i1 %20 to i32
%22 = load double, double* %3
%23 = load double, double* %4
%24 = fcmp oge double %22, %23
%25 = zext i1 %24 to i32
%26 = load double, double* %3
%27 = load double, double* %4
%28 = fcmp ole double %26, %27
%29 = zext i1 %28 to i32
%30 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double %9, i32 %13, i32 %17, i32 %21, i32 %25, i32 %29)
%31 = load double, double* %3
%32 = load double, double* %4
%33 = load double, double* %3
%34 = load double, double* %4
%35 = fadd double %33, %34
%36 = load double, double* %3
%37 = load double, double* %4
%38 = fsub double %36, %37
%39 = load double, double* %3
%40 = load double, double* %4
%41 = fmul double %39, %40
%42 = load double, double* %3
%43 = load double, double* %4
%44 = fdiv double %42, %43
%45 = load double, double* %3
%46 = fneg double %45
%47 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), double %31, double %32, double %35, double %38, double %41, double %44, double %46)
%48 = load double, double* %3
%49 = fadd double %48, 1.000000e+00
store double %49, double* %3
%50 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %49)
%51 = load double, double* %3
%52 = fadd double %51, 1.000000e+00
store double %52, double* %3
%53 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %51)
%54 = load double, double* %3
%55 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %54)
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 @dcmp(double %0, double %1) {
%3 = fcmp oeq double %0, %1
%4 = uitofp i1 %3 to double
%5 = fcmp une double %0, %1
%6 = zext i1 %5 to i32
%7 = fcmp olt double %0, %1
%8 = zext i1 %7 to i32
%9 = fcmp ogt double %0, %1
%10 = zext i1 %9 to i32
%11 = fcmp oge double %0, %1
%12 = zext i1 %11 to i32
%13 = fcmp ole double %0, %1
%14 = zext i1 %13 to i32
%15 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double %4, i32 %6, i32 %8, i32 %10, i32 %12, i32 %14)
%16 = fadd double %0, %1
%17 = fsub double %0, %1
%18 = fmul double %0, %1
%19 = fdiv double %0, %1
%20 = fneg double %0
%21 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), double %0, double %1, double %16, double %17, double %18, double %19, double %20)
%22 = fadd double %0, 1.000000e+00
%23 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %22)
%24 = fadd double %22, 1.000000e+00
%25 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %22)
%26 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %24)
ret void
}