// File: kobanium[P]Ray/src/board/GoBoard.cpp
// Function: CopyGame(game_info_t*, game_info_t const*)
void
CopyGame( game_info_t *dst, const game_info_t *src )
{
  memcpy(dst->record,             src->record,             sizeof(record_t) * MAX_RECORDS);
  memcpy(dst->prisoner,           src->prisoner,           sizeof(int) * S_MAX);
  memcpy(dst->board,              src->board,              sizeof(char) * board_max);  
  memcpy(dst->pat,                src->pat,                sizeof(pattern_t) * board_max); 
  memcpy(dst->string_id,          src->string_id,          sizeof(int) * STRING_POS_MAX);
  memcpy(dst->string_next,        src->string_next,        sizeof(int) * STRING_POS_MAX);
  memcpy(dst->candidates,         src->candidates,         sizeof(bool) * board_max); 
  memcpy(dst->capture_num,        src->capture_num,        sizeof(int) * 2);
  memcpy(dst->capture_dir,        src->capture_dir,        sizeof(int) * 2);
  memcpy(dst->capture_pos,        src->capture_pos,        sizeof(int) * 2 * CAPTURE_MAX);
  memcpy(dst->update_num,         src->update_num,         sizeof(int) * 2);

  std::fill_n(dst->tactical_features, board_max * ALL_MAX, 0);

  for (int i = 0; i < MAX_STRING; i++) {
    if (src->string[i].flag) {
      memcpy(&dst->string[i], &src->string[i], sizeof(string_t));
    } else {
      dst->string[i].flag = false;
    }
  }

  dst->current_hash = src->current_hash;
  dst->previous1_hash = src->previous1_hash;
  dst->previous2_hash = src->previous2_hash;
  dst->positional_hash = src->positional_hash;
  dst->move_hash = src->move_hash;

  dst->pass_count = src->pass_count;

  dst->moves = src->moves;
  dst->ko_move = src->ko_move;
  dst->ko_pos = src->ko_pos;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x43b0, %edx           # imm = 0x43B0
callq 0x7430
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x43b4(%rcx), %rdx
movq %rdx, 0x43b4(%rax)
movq 0x43bc(%rcx), %rcx
movq %rcx, 0x43bc(%rax)
movq -0x8(%rbp), %rdi
addq $0x43f8, %rdi           # imm = 0x43F8
movq -0x10(%rbp), %rsi
addq $0x43f8, %rsi           # imm = 0x43F8
movslq 0x4b385(%rip), %rdx     # 0xe7a48
shlq $0x0, %rdx
callq 0x7430
movq -0x8(%rbp), %rdi
addq $0x4748, %rdi           # imm = 0x4748
movq -0x10(%rbp), %rsi
addq $0x4748, %rsi           # imm = 0x4748
movslq 0x4b35f(%rip), %rax     # 0xe7a48
imulq $0x18, %rax, %rdx
callq 0x7430
movq -0x8(%rbp), %rdi
addq $0x95720, %rdi          # imm = 0x95720
movq -0x10(%rbp), %rsi
addq $0x95720, %rsi          # imm = 0x95720
movl $0xae0, %edx            # imm = 0xAE0
callq 0x7430
movq -0x8(%rbp), %rdi
addq $0x96200, %rdi          # imm = 0x96200
movq -0x10(%rbp), %rsi
addq $0x96200, %rsi          # imm = 0x96200
movl $0xae0, %edx            # imm = 0xAE0
callq 0x7430
movq -0x8(%rbp), %rdi
addq $0x96ce0, %rdi          # imm = 0x96CE0
movq -0x10(%rbp), %rsi
addq $0x96ce0, %rsi          # imm = 0x96CE0
movslq 0x4b2f9(%rip), %rdx     # 0xe7a48
shlq $0x0, %rdx
callq 0x7430
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x98728(%rcx), %rcx
movq %rcx, 0x98728(%rax)
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x98730(%rcx), %rcx
movq %rcx, 0x98730(%rax)
movq -0x8(%rbp), %rdi
addq $0x98738, %rdi          # imm = 0x98738
movq -0x10(%rbp), %rsi
addq $0x98738, %rsi          # imm = 0x98738
movl $0x15c0, %edx           # imm = 0x15C0
callq 0x7430
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x99cf8(%rcx), %rcx
movq %rcx, 0x99cf8(%rax)
movq -0x8(%rbp), %rdi
addq $0x97372, %rdi          # imm = 0x97372
imull $0x6, 0x4b27c(%rip), %esi # 0xe7a48
movl $0x0, -0x14(%rbp)
leaq -0x14(%rbp), %rdx
callq 0x9eb50
movl $0x0, -0x18(%rbp)
cmpl $0x120, -0x18(%rbp)     # imm = 0x120
jge 0x9c87e
movq -0x10(%rbp), %rax
addq $0x9620, %rax           # imm = 0x9620
movslq -0x18(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
testb $0x1, 0x7c4(%rax)
je 0x9c84f
movq -0x8(%rbp), %rdi
addq $0x9620, %rdi           # imm = 0x9620
movslq -0x18(%rbp), %rax
imulq $0x7c8, %rax, %rax      # imm = 0x7C8
addq %rax, %rdi
movq -0x10(%rbp), %rsi
addq $0x9620, %rsi           # imm = 0x9620
movslq -0x18(%rbp), %rax
imulq $0x7c8, %rax, %rax      # imm = 0x7C8
addq %rax, %rsi
movl $0x7c8, %edx            # imm = 0x7C8
callq 0x7430
jmp 0x9c86e
movq -0x8(%rbp), %rax
addq $0x9620, %rax           # imm = 0x9620
movslq -0x18(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
movb $0x0, 0x7c4(%rax)
jmp 0x9c870
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x9c7e3
movq -0x10(%rbp), %rax
movq 0x43d0(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x43d0(%rax)
movq -0x10(%rbp), %rax
movq 0x43d8(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x43d8(%rax)
movq -0x10(%rbp), %rax
movq 0x43e0(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x43e0(%rax)
movq -0x10(%rbp), %rax
movq 0x43e8(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x43e8(%rax)
movq -0x10(%rbp), %rax
movq 0x43f0(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x43f0(%rax)
movq -0x10(%rbp), %rax
movl 0x4744(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x4744(%rax)
movq -0x10(%rbp), %rax
movl 0x43b0(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x43b0(%rax)
movq -0x10(%rbp), %rax
movl 0x43c8(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x43c8(%rax)
movq -0x10(%rbp), %rax
movl 0x43c4(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x43c4(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)