#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 printf(char *, long double, long double, long double, int, int);
int test(long double d) {
  int i, j;
  long double e = 3.14L, f = 0;
  i = d == 1.0L;
  j = d != e;
  if (d < 3)
    f += 1;
  if (d <= e)
    f += 2;
  if (d > e)
    f += 3L;
  if (d >= e)
    f += 4u;
  return printf("%Lf, %Lf, %Lf, %d, %d\n", d, e, f, i, j);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   0xedc(%rip)
fstpt  -0x30(%rbp)
fldz
fstpt  -0x40(%rbp)
fldt   -0x10(%rbp)
fld1
fucomip %st(1),%st
fstp   %st(0)
setnp  %cl
sete   %al
and    %cl,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
fldt   -0x10(%rbp)
fldt   -0x30(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setp   %cl
setne  %al
or     %cl,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
fldt   -0x10(%rbp)
flds   0xeaa(%rip)
fucomip %st(1),%st
fstp   %st(0)
jbe    117f <test+0x6f>
jmp    1175 <test+0x65>
fldt   -0x40(%rbp)
fld1
faddp  %st,%st(1)
fstpt  -0x40(%rbp)
fldt   -0x10(%rbp)
fldt   -0x30(%rbp)
fucomip %st(1),%st
fstp   %st(0)
jb     11a2 <test+0x92>
jmp    1194 <test+0x84>
fldt   -0x40(%rbp)
flds   0xe77(%rip)
faddp  %st,%st(1)
fstpt  -0x40(%rbp)
fldt   -0x10(%rbp)
fldt   -0x30(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jbe    11c7 <test+0xb7>
jmp    11b9 <test+0xa9>
fldt   -0x40(%rbp)
flds   0xe4e(%rip)
faddp  %st,%st(1)
fstpt  -0x40(%rbp)
fldt   -0x10(%rbp)
fldt   -0x30(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jb     11ec <test+0xdc>
jmp    11de <test+0xce>
fldt   -0x40(%rbp)
flds   0xe31(%rip)
faddp  %st,%st(1)
fstpt  -0x40(%rbp)
fldt   -0x10(%rbp)
fldt   -0x30(%rbp)
fldt   -0x40(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    %rsp,%rax
fstpt  0x20(%rax)
fstpt  0x10(%rax)
fstpt  (%rax)
lea    0xe0f(%rip),%rdi
call   1030 <printf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
sub    $0x38,%rsp
fldt   0x40(%rsp)
flds   0xee2(%rip)
fucomi %st(1),%st
fld1
fldz
fcmovnbe %st(1),%st
fldt   0xee4(%rip)
fucomi %st(4),%st
fld    %st(1)
fadds  0xece(%rip)
fcmovb %st(2),%st
fstp   %st(2)
fxch   %st(3)
fadd   %st(1),%st
fxch   %st(4)
fucomi %st(3),%st
fxch   %st(1)
fcmovnbe %st(4),%st
fstp   %st(4)
fld    %st(3)
fadds  0xeb8(%rip)
fcmovb %st(4),%st
fstp   %st(4)
setp   %al
setne  %cl
or     %al,%cl
movzbl %cl,%edx
fxch   %st(1)
fucomip %st(1),%st
setnp  %al
sete   %cl
and    %al,%cl
movzbl %cl,%esi
fxch   %st(1)
fstpt  0x10(%rsp)
fstpt  (%rsp)
fstpt  0x20(%rsp)
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"%Lf, %Lf, %Lf, %d, %d\0A\00"
define i32 @test(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca i32
%4 = alloca i32
%5 = alloca x86_fp80
%6 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
store x86_fp80 0xK4000C8F5C28F5C28F5C3, x86_fp80* %5
store x86_fp80 0xK00000000000000000000, x86_fp80* %6
%7 = load x86_fp80, x86_fp80* %2
%8 = fcmp oeq x86_fp80 %7, 0xK3FFF8000000000000000
%9 = zext i1 %8 to i32
store i32 %9, i32* %3
%10 = load x86_fp80, x86_fp80* %2
%11 = load x86_fp80, x86_fp80* %5
%12 = fcmp une x86_fp80 %10, %11
%13 = zext i1 %12 to i32
store i32 %13, i32* %4
%14 = load x86_fp80, x86_fp80* %2
%15 = fcmp olt x86_fp80 %14, 0xK4000C000000000000000
br i1 %15, label %16, label %19
16: ; preds = %1
%17 = load x86_fp80, x86_fp80* %6
%18 = fadd x86_fp80 %17, 0xK3FFF8000000000000000
store x86_fp80 %18, x86_fp80* %6
br label %19
19: ; preds = %16, %1
%20 = load x86_fp80, x86_fp80* %2
%21 = load x86_fp80, x86_fp80* %5
%22 = fcmp ole x86_fp80 %20, %21
br i1 %22, label %23, label %26
23: ; preds = %19
%24 = load x86_fp80, x86_fp80* %6
%25 = fadd x86_fp80 %24, 0xK40008000000000000000
store x86_fp80 %25, x86_fp80* %6
br label %26
26: ; preds = %23, %19
%27 = load x86_fp80, x86_fp80* %2
%28 = load x86_fp80, x86_fp80* %5
%29 = fcmp ogt x86_fp80 %27, %28
br i1 %29, label %30, label %33
30: ; preds = %26
%31 = load x86_fp80, x86_fp80* %6
%32 = fadd x86_fp80 %31, 0xK4000C000000000000000
store x86_fp80 %32, x86_fp80* %6
br label %33
33: ; preds = %30, %26
%34 = load x86_fp80, x86_fp80* %2
%35 = load x86_fp80, x86_fp80* %5
%36 = fcmp oge x86_fp80 %34, %35
br i1 %36, label %37, label %40
37: ; preds = %33
%38 = load x86_fp80, x86_fp80* %6
%39 = fadd x86_fp80 %38, 0xK40018000000000000000
store x86_fp80 %39, x86_fp80* %6
br label %40
40: ; preds = %37, %33
%41 = load x86_fp80, x86_fp80* %2
%42 = load x86_fp80, x86_fp80* %5
%43 = load x86_fp80, x86_fp80* %6
%44 = load i32, i32* %3
%45 = load i32, i32* %4
%46 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), x86_fp80 %41, x86_fp80 %42, x86_fp80 %43, i32 %44, i32 %45)
ret i32 %46
}

LLVM IR (-O2):
@.str = [23 x i8] c"%Lf, %Lf, %Lf, %d, %d\0A\00"
define i32 @test(x86_fp80 %0) {
%2 = fcmp olt x86_fp80 %0, 0xK4000C000000000000000
%3 = select i1 %2, x86_fp80 0xK3FFF8000000000000000, x86_fp80 0xK00000000000000000000
%4 = fcmp ugt x86_fp80 %0, 0xK4000C8F5C28F5C28F5C3
%5 = fadd x86_fp80 %3, 0xK40008000000000000000
%6 = select i1 %4, x86_fp80 %3, x86_fp80 %5
%7 = fcmp ogt x86_fp80 %0, 0xK4000C8F5C28F5C28F5C3
%8 = fadd x86_fp80 %6, 0xK4000C000000000000000
%9 = select i1 %7, x86_fp80 %8, x86_fp80 %6
%10 = fcmp ult x86_fp80 %0, 0xK4000C8F5C28F5C28F5C3
%11 = fadd x86_fp80 %9, 0xK40018000000000000000
%12 = select i1 %10, x86_fp80 %9, x86_fp80 %11
%13 = fcmp une x86_fp80 %0, 0xK4000C8F5C28F5C28F5C3
%14 = zext i1 %13 to i32
%15 = fcmp oeq x86_fp80 %0, 0xK3FFF8000000000000000
%16 = zext i1 %15 to i32
%17 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), x86_fp80 %0, x86_fp80 0xK4000C8F5C28F5C28F5C3, x86_fp80 %12, i32 %16, i32 %14)
ret i32 %17
}