// File: czinn[P]homeworlds/game_io.cc
// Function: read_game(std::istream&, 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>>>>>&)
Game* read_game(std::istream& is, std::map<int, std::string>& system_names) {
  int num_players, homeworlds_built, cur_player;
  std::string line;
  is >> num_players >> homeworlds_built >> cur_player;
  std::getline(is, line);
  Game *g = new Game(num_players);
  g->set_homeworlds_built(homeworlds_built);
  g->set_cur_player(cur_player);
  while (true) {
    std::getline(is, line);
    if (line.length() == 0) {
      break;
    }
    System system;
    std::istringstream sis = std::istringstream(line);
    std::string system_name;
    sis >> system_name;
    sis >> system;
    int system_id = g->add_system(system);
    system_names.emplace(system_id, system_name);
  }

  return g;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2d0, %rsp            # imm = 0x2D0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x3320
movq -0x8(%rbp), %rdi
leaq -0x14(%rbp), %rsi
callq 0x3150
movq %rax, -0x288(%rbp)
jmp 0x1e7a2
movq -0x288(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x3150
movq %rax, -0x290(%rbp)
jmp 0x1e7bb
movq -0x290(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
callq 0x3150
jmp 0x1e7cd
movq -0x8(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x3060
jmp 0x1e7dc
movl $0x68, %edi
callq 0x3230
movq %rax, -0x298(%rbp)
jmp 0x1e7ef
movq -0x298(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x38c0
jmp 0x1e800
movq -0x298(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
movl -0x18(%rbp), %esi
callq 0x3c20
jmp 0x1e819
movq -0x58(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x3be0
jmp 0x1e827
jmp 0x1e829
jmp 0x1e82b
movq -0x8(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x3060
jmp 0x1e83a
leaq -0x40(%rbp), %rdi
callq 0x3350
cmpq $0x0, %rax
jne 0x1e881
jmp 0x1e9f7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x1ea1b
movq -0x298(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
movl $0x68, %esi
callq 0x3240
jmp 0x1ea1b
leaq -0x90(%rbp), %rdi
callq 0x1f3b0
leaq -0x210(%rbp), %rdi
leaq -0x40(%rbp), %rsi
movl $0x8, %edx
callq 0x3390
jmp 0x1e8a4
leaq -0x230(%rbp), %rdi
movq %rdi, -0x2a0(%rbp)
callq 0x3320
movq -0x2a0(%rbp), %rsi
leaq -0x210(%rbp), %rdi
callq 0x32e0
jmp 0x1e8cc
leaq -0x210(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x1e670
jmp 0x1e8e1
movq -0x58(%rbp), %rax
movq %rax, -0x2a8(%rbp)
leaq -0x270(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x10240
jmp 0x1e901
movq -0x2a8(%rbp), %rdi
leaq -0x270(%rbp), %rsi
callq 0x6750
movl %eax, -0x2ac(%rbp)
jmp 0x1e91c
leaq -0x270(%rbp), %rdi
callq 0x9620
movl -0x2ac(%rbp), %eax
movl %eax, -0x234(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x234(%rbp), %rsi
leaq -0x230(%rbp), %rdx
callq 0x1f3e0
movb %dl, -0x2b9(%rbp)
movq %rax, -0x2b8(%rbp)
jmp 0x1e95a
movb -0x2b9(%rbp), %al
movq -0x2b8(%rbp), %rcx
movq %rcx, -0x280(%rbp)
movb %al, -0x278(%rbp)
leaq -0x230(%rbp), %rdi
callq 0x3160
leaq -0x210(%rbp), %rdi
callq 0x30f0
leaq -0x90(%rbp), %rdi
callq 0x9620
jmp 0x1e829
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x1e9e9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x1e9d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x270(%rbp), %rdi
callq 0x9620
leaq -0x230(%rbp), %rdi
callq 0x3160
leaq -0x210(%rbp), %rdi
callq 0x30f0
leaq -0x90(%rbp), %rdi
callq 0x9620
jmp 0x1ea1b
movq -0x58(%rbp), %rax
movq %rax, -0x2c8(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x3160
movq -0x2c8(%rbp), %rax
addq $0x2d0, %rsp            # imm = 0x2D0
popq %rbp
retq
leaq -0x40(%rbp), %rdi
callq 0x3160
movq -0x48(%rbp), %rdi
callq 0x33c0
nopl (%rax)