#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;
typedef int f;

/* Variables and functions */
int filter(uint32_t const x) {
  uint32_t f;
  f = 0xf22c0 >> (x & 0xf) & 16;
  f |= 0x6c9c0 >> (x >> 4 & 0xf) & 8;
  f |= 0x3c8b0 >> (x >> 8 & 0xf) & 4;
  f |= 0x1e458 >> (x >> 12 & 0xf) & 2;
  f |= 0x0d938 >> (x >> 16 & 0xf) & 1;
  return ((0xEC57E80A) >> (f)&1);
}


x86 assembly (clang, -O0):
<filter>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0xf,%ecx
mov    $0xf22c0,%eax
sar    %cl,%eax
and    $0x10,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
and    $0xf,%ecx
mov    $0x6c9c0,%eax
sar    %cl,%eax
and    $0x8,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xf,%ecx
mov    $0x3c8b0,%eax
sar    %cl,%eax
and    $0x4,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0xc,%ecx
and    $0xf,%ecx
mov    $0x1e458,%eax
sar    %cl,%eax
and    $0x2,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
and    $0xf,%ecx
mov    $0xd938,%eax
sar    %cl,%eax
and    $0x1,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0xec57e80a,%eax
shr    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<filter>:
mov    %edi,%ecx
and    $0xf,%cl
mov    $0xf22c0,%eax
shr    %cl,%eax
mov    %edi,%ecx
shr    $0x4,%cl
mov    $0x6c9c0,%edx
shr    %cl,%edx
and    $0x10,%eax
and    $0x8,%edx
mov    %edi,%ecx
shr    $0x8,%ecx
and    $0xf,%cl
mov    $0x3c8b0,%esi
shr    %cl,%esi
or     %eax,%edx
and    $0x4,%esi
mov    %edi,%ecx
shr    $0xc,%ecx
and    $0xf,%cl
mov    $0x1e458,%eax
shr    %cl,%eax
or     %edx,%esi
and    $0x2,%eax
shr    $0x10,%edi
and    $0xf,%dil
mov    $0xd938,%edx
mov    %edi,%ecx
shr    %cl,%edx
or     %esi,%eax
and    $0x1,%edx
or     %eax,%edx
mov    $0xec57e80a,%eax
mov    %edx,%ecx
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @filter(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 15
%6 = ashr i32 991936, %5
%7 = and i32 %6, 16
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = ashr i32 %8, 4
%10 = and i32 %9, 15
%11 = ashr i32 444864, %10
%12 = and i32 %11, 8
%13 = load i32, i32* %3
%14 = or i32 %13, %12
store i32 %14, i32* %3
%15 = load i32, i32* %2
%16 = ashr i32 %15, 8
%17 = and i32 %16, 15
%18 = ashr i32 247984, %17
%19 = and i32 %18, 4
%20 = load i32, i32* %3
%21 = or i32 %20, %19
store i32 %21, i32* %3
%22 = load i32, i32* %2
%23 = ashr i32 %22, 12
%24 = and i32 %23, 15
%25 = ashr i32 123992, %24
%26 = and i32 %25, 2
%27 = load i32, i32* %3
%28 = or i32 %27, %26
store i32 %28, i32* %3
%29 = load i32, i32* %2
%30 = ashr i32 %29, 16
%31 = and i32 %30, 15
%32 = ashr i32 55608, %31
%33 = and i32 %32, 1
%34 = load i32, i32* %3
%35 = or i32 %34, %33
store i32 %35, i32* %3
%36 = load i32, i32* %3
%37 = lshr i32 -329783286, %36
%38 = and i32 %37, 1
ret i32 %38
}

LLVM IR (-O2):
define i32 @filter(i32 %0) {
%2 = and i32 %0, 15
%3 = lshr i32 991936, %2
%4 = and i32 %3, 16
%5 = lshr i32 %0, 4
%6 = and i32 %5, 15
%7 = lshr i32 444864, %6
%8 = and i32 %7, 8
%9 = or i32 %8, %4
%10 = lshr i32 %0, 8
%11 = and i32 %10, 15
%12 = lshr i32 247984, %11
%13 = and i32 %12, 4
%14 = or i32 %9, %13
%15 = lshr i32 %0, 12
%16 = and i32 %15, 15
%17 = lshr i32 123992, %16
%18 = and i32 %17, 2
%19 = or i32 %14, %18
%20 = lshr i32 %0, 16
%21 = and i32 %20, 15
%22 = lshr i32 55608, %21
%23 = and i32 %22, 1
%24 = or i32 %19, %23
%25 = lshr i32 -329783286, %24
%26 = and i32 %25, 1
ret i32 %26
}