// File: /workspace/github_cpp_makefile_star2_O1/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 0x7206
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 0x7206
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5070
addq $0x20, %r15
leaq 0x50(%rsp), %rsi
movq %r15, %rdi
callq 0x85c8
movq %rax, %r15
cmpq $0x0, 0x10(%rax)
je 0x72e6
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x8733(%rip), %rsi      # 0xf968
leaq 0x872d(%rip), %rdx      # 0xf969
leaq 0x8(%rsp), %rdi
callq 0x6214
leaq 0x70(%rsp), %rdi
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x8644
cmpq $0x0, 0x10(%r15)
je 0x7338
leaq 0x70(%rsp), %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq 0x48(%rsp), %rdx
callq *0x18(%r15)
leaq 0x70(%rsp), %rdi
callq 0x877c
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x729a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5070
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x72b6
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5070
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x72d1
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 0x7f04(%rip), %rsi      # 0xf1fe
leaq 0x7f13(%rip), %rcx      # 0xf214
leaq 0x8(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x87d7
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x50e0
xorl %ebp, %ebp
movq 0xec6f(%rip), %rsi      # 0x15f98
movq 0xecb0(%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 0x7363
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5070
jmp 0x7363
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x73a4
movq %r14, %rdi
callq 0x55f0
jmp 0x73a4
jmp 0x737b
movq %rax, %rbx
jmp 0x738d
jmp 0x737b
movq %rax, %rbx
jmp 0x73a4
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x877c
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x73a4
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5070
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x73c0
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x5070
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x73db
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x5070
movq %rbx, %rdi
callq 0x5200
nop