#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 int64_t;

/* Variables and functions */
int valid_bo_pre_v2(int64_t value) {
  if ((value & 0x14) == 0)
    return 1;
  else if ((value & 0x14) == 0x4)
    return (value & 0x2) == 0;
  else if ((value & 0x14) == 0x10)
    return (value & 0x8) == 0;
  else
    return value == 0x14;
}


x86 assembly (clang, -O0):
<valid_bo_pre_v2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x14,%eax
cmp    $0x0,%eax
jne    1122 <valid_bo_pre_v2+0x22>
movl   $0x1,-0x4(%rbp)
jmp    1181 <valid_bo_pre_v2+0x81>
mov    -0x8(%rbp),%eax
and    $0x14,%eax
cmp    $0x4,%eax
jne    114a <valid_bo_pre_v2+0x4a>
mov    -0x8(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1181 <valid_bo_pre_v2+0x81>
mov    -0x8(%rbp),%eax
and    $0x14,%eax
cmp    $0x10,%eax
jne    1172 <valid_bo_pre_v2+0x72>
mov    -0x8(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1181 <valid_bo_pre_v2+0x81>
cmpl   $0x14,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_bo_pre_v2>:
mov    %edi,%eax
and    $0x14,%eax
je     1117 <valid_bo_pre_v2+0x17>
cmp    $0x10,%eax
je     111d <valid_bo_pre_v2+0x1d>
cmp    $0x4,%eax
jne    1123 <valid_bo_pre_v2+0x23>
test   $0x2,%dil
jmp    1126 <valid_bo_pre_v2+0x26>
mov    $0x1,%al
movzbl %al,%eax
ret
test   $0x8,%dil
jmp    1126 <valid_bo_pre_v2+0x26>
cmp    $0x14,%edi
sete   %al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @valid_bo_pre_v2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 20
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %30
8: ; preds = %1
%9 = load i32, i32* %3
%10 = and i32 %9, 20
%11 = icmp eq i32 %10, 4
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = load i32, i32* %3
%14 = and i32 %13, 2
%15 = icmp eq i32 %14, 0
%16 = zext i1 %15 to i32
store i32 %16, i32* %2
br label %30
17: ; preds = %8
%18 = load i32, i32* %3
%19 = and i32 %18, 20
%20 = icmp eq i32 %19, 16
br i1 %20, label %21, label %26
21: ; preds = %17
%22 = load i32, i32* %3
%23 = and i32 %22, 8
%24 = icmp eq i32 %23, 0
%25 = zext i1 %24 to i32
store i32 %25, i32* %2
br label %30
26: ; preds = %17
%27 = load i32, i32* %3
%28 = icmp eq i32 %27, 20
%29 = zext i1 %28 to i32
store i32 %29, i32* %2
br label %30
30: ; preds = %26, %21, %12, %7
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
define i32 @valid_bo_pre_v2(i32 %0) {
%2 = and i32 %0, 20
switch i32 %2, label %9 [
i32 0, label %11
i32 4, label %3
i32 16, label %6
]
3: ; preds = %1
%4 = and i32 %0, 2
%5 = icmp eq i32 %4, 0
br label %11
6: ; preds = %1
%7 = and i32 %0, 8
%8 = icmp eq i32 %7, 0
br label %11
9: ; preds = %1
%10 = icmp eq i32 %0, 20
br label %11
11: ; preds = %1, %9, %6, %3
%12 = phi i1 [ %5, %3 ], [ %8, %6 ], [ %10, %9 ], [ true, %1 ]
%13 = zext i1 %12 to i32
ret i32 %13
}