#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 *, long double, ...);
void ldcmp(long double a, long double b) {
  printf("%d %d %d %d %d %d\n", a == b, a != b, a<b, a> b, a >= b, a <= b);
  printf("%Lf"
         " "
         "%Lf"
         " "
         "%Lf"
         " "
         "%Lf"
         " "
         "%Lf"
         " "
         "%Lf"
         " "
         "%Lf"
         "\n",
         a, b, a + b, a - b, a * b, a / b, -a);
  printf("%Lf"
         "\n",
         ++a);
  printf("%Lf"
         "\n",
         a++);
  printf("%Lf"
         "\n",
         a);
}


x86 assembly (clang, -O0):
<ldcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fxch   %st(1)
fucomi %st(1),%st
fldz
fld1
fld    %st(0)
fstpt  -0x3c(%rbp)
fcmovne %st(1),%st
fcmovu %st(1),%st
fstp   %st(1)
setp   %sil
setne  %dl
seta   %cl
setae  %al
or     %sil,%dl
movzbl %dl,%esi
fxch   %st(2)
fucomip %st(1),%st
fstp   %st(0)
seta   %dl
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl %al,%r8d
setae  %al
movzbl %al,%r9d
mov    %rsp,%rax
fstpt  (%rax)
lea    0xe87(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x21(%rbp)
call   1030 <printf@plt>
mov    -0x21(%rbp),%al
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fld    %st(1)
fadd   %st(1),%st
fld    %st(2)
fsub   %st(2),%st
fld    %st(3)
fmul   %st(3),%st
fld    %st(4)
fdiv   %st(4),%st
fld    %st(5)
fchs
mov    %rsp,%rcx
fstpt  0x60(%rcx)
fstpt  0x50(%rcx)
fstpt  0x40(%rcx)
fstpt  0x30(%rcx)
fstpt  0x20(%rcx)
fstpt  0x10(%rcx)
fstpt  (%rcx)
lea    0xe55(%rip),%rdi
call   1030 <printf@plt>
fldt   -0x3c(%rbp)
mov    -0x21(%rbp),%al
fldt   -0x10(%rbp)
faddp  %st,%st(1)
fld    %st(0)
fstpt  -0x10(%rbp)
mov    %rsp,%rcx
fstpt  (%rcx)
lea    0xe4c(%rip),%rdi
mov    %rdi,-0x30(%rbp)
call   1030 <printf@plt>
fldt   -0x3c(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x21(%rbp),%al
fldt   -0x10(%rbp)
fadd   %st,%st(1)
fxch   %st(1)
fstpt  -0x10(%rbp)
mov    %rsp,%rcx
fstpt  (%rcx)
call   1030 <printf@plt>
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
lea    0xe16(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldcmp>:
push   %rbx
sub    $0xa0,%rsp
fldt   0xc0(%rsp)
fldt   0xb0(%rsp)
xor    %ecx,%ecx
xor    %r8d,%r8d
fucomi %st(1),%st
fld    %st(0)
fxch   %st(1)
fstpt  0x7c(%rsp)
fld    %st(1)
fxch   %st(2)
fstpt  0x94(%rsp)
fldz
fld1
fld    %st(0)
fstpt  0x88(%rsp)
fcmovne %st(1),%st
fcmovu %st(1),%st
fstp   %st(1)
setp   %al
setne  %dl
seta   %cl
setae  %r8b
or     %al,%dl
movzbl %dl,%esi
xor    %edx,%edx
xor    %r9d,%r9d
fxch   %st(2)
fucomip %st(1),%st
fstp   %st(0)
seta   %dl
setae  %r9b
fstpt  (%rsp)
lea    0xe7f(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
fldt   0x7c(%rsp)
fldt   0x94(%rsp)
fld    %st(1)
fadd   %st(1),%st
fld    %st(2)
fsub   %st(2),%st
fld    %st(3)
fmul   %st(3),%st
fld    %st(4)
fdiv   %st(4),%st
fld    %st(5)
fchs
fstpt  0x60(%rsp)
fstpt  0x50(%rsp)
fstpt  0x40(%rsp)
fstpt  0x30(%rsp)
fstpt  0x20(%rsp)
fstpt  0x10(%rsp)
fstpt  (%rsp)
lea    0xe4a(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
fldt   0x88(%rsp)
fldt   0x7c(%rsp)
faddp  %st,%st(1)
fld    %st(0)
fstpt  0x7c(%rsp)
fstpt  (%rsp)
lea    0xe3e(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
fldt   0x88(%rsp)
fldt   0x7c(%rsp)
fadd   %st,%st(1)
fxch   %st(1)
fstpt  0x88(%rsp)
fstpt  (%rsp)
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
fldt   0x88(%rsp)
fstpt  (%rsp)
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0xa0,%rsp
pop    %rbx
ret

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

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