#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 atoi(char *);
char *strdup(char *);
char *find_ravenshield_game(char *gameno) {
  switch (atoi(gameno)) {
  case 8:
    return strdup("Team Deathmatch");
    break;
  case 13:
    return strdup("Deathmatch");
    break;
  case 14:
    return strdup("Team Deathmatch");
    break;
  case 15:
    return strdup("Bomb");
    break;
  case 16:
    return strdup("Escort Pilot");
    break;
  default:
    return strdup(gameno);
    break;
  }
}


x86 assembly (clang, -O0):
<find_ravenshield_game>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atoi@plt>
add    $0xfffffff8,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x8,%eax
ja     11c4 <find_ravenshield_game+0xa4>
mov    -0x18(%rbp),%rax
lea    0xeae(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xec2(%rip),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    11d1 <find_ravenshield_game+0xb1>
lea    0xeb2(%rip),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    11d1 <find_ravenshield_game+0xb1>
lea    0xe98(%rip),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    11d1 <find_ravenshield_game+0xb1>
lea    0xe93(%rip),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    11d1 <find_ravenshield_game+0xb1>
lea    0xe83(%rip),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    11d1 <find_ravenshield_game+0xb1>
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_ravenshield_game>:
push   %rbx
mov    %rdi,%rbx
call   1030 <atoi@plt>
add    $0xfffffff8,%eax
cmp    $0x8,%eax
ja     114e <find_ravenshield_game+0x2e>
lea    0xec8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xedc(%rip),%rdi
pop    %rbx
jmp    1040 <strdup@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strdup@plt>
lea    0xecb(%rip),%rdi
pop    %rbx
jmp    1040 <strdup@plt>
lea    0xec9(%rip),%rdi
pop    %rbx
jmp    1040 <strdup@plt>
lea    0xec1(%rip),%rdi
pop    %rbx
jmp    1040 <strdup@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Team Deathmatch\00"
@.str.1 = [11 x i8] c"Deathmatch\00"
@.str.2 = [5 x i8] c"Bomb\00"
@.str.3 = [13 x i8] c"Escort Pilot\00"
define i8* @find_ravenshield_game(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @atoi(i8* %4)
switch i32 %5, label %16 [
i32 8, label %6
i32 13, label %8
i32 14, label %10
i32 15, label %12
i32 16, label %14
]
6: ; preds = %1
%7 = call i8* @strdup(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %2
br label %19
8: ; preds = %1
%9 = call i8* @strdup(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
store i8* %9, i8** %2
br label %19
10: ; preds = %1
%11 = call i8* @strdup(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i8* %11, i8** %2
br label %19
12: ; preds = %1
%13 = call i8* @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
store i8* %13, i8** %2
br label %19
14: ; preds = %1
%15 = call i8* @strdup(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
store i8* %15, i8** %2
br label %19
16: ; preds = %1
%17 = load i8*, i8** %3
%18 = call i8* @strdup(i8* %17)
store i8* %18, i8** %2
br label %19
19: ; preds = %16, %14, %12, %10, %8, %6
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
@.str = [16 x i8] c"Team Deathmatch\00"
@.str.1 = [11 x i8] c"Deathmatch\00"
@.str.2 = [5 x i8] c"Bomb\00"
@.str.3 = [13 x i8] c"Escort Pilot\00"
define noalias i8* @find_ravenshield_game(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
switch i32 %2, label %13 [
i32 8, label %3
i32 13, label %5
i32 14, label %7
i32 15, label %9
i32 16, label %11
]
3: ; preds = %1
%4 = tail call dereferenceable_or_null(16) i8* @strdup(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %15
5: ; preds = %1
%6 = tail call dereferenceable_or_null(11) i8* @strdup(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %15
7: ; preds = %1
%8 = tail call dereferenceable_or_null(16) i8* @strdup(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %15
9: ; preds = %1
%10 = tail call dereferenceable_or_null(5) i8* @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %15
11: ; preds = %1
%12 = tail call dereferenceable_or_null(13) i8* @strdup(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
br label %15
13: ; preds = %1
%14 = tail call i8* @strdup(i8* %0)
br label %15
15: ; preds = %13, %11, %9, %7, %5, %3
%16 = phi i8* [ %14, %13 ], [ %12, %11 ], [ %10, %9 ], [ %8, %7 ], [ %6, %5 ], [ %4, %3 ]
ret i8* %16
}