// File: /workspace/github_cpp_makefile_star2_O2/talyerushalmy[P]SimpleFileSystem/src/Environment.cpp
// Function: Environment::handleInput(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void Environment::handleInput(const string& input)
{
	if (verbose == 2 || verbose == 3)
		std::cout << input << std::endl;

	string first_word = input.substr(0, input.find(' '));
	string args = input.substr(first_word.size(), input.size() - first_word.size());

	switch (CommandTools::stringToCommand(first_word))
	{
	case CommandType::EmptyCommandType:
		// do and print nothing
		break;
	case CommandType::CdCommandType:
	{
		CdCommand cd_command(first_word, args);
		cd_command.execute(this->fs);
		this->addToHistory(new CdCommand(cd_command));
	}
	break;
	case CommandType::CpCommandType:
	{
		CpCommand cp_command(first_word, args);
		cp_command.execute(this->fs);
		this->addToHistory(new CpCommand(cp_command));
	}
	break;
	case CommandType::ExecCommandType:
	{
		ExecCommand exec_command(first_word, args, this->getHistory());
		exec_command.execute(this->fs);
		this->addToHistory(new ExecCommand(exec_command));
	}
	break;
	case CommandType::HistoryCommandType:
	{
		HistoryCommand history_command(first_word, args, this->getHistory());
		history_command.execute(this->fs);
		this->addToHistory(new HistoryCommand(history_command));
	}
	break;
	case CommandType::LsCommandType:
	{
		LsCommand ls_command(first_word, args);
		ls_command.execute(this->fs);
		this->addToHistory(new LsCommand(ls_command));
	}
	break;
	case CommandType::MkdirCommandType:
	{
		MkdirCommand mkdir_command(first_word, args);
		mkdir_command.execute(this->fs);
		this->addToHistory(new MkdirCommand(mkdir_command));
	}
	break;
	case CommandType::MkfileCommandType:
	{
		MkfileCommand mkfile_command(first_word, args);
		mkfile_command.execute(this->fs);
		this->addToHistory(new MkfileCommand(mkfile_command));
	}
	break;
	case CommandType::MvCommandType:
	{
		MvCommand mv_command(first_word, args);
		mv_command.execute(this->fs);
		this->addToHistory(new MvCommand(mv_command));
	}
	break;
	case CommandType::PwdCommandType:
	{
		PwdCommand pwd_command(first_word, args);
		pwd_command.execute(this->fs);
		this->addToHistory(new PwdCommand(pwd_command));
	}
	break;
	case CommandType::RenameCommandType:
	{
		RenameCommand rename_command(first_word, args);
		rename_command.execute(this->fs);
		this->addToHistory(new RenameCommand(rename_command));
	}
	break;
	case CommandType::RmCommandType:
	{
		RmCommand rm_command(first_word, args);
		rm_command.execute(this->fs);
		this->addToHistory(new RmCommand(rm_command));
	}
	break;
	case CommandType::VerboseCommandType:
	{
		VerboseCommand verbose_command(first_word, args);
		verbose_command.execute(this->fs);
		this->addToHistory(new VerboseCommand(verbose_command));
	}
	break;
	case CommandType::UnknownCommandType:
	default:
		ErrorCommand error_command(first_word, args);
		error_command.execute(this->fs);
		this->addToHistory(new ErrorCommand(error_command));
		break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x3d8, %rsp            # imm = 0x3D8
movq %rsi, %r14
movq %rdi, %rbx
leaq 0xd72f(%rip), %rax      # 0x1118c
movl (%rax), %eax
andl $-0x2, %eax
cmpl $0x2, %eax
jne 0x3a7e
movq 0xd55a(%rip), %rdi      # 0x10fc8
movq %r14, %rsi
callq 0x3150
movq %rax, %rdi
callq 0x30d0
pushq $0x20
popq %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x3200
leaq -0x88(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x31a0
movq 0x8(%r15), %rdx
movq 0x8(%r14), %rcx
subq %rdx, %rcx
leaq -0xa8(%rbp), %rdi
movq %r14, %rsi
callq 0x31a0
leaq -0x88(%rbp), %rdi
callq 0x81c6
cmpl $0xd, %eax
ja 0x3ea8
movl %eax, %eax
leaq 0x7546(%rip), %rcx      # 0xb020
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0x1e8(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x3210
leaq -0x1c8(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x3210
leaq -0x68(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
leaq -0x1c8(%rbp), %rdx
callq 0x4f20
leaq -0x1c8(%rbp), %rdi
callq 0x30c0
leaq -0x1e8(%rbp), %rdi
callq 0x30c0
leaq 0x18(%rbx), %rsi
leaq -0x68(%rbp), %rdi
callq 0x4e46
pushq $0x48
popq %rdi
callq 0x3190
movq %rax, %r14
leaq -0x68(%rbp), %rsi
movq %rax, %rdi
callq 0x48ba
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4444
jmp 0x41d9
leaq -0x328(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x3210
leaq -0x308(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x3210
leaq -0x68(%rbp), %rdi
leaq -0x328(%rbp), %rsi
leaq -0x308(%rbp), %rdx
movq %rbx, %rcx
callq 0x7a82
leaq -0x308(%rbp), %rdi
callq 0x30c0
leaq -0x328(%rbp), %rdi
callq 0x30c0
leaq 0x18(%rbx), %rsi
leaq -0x68(%rbp), %rdi
callq 0x78f4
pushq $0x50
popq %rdi
callq 0x3190
movq %rax, %r14
leaq -0x68(%rbp), %rsi
movq %rax, %rdi
callq 0x47fc
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4444
jmp 0x41d9
leaq -0x2a8(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x3210
leaq -0x288(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x3210
leaq -0x68(%rbp), %rdi
leaq -0x2a8(%rbp), %rsi
leaq -0x288(%rbp), %rdx
callq 0x5c92
leaq -0x288(%rbp), %rdi
callq 0x30c0
leaq -0x2a8(%rbp), %rdi
callq 0x30c0
leaq 0x18(%rbx), %rsi
leaq -0x68(%rbp), %rdi
callq 0x570c
pushq $0x48
popq %rdi
callq 0x3190
movq %rax, %r14
leaq -0x68(%rbp), %rsi
movq %rax, %rdi
callq 0x484e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4444
jmp 0x41d9
leaq -0x368(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x3210
leaq -0x348(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x3210
leaq -0x68(%rbp), %rdi
leaq -0x368(%rbp), %rsi
leaq -0x348(%rbp), %rdx
movq %rbx, %rcx
callq 0x8162
leaq -0x348(%rbp), %rdi
callq 0x30c0
leaq -0x368(%rbp), %rdi
callq 0x30c0
leaq 0x18(%rbx), %rsi
leaq -0x68(%rbp), %rdi
callq 0x7f50
pushq $0x50
popq %rdi
callq 0x3190
movq %rax, %r14
leaq -0x68(%rbp), %rsi
movq %rax, %rdi
callq 0x47ce
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4444
jmp 0x41d9
leaq -0x268(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x3210
leaq -0x248(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x3210
leaq -0x68(%rbp), %rdi
leaq -0x268(%rbp), %rsi
leaq -0x248(%rbp), %rdx
callq 0x629c
leaq -0x248(%rbp), %rdi
callq 0x30c0
leaq -0x268(%rbp), %rdi
callq 0x30c0
leaq 0x18(%rbx), %rsi
leaq -0x68(%rbp), %rdi
callq 0x5d66
pushq $0x48
popq %rdi
callq 0x3190
movq %rax, %r14
leaq -0x68(%rbp), %rsi
movq %rax, %rdi
callq 0x4872
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4444
jmp 0x41d9
leaq -0x128(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x3210
leaq -0x108(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x3210
leaq -0x68(%rbp), %rdi
leaq -0x128(%rbp), %rsi
leaq -0x108(%rbp), %rdx
callq 0x7cbc
leaq -0x108(%rbp), %rdi
callq 0x30c0
leaq -0x128(%rbp), %rdi
callq 0x30c0
leaq 0x18(%rbx), %rsi
leaq -0x68(%rbp), %rdi
callq 0x7b60
pushq $0x48
popq %rdi
callq 0x3190
movq %rax, %r14
leaq -0x68(%rbp), %rsi
movq %rax, %rdi
callq 0x4926
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4444
jmp 0x41d9
leaq -0x2e8(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x3210
leaq -0x2c8(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x3210
leaq -0x68(%rbp), %rdi
leaq -0x2e8(%rbp), %rsi
leaq -0x2c8(%rbp), %rdx
callq 0x5638
leaq -0x2c8(%rbp), %rdi
callq 0x30c0
leaq -0x2e8(%rbp), %rdi
callq 0x30c0
leaq 0x18(%rbx), %rsi
leaq -0x68(%rbp), %rdi
callq 0x528c
pushq $0x48
popq %rdi
callq 0x3190
movq %rax, %r14
leaq -0x68(%rbp), %rsi
movq %rax, %rdi
callq 0x482a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4444
jmp 0x41d9
leaq -0xe8(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x3210
leaq -0xc8(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x3210
leaq -0x68(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
leaq -0xc8(%rbp), %rdx
callq 0x7d90
leaq -0xc8(%rbp), %rdi
callq 0x30c0
leaq -0xe8(%rbp), %rdi
callq 0x30c0
leaq 0x18(%rbx), %rsi
leaq -0x68(%rbp), %rdi
callq 0x7e0e
pushq $0x48
popq %rdi
callq 0x3190
movq %rax, %r14
leaq -0x68(%rbp), %rsi
movq %rax, %rdi
callq 0x494a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4444
jmp 0x41d9
leaq -0x3e8(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x3210
leaq -0x3c8(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x3210
leaq -0x68(%rbp), %rdi
leaq -0x3e8(%rbp), %rsi
leaq -0x3c8(%rbp), %rdx
callq 0x51b8
leaq -0x3c8(%rbp), %rdi
callq 0x30c0
leaq -0x3e8(%rbp), %rdi
callq 0x30c0
leaq 0x18(%rbx), %rsi
leaq -0x68(%rbp), %rdi
callq 0x4ff4
pushq $0x48
popq %rdi
callq 0x3190
movq %rax, %r14
leaq -0x68(%rbp), %rsi
movq %rax, %rdi
callq 0x4786
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4444
jmp 0x41d9
leaq -0x3a8(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x3210
leaq -0x388(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x3210
leaq -0x68(%rbp), %rdi
leaq -0x3a8(%rbp), %rsi
leaq -0x388(%rbp), %rdx
callq 0x6842
leaq -0x388(%rbp), %rdi
callq 0x30c0
leaq -0x3a8(%rbp), %rdi
callq 0x30c0
leaq 0x18(%rbx), %rsi
leaq -0x68(%rbp), %rdi
callq 0x6370
pushq $0x48
popq %rdi
callq 0x3190
movq %rax, %r14
leaq -0x68(%rbp), %rsi
movq %rax, %rdi
callq 0x47aa
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4444
jmp 0x41d9
leaq -0x228(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x3210
leaq -0x208(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x3210
leaq -0x68(%rbp), %rdi
leaq -0x228(%rbp), %rsi
leaq -0x208(%rbp), %rdx
callq 0x6ee8
leaq -0x208(%rbp), %rdi
callq 0x30c0
leaq -0x228(%rbp), %rdi
callq 0x30c0
leaq 0x18(%rbx), %rsi
leaq -0x68(%rbp), %rdi
callq 0x6916
pushq $0x48
popq %rdi
callq 0x3190
movq %rax, %r14
leaq -0x68(%rbp), %rsi
movq %rax, %rdi
callq 0x4896
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4444
jmp 0x41d9
leaq -0x168(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x3210
leaq -0x148(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x3210
leaq -0x68(%rbp), %rdi
leaq -0x168(%rbp), %rsi
leaq -0x148(%rbp), %rdx
callq 0x7816
leaq -0x148(%rbp), %rdi
callq 0x30c0
leaq -0x168(%rbp), %rdi
callq 0x30c0
leaq 0x18(%rbx), %rsi
leaq -0x68(%rbp), %rdi
callq 0x7420
pushq $0x48
popq %rdi
callq 0x3190
movq %rax, %r14
leaq -0x68(%rbp), %rsi
movq %rax, %rdi
callq 0x4902
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4444
jmp 0x41d9
leaq -0x1a8(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x3210
leaq -0x188(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x3210
leaq -0x68(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
leaq -0x188(%rbp), %rdx
callq 0x734c
leaq -0x188(%rbp), %rdi
callq 0x30c0
leaq -0x1a8(%rbp), %rdi
callq 0x30c0
leaq 0x18(%rbx), %rsi
leaq -0x68(%rbp), %rdi
callq 0x6fbc
pushq $0x48
popq %rdi
callq 0x3190
movq %rax, %r14
leaq -0x68(%rbp), %rsi
movq %rax, %rdi
callq 0x48de
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4444
leaq -0x68(%rbp), %rdi
callq 0x49c6
leaq -0xa8(%rbp), %rdi
callq 0x30c0
leaq -0x88(%rbp), %rdi
callq 0x30c0
addq $0x3d8, %rsp            # imm = 0x3D8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4220
jmp 0x4220
jmp 0x4220
jmp 0x4220
jmp 0x4220
jmp 0x4220
jmp 0x4220
jmp 0x4220
jmp 0x4220
jmp 0x4220
jmp 0x4220
jmp 0x4220
movq %rax, %rbx
movq %r14, %rdi
callq 0x3170
jmp 0x4410
movq %rax, %rbx
leaq -0x188(%rbp), %rdi
callq 0x30c0
jmp 0x4337
movq %rax, %rbx
leaq -0x148(%rbp), %rdi
callq 0x30c0
jmp 0x4346
movq %rax, %rbx
leaq -0x208(%rbp), %rdi
callq 0x30c0
jmp 0x4355
movq %rax, %rbx
leaq -0x388(%rbp), %rdi
callq 0x30c0
jmp 0x4361
movq %rax, %rbx
leaq -0x3c8(%rbp), %rdi
callq 0x30c0
jmp 0x436d
movq %rax, %rbx
leaq -0xc8(%rbp), %rdi
callq 0x30c0
jmp 0x4385
movq %rax, %rbx
leaq -0x1c8(%rbp), %rdi
callq 0x30c0
jmp 0x4379
movq %rax, %rbx
leaq -0x2c8(%rbp), %rdi
callq 0x30c0
jmp 0x4391
movq %rax, %rbx
leaq -0x108(%rbp), %rdi
callq 0x30c0
jmp 0x439d
movq %rax, %rbx
leaq -0x248(%rbp), %rdi
callq 0x30c0
jmp 0x43a9
movq %rax, %rbx
leaq -0x348(%rbp), %rdi
callq 0x30c0
jmp 0x43b5
movq %rax, %rbx
leaq -0x288(%rbp), %rdi
callq 0x30c0
jmp 0x43c1
movq %rax, %rbx
leaq -0x308(%rbp), %rdi
callq 0x30c0
jmp 0x43cd
movq %rax, %rbx
leaq -0x1a8(%rbp), %rdi
jmp 0x43d4
movq %rax, %rbx
leaq -0x168(%rbp), %rdi
jmp 0x43d4
movq %rax, %rbx
leaq -0x228(%rbp), %rdi
jmp 0x43d4
movq %rax, %rbx
leaq -0x3a8(%rbp), %rdi
jmp 0x43d4
movq %rax, %rbx
leaq -0x3e8(%rbp), %rdi
jmp 0x43d4
movq %rax, %rbx
leaq -0x1e8(%rbp), %rdi
jmp 0x43d4
movq %rax, %rbx
leaq -0xe8(%rbp), %rdi
jmp 0x43d4
movq %rax, %rbx
leaq -0x2e8(%rbp), %rdi
jmp 0x43d4
movq %rax, %rbx
leaq -0x128(%rbp), %rdi
jmp 0x43d4
movq %rax, %rbx
leaq -0x268(%rbp), %rdi
jmp 0x43d4
movq %rax, %rbx
leaq -0x368(%rbp), %rdi
jmp 0x43d4
movq %rax, %rbx
leaq -0x2a8(%rbp), %rdi
jmp 0x43d4
movq %rax, %rbx
leaq -0x328(%rbp), %rdi
callq 0x30c0
jmp 0x441e
jmp 0x441b
jmp 0x441b
jmp 0x441b
jmp 0x441b
jmp 0x441b
jmp 0x441b
jmp 0x441b
jmp 0x441b
jmp 0x441b
jmp 0x441b
jmp 0x441b
jmp 0x441b
jmp 0x441b
jmp 0x440d
jmp 0x440d
jmp 0x440d
jmp 0x440d
jmp 0x440d
jmp 0x440d
jmp 0x440d
jmp 0x440d
jmp 0x440d
jmp 0x440d
jmp 0x440d
jmp 0x440d
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x49c6
jmp 0x441e
movq %rax, %rbx
leaq -0xa8(%rbp), %rdi
callq 0x30c0
leaq -0x88(%rbp), %rdi
callq 0x30c0
movq %rbx, %rdi
callq 0x3290
movq %rax, %rbx
jmp 0x442a
nop