#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_ft(int);
int wpa_key_mgmt_only_ft(int akm) {
  int ft = wpa_key_mgmt_ft(akm);
  akm &= ~(BIT(6) | BIT(5) | BIT(24) | BIT(11) | BIT(20) | BIT(21));
  return ft && !akm;
}


x86 assembly (clang, -O0):
<wpa_key_mgmt_only_ft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <wpa_key_mgmt_ft@plt>
mov    %eax,-0x8(%rbp)
mov    $0x6,%edi
call   1030 <BIT@plt>
mov    %eax,-0x20(%rbp)
mov    $0x5,%edi
call   1030 <BIT@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    $0x18,%edi
call   1030 <BIT@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    $0xb,%edi
call   1030 <BIT@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    $0x14,%edi
call   1030 <BIT@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    $0x15,%edi
call   1030 <BIT@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
or     %ecx,%eax
xor    $0xffffffff,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     11c8 <wpa_key_mgmt_only_ft+0xa8>
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wpa_key_mgmt_only_ft>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edi,%r15d
call   1040 <wpa_key_mgmt_ft@plt>
mov    %eax,%r14d
mov    $0x6,%edi
call   1030 <BIT@plt>
mov    %eax,%ebp
mov    $0x5,%edi
call   1030 <BIT@plt>
mov    %eax,%ebx
or     %ebp,%ebx
mov    $0x18,%edi
call   1030 <BIT@plt>
mov    %eax,%r12d
mov    $0xb,%edi
call   1030 <BIT@plt>
mov    %eax,%ebp
or     %r12d,%ebp
or     %ebx,%ebp
mov    $0x14,%edi
call   1030 <BIT@plt>
mov    %eax,%ebx
mov    $0x15,%edi
call   1030 <BIT@plt>
or     %ebx,%eax
or     %ebp,%eax
not    %eax
test   %r14d,%r14d
setne  %cl
test   %r15d,%eax
sete   %al
and    %cl,%al
movzbl %al,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @wpa_key_mgmt_only_ft(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @wpa_key_mgmt_ft(i32 %4)
store i32 %5, i32* %3
%6 = call i32 @BIT(i32 6)
%7 = call i32 @BIT(i32 5)
%8 = or i32 %6, %7
%9 = call i32 @BIT(i32 24)
%10 = or i32 %8, %9
%11 = call i32 @BIT(i32 11)
%12 = or i32 %10, %11
%13 = call i32 @BIT(i32 20)
%14 = or i32 %12, %13
%15 = call i32 @BIT(i32 21)
%16 = or i32 %14, %15
%17 = xor i32 %16, -1
%18 = load i32, i32* %2
%19 = and i32 %18, %17
store i32 %19, i32* %2
%20 = load i32, i32* %3
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %26
22: ; preds = %1
%23 = load i32, i32* %2
%24 = icmp ne i32 %23, 0
%25 = xor i1 %24, true
br label %26
26: ; preds = %22, %1
%27 = phi i1 [ false, %1 ], [ %25, %22 ]
%28 = zext i1 %27 to i32
ret i32 %28
}

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