#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 uint32_t;

/* Variables and functions */
int FP_INFINITE;
int FP_NAN;
int FP_NORMAL;
int FP_SUBNORMAL;
int FP_ZERO;
int __fpclassifyf(float x) {
  union {
    float f;
    uint32_t i;
  } u = {x};
  int e = u.i >> 23 & 0xff;
  if (!e)
    return u.i << 1 ? FP_SUBNORMAL : FP_ZERO;
  if (e == 0xff)
    return u.i << 9 ? FP_NAN : FP_INFINITE;
  return FP_NORMAL;
}


x86 assembly (clang, -O0):
<__fpclassifyf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sar    $0x17,%eax
and    $0xff,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1162 <__fpclassifyf+0x62>
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
cmp    $0x0,%eax
je     114b <__fpclassifyf+0x4b>
mov    0x2e7f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
jmp    1157 <__fpclassifyf+0x57>
mov    0x2e7e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11b2 <__fpclassifyf+0xb2>
cmpl   $0xff,-0x14(%rbp)
jne    11a6 <__fpclassifyf+0xa6>
mov    -0x10(%rbp),%eax
shl    $0x9,%eax
cmp    $0x0,%eax
je     118f <__fpclassifyf+0x8f>
mov    0x2e5b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
jmp    119b <__fpclassifyf+0x9b>
mov    0x2e42(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11b2 <__fpclassifyf+0xb2>
mov    0x2e43(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fpclassifyf>:
movd   %xmm0,%eax
mov    %eax,%ecx
shr    $0x17,%ecx
cmp    $0xff,%cl
je     1123 <__fpclassifyf+0x23>
test   %cl,%cl
jne    1134 <__fpclassifyf+0x34>
test   $0x7fffffff,%eax
jne    113e <__fpclassifyf+0x3e>
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
ret
test   $0x7fffff,%eax
jne    1148 <__fpclassifyf+0x48>
mov    0x2ea7(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2eb5(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2e7b(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2e91(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%union.anon = type { float }
@FP_SUBNORMAL = global i32 0
@FP_ZERO = global i32 0
@FP_NAN = global i32 0
@FP_INFINITE = global i32 0
@FP_NORMAL = global i32 0
define i32 @__fpclassifyf(float %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca %union.anon
%5 = alloca i32
store float %0, float* %3
%6 = bitcast %union.anon* %4 to float*
%7 = load float, float* %3
store float %7, float* %6
%8 = bitcast %union.anon* %4 to i32*
%9 = load i32, i32* %8
%10 = ashr i32 %9, 23
%11 = and i32 %10, 255
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = icmp ne i32 %12, 0
br i1 %13, label %25, label %14
14: ; preds = %1
%15 = bitcast %union.anon* %4 to i32*
%16 = load i32, i32* %15
%17 = shl i32 %16, 1
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = load i32, i32* @FP_SUBNORMAL
br label %23
21: ; preds = %14
%22 = load i32, i32* @FP_ZERO
br label %23
23: ; preds = %21, %19
%24 = phi i32 [ %20, %19 ], [ %22, %21 ]
store i32 %24, i32* %2
br label %41
25: ; preds = %1
%26 = load i32, i32* %5
%27 = icmp eq i32 %26, 255
br i1 %27, label %28, label %39
28: ; preds = %25
%29 = bitcast %union.anon* %4 to i32*
%30 = load i32, i32* %29
%31 = shl i32 %30, 9
%32 = icmp ne i32 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %28
%34 = load i32, i32* @FP_NAN
br label %37
35: ; preds = %28
%36 = load i32, i32* @FP_INFINITE
br label %37
37: ; preds = %35, %33
%38 = phi i32 [ %34, %33 ], [ %36, %35 ]
store i32 %38, i32* %2
br label %41
39: ; preds = %25
%40 = load i32, i32* @FP_NORMAL
store i32 %40, i32* %2
br label %41
41: ; preds = %39, %37, %23
%42 = load i32, i32* %2
ret i32 %42
}

LLVM IR (-O2):
@FP_SUBNORMAL = global i32 0
@FP_ZERO = global i32 0
@FP_NAN = global i32 0
@FP_INFINITE = global i32 0
@FP_NORMAL = global i32 0
define i32 @__fpclassifyf(float %0) {
%2 = bitcast float %0 to i32
%3 = lshr i32 %2, 23
%4 = trunc i32 %3 to i8
switch i8 %4, label %17 [
i8 0, label %5
i8 -1, label %11
]
5: ; preds = %1
%6 = and i32 %2, 2147483647
%7 = icmp eq i32 %6, 0
%8 = load i32, i32* @FP_SUBNORMAL
%9 = load i32, i32* @FP_ZERO
%10 = select i1 %7, i32 %9, i32 %8
br label %19
11: ; preds = %1
%12 = and i32 %2, 8388607
%13 = icmp eq i32 %12, 0
%14 = load i32, i32* @FP_NAN
%15 = load i32, i32* @FP_INFINITE
%16 = select i1 %13, i32 %15, i32 %14
br label %19
17: ; preds = %1
%18 = load i32, i32* @FP_NORMAL
br label %19
19: ; preds = %17, %11, %5
%20 = phi i32 [ %16, %11 ], [ %18, %17 ], [ %10, %5 ]
ret i32 %20
}