// File: 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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movq %rax, -0x18(%rbp)
subq $0x7, %rax
ja 0x1e067
movq -0x18(%rbp), %rax
leaq 0x63fc(%rip), %rcx      # 0x2420c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rdi
leaq 0x6432(%rip), %rsi      # 0x24256
callq 0x3220
jmp 0x1e067
movq -0x8(%rbp), %rdi
leaq 0x6422(%rip), %rsi      # 0x2425b
callq 0x3220
movq %rax, %rdi
movq -0x10(%rbp), %rsi
addq $0xc, %rsi
callq 0x1dc20
movq %rax, %rdi
leaq 0x63fc(%rip), %rsi      # 0x24254
callq 0x3220
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl 0x8(%rax), %esi
callq 0x33b0
jmp 0x1e067
movq -0x8(%rbp), %rdi
leaq 0x63e7(%rip), %rsi      # 0x24263
callq 0x3220
movq %rax, %rdi
movq -0x10(%rbp), %rsi
addq $0xc, %rsi
callq 0x1dc20
movq %rax, %rdi
leaq 0x63b9(%rip), %rsi      # 0x24254
callq 0x3220
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl 0x8(%rax), %esi
callq 0x33b0
movq -0x8(%rbp), %rdi
leaq 0x639a(%rip), %rsi      # 0x24254
callq 0x3220
movq %rax, %rdi
movq -0x10(%rbp), %rsi
addq $0x18, %rsi
callq 0x1dc20
jmp 0x1e067
movq -0x8(%rbp), %rdi
leaq 0x638e(%rip), %rsi      # 0x2426d
callq 0x3220
movq %rax, %rdi
movq -0x10(%rbp), %rsi
addq $0xc, %rsi
callq 0x1dc20
movq %rax, %rdi
leaq 0x6356(%rip), %rsi      # 0x24254
callq 0x3220
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl 0x8(%rax), %esi
callq 0x33b0
movq %rax, %rdi
leaq 0x6338(%rip), %rsi      # 0x24254
callq 0x3220
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x14(%rax), %esi
callq 0x33b0
jmp 0x1e067
movq -0x8(%rbp), %rdi
leaq 0x6332(%rip), %rsi      # 0x24273
callq 0x3220
movq %rax, %rdi
movq -0x10(%rbp), %rsi
addq $0xc, %rsi
callq 0x1dc20
movq %rax, %rdi
leaq 0x62f4(%rip), %rsi      # 0x24254
callq 0x3220
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl 0x8(%rax), %esi
callq 0x33b0
jmp 0x1e067
movq -0x8(%rbp), %rdi
leaq 0x62f6(%rip), %rsi      # 0x2427a
callq 0x3220
movq %rax, %rdi
movq -0x10(%rbp), %rsi
addq $0xc, %rsi
callq 0x1dc20
movq %rax, %rdi
leaq 0x62b1(%rip), %rsi      # 0x24254
callq 0x3220
movq %rax, %rdi
movq -0x10(%rbp), %rsi
addq $0x18, %rsi
callq 0x1dc20
movq -0x8(%rbp), %rdi
leaq 0x6291(%rip), %rsi      # 0x24254
callq 0x3220
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl 0x8(%rax), %esi
callq 0x33b0
jmp 0x1e067
movq -0x8(%rbp), %rdi
leaq 0x629a(%rip), %rsi      # 0x24281
callq 0x3220
movq %rax, %rdi
movq -0x10(%rbp), %rsi
addq $0xc, %rsi
callq 0x1dc20
movq %rax, %rdi
leaq 0x624e(%rip), %rsi      # 0x24254
callq 0x3220
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl 0x8(%rax), %esi
callq 0x33b0
jmp 0x1e067
movq -0x8(%rbp), %rdi
leaq 0x6265(%rip), %rsi      # 0x2428c
callq 0x3220
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl 0x8(%rax), %esi
callq 0x33b0
movq -0x8(%rbp), %rdi
leaq 0x620e(%rip), %rsi      # 0x24254
callq 0x3220
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %ecx
leaq 0x61ee(%rip), %rax      # 0x2424c
movsbl (%rax,%rcx), %esi
callq 0x32c0
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)