// File: /workspace/github_cpp_makefile_star2_O3/czinn[P]homeworlds/game_io.cc
// Function: operator<<(std::ostream&, Action const&)
std::ostream& operator<<(std::ostream& os, const Action& action) {
  switch(action.type) {
    case PASS:
      os << "PASS";
      break;

    case ATTACK:
      os << "ATTACK " << action.ship << " " << action.system;
      break;

    case DISCOVER:
      os << "DISCOVER " << action.ship << " " << action.system;
      os << " " << action.target;
      break;

    case TRAVEL:
      os << "MOVE " << action.ship << " " << action.system << " ";
      os << action.system_target;
      break;

    case BUILD:
      os << "BUILD " << action.ship << " " << action.system;
      break;

    case TRADE:
      os << "TRADE " << action.ship << " " << action.target;
      os << " " << action.system;
      break;

    case SACRIFICE:
      os << "SACRIFICE " << action.ship << " " << action.system;
      break;

    case CATASTROPHE:
      os << "CATASTROPHE " << action.system;
      os << " " << "rygb"[action.ship.colour];
      break;
  }
  return os;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl 0x4(%rsi), %eax
cmpq $0x7, %rax
ja 0x845e
movq %rsi, %r14
leaq 0x2ffc(%rip), %rcx      # 0xb180
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x3036(%rip), %rsi      # 0xb1ca
movl $0x4, %edx
jmp 0x8334
leaq 0x3042(%rip), %rsi      # 0xb1e7
movl $0x6, %edx
movq %rbx, %rdi
callq 0x21f0
movl 0x10(%r14), %eax
leaq 0x3003(%rip), %rcx      # 0xb1c0
movb (%rax,%rcx), %al
leaq 0x13(%rsp), %rsi
jmp 0x8423
leaq 0x3006(%rip), %rsi      # 0xb1d7
movl $0x9, %edx
movq %rbx, %rdi
callq 0x21f0
movl 0x10(%r14), %eax
leaq 0x2fd7(%rip), %r12      # 0xb1c0
movb (%rax,%r12), %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 0x2fb4(%rip), %r15      # 0xb1c8
movl $0x1, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x21f0
movl 0x8(%r14), %esi
movq %rbx, %rdi
callq 0x22c0
movl $0x1, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x21f0
movl 0x1c(%r14), %eax
movb (%rax,%r12), %al
leaq 0x11(%rsp), %rsi
movb %al, (%rsi)
movl $0x1, %edx
movq %rbx, %rdi
callq 0x21f0
movl 0x18(%r14), %esi
movq %rax, %rdi
jmp 0x8459
leaq 0x2f72(%rip), %rsi      # 0xb1e1
movl $0x5, %edx
movq %rbx, %rdi
callq 0x21f0
movl 0x10(%r14), %eax
leaq 0x2f39(%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 0x2f17(%rip), %r15      # 0xb1c8
movl $0x1, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x21f0
movl 0x8(%r14), %esi
movq %rbx, %rdi
callq 0x22c0
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x21f0
movl 0x14(%r14), %esi
jmp 0x8456
leaq 0x2f13(%rip), %rsi      # 0xb200
movl $0xc, %edx
movq %rbx, %rdi
callq 0x21f0
movl 0x8(%r14), %esi
movq %rbx, %rdi
callq 0x22c0
leaq 0x2ebb(%rip), %rsi      # 0xb1c8
movl $0x1, %edx
movq %rbx, %rdi
callq 0x21f0
movl 0x10(%r14), %eax
leaq 0x2e9b(%rip), %rcx      # 0xb1c0
movb (%rax,%rcx), %al
leaq 0x17(%rsp), %rsi
movb %al, (%rsi)
movl $0x1, %edx
movq %rbx, %rdi
callq 0x21f0
jmp 0x845e
leaq 0x2e87(%rip), %rsi      # 0xb1cf
movl $0x7, %edx
movq %rbx, %rdi
callq 0x21f0
movl 0x10(%r14), %eax
leaq 0x2e60(%rip), %rcx      # 0xb1c0
movb (%rax,%rcx), %al
leaq 0xf(%rsp), %rsi
jmp 0x8423
leaq 0x2e7a(%rip), %rsi      # 0xb1ee
movl $0x6, %edx
movq %rbx, %rdi
callq 0x21f0
movl 0x10(%r14), %eax
leaq 0x2e34(%rip), %r12      # 0xb1c0
movb (%rax,%r12), %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 0x2e11(%rip), %r15      # 0xb1c8
movl $0x1, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x21f0
movl 0x1c(%r14), %eax
movb (%rax,%r12), %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 %r15, %rsi
jmp 0x844d
leaq 0x2df2(%rip), %rsi      # 0xb1f5
movl $0xa, %edx
movq %rbx, %rdi
callq 0x21f0
movl 0x10(%r14), %eax
leaq 0x2da5(%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 0x2d83(%rip), %rsi      # 0xb1c8
movl $0x1, %edx
movq %rbx, %rdi
callq 0x21f0
movl 0x8(%r14), %esi
movq %rbx, %rdi
callq 0x22c0
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq