#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 /*<<< orphan*/ FadeSetEnterMenu();
int /*<<< orphan*/ FadeSetEnterScreen();
int /*<<< orphan*/ FadeSetLeaveMenu();
void FadeSetFromType(int type) {
  if (type & (1 << 12))
    FadeSetEnterScreen();
  else if (type & ((1 << 12) | (1 << 14) | (1 << 16)))
    FadeSetEnterMenu();
  else if (type & ((1 << 13) | (1 << 15) | (1 << 17)))
    FadeSetLeaveMenu();
}


x86 assembly (clang, -O0):
<FadeSetFromType>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1000,%eax
cmp    $0x0,%eax
je     1158 <FadeSetFromType+0x28>
mov    $0x0,%al
call   1030 <FadeSetEnterScreen@plt>
jmp    1197 <FadeSetFromType+0x67>
mov    -0x4(%rbp),%eax
and    $0x15000,%eax
cmp    $0x0,%eax
je     1175 <FadeSetFromType+0x45>
mov    $0x0,%al
call   1050 <FadeSetEnterMenu@plt>
jmp    1192 <FadeSetFromType+0x62>
mov    -0x4(%rbp),%eax
and    $0x2a000,%eax
cmp    $0x0,%eax
je     118d <FadeSetFromType+0x5d>
mov    $0x0,%al
call   1040 <FadeSetLeaveMenu@plt>
jmp    1192 <FadeSetFromType+0x62>
jmp    1197 <FadeSetFromType+0x67>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FadeSetFromType>:
test   $0x1000,%edi
jne    1147 <FadeSetFromType+0x17>
test   $0x15000,%edi
je     114e <FadeSetFromType+0x1e>
xor    %eax,%eax
jmp    1050 <FadeSetEnterMenu@plt>
xor    %eax,%eax
jmp    1030 <FadeSetEnterScreen@plt>
test   $0x2a000,%edi
je     115d <FadeSetFromType+0x2d>
xor    %eax,%eax
jmp    1040 <FadeSetLeaveMenu@plt>
ret

LLVM IR (-O0):
define void @FadeSetFromType(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 4096
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @FadeSetEnterScreen()
br label %22
8: ; preds = %1
%9 = load i32, i32* %2
%10 = and i32 %9, 86016
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 (...) @FadeSetEnterMenu()
br label %21
14: ; preds = %8
%15 = load i32, i32* %2
%16 = and i32 %15, 172032
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = call i32 (...) @FadeSetLeaveMenu()
br label %20
20: ; preds = %18, %14
br label %21
21: ; preds = %20, %12
br label %22
22: ; preds = %21, %6
ret void
}

LLVM IR (-O2):
define void @FadeSetFromType(i32 %0) {
%2 = and i32 %0, 4096
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @FadeSetEnterScreen()
br label %16
6: ; preds = %1
%7 = and i32 %0, 86016
%8 = icmp eq i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 (...) @FadeSetEnterMenu()
br label %16
11: ; preds = %6
%12 = and i32 %0, 172032
%13 = icmp eq i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %11
%15 = tail call i32 (...) @FadeSetLeaveMenu()
br label %16
16: ; preds = %9, %14, %11, %4
ret void
}