#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 *);
int /*<<< orphan*/ changeMode(int);
int /*<<< orphan*/ changeSpeed(int, int);
int /*<<< orphan*/ goBack(int);
int /*<<< orphan*/ move(int, int);
int /*<<< orphan*/ setGameTable(int, int, int, int, int, int, int);
scalar_t__ strcmp(char *, char *);
char *strtok(char *, char *);
void processCommands(char *buff) {
  int aPos, bPos, ballPosX, ballPosY, ballSpeedX, ballSpeedY, mode, backCount;
  char *command, *delimeter = " ,";
  command = strtok(buff, delimeter);
  if (strcmp(command, "set") == 0) {
    aPos = atoi(strtok(NULL, delimeter));
    bPos = atoi(strtok(NULL, delimeter));
    ballPosX = atoi(strtok(NULL, delimeter));
    ballPosY = atoi(strtok(NULL, delimeter));
    ballSpeedX = atoi(strtok(NULL, delimeter));
    ballSpeedY = atoi(strtok(NULL, delimeter));
    mode = atoi(strtok(NULL, delimeter));
    setGameTable(aPos, bPos, ballPosX, ballPosY, ballSpeedX, ballSpeedY, mode);
  } else if (strcmp(command, "move") == 0) {
    aPos = atoi(strtok(NULL, delimeter));
    bPos = atoi(strtok(NULL, delimeter));
    move(aPos, bPos);
  } else if (strcmp(command, "changemode") == 0) {
    mode = atoi(strtok(NULL, delimeter));
    changeMode(mode);
  } else if (strcmp(command, "changespeed") == 0) {
    ballSpeedX = atoi(strtok(NULL, delimeter));
    ballSpeedY = atoi(strtok(NULL, delimeter));
    changeSpeed(ballSpeedX, ballSpeedY);
  } else if (strcmp(command, "goback") == 0) {
    backCount = atoi(strtok(NULL, delimeter));
    goBack(backCount);
  }
}


x86 assembly (clang, -O0):
<processCommands>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xe6d(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   1070 <strtok@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
lea    0xe50(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    128e <processCommands+0x10e>
mov    -0x38(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1070 <strtok@plt>
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %eax,-0xc(%rbp)
mov    -0x38(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1070 <strtok@plt>
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %eax,-0x10(%rbp)
mov    -0x38(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1070 <strtok@plt>
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x38(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1070 <strtok@plt>
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x38(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1070 <strtok@plt>
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x38(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1070 <strtok@plt>
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %eax,-0x20(%rbp)
mov    -0x38(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1070 <strtok@plt>
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %eax,-0x24(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
mov    -0x24(%rbp),%eax
mov    %eax,(%rsp)
call   1060 <setGameTable@plt>
jmp    13cf <processCommands+0x24f>
mov    -0x30(%rbp),%rdi
lea    0xd6e(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    12e8 <processCommands+0x168>
mov    -0x38(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1070 <strtok@plt>
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %eax,-0xc(%rbp)
mov    -0x38(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1070 <strtok@plt>
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   10a0 <move@plt>
jmp    13ca <processCommands+0x24a>
mov    -0x30(%rbp),%rdi
lea    0xd19(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1327 <processCommands+0x1a7>
mov    -0x38(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1070 <strtok@plt>
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edi
call   1090 <changeMode@plt>
jmp    13c5 <processCommands+0x245>
mov    -0x30(%rbp),%rdi
lea    0xce5(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1381 <processCommands+0x201>
mov    -0x38(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1070 <strtok@plt>
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x38(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1070 <strtok@plt>
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1030 <changeSpeed@plt>
jmp    13c0 <processCommands+0x240>
mov    -0x30(%rbp),%rdi
lea    0xc97(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    13bb <processCommands+0x23b>
mov    -0x38(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1070 <strtok@plt>
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%edi
call   1050 <goBack@plt>
jmp    13c0 <processCommands+0x240>
jmp    13c5 <processCommands+0x245>
jmp    13ca <processCommands+0x24a>
jmp    13cf <processCommands+0x24f>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processCommands>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xe6b(%rip),%rsi
call   1070 <strtok@plt>
mov    %rax,%rbx
lea    0xe5f(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1240 <processCommands+0xc0>
lea    0xe4b(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1301 <processCommands+0x181>
lea    0xe38(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1345 <processCommands+0x1c5>
lea    0xe2b(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1370 <processCommands+0x1f0>
lea    0xe1f(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    12f2 <processCommands+0x172>
lea    0xde4(%rip),%rsi
xor    %edi,%edi
call   1070 <strtok@plt>
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %eax,%edi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <goBack@plt>
lea    0xdb9(%rip),%rbx
xor    %edi,%edi
mov    %rbx,%rsi
call   1070 <strtok@plt>
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %eax,0x14(%rsp)
xor    %edi,%edi
mov    %rbx,%rsi
call   1070 <strtok@plt>
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %eax,%r15d
xor    %edi,%edi
mov    %rbx,%rsi
call   1070 <strtok@plt>
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %eax,%r12d
xor    %edi,%edi
mov    %rbx,%rsi
call   1070 <strtok@plt>
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %eax,%r13d
xor    %edi,%edi
mov    %rbx,%rsi
call   1070 <strtok@plt>
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %eax,%ebp
xor    %edi,%edi
mov    %rbx,%rsi
call   1070 <strtok@plt>
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %eax,%r14d
xor    %edi,%edi
mov    %rbx,%rsi
call   1070 <strtok@plt>
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %eax,(%rsp)
mov    0x14(%rsp),%edi
mov    %r15d,%esi
mov    %r12d,%edx
mov    %r13d,%ecx
mov    %ebp,%r8d
mov    %r14d,%r9d
call   1060 <setGameTable@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xcf8(%rip),%rbx
xor    %edi,%edi
mov    %rbx,%rsi
call   1070 <strtok@plt>
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %eax,%ebp
xor    %edi,%edi
mov    %rbx,%rsi
call   1070 <strtok@plt>
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %ebp,%edi
mov    %eax,%esi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    10a0 <move@plt>
lea    0xcb4(%rip),%rsi
xor    %edi,%edi
call   1070 <strtok@plt>
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %eax,%edi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1090 <changeMode@plt>
lea    0xc89(%rip),%rbx
xor    %edi,%edi
mov    %rbx,%rsi
call   1070 <strtok@plt>
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %eax,%ebp
xor    %edi,%edi
mov    %rbx,%rsi
call   1070 <strtok@plt>
mov    %rax,%rdi
call   1080 <atoi@plt>
mov    %ebp,%edi
mov    %eax,%esi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <changeSpeed@plt>

LLVM IR (-O0):
@.str = [3 x i8] c" ,\00"
@.str.1 = [4 x i8] c"set\00"
@.str.2 = [5 x i8] c"move\00"
@.str.3 = [11 x i8] c"changemode\00"
@.str.4 = [12 x i8] c"changespeed\00"
@.str.5 = [7 x i8] c"goback\00"
define void @processCommands(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %12
%13 = load i8*, i8** %2
%14 = load i8*, i8** %12
%15 = call i8* @strtok(i8* %13, i8* %14)
store i8* %15, i8** %11
%16 = load i8*, i8** %11
%17 = call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %49
19: ; preds = %1
%20 = load i8*, i8** %12
%21 = call i8* @strtok(i8* null, i8* %20)
%22 = call i32 @atoi(i8* %21)
store i32 %22, i32* %3
%23 = load i8*, i8** %12
%24 = call i8* @strtok(i8* null, i8* %23)
%25 = call i32 @atoi(i8* %24)
store i32 %25, i32* %4
%26 = load i8*, i8** %12
%27 = call i8* @strtok(i8* null, i8* %26)
%28 = call i32 @atoi(i8* %27)
store i32 %28, i32* %5
%29 = load i8*, i8** %12
%30 = call i8* @strtok(i8* null, i8* %29)
%31 = call i32 @atoi(i8* %30)
store i32 %31, i32* %6
%32 = load i8*, i8** %12
%33 = call i8* @strtok(i8* null, i8* %32)
%34 = call i32 @atoi(i8* %33)
store i32 %34, i32* %7
%35 = load i8*, i8** %12
%36 = call i8* @strtok(i8* null, i8* %35)
%37 = call i32 @atoi(i8* %36)
store i32 %37, i32* %8
%38 = load i8*, i8** %12
%39 = call i8* @strtok(i8* null, i8* %38)
%40 = call i32 @atoi(i8* %39)
store i32 %40, i32* %9
%41 = load i32, i32* %3
%42 = load i32, i32* %4
%43 = load i32, i32* %5
%44 = load i32, i32* %6
%45 = load i32, i32* %7
%46 = load i32, i32* %8
%47 = load i32, i32* %9
%48 = call i32 @setGameTable(i32 %41, i32 %42, i32 %43, i32 %44, i32 %45, i32 %46, i32 %47)
br label %101
49: ; preds = %1
%50 = load i8*, i8** %11
%51 = call i64 @strcmp(i8* %50, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %63
53: ; preds = %49
%54 = load i8*, i8** %12
%55 = call i8* @strtok(i8* null, i8* %54)
%56 = call i32 @atoi(i8* %55)
store i32 %56, i32* %3
%57 = load i8*, i8** %12
%58 = call i8* @strtok(i8* null, i8* %57)
%59 = call i32 @atoi(i8* %58)
store i32 %59, i32* %4
%60 = load i32, i32* %3
%61 = load i32, i32* %4
%62 = call i32 @move(i32 %60, i32 %61)
br label %100
63: ; preds = %49
%64 = load i8*, i8** %11
%65 = call i64 @strcmp(i8* %64, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%66 = icmp eq i64 %65, 0
br i1 %66, label %67, label %73
67: ; preds = %63
%68 = load i8*, i8** %12
%69 = call i8* @strtok(i8* null, i8* %68)
%70 = call i32 @atoi(i8* %69)
store i32 %70, i32* %9
%71 = load i32, i32* %9
%72 = call i32 @changeMode(i32 %71)
br label %99
73: ; preds = %63
%74 = load i8*, i8** %11
%75 = call i64 @strcmp(i8* %74, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%76 = icmp eq i64 %75, 0
br i1 %76, label %77, label %87
77: ; preds = %73
%78 = load i8*, i8** %12
%79 = call i8* @strtok(i8* null, i8* %78)
%80 = call i32 @atoi(i8* %79)
store i32 %80, i32* %7
%81 = load i8*, i8** %12
%82 = call i8* @strtok(i8* null, i8* %81)
%83 = call i32 @atoi(i8* %82)
store i32 %83, i32* %8
%84 = load i32, i32* %7
%85 = load i32, i32* %8
%86 = call i32 @changeSpeed(i32 %84, i32 %85)
br label %98
87: ; preds = %73
%88 = load i8*, i8** %11
%89 = call i64 @strcmp(i8* %88, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%90 = icmp eq i64 %89, 0
br i1 %90, label %91, label %97
91: ; preds = %87
%92 = load i8*, i8** %12
%93 = call i8* @strtok(i8* null, i8* %92)
%94 = call i32 @atoi(i8* %93)
store i32 %94, i32* %10
%95 = load i32, i32* %10
%96 = call i32 @goBack(i32 %95)
br label %97
97: ; preds = %91, %87
br label %98
98: ; preds = %97, %77
br label %99
99: ; preds = %98, %67
br label %100
100: ; preds = %99, %53
br label %101
101: ; preds = %100, %19
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c" ,\00"
@.str.1 = [4 x i8] c"set\00"
@.str.2 = [5 x i8] c"move\00"
@.str.3 = [11 x i8] c"changemode\00"
@.str.4 = [12 x i8] c"changespeed\00"
@.str.5 = [7 x i8] c"goback\00"
define void @processCommands(i8* %0) {
%2 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %21
5: ; preds = %1
%6 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @atoi(i8* %6)
%8 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @atoi(i8* %8)
%10 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 @atoi(i8* %10)
%12 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%13 = tail call i32 @atoi(i8* %12)
%14 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%15 = tail call i32 @atoi(i8* %14)
%16 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%17 = tail call i32 @atoi(i8* %16)
%18 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%19 = tail call i32 @atoi(i8* %18)
%20 = tail call i32 @setGameTable(i32 %7, i32 %9, i32 %11, i32 %13, i32 %15, i32 %17, i32 %19)
br label %53
21: ; preds = %1
%22 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %30
24: ; preds = %21
%25 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%26 = tail call i32 @atoi(i8* %25)
%27 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%28 = tail call i32 @atoi(i8* %27)
%29 = tail call i32 @move(i32 %26, i32 %28)
br label %53
30: ; preds = %21
%31 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %37
33: ; preds = %30
%34 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%35 = tail call i32 @atoi(i8* %34)
%36 = tail call i32 @changeMode(i32 %35)
br label %53
37: ; preds = %30
%38 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %46
40: ; preds = %37
%41 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%42 = tail call i32 @atoi(i8* %41)
%43 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%44 = tail call i32 @atoi(i8* %43)
%45 = tail call i32 @changeSpeed(i32 %42, i32 %44)
br label %53
46: ; preds = %37
%47 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %53
49: ; preds = %46
%50 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%51 = tail call i32 @atoi(i8* %50)
%52 = tail call i32 @goBack(i32 %51)
br label %53
53: ; preds = %24, %40, %49, %46, %33, %5
ret void
}