// File: /workspace/github_cpp_makefile_star2_O3/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
subq $0x18, %rsp
movl 0x4(%rsi), %eax
cmpq $0x7, %rax
ja 0x87dc
movq %rcx, %r12
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x2d05(%rip), %rcx      # 0xb1a0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x2d1f(%rip), %rsi      # 0xb1ca
movl $0x4, %edx
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21f0
leaq 0x2d1a(%rip), %rsi      # 0xb1e7
movl $0x6, %edx
movq %rbx, %rdi
callq 0x21f0
movl 0x10(%r14), %eax
leaq 0x2cdb(%rip), %rcx      # 0xb1c0
movb (%rax,%rcx), %al
leaq 0x13(%rsp), %rsi
jmp 0x878f
leaq 0x2cde(%rip), %rsi      # 0xb1d7
movl $0x9, %edx
movq %rbx, %rdi
callq 0x21f0
movl 0x10(%r14), %eax
leaq 0x2caf(%rip), %rbp      # 0xb1c0
movb (%rax,%rbp), %al
leaq 0x10(%rsp), %rsi
movb %al, (%rsi)
movl $0x1, %edx
movq %rbx, %rdi
callq 0x21f0
movl 0xc(%r14), %esi
movq %rax, %rdi
callq 0x22c0
leaq 0x2c8d(%rip), %r13      # 0xb1c8
movl $0x1, %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x21f0
leaq 0x8(%r14), %rsi
movq %r15, %rdi
callq 0x93c2
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %rbx, %rdi
callq 0x21f0
movl $0x1, %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x21f0
movl 0x1c(%r14), %eax
movb (%rax,%rbp), %al
leaq 0x11(%rsp), %rsi
movb %al, (%rsi)
movl $0x1, %edx
movq %rbx, %rdi
callq 0x21f0
movl 0x18(%r14), %esi
movq %rax, %rdi
callq 0x22c0
movl $0x1, %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x21f0
movq (%r12), %rax
leaq 0x20(%rax), %rcx
movq %rcx, (%r12)
jmp 0x87cd
leaq 0x2c1c(%rip), %rsi      # 0xb1e1
movl $0x5, %edx
movq %rbx, %rdi
callq 0x21f0
movl 0x10(%r14), %eax
leaq 0x2be3(%rip), %rcx      # 0xb1c0
movb (%rax,%rcx), %al
leaq 0x12(%rsp), %rsi
movb %al, (%rsi)
movl $0x1, %edx
movq %rbx, %rdi
callq 0x21f0
movl 0xc(%r14), %esi
movq %rax, %rdi
callq 0x22c0
leaq 0x2bc1(%rip), %r12      # 0xb1c8
movl $0x1, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x21f0
leaq 0x8(%r14), %rsi
movq %r15, %rdi
callq 0x93c2
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %rbx, %rdi
callq 0x21f0
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x21f0
addq $0x14, %r14
jmp 0x87c2
leaq 0x2bae(%rip), %rsi      # 0xb200
movl $0xc, %edx
movq %rbx, %rdi
callq 0x21f0
leaq 0x8(%r14), %rsi
movq %r15, %rdi
callq 0x93c2
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %rbx, %rdi
callq 0x21f0
leaq 0x2b47(%rip), %rsi      # 0xb1c8
movl $0x1, %edx
movq %rbx, %rdi
callq 0x21f0
movl 0x10(%r14), %eax
leaq 0x2b27(%rip), %rcx      # 0xb1c0
movb (%rax,%rcx), %al
leaq 0x17(%rsp), %rsi
movb %al, (%rsi)
movl $0x1, %edx
jmp 0x87d4
leaq 0x2b1b(%rip), %rsi      # 0xb1cf
movl $0x7, %edx
movq %rbx, %rdi
callq 0x21f0
movl 0x10(%r14), %eax
leaq 0x2af4(%rip), %rcx      # 0xb1c0
movb (%rax,%rcx), %al
leaq 0xf(%rsp), %rsi
jmp 0x878f
leaq 0x2b0e(%rip), %rsi      # 0xb1ee
movl $0x6, %edx
movq %rbx, %rdi
callq 0x21f0
movl 0x10(%r14), %eax
leaq 0x2ac8(%rip), %r13      # 0xb1c0
movb (%rax,%r13), %al
leaq 0x14(%rsp), %rsi
movb %al, (%rsi)
movl $0x1, %edx
movq %rbx, %rdi
callq 0x21f0
movl 0xc(%r14), %esi
movq %rax, %rdi
callq 0x22c0
leaq 0x2aa5(%rip), %r12      # 0xb1c8
movl $0x1, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x21f0
movl 0x1c(%r14), %eax
movb (%rax,%r13), %al
leaq 0x15(%rsp), %rsi
movb %al, (%rsi)
movl $0x1, %edx
movq %rbx, %rdi
callq 0x21f0
movl 0x18(%r14), %esi
movq %rax, %rdi
callq 0x22c0
movl $0x1, %edx
movq %rbx, %rdi
movq %r12, %rsi
jmp 0x87b9
leaq 0x2a86(%rip), %rsi      # 0xb1f5
movl $0xa, %edx
movq %rbx, %rdi
callq 0x21f0
movl 0x10(%r14), %eax
leaq 0x2a39(%rip), %rcx      # 0xb1c0
movb (%rax,%rcx), %al
leaq 0x16(%rsp), %rsi
movb %al, (%rsi)
movl $0x1, %edx
movq %rbx, %rdi
callq 0x21f0
movl 0xc(%r14), %esi
movq %rax, %rdi
callq 0x22c0
leaq 0x2a17(%rip), %rsi      # 0xb1c8
movl $0x1, %edx
movq %rbx, %rdi
callq 0x21f0
addq $0x8, %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x93c2
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %rbx, %rdi
callq 0x21f0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq