#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 */
long double LDBL_EPSILON;
scalar_t__ NAN;
int /*<<< orphan*/ check(char *, int);
void ldouble_test_value(void) {
  volatile long double Inf_var, NaN_var, zero_var, one_var;
  long double x1, x2;
  zero_var = 0.0;
  one_var = 1.0;
  NaN_var = zero_var / zero_var;
  Inf_var = one_var / zero_var;
  (void)&zero_var;
  (void)&one_var;
  (void)&NaN_var;
  (void)&Inf_var;
  check("long double"
        " inf == inf",
        Inf_var == Inf_var);
  check("long double"
        " -inf == -inf",
        -Inf_var == -Inf_var);
  check("long double"
        " inf != -inf",
        Inf_var != -Inf_var);
  check("long double"
        " NaN != NaN",
        NaN_var != NaN_var);
  check("long double"
        " NAN != NAN",
        NAN != NAN);
  x1 = 1.0;
  x2 = x1 + LDBL_EPSILON;
  check("long double"
        " 1 != 1+EPSILON",
        x1 != x2);
  x1 = 1.0;
  x2 = x1 - LDBL_EPSILON;
  check("long double"
        " 1 != 1-EPSILON",
        x1 != x2);
}


x86 assembly (clang, -O0):
<ldouble_test_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
fldz
fstpt  -0x30(%rbp)
fld1
fld    %st(0)
fstpt  -0x74(%rbp)
fstpt  -0x40(%rbp)
fldt   -0x30(%rbp)
fldt   -0x30(%rbp)
fdivrp %st,%st(1)
fstpt  -0x20(%rbp)
fldt   -0x40(%rbp)
fldt   -0x30(%rbp)
fdivrp %st,%st(1)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fldt   -0x10(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setnp  %cl
sete   %al
and    %cl,%al
movzbl %al,%esi
lea    0xea2(%rip),%rdi
call   1030 <check@plt>
fldt   -0x10(%rbp)
fchs
fldt   -0x10(%rbp)
fchs
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setnp  %cl
sete   %al
and    %cl,%al
movzbl %al,%esi
lea    0xe92(%rip),%rdi
call   1030 <check@plt>
fldt   -0x10(%rbp)
fldt   -0x10(%rbp)
fchs
fucomip %st(1),%st
fstp   %st(0)
setp   %cl
setne  %al
or     %cl,%al
movzbl %al,%esi
lea    0xe88(%rip),%rdi
call   1030 <check@plt>
fldt   -0x20(%rbp)
fldt   -0x20(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setp   %cl
setne  %al
or     %cl,%al
movzbl %al,%esi
lea    0xe7d(%rip),%rdi
call   1030 <check@plt>
lea    0xe88(%rip),%rdi
xor    %esi,%esi
call   1030 <check@plt>
fldt   -0x74(%rbp)
fstpt  -0x50(%rbp)
fldt   -0x50(%rbp)
mov    0x2dea(%rip),%rax
mov    %rax,-0x68(%rbp)
fldt   (%rax)
faddp  %st,%st(1)
fstpt  -0x60(%rbp)
fldt   -0x50(%rbp)
fldt   -0x60(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setp   %cl
setne  %al
or     %cl,%al
movzbl %al,%esi
lea    0xe5f(%rip),%rdi
call   1030 <check@plt>
fldt   -0x74(%rbp)
mov    -0x68(%rbp),%rax
fstpt  -0x50(%rbp)
fldt   -0x50(%rbp)
fldt   (%rax)
fsubrp %st,%st(1)
fstpt  -0x60(%rbp)
fldt   -0x50(%rbp)
fldt   -0x60(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setp   %cl
setne  %al
or     %cl,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xe41(%rip),%rdi
call   1030 <check@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldouble_test_value>:
push   %rbx
sub    $0x50,%rsp
fldz
fstpt  0x20(%rsp)
fld1
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  0x40(%rsp)
fldt   0x20(%rsp)
fldt   0x20(%rsp)
fdivrp %st,%st(1)
fstpt  0x30(%rsp)
fldt   0x40(%rsp)
fldt   0x20(%rsp)
fdivrp %st,%st(1)
fstpt  (%rsp)
fldt   (%rsp)
fldt   (%rsp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setnp  %al
sete   %cl
and    %al,%cl
movzbl %cl,%esi
lea    0xea0(%rip),%rdi
call   1030 <check@plt>
fldt   (%rsp)
fldt   (%rsp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setnp  %al
sete   %cl
and    %al,%cl
movzbl %cl,%esi
lea    0xe94(%rip),%rdi
call   1030 <check@plt>
fldt   (%rsp)
fldt   (%rsp)
fchs
fucomip %st(1),%st
fstp   %st(0)
setp   %al
setne  %cl
or     %al,%cl
movzbl %cl,%esi
lea    0xe8a(%rip),%rdi
call   1030 <check@plt>
fldt   0x30(%rsp)
fldt   0x30(%rsp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setp   %al
setne  %cl
or     %al,%cl
movzbl %cl,%esi
lea    0xe7d(%rip),%rdi
call   1030 <check@plt>
lea    0xe88(%rip),%rdi
xor    %esi,%esi
call   1030 <check@plt>
mov    0x2df3(%rip),%rbx
fldt   (%rbx)
fldt   0x14(%rsp)
fadd   %st,%st(1)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setp   %al
setne  %cl
or     %al,%cl
movzbl %cl,%esi
lea    0xe71(%rip),%rdi
call   1030 <check@plt>
fldt   (%rbx)
fldt   0x14(%rsp)
fsub   %st,%st(1)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setp   %al
setne  %cl
or     %al,%cl
movzbl %cl,%esi
lea    0xe67(%rip),%rdi
add    $0x50,%rsp
pop    %rbx
jmp    1030 <check@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"long double inf == inf\00"
@.str.1 = [25 x i8] c"long double -inf == -inf\00"
@.str.2 = [24 x i8] c"long double inf != -inf\00"
@.str.3 = [23 x i8] c"long double NaN != NaN\00"
@.str.4 = [23 x i8] c"long double NAN != NAN\00"
@NAN = global i64 0
@LDBL_EPSILON = global x86_fp80 0xK00000000000000000000
@.str.5 = [27 x i8] c"long double 1 != 1+EPSILON\00"
@.str.6 = [27 x i8] c"long double 1 != 1-EPSILON\00"
define void @ldouble_test_value() {
%1 = alloca x86_fp80
%2 = alloca x86_fp80
%3 = alloca x86_fp80
%4 = alloca x86_fp80
%5 = alloca x86_fp80
%6 = alloca x86_fp80
store volatile x86_fp80 0xK00000000000000000000, x86_fp80* %3
store volatile x86_fp80 0xK3FFF8000000000000000, x86_fp80* %4
%7 = load volatile x86_fp80, x86_fp80* %3
%8 = load volatile x86_fp80, x86_fp80* %3
%9 = fdiv x86_fp80 %7, %8
store volatile x86_fp80 %9, x86_fp80* %2
%10 = load volatile x86_fp80, x86_fp80* %4
%11 = load volatile x86_fp80, x86_fp80* %3
%12 = fdiv x86_fp80 %10, %11
store volatile x86_fp80 %12, x86_fp80* %1
%13 = load volatile x86_fp80, x86_fp80* %1
%14 = load volatile x86_fp80, x86_fp80* %1
%15 = fcmp oeq x86_fp80 %13, %14
%16 = zext i1 %15 to i32
%17 = call i32 @check(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = load volatile x86_fp80, x86_fp80* %1
%19 = fneg x86_fp80 %18
%20 = load volatile x86_fp80, x86_fp80* %1
%21 = fneg x86_fp80 %20
%22 = fcmp oeq x86_fp80 %19, %21
%23 = zext i1 %22 to i32
%24 = call i32 @check(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %23)
%25 = load volatile x86_fp80, x86_fp80* %1
%26 = load volatile x86_fp80, x86_fp80* %1
%27 = fneg x86_fp80 %26
%28 = fcmp une x86_fp80 %25, %27
%29 = zext i1 %28 to i32
%30 = call i32 @check(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %29)
%31 = load volatile x86_fp80, x86_fp80* %2
%32 = load volatile x86_fp80, x86_fp80* %2
%33 = fcmp une x86_fp80 %31, %32
%34 = zext i1 %33 to i32
%35 = call i32 @check(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %34)
%36 = load i64, i64* @NAN
%37 = load i64, i64* @NAN
%38 = icmp ne i64 %36, %37
%39 = zext i1 %38 to i32
%40 = call i32 @check(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 %39)
store x86_fp80 0xK3FFF8000000000000000, x86_fp80* %5
%41 = load x86_fp80, x86_fp80* %5
%42 = load x86_fp80, x86_fp80* @LDBL_EPSILON
%43 = fadd x86_fp80 %41, %42
store x86_fp80 %43, x86_fp80* %6
%44 = load x86_fp80, x86_fp80* %5
%45 = load x86_fp80, x86_fp80* %6
%46 = fcmp une x86_fp80 %44, %45
%47 = zext i1 %46 to i32
%48 = call i32 @check(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i32 %47)
store x86_fp80 0xK3FFF8000000000000000, x86_fp80* %5
%49 = load x86_fp80, x86_fp80* %5
%50 = load x86_fp80, x86_fp80* @LDBL_EPSILON
%51 = fsub x86_fp80 %49, %50
store x86_fp80 %51, x86_fp80* %6
%52 = load x86_fp80, x86_fp80* %5
%53 = load x86_fp80, x86_fp80* %6
%54 = fcmp une x86_fp80 %52, %53
%55 = zext i1 %54 to i32
%56 = call i32 @check(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0), i32 %55)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"long double inf == inf\00"
@.str.1 = [25 x i8] c"long double -inf == -inf\00"
@.str.2 = [24 x i8] c"long double inf != -inf\00"
@.str.3 = [23 x i8] c"long double NaN != NaN\00"
@.str.4 = [23 x i8] c"long double NAN != NAN\00"
@NAN = global i64 0
@LDBL_EPSILON = global x86_fp80 0xK00000000000000000000
@.str.5 = [27 x i8] c"long double 1 != 1+EPSILON\00"
@.str.6 = [27 x i8] c"long double 1 != 1-EPSILON\00"
define void @ldouble_test_value() {
%1 = alloca x86_fp80
%2 = alloca x86_fp80
%3 = alloca x86_fp80
%4 = alloca x86_fp80
%5 = bitcast x86_fp80* %1 to i8*
%6 = bitcast x86_fp80* %2 to i8*
%7 = bitcast x86_fp80* %3 to i8*
%8 = bitcast x86_fp80* %4 to i8*
store volatile x86_fp80 0xK00000000000000000000, x86_fp80* %3
store volatile x86_fp80 0xK3FFF8000000000000000, x86_fp80* %4
%9 = load volatile x86_fp80, x86_fp80* %3
%10 = load volatile x86_fp80, x86_fp80* %3
%11 = fdiv x86_fp80 %9, %10
store volatile x86_fp80 %11, x86_fp80* %2
%12 = load volatile x86_fp80, x86_fp80* %4
%13 = load volatile x86_fp80, x86_fp80* %3
%14 = fdiv x86_fp80 %12, %13
store volatile x86_fp80 %14, x86_fp80* %1
%15 = load volatile x86_fp80, x86_fp80* %1
%16 = load volatile x86_fp80, x86_fp80* %1
%17 = fcmp oeq x86_fp80 %15, %16
%18 = zext i1 %17 to i32
%19 = tail call i32 @check(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %18)
%20 = load volatile x86_fp80, x86_fp80* %1
%21 = load volatile x86_fp80, x86_fp80* %1
%22 = fcmp oeq x86_fp80 %20, %21
%23 = zext i1 %22 to i32
%24 = tail call i32 @check(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %23)
%25 = load volatile x86_fp80, x86_fp80* %1
%26 = load volatile x86_fp80, x86_fp80* %1
%27 = fneg x86_fp80 %26
%28 = fcmp une x86_fp80 %25, %27
%29 = zext i1 %28 to i32
%30 = tail call i32 @check(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %29)
%31 = load volatile x86_fp80, x86_fp80* %2
%32 = load volatile x86_fp80, x86_fp80* %2
%33 = fcmp une x86_fp80 %31, %32
%34 = zext i1 %33 to i32
%35 = tail call i32 @check(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %34)
%36 = tail call i32 @check(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 0)
%37 = load x86_fp80, x86_fp80* @LDBL_EPSILON
%38 = fadd x86_fp80 %37, 0xK3FFF8000000000000000
%39 = fcmp une x86_fp80 %38, 0xK3FFF8000000000000000
%40 = zext i1 %39 to i32
%41 = tail call i32 @check(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i32 %40)
%42 = load x86_fp80, x86_fp80* @LDBL_EPSILON
%43 = fsub x86_fp80 0xK3FFF8000000000000000, %42
%44 = fcmp une x86_fp80 %43, 0xK3FFF8000000000000000
%45 = zext i1 %44 to i32
%46 = tail call i32 @check(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0), i32 %45)
ret void
}