// File: kobanium[P]Ray/src/board/SearchBoard.cpp
// Function: search_game_info_t::search_game_info_t(game_info_t const*)
search_game_info_t::search_game_info_t( const game_info_t *src )
{
  memcpy(record,      src->record,      sizeof(record_t) * MAX_RECORDS);
  memcpy(prisoner,    src->prisoner,    sizeof(int) * S_MAX);
  memcpy(board,       src->board,       sizeof(char) * BOARD_MAX);
  memcpy(pat,         src->pat,         sizeof(pattern_t) * BOARD_MAX);
  memcpy(string_id,   src->string_id,   sizeof(int) * STRING_POS_MAX);
  memcpy(string_next, src->string_next, sizeof(int) * STRING_POS_MAX);
  memcpy(candidates,  src->candidates,  sizeof(bool) * BOARD_MAX);

  for (int i = 0; i < MAX_STRING; i++) {
    if (src->string[i].flag) {
      memcpy(&string[i], &src->string[i], sizeof(string_t));
    } else {
      string[i].flag = false;
    }
  }

  moves = src->moves;
  ko_move = src->ko_move;
  ko_pos = src->ko_pos;

  memset(&undo[moves], 0, sizeof(undo_record_t));
  undo[moves].ko_move_record = ko_move;
  undo[moves].ko_pos_record = ko_pos;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
movq -0x10(%rbp), %rsi
movl $0x43b0, %edx           # imm = 0x43B0
callq 0x7430
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x43b4(%rax), %rcx
movq %rcx, 0x43b4(%rdi)
movq 0x43bc(%rax), %rax
movq %rax, 0x43bc(%rdi)
addq $0x43cc, %rdi           # imm = 0x43CC
movq -0x10(%rbp), %rsi
addq $0x43f8, %rsi           # imm = 0x43F8
movl $0x349, %edx            # imm = 0x349
callq 0x7430
movq -0x20(%rbp), %rdi
addq $0x4718, %rdi           # imm = 0x4718
movq -0x10(%rbp), %rsi
addq $0x4748, %rsi           # imm = 0x4748
movl $0x4ed8, %edx           # imm = 0x4ED8
callq 0x7430
movq -0x20(%rbp), %rdi
addq $0x956f0, %rdi          # imm = 0x956F0
movq -0x10(%rbp), %rsi
addq $0x95720, %rsi          # imm = 0x95720
movl $0xae0, %edx            # imm = 0xAE0
callq 0x7430
movq -0x20(%rbp), %rdi
addq $0x961d0, %rdi          # imm = 0x961D0
movq -0x10(%rbp), %rsi
addq $0x96200, %rsi          # imm = 0x96200
movl $0xae0, %edx            # imm = 0xAE0
callq 0x7430
movq -0x20(%rbp), %rdi
addq $0x96cb0, %rdi          # imm = 0x96CB0
movq -0x10(%rbp), %rsi
addq $0x96ce0, %rsi          # imm = 0x96CE0
movl $0x349, %edx            # imm = 0x349
callq 0x7430
movl $0x0, -0x14(%rbp)
cmpl $0x120, -0x14(%rbp)     # imm = 0x120
jge 0x98488
movq -0x10(%rbp), %rax
addq $0x9620, %rax           # imm = 0x9620
movslq -0x14(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
testb $0x1, 0x7c4(%rax)
je 0x98459
movq -0x20(%rbp), %rdi
addq $0x95f0, %rdi           # imm = 0x95F0
movslq -0x14(%rbp), %rax
imulq $0x7c8, %rax, %rax      # imm = 0x7C8
addq %rax, %rdi
movq -0x10(%rbp), %rsi
addq $0x9620, %rsi           # imm = 0x9620
movslq -0x14(%rbp), %rax
imulq $0x7c8, %rax, %rax      # imm = 0x7C8
addq %rax, %rsi
movl $0x7c8, %edx            # imm = 0x7C8
callq 0x7430
jmp 0x98478
movq -0x20(%rbp), %rax
addq $0x95f0, %rax           # imm = 0x95F0
movslq -0x14(%rbp), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rcx, %rax
movb $0x0, 0x7c4(%rax)
jmp 0x9847a
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x983ed
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0x43b0(%rcx), %ecx
movl %ecx, 0x43b0(%rax)
movq -0x10(%rbp), %rcx
movl 0x43c8(%rcx), %ecx
movl %ecx, 0x43c8(%rax)
movq -0x10(%rbp), %rcx
movl 0x43c4(%rcx), %ecx
movl %ecx, 0x43c4(%rax)
movq %rax, %rdi
addq $0x96ffc, %rdi          # imm = 0x96FFC
movslq 0x43b0(%rax), %rax
imulq $0x16c0, %rax, %rax     # imm = 0x16C0
addq %rax, %rdi
xorl %esi, %esi
movl $0x16c0, %edx           # imm = 0x16C0
callq 0x72b0
movq -0x20(%rbp), %rdx
movl 0x43c8(%rdx), %ecx
movq %rdx, %rax
addq $0x96ffc, %rax          # imm = 0x96FFC
movslq 0x43b0(%rdx), %rsi
imulq $0x16c0, %rsi, %rsi     # imm = 0x16C0
addq %rsi, %rax
movl %ecx, 0x16b8(%rax)
movl 0x43c4(%rdx), %ecx
movq %rdx, %rax
addq $0x96ffc, %rax          # imm = 0x96FFC
movslq 0x43b0(%rdx), %rdx
imulq $0x16c0, %rdx, %rdx     # imm = 0x16C0
addq %rdx, %rax
movl %ecx, 0x16bc(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)