#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*/ DrawMaskedBorder_ALL();
int /*<<< orphan*/ DrawMaskedBorder_DOOR_1();
int /*<<< orphan*/ DrawMaskedBorder_DOOR_2();
int /*<<< orphan*/ DrawMaskedBorder_DOOR_3();
int /*<<< orphan*/ DrawMaskedBorder_FIELD();
int effectiveGameStatus();
void DrawMaskedBorder(int redraw_mask) {
  if (effectiveGameStatus() == 1 || effectiveGameStatus() == 3)
    return;
  if (redraw_mask & (1 << 0))
    DrawMaskedBorder_ALL();
  else {
    if (redraw_mask & (1 << 1))
      DrawMaskedBorder_FIELD();
    if (redraw_mask & (1 << 3))
      DrawMaskedBorder_DOOR_1();
    if (redraw_mask & ((1 << 4) | (1 << 5) | (1 << 6)))
      DrawMaskedBorder_DOOR_2();
    if (redraw_mask & (1 << 10))
      DrawMaskedBorder_DOOR_3();
  }
}


x86 assembly (clang, -O0):
<DrawMaskedBorder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1080 <effectiveGameStatus@plt>
cmp    $0x1,%eax
je     118b <DrawMaskedBorder+0x2b>
mov    $0x0,%al
call   1080 <effectiveGameStatus@plt>
cmp    $0x3,%eax
jne    1190 <DrawMaskedBorder+0x30>
jmp    120a <DrawMaskedBorder+0xaa>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     11ab <DrawMaskedBorder+0x4b>
mov    $0x0,%al
call   1040 <DrawMaskedBorder_ALL@plt>
jmp    120a <DrawMaskedBorder+0xaa>
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     11c1 <DrawMaskedBorder+0x61>
mov    $0x0,%al
call   1070 <DrawMaskedBorder_FIELD@plt>
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     11d7 <DrawMaskedBorder+0x77>
mov    $0x0,%al
call   1060 <DrawMaskedBorder_DOOR_1@plt>
mov    -0x4(%rbp),%eax
and    $0x70,%eax
cmp    $0x0,%eax
je     11ed <DrawMaskedBorder+0x8d>
mov    $0x0,%al
call   1030 <DrawMaskedBorder_DOOR_2@plt>
mov    -0x4(%rbp),%eax
and    $0x400,%eax
cmp    $0x0,%eax
je     1205 <DrawMaskedBorder+0xa5>
mov    $0x0,%al
call   1050 <DrawMaskedBorder_DOOR_3@plt>
jmp    120a <DrawMaskedBorder+0xaa>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DrawMaskedBorder>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1080 <effectiveGameStatus@plt>
cmp    $0x1,%eax
je     117b <DrawMaskedBorder+0x1b>
xor    %eax,%eax
call   1080 <effectiveGameStatus@plt>
cmp    $0x3,%eax
jne    117d <DrawMaskedBorder+0x1d>
pop    %rbx
ret
test   $0x1,%bl
jne    11a8 <DrawMaskedBorder+0x48>
test   $0x2,%bl
jne    11b0 <DrawMaskedBorder+0x50>
test   $0x8,%bl
jne    11bc <DrawMaskedBorder+0x5c>
test   $0x70,%bl
je     1198 <DrawMaskedBorder+0x38>
xor    %eax,%eax
call   1030 <DrawMaskedBorder_DOOR_2@plt>
test   $0x400,%ebx
je     117b <DrawMaskedBorder+0x1b>
xor    %eax,%eax
pop    %rbx
jmp    1050 <DrawMaskedBorder_DOOR_3@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <DrawMaskedBorder_ALL@plt>
xor    %eax,%eax
call   1070 <DrawMaskedBorder_FIELD@plt>
test   $0x8,%bl
je     118c <DrawMaskedBorder+0x2c>
xor    %eax,%eax
call   1060 <DrawMaskedBorder_DOOR_1@plt>
test   $0x70,%bl
jne    1191 <DrawMaskedBorder+0x31>
jmp    1198 <DrawMaskedBorder+0x38>

LLVM IR (-O0):
define void @DrawMaskedBorder(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @effectiveGameStatus()
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = call i32 (...) @effectiveGameStatus()
%7 = icmp eq i32 %6, 3
br i1 %7, label %8, label %9
8: ; preds = %5, %1
br label %40
9: ; preds = %5
%10 = load i32, i32* %2
%11 = and i32 %10, 1
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = call i32 (...) @DrawMaskedBorder_ALL()
br label %40
15: ; preds = %9
%16 = load i32, i32* %2
%17 = and i32 %16, 2
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = call i32 (...) @DrawMaskedBorder_FIELD()
br label %21
21: ; preds = %19, %15
%22 = load i32, i32* %2
%23 = and i32 %22, 8
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = call i32 (...) @DrawMaskedBorder_DOOR_1()
br label %27
27: ; preds = %25, %21
%28 = load i32, i32* %2
%29 = and i32 %28, 112
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %27
%32 = call i32 (...) @DrawMaskedBorder_DOOR_2()
br label %33
33: ; preds = %31, %27
%34 = load i32, i32* %2
%35 = and i32 %34, 1024
%36 = icmp ne i32 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = call i32 (...) @DrawMaskedBorder_DOOR_3()
br label %39
39: ; preds = %37, %33
br label %40
40: ; preds = %8, %39, %13
ret void
}

LLVM IR (-O2):
define void @DrawMaskedBorder(i32 %0) {
%2 = tail call i32 (...) @effectiveGameStatus()
%3 = icmp eq i32 %2, 1
br i1 %3, label %32, label %4
4: ; preds = %1
%5 = tail call i32 (...) @effectiveGameStatus()
%6 = icmp eq i32 %5, 3
br i1 %6, label %32, label %7
7: ; preds = %4
%8 = and i32 %0, 1
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 (...) @DrawMaskedBorder_ALL()
br label %32
12: ; preds = %7
%13 = and i32 %0, 2
%14 = icmp eq i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = tail call i32 (...) @DrawMaskedBorder_FIELD()
br label %17
17: ; preds = %15, %12
%18 = and i32 %0, 8
%19 = icmp eq i32 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %17
%21 = tail call i32 (...) @DrawMaskedBorder_DOOR_1()
br label %22
22: ; preds = %20, %17
%23 = and i32 %0, 112
%24 = icmp eq i32 %23, 0
br i1 %24, label %27, label %25
25: ; preds = %22
%26 = tail call i32 (...) @DrawMaskedBorder_DOOR_2()
br label %27
27: ; preds = %25, %22
%28 = and i32 %0, 1024
%29 = icmp eq i32 %28, 0
br i1 %29, label %32, label %30
30: ; preds = %27
%31 = tail call i32 (...) @DrawMaskedBorder_DOOR_3()
br label %32
32: ; preds = %27, %30, %1, %4, %10
ret void
}