#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*/ marker_show();
int road_down_prospect(int);
int road_left_prospect(int);
int road_right_prospect(int);
int road_up_prospect(int);
int road_prospect(int player, int dir) {
  marker_show();
  switch (dir) {
  case 0:
    return road_up_prospect(player);
    break;
  case 1:
    return road_down_prospect(player);
    break;
  case 2:
    return road_left_prospect(player);
    break;
  case 3:
    return road_right_prospect(player);
    break;
  default:
    return 0;
    break;
  }
}


x86 assembly (clang, -O0):
<road_prospect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
call   1070 <marker_show@plt>
mov    -0xc(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x3,%rax
ja     11ca <road_prospect+0x7a>
mov    -0x18(%rbp),%rax
lea    0xe7f(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%edi
call   1050 <road_up_prospect@plt>
mov    %eax,-0x4(%rbp)
jmp    11d1 <road_prospect+0x81>
mov    -0x8(%rbp),%edi
call   1040 <road_down_prospect@plt>
mov    %eax,-0x4(%rbp)
jmp    11d1 <road_prospect+0x81>
mov    -0x8(%rbp),%edi
call   1060 <road_left_prospect@plt>
mov    %eax,-0x4(%rbp)
jmp    11d1 <road_prospect+0x81>
mov    -0x8(%rbp),%edi
call   1030 <road_right_prospect@plt>
mov    %eax,-0x4(%rbp)
jmp    11d1 <road_prospect+0x81>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<road_prospect>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1070 <marker_show@plt>
cmp    $0x3,%ebp
ja     1182 <road_prospect+0x32>
mov    %ebp,%eax
lea    0xe94(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <road_up_prospect@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <road_down_prospect@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <road_left_prospect@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <road_right_prospect@plt>

LLVM IR (-O0):
define i32 @road_prospect(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @marker_show()
%7 = load i32, i32* %5
switch i32 %7, label %20 [
i32 0, label %8
i32 1, label %11
i32 2, label %14
i32 3, label %17
]
8: ; preds = %2
%9 = load i32, i32* %4
%10 = call i32 @road_up_prospect(i32 %9)
store i32 %10, i32* %3
br label %21
11: ; preds = %2
%12 = load i32, i32* %4
%13 = call i32 @road_down_prospect(i32 %12)
store i32 %13, i32* %3
br label %21
14: ; preds = %2
%15 = load i32, i32* %4
%16 = call i32 @road_left_prospect(i32 %15)
store i32 %16, i32* %3
br label %21
17: ; preds = %2
%18 = load i32, i32* %4
%19 = call i32 @road_right_prospect(i32 %18)
store i32 %19, i32* %3
br label %21
20: ; preds = %2
store i32 0, i32* %3
br label %21
21: ; preds = %20, %17, %14, %11, %8
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @road_prospect(i32 %0, i32 %1) {
%3 = tail call i32 (...) @marker_show()
switch i32 %1, label %12 [
i32 0, label %4
i32 1, label %6
i32 2, label %8
i32 3, label %10
]
4: ; preds = %2
%5 = tail call i32 @road_up_prospect(i32 %0)
br label %12
6: ; preds = %2
%7 = tail call i32 @road_down_prospect(i32 %0)
br label %12
8: ; preds = %2
%9 = tail call i32 @road_left_prospect(i32 %0)
br label %12
10: ; preds = %2
%11 = tail call i32 @road_right_prospect(i32 %0)
br label %12
12: ; preds = %2, %10, %8, %6, %4
%13 = phi i32 [ %11, %10 ], [ %9, %8 ], [ %7, %6 ], [ %5, %4 ], [ 0, %2 ]
ret i32 %13
}