// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
leaq 0x7bf1(%rip), %rsi      # 0xd216
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x4eca
leaq 0x20(%rbx), %r14
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x6fe6
movups (%rax), %xmm0
leaq 0x40(%rsp), %rdi
movaps %xmm0, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rdi)
leaq 0xb43(%rip), %rcx       # 0x61a8
movq %rcx, 0x10(%rax)
movq 0x18(%rax), %rcx
movq %rcx, 0x18(%rdi)
leaq 0xa28(%rip), %rcx       # 0x60a0
movq %rcx, 0x18(%rax)
callq 0x7162
leaq 0x10(%rsp), %rdi
callq 0x4540
leaq 0x7b89(%rip), %rsi      # 0xd21b
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x4eca
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x6fe6
leaq 0x40(%rsp), %rdi
andq $0x0, 0x8(%rdi)
movq %rbx, (%rdi)
movaps (%rdi), %xmm0
movaps %xmm0, 0x30(%rsp)
movups (%rax), %xmm1
movaps %xmm1, (%rdi)
movups %xmm0, (%rax)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rdi)
leaq 0xc4b(%rip), %rcx       # 0x6326
movq %rcx, 0x10(%rax)
movq 0x18(%rax), %rcx
movq %rcx, 0x18(%rdi)
leaq 0xad2(%rip), %rcx       # 0x61c0
movq %rcx, 0x18(%rax)
callq 0x7162
leaq 0x10(%rsp), %rdi
callq 0x4540
leaq 0x7b18(%rip), %rsi      # 0xd220
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x4eca
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x6fe6
leaq 0x40(%rsp), %rdi
andq $0x0, 0x8(%rdi)
movq %rbx, (%rdi)
movaps (%rdi), %xmm0
movaps %xmm0, 0x30(%rsp)
movups (%rax), %xmm1
movaps %xmm1, (%rdi)
movups %xmm0, (%rax)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rdi)
leaq 0xd3f(%rip), %rcx       # 0x6490
movq %rcx, 0x10(%rax)
movq 0x18(%rax), %rcx
movq %rcx, 0x18(%rdi)
leaq 0xbe8(%rip), %rcx       # 0x634c
movq %rcx, 0x18(%rax)
callq 0x7162
leaq 0x10(%rsp), %rdi
callq 0x4540
leaq 0x7aa8(%rip), %rsi      # 0xd226
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x4eca
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x6fe6
leaq 0x40(%rsp), %rdi
andq $0x0, 0x8(%rdi)
movq %rbx, (%rdi)
movaps (%rdi), %xmm0
movaps %xmm0, 0x30(%rsp)
movups (%rax), %xmm1
movaps %xmm1, (%rdi)
movups %xmm0, (%rax)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rdi)
leaq 0xd57(%rip), %rcx       # 0x651e
movq %rcx, 0x10(%rax)
movq 0x18(%rax), %rcx
movq %rcx, 0x18(%rdi)
leaq 0xcdc(%rip), %rcx       # 0x64b6
movq %rcx, 0x18(%rax)
callq 0x7162
leaq 0x10(%rsp), %rdi
callq 0x4540
leaq 0x7a37(%rip), %rsi      # 0xd22b
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x4eca
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x6fe6
leaq 0x40(%rsp), %rdi
andq $0x0, 0x8(%rdi)
movq %rbx, (%rdi)
movaps (%rdi), %xmm0
movaps %xmm0, 0x30(%rsp)
movups (%rax), %xmm1
movaps %xmm1, (%rdi)
movups %xmm0, (%rax)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rdi)
leaq 0xd6f(%rip), %rcx       # 0x65ac
movq %rcx, 0x10(%rax)
movq 0x18(%rax), %rcx
movq %rcx, 0x18(%rdi)
leaq 0xcf4(%rip), %rcx       # 0x6544
movq %rcx, 0x18(%rax)
callq 0x7162
leaq 0x10(%rsp), %rdi
callq 0x4540
leaq 0x79c6(%rip), %rsi      # 0xd230
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x4eca
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x6fe6
leaq 0x40(%rsp), %rdi
andq $0x0, 0x8(%rdi)
movq %rbx, (%rdi)
movaps (%rdi), %xmm0
movaps %xmm0, 0x30(%rsp)
movups (%rax), %xmm1
movaps %xmm1, (%rdi)
movups %xmm0, (%rax)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rdi)
leaq 0xd87(%rip), %rcx       # 0x663a
movq %rcx, 0x10(%rax)
movq 0x18(%rax), %rcx
movq %rcx, 0x18(%rdi)
leaq 0xd0c(%rip), %rcx       # 0x65d2
movq %rcx, 0x18(%rax)
callq 0x7162
leaq 0x10(%rsp), %rdi
callq 0x4540
leaq 0x7957(%rip), %rsi      # 0xd237
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x4eca
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x6fe6
leaq 0x40(%rsp), %rdi
andq $0x0, 0x8(%rdi)
movq %rbx, (%rdi)
movaps (%rdi), %xmm0
movaps %xmm0, 0x30(%rsp)
movups (%rax), %xmm1
movaps %xmm1, (%rdi)
movups %xmm0, (%rax)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rdi)
leaq 0xd9f(%rip), %rcx       # 0x66c8
movq %rcx, 0x10(%rax)
movq 0x18(%rax), %rcx
movq %rcx, 0x18(%rdi)
leaq 0xd24(%rip), %rcx       # 0x6660
movq %rcx, 0x18(%rax)
callq 0x7162
leaq 0x10(%rsp), %rdi
callq 0x4540
leaq 0x78df(%rip), %rsi      # 0xd235
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x4eca
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x6fe6
leaq 0x40(%rsp), %rdi
andq $0x0, 0x8(%rdi)
movq %rbx, (%rdi)
movaps (%rdi), %xmm0
movaps %xmm0, 0x30(%rsp)
movups (%rax), %xmm1
movaps %xmm1, (%rdi)
movups %xmm0, (%rax)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rdi)
leaq 0xdb7(%rip), %rcx       # 0x6756
movq %rcx, 0x10(%rax)
movq 0x18(%rax), %rcx
movq %rcx, 0x18(%rdi)
leaq 0xd3c(%rip), %rcx       # 0x66ee
movq %rcx, 0x18(%rax)
callq 0x7162
leaq 0x10(%rsp), %rdi
callq 0x4540
leaq 0x7871(%rip), %rsi      # 0xd23d
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x4eca
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x6fe6
leaq 0x40(%rsp), %rdi
andq $0x0, 0x8(%rdi)
movq %rbx, (%rdi)
movaps (%rdi), %xmm0
movaps %xmm0, 0x30(%rsp)
movups (%rax), %xmm1
movaps %xmm1, (%rdi)
movups %xmm0, (%rax)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rdi)
leaq 0xe31(%rip), %rcx       # 0x6846
movq %rcx, 0x10(%rax)
movq 0x18(%rax), %rcx
movq %rcx, 0x18(%rdi)
leaq 0xd54(%rip), %rcx       # 0x677c
movq %rcx, 0x18(%rax)
callq 0x7162
leaq 0x10(%rsp), %rdi
callq 0x4540
leaq 0x7800(%rip), %rsi      # 0xd242
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x4eca
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x6fe6
leaq 0x40(%rsp), %rdi
andq $0x0, 0x8(%rdi)
movq %rbx, (%rdi)
movaps (%rdi), %xmm0
movaps %xmm0, 0x30(%rsp)
movups (%rax), %xmm1
movaps %xmm1, (%rdi)
movups %xmm0, (%rax)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rdi)
leaq 0xec9(%rip), %rcx       # 0x6954
movq %rcx, 0x10(%rax)
movq 0x18(%rax), %rcx
movq %rcx, 0x18(%rdi)
leaq 0xdce(%rip), %rcx       # 0x686c
movq %rcx, 0x18(%rax)
callq 0x7162
leaq 0x10(%rsp), %rdi
callq 0x4540
leaq 0x778e(%rip), %rsi      # 0xd246
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x4eca
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x6fe6
leaq 0x40(%rsp), %rdi
andq $0x0, 0x8(%rdi)
movq %rbx, (%rdi)
movaps (%rdi), %xmm0
movaps %xmm0, 0x30(%rsp)
movups (%rax), %xmm1
movaps %xmm1, (%rdi)
movups %xmm0, (%rax)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rdi)
leaq 0xee1(%rip), %rcx       # 0x69e2
movq %rcx, 0x10(%rax)
movq 0x18(%rax), %rcx
movq %rcx, 0x18(%rdi)
leaq 0xe66(%rip), %rcx       # 0x697a
movq %rcx, 0x18(%rax)
callq 0x7162
leaq 0x10(%rsp), %rdi
callq 0x4540
leaq 0x771c(%rip), %rsi      # 0xd24a
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x4eca
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x6fe6
leaq 0x40(%rsp), %rdi
andq $0x0, 0x8(%rdi)
movq %rbx, (%rdi)
movaps (%rdi), %xmm0
movaps %xmm0, 0x30(%rsp)
movups (%rax), %xmm1
movaps %xmm1, (%rdi)
movups %xmm0, (%rax)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rdi)
leaq 0xf85(%rip), %rcx       # 0x6afc
movq %rcx, 0x10(%rax)
movq 0x18(%rax), %rcx
movq %rcx, 0x18(%rdi)
leaq 0xe7e(%rip), %rcx       # 0x6a08
movq %rcx, 0x18(%rax)
callq 0x7162
leaq 0x10(%rsp), %rdi
callq 0x4540
leaq 0x76ac(%rip), %rsi      # 0xd250
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x4eca
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x6fe6
leaq 0x40(%rsp), %rdi
andq $0x0, 0x8(%rdi)
movq %rbx, (%rdi)
movaps (%rdi), %xmm0
movaps %xmm0, 0x30(%rsp)
movups (%rax), %xmm1
movaps %xmm1, (%rdi)
movups %xmm0, (%rax)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rdi)
leaq 0x1029(%rip), %rcx      # 0x6c16
movq %rcx, 0x10(%rax)
movq 0x18(%rax), %rcx
movq %rcx, 0x18(%rdi)
leaq 0xf22(%rip), %rcx       # 0x6b22
movq %rcx, 0x18(%rax)
callq 0x7162
leaq 0x10(%rsp), %rdi
callq 0x4540
leaq 0x763d(%rip), %rsi      # 0xd257
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x4eca
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x6fe6
leaq 0x40(%rsp), %rdi
andq $0x0, 0x8(%rdi)
movq %rbx, (%rdi)
movaps (%rdi), %xmm0
movaps %xmm0, 0x30(%rsp)
movups (%rax), %xmm1
movaps %xmm1, (%rdi)
movups %xmm0, (%rax)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rdi)
leaq 0x10cd(%rip), %rcx      # 0x6d30
movq %rcx, 0x10(%rax)
movq 0x18(%rax), %rcx
movq %rcx, 0x18(%rdi)
leaq 0xfc6(%rip), %rcx       # 0x6c3c
movq %rcx, 0x18(%rax)
callq 0x7162
leaq 0x10(%rsp), %rdi
callq 0x4540
leaq 0x75cd(%rip), %rsi      # 0xd25d
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x4eca
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x6fe6
leaq 0x40(%rsp), %rdi
andq $0x0, 0x8(%rdi)
movq %rbx, (%rdi)
movaps (%rdi), %xmm0
movaps %xmm0, 0x30(%rsp)
movups (%rax), %xmm1
movaps %xmm1, (%rdi)
movups %xmm0, (%rax)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rdi)
leaq 0x10d1(%rip), %rcx      # 0x6daa
movq %rcx, 0x10(%rax)
movq 0x18(%rax), %rcx
movq %rcx, 0x18(%rdi)
leaq 0x106a(%rip), %rcx      # 0x6d56
movq %rcx, 0x18(%rax)
callq 0x7162
leaq 0x10(%rsp), %rdi
callq 0x4540
addq $0x68, %rsp
popq %rbx
popq %r14
retq
jmp 0x5d3f
jmp 0x5d4e
jmp 0x5d3f
jmp 0x5d4e
jmp 0x5d3f
jmp 0x5d4e
jmp 0x5d3f
jmp 0x5d4e
jmp 0x5d3f
jmp 0x5d4e
jmp 0x5d3f
jmp 0x5d4e
jmp 0x5d3f
jmp 0x5d4e
jmp 0x5d3f
jmp 0x5d4e
jmp 0x5d3f
jmp 0x5d4e
jmp 0x5d3f
jmp 0x5d4e
jmp 0x5d3f
jmp 0x5d4e
jmp 0x5d3f
jmp 0x5d4e
jmp 0x5d3f
jmp 0x5d4e
jmp 0x5d3f
jmp 0x5d4e
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x4540
jmp 0x5d51
movq %rax, %rbx
movq %rbx, %rdi
callq 0x4200
nop