#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 */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
scalar_t__ isnan_d(long double);
scalar_t__ isnan_f(long double);
scalar_t__ isnan_ld(long double);
int isinf_ld(long double x) {
  return !(sizeof(x) == sizeof(long double) ? isnan_ld(x)
           : sizeof(x) == sizeof(double)    ? isnan_d(x)
                                            : isnan_f(x)) &&
         (sizeof(x - x) == sizeof(long double) ? isnan_ld(x - x)
          : sizeof(x - x) == sizeof(double)    ? isnan_d(x - x)
                                               : isnan_f(x - x));
}


x86 assembly (clang, -O0):
<isinf_ld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    114d <isinf_ld+0x1d>
jmp    1171 <isinf_ld+0x41>
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1050 <isnan_ld@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    11de <isinf_ld+0xae>
jmp    11c3 <isinf_ld+0x93>
xor    %eax,%eax
test   $0x1,%al
jne    1180 <isinf_ld+0x50>
jmp    11a4 <isinf_ld+0x74>
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <isnan_d@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    11de <isinf_ld+0xae>
jmp    11c3 <isinf_ld+0x93>
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <isnan_f@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    11de <isinf_ld+0xae>
fldt   -0x10(%rbp)
fld    %st(0)
fsubp  %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1050 <isnan_ld@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isinf_ld>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x1c(%rsp)
fstpt  (%rsp)
call   1030 <isnan_ld@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <isinf_ld+0x25>
add    $0x28,%rsp
ret
fldt   0x1c(%rsp)
fsub   %st,%st(0)
fstpt  (%rsp)
call   1030 <isnan_ld@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @isinf_ld(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
br i1 true, label %3, label %7
3: ; preds = %1
%4 = load x86_fp80, x86_fp80* %2
%5 = call i64 @isnan_ld(x86_fp80 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %22, label %16
7: ; preds = %1
br i1 false, label %8, label %12
8: ; preds = %7
%9 = load x86_fp80, x86_fp80* %2
%10 = call i64 @isnan_d(x86_fp80 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %22, label %16
12: ; preds = %7
%13 = load x86_fp80, x86_fp80* %2
%14 = call i64 @isnan_f(x86_fp80 %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %22, label %16
16: ; preds = %12, %8, %3
%17 = load x86_fp80, x86_fp80* %2
%18 = load x86_fp80, x86_fp80* %2
%19 = fsub x86_fp80 %17, %18
%20 = call i64 @isnan_ld(x86_fp80 %19)
%21 = icmp ne i64 %20, 0
br label %22
22: ; preds = %16, %12, %8, %3
%23 = phi i1 [ false, %12 ], [ false, %8 ], [ false, %3 ], [ %21, %16 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @isinf_ld(x86_fp80 %0) {
%2 = tail call i64 @isnan_ld(x86_fp80 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = fsub x86_fp80 %0, %0
%6 = tail call i64 @isnan_ld(x86_fp80 %5)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %10
}