#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 executeCdCommand(char *);
int executeCpCommand(char *, char *);
int executeExitCommand();
int executeLsCommand();
int executeLsMinusLCommand();
int executeMkdirCommand(char *);
int executePwdCommand();
int executeRmdirCommand(char *);
int /*<<< orphan*/ printArgumentError();
int /*<<< orphan*/ strlen(char *);
scalar_t__ strncmp(char *, char *, int /*<<< orphan*/);
char *strtok(char *, char *);
int processBuiltInCommand(char *cmd, int *comm) {
  if (strncmp(cmd, "exit", strlen("exit")) == 0) {
    char *arg0 = strtok(cmd, " ");
    char *arg1 = strtok(NULL, " ");
    if (arg1 != NULL) {
      printArgumentError();
      return -1;
    }
    return executeExitCommand();
  } else if (strncmp(cmd, "pwd", strlen("pwd")) == 0) {
    char *arg0 = strtok(cmd, " ");
    char *arg1 = strtok(NULL, " ");
    if (arg1 != NULL) {
      printArgumentError();
      return -1;
    }
    return executePwdCommand();
  } else if (strncmp(cmd, "ls", strlen("ls")) == 0) {
    char *arg0 = strtok(cmd, " ");
    char *arg1 = strtok(NULL, " ");
    char *arg2 = strtok(NULL, " ");
    if (arg1 != NULL) {
      if (strncmp(arg1, "-l", strlen("-l")) == 0) {
        return executeLsMinusLCommand();
      }
      printArgumentError();
      return -1;
    }
    return executeLsCommand();
  } else if (strncmp(cmd, "cd", strlen("cd")) == 0) {
    char *arg0 = strtok(cmd, " ");
    char *arg1 = strtok(NULL, " ");
    char *arg2 = strtok(NULL, " ");
    if (arg2 != NULL || arg1 == NULL) {
      printArgumentError();
      return -1;
    }
    return executeCdCommand(arg1);
  } else if (strncmp(cmd, "cp", strlen("cp")) == 0) {
    char *arg0 = strtok(cmd, " ");
    char *arg1 = strtok(NULL, " ");
    char *arg2 = strtok(NULL, " ");
    char *arg3 = strtok(NULL, " ");
    if (arg3 != NULL) {
      printArgumentError();
      return -1;
    }
    return executeCpCommand(arg1, arg2);
  } else if (strncmp(cmd, "mkdir", strlen("mkdir")) == 0) {
    char *arg0 = strtok(cmd, " ");
    char *arg1 = strtok(NULL, " ");
    char *arg2 = strtok(NULL, " ");
    if (arg2 != NULL) {
      printArgumentError();
      return -1;
    }
    return executeMkdirCommand(arg1);
  } else if (strncmp(cmd, "rmdir", strlen("rmdir")) == 0) {
    char *arg0 = strtok(cmd, " ");
    char *arg1 = strtok(NULL, " ");
    char *arg2 = strtok(NULL, " ");
    if (arg2 != NULL) {
      printArgumentError();
      return -1;
    }
    return executeRmdirCommand(arg1);
  } else
    return -2;
  return 0;
}


x86 assembly (clang, -O0):
<processBuiltInCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0xc0(%rbp)
lea    0xe1b(%rip),%rdi
call   1060 <strlen@plt>
mov    -0xc0(%rbp),%rdi
mov    %eax,%edx
lea    0xe06(%rip),%rsi
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    125e <processBuiltInCommand+0x9e>
mov    -0x10(%rbp),%rdi
lea    0xdf1(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xddd(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     124f <processBuiltInCommand+0x8f>
mov    $0x0,%al
call   10b0 <printArgumentError@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    169f <processBuiltInCommand+0x4df>
mov    $0x0,%al
call   1070 <executeExitCommand@plt>
mov    %eax,-0x4(%rbp)
jmp    169f <processBuiltInCommand+0x4df>
mov    -0x10(%rbp),%rax
mov    %rax,-0xc8(%rbp)
lea    0xd97(%rip),%rdi
call   1060 <strlen@plt>
mov    -0xc8(%rbp),%rdi
mov    %eax,%edx
lea    0xd82(%rip),%rsi
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    12e9 <processBuiltInCommand+0x129>
mov    -0x10(%rbp),%rdi
lea    0xd66(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0x30(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xd52(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     12da <processBuiltInCommand+0x11a>
mov    $0x0,%al
call   10b0 <printArgumentError@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    169f <processBuiltInCommand+0x4df>
mov    $0x0,%al
call   1080 <executePwdCommand@plt>
mov    %eax,-0x4(%rbp)
jmp    169f <processBuiltInCommand+0x4df>
mov    -0x10(%rbp),%rax
mov    %rax,-0xd0(%rbp)
lea    0xd10(%rip),%rdi
call   1060 <strlen@plt>
mov    -0xd0(%rbp),%rdi
mov    %eax,%edx
lea    0xcfb(%rip),%rsi
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    13cd <processBuiltInCommand+0x20d>
mov    -0x10(%rbp),%rdi
lea    0xcdb(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0x40(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xcc7(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0x48(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xcb3(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x48(%rbp)
je     13be <processBuiltInCommand+0x1fe>
mov    -0x48(%rbp),%rax
mov    %rax,-0xd8(%rbp)
lea    0xc96(%rip),%rdi
call   1060 <strlen@plt>
mov    -0xd8(%rbp),%rdi
mov    %eax,%edx
lea    0xc81(%rip),%rsi
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    13ab <processBuiltInCommand+0x1eb>
mov    $0x0,%al
call   10d0 <executeLsMinusLCommand@plt>
mov    %eax,-0x4(%rbp)
jmp    169f <processBuiltInCommand+0x4df>
mov    $0x0,%al
call   10b0 <printArgumentError@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    169f <processBuiltInCommand+0x4df>
mov    $0x0,%al
call   10a0 <executeLsCommand@plt>
mov    %eax,-0x4(%rbp)
jmp    169f <processBuiltInCommand+0x4df>
mov    -0x10(%rbp),%rax
mov    %rax,-0xe0(%rbp)
lea    0xc32(%rip),%rdi
call   1060 <strlen@plt>
mov    -0xe0(%rbp),%rdi
mov    %eax,%edx
lea    0xc1d(%rip),%rsi
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1479 <processBuiltInCommand+0x2b9>
mov    -0x10(%rbp),%rdi
lea    0xbf7(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0x58(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xbe3(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0x60(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xbcf(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0x68(%rbp)
cmpq   $0x0,-0x68(%rbp)
jne    1455 <processBuiltInCommand+0x295>
cmpq   $0x0,-0x60(%rbp)
jne    1468 <processBuiltInCommand+0x2a8>
mov    $0x0,%al
call   10b0 <printArgumentError@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    169f <processBuiltInCommand+0x4df>
mov    -0x60(%rbp),%rdi
call   1030 <executeCdCommand@plt>
mov    %eax,-0x4(%rbp)
jmp    169f <processBuiltInCommand+0x4df>
mov    -0x10(%rbp),%rax
mov    %rax,-0xe8(%rbp)
lea    0xb89(%rip),%rdi
call   1060 <strlen@plt>
mov    -0xe8(%rbp),%rdi
mov    %eax,%edx
lea    0xb74(%rip),%rsi
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1538 <processBuiltInCommand+0x378>
mov    -0x10(%rbp),%rdi
lea    0xb4b(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0x70(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xb37(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0x78(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xb23(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0x80(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xb0f(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0x88(%rbp)
cmpq   $0x0,-0x88(%rbp)
je     1523 <processBuiltInCommand+0x363>
mov    $0x0,%al
call   10b0 <printArgumentError@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    169f <processBuiltInCommand+0x4df>
mov    -0x78(%rbp),%rdi
mov    -0x80(%rbp),%rsi
call   10e0 <executeCpCommand@plt>
mov    %eax,-0x4(%rbp)
jmp    169f <processBuiltInCommand+0x4df>
mov    -0x10(%rbp),%rax
mov    %rax,-0xf0(%rbp)
lea    0xacd(%rip),%rdi
call   1060 <strlen@plt>
mov    -0xf0(%rbp),%rdi
mov    %eax,%edx
lea    0xab8(%rip),%rsi
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    15e8 <processBuiltInCommand+0x428>
mov    -0x10(%rbp),%rdi
lea    0xa8c(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0x90(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xa75(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0x98(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xa5e(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0xa0(%rbp)
cmpq   $0x0,-0xa0(%rbp)
je     15d4 <processBuiltInCommand+0x414>
mov    $0x0,%al
call   10b0 <printArgumentError@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    169f <processBuiltInCommand+0x4df>
mov    -0x98(%rbp),%rdi
call   1050 <executeMkdirCommand@plt>
mov    %eax,-0x4(%rbp)
jmp    169f <processBuiltInCommand+0x4df>
mov    -0x10(%rbp),%rax
mov    %rax,-0xf8(%rbp)
lea    0xa23(%rip),%rdi
call   1060 <strlen@plt>
mov    -0xf8(%rbp),%rdi
mov    %eax,%edx
lea    0xa0e(%rip),%rsi
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1698 <processBuiltInCommand+0x4d8>
mov    -0x10(%rbp),%rdi
lea    0x9dc(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0xa8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0x9c5(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0xb0(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0x9ae(%rip),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0xb8(%rbp)
cmpq   $0x0,-0xb8(%rbp)
je     1684 <processBuiltInCommand+0x4c4>
mov    $0x0,%al
call   10b0 <printArgumentError@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    169f <processBuiltInCommand+0x4df>
mov    -0xb0(%rbp),%rdi
call   1090 <executeRmdirCommand@plt>
mov    %eax,-0x4(%rbp)
jmp    169f <processBuiltInCommand+0x4df>
movl   $0xfffffffe,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processBuiltInCommand>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
lea    0xe31(%rip),%rbx
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1312 <processBuiltInCommand+0x152>
lea    0xe13(%rip),%rbx
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1343 <processBuiltInCommand+0x183>
lea    0xdf2(%rip),%rbx
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1374 <processBuiltInCommand+0x1b4>
lea    0xdd3(%rip),%rbx
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     13d7 <processBuiltInCommand+0x217>
lea    0xdb1(%rip),%rbx
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     141f <processBuiltInCommand+0x25f>
lea    0xd8f(%rip),%rbx
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1476 <processBuiltInCommand+0x2b6>
lea    0xd70(%rip),%rbx
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <strncmp@plt>
mov    %rax,%rcx
mov    $0xfffffffe,%eax
test   %rcx,%rcx
jne    14b0 <processBuiltInCommand+0x2f0>
lea    0xd2b(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   10c0 <strtok@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   10c0 <strtok@plt>
mov    %rax,%r14
xor    %edi,%edi
mov    %rbx,%rsi
call   10c0 <strtok@plt>
test   %rax,%rax
jne    14a4 <processBuiltInCommand+0x2e4>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1090 <executeRmdirCommand@plt>
lea    0xcec(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   10c0 <strtok@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   10c0 <strtok@plt>
test   %rax,%rax
jne    14a4 <processBuiltInCommand+0x2e4>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1070 <executeExitCommand@plt>
lea    0xcbb(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   10c0 <strtok@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   10c0 <strtok@plt>
test   %rax,%rax
jne    14a4 <processBuiltInCommand+0x2e4>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1080 <executePwdCommand@plt>
lea    0xc8a(%rip),%r15
mov    %r14,%rdi
mov    %r15,%rsi
call   10c0 <strtok@plt>
xor    %edi,%edi
mov    %r15,%rsi
call   10c0 <strtok@plt>
mov    %rax,%rbx
xor    %edi,%edi
mov    %r15,%rsi
call   10c0 <strtok@plt>
test   %rbx,%rbx
je     146a <processBuiltInCommand+0x2aa>
lea    0xc61(%rip),%r14
mov    %r14,%rdi
call   1060 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
jne    14a4 <processBuiltInCommand+0x2e4>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    10d0 <executeLsMinusLCommand@plt>
lea    0xc27(%rip),%r15
mov    %r14,%rdi
mov    %r15,%rsi
call   10c0 <strtok@plt>
xor    %edi,%edi
mov    %r15,%rsi
call   10c0 <strtok@plt>
mov    %rax,%rbx
xor    %edi,%edi
mov    %r15,%rsi
call   10c0 <strtok@plt>
test   %rax,%rax
jne    14a4 <processBuiltInCommand+0x2e4>
test   %rbx,%rbx
je     14a4 <processBuiltInCommand+0x2e4>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <executeCdCommand@plt>
lea    0xbdf(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   10c0 <strtok@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   10c0 <strtok@plt>
mov    %rax,%r14
xor    %edi,%edi
mov    %rbx,%rsi
call   10c0 <strtok@plt>
mov    %rax,%r15
xor    %edi,%edi
mov    %rbx,%rsi
call   10c0 <strtok@plt>
test   %rax,%rax
jne    14a4 <processBuiltInCommand+0x2e4>
mov    %r14,%rdi
mov    %r15,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    10e0 <executeCpCommand@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    10a0 <executeLsCommand@plt>
lea    0xb88(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   10c0 <strtok@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   10c0 <strtok@plt>
mov    %rax,%r14
xor    %edi,%edi
mov    %rbx,%rsi
call   10c0 <strtok@plt>
test   %rax,%rax
je     14b6 <processBuiltInCommand+0x2f6>
xor    %eax,%eax
call   10b0 <printArgumentError@plt>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <executeMkdirCommand@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"exit\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [4 x i8] c"pwd\00"
@.str.3 = [3 x i8] c"ls\00"
@.str.4 = [3 x i8] c"-l\00"
@.str.5 = [3 x i8] c"cd\00"
@.str.6 = [3 x i8] c"cp\00"
@.str.7 = [6 x i8] c"mkdir\00"
@.str.8 = [6 x i8] c"rmdir\00"
define i32 @processBuiltInCommand(i8* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca i8*
%20 = alloca i8*
%21 = alloca i8*
%22 = alloca i8*
%23 = alloca i8*
%24 = alloca i8*
%25 = alloca i8*
store i8* %0, i8** %4
store i32* %1, i32** %5
%26 = load i8*, i8** %4
%27 = call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%28 = call i64 @strncmp(i8* %26, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %27)
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %40
30: ; preds = %2
%31 = load i8*, i8** %4
%32 = call i8* @strtok(i8* %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %32, i8** %6
%33 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %33, i8** %7
%34 = load i8*, i8** %7
%35 = icmp ne i8* %34, null
br i1 %35, label %36, label %38
36: ; preds = %30
%37 = call i32 (...) @printArgumentError()
store i32 -1, i32* %3
br label %152
38: ; preds = %30
%39 = call i32 (...) @executeExitCommand()
store i32 %39, i32* %3
br label %152
40: ; preds = %2
%41 = load i8*, i8** %4
%42 = call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%43 = call i64 @strncmp(i8* %41, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %42)
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %55
45: ; preds = %40
%46 = load i8*, i8** %4
%47 = call i8* @strtok(i8* %46, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %47, i8** %8
%48 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %48, i8** %9
%49 = load i8*, i8** %9
%50 = icmp ne i8* %49, null
br i1 %50, label %51, label %53
51: ; preds = %45
%52 = call i32 (...) @printArgumentError()
store i32 -1, i32* %3
br label %152
53: ; preds = %45
%54 = call i32 (...) @executePwdCommand()
store i32 %54, i32* %3
br label %152
55: ; preds = %40
%56 = load i8*, i8** %4
%57 = call i32 @strlen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%58 = call i64 @strncmp(i8* %56, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %57)
%59 = icmp eq i64 %58, 0
br i1 %59, label %60, label %78
60: ; preds = %55
%61 = load i8*, i8** %4
%62 = call i8* @strtok(i8* %61, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %62, i8** %10
%63 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %63, i8** %11
%64 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %64, i8** %12
%65 = load i8*, i8** %11
%66 = icmp ne i8* %65, null
br i1 %66, label %67, label %76
67: ; preds = %60
%68 = load i8*, i8** %11
%69 = call i32 @strlen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%70 = call i64 @strncmp(i8* %68, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %69)
%71 = icmp eq i64 %70, 0
br i1 %71, label %72, label %74
72: ; preds = %67
%73 = call i32 (...) @executeLsMinusLCommand()
store i32 %73, i32* %3
br label %152
74: ; preds = %67
%75 = call i32 (...) @printArgumentError()
store i32 -1, i32* %3
br label %152
76: ; preds = %60
%77 = call i32 (...) @executeLsCommand()
store i32 %77, i32* %3
br label %152
78: ; preds = %55
%79 = load i8*, i8** %4
%80 = call i32 @strlen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%81 = call i64 @strncmp(i8* %79, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %80)
%82 = icmp eq i64 %81, 0
br i1 %82, label %83, label %98
83: ; preds = %78
%84 = load i8*, i8** %4
%85 = call i8* @strtok(i8* %84, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %85, i8** %13
%86 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %86, i8** %14
%87 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %87, i8** %15
%88 = load i8*, i8** %15
%89 = icmp ne i8* %88, null
br i1 %89, label %93, label %90
90: ; preds = %83
%91 = load i8*, i8** %14
%92 = icmp eq i8* %91, null
br i1 %92, label %93, label %95
93: ; preds = %90, %83
%94 = call i32 (...) @printArgumentError()
store i32 -1, i32* %3
br label %152
95: ; preds = %90
%96 = load i8*, i8** %14
%97 = call i32 @executeCdCommand(i8* %96)
store i32 %97, i32* %3
br label %152
98: ; preds = %78
%99 = load i8*, i8** %4
%100 = call i32 @strlen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%101 = call i64 @strncmp(i8* %99, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 %100)
%102 = icmp eq i64 %101, 0
br i1 %102, label %103, label %117
103: ; preds = %98
%104 = load i8*, i8** %4
%105 = call i8* @strtok(i8* %104, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %105, i8** %16
%106 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %106, i8** %17
%107 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %107, i8** %18
%108 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %108, i8** %19
%109 = load i8*, i8** %19
%110 = icmp ne i8* %109, null
br i1 %110, label %111, label %113
111: ; preds = %103
%112 = call i32 (...) @printArgumentError()
store i32 -1, i32* %3
br label %152
113: ; preds = %103
%114 = load i8*, i8** %17
%115 = load i8*, i8** %18
%116 = call i32 @executeCpCommand(i8* %114, i8* %115)
store i32 %116, i32* %3
br label %152
117: ; preds = %98
%118 = load i8*, i8** %4
%119 = call i32 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%120 = call i64 @strncmp(i8* %118, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 %119)
%121 = icmp eq i64 %120, 0
br i1 %121, label %122, label %134
122: ; preds = %117
%123 = load i8*, i8** %4
%124 = call i8* @strtok(i8* %123, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %124, i8** %20
%125 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %125, i8** %21
%126 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %126, i8** %22
%127 = load i8*, i8** %22
%128 = icmp ne i8* %127, null
br i1 %128, label %129, label %131
129: ; preds = %122
%130 = call i32 (...) @printArgumentError()
store i32 -1, i32* %3
br label %152
131: ; preds = %122
%132 = load i8*, i8** %21
%133 = call i32 @executeMkdirCommand(i8* %132)
store i32 %133, i32* %3
br label %152
134: ; preds = %117
%135 = load i8*, i8** %4
%136 = call i32 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%137 = call i64 @strncmp(i8* %135, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i32 %136)
%138 = icmp eq i64 %137, 0
br i1 %138, label %139, label %151
139: ; preds = %134
%140 = load i8*, i8** %4
%141 = call i8* @strtok(i8* %140, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %141, i8** %23
%142 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %142, i8** %24
%143 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %143, i8** %25
%144 = load i8*, i8** %25
%145 = icmp ne i8* %144, null
br i1 %145, label %146, label %148
146: ; preds = %139
%147 = call i32 (...) @printArgumentError()
store i32 -1, i32* %3
br label %152
148: ; preds = %139
%149 = load i8*, i8** %24
%150 = call i32 @executeRmdirCommand(i8* %149)
store i32 %150, i32* %3
br label %152
151: ; preds = %134
store i32 -2, i32* %3
br label %152
152: ; preds = %151, %148, %146, %131, %129, %113, %111, %95, %93, %76, %74, %72, %53, %51, %38, %36
%153 = load i32, i32* %3
ret i32 %153
}

LLVM IR (-O2):
@.str = [5 x i8] c"exit\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [4 x i8] c"pwd\00"
@.str.3 = [3 x i8] c"ls\00"
@.str.4 = [3 x i8] c"-l\00"
@.str.5 = [3 x i8] c"cd\00"
@.str.6 = [3 x i8] c"cp\00"
@.str.7 = [6 x i8] c"mkdir\00"
@.str.8 = [6 x i8] c"rmdir\00"
define i32 @processBuiltInCommand(i8* %0, i32* nocapture readnone %1) {
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %2
%7 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i8* %8, null
br i1 %9, label %12, label %10
10: ; preds = %6
%11 = tail call i32 (...) @printArgumentError()
br label %100
12: ; preds = %6
%13 = tail call i32 (...) @executeExitCommand()
br label %100
14: ; preds = %2
%15 = tail call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%16 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %15)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %26
18: ; preds = %14
%19 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%20 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%21 = icmp eq i8* %20, null
br i1 %21, label %24, label %22
22: ; preds = %18
%23 = tail call i32 (...) @printArgumentError()
br label %100
24: ; preds = %18
%25 = tail call i32 (...) @executePwdCommand()
br label %100
26: ; preds = %14
%27 = tail call i32 @strlen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%28 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %27)
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %45
30: ; preds = %26
%31 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%32 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%33 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%34 = icmp eq i8* %32, null
br i1 %34, label %43, label %35
35: ; preds = %30
%36 = tail call i32 @strlen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%37 = tail call i64 @strncmp(i8* %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %36)
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %35
%40 = tail call i32 (...) @executeLsMinusLCommand()
br label %100
41: ; preds = %35
%42 = tail call i32 (...) @printArgumentError()
br label %100
43: ; preds = %30
%44 = tail call i32 (...) @executeLsCommand()
br label %100
45: ; preds = %26
%46 = tail call i32 @strlen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%47 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %46)
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %60
49: ; preds = %45
%50 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%51 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%52 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%53 = icmp ne i8* %52, null
%54 = icmp eq i8* %51, null
%55 = select i1 %53, i1 true, i1 %54
br i1 %55, label %56, label %58
56: ; preds = %49
%57 = tail call i32 (...) @printArgumentError()
br label %100
58: ; preds = %49
%59 = tail call i32 @executeCdCommand(i8* %51)
br label %100
60: ; preds = %45
%61 = tail call i32 @strlen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%62 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 %61)
%63 = icmp eq i64 %62, 0
br i1 %63, label %64, label %74
64: ; preds = %60
%65 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%66 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%67 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%68 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%69 = icmp eq i8* %68, null
br i1 %69, label %72, label %70
70: ; preds = %64
%71 = tail call i32 (...) @printArgumentError()
br label %100
72: ; preds = %64
%73 = tail call i32 @executeCpCommand(i8* %66, i8* %67)
br label %100
74: ; preds = %60
%75 = tail call i32 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%76 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 %75)
%77 = icmp eq i64 %76, 0
br i1 %77, label %78, label %87
78: ; preds = %74
%79 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%80 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%81 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%82 = icmp eq i8* %81, null
br i1 %82, label %85, label %83
83: ; preds = %78
%84 = tail call i32 (...) @printArgumentError()
br label %100
85: ; preds = %78
%86 = tail call i32 @executeMkdirCommand(i8* %80)
br label %100
87: ; preds = %74
%88 = tail call i32 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%89 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i32 %88)
%90 = icmp eq i64 %89, 0
br i1 %90, label %91, label %100
91: ; preds = %87
%92 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%93 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%94 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%95 = icmp eq i8* %94, null
br i1 %95, label %98, label %96
96: ; preds = %91
%97 = tail call i32 (...) @printArgumentError()
br label %100
98: ; preds = %91
%99 = tail call i32 @executeRmdirCommand(i8* %93)
br label %100
100: ; preds = %87, %96, %98, %83, %85, %70, %72, %56, %58, %39, %41, %43, %22, %24, %10, %12
%101 = phi i32 [ -1, %10 ], [ %13, %12 ], [ -1, %22 ], [ %25, %24 ], [ %40, %39 ], [ -1, %41 ], [ %44, %43 ], [ -1, %56 ], [ %59, %58 ], [ -1, %70 ], [ %73, %72 ], [ -1, %83 ], [ %86, %85 ], [ -1, %96 ], [ %99, %98 ], [ -2, %87 ]
ret i32 %101
}