// File: 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
subq $0x1c0, %rsp            # imm = 0x1C0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x150(%rbp)
leaq -0x29(%rbp), %rdi
movq %rdi, -0x148(%rbp)
callq 0x3480
movq -0x148(%rbp), %rdx
leaq 0x5fd4(%rip), %rsi      # 0xa0bc
leaq -0x28(%rbp), %rdi
callq 0x3750
jmp 0x40f3
leaq -0x29(%rbp), %rdi
callq 0x32e0
jmp 0x40fe
movq 0x9ec3(%rip), %rdi      # 0xdfc8
leaq 0x6041(%rip), %rsi      # 0xa14d
callq 0x3280
jmp 0x4113
movq 0x9ec6(%rip), %rdi      # 0xdfe0
leaq -0x28(%rbp), %rsi
callq 0x3090
jmp 0x4125
leaq -0x78(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x3100
jmp 0x4134
leaq -0x58(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x5940
jmp 0x4143
leaq -0x78(%rbp), %rdi
callq 0x3170
leaq -0x58(%rbp), %rdi
callq 0x5a60
cmpq $0x0, %rax
jne 0x41f2
movq 0x9e62(%rip), %rdi      # 0xdfc8
leaq 0x5fe4(%rip), %rsi      # 0xa151
callq 0x3280
movq %rax, -0x158(%rbp)
jmp 0x417b
movq -0x158(%rbp), %rdi
movq 0x9e2f(%rip), %rsi      # 0xdfb8
callq 0x32c0
jmp 0x4190
movl $0x2, -0x7c(%rbp)
jmp 0x4792
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x29(%rbp), %rdi
callq 0x32e0
jmp 0x47e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x47df
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x3170
jmp 0x47df
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x47c2
xorl %eax, %eax
movl %eax, %esi
leaq -0x58(%rbp), %rdi
callq 0x5a80
movq %rax, %rdi
leaq 0x5f59(%rip), %rsi      # 0xa162
callq 0x5aa0
movb %al, -0x159(%rbp)
jmp 0x4216
movb -0x159(%rbp), %al
testb $0x1, %al
jne 0x4252
jmp 0x4222
xorl %eax, %eax
movl %eax, %esi
leaq -0x58(%rbp), %rdi
callq 0x5a80
movq %rax, %rdi
leaq 0x5f2e(%rip), %rsi      # 0xa167
callq 0x5aa0
movb %al, -0x15a(%rbp)
jmp 0x4246
movb -0x15a(%rbp), %al
testb $0x1, %al
jne 0x4252
jmp 0x425e
movl $0x3, -0x7c(%rbp)
jmp 0x4792
xorl %eax, %eax
movl %eax, %esi
leaq -0x58(%rbp), %rdi
callq 0x5a80
movq %rax, %rdi
leaq 0x5ef4(%rip), %rsi      # 0xa169
callq 0x5aa0
movb %al, -0x15b(%rbp)
jmp 0x4282
movb -0x15b(%rbp), %al
testb $0x1, %al
jne 0x428e
jmp 0x42a1
movq -0x150(%rbp), %rdi
callq 0x4800
jmp 0x429c
jmp 0x4789
xorl %eax, %eax
movl %eax, %esi
leaq -0x58(%rbp), %rdi
callq 0x5a80
movq %rax, %rdi
leaq 0x5eb5(%rip), %rsi      # 0xa16d
callq 0x5aa0
movb %al, -0x15c(%rbp)
jmp 0x42c5
movb -0x15c(%rbp), %al
testb $0x1, %al
jne 0x42d4
jmp 0x4382
leaq -0x58(%rbp), %rdi
callq 0x5a60
cmpq $0x2, %rax
jae 0x4320
movq 0x9cde(%rip), %rdi      # 0xdfc8
leaq 0x5e80(%rip), %rsi      # 0xa171
callq 0x3280
movq %rax, -0x168(%rbp)
jmp 0x42ff
movq -0x168(%rbp), %rdi
movq 0x9cab(%rip), %rsi      # 0xdfb8
callq 0x32c0
jmp 0x4314
movl $0x2, -0x7c(%rbp)
jmp 0x4792
leaq -0x58(%rbp), %rdi
movl $0x1, %esi
callq 0x5a80
movq %rax, %rsi
leaq -0xa0(%rbp), %rdi
callq 0x3100
jmp 0x433f
movq -0x150(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x48d0
jmp 0x4354
leaq -0xa0(%rbp), %rdi
callq 0x3170
jmp 0x4787
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x3170
jmp 0x47c2
xorl %eax, %eax
movl %eax, %esi
leaq -0x58(%rbp), %rdi
callq 0x5a80
movq %rax, %rdi
leaq 0x5df6(%rip), %rsi      # 0xa18f
callq 0x5aa0
movb %al, -0x169(%rbp)
jmp 0x43a6
movb -0x169(%rbp), %al
testb $0x1, %al
jne 0x43b5
jmp 0x4463
leaq -0x58(%rbp), %rdi
callq 0x5a60
cmpq $0x2, %rax
jae 0x4401
movq 0x9bfd(%rip), %rdi      # 0xdfc8
leaq 0x5d9f(%rip), %rsi      # 0xa171
callq 0x3280
movq %rax, -0x178(%rbp)
jmp 0x43e0
movq -0x178(%rbp), %rdi
movq 0x9bca(%rip), %rsi      # 0xdfb8
callq 0x32c0
jmp 0x43f5
movl $0x2, -0x7c(%rbp)
jmp 0x4792
leaq -0x58(%rbp), %rdi
movl $0x1, %esi
callq 0x5a80
movq %rax, %rsi
leaq -0xc0(%rbp), %rdi
callq 0x3100
jmp 0x4420
movq -0x150(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x5010
jmp 0x4435
leaq -0xc0(%rbp), %rdi
callq 0x3170
jmp 0x4785
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x3170
jmp 0x47c2
xorl %eax, %eax
movl %eax, %esi
leaq -0x58(%rbp), %rdi
callq 0x5a80
movq %rax, %rdi
leaq 0x5d19(%rip), %rsi      # 0xa193
callq 0x5aa0
movb %al, -0x179(%rbp)
jmp 0x4487
movb -0x179(%rbp), %al
testb $0x1, %al
jne 0x4496
jmp 0x4544
leaq -0x58(%rbp), %rdi
callq 0x5a60
cmpq $0x2, %rax
jae 0x44e2
movq 0x9b1c(%rip), %rdi      # 0xdfc8
leaq 0x5cbe(%rip), %rsi      # 0xa171
callq 0x3280
movq %rax, -0x188(%rbp)
jmp 0x44c1
movq -0x188(%rbp), %rdi
movq 0x9ae9(%rip), %rsi      # 0xdfb8
callq 0x32c0
jmp 0x44d6
movl $0x2, -0x7c(%rbp)
jmp 0x4792
leaq -0x58(%rbp), %rdi
movl $0x1, %esi
callq 0x5a80
movq %rax, %rsi
leaq -0xe0(%rbp), %rdi
callq 0x3100
jmp 0x4501
movq -0x150(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x5200
jmp 0x4516
leaq -0xe0(%rbp), %rdi
callq 0x3170
jmp 0x4783
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x3170
jmp 0x47c2
xorl %eax, %eax
movl %eax, %esi
leaq -0x58(%rbp), %rdi
callq 0x5a80
movq %rax, %rdi
leaq 0x5c3d(%rip), %rsi      # 0xa198
callq 0x5aa0
movb %al, -0x189(%rbp)
jmp 0x4568
movb -0x189(%rbp), %al
testb $0x1, %al
jne 0x4577
jmp 0x4671
leaq -0x58(%rbp), %rdi
callq 0x5a60
cmpq $0x3, %rax
jae 0x45c3
movq 0x9a3b(%rip), %rdi      # 0xdfc8
leaq 0x5bdd(%rip), %rsi      # 0xa171
callq 0x3280
movq %rax, -0x198(%rbp)
jmp 0x45a2
movq -0x198(%rbp), %rdi
movq 0x9a08(%rip), %rsi      # 0xdfb8
callq 0x32c0
jmp 0x45b7
movl $0x2, -0x7c(%rbp)
jmp 0x4792
leaq -0x58(%rbp), %rdi
movl $0x1, %esi
callq 0x5a80
movq %rax, %rsi
leaq -0x100(%rbp), %rdi
callq 0x3100
jmp 0x45e2
leaq -0x58(%rbp), %rdi
movl $0x2, %esi
callq 0x5a80
movq %rax, %rsi
leaq -0x120(%rbp), %rdi
callq 0x3100
jmp 0x4601
movq -0x150(%rbp), %rdi
leaq -0x100(%rbp), %rsi
leaq -0x120(%rbp), %rdx
callq 0x54f0
jmp 0x461d
leaq -0x120(%rbp), %rdi
callq 0x3170
leaq -0x100(%rbp), %rdi
callq 0x3170
jmp 0x4781
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x4660
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x3170
leaq -0x100(%rbp), %rdi
callq 0x3170
jmp 0x47c2
xorl %eax, %eax
movl %eax, %esi
leaq -0x58(%rbp), %rdi
callq 0x5a80
movq %rax, %rdi
leaq 0x5b15(%rip), %rsi      # 0xa19d
callq 0x5aa0
movb %al, -0x199(%rbp)
jmp 0x4695
movb -0x199(%rbp), %al
testb $0x1, %al
jne 0x46a4
jmp 0x474c
leaq -0x58(%rbp), %rdi
callq 0x5a60
cmpq $0x2, %rax
jae 0x46f0
movq 0x990e(%rip), %rdi      # 0xdfc8
leaq 0x5ae0(%rip), %rsi      # 0xa1a1
callq 0x3280
movq %rax, -0x1a8(%rbp)
jmp 0x46cf
movq -0x1a8(%rbp), %rdi
movq 0x98db(%rip), %rsi      # 0xdfb8
callq 0x32c0
jmp 0x46e4
movl $0x2, -0x7c(%rbp)
jmp 0x4792
leaq -0x58(%rbp), %rdi
movl $0x1, %esi
callq 0x5a80
movq %rax, %rsi
leaq -0x140(%rbp), %rdi
callq 0x3100
jmp 0x470f
movq -0x150(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x4a50
jmp 0x4724
leaq -0x140(%rbp), %rdi
callq 0x3170
jmp 0x477f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x3170
jmp 0x47c2
movq 0x9875(%rip), %rdi      # 0xdfc8
leaq 0x5a65(%rip), %rsi      # 0xa1bf
callq 0x3280
movq %rax, -0x1b0(%rbp)
jmp 0x4768
movq -0x1b0(%rbp), %rdi
movq 0x9842(%rip), %rsi      # 0xdfb8
callq 0x32c0
jmp 0x477d
jmp 0x477f
jmp 0x4781
jmp 0x4783
jmp 0x4785
jmp 0x4787
jmp 0x4789
jmp 0x478b
movl $0x0, -0x7c(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x38d0
movl -0x7c(%rbp), %eax
movl %eax, -0x1b4(%rbp)
testl %eax, %eax
je 0x47bd
jmp 0x47aa
movl -0x1b4(%rbp), %eax
subl $0x2, %eax
je 0x40fc
jmp 0x47bb
jmp 0x47cd
jmp 0x40fc
leaq -0x58(%rbp), %rdi
callq 0x38d0
jmp 0x47df
leaq -0x28(%rbp), %rdi
callq 0x3170
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0x3170
movq -0x38(%rbp), %rdi
callq 0x3470
nopw %cs:(%rax,%rax)