#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 & (1ul << 22))) ||
         (flags & 0x0002 && isnan(a) && (*(uint32_t *)&a & (1ul << 22))) ||
         (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     118d <__hsail_class_f32+0x4d>
movss  -0x4(%rbp),%xmm0
call   1040 <isnan@plt>
cmp    $0x0,%rax
je     118d <__hsail_class_f32+0x4d>
movslq -0x4(%rbp),%rcx
and    $0x400000,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     13d4 <__hsail_class_f32+0x294>
mov    -0x8(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     11ca <__hsail_class_f32+0x8a>
movss  -0x4(%rbp),%xmm0
call   1040 <isnan@plt>
cmp    $0x0,%rax
je     11ca <__hsail_class_f32+0x8a>
movslq -0x4(%rbp),%rcx
and    $0x400000,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    13d4 <__hsail_class_f32+0x294>
mov    -0x8(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     11ff <__hsail_class_f32+0xbf>
movss  -0x4(%rbp),%xmm0
call   1060 <isinf@plt>
cmp    $0x0,%rax
je     11ff <__hsail_class_f32+0xbf>
mov    $0x1,%al
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
mov    %al,-0x9(%rbp)
ja     13d4 <__hsail_class_f32+0x294>
mov    -0x8(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     123e <__hsail_class_f32+0xfe>
movss  -0x4(%rbp),%xmm0
call   1030 <isnormal@plt>
cmp    $0x0,%rax
je     123e <__hsail_class_f32+0xfe>
movss  -0x4(%rbp),%xmm0
call   1050 <signbit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    13d4 <__hsail_class_f32+0x294>
mov    -0x8(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     1285 <__hsail_class_f32+0x145>
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1285 <__hsail_class_f32+0x145>
movss  -0x4(%rbp),%xmm0
mov    0x2d82(%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     13d4 <__hsail_class_f32+0x294>
mov    -0x8(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     12c7 <__hsail_class_f32+0x187>
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    12c7 <__hsail_class_f32+0x187>
jp     12c7 <__hsail_class_f32+0x187>
movss  -0x4(%rbp),%xmm0
call   1050 <signbit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    13d4 <__hsail_class_f32+0x294>
mov    -0x8(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
je     1309 <__hsail_class_f32+0x1c9>
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1309 <__hsail_class_f32+0x1c9>
jp     1309 <__hsail_class_f32+0x1c9>
movss  -0x4(%rbp),%xmm0
call   1050 <signbit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     13d4 <__hsail_class_f32+0x294>
mov    -0x8(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1349 <__hsail_class_f32+0x209>
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1349 <__hsail_class_f32+0x209>
movss  -0x4(%rbp),%xmm1
mov    0x2cb1(%rip),%rax
movss  (%rax),%xmm0
mov    $0x1,%al
ucomiss %xmm1,%xmm0
mov    %al,-0x9(%rbp)
ja     13d4 <__hsail_class_f32+0x294>
mov    -0x8(%rbp),%eax
and    $0x100,%eax
cmp    $0x0,%eax
je     138a <__hsail_class_f32+0x24a>
movss  -0x4(%rbp),%xmm0
call   1030 <isnormal@plt>
cmp    $0x0,%rax
je     138a <__hsail_class_f32+0x24a>
movss  -0x4(%rbp),%xmm0
call   1050 <signbit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     13d4 <__hsail_class_f32+0x294>
mov    -0x8(%rbp),%ecx
and    $0x200,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xa(%rbp)
je     13ce <__hsail_class_f32+0x28e>
movss  -0x4(%rbp),%xmm0
call   1060 <isinf@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0xa(%rbp)
je     13ce <__hsail_class_f32+0x28e>
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   $0x400000,%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   $0x400000,%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 %18
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 %18
12: ; preds = %8
%13 = bitcast float* %3 to i32*
%14 = load i32, i32* %13
%15 = sext i32 %14 to i64
%16 = and i64 %15, 4194304
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %125
18: ; preds = %12, %8, %2
%19 = load i32, i32* %4
%20 = and i32 %19, 2
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %32
22: ; preds = %18
%23 = load float, float* %3
%24 = call i64 @isnan(float %23)
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %32
26: ; preds = %22
%27 = bitcast float* %3 to i32*
%28 = load i32, i32* %27
%29 = sext i32 %28 to i64
%30 = and i64 %29, 4194304
%31 = icmp ne i64 %30, 0
br i1 %31, label %125, label %32
32: ; preds = %26, %22, %18
%33 = load i32, i32* %4
%34 = and i32 %33, 4
%35 = icmp ne i32 %34, 0
br i1 %35, label %36, label %43
36: ; preds = %32
%37 = load float, float* %3
%38 = call i64 @isinf(float %37)
%39 = icmp ne i64 %38, 0
br i1 %39, label %40, label %43
40: ; preds = %36
%41 = load float, float* %3
%42 = fcmp olt float %41, 0.000000e+00
br i1 %42, label %125, label %43
43: ; preds = %40, %36, %32
%44 = load i32, i32* %4
%45 = and i32 %44, 8
%46 = icmp ne i32 %45, 0
br i1 %46, label %47, label %55
47: ; preds = %43
%48 = load float, float* %3
%49 = call i64 @isnormal(float %48)
%50 = icmp ne i64 %49, 0
br i1 %50, label %51, label %55
51: ; preds = %47
%52 = load float, float* %3
%53 = call i64 @signbit(float %52)
%54 = icmp ne i64 %53, 0
br i1 %54, label %125, label %55
55: ; preds = %51, %47, %43
%56 = load i32, i32* %4
%57 = and i32 %56, 16
%58 = icmp ne i32 %57, 0
br i1 %58, label %59, label %67
59: ; preds = %55
%60 = load float, float* %3
%61 = fcmp olt float %60, 0.000000e+00
br i1 %61, label %62, label %67
62: ; preds = %59
%63 = load float, float* %3
%64 = load float, float* @FLT_MIN
%65 = fneg float %64
%66 = fcmp ogt float %63, %65
br i1 %66, label %125, label %67
67: ; preds = %62, %59, %55
%68 = load i32, i32* %4
%69 = and i32 %68, 32
%70 = icmp ne i32 %69, 0
br i1 %70, label %71, label %78
71: ; preds = %67
%72 = load float, float* %3
%73 = fcmp oeq float %72, 0.000000e+00
br i1 %73, label %74, label %78
74: ; preds = %71
%75 = load float, float* %3
%76 = call i64 @signbit(float %75)
%77 = icmp ne i64 %76, 0
br i1 %77, label %125, label %78
78: ; preds = %74, %71, %67
%79 = load i32, i32* %4
%80 = and i32 %79, 64
%81 = icmp ne i32 %80, 0
br i1 %81, label %82, label %89
82: ; preds = %78
%83 = load float, float* %3
%84 = fcmp oeq float %83, 0.000000e+00
br i1 %84, label %85, label %89
85: ; preds = %82
%86 = load float, float* %3
%87 = call i64 @signbit(float %86)
%88 = icmp ne i64 %87, 0
br i1 %88, label %89, label %125
89: ; preds = %85, %82, %78
%90 = load i32, i32* %4
%91 = and i32 %90, 128
%92 = icmp ne i32 %91, 0
br i1 %92, label %93, label %100
93: ; preds = %89
%94 = load float, float* %3
%95 = fcmp ogt float %94, 0.000000e+00
br i1 %95, label %96, label %100
96: ; preds = %93
%97 = load float, float* %3
%98 = load float, float* @FLT_MIN
%99 = fcmp olt float %97, %98
br i1 %99, label %125, label %100
100: ; preds = %96, %93, %89
%101 = load i32, i32* %4
%102 = and i32 %101, 256
%103 = icmp ne i32 %102, 0
br i1 %103, label %104, label %112
104: ; preds = %100
%105 = load float, float* %3
%106 = call i64 @isnormal(float %105)
%107 = icmp ne i64 %106, 0
br i1 %107, label %108, label %112
108: ; preds = %104
%109 = load float, float* %3
%110 = call i64 @signbit(float %109)
%111 = icmp ne i64 %110, 0
br i1 %111, label %112, label %125
112: ; preds = %108, %104, %100
%113 = load i32, i32* %4
%114 = and i32 %113, 512
%115 = icmp ne i32 %114, 0
br i1 %115, label %116, label %123
116: ; preds = %112
%117 = load float, float* %3
%118 = call i64 @isinf(float %117)
%119 = icmp ne i64 %118, 0
br i1 %119, label %120, label %123
120: ; preds = %116
%121 = load float, float* %3
%122 = fcmp oge float %121, 0.000000e+00
br label %123
123: ; preds = %120, %116, %112
%124 = phi i1 [ false, %116 ], [ false, %112 ], [ %122, %120 ]
br label %125
125: ; preds = %123, %108, %96, %85, %74, %62, %51, %40, %26, %12
%126 = phi i1 [ true, %108 ], [ true, %96 ], [ true, %85 ], [ true, %74 ], [ true, %62 ], [ true, %51 ], [ true, %40 ], [ true, %26 ], [ true, %12 ], [ %124, %123 ]
%127 = zext i1 %126 to i32
ret i32 %127
}

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, 4194304
%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, 4194304
%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
}