// File: /workspace/github_cpp_makefile_star2_O3/RC2K7[P]SDisk-FileSystem/shell.cpp
// Function: Shell::runShell()
void Shell::runShell()
{
    string buffer = "";
    while (1) {
        cout << ">> ";
        getline(cin, buffer);

        vector<string> args = splitString(buffer);

        if (args.size() == 0) {
            cout << "No Command Found" << endl;
            continue;
        }

        // arg[0] Is Our Command, Following Handles All Possible Commands
        if (args[0] == "quit" || args[0] == "q") {
            break;
        } else if (args[0] == "dir") {
            this->dir();
        } else if (args[0] == "add") {
            if (args.size() < 2) { // Handle Incorrect Number Of Arguments
                cout << "Incorrect Number of Arguments" << endl;
                continue;
            }
            this->add(args[1]);
        } else if (args[0] == "del") {
            if (args.size() < 2) { // Handle Incorrect Number Of Arguments
                cout << "Incorrect Number of Arguments" << endl;
                continue;
            }
            this->del(args[1]);
        } else if (args[0] == "type") {
            if (args.size() < 2) { // Handle Incorrect Number Of Arguments
                cout << "Incorrect Number of Arguments" << endl;
                continue;
            }
            this->type(args[1]);
        } else if (args[0] == "copy") {
            if (args.size() < 3) { // Handle Incorrect Number Of Arguments
                cout << "Incorrect Number of Arguments" << endl;
                continue;
            }
            this->copy(args[1], args[2]);
        } else if (args[0] == "app") {
            if (args.size() < 2) {
                cout << "Inoccrent Number of Arguments" << endl;
                continue;
            }
            this->append(args[1]);
        } else {
            cout << "Unknown Command" << endl;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rdi, -0x48(%rbp)
leaq -0x58(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x4835(%rip), %rdx      # 0x70bc
leaq -0x68(%rbp), %rdi
movq %rdx, %rsi
callq 0x2648
leaq -0x138(%rbp), %r14
movq 0x772f(%rip), %r15      # 0x9fd0
movq 0x7738(%rip), %r13      # 0x9fe0
leaq -0x148(%rbp), %rbx
leaq -0x40(%rbp), %r12
movl $0x3, %edx
movq %r15, %rdi
leaq 0x488b(%rip), %rsi      # 0x714d
callq 0x21f0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %edx
movq %r13, %rdi
leaq -0x68(%rbp), %rsi
callq 0x2320
movq %r14, -0x148(%rbp)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x4218
movq %r12, %rdi
movq %rbx, %rsi
callq 0x40bf
movq -0x148(%rbp), %rdi
cmpq %r14, %rdi
je 0x292b
movq -0x138(%rbp), %rsi
incq %rsi
callq 0x21c0
movq -0x40(%rbp), %rdi
cmpq %rdi, -0x38(%rbp)
je 0x2a62
leaq 0x4822(%rip), %rsi      # 0x7162
callq 0x2080
testl %eax, %eax
je 0x2cb4
movq -0x40(%rbp), %rdi
leaq 0x480f(%rip), %rsi      # 0x7167
callq 0x2080
testl %eax, %eax
je 0x2cb4
movq -0x40(%rbp), %rdi
leaq 0x47f9(%rip), %rsi      # 0x7169
callq 0x2080
testl %eax, %eax
je 0x2aa2
movq -0x40(%rbp), %rdi
leaq 0x47e5(%rip), %rsi      # 0x716d
callq 0x2080
testl %eax, %eax
je 0x2ab0
movq -0x40(%rbp), %rdi
leaq 0x47ef(%rip), %rsi      # 0x718f
callq 0x2080
testl %eax, %eax
je 0x2b15
movq -0x40(%rbp), %rdi
leaq 0x47db(%rip), %rsi      # 0x7193
callq 0x2080
testl %eax, %eax
je 0x2b7e
movq -0x40(%rbp), %rdi
leaq 0x47c8(%rip), %rsi      # 0x7198
callq 0x2080
testl %eax, %eax
je 0x2be7
movq -0x40(%rbp), %rdi
leaq 0x47b5(%rip), %rsi      # 0x719d
callq 0x2080
movl $0xf, %edx
leaq 0x47c6(%rip), %rsi      # 0x71bf
testl %eax, %eax
jne 0x2a6e
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rax, %rcx
movl $0x1d, %edx
leaq 0x478d(%rip), %rsi      # 0x71a1
cmpq $0x21, %rcx
jb 0x2a6e
leaq -0x98(%rbp), %rcx
movq %rcx, -0xa8(%rbp)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
leaq -0xa8(%rbp), %rdi
callq 0x4218
movq -0x48(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x3076
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rcx
jmp 0x2c94
movl $0x10, %edx
leaq 0x46e3(%rip), %rsi      # 0x7151
movq %r15, %rdi
callq 0x21f0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
jmp 0x2ca7
movq -0x48(%rbp), %rdi
callq 0x2e0c
jmp 0x2ca7
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rax, %rcx
movl $0x1d, %edx
leaq 0x46aa(%rip), %rsi      # 0x7171
cmpq $0x21, %rcx
jb 0x2a6e
leaq -0x118(%rbp), %rcx
movq %rcx, -0x128(%rbp)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
leaq -0x128(%rbp), %rdi
callq 0x4218
movq -0x48(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x2ee6
movq -0x128(%rbp), %rdi
leaq -0x118(%rbp), %rcx
jmp 0x2c94
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rax, %rcx
movl $0x1d, %edx
leaq 0x4645(%rip), %rsi      # 0x7171
cmpq $0x21, %rcx
jb 0x2a6e
leaq -0xf8(%rbp), %rcx
movq %rcx, -0x108(%rbp)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
leaq -0x108(%rbp), %rdi
callq 0x4218
movq -0x48(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x373e
movq -0x108(%rbp), %rdi
leaq -0xf8(%rbp), %rcx
jmp 0x2c94
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rax, %rcx
movl $0x1d, %edx
leaq 0x45dc(%rip), %rsi      # 0x7171
cmpq $0x21, %rcx
jb 0x2a6e
leaq -0xd8(%rbp), %rcx
movq %rcx, -0xe8(%rbp)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
leaq -0xe8(%rbp), %rdi
callq 0x4218
movq -0x48(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x3938
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rcx
jmp 0x2c94
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rax, %rcx
movl $0x1d, %edx
leaq 0x4573(%rip), %rsi      # 0x7171
cmpq $0x41, %rcx
jb 0x2a6e
leaq -0xb8(%rbp), %rcx
movq %rcx, -0xc8(%rbp)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
leaq -0xc8(%rbp), %rdi
callq 0x4218
movq -0x40(%rbp), %rax
leaq -0x78(%rbp), %rcx
movq %rcx, -0x88(%rbp)
movq 0x40(%rax), %rsi
movq 0x48(%rax), %rdx
addq %rsi, %rdx
leaq -0x88(%rbp), %rdi
callq 0x4218
movq -0x48(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
leaq -0x88(%rbp), %rdx
callq 0x3c24
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x2c86
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x21c0
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rcx
movq %rcx, %rax
cmpq %rcx, %rdi
je 0x2ca7
movq (%rax), %rsi
incq %rsi
callq 0x21c0
movq %r12, %rdi
callq 0x25da
jmp 0x28b3
leaq -0x40(%rbp), %rdi
callq 0x25da
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x2cd6
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x21c0
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x2ddc
movq -0x98(%rbp), %rsi
jmp 0x2dad
movq %rax, %rbx
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x2d32
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x21c0
jmp 0x2d32
movq %rax, %rbx
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0x2ddc
movq -0xb8(%rbp), %rsi
jmp 0x2dad
movq %rax, %rbx
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rax
cmpq %rax, %rdi
je 0x2ddc
movq -0xd8(%rbp), %rsi
jmp 0x2dad
movq %rax, %rbx
movq -0x108(%rbp), %rdi
leaq -0xf8(%rbp), %rax
cmpq %rax, %rdi
je 0x2ddc
movq -0xf8(%rbp), %rsi
jmp 0x2dad
movq %rax, %rbx
movq -0x128(%rbp), %rdi
leaq -0x118(%rbp), %rax
cmpq %rax, %rdi
je 0x2ddc
movq -0x118(%rbp), %rsi
incq %rsi
callq 0x21c0
jmp 0x2ddc
movq %rax, %rbx
movq -0x148(%rbp), %rdi
cmpq %r14, %rdi
je 0x2dea
movq -0x138(%rbp), %rsi
incq %rsi
callq 0x21c0
jmp 0x2dea
jmp 0x2de7
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x25da
jmp 0x2dea
movq %rax, %rbx
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x2e03
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x21c0
movq %rbx, %rdi
callq 0x2300
nop