#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*/ joystick_joypad_clear();
int /*<<< orphan*/ keyboard_keyword_clear();
int /*<<< orphan*/ keyboard_keyword_include();
int /*<<< orphan*/ keyboard_keyword_lshift();
int /*<<< orphan*/ keyboard_keyword_rshift();
int /*<<< orphan*/ keyboard_keyword_shiftl();
int /*<<< orphan*/ keyboard_keyword_undef();
int /*<<< orphan*/ keyboard_keyword_vshift();
int /*<<< orphan*/ strcmp(char *, char *);
char *strtok(char *, char *);
void keyboard_parse_keyword(char *buffer) {
  char *key;
  key = strtok(buffer + 1, " \t:");
  if (!strcmp(key, "LSHIFT")) {
    keyboard_keyword_lshift();
  } else if (!strcmp(key, "RSHIFT")) {
    keyboard_keyword_rshift();
  } else if (!strcmp(key, "VSHIFT")) {
    keyboard_keyword_vshift();
  } else if (!strcmp(key, "SHIFTL")) {
    keyboard_keyword_shiftl();
  } else if (!strcmp(key, "CLEAR")) {
    keyboard_keyword_clear();
  } else if (!strcmp(key, "INCLUDE")) {
    keyboard_keyword_include();
  } else if (!strcmp(key, "UNDEF")) {
    keyboard_keyword_undef();
  }
  joystick_joypad_clear();
}


x86 assembly (clang, -O0):
<keyboard_parse_keyword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
lea    0xe45(%rip),%rsi
call   10b0 <strtok@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe35(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    11e9 <keyboard_parse_keyword+0x49>
mov    $0x0,%al
call   10c0 <keyboard_keyword_lshift@plt>
jmp    12e0 <keyboard_parse_keyword+0x140>
mov    -0x10(%rbp),%rdi
lea    0xe17(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    120e <keyboard_parse_keyword+0x6e>
mov    $0x0,%al
call   1080 <keyboard_keyword_rshift@plt>
jmp    12db <keyboard_parse_keyword+0x13b>
mov    -0x10(%rbp),%rdi
lea    0xdf9(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1233 <keyboard_parse_keyword+0x93>
mov    $0x0,%al
call   1090 <keyboard_keyword_vshift@plt>
jmp    12d6 <keyboard_parse_keyword+0x136>
mov    -0x10(%rbp),%rdi
lea    0xddb(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1258 <keyboard_parse_keyword+0xb8>
mov    $0x0,%al
call   1040 <keyboard_keyword_shiftl@plt>
jmp    12d1 <keyboard_parse_keyword+0x131>
mov    -0x10(%rbp),%rdi
lea    0xdbd(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    127d <keyboard_parse_keyword+0xdd>
mov    $0x0,%al
call   1050 <keyboard_keyword_clear@plt>
jmp    12cc <keyboard_parse_keyword+0x12c>
mov    -0x10(%rbp),%rdi
lea    0xd9e(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    12a2 <keyboard_parse_keyword+0x102>
mov    $0x0,%al
call   10a0 <keyboard_keyword_include@plt>
jmp    12c7 <keyboard_parse_keyword+0x127>
mov    -0x10(%rbp),%rdi
lea    0xd81(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    12c2 <keyboard_parse_keyword+0x122>
mov    $0x0,%al
call   1030 <keyboard_keyword_undef@plt>
jmp    12c7 <keyboard_parse_keyword+0x127>
jmp    12cc <keyboard_parse_keyword+0x12c>
jmp    12d1 <keyboard_parse_keyword+0x131>
jmp    12d6 <keyboard_parse_keyword+0x136>
jmp    12db <keyboard_parse_keyword+0x13b>
jmp    12e0 <keyboard_parse_keyword+0x140>
mov    $0x0,%al
call   1070 <joystick_joypad_clear@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyboard_parse_keyword>:
push   %rbx
add    $0x1,%rdi
lea    0xe54(%rip),%rsi
call   10b0 <strtok@plt>
mov    %rax,%rbx
lea    0xe49(%rip),%rsi
mov    %rax,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1242 <keyboard_parse_keyword+0xa2>
lea    0xe3d(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
je     124b <keyboard_parse_keyword+0xab>
lea    0xe31(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1254 <keyboard_parse_keyword+0xb4>
lea    0xe25(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
je     125d <keyboard_parse_keyword+0xbd>
lea    0xe19(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1266 <keyboard_parse_keyword+0xc6>
lea    0xe0c(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
je     126f <keyboard_parse_keyword+0xcf>
lea    0xe01(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %eax,%eax
jne    1276 <keyboard_parse_keyword+0xd6>
xor    %eax,%eax
call   1030 <keyboard_keyword_undef@plt>
jmp    1276 <keyboard_parse_keyword+0xd6>
xor    %eax,%eax
call   10c0 <keyboard_keyword_lshift@plt>
jmp    1276 <keyboard_parse_keyword+0xd6>
xor    %eax,%eax
call   1080 <keyboard_keyword_rshift@plt>
jmp    1276 <keyboard_parse_keyword+0xd6>
xor    %eax,%eax
call   1090 <keyboard_keyword_vshift@plt>
jmp    1276 <keyboard_parse_keyword+0xd6>
xor    %eax,%eax
call   1040 <keyboard_keyword_shiftl@plt>
jmp    1276 <keyboard_parse_keyword+0xd6>
xor    %eax,%eax
call   1050 <keyboard_keyword_clear@plt>
jmp    1276 <keyboard_parse_keyword+0xd6>
xor    %eax,%eax
call   10a0 <keyboard_keyword_include@plt>
xor    %eax,%eax
pop    %rbx
jmp    1070 <joystick_joypad_clear@plt>

LLVM IR (-O0):
@.str = [4 x i8] c" \09:\00"
@.str.1 = [7 x i8] c"LSHIFT\00"
@.str.2 = [7 x i8] c"RSHIFT\00"
@.str.3 = [7 x i8] c"VSHIFT\00"
@.str.4 = [7 x i8] c"SHIFTL\00"
@.str.5 = [6 x i8] c"CLEAR\00"
@.str.6 = [8 x i8] c"INCLUDE\00"
@.str.7 = [6 x i8] c"UNDEF\00"
define void @keyboard_parse_keyword(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = call i8* @strtok(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @strcmp(i8* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp ne i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %1
%11 = call i32 (...) @keyboard_keyword_lshift()
br label %54
12: ; preds = %1
%13 = load i8*, i8** %3
%14 = call i32 @strcmp(i8* %13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%15 = icmp ne i32 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %12
%17 = call i32 (...) @keyboard_keyword_rshift()
br label %53
18: ; preds = %12
%19 = load i8*, i8** %3
%20 = call i32 @strcmp(i8* %19, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%21 = icmp ne i32 %20, 0
br i1 %21, label %24, label %22
22: ; preds = %18
%23 = call i32 (...) @keyboard_keyword_vshift()
br label %52
24: ; preds = %18
%25 = load i8*, i8** %3
%26 = call i32 @strcmp(i8* %25, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%27 = icmp ne i32 %26, 0
br i1 %27, label %30, label %28
28: ; preds = %24
%29 = call i32 (...) @keyboard_keyword_shiftl()
br label %51
30: ; preds = %24
%31 = load i8*, i8** %3
%32 = call i32 @strcmp(i8* %31, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%33 = icmp ne i32 %32, 0
br i1 %33, label %36, label %34
34: ; preds = %30
%35 = call i32 (...) @keyboard_keyword_clear()
br label %50
36: ; preds = %30
%37 = load i8*, i8** %3
%38 = call i32 @strcmp(i8* %37, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%39 = icmp ne i32 %38, 0
br i1 %39, label %42, label %40
40: ; preds = %36
%41 = call i32 (...) @keyboard_keyword_include()
br label %49
42: ; preds = %36
%43 = load i8*, i8** %3
%44 = call i32 @strcmp(i8* %43, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%45 = icmp ne i32 %44, 0
br i1 %45, label %48, label %46
46: ; preds = %42
%47 = call i32 (...) @keyboard_keyword_undef()
br label %48
48: ; preds = %46, %42
br label %49
49: ; preds = %48, %40
br label %50
50: ; preds = %49, %34
br label %51
51: ; preds = %50, %28
br label %52
52: ; preds = %51, %22
br label %53
53: ; preds = %52, %16
br label %54
54: ; preds = %53, %10
%55 = call i32 (...) @joystick_joypad_clear()
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c" \09:\00"
@.str.1 = [7 x i8] c"LSHIFT\00"
@.str.2 = [7 x i8] c"RSHIFT\00"
@.str.3 = [7 x i8] c"VSHIFT\00"
@.str.4 = [7 x i8] c"SHIFTL\00"
@.str.5 = [6 x i8] c"CLEAR\00"
@.str.6 = [8 x i8] c"INCLUDE\00"
@.str.7 = [6 x i8] c"UNDEF\00"
define void @keyboard_parse_keyword(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = tail call i8* @strtok(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 (...) @keyboard_keyword_lshift()
br label %38
8: ; preds = %1
%9 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = tail call i32 (...) @keyboard_keyword_rshift()
br label %38
13: ; preds = %8
%14 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = tail call i32 (...) @keyboard_keyword_vshift()
br label %38
18: ; preds = %13
%19 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = tail call i32 (...) @keyboard_keyword_shiftl()
br label %38
23: ; preds = %18
%24 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = tail call i32 (...) @keyboard_keyword_clear()
br label %38
28: ; preds = %23
%29 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = tail call i32 (...) @keyboard_keyword_include()
br label %38
33: ; preds = %28
%34 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = tail call i32 (...) @keyboard_keyword_undef()
br label %38
38: ; preds = %11, %21, %31, %36, %33, %26, %16, %6
%39 = tail call i32 (...) @joystick_joypad_clear()
ret void
}