// File: /workspace/github_cpp_makefile_star2_O2/czinn[P]homeworlds/game_io.cc
// Function: print_action(std::ostream&, Action const&, std::map<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<int>, std::allocator<std::pair<int const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>> const&, __gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>&)
void print_action(std::ostream& os, const Action& action,
                  const std::map<int, std::string>& system_names,
                  std::vector<std::string>::iterator& new_names) {
  switch (action.type) {
    case PASS:
      os << "PASS";
      break;

    case ATTACK:
      os << "ATTACK " << action.ship << " " << system_names.at(action.system);
      break;

    case DISCOVER:
      os << "DISCOVER " << action.ship << " " << system_names.at(action.system);
      os << " " << action.target << " " << *new_names++;
      break;

    case TRAVEL:
      os << "MOVE " << action.ship << " " << system_names.at(action.system) << " ";
      os << system_names.at(action.system_target);
      break;

    case BUILD:
      os << "BUILD " << action.ship << " " << system_names.at(action.system);
      break;

    case TRADE:
      os << "TRADE " << action.ship << " " << action.target;
      os << " " << system_names.at(action.system);
      break;

    case SACRIFICE:
      os << "SACRIFICE " << action.ship << " " << system_names.at(action.system);
      break;

    case CATASTROPHE:
      os << "CATASTROPHE " << system_names.at(action.system);
      os << " " << "rygb"[action.ship.colour];
      break;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0x4(%rsi), %eax
cmpq $0x7, %rax
ja 0x84f8
movq %rcx, %r12
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x1eaf(%rip), %rcx      # 0xa190
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x1ec9(%rip), %rsi      # 0xa1ba
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21d0
leaq 0x1ec9(%rip), %rsi      # 0xa1d7
jmp 0x84a7
leaq 0x1ead(%rip), %rsi      # 0xa1c7
movq %r15, %rdi
callq 0x21d0
movq %rax, %rbp
leaq 0xc(%rbx), %rsi
movq %rax, %rdi
callq 0x7fe0
leaq 0x1e80(%rip), %r13      # 0xa1b8
movq %rbp, %rdi
movq %r13, %rsi
callq 0x21d0
movq %rax, %rbp
leaq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x8df4
movq %rbp, %rdi
movq %rax, %rsi
callq 0x21c0
movq %r15, %rdi
movq %r13, %rsi
callq 0x21d0
movq %rax, %r14
addq $0x18, %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x7fe0
movq %r14, %rdi
movq %r13, %rsi
callq 0x21d0
movq (%r12), %rsi
leaq 0x20(%rsi), %rcx
movq %rcx, (%r12)
movq %rax, %rdi
jmp 0x84e5
leaq 0x1e31(%rip), %rsi      # 0xa1d1
movq %r15, %rdi
callq 0x21d0
movq %rax, %r12
leaq 0xc(%rbx), %rsi
movq %rax, %rdi
callq 0x7fe0
leaq 0x1dfa(%rip), %r13      # 0xa1b8
movq %r12, %rdi
movq %r13, %rsi
callq 0x21d0
movq %rax, %r12
leaq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x8df4
movq %r12, %rdi
movq %rax, %rsi
callq 0x21c0
movq %rax, %rdi
movq %r13, %rsi
callq 0x21d0
addq $0x14, %rbx
jmp 0x84d4
leaq 0x1df2(%rip), %rsi      # 0xa1f0
movq %r15, %rdi
callq 0x21d0
movq %rax, %r12
leaq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x8df4
movq %r12, %rdi
movq %rax, %rsi
callq 0x21c0
leaq 0x1d91(%rip), %rsi      # 0xa1b8
movq %r15, %rdi
callq 0x21d0
movl 0x10(%rbx), %ecx
leaq 0x1d77(%rip), %rdx      # 0xa1b0
movsbl (%rcx,%rdx), %esi
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2220
leaq 0x1d65(%rip), %rsi      # 0xa1bf
jmp 0x84a7
leaq 0x1d7b(%rip), %rsi      # 0xa1de
movq %r15, %rdi
callq 0x21d0
movq %rax, %r12
leaq 0xc(%rbx), %rsi
movq %rax, %rdi
callq 0x7fe0
leaq 0x1d37(%rip), %r13      # 0xa1b8
movq %r12, %rdi
movq %r13, %rsi
callq 0x21d0
leaq 0x18(%rbx), %rsi
movq %rax, %rdi
callq 0x7fe0
movq %r15, %rdi
movq %r13, %rsi
jmp 0x84c8
leaq 0x1d3e(%rip), %rsi      # 0xa1e5
movq %r15, %rdi
callq 0x21d0
movq %rax, %r15
leaq 0xc(%rbx), %rsi
movq %rax, %rdi
callq 0x7fe0
leaq 0x1cf3(%rip), %rsi      # 0xa1b8
movq %r15, %rdi
callq 0x21d0
movq %rax, %r15
addq $0x8, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8df4
movq %r15, %rdi
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21c0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq