// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x258, %rsp            # imm = 0x258
movq %rsi, 0x60(%rsp)
movq %rdi, %r14
leaq 0x28(%rsp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
leaq 0x14(%rsp), %rsi
callq 0x2110
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0x2110
leaq 0xc(%rsp), %rsi
movq %rax, %rdi
callq 0x2110
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %edx
leaq 0x18(%rsp), %rsi
movq %r14, %rdi
callq 0x2300
movl $0x68, %edi
callq 0x21c0
movq %rax, %r12
movl 0x14(%rsp), %esi
movq %rax, %rdi
callq 0x26f4
movl 0x10(%rsp), %esi
movq %r12, %rdi
callq 0x2816
movl 0xc(%rsp), %esi
movq %r12, %rdi
callq 0x280c
movq %r12, 0x38(%rsp)
leaq 0xa8(%rsp), %r12
leaq 0x18(%rsp), %r13
leaq 0xd8(%rsp), %rbp
leaq 0x40(%rsp), %rbx
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %edx
movq %r14, %rdi
movq %r13, %rsi
callq 0x2300
cmpq $0x0, 0x20(%rsp)
je 0x8f7a
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%r12)
movups %xmm0, 0x10(%r12)
movups %xmm0, (%r12)
movq %rbp, %rdi
movq %r13, %rsi
movl $0x8, %edx
callq 0x22a0
leaq 0x50(%rsp), %rax
movq %rax, 0x40(%rsp)
movq $0x0, 0x48(%rsp)
movb $0x0, 0x50(%rsp)
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x2210
movq %rbp, %rdi
leaq 0xa0(%rsp), %rsi
callq 0x8c0e
movq 0xa0(%rsp), %rax
movq %rax, 0x68(%rsp)
leaq 0x70(%rsp), %rdi
movq %r12, %rsi
callq 0x44be
leaq 0x88(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0x53c0
movq 0x38(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x42d4
movl %eax, %r15d
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x8ece
movq 0x98(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x8ee8
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movl %r15d, 0x8(%rsp)
movq 0x60(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movq %rbx, %rdx
callq 0x984c
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x8f1b
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x21d0
movq %rbp, %rdi
movq 0x70a3(%rip), %rsi      # 0xffc8
callq 0x2240
leaq 0x150(%rsp), %rdi
callq 0x2090
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x8f54
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x8deb
movq 0xb8(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
jmp 0x8deb
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x8f96
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x38(%rsp), %rax
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x68, %esi
movq %r12, %rdi
callq 0x21d0
jmp 0x9062
jmp 0x8fc4
movq %rax, %rbx
jmp 0x9062
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x453e
jmp 0x9009
movq %rax, %rbx
leaq 0x28(%rsp), %r15
jmp 0x904b
movq %rax, %rbx
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x9009
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
jmp 0x9009
jmp 0x9006
movq %rax, %rbx
leaq 0x28(%rsp), %r15
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x902a
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x6f97(%rip), %rsi      # 0xffc8
leaq 0xd8(%rsp), %rdi
callq 0x2240
leaq 0x150(%rsp), %rdi
callq 0x2090
leaq 0xa0(%rsp), %rdi
callq 0x453e
jmp 0x9062
movq %rax, %rbx
leaq 0x28(%rsp), %r15
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x9079
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x21d0
movq %rbx, %rdi
callq 0x22d0