#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 *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *strtok(char *, char *);
void parseTheInput(char *inBuf, char *command, char *fileName, int fileSize) {
  char *test;
  char *size;
  test = strtok(inBuf, " ");
  command = test;
  test = strtok(NULL, " ");
  fileName = test;
  if (strcmp(command, "READ") == 0) {
    return;
  }
  test = strtok(NULL, " ");
  size = test;
  test = strtok(NULL, " ");
  strcpy(inBuf, test);
  fileSize = atoi(size);
}


x86 assembly (clang, -O0):
<parseTheInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe9e(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xe82(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe68(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11ae <parseTheInput+0x6e>
jmp    11f7 <parseTheInput+0xb7>
xor    %eax,%eax
mov    %eax,%edi
lea    0xe47(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xe2b(%rip),%rsi
call   1050 <strtok@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x30(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x1c(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseTheInput>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
lea    0xec1(%rip),%r15
mov    %r15,%rsi
call   1050 <strtok@plt>
mov    %rax,%rbx
xor    %edi,%edi
mov    %r15,%rsi
call   1050 <strtok@plt>
lea    0xea7(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1193 <parseTheInput+0x63>
lea    0xe91(%rip),%rbx
xor    %edi,%edi
mov    %rbx,%rsi
call   1050 <strtok@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1050 <strtok@plt>
mov    %r14,%rdi
mov    %rax,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <strcpy@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [5 x i8] c"READ\00"
define void @parseTheInput(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%11 = load i8*, i8** %5
%12 = call i8* @strtok(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %12, i8** %9
%13 = load i8*, i8** %9
store i8* %13, i8** %6
%14 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %14, i8** %9
%15 = load i8*, i8** %9
store i8* %15, i8** %7
%16 = load i8*, i8** %6
%17 = call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %4
br label %29
20: ; preds = %4
%21 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %21, i8** %9
%22 = load i8*, i8** %9
store i8* %22, i8** %10
%23 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %23, i8** %9
%24 = load i8*, i8** %5
%25 = load i8*, i8** %9
%26 = call i32 @strcpy(i8* %24, i8* %25)
%27 = load i8*, i8** %10
%28 = call i32 @atoi(i8* %27)
store i32 %28, i32* %8
br label %29
29: ; preds = %20, %19
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [5 x i8] c"READ\00"
define void @parseTheInput(i8* %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
%5 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = tail call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = tail call i32 @strcpy(i8* %0, i8* %11)
br label %13
13: ; preds = %4, %9
ret void
}