// File: /workspace/github_cpp_makefile_star2_O3/Themaister[P]umusd/command.cpp
// Function: Command::parse_command(EventHandler&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
std::string Command::parse_command(EventHandler &event, const std::string &cmd)
{
   auto split = cmd.find(' ');
   auto first_arg = cmd.find('\"', split);
   auto last_arg = cmd.rfind('\"');

   auto name = cmd.substr(0, split);

   std::string arg;
   if (last_arg > first_arg)
      arg = cmd.substr(first_arg + 1, last_arg - first_arg - 1);

   auto &cb = command_map[name];
   if (cb)
      return cb(event, string_split(arg, "\n"));
   else
      throw std::runtime_error(stringify("Unrecognized command: \"", name, "\""));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rcx, %r12
movq %rdx, 0x48(%rsp)
movq %rsi, %r15
movq %rdi, %rbx
movq %rcx, %rdi
movl $0x20, %esi
xorl %edx, %edx
callq 0x5680
movq %rax, %r14
movq %r12, %rdi
movl $0x22, %esi
movq %rax, %rdx
callq 0x5680
movq %rax, %r13
movq %r12, %rdi
movl $0x22, %esi
movq $-0x1, %rdx
callq 0x5460
movq %rax, %rbp
leaq 0x50(%rsp), %rdi
movq %r12, %rsi
xorl %edx, %edx
movq %r14, %rcx
callq 0x5640
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
cmpq %r13, %rbp
jbe 0x7522
leaq 0x1(%r13), %rdx
notq %r13
addq %r13, %rbp
leaq 0x8(%rsp), %rdi
movq %r12, %rsi
movq %rbp, %rcx
callq 0x5640
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq 0x5490
movq (%r14), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x7522
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5070
addq $0x20, %r15
leaq 0x50(%rsp), %rsi
movq %r15, %rdi
callq 0x8868
movq %rax, %r15
cmpq $0x0, 0x10(%rax)
je 0x7602
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x8477(%rip), %rsi      # 0xf9c8
leaq 0x8471(%rip), %rdx      # 0xf9c9
leaq 0x8(%rsp), %rdi
callq 0x64c4
leaq 0x70(%rsp), %rdi
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x88e4
cmpq $0x0, 0x10(%r15)
je 0x7654
leaq 0x70(%rsp), %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq 0x48(%rsp), %rdx
callq *0x18(%r15)
leaq 0x70(%rsp), %rdi
callq 0x8a1c
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x75b6
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5070
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x75d2
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5070
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x75ed
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5070
movq %rbx, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x5420
movq %rax, %r14
leaq 0x7c44(%rip), %rsi      # 0xf25a
leaq 0x7c53(%rip), %rcx      # 0xf270
leaq 0x8(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x8a7a
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x50e0
xorl %ebp, %ebp
movq 0xe953(%rip), %rsi      # 0x15f98
movq 0xe994(%rip), %rdx      # 0x15fe0
movq %r14, %rdi
callq 0x51c0
callq 0x52e0
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7677
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5070
testb %bpl, %bpl
jne 0x7681
jmp 0x76bd
movq %rax, %rbx
movq %r14, %rdi
callq 0x55f0
jmp 0x76bd
jmp 0x7694
movq %rax, %rbx
jmp 0x76a6
jmp 0x7694
movq %rax, %rbx
jmp 0x76bd
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x8a1c
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x76bd
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5070
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x76d9
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5070
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x76f4
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5070
movq %rbx, %rdi
callq 0x5200