// File: /workspace/github_cpp_makefile_star2_O3/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 $0x248, %rsp            # imm = 0x248
movq %rsi, 0x50(%rsp)
movq %rdi, %r14
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
leaq 0xc(%rsp), %rsi
callq 0x2110
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x2110
leaq 0x4(%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 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x2300
movl $0x68, %edi
callq 0x21c0
movq %rax, %r12
movl 0xc(%rsp), %esi
movq %rax, %rdi
callq 0x2714
movl 0x8(%rsp), %esi
movq %r12, %rdi
callq 0x2832
movl 0x4(%rsp), %esi
movq %r12, %rdi
callq 0x2828
leaq 0x98(%rsp), %r13
leaq 0xc8(%rsp), %rbp
leaq 0x30(%rsp), %rbx
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %edx
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
callq 0x2300
cmpq $0x0, 0x18(%rsp)
je 0x8d56
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%r13)
movups %xmm0, 0x10(%r13)
movups %xmm0, (%r13)
movq %rbp, %rdi
leaq 0x10(%rsp), %rsi
movl $0x8, %edx
callq 0x22a0
leaq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
movb $0x0, 0x40(%rsp)
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x2210
movq %rbp, %rdi
leaq 0x90(%rsp), %rsi
callq 0x89fa
movq 0x90(%rsp), %rax
movq %rax, 0x58(%rsp)
leaq 0x60(%rsp), %rdi
movq %r13, %rsi
callq 0x43dc
leaq 0x78(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x52d4
movq %r12, %r15
movq %r12, %rdi
leaq 0x58(%rsp), %rsi
callq 0x4202
movl %eax, %r12d
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x8cad
movq 0x88(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x8cc4
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movl %r12d, (%rsp)
movq 0x50(%rsp), %rdi
movq %rsp, %rsi
movq %rbx, %rdx
callq 0x961c
movq %r15, %r12
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x8cf7
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x21d0
movq %rbp, %rdi
movq 0x72c7(%rip), %rsi      # 0xffc8
callq 0x2240
leaq 0x140(%rsp), %rdi
callq 0x2090
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x8d30
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x8bcd
movq 0xa8(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
jmp 0x8bcd
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x8d72
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21d0
movq %r12, %rax
addq $0x248, %rsp            # imm = 0x248
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 0x8e39
jmp 0x8d9e
movq %rax, %rbx
jmp 0x8e39
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x445c
jmp 0x8de0
movq %rax, %rbx
leaq 0x20(%rsp), %r15
jmp 0x8e22
movq %rax, %rbx
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x8de0
movq 0x70(%rsp), %rsi
subq %rdi, %rsi
callq 0x21d0
jmp 0x8de0
jmp 0x8ddd
movq %rax, %rbx
leaq 0x20(%rsp), %r15
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x8e01
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x21d0
movq 0x71c0(%rip), %rsi      # 0xffc8
leaq 0xc8(%rsp), %rdi
callq 0x2240
leaq 0x140(%rsp), %rdi
callq 0x2090
leaq 0x90(%rsp), %rdi
callq 0x445c
jmp 0x8e39
movq %rax, %rbx
leaq 0x20(%rsp), %r15
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x8e50
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21d0
movq %rbx, %rdi
callq 0x22d0