#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*/ printf(char *, char const *, ...);
scalar_t__ strcmp(char const *, char *);
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  int i = 0;
  const char *cmd[15] = {"mount", "pbs",   "pfe",   "ls",   "cd",
                         "cat",   "touch", "mkdir", "rm",   "rmdir",
                         "df",    "pwd",   "clear", "exit", NULL};
  const char *desc[15] = {"Mount fat12 file system",
                          "Print boot sector",
                          "Print fat entries",
                          "List files/dirs",
                          "Change directory",
                          "Display file",
                          "Create new file at designated location",
                          "Create new subdir at designated location",
                          "Delete designated file",
                          "Delete designated subdir",
                          "Display free space on mounted image",
                          "Display current working directory path",
                          "Clear terminal",
                          "Exit terminal",
                          NULL};
  const char *desc_lng[15] = {"{/PATH/TO/FAT12/IMG}",
                              "",
                              "X Y <=> (X > 1) && (X < Y)",
                              "{OPTIONAL: -l (list)}",
                              "{/PATH/TO/SUBDIR}",
                              "{/PATH/TO/FILE}",
                              "{/PATH/TO/NEW/FILE}",
                              "{PATH/TO/NEW/DIR}",
                              "{/PATH/TO/FILE}",
                              "{/PATH/TO/DIR}",
                              "",
                              "",
                              "",
                              "",
                              NULL};
  if (argc > 2 || argc < 1) {
    usage();
    return 1;
  } else if (argc == 1) {
    while (cmd[i] != NULL) {
      printf("%s \t- %s\n", cmd[i], desc[i]);
      i++;
    }
  } else {
    i = 0;
    while (cmd[i] != NULL && (strcmp(cmd[i], argv[1]) != 0)) {
      i++;
    }
    if (cmd[i] == NULL)
      printf("Command '%s' not found\n", argv[1]);
    else
      printf("%s %s\n", cmd[i], desc_lng[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x90(%rbp),%rdi
lea    0x2b32(%rip),%rsi
mov    $0x78,%edx
call   1050 <memcpy@plt>
lea    -0x110(%rbp),%rdi
lea    0x2b9a(%rip),%rsi
mov    $0x78,%edx
call   1050 <memcpy@plt>
lea    -0x190(%rbp),%rdi
lea    0x2c02(%rip),%rsi
mov    $0x78,%edx
call   1050 <memcpy@plt>
cmpl   $0x2,-0x8(%rbp)
jg     11bc <main+0x7c>
cmpl   $0x1,-0x8(%rbp)
jge    11cf <main+0x8f>
mov    $0x0,%al
call   1060 <usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    12f8 <main+0x1b8>
cmpl   $0x1,-0x8(%rbp)
jne    122a <main+0xea>
jmp    11de <main+0x9e>
movslq -0x14(%rbp),%rax
cmpq   $0x0,-0x90(%rbp,%rax,8)
je     1225 <main+0xe5>
movslq -0x14(%rbp),%rax
mov    -0x90(%rbp,%rax,8),%rsi
ff
movslq -0x14(%rbp),%rax
mov    -0x110(%rbp,%rax,8),%rdx
ff
lea    0x101e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11de <main+0x9e>
jmp    12ec <main+0x1ac>
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rcx
xor    %eax,%eax
cmpq   $0x0,-0x90(%rbp,%rcx,8)
mov    %al,-0x191(%rbp)
je     1272 <main+0x132>
movslq -0x14(%rbp),%rax
mov    -0x90(%rbp,%rax,8),%rdi
ff
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x191(%rbp)
mov    -0x191(%rbp),%al
test   $0x1,%al
jne    1285 <main+0x145>
jmp    1293 <main+0x153>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1231 <main+0xf1>
movslq -0x14(%rbp),%rax
cmpq   $0x0,-0x90(%rbp,%rax,8)
jne    12c1 <main+0x181>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xf83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12e7 <main+0x1a7>
movslq -0x14(%rbp),%rax
mov    -0x90(%rbp,%rax,8),%rsi
ff
movslq -0x14(%rbp),%rax
mov    -0x190(%rbp,%rax,8),%rdx
ff
lea    0xf70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12ec <main+0x1ac>
jmp    12f1 <main+0x1b1>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    -0x3(%rdi),%eax
cmp    $0xfffffffd,%eax
ja     114f <main+0x1f>
xor    %eax,%eax
call   1050 <usage@plt>
mov    $0x1,%r14d
jmp    14ca <main+0x39a>
cmp    $0x1,%edi
jne    12b0 <main+0x180>
lea    0x10cf(%rip),%rbx
lea    0xe9a(%rip),%rsi
lea    0xed2(%rip),%rdx
xor    %r14d,%r14d
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe85(%rip),%rsi
lea    0xecf(%rip),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe71(%rip),%rsi
lea    0xec9(%rip),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe5d(%rip),%rsi
lea    0xec3(%rip),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe48(%rip),%rsi
lea    0xebb(%rip),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe33(%rip),%rsi
lea    0xeb4(%rip),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe1f(%rip),%rsi
lea    0xea9(%rip),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe0d(%rip),%rsi
lea    0xeb8(%rip),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xdfb(%rip),%rsi
lea    0xec9(%rip),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xde6(%rip),%rsi
lea    0xec8(%rip),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xdd4(%rip),%rsi
lea    0xec9(%rip),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xdbf(%rip),%rsi
lea    0xed5(%rip),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xdab(%rip),%rsi
lea    0xee4(%rip),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xd99(%rip),%rsi
lea    0xedb(%rip),%rdx
mov    %rbx,%rdi
jmp    14c3 <main+0x393>
mov    %rsi,%rbx
mov    0x8(%rsi),%rsi
lea    0xd42(%rip),%r15
mov    %r15,%rdi
call   1040 <strcmp@plt>
xor    %r14d,%r14d
test   %rax,%rax
je     1451 <main+0x321>
mov    0x8(%rbx),%rsi
lea    0xd29(%rip),%r15
mov    %r15,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1455 <main+0x325>
mov    0x8(%rbx),%rsi
lea    0xd11(%rip),%r15
mov    %r15,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     145c <main+0x32c>
mov    0x8(%rbx),%rsi
lea    0xcf9(%rip),%r15
mov    %r15,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1463 <main+0x333>
mov    0x8(%rbx),%rsi
lea    0xce0(%rip),%r15
mov    %r15,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     146a <main+0x33a>
mov    0x8(%rbx),%rsi
lea    0xcc7(%rip),%r15
mov    %r15,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1471 <main+0x341>
mov    0x8(%rbx),%rsi
lea    0xcaf(%rip),%r15
mov    %r15,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1478 <main+0x348>
mov    0x8(%rbx),%rsi
lea    0xc99(%rip),%r15
mov    %r15,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     147f <main+0x34f>
mov    0x8(%rbx),%rsi
lea    0xc83(%rip),%r15
mov    %r15,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1486 <main+0x356>
mov    0x8(%rbx),%rsi
lea    0xc6a(%rip),%r15
mov    %r15,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     148d <main+0x35d>
mov    0x8(%rbx),%rsi
lea    0xc54(%rip),%r15
mov    %r15,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1494 <main+0x364>
mov    0x8(%rbx),%rsi
lea    0xc3b(%rip),%r15
mov    %r15,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     149b <main+0x36b>
mov    0x8(%rbx),%rsi
lea    0xc23(%rip),%r15
mov    %r15,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     14a2 <main+0x372>
mov    0x8(%rbx),%rsi
lea    0xc0d(%rip),%r15
mov    %r15,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     14a9 <main+0x379>
mov    0x8(%rbx),%rsi
lea    0xdf3(%rip),%rdi
xor    %r14d,%r14d
xor    %eax,%eax
call   1030 <printf@plt>
jmp    14ca <main+0x39a>
xor    %eax,%eax
jmp    14ae <main+0x37e>
mov    $0x1,%eax
jmp    14ae <main+0x37e>
mov    $0x2,%eax
jmp    14ae <main+0x37e>
mov    $0x3,%eax
jmp    14ae <main+0x37e>
mov    $0x4,%eax
jmp    14ae <main+0x37e>
mov    $0x5,%eax
jmp    14ae <main+0x37e>
mov    $0x6,%eax
jmp    14ae <main+0x37e>
mov    $0x7,%eax
jmp    14ae <main+0x37e>
mov    $0x8,%eax
jmp    14ae <main+0x37e>
mov    $0x9,%eax
jmp    14ae <main+0x37e>
mov    $0xa,%eax
jmp    14ae <main+0x37e>
mov    $0xb,%eax
jmp    14ae <main+0x37e>
mov    $0xc,%eax
jmp    14ae <main+0x37e>
mov    $0xd,%eax
lea    0x28eb(%rip),%rcx
mov    (%rcx,%rax,8),%rdx
lea    0xd90(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"mount\00"
@.str.1 = [4 x i8] c"pbs\00"
@.str.2 = [4 x i8] c"pfe\00"
@.str.3 = [3 x i8] c"ls\00"
@.str.4 = [3 x i8] c"cd\00"
@.str.5 = [4 x i8] c"cat\00"
@.str.6 = [6 x i8] c"touch\00"
@.str.7 = [6 x i8] c"mkdir\00"
@.str.8 = [3 x i8] c"rm\00"
@.str.9 = [6 x i8] c"rmdir\00"
@.str.10 = [3 x i8] c"df\00"
@.str.11 = [4 x i8] c"pwd\00"
@.str.12 = [6 x i8] c"clear\00"
@.str.13 = [5 x i8] c"exit\00"
@__const.main.cmd = [15 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i32 0, i32 0), i8* null]
@.str.14 = [24 x i8] c"Mount fat12 file system\00"
@.str.15 = [18 x i8] c"Print boot sector\00"
@.str.16 = [18 x i8] c"Print fat entries\00"
@.str.17 = [16 x i8] c"List files/dirs\00"
@.str.18 = [17 x i8] c"Change directory\00"
@.str.19 = [13 x i8] c"Display file\00"
@.str.20 = [39 x i8] c"Create new file at designated location\00"
@.str.21 = [41 x i8] c"Create new subdir at designated location\00"
@.str.22 = [23 x i8] c"Delete designated file\00"
@.str.23 = [25 x i8] c"Delete designated subdir\00"
@.str.24 = [36 x i8] c"Display free space on mounted image\00"
@.str.25 = [39 x i8] c"Display current working directory path\00"
@.str.26 = [15 x i8] c"Clear terminal\00"
@.str.27 = [14 x i8] c"Exit terminal\00"
@__const.main.desc = [15 x i8*] [i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.25, i32 0, i32 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.26, i32 0, i32 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.27, i32 0, i32 0), i8* null]
@.str.28 = [21 x i8] c"{/PATH/TO/FAT12/IMG}\00"
@.str.29 = [1 x i8] zeroinitializer
@.str.30 = [27 x i8] c"X Y <=> (X > 1) && (X < Y)\00"
@.str.31 = [22 x i8] c"{OPTIONAL: -l (list)}\00"
@.str.32 = [18 x i8] c"{/PATH/TO/SUBDIR}\00"
@.str.33 = [16 x i8] c"{/PATH/TO/FILE}\00"
@.str.34 = [20 x i8] c"{/PATH/TO/NEW/FILE}\00"
@.str.35 = [18 x i8] c"{PATH/TO/NEW/DIR}\00"
@.str.36 = [15 x i8] c"{/PATH/TO/DIR}\00"
@__const.main.desc_lng = [15 x i8*] [i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.28, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.29, i32 0, i32 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.30, i32 0, i32 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.31, i32 0, i32 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.32, i32 0, i32 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.33, i32 0, i32 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.34, i32 0, i32 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.35, i32 0, i32 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.33, i32 0, i32 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.36, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.29, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.29, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.29, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.29, i32 0, i32 0), i8* null]
@.str.37 = [10 x i8] c"%s \09- %s\0A\00"
@.str.38 = [24 x i8] c"Command '%s' not found\0A\00"
@.str.39 = [7 x i8] c"%s %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [15 x i8*]
%8 = alloca [15 x i8*]
%9 = alloca [15 x i8*]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%10 = bitcast [15 x i8*]* %7 to i8*
%11 = bitcast [15 x i8*]* %8 to i8*
%12 = bitcast [15 x i8*]* %9 to i8*
%13 = load i32, i32* %4
%14 = icmp sgt i32 %13, 2
br i1 %14, label %18, label %15
15: ; preds = %2
%16 = load i32, i32* %4
%17 = icmp slt i32 %16, 1
br i1 %17, label %18, label %20
18: ; preds = %15, %2
%19 = call i32 (...) @usage()
store i32 1, i32* %3
br label %89
20: ; preds = %15
%21 = load i32, i32* %4
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %43
23: ; preds = %20
br label %24
24: ; preds = %30, %23
%25 = load i32, i32* %6
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [15 x i8*], [15 x i8*]* %7, i64 0, i64 %26
%28 = load i8*, i8** %27
%29 = icmp ne i8* %28, null
br i1 %29, label %30, label %42
30: ; preds = %24
%31 = load i32, i32* %6
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [15 x i8*], [15 x i8*]* %7, i64 0, i64 %32
%34 = load i8*, i8** %33
%35 = load i32, i32* %6
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [15 x i8*], [15 x i8*]* %8, i64 0, i64 %36
%38 = load i8*, i8** %37
%39 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.37, i64 0, i64 0), i8* %34, i8* %38)
%40 = load i32, i32* %6
%41 = add nsw i32 %40, 1
store i32 %41, i32* %6
br label %24
42: ; preds = %24
br label %87
43: ; preds = %20
store i32 0, i32* %6
br label %44
44: ; preds = %62, %43
%45 = load i32, i32* %6
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [15 x i8*], [15 x i8*]* %7, i64 0, i64 %46
%48 = load i8*, i8** %47
%49 = icmp ne i8* %48, null
br i1 %49, label %50, label %60
50: ; preds = %44
%51 = load i32, i32* %6
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [15 x i8*], [15 x i8*]* %7, i64 0, i64 %52
%54 = load i8*, i8** %53
%55 = load i8**, i8*** %5
%56 = getelementptr inbounds i8*, i8** %55, i64 1
%57 = load i8*, i8** %56
%58 = call i64 @strcmp(i8* %54, i8* %57)
%59 = icmp ne i64 %58, 0
br label %60
60: ; preds = %50, %44
%61 = phi i1 [ false, %44 ], [ %59, %50 ]
br i1 %61, label %62, label %65
62: ; preds = %60
%63 = load i32, i32* %6
%64 = add nsw i32 %63, 1
store i32 %64, i32* %6
br label %44
65: ; preds = %60
%66 = load i32, i32* %6
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [15 x i8*], [15 x i8*]* %7, i64 0, i64 %67
%69 = load i8*, i8** %68
%70 = icmp eq i8* %69, null
br i1 %70, label %71, label %76
71: ; preds = %65
%72 = load i8**, i8*** %5
%73 = getelementptr inbounds i8*, i8** %72, i64 1
%74 = load i8*, i8** %73
%75 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.38, i64 0, i64 0), i8* %74)
br label %86
76: ; preds = %65
%77 = load i32, i32* %6
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds [15 x i8*], [15 x i8*]* %7, i64 0, i64 %78
%80 = load i8*, i8** %79
%81 = load i32, i32* %6
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds [15 x i8*], [15 x i8*]* %9, i64 0, i64 %82
%84 = load i8*, i8** %83
%85 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.39, i64 0, i64 0), i8* %80, i8* %84)
br label %86
86: ; preds = %76, %71
br label %87
87: ; preds = %86, %42
br label %88
88: ; preds = %87
store i32 0, i32* %3
br label %89
89: ; preds = %88, %18
%90 = load i32, i32* %3
ret i32 %90
}

LLVM IR (-O2):
@.str = [6 x i8] c"mount\00"
@.str.1 = [4 x i8] c"pbs\00"
@.str.2 = [4 x i8] c"pfe\00"
@.str.3 = [3 x i8] c"ls\00"
@.str.4 = [3 x i8] c"cd\00"
@.str.5 = [4 x i8] c"cat\00"
@.str.6 = [6 x i8] c"touch\00"
@.str.7 = [6 x i8] c"mkdir\00"
@.str.8 = [3 x i8] c"rm\00"
@.str.9 = [6 x i8] c"rmdir\00"
@.str.10 = [3 x i8] c"df\00"
@.str.11 = [4 x i8] c"pwd\00"
@.str.12 = [6 x i8] c"clear\00"
@.str.13 = [5 x i8] c"exit\00"
@.str.14 = [24 x i8] c"Mount fat12 file system\00"
@.str.15 = [18 x i8] c"Print boot sector\00"
@.str.16 = [18 x i8] c"Print fat entries\00"
@.str.17 = [16 x i8] c"List files/dirs\00"
@.str.18 = [17 x i8] c"Change directory\00"
@.str.19 = [13 x i8] c"Display file\00"
@.str.20 = [39 x i8] c"Create new file at designated location\00"
@.str.21 = [41 x i8] c"Create new subdir at designated location\00"
@.str.22 = [23 x i8] c"Delete designated file\00"
@.str.23 = [25 x i8] c"Delete designated subdir\00"
@.str.24 = [36 x i8] c"Display free space on mounted image\00"
@.str.25 = [39 x i8] c"Display current working directory path\00"
@.str.26 = [15 x i8] c"Clear terminal\00"
@.str.27 = [14 x i8] c"Exit terminal\00"
@.str.28 = [21 x i8] c"{/PATH/TO/FAT12/IMG}\00"
@.str.29 = [1 x i8] zeroinitializer
@.str.30 = [27 x i8] c"X Y <=> (X > 1) && (X < Y)\00"
@.str.31 = [22 x i8] c"{OPTIONAL: -l (list)}\00"
@.str.32 = [18 x i8] c"{/PATH/TO/SUBDIR}\00"
@.str.33 = [16 x i8] c"{/PATH/TO/FILE}\00"
@.str.34 = [20 x i8] c"{/PATH/TO/NEW/FILE}\00"
@.str.35 = [18 x i8] c"{PATH/TO/NEW/DIR}\00"
@.str.36 = [15 x i8] c"{/PATH/TO/DIR}\00"
@__const.main.desc_lng = [15 x i8*] [i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.28, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.29, i32 0, i32 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.30, i32 0, i32 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.31, i32 0, i32 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.32, i32 0, i32 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.33, i32 0, i32 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.34, i32 0, i32 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.35, i32 0, i32 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.33, i32 0, i32 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.36, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.29, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.29, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.29, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.29, i32 0, i32 0), i8* null]
@.str.37 = [10 x i8] c"%s \09- %s\0A\00"
@.str.38 = [24 x i8] c"Command '%s' not found\0A\00"
@.str.39 = [7 x i8] c"%s %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = add i32 %0, -3
%4 = icmp ult i32 %3, -2
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @usage()
br label %90
7: ; preds = %2
%8 = icmp eq i32 %0, 1
br i1 %8, label %9, label %24
9: ; preds = %7
%10 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.37, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.14, i64 0, i64 0))
%11 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.37, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.15, i64 0, i64 0))
%12 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.37, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.16, i64 0, i64 0))
%13 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.37, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.17, i64 0, i64 0))
%14 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.37, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.18, i64 0, i64 0))
%15 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.37, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.19, i64 0, i64 0))
%16 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.37, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.20, i64 0, i64 0))
%17 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.37, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.21, i64 0, i64 0))
%18 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.37, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.22, i64 0, i64 0))
%19 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.37, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.23, i64 0, i64 0))
%20 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.37, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.24, i64 0, i64 0))
%21 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.37, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.25, i64 0, i64 0))
%22 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.37, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.26, i64 0, i64 0))
%23 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.37, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.27, i64 0, i64 0))
br label %90
24: ; preds = %7
%25 = getelementptr inbounds i8*, i8** %1, i64 1
%26 = load i8*, i8** %25
%27 = tail call i64 @strcmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %26)
%28 = icmp eq i64 %27, 0
br i1 %28, label %84, label %29
29: ; preds = %24
%30 = load i8*, i8** %25
%31 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %30)
%32 = icmp eq i64 %31, 0
br i1 %32, label %84, label %33
33: ; preds = %29
%34 = load i8*, i8** %25
%35 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %34)
%36 = icmp eq i64 %35, 0
br i1 %36, label %84, label %37
37: ; preds = %33
%38 = load i8*, i8** %25
%39 = tail call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %38)
%40 = icmp eq i64 %39, 0
br i1 %40, label %84, label %41
41: ; preds = %37
%42 = load i8*, i8** %25
%43 = tail call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %42)
%44 = icmp eq i64 %43, 0
br i1 %44, label %84, label %45
45: ; preds = %41
%46 = load i8*, i8** %25
%47 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %46)
%48 = icmp eq i64 %47, 0
br i1 %48, label %84, label %49
49: ; preds = %45
%50 = load i8*, i8** %25
%51 = tail call i64 @strcmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i8* %50)
%52 = icmp eq i64 %51, 0
br i1 %52, label %84, label %53
53: ; preds = %49
%54 = load i8*, i8** %25
%55 = tail call i64 @strcmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* %54)
%56 = icmp eq i64 %55, 0
br i1 %56, label %84, label %57
57: ; preds = %53
%58 = load i8*, i8** %25
%59 = tail call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* %58)
%60 = icmp eq i64 %59, 0
br i1 %60, label %84, label %61
61: ; preds = %57
%62 = load i8*, i8** %25
%63 = tail call i64 @strcmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* %62)
%64 = icmp eq i64 %63, 0
br i1 %64, label %84, label %65
65: ; preds = %61
%66 = load i8*, i8** %25
%67 = tail call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* %66)
%68 = icmp eq i64 %67, 0
br i1 %68, label %84, label %69
69: ; preds = %65
%70 = load i8*, i8** %25
%71 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8* %70)
%72 = icmp eq i64 %71, 0
br i1 %72, label %84, label %73
73: ; preds = %69
%74 = load i8*, i8** %25
%75 = tail call i64 @strcmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i8* %74)
%76 = icmp eq i64 %75, 0
br i1 %76, label %84, label %77
77: ; preds = %73
%78 = load i8*, i8** %25
%79 = tail call i64 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0), i8* %78)
%80 = icmp eq i64 %79, 0
br i1 %80, label %84, label %81
81: ; preds = %77
%82 = load i8*, i8** %25
%83 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.38, i64 0, i64 0), i8* %82)
br label %90
84: ; preds = %77, %73, %69, %65, %61, %57, %53, %49, %45, %41, %37, %33, %29, %24
%85 = phi i64 [ 0, %24 ], [ 1, %29 ], [ 2, %33 ], [ 3, %37 ], [ 4, %41 ], [ 5, %45 ], [ 6, %49 ], [ 7, %53 ], [ 8, %57 ], [ 9, %61 ], [ 10, %65 ], [ 11, %69 ], [ 12, %73 ], [ 13, %77 ]
%86 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %24 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %29 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), %33 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), %37 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), %41 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), %45 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), %49 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), %53 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), %57 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), %61 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), %65 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), %69 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), %73 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0), %77 ]
%87 = getelementptr inbounds [15 x i8*], [15 x i8*]* @__const.main.desc_lng, i64 0, i64 %85
%88 = load i8*, i8** %87
%89 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.39, i64 0, i64 0), i8* %86, i8* %88)
br label %90
90: ; preds = %9, %81, %84, %5
%91 = phi i32 [ 1, %5 ], [ 0, %84 ], [ 0, %81 ], [ 0, %9 ]
ret i32 %91
}