// File: /workspace/github_cpp_makefile_star2_O1/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 0x483d(%rip), %rdx      # 0x70bc
leaq -0x68(%rbp), %rdi
movq %rdx, %rsi
callq 0x2644
leaq -0x138(%rbp), %r14
movq 0x7737(%rip), %r15      # 0x9fd0
movq 0x7740(%rip), %r13      # 0x9fe0
leaq -0x148(%rbp), %rbx
leaq -0x40(%rbp), %r12
movl $0x3, %edx
movq %r15, %rdi
leaq 0x4893(%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 0x41ce
movq %r12, %rdi
movq %rbx, %rsi
callq 0x4075
movq -0x148(%rbp), %rdi
cmpq %r14, %rdi
je 0x2923
movq -0x138(%rbp), %rsi
incq %rsi
callq 0x21c0
movq -0x40(%rbp), %rdi
cmpq %rdi, -0x38(%rbp)
je 0x2a5a
leaq 0x482a(%rip), %rsi      # 0x7162
callq 0x2080
testl %eax, %eax
je 0x2cac
movq -0x40(%rbp), %rdi
leaq 0x4817(%rip), %rsi      # 0x7167
callq 0x2080
testl %eax, %eax
je 0x2cac
movq -0x40(%rbp), %rdi
leaq 0x4801(%rip), %rsi      # 0x7169
callq 0x2080
testl %eax, %eax
je 0x2a9a
movq -0x40(%rbp), %rdi
leaq 0x47ed(%rip), %rsi      # 0x716d
callq 0x2080
testl %eax, %eax
je 0x2aa8
movq -0x40(%rbp), %rdi
leaq 0x47f7(%rip), %rsi      # 0x718f
callq 0x2080
testl %eax, %eax
je 0x2b0d
movq -0x40(%rbp), %rdi
leaq 0x47e3(%rip), %rsi      # 0x7193
callq 0x2080
testl %eax, %eax
je 0x2b76
movq -0x40(%rbp), %rdi
leaq 0x47d0(%rip), %rsi      # 0x7198
callq 0x2080
testl %eax, %eax
je 0x2bdf
movq -0x40(%rbp), %rdi
leaq 0x47bd(%rip), %rsi      # 0x719d
callq 0x2080
movl $0xf, %edx
leaq 0x47ce(%rip), %rsi      # 0x71bf
testl %eax, %eax
jne 0x2a66
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rax, %rcx
movl $0x1d, %edx
leaq 0x4795(%rip), %rsi      # 0x71a1
cmpq $0x21, %rcx
jb 0x2a66
leaq -0x98(%rbp), %rcx
movq %rcx, -0xa8(%rbp)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
leaq -0xa8(%rbp), %rdi
callq 0x41ce
movq -0x48(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x306e
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rcx
jmp 0x2c8c
movl $0x10, %edx
leaq 0x46eb(%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 0x2c9f
movq -0x48(%rbp), %rdi
callq 0x2e04
jmp 0x2c9f
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rax, %rcx
movl $0x1d, %edx
leaq 0x46b2(%rip), %rsi      # 0x7171
cmpq $0x21, %rcx
jb 0x2a66
leaq -0x118(%rbp), %rcx
movq %rcx, -0x128(%rbp)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
leaq -0x128(%rbp), %rdi
callq 0x41ce
movq -0x48(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x2ede
movq -0x128(%rbp), %rdi
leaq -0x118(%rbp), %rcx
jmp 0x2c8c
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rax, %rcx
movl $0x1d, %edx
leaq 0x464d(%rip), %rsi      # 0x7171
cmpq $0x21, %rcx
jb 0x2a66
leaq -0xf8(%rbp), %rcx
movq %rcx, -0x108(%rbp)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
leaq -0x108(%rbp), %rdi
callq 0x41ce
movq -0x48(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x36f4
movq -0x108(%rbp), %rdi
leaq -0xf8(%rbp), %rcx
jmp 0x2c8c
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rax, %rcx
movl $0x1d, %edx
leaq 0x45e4(%rip), %rsi      # 0x7171
cmpq $0x21, %rcx
jb 0x2a66
leaq -0xd8(%rbp), %rcx
movq %rcx, -0xe8(%rbp)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
leaq -0xe8(%rbp), %rdi
callq 0x41ce
movq -0x48(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x38ee
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rcx
jmp 0x2c8c
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rax, %rcx
movl $0x1d, %edx
leaq 0x457b(%rip), %rsi      # 0x7171
cmpq $0x41, %rcx
jb 0x2a66
leaq -0xb8(%rbp), %rcx
movq %rcx, -0xc8(%rbp)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
leaq -0xc8(%rbp), %rdi
callq 0x41ce
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 0x41ce
movq -0x48(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
leaq -0x88(%rbp), %rdx
callq 0x3bda
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x2c7e
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x21c0
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rcx
movq %rcx, %rax
cmpq %rcx, %rdi
je 0x2c9f
movq (%rax), %rsi
incq %rsi
callq 0x21c0
movq %r12, %rdi
callq 0x25da
jmp 0x28ab
leaq -0x40(%rbp), %rdi
callq 0x25da
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x2cce
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 0x2dd4
movq -0x98(%rbp), %rsi
jmp 0x2da5
movq %rax, %rbx
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x2d2a
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x21c0
jmp 0x2d2a
movq %rax, %rbx
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0x2dd4
movq -0xb8(%rbp), %rsi
jmp 0x2da5
movq %rax, %rbx
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rax
cmpq %rax, %rdi
je 0x2dd4
movq -0xd8(%rbp), %rsi
jmp 0x2da5
movq %rax, %rbx
movq -0x108(%rbp), %rdi
leaq -0xf8(%rbp), %rax
cmpq %rax, %rdi
je 0x2dd4
movq -0xf8(%rbp), %rsi
jmp 0x2da5
movq %rax, %rbx
movq -0x128(%rbp), %rdi
leaq -0x118(%rbp), %rax
cmpq %rax, %rdi
je 0x2dd4
movq -0x118(%rbp), %rsi
incq %rsi
callq 0x21c0
jmp 0x2dd4
movq %rax, %rbx
movq -0x148(%rbp), %rdi
cmpq %r14, %rdi
je 0x2de2
movq -0x138(%rbp), %rsi
incq %rsi
callq 0x21c0
jmp 0x2de2
jmp 0x2ddf
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x25da
jmp 0x2de2
movq %rax, %rbx
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x2dfb
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x21c0
movq %rbx, %rdi
callq 0x2300
nop