#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 */
int FP_INFINITE;
int FP_NAN;
int FP_NORMAL;
int FP_SUBNORMAL;
int FP_ZERO;
scalar_t__ __ESBMC_isinf(float);
scalar_t__ __ESBMC_isnan(float);
scalar_t__ __ESBMC_isnormal(float);
int __fpclassifyf(float f) {
  if (__ESBMC_isnan(f))
    return FP_NAN;
  if (__ESBMC_isinf(f))
    return FP_INFINITE;
  if (f == 0)
    return FP_ZERO;
  if (__ESBMC_isnormal(f))
    return FP_NORMAL;
  return FP_SUBNORMAL;
}


x86 assembly (clang, -O0):
<__fpclassifyf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1050 <__ESBMC_isnan@plt>
cmp    $0x0,%rax
je     1162 <__fpclassifyf+0x32>
mov    0x2e88(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11e0 <__fpclassifyf+0xb0>
movss  -0x8(%rbp),%xmm0
call   1030 <__ESBMC_isinf@plt>
cmp    $0x0,%rax
je     1187 <__fpclassifyf+0x57>
mov    0x2e5b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11e0 <__fpclassifyf+0xb0>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    11af <__fpclassifyf+0x7f>
jp     11af <__fpclassifyf+0x7f>
mov    0x2e2b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11e0 <__fpclassifyf+0xb0>
movss  -0x8(%rbp),%xmm0
call   1040 <__ESBMC_isnormal@plt>
cmp    $0x0,%rax
je     11d4 <__fpclassifyf+0xa4>
mov    0x2e26(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11e0 <__fpclassifyf+0xb0>
mov    0x2de5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fpclassifyf>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1050 <__ESBMC_isnan@plt>
test   %rax,%rax
je     114a <__fpclassifyf+0x1a>
mov    0x2e98(%rip),%rax
jmp    119c <__fpclassifyf+0x6c>
movss  0x4(%rsp),%xmm0
call   1030 <__ESBMC_isinf@plt>
test   %rax,%rax
je     1163 <__fpclassifyf+0x33>
mov    0x2e77(%rip),%rax
jmp    119c <__fpclassifyf+0x6c>
xorps  %xmm0,%xmm0
movss  0x4(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jne    117c <__fpclassifyf+0x4c>
jp     117c <__fpclassifyf+0x4c>
mov    0x2e56(%rip),%rax
jmp    119c <__fpclassifyf+0x6c>
movss  0x4(%rsp),%xmm0
call   1040 <__ESBMC_isnormal@plt>
test   %rax,%rax
jne    1195 <__fpclassifyf+0x65>
mov    0x2e2d(%rip),%rax
jmp    119c <__fpclassifyf+0x6c>
mov    0x2e54(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@FP_NAN = global i32 0
@FP_INFINITE = global i32 0
@FP_ZERO = global i32 0
@FP_NORMAL = global i32 0
@FP_SUBNORMAL = global i32 0
define i32 @__fpclassifyf(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = call i64 @__ESBMC_isnan(float %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* @FP_NAN
store i32 %8, i32* %2
br label %28
9: ; preds = %1
%10 = load float, float* %3
%11 = call i64 @__ESBMC_isinf(float %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = load i32, i32* @FP_INFINITE
store i32 %14, i32* %2
br label %28
15: ; preds = %9
%16 = load float, float* %3
%17 = fcmp oeq float %16, 0.000000e+00
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = load i32, i32* @FP_ZERO
store i32 %19, i32* %2
br label %28
20: ; preds = %15
%21 = load float, float* %3
%22 = call i64 @__ESBMC_isnormal(float %21)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = load i32, i32* @FP_NORMAL
store i32 %25, i32* %2
br label %28
26: ; preds = %20
%27 = load i32, i32* @FP_SUBNORMAL
store i32 %27, i32* %2
br label %28
28: ; preds = %26, %24, %18, %13, %7
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
@FP_NAN = global i32 0
@FP_INFINITE = global i32 0
@FP_ZERO = global i32 0
@FP_NORMAL = global i32 0
@FP_SUBNORMAL = global i32 0
define i32 @__fpclassifyf(float %0) {
%2 = tail call i64 @__ESBMC_isnan(float %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = tail call i64 @__ESBMC_isinf(float %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = fcmp oeq float %0, 0.000000e+00
br i1 %8, label %13, label %9
9: ; preds = %7
%10 = tail call i64 @__ESBMC_isnormal(float %0)
%11 = icmp eq i64 %10, 0
%12 = select i1 %11, i32* @FP_SUBNORMAL, i32* @FP_NORMAL
br label %13
13: ; preds = %9, %7, %4, %1
%14 = phi i32* [ @FP_NAN, %1 ], [ @FP_INFINITE, %4 ], [ @FP_ZERO, %7 ], [ %12, %9 ]
%15 = load i32, i32* %14
ret i32 %15
}