LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl $0x43b0, %edx           # imm = 0x43B0
callq 0x6330
movups 0x43b4(%r14), %xmm0
movups %xmm0, 0x43b4(%rbx)
leaq 0x43cc(%rbx), %rdi
leaq 0x43f8(%r14), %rsi
movl $0x349, %edx            # imm = 0x349
callq 0x6330
leaq 0x4718(%rbx), %rdi
leaq 0x4748(%r14), %rsi
movl $0x4ed8, %edx           # imm = 0x4ED8
callq 0x6330
leaq 0x956f0(%rbx), %rdi
leaq 0x95720(%r14), %rsi
movl $0xae0, %edx            # imm = 0xAE0
callq 0x6330
leaq 0x961d0(%rbx), %rdi
leaq 0x96200(%r14), %rsi
movl $0xae0, %edx            # imm = 0xAE0
callq 0x6330
leaq 0x96cb0(%rbx), %rdi
leaq 0x96ce0(%r14), %rsi
movl $0x349, %edx            # imm = 0x349
callq 0x6330
leaq 0x9620(%r14), %r15
leaq 0x95f0(%rbx), %r12
xorl %r13d, %r13d
cmpb $0x1, 0x7c4(%r15,%r13)
jne 0x51a4c
leaq (%r15,%r13), %rsi
leaq (%r12,%r13), %rdi
movl $0x7c8, %edx            # imm = 0x7C8
callq 0x6330
jmp 0x51a55
movb $0x0, 0x7c4(%r12,%r13)
addq $0x7c8, %r13            # imm = 0x7C8
cmpq $0x8c100, %r13          # imm = 0x8C100
jne 0x51a2d
movslq 0x43b0(%r14), %rax
movl %eax, 0x43b0(%rbx)
movl 0x43c8(%r14), %ecx
movl %ecx, 0x43c8(%rbx)
movl 0x43c4(%r14), %ecx
movl %ecx, 0x43c4(%rbx)
imulq $0x16c0, %rax, %rax     # imm = 0x16C0
leaq (%rbx,%rax), %rdi
addq $0x96ffc, %rdi          # imm = 0x96FFC
movl $0x16c0, %edx           # imm = 0x16C0
xorl %esi, %esi
callq 0x6210
movl 0x43c8(%rbx), %eax
movslq 0x43b0(%rbx), %rcx
imulq $0x16c0, %rcx, %rcx     # imm = 0x16C0
movl %eax, 0x986b4(%rbx,%rcx)
movl 0x43c4(%rbx), %eax
movl %eax, 0x986b8(%rbx,%rcx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/kobanium[P]Ray/src/board/SearchBoard.cpp
// Function: IsLegalForSearch(search_game_info_t const*, int, int)
bool
IsLegalForSearch( const search_game_info_t *game, const int pos, const int color )
{
  // 既に石がある
  if (game->board[pos] != S_EMPTY) {
    return false;
  }

  // 自殺手である
  if (nb4_empty[Pat3(game->pat, pos)] == 0 &&
      IsSuicide(game, game->string, color, pos)) {
    return false;
  }

  // 劫である
  if (game->ko_pos == pos &&
      game->ko_move == (game->moves - 1)) {
    return false;
  }

  return true;
}

// Assembly:
movslq %esi, %rax
cmpb $0x0, 0x43cc(%rdi,%rax)
je 0x51aec
xorl %eax, %eax
retq
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %edx, %r14d
movl %esi, %ebp
movq %rdi, %rbx
addq $0x4718, %rdi           # imm = 0x4718
callq 0x4f84b
movl %eax, %eax
leaq 0x1aaecbcd(%rip), %rcx  # 0x1ab3e6e0
cmpb $0x0, (%rcx,%rax)
jne 0x51b90
leaq 0x95f0(%rbx), %r15
movq %rsp, %rdi
movl %ebp, %esi
callq 0x53e40
xorl %eax, %eax
xorl %ecx, %ecx
movslq (%rsp,%rax,4), %rdx
movsbl 0x43cc(%rbx,%rdx), %esi
movl %esi, %edi
xorl %r14d, %edi
cmpl $0x3, %edi
jne 0x51b5b
movslq 0x956f0(%rbx,%rdx,4), %rdi
imulq $0x7c8, %rdi, %rdi      # imm = 0x7C8
cmpl $0x1, 0x4(%r15,%rdi)
je 0x51b8b
cmpl %r14d, %esi
jne 0x51b77
movslq 0x956f0(%rbx,%rdx,4), %rdx
imulq $0x7c8, %rdx, %rdx      # imm = 0x7C8
cmpl $0x1, 0x4(%r15,%rdx)
jg 0x51b8b
cmpq $0x3, %rax
leaq 0x1(%rax), %rdx
setae %cl
movq %rdx, %rax
cmpq $0x4, %rdx
jne 0x51b2e
testb $0x1, %cl
jne 0x51ba8
cmpl %ebp, 0x43c4(%rbx)
jne 0x51bac
movl 0x43b0(%rbx), %eax
decl %eax
cmpl %eax, 0x43c8(%rbx)
jne 0x51bac
xorl %eax, %eax
jmp 0x51bae
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/kobanium[P]Ray/src/board/SearchBoard.cpp
// Function: RecordString(search_game_info_t*, int)
static void
RecordString( search_game_info_t *game, int id )
{
  const int moves = game->moves;  
  const string_t *string = game->string;
  const int *string_next = game->string_next;
  undo_record_t* rec = &game->undo[moves];
  int pos, i = 0;

  pos = string[id].origin;
  while (pos != STRING_END) {
    rec->stone[rec->strings][i++] = pos;
    pos = string_next[pos];
  }

  rec->string_color[rec->strings] = string[id].color;
  rec->stones[rec->strings] = string[id].size;
  rec->strings_id[rec->strings] = id;
  rec->strings++;
}

// Assembly:
movslq 0x43b0(%rdi), %rax
imulq $0x16c0, %rax, %rax     # imm = 0x16C0
addq %rdi, %rax
addq $0x96ffc, %rax          # imm = 0x96FFC
movslq %esi, %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
addq %rdi, %rcx
addq $0x95f0, %rcx           # imm = 0x95F0
movl 0x7bc(%rcx), %edx
cmpl $0x2b7, %edx            # imm = 0x2B7
je 0x523f9
movq %rax, %r8
movslq 0x16b0(%rax), %r9
imulq $0x5a4, %r9, %r9        # imm = 0x5A4
movl %edx, (%r8,%r9)
movslq %edx, %rdx
movl 0x961d0(%rdi,%rdx,4), %edx
addq $0x4, %r8
cmpl $0x2b7, %edx            # imm = 0x2B7
jne 0x523d1
movb (%rcx), %dl
movslq 0x16b0(%rax), %rdi
movb %dl, 0x16b4(%rax,%rdi)
movl 0x7c0(%rcx), %ecx
movslq 0x16b0(%rax), %rdx
movl %ecx, 0x1690(%rax,%rdx,4)
movslq 0x16b0(%rax), %rcx
movl %esi, 0x16a0(%rax,%rcx,4)
incl 0x16b0(%rax)
retq
// File: /workspace/github_cpp_makefile_star2_O1/kobanium[P]Ray/src/board/SearchBoard.cpp
// Function: AddStone(search_game_info_t*, int, int, int)
static void
AddStone( search_game_info_t *game, const int pos, const int color, const int id )
{
  const char *board = game->board;
  string_t *string = game->string;
  string_t *add_str;
  int *string_id = game->string_id;
  int lib_add = 0;
  int other = GetOppositeColor(color);
  int neighbor, neighbor4[4];

  // IDを更新
  string_id[pos] = id;

  // 追加先の連を取り出す
  add_str = &string[id];

  // 石を追加する
  AddStoneToString(game, add_str, pos);

  // 上下左右の座標の導出
  GetNeighbor4(neighbor4, pos);

  // 空点なら呼吸点を追加し
  // 敵の石があれば隣接する敵連の情報を更新
  for (int i = 0; i < 4; i++) {
    if (board[neighbor4[i]] == S_EMPTY) {
      lib_add = AddLiberty(add_str, neighbor4[i], lib_add);
    } else if (board[neighbor4[i]] == other) {
      neighbor = string_id[neighbor4[i]];
      AddNeighbor(&string[neighbor], id);
      AddNeighbor(&string[id], neighbor);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, %ebx
movl %edx, %ebp
movq %rdi, %r14
movslq %esi, %rax
movl %ecx, 0x956f0(%rdi,%rax,4)
movslq %ecx, %rdx
movq %rdx, (%rsp)
imulq $0x7c8, %rdx, %rcx      # imm = 0x7C8
leaq (%rdi,%rcx), %r12
addq $0x95f0, %r12           # imm = 0x95F0
cmpl $0x2b7, %eax            # imm = 0x2B7
je 0x526dd
leaq 0x961d0(%r14), %rcx
movl 0x7bc(%r12), %edx
cmpl %esi, %edx
jle 0x526c2
leaq 0x7bc(%r12), %rdi
jmp 0x526d0
movslq %edx, %rdi
movl (%rcx,%rdi,4), %edx
cmpl %esi, %edx
jl 0x526c2
leaq (%rcx,%rdi,4), %rdi
movl %edx, (%rcx,%rax,4)
movl %esi, (%rdi)
incl 0x7c0(%r12)
leaq 0x95f0(%r14), %r15
leaq 0x10(%rsp), %rdi
callq 0x53e40
leaq 0x57c(%r12), %rax
leaq 0x578(%r12), %rcx
movq %rcx, 0x8(%rsp)
leaq 0x8(%r12), %rdx
addq $0x4, %r12
xorl %esi, %esi
xorl %edi, %edi
movl 0x10(%rsp,%rsi,4), %r8d
movslq %r8d, %r9
movsbl 0x43cc(%r14,%r9), %ecx
testl %ecx, %ecx
je 0x527bd
xorl %ebp, %ecx
cmpl $0x3, %ecx
jne 0x527f1
movl 0x956f0(%r14,%r9,4), %r8d
movslq %r8d, %r9
imulq $0x7c8, %r9, %r10       # imm = 0x7C8
addq %r15, %r10
movq (%rsp), %rcx
cmpw $0x0, 0x57c(%r10,%rcx,2)
jne 0x52792
movq %r12, %r13
xorl %ecx, %ecx
movslq %ecx, %r11
movzwl 0x57c(%r10,%r11,2), %r12d
movswl %r12w, %ecx
cmpl %ebx, %ecx
jl 0x5275e
movq (%rsp), %rcx
movw %r12w, 0x57c(%r10,%rcx,2)
movw %bx, 0x57c(%r10,%r11,2)
incl 0x578(%r10)
movq %r13, %r12
cmpw $0x0, (%rax,%r9,2)
jne 0x527f1
xorl %ecx, %ecx
movslq %ecx, %r10
movzwl (%rax,%r10,2), %r11d
movswl %r11w, %ecx
cmpl %ecx, %r8d
jg 0x5279c
leaq (%rax,%r10,2), %r10
movw %r11w, (%rax,%r9,2)
movq 0x8(%rsp), %r9
jmp 0x527ea
cmpw $0x0, (%rdx,%r9,2)
je 0x527ca
movl %r8d, %edi
jmp 0x527f1
movslq %edi, %rcx
movzwl (%rdx,%rcx,2), %r11d
movswl %r11w, %edi
cmpl %edi, %r8d
jg 0x527ca
leaq (%rdx,%rcx,2), %r10
movw %r11w, (%rdx,%r9,2)
movq %r12, %r9
movl %r8d, %edi
movw %r8w, (%r10)
incl (%r9)
incq %rsi
cmpq $0x4, %rsi
jne 0x52710
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/kobanium[P]Ray/src/board/String.cpp
// Function: AddStone(game_info_t*, int, int, int)
void
AddStone( game_info_t *game, const int pos, const int color, const int id )
{
  const int other = GetOppositeColor(color);
  string_t *string = game->string;
  string_t *add_str;
  char *board = game->board;
  int *string_id = game->string_id;
  int lib_add = 0;
  int neighbor, neighbor4[4];

  // IDを更新
  string_id[pos] = id;

  // 追加先の連を取り出す
  add_str = &string[id];

  // 石を追加する
  AddStoneToString(game, add_str, pos, 0);

  // 上下左右の座標の導出
  GetNeighbor4(neighbor4, pos);

  // 空点なら呼吸点を追加し
  // 敵の石があれば隣接する敵連の情報を更新
  for (int i = 0; i < 4; i++) {
    if (board[neighbor4[i]] == S_EMPTY) {
      lib_add = AddLiberty(add_str, neighbor4[i], lib_add);
    } else if (board[neighbor4[i]] == other) {
      neighbor = string_id[neighbor4[i]];
      AddNeighbor(&string[neighbor], id, 0);
      AddNeighbor(&string[id], neighbor, 0);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, %ebx
movl %edx, %ebp
movq %rdi, %r14
movslq %esi, %rax
movl %ecx, 0x95720(%rdi,%rax,4)
movslq %ecx, %rdx
movq %rdx, (%rsp)
imulq $0x7c8, %rdx, %rcx      # imm = 0x7C8
leaq (%rdi,%rcx), %r12
addq $0x9620, %r12           # imm = 0x9620
cmpl $0x2b7, %eax            # imm = 0x2B7
je 0x52eb3
leaq 0x96200(%r14), %rcx
movl 0x7bc(%r12), %edx
cmpl %esi, %edx
jle 0x52e98
leaq 0x7bc(%r12), %rdi
jmp 0x52ea6
movslq %edx, %rdi
movl (%rcx,%rdi,4), %edx
cmpl %esi, %edx
jl 0x52e98
leaq (%rcx,%rdi,4), %rdi
movl %edx, (%rcx,%rax,4)
movl %esi, (%rdi)
incl 0x7c0(%r12)
leaq 0x9620(%r14), %r15
leaq 0x10(%rsp), %rdi
callq 0x53e40
leaq 0x57c(%r12), %rax
leaq 0x578(%r12), %rcx
movq %rcx, 0x8(%rsp)
leaq 0x8(%r12), %rdx
addq $0x4, %r12
xorl %esi, %esi
xorl %edi, %edi
movl 0x10(%rsp,%rsi,4), %r8d
movslq %r8d, %r9
movsbl 0x43f8(%r14,%r9), %ecx
testl %ecx, %ecx
je 0x52f93
xorl %ebp, %ecx
cmpl $0x3, %ecx
jne 0x52fc7
movl 0x95720(%r14,%r9,4), %r8d
movslq %r8d, %r9
imulq $0x7c8, %r9, %r10       # imm = 0x7C8
addq %r15, %r10
movq (%rsp), %rcx
cmpw $0x0, 0x57c(%r10,%rcx,2)
jne 0x52f68
movq %r12, %r13
xorl %ecx, %ecx
movslq %ecx, %r11
movzwl 0x57c(%r10,%r11,2), %r12d
movswl %r12w, %ecx
cmpl %ebx, %ecx
jl 0x52f34
movq (%rsp), %rcx
movw %r12w, 0x57c(%r10,%rcx,2)
movw %bx, 0x57c(%r10,%r11,2)
incl 0x578(%r10)
movq %r13, %r12
cmpw $0x0, (%rax,%r9,2)
jne 0x52fc7
xorl %ecx, %ecx
movslq %ecx, %r10
movzwl (%rax,%r10,2), %r11d
movswl %r11w, %ecx
cmpl %ecx, %r8d
jg 0x52f72
leaq (%rax,%r10,2), %r10
movw %r11w, (%rax,%r9,2)
movq 0x8(%rsp), %r9
jmp 0x52fc0
cmpw $0x0, (%rdx,%r9,2)
je 0x52fa0
movl %r8d, %edi
jmp 0x52fc7
movslq %edi, %rcx
movzwl (%rdx,%rcx,2), %r11d
movswl %r11w, %edi
cmpl %edi, %r8d
jg 0x52fa0
leaq (%rdx,%rcx,2), %r10
movw %r11w, (%rdx,%r9,2)
movq %r12, %r9
movl %r8d, %edi
movw %r8w, (%r10)
incl (%r9)
incq %rsi
cmpq $0x4, %rsi
jne 0x52ee6
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/kobanium[P]Ray/src/board/String.cpp
// Function: PoRemoveLiberty(game_info_t*, string_t*, int, int)
void
PoRemoveLiberty( game_info_t *game, string_t *string, const int pos, const int color )
{
  int lib = 0;

  // 既に取り除かれている場合は何もしない
  if (string->lib[pos] == 0) return;

  // 取り除く呼吸点の座標を見つけるまで進める
  while (string->lib[lib] != pos) {
    lib = string->lib[lib];
  }

  // 呼吸点の座標の情報を取り除く
  string->lib[lib] = string->lib[string->lib[lib]];
  string->lib[pos] = 0;

  // 呼吸点の数を1つ減らす
  string->libs--;

  // 連の呼吸点の数を確認
  // 呼吸点が1つならば, その呼吸点を候補手に戻して, レートの更新対象に加える
  // 呼吸点が2つならば, レートの更新対象に加える
  if (string->libs == 1) {
    game->candidates[string->lib[0]] = true;
    game->update_pos[color - 1][game->update_num[color - 1]++] = string->lib[0];
    game->seki[string->lib[0]] = false;
  }
}

// Assembly:
movslq %edx, %rax
cmpw $0x0, 0x8(%rsi,%rax,2)
je 0x5337b
xorl %r8d, %r8d
movslq %r8d, %r9
movswl 0x8(%rsi,%r9,2), %r8d
cmpl %edx, %r8d
jne 0x53309
movslq %r8d, %rdx
movzwl 0x8(%rsi,%rdx,2), %edx
movw %dx, 0x8(%rsi,%r9,2)
movw $0x0, 0x8(%rsi,%rax,2)
movl 0x4(%rsi), %eax
decl %eax
movl %eax, 0x4(%rsi)
cmpl $0x1, %eax
jne 0x5337b
movswl 0x8(%rsi), %eax
cltq
movb $0x1, 0x96ce0(%rdi,%rax)
movslq %ecx, %rcx
leaq -0x1(%rcx), %rdx
imulq $0x5a4, %rdx, %rdx      # imm = 0x5A4
addq %rdi, %rdx
movslq 0x99cf4(%rdi,%rcx,4), %rsi
leal 0x1(%rsi), %r8d
movl %r8d, 0x99cf4(%rdi,%rcx,4)
movl %eax, 0x99d00(%rdx,%rsi,4)
movb $0x0, 0x97029(%rdi,%rax)
retq
// File: /workspace/github_cpp_makefile_star2_O1/kobanium[P]Ray/src/board/GoBoard.cpp
// Function: SetKomi(double)
void
SetKomi( const double new_komi )
{
  default_komi = new_komi;
  komi[0] = dynamic_komi[0] = default_komi;
  komi[S_BLACK] = dynamic_komi[S_BLACK] = default_komi + 1;
  komi[S_WHITE] = dynamic_komi[S_WHITE] = default_komi - 1;
}

// Assembly:
movsd %xmm0, 0x21acd(%rip)    # 0x758c8
movsd %xmm0, 0x1aab812d(%rip) # 0x1ab0bf30
movsd %xmm0, 0x1aab8105(%rip) # 0x1ab0bf10
movsd 0x91f5(%rip), %xmm1     # 0x5d008
addsd %xmm0, %xmm1
movsd %xmm1, 0x1aab8119(%rip) # 0x1ab0bf38
movsd %xmm1, 0x1aab80f1(%rip) # 0x1ab0bf18
addsd 0xb041(%rip), %xmm0     # 0x5ee70
movsd %xmm0, 0x1aab8109(%rip) # 0x1ab0bf40
movsd %xmm0, 0x1aab80e1(%rip) # 0x1ab0bf20
retq
// File: /workspace/github_cpp_makefile_star2_O1/kobanium[P]Ray/src/board/GoBoard.cpp
// Function: IsSuicide(game_info_t const*, string_t const*, int, int)
void
GetNeighbor4( int neighbor4[4], const int pos )
{
  neighbor4[0] = NORTH(pos);
  neighbor4[1] =  WEST(pos);
  neighbor4[2] =  EAST(pos);
  neighbor4[3] = SOUTH(pos);
}

// Assembly:
movl 0x20c44(%rip), %eax     # 0x758bc
movl %ecx, %r8d
subl %eax, %r8d
movl %r8d, -0x18(%rsp)
leal -0x1(%rcx), %r8d
movl %r8d, -0x14(%rsp)
leal 0x1(%rcx), %r8d
movl %r8d, -0x10(%rsp)
addl %ecx, %eax
movl %eax, -0xc(%rsp)
xorl %ecx, %ecx
xorl %eax, %eax
movslq -0x18(%rsp,%rcx,4), %r8
movsbl 0x43f8(%rdi,%r8), %r9d
movl %r9d, %r10d
xorl %edx, %r10d
cmpl $0x3, %r10d
jne 0x54cd0
movslq 0x95720(%rdi,%r8,4), %r10
imulq $0x7c8, %r10, %r10      # imm = 0x7C8
cmpl $0x1, 0x4(%rsi,%r10)
je 0x54d00
cmpl %edx, %r9d
jne 0x54cec
movslq 0x95720(%rdi,%r8,4), %r8
imulq $0x7c8, %r8, %r8        # imm = 0x7C8
cmpl $0x1, 0x4(%rsi,%r8)
jg 0x54d00
cmpq $0x3, %rcx
leaq 0x1(%rcx), %r8
setae %al
movq %r8, %rcx
cmpq $0x4, %r8
jne 0x54c9f
andb $0x1, %al
retq
// File: /workspace/github_cpp_makefile_star2_O1/kobanium[P]Ray/src/board/GoBoard.cpp
// Function: InitializeNeighbor()
static void
InitializeNeighbor( void )
{
  for (int i = 0; i < PAT3_MAX; i++) {
    char empty = 0;

    if (((i >>  2) & 0x3) == S_EMPTY) empty++;
    if (((i >>  6) & 0x3) == S_EMPTY) empty++;
    if (((i >>  8) & 0x3) == S_EMPTY) empty++;
    if (((i >> 12) & 0x3) == S_EMPTY) empty++;

    nb4_empty[i] = empty;
  }
}

// Assembly:
xorl %eax, %eax
leaq 0x1aaea5f4(%rip), %rcx  # 0x1ab3e6e0
xorl %edx, %edx
testb $0xc, %al
sete %dl
leal 0x1(%rdx), %esi
testb $-0x40, %al
movzbl %sil, %esi
cmovnel %edx, %esi
movl %eax, %edx
andl $0x300, %edx            # imm = 0x300
testl $0x3000, %eax           # imm = 0x3000
sete %dil
cmpq $0x1, %rdx
adcb %sil, %dil
movb %dil, (%rax,%rcx)
incq %rax
cmpq $0x10000, %rax          # imm = 0x10000
jne 0x540ec
retq
// File: /workspace/github_cpp_makefile_star2_O1/kobanium[P]Ray/src/board/GoBoard.cpp
// Function: CheckBentFourInTheCorner(game_info_t*)
void
CheckBentFourInTheCorner( game_info_t *game )
{
  const string_t *string = game->string;
  const int *string_id = game->string_id;
  const int *string_next = game->string_next;
  char *board = game->board;
  int pos, neighbor;

  // 四隅について隅のマガリ四目が存在するか確認し
  // 存在すれば地を訂正する
  for (int i = 0; i < 4; i++) {
    const int id = string_id[corner[i]];
    if (string[id].size == 3 &&
        string[id].libs == 2 &&
        string[id].neighbors == 1) {
      const int color = string[id].color;
      const int lib1 = string[id].lib[0];
      const int lib2 = string[id].lib[lib1];
      if ((board[corner_neighbor[i][0]] == S_EMPTY ||
          board[corner_neighbor[i][0]] == color) &&
          (board[corner_neighbor[i][1]] == S_EMPTY ||
          board[corner_neighbor[i][1]] == color)) {
        neighbor = string[id].neighbor[0];
        if (string[neighbor].libs == 2 &&
            string[neighbor].size > 6) {
          // 呼吸点を共有しているかの確認
          const int neighbor_lib1 = string[neighbor].lib[0];
          const int neighbor_lib2 = string[neighbor].lib[neighbor_lib1];
          if ((neighbor_lib1 == lib1 && neighbor_lib2 == lib2) ||
              (neighbor_lib1 == lib2 && neighbor_lib2 == lib1)) {
            pos = string[neighbor].origin;
            while (pos != STRING_END) {
              board[pos] = static_cast<char>(color);
              pos = string_next[pos];
            }
            pos = string[neighbor].lib[0];
            board[pos] = static_cast<char>(color);
            pos = string[neighbor].lib[pos];
            board[pos] = static_cast<char>(color);
          }
        }
      }
    }
  }
}

// Assembly:
pushq %r14
pushq %rbx
leaq 0x9620(%rdi), %rax
xorl %ecx, %ecx
leaq 0x1ab0ba2d(%rip), %rdx  # 0x1ab61270
leaq 0x1ab0ba36(%rip), %rsi  # 0x1ab61280
movslq (%rdx,%rcx,4), %r8
movslq 0x95720(%rdi,%r8,4), %r8
imulq $0x7c8, %r8, %r10       # imm = 0x7C8
cmpl $0x3, 0x7c0(%rax,%r10)
jne 0x5594e
addq %rax, %r10
cmpl $0x2, 0x4(%r10)
jne 0x5594e
cmpl $0x1, 0x578(%r10)
jne 0x5594e
movb (%r10), %r8b
movswq 0x8(%r10), %r9
movzwl 0x8(%r10,%r9,2), %r11d
movslq (%rsi,%rcx,8), %rbx
movb 0x43f8(%rdi,%rbx), %bl
testb %bl, %bl
je 0x558ae
cmpb %r8b, %bl
jne 0x5594e
movslq 0x4(%rsi,%rcx,8), %rbx
movb 0x43f8(%rdi,%rbx), %bl
testb %bl, %bl
je 0x558c7
cmpb %r8b, %bl
jne 0x5594e
movswq 0x57c(%r10), %r10
imulq $0x7c8, %r10, %r10      # imm = 0x7C8
cmpl $0x2, 0x4(%rax,%r10)
jne 0x5594e
addq %rax, %r10
cmpl $0x7, 0x7c0(%r10)
jl 0x5594e
movswq 0x8(%r10), %r14
movzwl 0x8(%r10,%r14,2), %ebx
cmpw %r9w, %r14w
jne 0x55902
cmpw %r11w, %bx
je 0x5590e
cmpw %r11w, %r14w
jne 0x5594e
cmpw %r9w, %bx
jne 0x5594e
movl 0x7bc(%r10), %r9d
cmpl $0x2b7, %r9d            # imm = 0x2B7
je 0x55933
movslq %r9d, %r9
movb %r8b, 0x43f8(%rdi,%r9)
movl 0x96200(%rdi,%r9,4), %r9d
jmp 0x55915
movswq 0x8(%r10), %r9
movb %r8b, 0x43f8(%rdi,%r9)
movswq 0x8(%r10,%r9,2), %r9
movb %r8b, 0x43f8(%rdi,%r9)
incq %rcx
cmpq $0x4, %rcx
jne 0x5584a
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/kobanium[P]Ray/src/board/GoBoard.cpp
// Function: CalculateScore(game_info_t*)
int
CalculateScore( game_info_t *game )
{
  const char *board = game->board;
  int color;
  int scores[S_MAX] = { 0 };

  // 地の数え上げ
  for (int i = 0; i < pure_board_max; i++) {
    const int pos = onboard_pos[i];
    color = board[pos];
    if (color == S_EMPTY) color = territory[Pat3(game->pat, pos)];
    scores[color]++;
  }

  //  黒−白を返す(コミなし)
  return (scores[S_BLACK] - scores[S_WHITE]);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
cmpl $0x0, 0x1ff36(%rip)     # 0x758b0
jle 0x559cd
movq %rdi, %rbx
leaq 0x4748(%rdi), %r14
leaq 0x1ab0ad63(%rip), %r15  # 0x1ab606f0
xorl %r12d, %r12d
leaq 0x1aad8d49(%rip), %r13  # 0x1ab2e6e0
movslq (%r15), %rsi
movsbq 0x43f8(%rbx,%rsi), %rax
testq %rax, %rax
jne 0x559b7
movq %r14, %rdi
callq 0x4f84b
movl %eax, %eax
movzbl (%rax,%r13), %eax
incl (%rsp,%rax,4)
incq %r12
movslq 0x1feec(%rip), %rax     # 0x758b0
addq $0x4, %r15
cmpq %rax, %r12
jl 0x55997
movl 0x4(%rsp), %eax
subl 0x8(%rsp), %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/kobanium[P]Ray/src/board/Point.cpp
// Function: StringToInteger(char const*)
int
StringToInteger( const char *cpos )
{
  char alphabet;
  int x, y, pos;

  if (strcmp(cpos, "pass") == 0 || 
      strcmp(cpos, "PASS") == 0){
    pos = PASS;
  } else {
    alphabet = (char)toupper(cpos[0]);
    x = 0;
    for (int i = 1; i <= pure_board_size; i++) {
      if (gogui_x[i] == alphabet) {
        x = i;
      }
    }
    y = pure_board_size - atoi(&cpos[1]) + 1;
    pos = POS(x + (OB_SIZE - 1), y + (OB_SIZE - 1));
  }

  return pos;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
leaq 0xb3be(%rip), %rsi      # 0x60db0
callq 0x6590
xorl %ebx, %ebx
testl %eax, %eax
je 0x55a72
leaq 0x771d(%rip), %rsi      # 0x5d121
movq %r14, %rdi
callq 0x6590
testl %eax, %eax
je 0x55a72
leaq 0x1fe9d(%rip), %rax     # 0x758b4
movl (%rax), %ebx
testl %ebx, %ebx
jle 0x55a51
movsbl (%r14), %edi
callq 0x67c0
movsbl %al, %eax
leaq 0x1(%rbx), %rcx
xorl %ebp, %ebp
movl $0x1, %edx
leaq 0xb385(%rip), %rsi      # 0x60dc0
movsbl (%rdx,%rsi), %edi
cmpl %edi, %eax
cmovel %edx, %ebp
incq %rdx
cmpq %rdx, %rcx
jne 0x55a3b
addl $0x4, %ebp
jmp 0x55a56
movl $0x4, %ebp
incq %r14
movq %r14, %rdi
callq 0x6640
subl %eax, %ebx
addl $0x5, %ebx
leaq 0x1fe4f(%rip), %rax     # 0x758bc
imull (%rax), %ebx
addl %ebp, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/kobanium[P]Ray/src/board/Point.cpp
// Function: IntegerToString(int, char*)
void
IntegerToString( const int pos, char *cpos )
{
  int x, y;

  if (pos == PASS) {
#if defined (_WIN32)
    sprintf_s(cpos, 5, "%s", pass);
#else
    snprintf(cpos, 5, "%s", pass);
#endif
  } else if (pos == RESIGN) {
#if defined (_WIN32)
    sprintf_s(cpos, 7, "%s", resign);
#else
    snprintf(cpos, 7, "%s", resign);
#endif
  } else {
    x = X(pos) - (OB_SIZE - 1);
    y = pure_board_size - (Y(pos) - OB_SIZE);
    cpos[0] = gogui_x[x];
    if (y / 10 == 0) {
      cpos[1] = static_cast<char>('0' + y % 10);
      cpos[2] = '\0';
    } else {
      cpos[1] = static_cast<char>('0' + y / 10);
      cpos[2] = static_cast<char>('0' + y % 10);
      cpos[3] = '\0';
    }
  }
}

// Assembly:
cmpl $-0x1, %edi
je 0x55a8d
testl %edi, %edi
jne 0x55a9b
movb $0x0, 0x4(%rsi)
movl $0x73736170, (%rsi)     # imm = 0x73736170
retq
movl $0x6e6769, 0x3(%rsi)    # imm = 0x6E6769
movl $0x69736572, (%rsi)     # imm = 0x69736572
retq
leaq 0x1fe1a(%rip), %rcx     # 0x758bc
movl %edi, %eax
cltd
idivl (%rcx)
movslq %edx, %rcx
leaq 0x1fe03(%rip), %rdx     # 0x758b4
movl (%rdx), %edx
subl %eax, %edx
leal 0x5(%rdx), %eax
leaq 0xb301(%rip), %rdi      # 0x60dc0
movb -0x4(%rcx,%rdi), %cl
movb %cl, (%rsi)
addl $0xe, %edx
cmpl $0x12, %edx
ja 0x55af5
movslq %eax, %rcx
imulq $0x66666667, %rcx, %rcx # imm = 0x66666667
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x22, %rcx
addl %edx, %ecx
addl %ecx, %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
addb $0x30, %al
movb %al, 0x1(%rsi)
movb $0x0, 0x2(%rsi)
retq
cltq
imulq $0x66666667, %rax, %rcx # imm = 0x66666667
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x22, %rcx
addl %edx, %ecx
leal 0x30(%rcx), %edx
movb %dl, 0x1(%rsi)
addl %ecx, %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
addb $0x30, %al
movb %al, 0x2(%rsi)
movb $0x0, 0x3(%rsi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/kobanium[P]Ray/src/board/Point.cpp
// Function: ParseSgfPoint[abi:cxx11](int, int)
std::string
ParseSgfPoint( const int x, const int y )
{
  std::string sgf_pos;

  if ((x ==  0 && y ==  0) ||
      (x == -1 && y == -1)) {
    sgf_pos = std::string("tt");
  } else {
    sgf_pos  = static_cast<char>(x - 1 + 'a');
    sgf_pos += static_cast<char>(y - 1 + 'a');
  }

  return sgf_pos;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
leaq 0x10(%rdi), %r15
movq %r15, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
movl %edx, %eax
orl %esi, %eax
setne %al
movl %edx, %ecx
andl %esi, %ecx
cmpl $-0x1, %ecx
setne %cl
testb %cl, %al
jne 0x55de9
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0xb02c(%rip), %rsi      # 0x60de1
leaq 0xb027(%rip), %rdx      # 0x60de3
movq %rsp, %rdi
callq 0x2030e
movq %rsp, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6500
movq (%r14), %rdi
cmpq %r12, %rdi
je 0x55e14
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x6420
jmp 0x55e14
movl %edx, %ebp
addb $0x60, %sil
movsbl %sil, %r8d
movl $0x1, %ecx
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x67d0
addb $0x60, %bpl
movsbl %bpl, %esi
movq %rbx, %rdi
callq 0x6360
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x55e26
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x55e3c
movq (%r15), %rsi
incq %rsi
callq 0x6420
movq %r14, %rdi
callq 0x6770
// File: /workspace/github_cpp_makefile_star2_O1/kobanium[P]Ray/src/board/ZobristHash.cpp
// Function: SetHashSize(unsigned int)
void
SetHashSize( const unsigned int new_size )
{
  if (!(new_size & (new_size - 1))) {
    uct_hash_size = new_size;
    uct_hash_limit = new_size * 9 / 10;
  } else {
    std::cerr << "Hash size must be 2 ^ n" << std::endl;
    for (int i = 1; i <= 20; i++) {
      std::cerr << "2^" << i << ":" << (1 << i) << std::endl;
    }
    exit(1);
  }

}

// Assembly:
leal -0x1(%rdi), %eax
testl %eax, %edi
jne 0x55e68
movl %edi, 0x1fa7f(%rip)     # 0x758d0
leal (%rdi,%rdi,8), %eax
movl $0xcccccccd, %ecx       # imm = 0xCCCCCCCD
imulq %rax, %rcx
shrq $0x23, %rcx
movl %ecx, 0x1fa6d(%rip)     # 0x758d4
retq
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x1f171(%rip), %rbx     # 0x74fe8
leaq 0xaf66(%rip), %rsi      # 0x60de4
movl $0x17, %edx
movq %rbx, %rdi
callq 0x64a0
movq %rbx, %rdi
callq 0x61a0
movl $0x1, %ebp
leaq 0xaf5d(%rip), %r14      # 0x60dfc
leaq 0x71f0(%rip), %r15      # 0x5d096
movl $0x2, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x64a0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x6740
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x64a0
movl $0x1, %esi
movl %ebp, %ecx
shll %cl, %esi
movq %r12, %rdi
callq 0x6740
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x63d0
movsbl %al, %esi
movq %r12, %rdi
callq 0x6040
movq %rax, %rdi
callq 0x62a0
incl %ebp
cmpl $0x15, %ebp
jne 0x55ea6
movl $0x1, %edi
callq 0x64f0
// File: /workspace/github_cpp_makefile_star2_O1/kobanium[P]Ray/src/board/ZobristHash.cpp
// Function: InitializeHash()
void
InitializeHash( void )
{
  std::random_device rnd;
  std::mt19937_64 mt(rnd());

  for (int i = 0; i < MAX_RECORDS; i++) {
    for (int j = 0; j < BOARD_MAX; j++) {
      move_bit[i][j][HASH_PASS] = mt();
      move_bit[i][j][HASH_BLACK] = mt();
      move_bit[i][j][HASH_WHITE] = mt();
      move_bit[i][j][HASH_KO] = mt();
    }
  }
    
  for (int i = 0; i < BOARD_MAX; i++) {  
    hash_bit[i][HASH_PASS]  = mt();
    hash_bit[i][HASH_BLACK] = mt();
    hash_bit[i][HASH_WHITE] = mt();
    hash_bit[i][HASH_KO]    = mt();
    shape_bit[i] = mt();
  }

  node_hash = new node_hash_t[uct_hash_size];

  if (node_hash == NULL) {
    std::cerr << "Cannot allocate memory" << std::endl;
    exit(1);
  }

  enough_size = true;

  InitializeNakadeHash();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1d58, %rsp           # imm = 0x1D58
leaq 0x9d0(%rsp), %rbx
movq %rbx, %rdi
callq 0x39d66
movq %rbx, %rdi
callq 0x6570
movl %eax, %esi
movq %rsi, 0x8(%rsp)
movl $0x1, %eax
movabsq $0x5851f42d4c957f2d, %rcx # imm = 0x5851F42D4C957F2D
movq %rsi, %rdx
shrq $0x3e, %rdx
xorq %rsi, %rdx
imulq %rcx, %rdx
addq %rax, %rdx
movq %rdx, 0x8(%rsp,%rax,8)
incq %rax
movq %rdx, %rsi
cmpq $0x138, %rax            # imm = 0x138
jne 0x55f72
leaq 0x8(%rsp), %rbx
movq $0x138, 0x9c0(%rbx) # imm = 0x138
leaq 0x1ab0b316(%rip), %r14  # 0x1ab612c0
xorl %r15d, %r15d
movl $0x18, %r12d
movq %rbx, %rdi
callq 0x3a512
movq %rax, -0x18(%r14,%r12)
movq %rbx, %rdi
callq 0x3a512
movq %rax, -0x10(%r14,%r12)
movq %rbx, %rdi
callq 0x3a512
movq %rax, -0x8(%r14,%r12)
movq %rbx, %rdi
callq 0x3a512
movq %rax, (%r14,%r12)
addq $0x20, %r12
cmpq $0x6938, %r12           # imm = 0x6938
jne 0x55fb3
incq %r15
addq $0x6920, %r14           # imm = 0x6920
cmpq $0x43b, %r15            # imm = 0x43B
jne 0x55fad
xorl %r14d, %r14d
leaq 0x8(%rsp), %rbx
leaq 0x1c6d6d0b(%rip), %r15  # 0x1c72cd20
leaq 0x1c6dd624(%rip), %r12  # 0x1c733640
movq %rbx, %rdi
callq 0x3a512
movq %rax, (%r15,%r14,4)
movq %rbx, %rdi
callq 0x3a512
movq %rax, 0x8(%r15,%r14,4)
movq %rbx, %rdi
callq 0x3a512
movq %rax, 0x10(%r15,%r14,4)
movq %rbx, %rdi
callq 0x3a512
movq %rax, 0x18(%r15,%r14,4)
movq %rbx, %rdi
callq 0x3a512
movq %rax, (%r14,%r12)
addq $0x8, %r14
cmpq $0x1a48, %r14           # imm = 0x1A48
jne 0x5601c
movl 0x1f862(%rip), %eax     # 0x758d0
shlq $0x3, %rax
leaq (%rax,%rax,2), %rdi
callq 0x6030
movq %rax, 0x1c6df006(%rip)  # 0x1c735088
movb $0x1, 0x1c6df007(%rip)  # 0x1c735090
callq 0x586c0
leaq 0x9d0(%rsp), %rdi
callq 0x63b0
addq $0x1d58, %rsp           # imm = 0x1D58
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x560c8
jmp 0x560b0
jmp 0x560b0
movq %rax, %rbx
leaq 0x9d0(%rsp), %rdi
callq 0x63b0
movq %rbx, %rdi
callq 0x6770
movq %rax, %rdi
callq 0x20303
// File: /workspace/github_cpp_makefile_star2_O1/kobanium[P]Ray/src/board/ZobristHash.cpp
// Function: InitializeUctHash()
void
InitializeUctHash( void )
{
  used = 0;
  enough_size = true;
  oldest_move = 1;
  
  for (unsigned int i = 0; i < uct_hash_size; i++) {
    node_hash[i].flag = false;
    node_hash[i].hash = 0;
    node_hash[i].color = 0;
  }
}

// Assembly:
movl $0x0, 0x1c6defba(%rip)  # 0x1c735094
movb $0x1, 0x1c6defaf(%rip)  # 0x1c735090
movl $0x1, 0x1c6defad(%rip)  # 0x1c735098
cmpl $0x0, 0x1f7de(%rip)     # 0x758d0
je 0x56125
movq 0x1c6def8d(%rip), %rax  # 0x1c735088
addq $0x10, %rax
xorl %ecx, %ecx
movb $0x0, (%rax)
movq $0x0, -0x10(%rax)
movl $0x0, -0x8(%rax)
incq %rcx
movl 0x1f7b4(%rip), %edx     # 0x758d0
addq $0x18, %rax
cmpq %rdx, %rcx
jb 0x56101
retq
// File: /workspace/github_cpp_makefile_star2_O1/kobanium[P]Ray/src/board/ZobristHash.cpp
// Function: ClearUctHash()
void
ClearUctHash( void )
{
  used = 0;
  enough_size = true;

  for (unsigned int i = 0; i < uct_hash_size; i++) {
    node_hash[i].flag = false;
    node_hash[i].hash = 0;
    node_hash[i].color = 0;
    node_hash[i].moves = 0;
  }
}

// Assembly:
movl $0x0, 0x1c6def64(%rip)  # 0x1c735094
movb $0x1, 0x1c6def59(%rip)  # 0x1c735090
cmpl $0x0, 0x1f792(%rip)     # 0x758d0
je 0x56165
movq 0x1c6def41(%rip), %rax  # 0x1c735088
movl 0x1f783(%rip), %ecx     # 0x758d0
xorl %edx, %edx
xorps %xmm0, %xmm0
incq %rdx
movups %xmm0, (%rax)
movb $0x0, 0x10(%rax)
addq $0x18, %rax
cmpq %rcx, %rdx
jb 0x56152
retq
// File: /workspace/github_cpp_makefile_star2_O1/kobanium[P]Ray/src/board/ZobristHash.cpp
// Function: ClearNotDescendentNodes(std::vector<int, std::allocator<int>>&)
void
ClearNotDescendentNodes( std::vector<int> &indexes )
{
  auto iter = indexes.begin();

  for (int i = 0; i < (int)uct_hash_size; i++) {
    if (*iter == i) {
      iter++;
    } else if (node_hash[i].flag) {
      node_hash[i].flag = false;
      node_hash[i].hash = 0;
      node_hash[i].color = 0;
      node_hash[i].moves = 0;
      used--;
    }
  }

  enough_size = true;
}

// Assembly:
cmpl $0x0, 0x1f763(%rip)     # 0x758d0
jle 0x561bd
movl 0x1c6def1f(%rip), %eax  # 0x1c735094
movq (%rdi), %rcx
movq 0x1c6def09(%rip), %rdx  # 0x1c735088
movslq 0x1f74a(%rip), %rsi     # 0x758d0
addq $0x10, %rdx
xorl %edi, %edi
xorps %xmm0, %xmm0
movl (%rcx), %r8d
cmpq %r8, %rdi
jne 0x5619d
addq $0x4, %rcx
jmp 0x561b1
cmpb $0x1, (%rdx)
jne 0x561b1
decl %eax
movups %xmm0, -0x10(%rdx)
movb $0x0, (%rdx)
movl %eax, 0x1c6deee3(%rip)  # 0x1c735094
incq %rdi
addq $0x18, %rdx
cmpq %rsi, %rdi
jl 0x5618f
movb $0x1, 0x1c6deecc(%rip)  # 0x1c735090
retq
// File: /workspace/github_cpp_makefile_star2_O1/kobanium[P]Ray/src/board/ZobristHash.cpp
// Function: DeleteOldHash(game_info_t const*)
void
DeleteOldHash( const game_info_t *game )
{
  while (oldest_move < game->moves) {
    for (unsigned int i = 0; i < uct_hash_size; i++) {
      if (node_hash[i].flag && node_hash[i].moves == oldest_move) {
        node_hash[i].flag = false;
        node_hash[i].hash = 0;
        node_hash[i].color = 0;
        node_hash[i].moves = 0;
        used--;
      }
    }
    oldest_move++;
  }

  enough_size = true;
}

// Assembly:
movl 0x43b0(%rdi), %eax
movl 0x1c6deec7(%rip), %ecx  # 0x1c735098
cmpl %eax, %ecx
jge 0x56232
movl 0x1c6deeb9(%rip), %edx  # 0x1c735094
movq 0x1c6deea6(%rip), %rsi  # 0x1c735088
movl 0x1f6e8(%rip), %edi     # 0x758d0
addq $0x10, %rsi
xorps %xmm0, %xmm0
testl %edi, %edi
je 0x56226
movq %rsi, %r8
xorl %r9d, %r9d
cmpb $0x1, (%r8)
jne 0x5621a
cmpl %ecx, -0x4(%r8)
jne 0x5621a
leaq -0x10(%r8), %r10
decl %edx
movups %xmm0, (%r10)
movb $0x0, 0x10(%r10)
movl %edx, 0x1c6dee7a(%rip)  # 0x1c735094
incq %r9
addq $0x18, %r8
cmpq %rdi, %r9
jb 0x561f9
incl %ecx
cmpl %eax, %ecx
jne 0x561ef
movl %eax, 0x1c6dee66(%rip)  # 0x1c735098
movb $0x1, 0x1c6dee57(%rip)  # 0x1c735090
retq
// File: /workspace/github_cpp_makefile_star2_O1/kobanium[P]Ray/src/board/DynamicKomi.cpp
// Function: SetHandicapNum(int)
void
SetHandicapNum( const int num )
{
  if (const_handicap_num == 0) {
    handicap_num = num;
    if (dk_mode != DK_OFF && handicap_num == 0) {
      dk_mode = DK_OFF;
    } else if (dk_mode == DK_OFF &&  handicap_num != 0) {
      dk_mode = DK_LINEAR;
    } 
  } else {
    handicap_num = const_handicap_num;
    dk_mode = DK_LINEAR;
  }
}

// Assembly:
movl 0x1c6deda7(%rip), %eax  # 0x1c7350c8
testl %eax, %eax
je 0x5632f
movl %eax, 0x1c6deda1(%rip)  # 0x1c7350cc
movb $0x1, %al
jmp 0x56356
movl %edi, 0x1c6ded97(%rip)  # 0x1c7350cc
movb 0x1c6ded95(%rip), %al   # 0x1c7350d0
testl %edi, %edi
sete %cl
testb %al, %cl
je 0x56348
xorl %eax, %eax
jmp 0x56356
testl %edi, %edi
sete %cl
orb %al, %cl
movb $0x1, %al
testb $0x1, %cl
jne 0x5635c
movb %al, 0x1c6ded74(%rip)   # 0x1c7350d0
retq
// File: /workspace/github_cpp_makefile_star2_O1/kobanium[P]Ray/src/board/DynamicKomi.cpp
// Function: DynamicKomi(game_info_t const*, uct_node_t const*, int)
void
DynamicKomi( const game_info_t *game, const uct_node_t *root, const int color )
{
  if (handicap_num != 0) {
    switch(dk_mode) {
      case DK_LINEAR:
        LinearHandicap(game);
        break;
      case DK_VALUE:
        ValueSituational(root, color);
        break;
      default:
        break;
    }
  }
}

// Assembly:
movl 0x1c6ded69(%rip), %eax  # 0x1c7350cc
testl %eax, %eax
je 0x5638c
cmpb $0x1, 0x1c6ded62(%rip)  # 0x1c7350d0
jne 0x5638c
movl 0x43b0(%rdi), %ecx
cmpl $0xba, %ecx
jl 0x5638d
cvtsi2sd %eax, %xmm0
addsd 0x6c86(%rip), %xmm0     # 0x5d010
jmp 0x563ac
retq
shll $0x3, %eax
cvtsi2sd %eax, %xmm1
cvtsi2sd %ecx, %xmm0
divsd 0xaa60(%rip), %xmm0     # 0x60e00
addsd 0x6c60(%rip), %xmm0     # 0x5d008
mulsd %xmm1, %xmm0
leaq 0x1aab5b7d(%rip), %rax  # 0x1ab0bf30
movsd %xmm0, (%rax)
movsd 0x6c49(%rip), %xmm1     # 0x5d008
addsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rax)
addsd 0x8aa0(%rip), %xmm0     # 0x5ee70
movsd %xmm0, 0x10(%rax)
jmp 0x1eafa
nop
// File: /workspace/github_cpp_makefile_star2_O1/kobanium[P]Ray/src/feature/SimulationFeature.cpp
// Function: SetCrossPosition()
void
SetCrossPosition( void )
{
  cross[0] = -board_size - 1;
  cross[1] = -board_size + 1;
  cross[2] =  board_size - 1;
  cross[3] =  board_size + 1;
}

// Assembly:
leaq 0x1f161(%rip), %rax     # 0x758bc
movl (%rax), %eax
movl %eax, %ecx
notl %ecx
movl %ecx, 0x1c6def59(%rip)  # 0x1c7356c0
movl $0x1, %ecx
subl %eax, %ecx
movl %ecx, 0x1c6def50(%rip)  # 0x1c7356c4
leal -0x1(%rax), %ecx
movl %ecx, 0x1c6def4b(%rip)  # 0x1c7356c8
incl %eax
movl %eax, 0x1c6def47(%rip)  # 0x1c7356cc
retq
// File: /workspace/github_cpp_makefile_star2_O1/kobanium[P]Ray/src/feature/Territory.cpp
// Function: IsRemainingDeadStone(game_info_t const*, int, statistic_t const*)
bool
IsRemainingDeadStone( const game_info_t *game, const int color, const statistic_t statistic[] )
{
  const char *board = game->board;
  const int other = GetOppositeColor(color);
  double owner[BOARD_MAX];

  std::fill_n(owner, BOARD_MAX, 0);

  CalculateOwner(statistic, color, owner);

  for (int i = 0; i < pure_board_max; i++) {
    const int pos = onboard_pos[i];
    if (board[pos] == other && owner[pos] > 0.95) {
      return true;
    }
  }

  return false;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1a50, %rsp           # imm = 0x1A50
movq %rdx, %r15
movl %esi, %ebx
movq %rdi, %r14
movq %rsp, %rdi
movl $0x1a48, %edx           # imm = 0x1A48
xorl %esi, %esi
callq 0x6210
leaq 0x1d2b6(%rip), %rax     # 0x758b0
cmpl $0x0, (%rax)
jle 0x58650
movslq %ebx, %rcx
xorl %edx, %edx
leaq 0x1ab080e5(%rip), %rsi  # 0x1ab606f0
movslq (%rsi,%rdx,4), %rdi
movq %rdi, %r8
shlq $0x4, %r8
movl 0x4(%r15,%r8), %r10d
movl 0x8(%r15,%r8), %r9d
addl %r10d, %r9d
je 0x58645
addq %r15, %r8
movl (%r8,%rcx,4), %r8d
xorps %xmm0, %xmm0
cvtsi2sd %r8d, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %r9d, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, (%rsp,%rdi,8)
incq %rdx
movslq (%rax), %rdi
cmpq %rdi, %rdx
jl 0x5860b
movslq (%rax), %rcx
testq %rcx, %rcx
setg %al
jle 0x586ae
movq %rcx, %rdx
negq %rdx
movl $0x1, %esi
leaq 0x1ab08083(%rip), %rdi  # 0x1ab606f0
movsd 0x7a83(%rip), %xmm0     # 0x600f8
movslq -0x4(%rdi,%rsi,4), %r8
movsbl 0x43f8(%r14,%r8), %r9d
xorl %ebx, %r9d
cmpl $0x3, %r9d
jne 0x58698
movsd (%rsp,%r8,8), %xmm1
ucomisd %xmm0, %xmm1
ja 0x586ae
cmpq %rcx, %rsi
setb %al
leaq (%rdx,%rsi), %r8
incq %r8
incq %rsi
cmpq $0x1, %r8
jne 0x58675
andb $0x1, %al
addq $0x1a50, %rsp           # imm = 0x1A50
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/kobanium[P]Ray/src/feature/Nakade.cpp
// Function: Enqueue(nakade_queue_t*, int)
static void
Enqueue( nakade_queue_t *nq, int pos )
{
  nq->pos[nq->tail++] = pos;
  if (nq->tail >= NAKADE_QUEUE_SIZE) {
    nq->tail = 0;
  }
  if (nq->tail == nq->head) {
    std::cerr << "queue  overflow" << std::endl;
  }
}

// Assembly:
movslq 0x7c(%rdi), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x7c(%rdi)
movl %esi, (%rdi,%rax,4)
cmpl $0x1e, 0x7c(%rdi)
jl 0x5936b
movl $0x0, 0x7c(%rdi)
movl 0x7c(%rdi), %eax
cmpl 0x78(%rdi), %eax
jne 0x593b7
pushq %rbx
movq 0x1bc6d(%rip), %rbx     # 0x74fe8
leaq 0x8ae6(%rip), %rsi      # 0x61e68
movl $0xf, %edx
movq %rbx, %rdi
callq 0x64a0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x63d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x6040
movq %rax, %rdi
popq %rbx
jmp 0x62a0
retq
// File: /workspace/github_cpp_makefile_star2_O1/kobanium[P]Ray/src/feature/UctFeature.cpp
// Function: CheckCaptureAfterKoForTree(game_info_t const*, int, unsigned int*)
void
CheckCaptureAfterKoForTree( const game_info_t *game, const int color, unsigned int *tactical_features )
{
  const string_t *string = game->string;
  const char *board = game->board;
  const int *string_id = game->string_id;
  const int other = GetOppositeColor(color);
  const int previous_move_2 = game->record[game->moves - 2].pos;
  int id, lib, neighbor4[4];
  GetNeighbor4(neighbor4, previous_move_2);

  for (int i = 0; i < 4; i++) {
    if (board[neighbor4[i]] == other) {
      id = string_id[neighbor4[i]];
      if (string[id].libs == 1) {
        lib = string[id].lib[0];
        CompareSwapFeature(tactical_features, lib, UCT_CAPTURE_INDEX, UCT_CAPTURE_AFTER_KO);
      }
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
leaq 0x9620(%rdi), %r15
movslq 0x43b0(%rdi), %rax
shlq $0x4, %rax
movl -0x1c(%rax,%rdi), %esi
movq %rsp, %rdi
callq 0x53e40
xorl %eax, %eax
movslq (%rsp,%rax,4), %rcx
movsbl 0x43f8(%r14,%rcx), %edx
xorl %ebp, %edx
cmpl $0x3, %edx
jne 0x5a88f
movslq 0x95720(%r14,%rcx,4), %rcx
imulq $0x7c8, %rcx, %rcx      # imm = 0x7C8
cmpl $0x1, 0x4(%r15,%rcx)
jne 0x5a88f
addq %r15, %rcx
movswq 0x8(%rcx), %rdx
leaq (%rdx,%rdx,8), %rcx
leaq (%rcx,%rcx,2), %rcx
addq %rdx, %rcx
cmpl $0x6, (%rbx,%rcx)
ja 0x5a88f
movl $0x7, (%rbx,%rcx)
incq %rax
cmpq $0x4, %rax
jne 0x5a844
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/kobanium[P]Ray/src/feature/UctFeature.cpp
// Function: CheckCaptureForTree(game_info_t const*, int, int, unsigned int*)
void
CheckCaptureForTree( const game_info_t *game, const int color, const int pos, unsigned int *tactical_features )
{
  const char *board = game->board;
  const int other = GetOppositeColor(color);
  const string_t *string = game->string;
  const int *string_id = game->string_id;
  int neighbor, id;
  int neighbor4[4];
  bool check;

  GetNeighbor4(neighbor4, pos);

  for (int i = 0; i < 4; i++) {
    if (board[neighbor4[i]] == other) {
      if (string[string_id[neighbor4[i]]].libs == 1) {
        check = false;
        id = string_id[neighbor4[i]];
        neighbor = string[id].neighbor[0];
        while (neighbor != NEIGHBOR_END) {
          if (string[neighbor].libs == 1) {
            check = true;
            break;
          }
          neighbor = string[id].neighbor[neighbor];
        }
        if (check) {
          CompareSwapFeature(tactical_features, pos, UCT_CAPTURE_INDEX, UCT_SEMEAI_CAPTURE);
          return;
        } else {
          CompareSwapFeature(tactical_features, pos, UCT_CAPTURE_INDEX, UCT_CAPTURE);
        }
      }
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %rbx
movl %edx, %r15d
movl %esi, %ebp
movq %rdi, %r14
leaq 0x9620(%rdi), %r12
movq %rsp, %rdi
movl %edx, %esi
callq 0x53e40
leal (,%r15,8), %eax
subl %r15d, %eax
cltq
xorl %ecx, %ecx
movslq (%rsp,%rcx,4), %rdx
movsbl 0x43f8(%r14,%rdx), %esi
xorl %ebp, %esi
cmpl $0x3, %esi
jne 0x5ab95
movslq 0x95720(%r14,%rdx,4), %rdx
imulq $0x7c8, %rdx, %rdx      # imm = 0x7C8
cmpl $0x1, 0x4(%r12,%rdx)
jne 0x5ab95
addq %r12, %rdx
movzwl 0x57c(%rdx), %esi
cmpl $0x11f, %esi            # imm = 0x11F
je 0x5ab88
movswq %si, %rsi
imulq $0x7c8, %rsi, %rdi      # imm = 0x7C8
cmpl $0x1, 0x4(%r12,%rdi)
je 0x5aba0
movzwl 0x57c(%rdx,%rsi,2), %esi
jmp 0x5ab63
cmpl $0x3, (%rbx,%rax,4)
ja 0x5ab95
movl $0x4, (%rbx,%rax,4)
incq %rcx
cmpq $0x4, %rcx
jne 0x5ab2e
jmp 0x5abad
cmpl $0x4, (%rbx,%rax,4)
ja 0x5abad
movl $0x5, (%rbx,%rax,4)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/kobanium[P]Ray/src/feature/UctFeature.cpp
// Function: CheckAtariForTree(game_info_t const*, int, int, unsigned int*)
void
CheckAtariForTree( const game_info_t *game, const int color, const int pos, unsigned int *tactical_features )
{
  const char *board = game->board;
  const int other = GetOppositeColor(color);
  const string_t *string = game->string;
  const int *string_id = game->string_id;
  int id, neighbor4[4];

  GetNeighbor4(neighbor4, pos);

  for (int i = 0; i < 4; i++) {
    if (board[neighbor4[i]] == other) {
      id = string_id[neighbor4[i]];
      if (string[id].libs == 2) {
        CompareSwapFeature(tactical_features, pos, UCT_ATARI_INDEX, UCT_ATARI);
      }
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %rbx
movl %edx, %r15d
movl %esi, %ebp
movq %rdi, %r14
leaq 0x9620(%rdi), %r12
movq %rsp, %rdi
movl %edx, %esi
callq 0x53e40
leal (,%r15,8), %eax
subl %r15d, %eax
cltq
xorl %ecx, %ecx
movslq (%rsp,%rcx,4), %rdx
movsbl 0x43f8(%r14,%rdx), %esi
xorl %ebp, %esi
cmpl $0x3, %esi
jne 0x5ac2b
movslq 0x95720(%r14,%rdx,4), %rdx
imulq $0x7c8, %rdx, %rdx      # imm = 0x7C8
cmpl $0x2, 0x4(%r12,%rdx)
jne 0x5ac2b
cmpl $0x0, 0x8(%rbx,%rax,4)
jne 0x5ac2b
movl $0x1, 0x8(%rbx,%rax,4)
incq %rcx
cmpq $0x4, %rcx
jne 0x5abf1
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/kobanium[P]Ray/src/feature/UctFeature.cpp
// Function: CheckKoRecaptureForTree(game_info_t const*, int, unsigned int*)
void
CheckKoRecaptureForTree( const game_info_t *game, const int color, unsigned int *tactical_features )
{
  const string_t *string = game->string;
  const char *board = game->board;
  const int *string_id = game->string_id;
  const int pm3 = game->record[game->moves - 3].pos;
  const int other = GetOppositeColor(color);

  if (board[pm3] == other) {
    const int id = string_id[pm3];
    if (string[id].libs == 1) {
      const int lib = string[id].lib[0];
      CompareSwapFeature(tactical_features, lib, UCT_CAPTURE_INDEX, UCT_KO_RECAPTURE);
    }
  }
}

// Assembly:
movslq 0x43b0(%rdi), %rax
shlq $0x4, %rax
movslq -0x2c(%rax,%rdi), %rax
movsbl 0x43f8(%rdi,%rax), %ecx
xorl %esi, %ecx
cmpl $0x3, %ecx
jne 0x5acd3
movslq 0x95720(%rdi,%rax,4), %rax
imulq $0x7c8, %rax, %rax      # imm = 0x7C8
cmpl $0x1, 0x9624(%rdi,%rax)
jne 0x5acd3
addq %rdi, %rax
addq $0x9620, %rax           # imm = 0x9620
movswq 0x8(%rax), %rcx
leaq (%rcx,%rcx,8), %rax
leaq (%rax,%rax,2), %rax
addq %rcx, %rax
cmpl $0x5, (%rdx,%rax)
ja 0x5acd3
movl $0x6, (%rdx,%rax)
retq
// File: /workspace/github_cpp_makefile_star2_O1/kobanium[P]Ray/src/feature/Semeai.cpp
// Function: IsCapturableAtari(game_info_t const*, int, int, int)
bool
IsCapturableAtari( const game_info_t *game, const int pos, const int color, const int opponent_pos )
{
  const int other = GetOppositeColor(color);

  if (!IsLegal(game, pos, color)) {
    return false;
  }

  std::unique_ptr<search_game_info_t> search_game(new search_game_info_t(game));
  search_game_info_t *capturable_game = search_game.get();

  // とりあえず石を置く
  PutStoneForSearch(capturable_game, pos, color);

  const string_t *string = capturable_game->string;
  const int *string_id = capturable_game->string_id;
  const int id = string_id[opponent_pos];

  // 周囲に取り返せる石があれば安全
  int neighbor = string[id].neighbor[0];
  while (neighbor != NEIGHBOR_END) {
    if (string[neighbor].libs == 1) {
      return false;
    }
    neighbor = string[id].neighbor[neighbor];
  }

  if (!IsLegalForSearch(capturable_game, string[string_id[opponent_pos]].lib[0], other)) {
    return true;
  }
  // 逃げるつもりでダメに打つ
  PutStoneForSearch(capturable_game, string[string_id[opponent_pos]].lib[0], other);

  // 逃げても呼吸点が1つなら捕獲可能と判定
  if (string[string_id[opponent_pos]].libs == 1) {
    return true;
  } else {
    return false;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %r14d
movl %edx, %ebp
movl %esi, %r15d
movq %rdi, %r12
callq 0x54a9c
testb %al, %al
je 0x5aef0
movl $0x69ae40, %edi         # imm = 0x69AE40
callq 0x6410
movq %rax, %rbx
movq %rax, %rdi
movq %r12, %rsi
callq 0x5197c
movq %rbx, %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0x51bb9
movq %rbx, %r15
addq $0x95f0, %r15           # imm = 0x95F0
movslq %r14d, %r12
movslq 0x956f0(%rbx,%r12,4), %rax
imulq $0x7c8, %rax, %rax      # imm = 0x7C8
movzwl 0x9b6c(%rbx,%rax), %ecx
cmpl $0x11f, %ecx            # imm = 0x11F
je 0x5ae9c
leaq (%r15,%rax), %rdx
movswq %cx, %rcx
imulq $0x7c8, %rcx, %rsi      # imm = 0x7C8
cmpl $0x1, 0x4(%r15,%rsi)
je 0x5aef5
movzwl 0x57c(%rdx,%rcx,2), %ecx
cmpl $0x11f, %ecx            # imm = 0x11F
jne 0x5ae79
xorl $0x3, %ebp
movswl 0x8(%r15,%rax), %esi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x51adc
movb $0x1, %r14b
testb %al, %al
je 0x5aef8
movslq 0x956f0(%rbx,%r12,4), %rax
imulq $0x7c8, %rax, %rax      # imm = 0x7C8
movswl 0x8(%r15,%rax), %esi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x51bb9
movslq 0x956f0(%rbx,%r12,4), %rax
imulq $0x7c8, %rax, %rax      # imm = 0x7C8
cmpl $0x1, 0x4(%r15,%rax)
sete %r14b
jmp 0x5aef8
xorl %r14d, %r14d
jmp 0x5af05
xorl %r14d, %r14d
movl $0x69ae40, %esi         # imm = 0x69AE40
movq %rbx, %rdi
callq 0x6420
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5af15
jmp 0x5af15
movq %rax, %r14
movl $0x69ae40, %esi         # imm = 0x69AE40
movq %rbx, %rdi
callq 0x6420
movq %r14, %rdi
callq 0x6770