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


x86 assembly (clang, -O0):
<float_test_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xed8(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
ucomiss %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xe90(%rip),%rdi
call   1030 <check@plt>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  -0x4(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
ucomiss %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xe61(%rip),%rdi
call   1030 <check@plt>
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
ucomiss %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xe41(%rip),%rdi
call   1030 <check@plt>
movss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
ucomiss %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xe2d(%rip),%rdi
call   1030 <check@plt>
mov    0x2ddf(%rip),%rax
mov    (%rax),%rax
mov    0x2dd5(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe16(%rip),%rdi
call   1030 <check@plt>
movss  0xdbe(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
mov    0x2d85(%rip),%rax
addss  (%rax),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
ucomiss -0x18(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xde3(%rip),%rdi
call   1030 <check@plt>
movss  0xd7a(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
mov    0x2d41(%rip),%rax
subss  (%rax),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
ucomiss -0x18(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xdb4(%rip),%rdi
call   1030 <check@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_test_value>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0x4(%rsp)
movl   $0x3f800000,0xc(%rsp)
3f
movss  0x4(%rsp),%xmm0
divss  0x4(%rsp),%xmm0
movss  %xmm0,0x8(%rsp)
movss  0xc(%rsp),%xmm0
divss  0x4(%rsp),%xmm0
movss  %xmm0,(%rsp)
movss  (%rsp),%xmm0
cmpeqss (%rsp),%xmm0
movd   %xmm0,%esi
and    $0x1,%esi
lea    0xeb3(%rip),%rdi
call   1030 <check@plt>
movss  (%rsp),%xmm0
cmpeqss (%rsp),%xmm0
movd   %xmm0,%esi
and    $0x1,%esi
lea    0xea6(%rip),%rdi
call   1030 <check@plt>
movss  (%rsp),%xmm0
movss  (%rsp),%xmm1
xorps  0xe6b(%rip),%xmm1
cmpneqss %xmm0,%xmm1
movd   %xmm1,%esi
and    $0x1,%esi
lea    0xe90(%rip),%rdi
call   1030 <check@plt>
movss  0x8(%rsp),%xmm0
cmpneqss 0x8(%rsp),%xmm0
movd   %xmm0,%esi
and    $0x1,%esi
lea    0xe82(%rip),%rdi
call   1030 <check@plt>
lea    0xe87(%rip),%rdi
xor    %esi,%esi
call   1030 <check@plt>
mov    0x2dfe(%rip),%rbx
movss  0xe26(%rip),%xmm1
movss  (%rbx),%xmm0
addss  %xmm1,%xmm0
cmpneqss %xmm1,%xmm0
movd   %xmm0,%esi
and    $0x1,%esi
lea    0xe67(%rip),%rdi
call   1030 <check@plt>
movss  0xdfe(%rip),%xmm1
movaps %xmm1,%xmm0
subss  (%rbx),%xmm0
cmpneqss %xmm1,%xmm0
movd   %xmm0,%esi
and    $0x1,%esi
lea    0xe55(%rip),%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <check@plt>

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

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