#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 */
typedef scalar_t__ pid_t;
typedef int /*<<< orphan*/ command;

/* Variables and functions */
scalar_t__ chdir(char *);
int /*<<< orphan*/ execvp(char *, char **);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
scalar_t__ fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
char *getenv(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *strtok(char *, char *);
int /*<<< orphan*/ typePrompt();
int /*<<< orphan*/ waitpid(int, int *, int /*<<< orphan*/);
int main() {
  char command[255];
  while (1) {
    typePrompt();
    fgets(command, sizeof(command), stdin);
    command[strlen(command) - 1] = '\0';
    if (strcmp(command, "exit") == 0)
      exit(0);
    char *token;
    char tokenCommand[255];
    strcpy(tokenCommand, command);
    int argCount = 0;
    for (token = strtok(tokenCommand, " "); token != NULL;
         token = strtok(NULL, " "))
      argCount++;
    char **arg_list = (char **)malloc((argCount + 1) * sizeof(char *));
    int i = 0;
    strcpy(tokenCommand, command);
    for (token = strtok(tokenCommand, " "); token != NULL;
         token = strtok(NULL, " ")) {
      arg_list[i] = (char *)malloc(255 * sizeof(char));
      strcpy(arg_list[i], token);
      i++;
    }
    arg_list[i] = NULL;
    if (strcmp(arg_list[0], "cd") == 0) {
      if (argCount == 1) {
        char homeDir[50] = "";
        strcpy(homeDir, getenv("HOME"));
        arg_list[1] = (char *)malloc(255 * sizeof(char));
        strcpy(arg_list[1], homeDir);
      }
      if (chdir(arg_list[1]) != 0)
        fprintf(stderr, "cd: '%s' file or directory not found\n", arg_list[1]);
      continue;
    }
    pid_t child_pid = fork();
    if (child_pid < 0) {
      fprintf(stderr, "Unexpected error\n");
      continue;
    }
    int status;
    if (child_pid != 0) {
      waitpid(-1, &status, 0);
    } else {
      execvp(arg_list[0], arg_list);
      fprintf(stderr, "Command '%s' not found\n", arg_list[0]);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x290,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <typePrompt@plt>
lea    -0x110(%rbp),%rdi
mov    0x2dd1(%rip),%rax
mov    (%rax),%edx
mov    $0xff,%esi
call   1090 <fgets@plt>
lea    -0x110(%rbp),%rdi
call   1060 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0x110(%rbp,%rax,1)
lea    -0x110(%rbp),%rdi
lea    0xdb6(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1260 <main+0x70>
xor    %edi,%edi
call   1100 <exit@plt>
lea    -0x220(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1050 <strcpy@plt>
movl   $0x0,-0x224(%rbp)
lea    -0x220(%rbp),%rdi
lea    0xd7a(%rip),%rsi
call   10e0 <strtok@plt>
mov    %rax,-0x118(%rbp)
cmpq   $0x0,-0x118(%rbp)
je     12d0 <main+0xe0>
mov    -0x224(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x224(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xd46(%rip),%rsi
call   10e0 <strtok@plt>
mov    %rax,-0x118(%rbp)
jmp    1297 <main+0xa7>
mov    -0x224(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x230(%rbp)
movl   $0x0,-0x234(%rbp)
lea    -0x220(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1050 <strcpy@plt>
lea    -0x220(%rbp),%rdi
lea    0xced(%rip),%rsi
call   10e0 <strtok@plt>
mov    %rax,-0x118(%rbp)
cmpq   $0x0,-0x118(%rbp)
je     139a <main+0x1aa>
mov    $0xff,%edi
call   10c0 <malloc@plt>
mov    %rax,%rdx
mov    -0x230(%rbp),%rax
movslq -0x234(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x230(%rbp),%rax
movslq -0x234(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x118(%rbp),%rsi
call   1050 <strcpy@plt>
mov    -0x234(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x234(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xc7c(%rip),%rsi
call   10e0 <strtok@plt>
mov    %rax,-0x118(%rbp)
jmp    1324 <main+0x134>
mov    -0x230(%rbp),%rax
movslq -0x234(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x230(%rbp),%rax
mov    (%rax),%rdi
lea    0xc46(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1489 <main+0x299>
cmpl   $0x1,-0x224(%rbp)
jne    1448 <main+0x258>
lea    -0x270(%rbp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   1080 <memset@plt>
lea    -0x270(%rbp),%rax
mov    %rax,-0x288(%rbp)
lea    0xc05(%rip),%rdi
call   1030 <getenv@plt>
mov    -0x288(%rbp),%rdi
mov    %rax,%rsi
call   1050 <strcpy@plt>
mov    $0xff,%edi
call   10c0 <malloc@plt>
mov    %rax,%rcx
mov    -0x230(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x230(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x270(%rbp),%rsi
call   1050 <strcpy@plt>
mov    -0x230(%rbp),%rax
mov    0x8(%rax),%rdi
call   1070 <chdir@plt>
cmp    $0x0,%rax
je     1484 <main+0x294>
mov    0x2b6f(%rip),%rax
mov    (%rax),%edi
mov    -0x230(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xb92(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
jmp    1202 <main+0x12>
mov    $0x0,%al
call   1110 <fork@plt>
mov    %rax,-0x278(%rbp)
cmpq   $0x0,-0x278(%rbp)
jge    14c1 <main+0x2d1>
mov    0x2b2c(%rip),%rax
mov    (%rax),%edi
lea    0xb80(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
jmp    1202 <main+0x12>
cmpq   $0x0,-0x278(%rbp)
je     14e7 <main+0x2f7>
mov    $0xffffffff,%edi
lea    -0x27c(%rbp),%rsi
xor    %edx,%edx
call   10d0 <waitpid@plt>
jmp    151e <main+0x32e>
mov    -0x230(%rbp),%rax
mov    (%rax),%rdi
mov    -0x230(%rbp),%rsi
call   10f0 <execvp@plt>
mov    0x2ad4(%rip),%rax
mov    (%rax),%edi
mov    -0x230(%rbp),%rax
mov    (%rax),%rdx
lea    0xb30(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
jmp    1202 <main+0x12>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x248,%rsp
lea    0x140(%rsp),%r12
lea    0x40(%rsp),%r14
lea    0xe00(%rip),%rbx
jmp    122c <main+0x4c>
nopw   0x0(%rax,%rax,1)
mov    0x2dc1(%rip),%rax
mov    (%rax),%edi
lea    0xe15(%rip),%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
lea    0x40(%rsp),%r14
xor    %eax,%eax
call   1040 <typePrompt@plt>
mov    0x2dae(%rip),%rax
mov    (%rax),%edx
mov    %r12,%rdi
mov    $0xff,%esi
call   1080 <fgets@plt>
mov    %r12,%rdi
call   1060 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%r12,1)
mov    %r12,%rdi
lea    0xd9d(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     142a <main+0x24a>
mov    %r14,%rdi
mov    %r12,%rsi
call   1050 <strcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   10d0 <strtok@plt>
xor    %r13d,%r13d
test   %rax,%rax
je     12a3 <main+0xc3>
nop
add    $0x1,%r13d
xor    %edi,%edi
mov    %rbx,%rsi
call   10d0 <strtok@plt>
test   %rax,%rax
jne    1290 <main+0xb0>
lea    0x8(,%r13,8),%edi
call   10b0 <malloc@plt>
mov    %rax,%rbp
mov    %r14,%rdi
mov    %r12,%rsi
call   1050 <strcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   10d0 <strtok@plt>
test   %rax,%rax
je     1320 <main+0x140>
mov    %rax,%r14
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0xff,%edi
call   10b0 <malloc@plt>
mov    %rax,0x0(%rbp,%r15,8)
mov    %rax,%rdi
mov    %r14,%rsi
call   1050 <strcpy@plt>
add    $0x1,%r15
xor    %edi,%edi
mov    %rbx,%rsi
call   10d0 <strtok@plt>
mov    %rax,%r14
test   %rax,%rax
jne    12e0 <main+0x100>
jmp    1323 <main+0x143>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %r15d,%r15d
mov    %r15d,%eax
movq   $0x0,0x0(%rbp,%rax,8)
mov    0x0(%rbp),%rdi
lea    0xccd(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1380 <main+0x1a0>
xor    %eax,%eax
call   1100 <fork@plt>
test   %rax,%rax
js     1210 <main+0x30>
lea    0x40(%rsp),%r14
je     13fe <main+0x21e>
mov    $0xffffffff,%edi
mov    %rsp,%rsi
xor    %edx,%edx
call   10c0 <waitpid@plt>
jmp    122c <main+0x4c>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    $0x1,%r13d
jne    13d1 <main+0x1f1>
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movw   $0x0,0x30(%rsp)
lea    0xc65(%rip),%rdi
call   1030 <getenv@plt>
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rax,%rsi
call   1050 <strcpy@plt>
mov    $0xff,%edi
call   10b0 <malloc@plt>
mov    %rax,0x8(%rbp)
mov    %rax,%rdi
mov    %r14,%rsi
call   1050 <strcpy@plt>
mov    0x8(%rbp),%rdi
call   1070 <chdir@plt>
test   %rax,%rax
lea    0x40(%rsp),%r14
je     122c <main+0x4c>
mov    0x2be9(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbp),%rdx
lea    0xc13(%rip),%rsi
jmp    141e <main+0x23e>
mov    0x0(%rbp),%rdi
mov    %rbp,%rsi
call   10e0 <execvp@plt>
mov    0x2bc7(%rip),%rax
mov    (%rax),%edi
mov    0x0(%rbp),%rdx
lea    0xc29(%rip),%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
jmp    122c <main+0x4c>
xor    %edi,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
@stdin = global i32 0
@.str = [5 x i8] c"exit\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [3 x i8] c"cd\00"
@.str.3 = [5 x i8] c"HOME\00"
@stderr = global i32 0
@.str.4 = [38 x i8] c"cd: '%s' file or directory not found\0A\00"
@.str.5 = [18 x i8] c"Unexpected error\0A\00"
@.str.6 = [24 x i8] c"Command '%s' not found\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [255 x i8]
%3 = alloca i8*
%4 = alloca [255 x i8]
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i32
%8 = alloca [50 x i8]
%9 = alloca i64
%10 = alloca i32
store i32 0, i32* %1
br label %11
11: ; preds = %0, %113, %118, %137
%12 = call i32 (...) @typePrompt()
%13 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%14 = load i32, i32* @stdin
%15 = call i32 @fgets(i8* %13, i32 255, i32 %14)
%16 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%17 = call i32 @strlen(i8* %16)
%18 = sub nsw i32 %17, 1
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 %19
store i8 0, i8* %20
%21 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%22 = call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %11
%25 = call i32 @exit(i32 0)
unreachable
26: ; preds = %11
%27 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%28 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%29 = call i32 @strcpy(i8* %27, i8* %28)
store i32 0, i32* %5
%30 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%31 = call i8* @strtok(i8* %30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %31, i8** %3
br label %32
32: ; preds = %38, %26
%33 = load i8*, i8** %3
%34 = icmp ne i8* %33, null
br i1 %34, label %35, label %40
35: ; preds = %32
%36 = load i32, i32* %5
%37 = add nsw i32 %36, 1
store i32 %37, i32* %5
br label %38
38: ; preds = %35
%39 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %39, i8** %3
br label %32
40: ; preds = %32
%41 = load i32, i32* %5
%42 = add nsw i32 %41, 1
%43 = sext i32 %42 to i64
%44 = mul i64 %43, 8
%45 = trunc i64 %44 to i32
%46 = call i64 @malloc(i32 %45)
%47 = inttoptr i64 %46 to i8**
store i8** %47, i8*** %6
store i32 0, i32* %7
%48 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%49 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%50 = call i32 @strcpy(i8* %48, i8* %49)
%51 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%52 = call i8* @strtok(i8* %51, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %52, i8** %3
br label %53
53: ; preds = %72, %40
%54 = load i8*, i8** %3
%55 = icmp ne i8* %54, null
br i1 %55, label %56, label %74
56: ; preds = %53
%57 = call i64 @malloc(i32 255)
%58 = inttoptr i64 %57 to i8*
%59 = load i8**, i8*** %6
%60 = load i32, i32* %7
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds i8*, i8** %59, i64 %61
store i8* %58, i8** %62
%63 = load i8**, i8*** %6
%64 = load i32, i32* %7
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i8*, i8** %63, i64 %65
%67 = load i8*, i8** %66
%68 = load i8*, i8** %3
%69 = call i32 @strcpy(i8* %67, i8* %68)
%70 = load i32, i32* %7
%71 = add nsw i32 %70, 1
store i32 %71, i32* %7
br label %72
72: ; preds = %56
%73 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i8* %73, i8** %3
br label %53
74: ; preds = %53
%75 = load i8**, i8*** %6
%76 = load i32, i32* %7
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds i8*, i8** %75, i64 %77
store i8* null, i8** %78
%79 = load i8**, i8*** %6
%80 = getelementptr inbounds i8*, i8** %79, i64 0
%81 = load i8*, i8** %80
%82 = call i64 @strcmp(i8* %81, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%83 = icmp eq i64 %82, 0
br i1 %83, label %84, label %114
84: ; preds = %74
%85 = load i32, i32* %5
%86 = icmp eq i32 %85, 1
br i1 %86, label %87, label %101
87: ; preds = %84
%88 = bitcast [50 x i8]* %8 to i8*
%89 = getelementptr inbounds [50 x i8], [50 x i8]* %8, i64 0, i64 0
%90 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%91 = call i32 @strcpy(i8* %89, i8* %90)
%92 = call i64 @malloc(i32 255)
%93 = inttoptr i64 %92 to i8*
%94 = load i8**, i8*** %6
%95 = getelementptr inbounds i8*, i8** %94, i64 1
store i8* %93, i8** %95
%96 = load i8**, i8*** %6
%97 = getelementptr inbounds i8*, i8** %96, i64 1
%98 = load i8*, i8** %97
%99 = getelementptr inbounds [50 x i8], [50 x i8]* %8, i64 0, i64 0
%100 = call i32 @strcpy(i8* %98, i8* %99)
br label %101
101: ; preds = %87, %84
%102 = load i8**, i8*** %6
%103 = getelementptr inbounds i8*, i8** %102, i64 1
%104 = load i8*, i8** %103
%105 = call i64 @chdir(i8* %104)
%106 = icmp ne i64 %105, 0
br i1 %106, label %107, label %113
107: ; preds = %101
%108 = load i32, i32* @stderr
%109 = load i8**, i8*** %6
%110 = getelementptr inbounds i8*, i8** %109, i64 1
%111 = load i8*, i8** %110
%112 = call i32 (i32, i8*, ...) @fprintf(i32 %108, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i8* %111)
br label %113
113: ; preds = %107, %101
br label %11
114: ; preds = %74
%115 = call i64 (...) @fork()
store i64 %115, i64* %9
%116 = load i64, i64* %9
%117 = icmp slt i64 %116, 0
br i1 %117, label %118, label %121
118: ; preds = %114
%119 = load i32, i32* @stderr
%120 = call i32 (i32, i8*, ...) @fprintf(i32 %119, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
br label %11
121: ; preds = %114
%122 = load i64, i64* %9
%123 = icmp ne i64 %122, 0
br i1 %123, label %124, label %126
124: ; preds = %121
%125 = call i32 @waitpid(i32 -1, i32* %10, i32 0)
br label %137
126: ; preds = %121
%127 = load i8**, i8*** %6
%128 = getelementptr inbounds i8*, i8** %127, i64 0
%129 = load i8*, i8** %128
%130 = load i8**, i8*** %6
%131 = call i32 @execvp(i8* %129, i8** %130)
%132 = load i32, i32* @stderr
%133 = load i8**, i8*** %6
%134 = getelementptr inbounds i8*, i8** %133, i64 0
%135 = load i8*, i8** %134
%136 = call i32 (i32, i8*, ...) @fprintf(i32 %132, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i8* %135)
br label %137
137: ; preds = %126, %124
br label %11
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [5 x i8] c"exit\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [3 x i8] c"cd\00"
@.str.3 = [5 x i8] c"HOME\00"
@stderr = global i32 0
@.str.4 = [38 x i8] c"cd: '%s' file or directory not found\0A\00"
@.str.5 = [18 x i8] c"Unexpected error\0A\00"
@.str.6 = [24 x i8] c"Command '%s' not found\0A\00"
define i32 @main() {
%1 = alloca [255 x i8]
%2 = alloca [255 x i8]
%3 = alloca [50 x i8]
%4 = alloca i32
%5 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%7 = bitcast i32* %4 to i8*
%8 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
br label %9
9: ; preds = %91, %0
%10 = call i32 (...) @typePrompt()
%11 = load i32, i32* @stdin
%12 = call i32 @fgets(i8* %5, i32 255, i32 %11)
%13 = call i32 @strlen(i8* %5)
%14 = add nsw i32 %13, -1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 %15
store i8 0, i8* %16
%17 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %9
%20 = call i32 @exit(i32 0)
unreachable
21: ; preds = %9
%22 = call i32 @strcpy(i8* %6, i8* %5)
%23 = call i8* @strtok(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%24 = icmp eq i8* %23, null
br i1 %24, label %30, label %25
25: ; preds = %21, %25
%26 = phi i32 [ %27, %25 ], [ 0, %21 ]
%27 = add nuw nsw i32 %26, 1
%28 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%29 = icmp eq i8* %28, null
br i1 %29, label %30, label %25
30: ; preds = %25, %21
%31 = phi i32 [ 0, %21 ], [ %27, %25 ]
%32 = shl i32 %31, 3
%33 = add i32 %32, 8
%34 = call i64 @malloc(i32 %33)
%35 = inttoptr i64 %34 to i8**
%36 = call i32 @strcpy(i8* %6, i8* %5)
%37 = call i8* @strtok(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%38 = icmp eq i8* %37, null
br i1 %38, label %49, label %39
39: ; preds = %30, %39
%40 = phi i64 [ %46, %39 ], [ 0, %30 ]
%41 = phi i8* [ %47, %39 ], [ %37, %30 ]
%42 = call i64 @malloc(i32 255)
%43 = inttoptr i64 %42 to i8*
%44 = getelementptr inbounds i8*, i8** %35, i64 %40
store i8* %43, i8** %44
%45 = call i32 @strcpy(i8* %43, i8* %41)
%46 = add nuw i64 %40, 1
%47 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%48 = icmp eq i8* %47, null
br i1 %48, label %49, label %39
49: ; preds = %39, %30
%50 = phi i64 [ 0, %30 ], [ %46, %39 ]
%51 = and i64 %50, 4294967295
%52 = getelementptr inbounds i8*, i8** %35, i64 %51
store i8* null, i8** %52
%53 = load i8*, i8** %35
%54 = call i64 @strcmp(i8* %53, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %74
56: ; preds = %49
%57 = icmp eq i32 %31, 1
br i1 %57, label %58, label %65
58: ; preds = %56
%59 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%60 = call i32 @strcpy(i8* %8, i8* %59)
%61 = call i64 @malloc(i32 255)
%62 = inttoptr i64 %61 to i8*
%63 = getelementptr inbounds i8*, i8** %35, i64 1
store i8* %62, i8** %63
%64 = call i32 @strcpy(i8* %62, i8* %8)
br label %65
65: ; preds = %58, %56
%66 = getelementptr inbounds i8*, i8** %35, i64 1
%67 = load i8*, i8** %66
%68 = call i64 @chdir(i8* %67)
%69 = icmp eq i64 %68, 0
br i1 %69, label %91, label %70
70: ; preds = %65
%71 = load i32, i32* @stderr
%72 = load i8*, i8** %66
%73 = call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i8* %72)
br label %91
74: ; preds = %49
%75 = call i64 (...) @fork()
%76 = icmp slt i64 %75, 0
br i1 %76, label %77, label %80
77: ; preds = %74
%78 = load i32, i32* @stderr
%79 = call i32 (i32, i8*, ...) @fprintf(i32 %78, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
br label %91
80: ; preds = %74
%81 = icmp eq i64 %75, 0
br i1 %81, label %84, label %82
82: ; preds = %80
%83 = call i32 @waitpid(i32 -1, i32* %4, i32 0)
br label %90
84: ; preds = %80
%85 = load i8*, i8** %35
%86 = call i32 @execvp(i8* %85, i8** %35)
%87 = load i32, i32* @stderr
%88 = load i8*, i8** %35
%89 = call i32 (i32, i8*, ...) @fprintf(i32 %87, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i8* %88)
br label %90
90: ; preds = %84, %82
br label %91
91: ; preds = %77, %90, %65, %70
br label %9
}