// File: /workspace/github_cpp_makefile_star2_O1/hyp1231[P]FMSS/main.cpp
// Function: exec_opt(FileSystem&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&)
bool exec_opt(FileSystem& S, vector<string>& opt) {
	if(opt.empty()) { return true; }
	bool flag = true; string str;
	switch(string_to_enum[opt[0]]) {
		case _help:			// help
			S.Help(); break;
		case _exit:			// exit
			flag = false; break;
        case _create:       // touch
            S.CreateFile(opt[1]); break;
        case _delete:       // rm
        	if((int)opt.size() > 2) {
        		S.DeleteFile(opt[2], opt[1]);
        	} else {
        		S.DeleteFile(opt[1]);
        	}
            break;
        case _list:         // ls
            if ((int)opt.size() > 2) {
                cout << "[Error] Too many parameters in command \"ls\"" << endl;
                S.Help();
            } else if((int)opt.size() == 2) {	// -a or -l
            	S.ListFile(opt[1]);
            } else {					// none
            	S.ListFile();
            } 
            break;
        case _move:			// mv
        	S.MoveFile(opt[1], opt[2]); break;
        case _print:		// cat
        	S.PrintFile(opt[1]); break;
        case _write:		// echo
        	if(opt.size() != 4 || opt[2] != ">") {
        		cout << "[Error] Illegal param" << endl;
        		break;
        	}
        	S.WriteFile(opt[1], opt[3]); break;
        case _mkdir:        // mkdir
            S.CreateDir(opt[1]); break;
        case _cd:           // cd
            if ((int)opt.size() < 2) {
                cout << "[Error] Directory path should be provided" << endl;
                cout << "cd [dirpath]" << endl;
                break;
            }
            S.OpenDir(opt[1]); break;
        case _copy:			// cp
        	S.CopyFile(opt[1], opt[2]); break;
		case undefined_opt:	// unknowned
			cout << "[Error] Unknown option" << endl; break;
		default: break;
	}
	return flag;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rsi, %r15
movq (%rsi), %rsi
cmpq 0x8(%r15), %rsi
je 0x7a1d
movq %rdi, %r14
leaq 0x98(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq $0x0, -0x8(%rbp)
movb $0x0, (%rbp)
leaq 0x5810(%rip), %rdi      # 0xd1f8
callq 0x827a
movl (%rax), %eax
movb $0x1, %bl
cmpq $0xb, %rax
ja 0x7d14
leaq 0x1d2a(%rip), %rcx      # 0x972c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x16, %r12d
leaq 0x1dc0(%rip), %r13      # 0x97d8
jmp 0x7be0
movb $0x1, %bl
jmp 0x7d31
movq (%r15), %rdx
leaq 0x20(%rdx), %rsi
addq $0x40, %rdx
movq %r14, %rdi
callq 0x5ec4
jmp 0x7d14
movq (%r15), %r12
movq 0x8(%r15), %rax
subq %r12, %rax
shrq $0x5, %rax
cmpl $0x3, %eax
jl 0x7c25
leaq 0x78(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x20(%r12), %rsi
movq 0x28(%r12), %rdx
addq %rsi, %rdx
leaq 0x68(%rsp), %rdi
callq 0x6c9e
addq $0x40, %r12
leaq 0x68(%rsp), %rdx
movq %r14, %rdi
movq %r12, %rsi
callq 0x42ee
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x7d14
movq 0x78(%rsp), %rsi
jmp 0x7d0c
movq (%r15), %rsi
addq $0x20, %rsi
movq %r14, %rdi
callq 0x51ac
jmp 0x7d14
xorl %ebx, %ebx
jmp 0x7d14
movq (%r15), %rsi
addq $0x20, %rsi
movq %r14, %rdi
callq 0x406c
jmp 0x7d14
movq (%r15), %rsi
addq $0x20, %rsi
movq %r14, %rdi
callq 0x672a
jmp 0x7d14
movq (%r15), %rax
movq 0x8(%r15), %rcx
subq %rax, %rcx
movq %rcx, %rdx
shrq $0x5, %rdx
cmpl $0x3, %edx
jl 0x7c72
movq 0x54cd(%rip), %rdi      # 0xcfd0
leaq 0x1c55(%rip), %rsi      # 0x975f
movl $0x2b, %edx
callq 0x2240
movq 0x54b5(%rip), %rdi      # 0xcfd0
callq 0x20f0
movq %r14, %rdi
callq 0x30ca
jmp 0x7d14
movq (%r15), %rdx
leaq 0x20(%rdx), %rsi
addq $0x40, %rdx
movq %r14, %rdi
callq 0x654c
jmp 0x7d14
movq (%r15), %rsi
movq 0x8(%r15), %rax
subq %rsi, %rax
shrq $0x5, %rax
cmpl $0x1, %eax
jg 0x7cc1
movq 0x546d(%rip), %rdi      # 0xcfd0
leaq 0x1c37(%rip), %rsi      # 0x97a1
movl $0x29, %edx
callq 0x2240
movq 0x5455(%rip), %rdi      # 0xcfd0
callq 0x20f0
movq 0x5449(%rip), %rdi      # 0xcfd0
leaq 0x1c3d(%rip), %rsi      # 0x97cb
movl $0xc, %edx
callq 0x2240
movq 0x5431(%rip), %rdi      # 0xcfd0
callq 0x20f0
jmp 0x7d14
movq (%r15), %rdi
movq 0x8(%r15), %rax
subq %rdi, %rax
movl $0x15, %r12d
leaq 0x1bcb(%rip), %r13      # 0x978b
cmpq $0x80, %rax
jne 0x7be0
addq $0x40, %rdi
leaq 0x19ec(%rip), %rsi      # 0x95bf
callq 0x2090
testl %eax, %eax
je 0x7d45
movq 0x53e9(%rip), %r14      # 0xcfd0
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x2240
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %esi
movq 0x53bd(%rip), %rdi      # 0xcfd0
callq 0x2030
movq %rax, %rdi
callq 0x2120
jmp 0x7d14
leaq 0x58(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x19fc(%rip), %rsi      # 0x9631
leaq 0x19f9(%rip), %rdx      # 0x9635
leaq 0x48(%rsp), %rdi
callq 0x2910
addq $0x20, %r12
leaq 0x48(%rsp), %rdx
movq %r14, %rdi
movq %r12, %rsi
callq 0x42ee
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x7d14
movq 0x58(%rsp), %rsi
jmp 0x7d0c
movabsq $0x1fffffffe0, %rdx     # imm = 0x1FFFFFFFE0
andq %rdx, %rcx
cmpq $0x40, %rcx
jne 0x7ccf
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0x6c9e
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x4ac0
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x7d14
movq 0x38(%rsp), %rsi
jmp 0x7d0c
addq $0x20, %rsi
movq %r14, %rdi
callq 0x542a
jmp 0x7d14
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1952(%rip), %rsi      # 0x9631
leaq 0x194f(%rip), %rdx      # 0x9635
leaq 0x8(%rsp), %rdi
callq 0x2910
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x4ac0
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x7d14
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x88(%rsp), %rdi
cmpq %rbp, %rdi
je 0x7d31
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2200
movl %ebx, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r15), %rdx
leaq 0x20(%rdx), %rsi
addq $0x60, %rdx
movq %r14, %rdi
callq 0x68d4
jmp 0x7d14
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x7db9
movq 0x18(%rsp), %rsi
jmp 0x7daa
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x7db9
movq 0x38(%rsp), %rsi
jmp 0x7daa
jmp 0x7db6
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x7db9
movq 0x58(%rsp), %rsi
jmp 0x7daa
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x7db9
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2200
jmp 0x7db9
jmp 0x7db6
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %rbp, %rdi
je 0x7dd6
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2200
movq %rbx, %rdi
callq 0x2350