// File: /workspace/github_cpp_makefile_star2_O3/Themaister[P]umusd/command.cpp
// Function: Command::init_command_map()
void Command::init_command_map()
{
   command_map["NOOP"] = [](EventHandler &, std::vector<std::string> arg) -> std::string {
      std::cerr << "NOOP begin" << std::endl;
      std::cerr << string_join(arg, "\n") << std::endl << "end" << std::endl;
      return "OK";
   };

   command_map["PLAY"] = [this](EventHandler &, std::vector<std::string> arg) -> std::string {
      if (arg.empty())
         arg.push_back("");

      try
      {
         remote->play(arg.front());
         arg.erase(arg.begin());
         for (auto &str : arg)
            remote->add(str);
         return "OK";
      }
      catch(const std::exception &e)
      {
         std::cerr << e.what() << std::endl;
         return "ERROR";
      }
   };

   command_map["QUEUE"] = [this](EventHandler &, std::vector<std::string> arg) -> std::string {
      if (arg.empty())
         arg.push_back("");

      try
      {
         for (auto &str : arg)
         remote->add(str);
         return "OK";
      }
      catch(const std::exception &e)
      {
         std::cerr << e.what() << std::endl;
         return "ERROR";
      }
   };

   command_map["NEXT"] = [this](EventHandler &, std::vector<std::string>) -> std::string {
      return plain_action(std::bind(&Remote::next, remote));
   };

   command_map["PREV"] = [this](EventHandler &, std::vector<std::string>) -> std::string {
      return plain_action(std::bind(&Remote::prev, remote));
   };

   command_map["STOP"] = [this](EventHandler &, std::vector<std::string>) -> std::string {
      return plain_action(std::bind(&Remote::stop, remote));
   };

   command_map["PAUSE"] = [this](EventHandler &, std::vector<std::string>) -> std::string {
      return plain_action(std::bind(&Remote::pause, remote));
   };

   command_map["UNPAUSE"] = [this](EventHandler &, std::vector<std::string>) -> std::string {
      return plain_action(std::bind(&Remote::unpause, remote));
   };

   command_map["SEEK"] = [this](EventHandler &, std::vector<std::string> arg) -> std::string {
      if (arg.empty())
         throw std::logic_error("SEEK requires argument.");

      int time = std::strtol(arg[0].c_str(), nullptr, 0);
      return plain_action(std::bind(&Remote::seek, remote, time));
   };

   command_map["POS"] = [this](EventHandler &, std::vector<std::string>) -> std::string {
      try
      {
         auto pos = remote->pos();
         return stringify(static_cast<int>(pos.first), " ", static_cast<int>(pos.second));
      }
      catch (const std::exception &e)
      {
         std::cerr << e.what() << std::endl;
         return "ERROR";
      }
   };

   command_map["DIE"] = [this](EventHandler &event, std::vector<std::string>) -> std::string {
      event.kill();
      return "OK";
   };

   command_map["TITLE"] = [this](EventHandler &, std::vector<std::string>) -> std::string {
      return metadata_action(*remote, [](const FF::MediaInfo &info) { return info.title; });
   };

   command_map["ARTIST"] = [this](EventHandler &, std::vector<std::string>) -> std::string {
      return metadata_action(*remote, [](const FF::MediaInfo &info) { return info.artist; });
   };

   command_map["ALBUM"] = [this](EventHandler &, std::vector<std::string>) -> std::string {
      return metadata_action(*remote, [](const FF::MediaInfo &info) { return info.album; });
   };

   command_map["STATUS"] = [this](EventHandler &, std::vector<std::string>) -> std::string {
      return remote->status();
   };
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x8788(%rip), %rsi      # 0xf272
leaq 0x8785(%rip), %rdx      # 0xf276
leaq 0x20(%rsp), %rdi
callq 0x64c4
leaq 0x20(%rbx), %r14
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x8b82
movups (%rax), %xmm0
movaps %xmm0, (%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
leaq 0xf7d(%rip), %rdx       # 0x7aa6
movq %rdx, 0x10(%rax)
movq 0x18(%rax), %rdx
movq %rdx, 0x18(%rsp)
leaq 0xd57(%rip), %rdx       # 0x7894
movq %rdx, 0x18(%rax)
testq %rcx, %rcx
je 0x6b53
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rcx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x6b6a
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5070
leaq 0x20(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x86fe(%rip), %rsi      # 0xf277
leaq 0x86fb(%rip), %rdx      # 0xf27b
callq 0x64c4
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x8b82
movq $0x0, 0x8(%rsp)
movq %rbx, (%rsp)
movaps (%rsp), %xmm0
movaps %xmm0, 0x40(%rsp)
movups (%rax), %xmm1
movaps %xmm1, (%rsp)
movups %xmm0, (%rax)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
leaq 0x107c(%rip), %rdx      # 0x7c3e
movq %rdx, 0x10(%rax)
movq 0x18(%rax), %rdx
movq %rdx, 0x18(%rsp)
leaq 0xee8(%rip), %rdx       # 0x7abe
movq %rdx, 0x18(%rax)
testq %rcx, %rcx
je 0x6bec
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rcx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x6c03
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5070
leaq 0x20(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x866a(%rip), %rsi      # 0xf27c
leaq 0x8668(%rip), %rdx      # 0xf281
callq 0x64c4
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x8b82
movq $0x0, 0x8(%rsp)
movq %rbx, (%rsp)
movaps (%rsp), %xmm0
movaps %xmm0, 0x40(%rsp)
movups (%rax), %xmm1
movaps %xmm1, (%rsp)
movups %xmm0, (%rax)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
leaq 0x116b(%rip), %rdx      # 0x7dc6
movq %rdx, 0x10(%rax)
movq 0x18(%rax), %rdx
movq %rdx, 0x18(%rsp)
leaq 0xff5(%rip), %rdx       # 0x7c64
movq %rdx, 0x18(%rax)
testq %rcx, %rcx
je 0x6c85
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rcx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x6c9c
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5070
leaq 0x20(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x85d7(%rip), %rsi      # 0xf282
leaq 0x85d4(%rip), %rdx      # 0xf286
callq 0x64c4
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x8b82
movq $0x0, 0x8(%rsp)
movq %rbx, (%rsp)
movaps (%rsp), %xmm0
movaps %xmm0, 0x40(%rsp)
movups (%rax), %xmm1
movaps %xmm1, (%rsp)
movups %xmm0, (%rax)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
leaq 0x1160(%rip), %rdx      # 0x7e54
movq %rdx, 0x10(%rax)
movq 0x18(%rax), %rdx
movq %rdx, 0x18(%rsp)
leaq 0x10e4(%rip), %rdx      # 0x7dec
movq %rdx, 0x18(%rax)
testq %rcx, %rcx
je 0x6d1e
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rcx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x6d35
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5070
leaq 0x20(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x8543(%rip), %rsi      # 0xf287
leaq 0x8540(%rip), %rdx      # 0xf28b
callq 0x64c4
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x8b82
movq $0x0, 0x8(%rsp)
movq %rbx, (%rsp)
movaps (%rsp), %xmm0
movaps %xmm0, 0x40(%rsp)
movups (%rax), %xmm1
movaps %xmm1, (%rsp)
movups %xmm0, (%rax)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
leaq 0x1155(%rip), %rdx      # 0x7ee2
movq %rdx, 0x10(%rax)
movq 0x18(%rax), %rdx
movq %rdx, 0x18(%rsp)
leaq 0x10d9(%rip), %rdx      # 0x7e7a
movq %rdx, 0x18(%rax)
testq %rcx, %rcx
je 0x6db7
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rcx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x6dce
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5070
leaq 0x20(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x84af(%rip), %rsi      # 0xf28c
leaq 0x84ac(%rip), %rdx      # 0xf290
callq 0x64c4
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x8b82
movq $0x0, 0x8(%rsp)
movq %rbx, (%rsp)
movaps (%rsp), %xmm0
movaps %xmm0, 0x40(%rsp)
movups (%rax), %xmm1
movaps %xmm1, (%rsp)
movups %xmm0, (%rax)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
leaq 0x114a(%rip), %rdx      # 0x7f70
movq %rdx, 0x10(%rax)
movq 0x18(%rax), %rdx
movq %rdx, 0x18(%rsp)
leaq 0x10ce(%rip), %rdx      # 0x7f08
movq %rdx, 0x18(%rax)
testq %rcx, %rcx
je 0x6e50
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rcx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x6e67
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5070
leaq 0x20(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x841d(%rip), %rsi      # 0xf293
leaq 0x841b(%rip), %rdx      # 0xf298
callq 0x64c4
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x8b82
movq $0x0, 0x8(%rsp)
movq %rbx, (%rsp)
movaps (%rsp), %xmm0
movaps %xmm0, 0x40(%rsp)
movups (%rax), %xmm1
movaps %xmm1, (%rsp)
movups %xmm0, (%rax)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
leaq 0x113f(%rip), %rdx      # 0x7ffe
movq %rdx, 0x10(%rax)
movq 0x18(%rax), %rdx
movq %rdx, 0x18(%rsp)
leaq 0x10c3(%rip), %rdx      # 0x7f96
movq %rdx, 0x18(%rax)
testq %rcx, %rcx
je 0x6ee9
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rcx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x6f00
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5070
leaq 0x20(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x8382(%rip), %rsi      # 0xf291
leaq 0x8382(%rip), %rdx      # 0xf298
callq 0x64c4
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x8b82
movq $0x0, 0x8(%rsp)
movq %rbx, (%rsp)
movaps (%rsp), %xmm0
movaps %xmm0, 0x40(%rsp)
movups (%rax), %xmm1
movaps %xmm1, (%rsp)
movups %xmm0, (%rax)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
leaq 0x1134(%rip), %rdx      # 0x808c
movq %rdx, 0x10(%rax)
movq 0x18(%rax), %rdx
movq %rdx, 0x18(%rsp)
leaq 0x10b8(%rip), %rdx      # 0x8024
movq %rdx, 0x18(%rax)
testq %rcx, %rcx
je 0x6f82
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rcx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x6f99
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5070
leaq 0x20(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x82f1(%rip), %rsi      # 0xf299
leaq 0x82ee(%rip), %rdx      # 0xf29d
callq 0x64c4
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x8b82
movq $0x0, 0x8(%rsp)
movq %rbx, (%rsp)
movaps (%rsp), %xmm0
movaps %xmm0, 0x40(%rsp)
movups (%rax), %xmm1
movaps %xmm1, (%rsp)
movups %xmm0, (%rax)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
leaq 0x1193(%rip), %rdx      # 0x8184
movq %rdx, 0x10(%rax)
movq 0x18(%rax), %rdx
movq %rdx, 0x18(%rsp)
leaq 0x10ad(%rip), %rdx      # 0x80b2
movq %rdx, 0x18(%rax)
testq %rcx, %rcx
je 0x701b
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rcx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x7032
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5070
leaq 0x20(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x825d(%rip), %rsi      # 0xf29e
leaq 0x8259(%rip), %rdx      # 0xf2a1
callq 0x64c4
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x8b82
movq $0x0, 0x8(%rsp)
movq %rbx, (%rsp)
movaps (%rsp), %xmm0
movaps %xmm0, 0x40(%rsp)
movups (%rax), %xmm1
movaps %xmm1, (%rsp)
movups %xmm0, (%rax)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
leaq 0x1210(%rip), %rdx      # 0x829a
movq %rdx, 0x10(%rax)
movq 0x18(%rax), %rdx
movq %rdx, 0x18(%rsp)
leaq 0x110c(%rip), %rdx      # 0x81aa
movq %rdx, 0x18(%rax)
testq %rcx, %rcx
je 0x70b4
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rcx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x70cb
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5070
leaq 0x20(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x81c8(%rip), %rsi      # 0xf2a2
leaq 0x81c4(%rip), %rdx      # 0xf2a5
callq 0x64c4
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x8b82
movq $0x0, 0x8(%rsp)
movq %rbx, (%rsp)
movaps (%rsp), %xmm0
movaps %xmm0, 0x40(%rsp)
movups (%rax), %xmm1
movaps %xmm1, (%rsp)
movups %xmm0, (%rax)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
leaq 0x1209(%rip), %rdx      # 0x832c
movq %rdx, 0x10(%rax)
movq 0x18(%rax), %rdx
movq %rdx, 0x18(%rsp)
leaq 0x1189(%rip), %rdx      # 0x82c0
movq %rdx, 0x18(%rax)
testq %rcx, %rcx
je 0x714d
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rcx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x7164
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5070
leaq 0x20(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x8133(%rip), %rsi      # 0xf2a6
leaq 0x8131(%rip), %rdx      # 0xf2ab
callq 0x64c4
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x8b82
movq $0x0, 0x8(%rsp)
movq %rbx, (%rsp)
movaps (%rsp), %xmm0
movaps %xmm0, 0x40(%rsp)
movups (%rax), %xmm1
movaps %xmm1, (%rsp)
movups %xmm0, (%rax)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
leaq 0x12e6(%rip), %rdx      # 0x84a2
movq %rdx, 0x10(%rax)
movq 0x18(%rax), %rdx
movq %rdx, 0x18(%rsp)
leaq 0x1182(%rip), %rdx      # 0x8352
movq %rdx, 0x18(%rax)
testq %rcx, %rcx
je 0x71e6
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rcx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x71fd
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5070
leaq 0x20(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x80a0(%rip), %rsi      # 0xf2ac
leaq 0x809f(%rip), %rdx      # 0xf2b2
callq 0x64c4
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x8b82
movq $0x0, 0x8(%rsp)
movq %rbx, (%rsp)
movaps (%rsp), %xmm0
movaps %xmm0, 0x40(%rsp)
movups (%rax), %xmm1
movaps %xmm1, (%rsp)
movups %xmm0, (%rax)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
leaq 0x13c3(%rip), %rdx      # 0x8618
movq %rdx, 0x10(%rax)
movq 0x18(%rax), %rdx
movq %rdx, 0x18(%rsp)
leaq 0x125f(%rip), %rdx      # 0x84c8
movq %rdx, 0x18(%rax)
testq %rcx, %rcx
je 0x727f
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rcx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x7296
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5070
leaq 0x20(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x800e(%rip), %rsi      # 0xf2b3
leaq 0x800c(%rip), %rdx      # 0xf2b8
callq 0x64c4
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x8b82
movq $0x0, 0x8(%rsp)
movq %rbx, (%rsp)
movaps (%rsp), %xmm0
movaps %xmm0, 0x40(%rsp)
movups (%rax), %xmm1
movaps %xmm1, (%rsp)
movups %xmm0, (%rax)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
leaq 0x14a0(%rip), %rdx      # 0x878e
movq %rdx, 0x10(%rax)
movq 0x18(%rax), %rdx
movq %rdx, 0x18(%rsp)
leaq 0x133c(%rip), %rdx      # 0x863e
movq %rdx, 0x18(%rax)
testq %rcx, %rcx
je 0x7318
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rcx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x732f
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5070
leaq 0x20(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x7f7b(%rip), %rsi      # 0xf2b9
leaq 0x7f7a(%rip), %rdx      # 0xf2bf
callq 0x64c4
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x8b82
movq $0x0, 0x8(%rsp)
movq %rbx, (%rsp)
movaps (%rsp), %xmm0
movaps %xmm0, 0x40(%rsp)
movups (%rax), %xmm1
movaps %xmm1, (%rsp)
movups %xmm0, (%rax)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
leaq 0x1485(%rip), %rdx      # 0x880c
movq %rdx, 0x10(%rax)
movq 0x18(%rax), %rdx
movq %rdx, 0x18(%rsp)
leaq 0x1419(%rip), %rdx      # 0x87b4
movq %rdx, 0x18(%rax)
testq %rcx, %rcx
je 0x73b1
movq %rsp, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rcx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x73c8
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5070
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x73ee
jmp 0x73ee
jmp 0x73ee
jmp 0x73ee
jmp 0x73ee
jmp 0x73ee
jmp 0x73ee
jmp 0x73ee
jmp 0x73ee
jmp 0x73ee
jmp 0x73ee
jmp 0x73ee
jmp 0x73ee
jmp 0x73ee
movq %rax, %rdi
callq 0x6406
jmp 0x742e
jmp 0x744a
jmp 0x742e
jmp 0x744a
jmp 0x742e
jmp 0x744a
jmp 0x742e
jmp 0x744a
jmp 0x742e
jmp 0x744a
jmp 0x742e
jmp 0x744a
jmp 0x742e
jmp 0x744a
jmp 0x742e
jmp 0x744a
jmp 0x742e
jmp 0x744a
jmp 0x742e
jmp 0x744a
jmp 0x742e
jmp 0x744a
jmp 0x742e
jmp 0x744a
jmp 0x742e
jmp 0x744a
jmp 0x742e
jmp 0x744a
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x744d
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5070
jmp 0x744d
movq %rax, %rbx
movq %rbx, %rdi
callq 0x5200
nop