#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(float);
scalar_t__ isnan_f(float);
scalar_t__ isnan_ld(float);
int isinf_f(float 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_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    114c <isinf_f+0x1c>
jmp    116d <isinf_f+0x3d>
movss  -0x4(%rbp),%xmm0
call   1050 <isnan_ld@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    11d2 <isinf_f+0xa2>
jmp    11b9 <isinf_f+0x89>
xor    %eax,%eax
test   $0x1,%al
jne    117c <isinf_f+0x4c>
jmp    119d <isinf_f+0x6d>
movss  -0x4(%rbp),%xmm0
call   1030 <isnan_d@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    11d2 <isinf_f+0xa2>
jmp    11b9 <isinf_f+0x89>
movss  -0x4(%rbp),%xmm0
call   1040 <isnan_f@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    11d2 <isinf_f+0xa2>
movss  -0x4(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
call   1040 <isnan_f@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isinf_f>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <isnan_f@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1128 <isinf_f+0x18>
pop    %rcx
ret
movss  0x4(%rsp),%xmm0
subss  %xmm0,%xmm0
call   1030 <isnan_f@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isinf_f(float %0) {
%2 = alloca float
store float %0, float* %2
br i1 false, label %3, label %7
3: ; preds = %1
%4 = load float, float* %2
%5 = call i64 @isnan_ld(float %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 float, float* %2
%10 = call i64 @isnan_d(float %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %22, label %16
12: ; preds = %7
%13 = load float, float* %2
%14 = call i64 @isnan_f(float %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %22, label %16
16: ; preds = %12, %8, %3
%17 = load float, float* %2
%18 = load float, float* %2
%19 = fsub float %17, %18
%20 = call i64 @isnan_f(float %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_f(float %0) {
%2 = tail call i64 @isnan_f(float %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = fsub float %0, %0
%6 = tail call i64 @isnan_f(float %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
}