#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 BIT(int);
int wpa_key_mgmt_sha256(int akm) {
  return !!(akm & (BIT(8) | BIT(7) | BIT(10) | BIT(11) | BIT(15) | BIT(16) |
                   BIT(18) | BIT(20)));
}


x86 assembly (clang, -O0):
<wpa_key_mgmt_sha256>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x8,%edi
call   1030 <BIT@plt>
mov    %eax,-0x24(%rbp)
mov    $0x7,%edi
call   1030 <BIT@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    $0xa,%edi
call   1030 <BIT@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    $0xb,%edi
call   1030 <BIT@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    $0xf,%edi
call   1030 <BIT@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    $0x10,%edi
call   1030 <BIT@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    $0x12,%edi
call   1030 <BIT@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    $0x14,%edi
call   1030 <BIT@plt>
mov    -0xc(%rbp),%ecx
mov    %eax,%edx
mov    -0x8(%rbp),%eax
or     %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wpa_key_mgmt_sha256>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edi,%r14d
mov    $0x8,%edi
call   1030 <BIT@plt>
mov    %eax,%ebp
mov    $0x7,%edi
call   1030 <BIT@plt>
mov    %eax,%ebx
or     %ebp,%ebx
mov    $0xa,%edi
call   1030 <BIT@plt>
mov    %eax,%r15d
mov    $0xb,%edi
call   1030 <BIT@plt>
mov    %eax,%r12d
or     %r15d,%r12d
or     %ebx,%r12d
mov    $0xf,%edi
call   1030 <BIT@plt>
mov    %eax,%r15d
mov    $0x10,%edi
call   1030 <BIT@plt>
mov    %eax,%ebx
or     %r15d,%ebx
mov    $0x12,%edi
call   1030 <BIT@plt>
mov    %eax,%ebp
or     %ebx,%ebp
or     %r12d,%ebp
mov    $0x14,%edi
call   1030 <BIT@plt>
or     %ebp,%eax
xor    %ecx,%ecx
test   %r14d,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @wpa_key_mgmt_sha256(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @BIT(i32 8)
%5 = call i32 @BIT(i32 7)
%6 = or i32 %4, %5
%7 = call i32 @BIT(i32 10)
%8 = or i32 %6, %7
%9 = call i32 @BIT(i32 11)
%10 = or i32 %8, %9
%11 = call i32 @BIT(i32 15)
%12 = or i32 %10, %11
%13 = call i32 @BIT(i32 16)
%14 = or i32 %12, %13
%15 = call i32 @BIT(i32 18)
%16 = or i32 %14, %15
%17 = call i32 @BIT(i32 20)
%18 = or i32 %16, %17
%19 = and i32 %3, %18
%20 = icmp ne i32 %19, 0
%21 = xor i1 %20, true
%22 = xor i1 %21, true
%23 = zext i1 %22 to i32
ret i32 %23
}

LLVM IR (-O2):
define i32 @wpa_key_mgmt_sha256(i32 %0) {
%2 = tail call i32 @BIT(i32 8)
%3 = tail call i32 @BIT(i32 7)
%4 = or i32 %3, %2
%5 = tail call i32 @BIT(i32 10)
%6 = or i32 %4, %5
%7 = tail call i32 @BIT(i32 11)
%8 = or i32 %6, %7
%9 = tail call i32 @BIT(i32 15)
%10 = or i32 %8, %9
%11 = tail call i32 @BIT(i32 16)
%12 = or i32 %10, %11
%13 = tail call i32 @BIT(i32 18)
%14 = or i32 %12, %13
%15 = tail call i32 @BIT(i32 20)
%16 = or i32 %14, %15
%17 = and i32 %16, %0
%18 = icmp ne i32 %17, 0
%19 = zext i1 %18 to i32
ret i32 %19
}