// File: /workspace/github_cpp_makefile_star2_O1/pokorj54[P]Pathfinder-utilities/src/CommandLine.cpp
// Function: CommandLine::HandleCommands()
void CommandLine::HandleCommands()
{
    while(!input->eof() && !input->fail())
    {
        string fullCommand;
        getline(*input, fullCommand);
        if(fullCommand.find_first_not_of(" \t") == string::npos)
        {
            continue; //no command given
        }
        else if(count(fullCommand.begin(), fullCommand.end(), '"') % 2 == 1)
        {
            *output << "Invalid command - odd number of \"" << endl;
            continue;
        }

        Arguments arguments;
        string cmdName = _GetCommandAndArgument(fullCommand, arguments);
        transform(cmdName.begin(), cmdName.end(), cmdName.begin(), ::tolower);

        if(cmdName == "exit") //it's the only command that can affect the command cycle 
        {
            break;
        }

        HandleCmd method;
        if(cmdTranslation.count(cmdName) > 0)
        {
            method = cmdTranslation.at(cmdName).first;
        }
        else if (aliases.count(cmdName) > 0)
        {
            method = cmdTranslation.at(aliases.at(cmdName)).first;
        }
        else
        {
            *output << "Unknown command" << endl;
            continue;
        }

        try
        {
            ((*this).*method)(arguments);
        }
        catch(const Exception & e)
        {
            e.Message(*output);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
leaq 0x38(%rsp), %r15
leaq 0x28(%rsp), %r14
leaq 0x48(%rsp), %r12
movq (%rbx), %r13
movq (%r13), %rax
movq -0x18(%rax), %rax
testb $0x7, 0x20(%r13,%rax)
jne 0x6e98
movq %r15, 0x28(%rsp)
movq $0x0, 0x30(%rsp)
movb $0x0, 0x38(%rsp)
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x3250
movsbl %al, %edx
movq %r13, %rdi
movq %r14, %rsi
callq 0x3430
xorl %ebp, %ebp
movl $0x2, %ecx
movq %r14, %rdi
leaq 0x27b3(%rip), %rsi      # 0x93e6
xorl %edx, %edx
callq 0x33b0
cmpq $-0x1, %rax
je 0x6e10
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
testq %rdx, %rdx
leaq 0x68(%rsp), %r13
je 0x6c79
xorl %ecx, %ecx
xorl %eax, %eax
xorl %edi, %edi
cmpb $0x22, (%rsi,%rcx)
sete %dil
addq %rdi, %rax
incq %rcx
cmpq %rcx, %rdx
jne 0x6c5c
testb $0x1, %al
jne 0x6d40
addq %rsi, %rdx
movq %r12, 0x50(%rsp)
movq %r12, 0x48(%rsp)
movq $0x0, 0x58(%rsp)
movl $0x0, 0x60(%rsp)
leaq 0x78(%rsp), %r15
movq %r15, 0x68(%rsp)
movq %r13, %rdi
callq 0x5abe
leaq 0x8(%rsp), %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x676d
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x6cc8
callq 0x3240
movq 0x10(%rsp), %r13
testq %r13, %r13
je 0x6cf2
movq 0x8(%rsp), %rbp
xorl %r15d, %r15d
movsbl (%rbp,%r15), %edi
callq 0x3320
movb %al, (%rbp,%r15)
incq %r15
cmpq %r15, %r13
jne 0x6cda
leaq 0x8(%rsp), %rdi
leaq 0x270d(%rip), %rsi      # 0x940b
callq 0x30b0
testl %eax, %eax
sete %bpl
leaq 0x38(%rsp), %r15
je 0x6df4
leaq 0x654d(%rip), %rdi      # 0xd268
leaq 0x8(%rsp), %rsi
callq 0x8108
testq %rax, %rax
je 0x6d87
leaq 0x6537(%rip), %rdi      # 0xd268
leaq 0x8(%rsp), %rsi
callq 0x8142
jmp 0x6dce
movq 0x8(%rbx), %r13
movl $0x21, %edx
movq %r13, %rdi
leaq 0x2696(%rip), %rsi      # 0x93e9
callq 0x32a0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x3250
movsbl %al, %esi
movq %r13, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3190
xorl %ebp, %ebp
jmp 0x6e10
leaq 0x6512(%rip), %rdi      # 0xd2a0
leaq 0x8(%rsp), %rsi
callq 0x817c
testq %rax, %rax
je 0x6e2a
leaq 0x64f8(%rip), %rdi      # 0xd2a0
leaq 0x8(%rsp), %rsi
callq 0x81b6
testq %rax, %rax
je 0x6eaa
addq $0x28, %rax
leaq 0x64a2(%rip), %rdi      # 0xd268
movq %rax, %rsi
callq 0x8142
testq %rax, %rax
je 0x6eaa
movq 0x28(%rax), %rcx
movq 0x30(%rax), %rdi
addq %rbx, %rdi
testb $0x1, %cl
je 0x6def
movq (%rdi), %rax
movq -0x1(%rax,%rcx), %rcx
movq %r12, %rsi
callq *%rcx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x6e08
callq 0x3240
movq %r12, %rdi
callq 0x7558
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x6e1f
callq 0x3240
testb %bpl, %bpl
je 0x6bd5
jmp 0x6e98
movq 0x8(%rbx), %r13
movl $0xf, %edx
movq %r13, %rdi
leaq 0x25d3(%rip), %rsi      # 0x9410
callq 0x32a0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x3250
movsbl %al, %esi
movq %r13, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3190
jmp 0x6df4
movq %rax, %r13
cmpl $0x1, %edx
jne 0x6ee3
movq %r13, %rdi
callq 0x3100
movq 0x8(%rbx), %rsi
movq (%rax), %rcx
movq %rax, %rdi
callq *0x18(%rcx)
leaq 0x38(%rsp), %r15
callq 0x33a0
jmp 0x6df4
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2599(%rip), %rdi      # 0x944a
callq 0x3310
jmp 0x6ee0
movq %rax, %r13
callq 0x33a0
jmp 0x6ee3
movq %rax, %rdi
callq 0x4684
jmp 0x6ee0
movq %rax, %r13
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
jne 0x6ef2
jmp 0x6ef7
movq %rax, %r13
jmp 0x6ef7
movq %rax, %r13
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x6ef7
callq 0x3240
leaq 0x48(%rsp), %rdi
callq 0x7558
jmp 0x6f06
movq %rax, %r13
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x6f1a
callq 0x3240
movq %r13, %rdi
callq 0x3410