#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*/ registerUserForTheGame(char *, void *);
int /*<<< orphan*/ sendDataAboutAttacks(void *);
int /*<<< orphan*/ sendDataAboutMap(void *);
int /*<<< orphan*/ sendDataAboutSentAttacks(char *, void *);
int /*<<< orphan*/ sendDataAboutUsers(void *);
void processUserMessage(char usermessage[], void *socket_desc) {
  char command = usermessage[0];
  switch (command) {
  case 'J':
    registerUserForTheGame(usermessage, socket_desc);
    break;
  case 'U':
    sendDataAboutUsers(socket_desc);
    break;
  case 'M':
    sendDataAboutMap(socket_desc);
    break;
  case 'A':
    sendDataAboutAttacks(socket_desc);
    break;
  case 'S':
    sendDataAboutSentAttacks(usermessage, socket_desc);
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<processUserMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x14,%eax
ja     11e1 <processUserMessage+0x91>
mov    -0x20(%rbp),%rax
lea    0xe76(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <registerUserForTheGame@plt>
jmp    11e6 <processUserMessage+0x96>
mov    -0x10(%rbp),%rdi
call   1040 <sendDataAboutUsers@plt>
jmp    11e6 <processUserMessage+0x96>
mov    -0x10(%rbp),%rdi
call   1060 <sendDataAboutMap@plt>
jmp    11e6 <processUserMessage+0x96>
mov    -0x10(%rbp),%rdi
call   1030 <sendDataAboutAttacks@plt>
jmp    11e6 <processUserMessage+0x96>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1070 <sendDataAboutSentAttacks@plt>
jmp    11e6 <processUserMessage+0x96>
jmp    11e6 <processUserMessage+0x96>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processUserMessage>:
movsbl (%rdi),%eax
add    $0xffffffbf,%eax
cmp    $0x14,%eax
ja     1173 <processUserMessage+0x23>
lea    0xe9e(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    %rsi,%rdi
jmp    1030 <sendDataAboutAttacks@plt>
ret
jmp    1050 <registerUserForTheGame@plt>
mov    %rsi,%rdi
jmp    1060 <sendDataAboutMap@plt>
jmp    1070 <sendDataAboutSentAttacks@plt>
mov    %rsi,%rdi
jmp    1040 <sendDataAboutUsers@plt>

LLVM IR (-O0):
define void @processUserMessage(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
store i8 %8, i8* %5
%9 = load i8, i8* %5
%10 = sext i8 %9 to i32
switch i32 %10, label %28 [
i32 74, label %11
i32 85, label %15
i32 77, label %18
i32 65, label %21
i32 83, label %24
]
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = load i8*, i8** %4
%14 = call i32 @registerUserForTheGame(i8* %12, i8* %13)
br label %29
15: ; preds = %2
%16 = load i8*, i8** %4
%17 = call i32 @sendDataAboutUsers(i8* %16)
br label %29
18: ; preds = %2
%19 = load i8*, i8** %4
%20 = call i32 @sendDataAboutMap(i8* %19)
br label %29
21: ; preds = %2
%22 = load i8*, i8** %4
%23 = call i32 @sendDataAboutAttacks(i8* %22)
br label %29
24: ; preds = %2
%25 = load i8*, i8** %3
%26 = load i8*, i8** %4
%27 = call i32 @sendDataAboutSentAttacks(i8* %25, i8* %26)
br label %29
28: ; preds = %2
br label %29
29: ; preds = %28, %24, %21, %18, %15, %11
ret void
}

LLVM IR (-O2):
define void @processUserMessage(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
switch i32 %4, label %15 [
i32 74, label %5
i32 85, label %7
i32 77, label %9
i32 65, label %11
i32 83, label %13
]
5: ; preds = %2
%6 = tail call i32 @registerUserForTheGame(i8* %0, i8* %1)
br label %15
7: ; preds = %2
%8 = tail call i32 @sendDataAboutUsers(i8* %1)
br label %15
9: ; preds = %2
%10 = tail call i32 @sendDataAboutMap(i8* %1)
br label %15
11: ; preds = %2
%12 = tail call i32 @sendDataAboutAttacks(i8* %1)
br label %15
13: ; preds = %2
%14 = tail call i32 @sendDataAboutSentAttacks(i8* %0, i8* %1)
br label %15
15: ; preds = %2, %13, %11, %9, %7, %5
ret void
}