// File: pokorj54[P]Pathfinder-utilities/src/CommandLine.cpp
// Function: CommandLine::HandleHelp(CommandLine::Arguments&)
void CommandLine::HandleHelp(Arguments & args)
{
    string cmd = args.PopFirstIfNotEmpty();
    args.ThrowIfNotEmpty();
    if(cmd == "")
    {
        vector<pair<string, string>> commands;
        for(const pair<string, pair<CommandLine::HandleCmd, string>> & c : cmdTranslation)
        {
            commands.push_back(make_pair(c.first, c.second.second));
        }
        sort(commands.begin(), commands.end());
        for(const pair<string,string> p : commands)
        {
            *output << p.first << " - " << p.second << endl;
        }
        return;
    }
    try
    {
        *output << cmdTranslation.at(cmd).second << endl;
    }
    catch(const out_of_range & e)
    {
        *output << "Unknown command" << endl;
    }
}

// Assembly:
subq $0x1d8, %rsp            # imm = 0x1D8
movq %rdi, 0x1d0(%rsp)
movq %rsi, 0x1c8(%rsp)
movq 0x1d0(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x1c8(%rsp), %rsi
leaq 0x1a8(%rsp), %rdi
callq 0x8400
movq 0x1c8(%rsp), %rdi
callq 0x84d0
jmp 0x7a78
leaq 0x993f(%rip), %rsi      # 0x113be
leaq 0x1a8(%rsp), %rdi
callq 0x7700
movb %al, 0x4f(%rsp)
jmp 0x7a92
movb 0x4f(%rsp), %al
testb $0x1, %al
jne 0x7a9f
jmp 0x7d89
leaq 0x180(%rsp), %rdi
callq 0x9f40
leaq 0x1081d(%rip), %rax     # 0x182d0
movq %rax, 0x178(%rsp)
leaq 0x1080e(%rip), %rdi     # 0x182d0
callq 0x9f50
movq %rax, 0x170(%rsp)
leaq 0x107fa(%rip), %rdi     # 0x182d0
callq 0x9f80
movq %rax, 0x168(%rsp)
leaq 0x170(%rsp), %rdi
leaq 0x168(%rsp), %rsi
callq 0x9fb0
testb $0x1, %al
jne 0x7b01
jmp 0x7c0c
leaq 0x170(%rsp), %rdi
callq 0x9fd0
movq %rax, %rsi
leaq 0x110(%rsp), %rdi
callq 0x9ff0
jmp 0x7b20
leaq 0x110(%rsp), %rax
movq %rax, 0x160(%rsp)
movq 0x160(%rsp), %rsi
movq %rsi, %rdx
addq $0x30, %rdx
leaq 0xd0(%rsp), %rdi
callq 0xa080
jmp 0x7b4e
leaq 0x180(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0xa050
jmp 0x7b65
leaq 0xd0(%rsp), %rdi
callq 0xa0c0
leaq 0x110(%rsp), %rdi
callq 0xa0f0
leaq 0x170(%rsp), %rdi
callq 0xa120
jmp 0x7ae3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a0(%rsp)
movl %eax, 0x19c(%rsp)
jmp 0x7e90
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a0(%rsp)
movl %eax, 0x19c(%rsp)
jmp 0x7d77
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a0(%rsp)
movl %eax, 0x19c(%rsp)
jmp 0x7bfa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a0(%rsp)
movl %eax, 0x19c(%rsp)
leaq 0xd0(%rsp), %rdi
callq 0xa0c0
leaq 0x110(%rsp), %rdi
callq 0xa0f0
jmp 0x7d77
leaq 0x180(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0xa190
movq 0x40(%rsp), %rdi
movq %rax, 0xc8(%rsp)
callq 0xa1c0
movq %rax, 0xc0(%rsp)
movq 0xc8(%rsp), %rdi
movq 0xc0(%rsp), %rsi
callq 0xa150
jmp 0x7c4f
leaq 0x180(%rsp), %rax
movq %rax, 0xb8(%rsp)
movq 0xb8(%rsp), %rdi
callq 0xa190
movq %rax, 0xb0(%rsp)
movq 0xb8(%rsp), %rdi
callq 0xa1c0
movq %rax, 0xa8(%rsp)
leaq 0xb0(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0xa1f0
testb $0x1, %al
jne 0x7ca7
jmp 0x7d5d
leaq 0xb0(%rsp), %rdi
callq 0xa230
movq %rax, %rsi
leaq 0x68(%rsp), %rdi
callq 0xa240
jmp 0x7cc3
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rdi
leaq 0x68(%rsp), %rsi
callq 0x3290
movq %rax, 0x38(%rsp)
jmp 0x7cdd
movq 0x38(%rsp), %rdi
leaq 0x970d(%rip), %rsi      # 0x113f6
callq 0x32e0
movq %rax, 0x30(%rsp)
jmp 0x7cf5
movq 0x30(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x3290
movq %rax, 0x28(%rsp)
jmp 0x7d0e
movq 0x28(%rsp), %rdi
movq 0x1028e(%rip), %rsi     # 0x17fa8
callq 0x3310
jmp 0x7d21
leaq 0x68(%rsp), %rdi
callq 0xa0c0
leaq 0xb0(%rsp), %rdi
callq 0xa2a0
jmp 0x7c89
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a0(%rsp)
movl %eax, 0x19c(%rsp)
leaq 0x68(%rsp), %rdi
callq 0xa0c0
jmp 0x7d77
movl $0x1, 0x64(%rsp)
leaq 0x180(%rsp), %rdi
callq 0xa2c0
jmp 0x7e5e
leaq 0x180(%rsp), %rdi
callq 0xa2c0
jmp 0x7e90
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x18(%rsp)
leaq 0x10532(%rip), %rdi     # 0x182d0
leaq 0x1a8(%rsp), %rsi
callq 0x9ea0
movq %rax, 0x20(%rsp)
jmp 0x7db2
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
addq $0x10, %rsi
callq 0x3290
movq %rax, 0x10(%rsp)
jmp 0x7dcc
movq 0x10(%rsp), %rdi
movq 0x101d0(%rip), %rsi     # 0x17fa8
callq 0x3310
jmp 0x7ddf
jmp 0x7e56
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a0(%rsp)
movl %eax, 0x19c(%rsp)
movl 0x19c(%rsp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x7e90
movq 0x1a0(%rsp), %rdi
callq 0x3110
movq %rax, %rcx
movq 0x50(%rsp), %rax
movq %rcx, 0x58(%rsp)
movq 0x8(%rax), %rdi
leaq 0x95b8(%rip), %rsi      # 0x113e6
callq 0x32e0
movq %rax, 0x8(%rsp)
jmp 0x7e3a
movq 0x8(%rsp), %rdi
movq 0x10162(%rip), %rsi     # 0x17fa8
callq 0x3310
jmp 0x7e4d
callq 0x3430
jmp 0x7e54
jmp 0x7e56
movl $0x0, 0x64(%rsp)
leaq 0x1a8(%rsp), %rdi
callq 0x31f0
addq $0x1d8, %rsp            # imm = 0x1D8
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a0(%rsp)
movl %eax, 0x19c(%rsp)
callq 0x3430
jmp 0x7e8e
jmp 0x7e90
leaq 0x1a8(%rsp), %rdi
callq 0x31f0
movq 0x1a0(%rsp), %rdi
callq 0x3490
movq %rax, %rdi
callq 0x5240
nopw %cs:(%rax,%rax)