#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 */
double __builtin_inf();
int /*<<< orphan*/ abort();
void test(double f, double i) {
  if (f == __builtin_inf())
    abort();
  if (f == -__builtin_inf())
    abort();
  if (i == -__builtin_inf())
    abort();
  if (i != __builtin_inf())
    abort();
  if (f >= __builtin_inf())
    abort();
  if (f > __builtin_inf())
    abort();
  if (i > __builtin_inf())
    abort();
  if (f <= -__builtin_inf())
    abort();
  if (f < -__builtin_inf())
    abort();
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1146 <test+0x36>
jp     1146 <test+0x36>
mov    $0x0,%al
call   1030 <abort@plt>
movsd  -0x8(%rbp),%xmm0
movsd  0xeb5(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    116a <test+0x5a>
jp     116a <test+0x5a>
mov    $0x0,%al
call   1030 <abort@plt>
movsd  -0x10(%rbp),%xmm0
movsd  0xe91(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    118e <test+0x7e>
jp     118e <test+0x7e>
mov    $0x0,%al
call   1030 <abort@plt>
movsd  -0x10(%rbp),%xmm0
movsd  0xe65(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11b0 <test+0xa0>
jp     11b0 <test+0xa0>
jmp    11b7 <test+0xa7>
mov    $0x0,%al
call   1030 <abort@plt>
movsd  -0x8(%rbp),%xmm0
movsd  0xe3c(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11d5 <test+0xc5>
mov    $0x0,%al
call   1030 <abort@plt>
movsd  -0x8(%rbp),%xmm0
movsd  0xe1e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11f3 <test+0xe3>
mov    $0x0,%al
call   1030 <abort@plt>
movsd  -0x10(%rbp),%xmm0
movsd  0xe00(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1211 <test+0x101>
mov    $0x0,%al
call   1030 <abort@plt>
movsd  0xdef(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jb     122b <test+0x11b>
mov    $0x0,%al
call   1030 <abort@plt>
movsd  0xdd5(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1245 <test+0x135>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
ucomisd 0xee7(%rip),%xmm0
jae    114b <test+0x3b>
movsd  0xee5(%rip),%xmm2
ucomisd %xmm0,%xmm2
jae    114b <test+0x3b>
ucomisd %xmm1,%xmm2
jae    114b <test+0x3b>
ucomisd 0xec9(%rip),%xmm1
jb     114b <test+0x3b>
ucomisd 0xebf(%rip),%xmm0
jae    114b <test+0x3b>
ucomisd %xmm0,%xmm2
jae    114b <test+0x3b>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @test(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 = fcmp oeq double %5, 0x7FF0000000000000
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %2
%10 = load double, double* %3
%11 = fcmp oeq double %10, 0xFFF0000000000000
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %9
%15 = load double, double* %4
%16 = fcmp oeq double %15, 0xFFF0000000000000
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 (...) @abort()
unreachable
19: ; preds = %14
%20 = load double, double* %4
%21 = fcmp une double %20, 0x7FF0000000000000
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = call i32 (...) @abort()
unreachable
24: ; preds = %19
%25 = load double, double* %3
%26 = fcmp oge double %25, 0x7FF0000000000000
br i1 %26, label %27, label %29
27: ; preds = %24
%28 = call i32 (...) @abort()
unreachable
29: ; preds = %24
%30 = load double, double* %3
%31 = fcmp ogt double %30, 0x7FF0000000000000
br i1 %31, label %32, label %34
32: ; preds = %29
%33 = call i32 (...) @abort()
unreachable
34: ; preds = %29
%35 = load double, double* %4
%36 = fcmp ogt double %35, 0x7FF0000000000000
br i1 %36, label %37, label %39
37: ; preds = %34
%38 = call i32 (...) @abort()
unreachable
39: ; preds = %34
%40 = load double, double* %3
%41 = fcmp ole double %40, 0xFFF0000000000000
br i1 %41, label %42, label %44
42: ; preds = %39
%43 = call i32 (...) @abort()
unreachable
44: ; preds = %39
%45 = load double, double* %3
%46 = fcmp olt double %45, 0xFFF0000000000000
br i1 %46, label %47, label %49
47: ; preds = %44
%48 = call i32 (...) @abort()
unreachable
49: ; preds = %44
ret void
}

LLVM IR (-O2):
define void @test(double %0, double %1) {
%3 = fcmp oeq double %0, 0x7FF0000000000000
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %2
%7 = fcmp oeq double %0, 0xFFF0000000000000
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %6
%11 = fcmp oeq double %1, 0xFFF0000000000000
br i1 %11, label %12, label %14
12: ; preds = %10
%13 = tail call i32 (...) @abort()
unreachable
14: ; preds = %10
%15 = fcmp une double %1, 0x7FF0000000000000
br i1 %15, label %16, label %18
16: ; preds = %14
%17 = tail call i32 (...) @abort()
unreachable
18: ; preds = %14
%19 = fcmp ult double %0, 0x7FF0000000000000
br i1 %19, label %22, label %20
20: ; preds = %18
%21 = tail call i32 (...) @abort()
unreachable
22: ; preds = %18
%23 = fcmp ugt double %0, 0xFFF0000000000000
br i1 %23, label %26, label %24
24: ; preds = %22
%25 = tail call i32 (...) @abort()
unreachable
26: ; preds = %22
ret void
}