// File: /workspace/github_cpp_makefile_star2_O3/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), %rcx
testb $0x7, 0x20(%r13,%rcx)
jne 0x6d5a
movq %r15, 0x28(%rsp)
movq $0x0, 0x30(%rsp)
movb $0x0, 0x38(%rsp)
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 0x28f1(%rip), %rsi      # 0x93e6
xorl %edx, %edx
callq 0x33b0
cmpq $-0x1, %rax
je 0x6cd2
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
testq %rdx, %rdx
leaq 0x68(%rsp), %r13
je 0x6b3b
xorl %ecx, %ecx
xorl %eax, %eax
xorl %edi, %edi
cmpb $0x22, (%rsi,%rcx)
sete %dil
addq %rdi, %rax
incq %rcx
cmpq %rcx, %rdx
jne 0x6b1e
testb $0x1, %al
jne 0x6c02
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 0x5974
leaq 0x8(%rsp), %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x6632
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x6b8a
callq 0x3240
movq 0x10(%rsp), %r13
testq %r13, %r13
je 0x6bb4
movq 0x8(%rsp), %rbp
xorl %r15d, %r15d
movsbl (%rbp,%r15), %edi
callq 0x3320
movb %al, (%rbp,%r15)
incq %r15
cmpq %r15, %r13
jne 0x6b9c
leaq 0x8(%rsp), %rdi
leaq 0x284b(%rip), %rsi      # 0x940b
callq 0x30b0
testl %eax, %eax
sete %bpl
leaq 0x38(%rsp), %r15
je 0x6cb6
leaq 0x668b(%rip), %rdi      # 0xd268
leaq 0x8(%rsp), %rsi
callq 0x7fc6
testq %rax, %rax
je 0x6c49
leaq 0x6675(%rip), %rdi      # 0xd268
leaq 0x8(%rsp), %rsi
callq 0x8000
jmp 0x6c90
movq 0x8(%rbx), %r13
movl $0x21, %edx
movq %r13, %rdi
leaq 0x27d4(%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 0x6cd2
leaq 0x6650(%rip), %rdi      # 0xd2a0
leaq 0x8(%rsp), %rsi
callq 0x803a
testq %rax, %rax
je 0x6cec
leaq 0x6636(%rip), %rdi      # 0xd2a0
leaq 0x8(%rsp), %rsi
callq 0x8074
testq %rax, %rax
je 0x6d6c
addq $0x28, %rax
leaq 0x65e0(%rip), %rdi      # 0xd268
movq %rax, %rsi
callq 0x8000
testq %rax, %rax
je 0x6d6c
movq 0x28(%rax), %rcx
movq 0x30(%rax), %rdi
addq %rbx, %rdi
testb $0x1, %cl
je 0x6cb1
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 0x6cca
callq 0x3240
movq %r12, %rdi
callq 0x741a
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x6ce1
callq 0x3240
testb %bpl, %bpl
je 0x6a9b
jmp 0x6d5a
movq 0x8(%rbx), %r13
movl $0xf, %edx
movq %r13, %rdi
leaq 0x2711(%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 0x6cb6
movq %rax, %r13
cmpl $0x1, %edx
jne 0x6da5
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 0x6cb6
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x26d7(%rip), %rdi      # 0x944a
callq 0x3310
jmp 0x6da2
movq %rax, %r13
callq 0x33a0
jmp 0x6da5
movq %rax, %rdi
callq 0x4659
jmp 0x6da2
movq %rax, %r13
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
jne 0x6db4
jmp 0x6db9
movq %rax, %r13
jmp 0x6db9
movq %rax, %r13
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x6db9
callq 0x3240
leaq 0x48(%rsp), %rdi
callq 0x741a
jmp 0x6dc8
movq %rax, %r13
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x6ddc
callq 0x3240
movq %r13, %rdi
callq 0x3410