#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 */
void *get_str_from_srv();
void *recv_item_from_srv();
void *recv_move_ev_data_from_srv();
void *recv_tags_data_from_srv();
void *get_event_data(const int type) {
  switch (type) {
  case 0x50:
  case 0x54:
    return recv_item_from_srv();
  case 0x51:
  case 0x55:
  case 0x0f:
    return get_str_from_srv();
  case 0x11:
    return recv_tags_data_from_srv();
  case 0x52:
  case 0x56:
    return recv_move_ev_data_from_srv();
  }
  return NULL;
}


x86 assembly (clang, -O0):
<get_event_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xfffffff1,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x47,%eax
ja     11b4 <get_event_data+0x74>
mov    -0x18(%rbp),%rax
lea    0xe95(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1050 <recv_item_from_srv@plt>
mov    %rax,-0x8(%rbp)
jmp    11bc <get_event_data+0x7c>
mov    $0x0,%al
call   1060 <get_str_from_srv@plt>
mov    %rax,-0x8(%rbp)
jmp    11bc <get_event_data+0x7c>
mov    $0x0,%al
call   1030 <recv_tags_data_from_srv@plt>
mov    %rax,-0x8(%rbp)
jmp    11bc <get_event_data+0x7c>
mov    $0x0,%al
call   1040 <recv_move_ev_data_from_srv@plt>
mov    %rax,-0x8(%rbp)
jmp    11bc <get_event_data+0x7c>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_event_data>:
add    $0xfffffff1,%edi
cmp    $0x47,%edi
ja     116d <get_event_data+0x2d>
lea    0xeb1(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
xor    %eax,%eax
jmp    1060 <get_str_from_srv@plt>
xor    %eax,%eax
jmp    1050 <recv_item_from_srv@plt>
xor    %eax,%eax
jmp    1040 <recv_move_ev_data_from_srv@plt>
xor    %eax,%eax
ret
xor    %eax,%eax
jmp    1030 <recv_tags_data_from_srv@plt>

LLVM IR (-O0):
define i8* @get_event_data(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %13 [
i32 80, label %5
i32 84, label %5
i32 81, label %7
i32 85, label %7
i32 15, label %7
i32 17, label %9
i32 82, label %11
i32 86, label %11
]
5: ; preds = %1, %1
%6 = call i8* (...) @recv_item_from_srv()
store i8* %6, i8** %2
br label %14
7: ; preds = %1, %1, %1
%8 = call i8* (...) @get_str_from_srv()
store i8* %8, i8** %2
br label %14
9: ; preds = %1
%10 = call i8* (...) @recv_tags_data_from_srv()
store i8* %10, i8** %2
br label %14
11: ; preds = %1, %1
%12 = call i8* (...) @recv_move_ev_data_from_srv()
store i8* %12, i8** %2
br label %14
13: ; preds = %1
store i8* null, i8** %2
br label %14
14: ; preds = %13, %11, %9, %7, %5
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @get_event_data(i32 %0) {
switch i32 %0, label %10 [
i32 80, label %2
i32 84, label %2
i32 81, label %4
i32 85, label %4
i32 15, label %4
i32 17, label %6
i32 82, label %8
i32 86, label %8
]
2: ; preds = %1, %1
%3 = tail call i8* (...) @recv_item_from_srv()
br label %10
4: ; preds = %1, %1, %1
%5 = tail call i8* (...) @get_str_from_srv()
br label %10
6: ; preds = %1
%7 = tail call i8* (...) @recv_tags_data_from_srv()
br label %10
8: ; preds = %1, %1
%9 = tail call i8* (...) @recv_move_ev_data_from_srv()
br label %10
10: ; preds = %1, %8, %6, %4, %2
%11 = phi i8* [ %9, %8 ], [ %7, %6 ], [ %5, %4 ], [ %3, %2 ], [ null, %1 ]
ret i8* %11
}