#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 */
float FLT_MIN;
scalar_t__ isinf(float);
scalar_t__ isnan(float);
scalar_t__ isnormal(float);
scalar_t__ signbit(float);
uint32_t __hsail_class_f32(float a, uint32_t flags) {
  return (flags & 0x0001 && isnan(a) && !(*(uint32_t *)&a & 0x40000000)) ||
         (flags & 0x0002 && isnan(a) && (*(uint32_t *)&a & 0x40000000)) ||
         (flags & 0x0004 && isinf(a) && a < 0.0f) ||
         (flags & 0x0008 && isnormal(a) && signbit(a)) ||
         (flags & 0x0010 && a < 0.0f && a > -FLT_MIN) ||
         (flags & 0x0020 && a == 0.0f && signbit(a)) ||
         (flags & 0x0040 && a == 0.0f && !signbit(a)) ||
         (flags & 0x0080 && a > 0.0f && a < FLT_MIN) ||
         (flags & 0x0100 && isnormal(a) && !signbit(a)) ||
         (flags & 0x0200 && isinf(a) && a >= 0.0f);
}


x86 assembly (clang, -O0):
<__hsail_class_f32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     118a <__hsail_class_f32+0x4a>
movss  -0x4(%rbp),%xmm0
call   1040 <isnan@plt>
cmp    $0x0,%rax
je     118a <__hsail_class_f32+0x4a>
mov    -0x4(%rbp),%ecx
and    $0x40000000,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     13ce <__hsail_class_f32+0x28e>
mov    -0x8(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     11c4 <__hsail_class_f32+0x84>
movss  -0x4(%rbp),%xmm0
call   1040 <isnan@plt>
cmp    $0x0,%rax
je     11c4 <__hsail_class_f32+0x84>
mov    -0x4(%rbp),%ecx
and    $0x40000000,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    13ce <__hsail_class_f32+0x28e>
mov    -0x8(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     11f9 <__hsail_class_f32+0xb9>
movss  -0x4(%rbp),%xmm0
call   1060 <isinf@plt>
cmp    $0x0,%rax
je     11f9 <__hsail_class_f32+0xb9>
mov    $0x1,%al
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
mov    %al,-0x9(%rbp)
ja     13ce <__hsail_class_f32+0x28e>
mov    -0x8(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1238 <__hsail_class_f32+0xf8>
movss  -0x4(%rbp),%xmm0
call   1030 <isnormal@plt>
cmp    $0x0,%rax
je     1238 <__hsail_class_f32+0xf8>
movss  -0x4(%rbp),%xmm0
call   1050 <signbit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    13ce <__hsail_class_f32+0x28e>
mov    -0x8(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     127f <__hsail_class_f32+0x13f>
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    127f <__hsail_class_f32+0x13f>
movss  -0x4(%rbp),%xmm0
mov    0x2d88(%rip),%rax
movss  (%rax),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mov    $0x1,%al
ucomiss %xmm1,%xmm0
mov    %al,-0x9(%rbp)
ja     13ce <__hsail_class_f32+0x28e>
mov    -0x8(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     12c1 <__hsail_class_f32+0x181>
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    12c1 <__hsail_class_f32+0x181>
jp     12c1 <__hsail_class_f32+0x181>
movss  -0x4(%rbp),%xmm0
call   1050 <signbit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    13ce <__hsail_class_f32+0x28e>
mov    -0x8(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
je     1303 <__hsail_class_f32+0x1c3>
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1303 <__hsail_class_f32+0x1c3>
jp     1303 <__hsail_class_f32+0x1c3>
movss  -0x4(%rbp),%xmm0
call   1050 <signbit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     13ce <__hsail_class_f32+0x28e>
mov    -0x8(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1343 <__hsail_class_f32+0x203>
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1343 <__hsail_class_f32+0x203>
movss  -0x4(%rbp),%xmm1
mov    0x2cb7(%rip),%rax
movss  (%rax),%xmm0
mov    $0x1,%al
ucomiss %xmm1,%xmm0
mov    %al,-0x9(%rbp)
ja     13ce <__hsail_class_f32+0x28e>
mov    -0x8(%rbp),%eax
and    $0x100,%eax
cmp    $0x0,%eax
je     1384 <__hsail_class_f32+0x244>
movss  -0x4(%rbp),%xmm0
call   1030 <isnormal@plt>
cmp    $0x0,%rax
je     1384 <__hsail_class_f32+0x244>
movss  -0x4(%rbp),%xmm0
call   1050 <signbit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     13ce <__hsail_class_f32+0x28e>
mov    -0x8(%rbp),%ecx
and    $0x200,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xa(%rbp)
je     13c8 <__hsail_class_f32+0x288>
movss  -0x4(%rbp),%xmm0
call   1060 <isinf@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0xa(%rbp)
je     13c8 <__hsail_class_f32+0x288>
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
setae  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hsail_class_f32>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
test   $0x1,%bl
movd   %xmm0,0x4(%rsp)
je     1174 <__hsail_class_f32+0x34>
call   1040 <isnan@plt>
movd   0x4(%rsp),%xmm0
test   %rax,%rax
je     1174 <__hsail_class_f32+0x34>
movd   %xmm0,%eax
mov    $0x1,%ebp
test   $0x40000000,%eax
je     12e3 <__hsail_class_f32+0x1a3>
test   $0x2,%bl
je     119d <__hsail_class_f32+0x5d>
call   1040 <isnan@plt>
movd   0x4(%rsp),%xmm0
test   %rax,%rax
je     119d <__hsail_class_f32+0x5d>
movd   %xmm0,%eax
mov    $0x1,%ebp
test   $0x40000000,%eax
jne    12e3 <__hsail_class_f32+0x1a3>
test   $0x4,%bl
je     11c3 <__hsail_class_f32+0x83>
call   1060 <isinf@plt>
movss  0x4(%rsp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jbe    11c3 <__hsail_class_f32+0x83>
mov    $0x1,%ebp
test   %rax,%rax
jne    12e3 <__hsail_class_f32+0x1a3>
test   $0x8,%bl
je     11f1 <__hsail_class_f32+0xb1>
call   1030 <isnormal@plt>
movd   0x4(%rsp),%xmm0
test   %rax,%rax
je     11f1 <__hsail_class_f32+0xb1>
call   1050 <signbit@plt>
movd   0x4(%rsp),%xmm0
mov    $0x1,%ebp
test   %rax,%rax
jne    12e3 <__hsail_class_f32+0x1a3>
xorps  %xmm2,%xmm2
ucomiss %xmm0,%xmm2
jbe    1220 <__hsail_class_f32+0xe0>
mov    %ebx,%eax
and    $0x10,%eax
je     1220 <__hsail_class_f32+0xe0>
mov    0x2de1(%rip),%rax
movss  (%rax),%xmm1
xorps  0xdee(%rip),%xmm1
mov    $0x1,%ebp
ucomiss %xmm1,%xmm0
ja     12e3 <__hsail_class_f32+0x1a3>
ucomiss %xmm2,%xmm0
jne    1247 <__hsail_class_f32+0x107>
jp     1247 <__hsail_class_f32+0x107>
mov    %ebx,%eax
and    $0x20,%eax
je     1247 <__hsail_class_f32+0x107>
call   1050 <signbit@plt>
movss  0x4(%rsp),%xmm0
mov    $0x1,%ebp
test   %rax,%rax
jne    12e3 <__hsail_class_f32+0x1a3>
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    126b <__hsail_class_f32+0x12b>
jp     126b <__hsail_class_f32+0x12b>
mov    %ebx,%eax
and    $0x40,%eax
je     126b <__hsail_class_f32+0x12b>
call   1050 <signbit@plt>
xorps  %xmm1,%xmm1
movss  0x4(%rsp),%xmm0
test   %rax,%rax
je     12de <__hsail_class_f32+0x19e>
ucomiss %xmm1,%xmm0
mov    $0x1,%ebp
jbe    128e <__hsail_class_f32+0x14e>
mov    %ebx,%eax
and    $0x80,%eax
je     128e <__hsail_class_f32+0x14e>
mov    0x2d63(%rip),%rax
movss  (%rax),%xmm1
ucomiss %xmm0,%xmm1
ja     12e3 <__hsail_class_f32+0x1a3>
test   $0x100,%ebx
je     12b6 <__hsail_class_f32+0x176>
call   1030 <isnormal@plt>
movss  0x4(%rsp),%xmm0
test   %rax,%rax
je     12b6 <__hsail_class_f32+0x176>
call   1050 <signbit@plt>
movss  0x4(%rsp),%xmm0
test   %rax,%rax
je     12e3 <__hsail_class_f32+0x1a3>
xor    %ebp,%ebp
test   $0x200,%ebx
je     12e3 <__hsail_class_f32+0x1a3>
call   1060 <isinf@plt>
movss  0x4(%rsp),%xmm1
test   %rax,%rax
je     12e3 <__hsail_class_f32+0x1a3>
xorps  %xmm0,%xmm0
xor    %ebp,%ebp
ucomiss %xmm0,%xmm1
setae  %bpl
jmp    12e3 <__hsail_class_f32+0x1a3>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@FLT_MIN = global float 0.000000e+00
define i32 @__hsail_class_f32(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 1
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %2
%9 = load float, float* %3
%10 = call i64 @isnan(float %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = bitcast float* %3 to i32*
%14 = load i32, i32* %13
%15 = and i32 %14, 1073741824
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %123
17: ; preds = %12, %8, %2
%18 = load i32, i32* %4
%19 = and i32 %18, 2
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %30
21: ; preds = %17
%22 = load float, float* %3
%23 = call i64 @isnan(float %22)
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %30
25: ; preds = %21
%26 = bitcast float* %3 to i32*
%27 = load i32, i32* %26
%28 = and i32 %27, 1073741824
%29 = icmp ne i32 %28, 0
br i1 %29, label %123, label %30
30: ; preds = %25, %21, %17
%31 = load i32, i32* %4
%32 = and i32 %31, 4
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %41
34: ; preds = %30
%35 = load float, float* %3
%36 = call i64 @isinf(float %35)
%37 = icmp ne i64 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %34
%39 = load float, float* %3
%40 = fcmp olt float %39, 0.000000e+00
br i1 %40, label %123, label %41
41: ; preds = %38, %34, %30
%42 = load i32, i32* %4
%43 = and i32 %42, 8
%44 = icmp ne i32 %43, 0
br i1 %44, label %45, label %53
45: ; preds = %41
%46 = load float, float* %3
%47 = call i64 @isnormal(float %46)
%48 = icmp ne i64 %47, 0
br i1 %48, label %49, label %53
49: ; preds = %45
%50 = load float, float* %3
%51 = call i64 @signbit(float %50)
%52 = icmp ne i64 %51, 0
br i1 %52, label %123, label %53
53: ; preds = %49, %45, %41
%54 = load i32, i32* %4
%55 = and i32 %54, 16
%56 = icmp ne i32 %55, 0
br i1 %56, label %57, label %65
57: ; preds = %53
%58 = load float, float* %3
%59 = fcmp olt float %58, 0.000000e+00
br i1 %59, label %60, label %65
60: ; preds = %57
%61 = load float, float* %3
%62 = load float, float* @FLT_MIN
%63 = fneg float %62
%64 = fcmp ogt float %61, %63
br i1 %64, label %123, label %65
65: ; preds = %60, %57, %53
%66 = load i32, i32* %4
%67 = and i32 %66, 32
%68 = icmp ne i32 %67, 0
br i1 %68, label %69, label %76
69: ; preds = %65
%70 = load float, float* %3
%71 = fcmp oeq float %70, 0.000000e+00
br i1 %71, label %72, label %76
72: ; preds = %69
%73 = load float, float* %3
%74 = call i64 @signbit(float %73)
%75 = icmp ne i64 %74, 0
br i1 %75, label %123, label %76
76: ; preds = %72, %69, %65
%77 = load i32, i32* %4
%78 = and i32 %77, 64
%79 = icmp ne i32 %78, 0
br i1 %79, label %80, label %87
80: ; preds = %76
%81 = load float, float* %3
%82 = fcmp oeq float %81, 0.000000e+00
br i1 %82, label %83, label %87
83: ; preds = %80
%84 = load float, float* %3
%85 = call i64 @signbit(float %84)
%86 = icmp ne i64 %85, 0
br i1 %86, label %87, label %123
87: ; preds = %83, %80, %76
%88 = load i32, i32* %4
%89 = and i32 %88, 128
%90 = icmp ne i32 %89, 0
br i1 %90, label %91, label %98
91: ; preds = %87
%92 = load float, float* %3
%93 = fcmp ogt float %92, 0.000000e+00
br i1 %93, label %94, label %98
94: ; preds = %91
%95 = load float, float* %3
%96 = load float, float* @FLT_MIN
%97 = fcmp olt float %95, %96
br i1 %97, label %123, label %98
98: ; preds = %94, %91, %87
%99 = load i32, i32* %4
%100 = and i32 %99, 256
%101 = icmp ne i32 %100, 0
br i1 %101, label %102, label %110
102: ; preds = %98
%103 = load float, float* %3
%104 = call i64 @isnormal(float %103)
%105 = icmp ne i64 %104, 0
br i1 %105, label %106, label %110
106: ; preds = %102
%107 = load float, float* %3
%108 = call i64 @signbit(float %107)
%109 = icmp ne i64 %108, 0
br i1 %109, label %110, label %123
110: ; preds = %106, %102, %98
%111 = load i32, i32* %4
%112 = and i32 %111, 512
%113 = icmp ne i32 %112, 0
br i1 %113, label %114, label %121
114: ; preds = %110
%115 = load float, float* %3
%116 = call i64 @isinf(float %115)
%117 = icmp ne i64 %116, 0
br i1 %117, label %118, label %121
118: ; preds = %114
%119 = load float, float* %3
%120 = fcmp oge float %119, 0.000000e+00
br label %121
121: ; preds = %118, %114, %110
%122 = phi i1 [ false, %114 ], [ false, %110 ], [ %120, %118 ]
br label %123
123: ; preds = %121, %106, %94, %83, %72, %60, %49, %38, %25, %12
%124 = phi i1 [ true, %106 ], [ true, %94 ], [ true, %83 ], [ true, %72 ], [ true, %60 ], [ true, %49 ], [ true, %38 ], [ true, %25 ], [ true, %12 ], [ %122, %121 ]
%125 = zext i1 %124 to i32
ret i32 %125
}

LLVM IR (-O2):
@FLT_MIN = global float 0.000000e+00
define i32 @__hsail_class_f32(float %0, i32 %1) {
%3 = and i32 %1, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = tail call i64 @isnan(float %0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %5
%9 = bitcast float %0 to i32
%10 = and i32 %9, 1073741824
%11 = icmp eq i32 %10, 0
br i1 %11, label %89, label %12
12: ; preds = %8, %5, %2
%13 = and i32 %1, 2
%14 = icmp eq i32 %13, 0
br i1 %14, label %22, label %15
15: ; preds = %12
%16 = tail call i64 @isnan(float %0)
%17 = icmp eq i64 %16, 0
br i1 %17, label %22, label %18
18: ; preds = %15
%19 = bitcast float %0 to i32
%20 = and i32 %19, 1073741824
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %89
22: ; preds = %18, %15, %12
%23 = and i32 %1, 4
%24 = icmp eq i32 %23, 0
br i1 %24, label %30, label %25
25: ; preds = %22
%26 = tail call i64 @isinf(float %0)
%27 = icmp ne i64 %26, 0
%28 = fcmp olt float %0, 0.000000e+00
%29 = and i1 %28, %27
br i1 %29, label %89, label %30
30: ; preds = %25, %22
%31 = and i32 %1, 8
%32 = icmp eq i32 %31, 0
br i1 %32, label %39, label %33
33: ; preds = %30
%34 = tail call i64 @isnormal(float %0)
%35 = icmp eq i64 %34, 0
br i1 %35, label %39, label %36
36: ; preds = %33
%37 = tail call i64 @signbit(float %0)
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %89
39: ; preds = %36, %33, %30
%40 = and i32 %1, 16
%41 = icmp ne i32 %40, 0
%42 = fcmp olt float %0, 0.000000e+00
%43 = and i1 %42, %41
br i1 %43, label %44, label %48
44: ; preds = %39
%45 = load float, float* @FLT_MIN
%46 = fneg float %45
%47 = fcmp olt float %46, %0
br i1 %47, label %89, label %48
48: ; preds = %44, %39
%49 = and i32 %1, 32
%50 = icmp ne i32 %49, 0
%51 = fcmp oeq float %0, 0.000000e+00
%52 = and i1 %51, %50
br i1 %52, label %53, label %56
53: ; preds = %48
%54 = tail call i64 @signbit(float %0)
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %89
56: ; preds = %53, %48
%57 = and i32 %1, 64
%58 = icmp ne i32 %57, 0
%59 = and i1 %51, %58
br i1 %59, label %60, label %63
60: ; preds = %56
%61 = tail call i64 @signbit(float %0)
%62 = icmp eq i64 %61, 0
br i1 %62, label %89, label %63
63: ; preds = %60, %56
%64 = and i32 %1, 128
%65 = icmp ne i32 %64, 0
%66 = fcmp ogt float %0, 0.000000e+00
%67 = and i1 %66, %65
%68 = load float, float* @FLT_MIN
%69 = fcmp ogt float %68, %0
%70 = select i1 %67, i1 %69, i1 false
br i1 %70, label %89, label %71
71: ; preds = %63
%72 = and i32 %1, 256
%73 = icmp eq i32 %72, 0
br i1 %73, label %80, label %74
74: ; preds = %71
%75 = tail call i64 @isnormal(float %0)
%76 = icmp eq i64 %75, 0
br i1 %76, label %80, label %77
77: ; preds = %74
%78 = tail call i64 @signbit(float %0)
%79 = icmp eq i64 %78, 0
br i1 %79, label %89, label %80
80: ; preds = %77, %74, %71
%81 = and i32 %1, 512
%82 = icmp eq i32 %81, 0
br i1 %82, label %89, label %83
83: ; preds = %80
%84 = tail call i64 @isinf(float %0)
%85 = icmp eq i64 %84, 0
br i1 %85, label %89, label %86
86: ; preds = %83
%87 = fcmp oge float %0, 0.000000e+00
%88 = zext i1 %87 to i32
br label %89
89: ; preds = %63, %80, %83, %86, %25, %77, %60, %53, %44, %36, %18, %8
%90 = phi i32 [ 1, %77 ], [ 1, %60 ], [ 1, %53 ], [ 1, %44 ], [ 1, %36 ], [ 1, %18 ], [ 1, %8 ], [ 1, %25 ], [ 0, %83 ], [ 0, %80 ], [ %88, %86 ], [ 1, %63 ]
ret i32 %90
}