// File: /workspace/github_cpp_makefile_star2_O2/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 0x385f(%rip), %rsi      # 0x60bc
leaq -0x128(%rbp), %r14
leaq -0x40(%rbp), %r15
movq %r14, %rdi
movq %r15, %rdx
callq 0x258e
movq 0x674e(%rip), %r12      # 0x8fc8
leaq -0x148(%rbp), %r13
movq %r12, %rdi
leaq 0x38c2(%rip), %rsi      # 0x614d
callq 0x21d0
movq 0x6749(%rip), %rdi      # 0x8fe0
movq %r14, %rsi
callq 0x2060
movq %r13, %rdi
movq %r14, %rsi
callq 0x2290
movq %r15, %rdi
movq %r13, %rsi
callq 0x3642
movq %r13, %rdi
callq 0x20e0
movq -0x40(%rbp), %rdi
leaq 0x3889(%rip), %rsi      # 0x6151
cmpq %rdi, -0x38(%rbp)
je 0x2ad6
leaq 0x3889(%rip), %rsi      # 0x6162
callq 0x3711
testb %al, %al
jne 0x2b23
movq -0x40(%rbp), %rdi
leaq 0x3876(%rip), %rsi      # 0x6167
callq 0x3711
testb %al, %al
jne 0x2b23
movq -0x40(%rbp), %rdi
leaq 0x3860(%rip), %rsi      # 0x6169
callq 0x3711
testb %al, %al
je 0x2920
movq -0x48(%rbp), %rdi
callq 0x2bd2
jmp 0x2b16
movq -0x40(%rbp), %rdi
leaq 0x3842(%rip), %rsi      # 0x616d
callq 0x3711
testb %al, %al
je 0x297b
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rax, %rcx
leaq 0x382b(%rip), %rsi      # 0x6171
cmpq $0x21, %rcx
jb 0x2ad6
addq $0x20, %rax
leaq -0x108(%rbp), %rdi
movq %rax, %rsi
callq 0x2290
movq -0x48(%rbp), %rdi
leaq -0x108(%rbp), %rbx
movq %rbx, %rsi
callq 0x2c70
jmp 0x2b0e
movq -0x40(%rbp), %rdi
leaq 0x3809(%rip), %rsi      # 0x618f
callq 0x3711
testb %al, %al
je 0x29d6
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rax, %rcx
leaq 0x37d0(%rip), %rsi      # 0x6171
cmpq $0x21, %rcx
jb 0x2ad6
addq $0x20, %rax
leaq -0xe8(%rbp), %rdi
movq %rax, %rsi
callq 0x2290
movq -0x48(%rbp), %rdi
leaq -0xe8(%rbp), %rbx
movq %rbx, %rsi
callq 0x310a
jmp 0x2b0e
movq -0x40(%rbp), %rdi
leaq 0x37b2(%rip), %rsi      # 0x6193
callq 0x3711
testb %al, %al
je 0x2a31
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rax, %rcx
leaq 0x3775(%rip), %rsi      # 0x6171
cmpq $0x21, %rcx
jb 0x2ad6
addq $0x20, %rax
leaq -0xc8(%rbp), %rdi
movq %rax, %rsi
callq 0x2290
movq -0x48(%rbp), %rdi
leaq -0xc8(%rbp), %rbx
movq %rbx, %rsi
callq 0x321a
jmp 0x2b0e
movq -0x40(%rbp), %rdi
leaq 0x375c(%rip), %rsi      # 0x6198
callq 0x3711
testb %al, %al
je 0x2aa3
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rax, %rcx
leaq 0x371a(%rip), %rsi      # 0x6171
cmpq $0x41, %rcx
jb 0x2ad6
addq $0x20, %rax
leaq -0xa8(%rbp), %rdi
movq %rax, %rsi
callq 0x2290
movq -0x40(%rbp), %rsi
addq $0x40, %rsi
leaq -0x68(%rbp), %rdi
callq 0x2290
movq -0x48(%rbp), %rdi
leaq -0xa8(%rbp), %rbx
movq %rbx, %rsi
leaq -0x68(%rbp), %rdx
callq 0x33c4
leaq -0x68(%rbp), %rdi
callq 0x20e0
jmp 0x2b0e
movq -0x40(%rbp), %rdi
leaq 0x36ef(%rip), %rsi      # 0x619d
callq 0x3711
leaq 0x3705(%rip), %rsi      # 0x61bf
testb %al, %al
je 0x2ad6
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rax, %rcx
leaq 0x36d1(%rip), %rsi      # 0x61a1
cmpq $0x21, %rcx
jae 0x2ae8
movq %r12, %rdi
callq 0x21d0
movq %rax, %rdi
callq 0x20f0
jmp 0x2b16
addq $0x20, %rax
leaq -0x88(%rbp), %rdi
movq %rax, %rsi
callq 0x2290
movq -0x48(%rbp), %rdi
leaq -0x88(%rbp), %rbx
movq %rbx, %rsi
callq 0x2d6e
movq %rbx, %rdi
callq 0x20e0
movq %r15, %rdi
callq 0x25fc
jmp 0x2881
leaq -0x40(%rbp), %rdi
callq 0x25fc
leaq -0x128(%rbp), %rdi
callq 0x20e0
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
jmp 0x2b92
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x20e0
jmp 0x2b67
movq %rax, %rbx
leaq -0xa8(%rbp), %rdi
jmp 0x2b92
movq %rax, %rbx
leaq -0xc8(%rbp), %rdi
jmp 0x2b92
movq %rax, %rbx
leaq -0xe8(%rbp), %rdi
jmp 0x2b92
movq %rax, %rbx
leaq -0x108(%rbp), %rdi
callq 0x20e0
jmp 0x2baf
jmp 0x2bba
movq %rax, %rbx
leaq -0x148(%rbp), %rdi
callq 0x20e0
jmp 0x2bbd
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x25fc
jmp 0x2bbd
movq %rax, %rbx
leaq -0x128(%rbp), %rdi
callq 0x20e0
movq %rbx, %rdi
callq 0x2330
nop