LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/mcts/Rating.cpp
// Function: OtherUpdate(game_info_t*, int, long long*, long long*, long long*, int, int*, bool*)
static void
OtherUpdate( game_info_t *game, int color, long long *sum_rate, long long sum_rate_row[], long long rate[], int update_num, int update[], bool flag[] )
{
  for (int i = 0; i < update_num; i++) {
    const int pos = update[i];
    if (flag[pos]) continue;

    if (game->candidates[pos]) {
      const bool self_atari_flag = CheckSelfAtariForSimulation(game, color, pos);

      // 元あったレートを消去
      *sum_rate -= rate[pos];
      sum_rate_row[board_y[pos]] -= rate[pos];

      // パターン、戦術的特徴、距離のγ値
      if (!self_atari_flag) {
        rate[pos] = 0;
      } else {
        CheckCaptureAndAtariForSimulation(game, color, pos);
        const double gamma = po_pattern[MD2(game->pat, pos)]
          * CalculateTacticalFeatures(&game->tactical_features[pos * ALL_MAX]);
        rate[pos] = static_cast<long long>(gamma) + 1;

        // 新たに計算したレートを代入
        *sum_rate += rate[pos];
        sum_rate_row[board_y[pos]] += rate[pos];
      }
    }
    ClearTacticalFeatures(&game->tactical_features[pos * ALL_MAX]);
    // 更新済みフラグを立てる
    flag[pos] = true;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r10
movl %esi, %ebp
movq %rdi, %r13
movq 0x78(%rsp), %rdx
movq 0x70(%rsp), %r11
leaq 0x4748(%rdi), %rax
movq %rax, 0x28(%rsp)
leaq 0x97372(%rdi), %rax
movq %rax, 0x20(%rsp)
xorl %r12d, %r12d
testl %r9d, %r9d
cmovlel %r12d, %r9d
leaq 0x1aac8f25(%rip), %r14  # 0x1aaf99b0
movq %r9, 0x8(%rsp)
movq %r8, 0x18(%rsp)
movq %r10, 0x10(%rsp)
cmpq %r12, %r9
je 0x30b9b
movslq (%r11,%r12,4), %r15
cmpb $0x0, (%rdx,%r15)
jne 0x30b93
cmpb $0x1, 0x96ce0(%r13,%r15)
jne 0x30b7b
movq %r13, %rdi
movl %ebp, %esi
movl %r15d, %edx
movq %r14, %rbx
movq %rcx, %r14
callq 0x3ec62
movq 0x10(%rsp), %r10
movq 0x18(%rsp), %r8
movq (%r8,%r15,8), %rcx
subq %rcx, (%r10)
movq (%r8,%r15,8), %rcx
movslq (%rbx,%r15,4), %rdx
subq %rcx, (%r14,%rdx,8)
testb %al, %al
je 0x30b61
movq %r13, %rdi
movl %ebp, %esi
movl %r15d, %edx
callq 0x3f18e
movq 0x28(%rsp), %rdi
movl %r15d, %esi
callq 0x37bd2
movl %eax, %eax
leaq 0x35208(%rip), %rcx     # 0x65d20
cvtss2sd (%rcx,%rax,4), %xmm0
movsd %xmm0, 0x30(%rsp)
imulq $0x6, %r15, %rdi
addq 0x20(%rsp), %rdi
callq 0x310ce
movq 0x10(%rsp), %r10
movq 0x18(%rsp), %r8
mulsd 0x30(%rsp), %xmm0
cvttsd2si %xmm0, %rax
incq %rax
movq %rax, (%r8,%r15,8)
addq %rax, (%r10)
movq (%r8,%r15,8), %rax
movslq (%rbx,%r15,4), %rcx
addq %rax, (%r14,%rcx,8)
movq %r14, %rcx
jmp 0x30b69
movq %r14, %rcx
andq $0x0, (%r8,%r15,8)
movq 0x8(%rsp), %r9
movq 0x78(%rsp), %rdx
movq 0x70(%rsp), %r11
movq %rbx, %r14
imulq $0x6, %r15, %rax
movq 0x20(%rsp), %rbx
andw $0x0, 0x4(%rbx,%rax)
andl $0x0, (%rbx,%rax)
movb $0x1, (%rdx,%r15)
incq %r12
jmp 0x30a9a
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/mcts/Rating.cpp
// Function: LoadParameter(char const*, float*, int)
static void
LoadParameter( const char *filename, float params[], const int array_size )
{
  FILE *fp;
#if defined (_WIN32)
  errno_t err;

  err = fopen_s(&fp, filename, "r");
  if (err != 0) {
    std::cerr << "can not open -" << filename << "-" << std::endl;
    exit(1);
  }
  for (int i = 0; i < array_size; i++) {
    if (fscanf_s(fp, "%e", &params[i]) == EOF) {
      std::cerr << "Read Error : " << filename << std::endl;
    }
  }
#else
  fp = fopen(filename, "r");
  if (fp == NULL) {
    std::cerr << "can not open -" << filename << "-" << std::endl;
    exit(1);
  }
  for (int i = 0; i < array_size; i++) {
    if (fscanf(fp, "%e", &params[i]) == EOF) {
      std::cerr << "Read Error : " << filename << std::endl;
      exit(1);
    }
  }
#endif
  fclose(fp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x14484(%rip), %rsi     # 0x454a3
callq 0x64a0
testq %rax, %rax
je 0x310a4
movq %rax, %r12
xorl %eax, %eax
testl %r14d, %r14d
cmovlel %eax, %r14d
incq %r14
leaq 0x15f52(%rip), %r13     # 0x46f91
decq %r14
je 0x3108e
leaq 0x4(%r15), %rbp
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x6780
movq %rbp, %r15
cmpl $-0x1, %eax
jne 0x3103f
movq 0x2ff89(%rip), %rdi     # 0x60ff0
leaq 0x1401c(%rip), %rsi     # 0x4508a
callq 0x63c0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x63c0
movq %rax, %rdi
callq 0x6190
pushq $0x1
popq %rdi
callq 0x64b0
movq %r12, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x63d0
movq 0x2ff45(%rip), %rdi     # 0x60ff0
leaq 0x13fc6(%rip), %rsi     # 0x45078
callq 0x63c0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x63c0
leaq 0x13032(%rip), %rsi     # 0x440fb
movq %rax, %rdi
jmp 0x31079
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/mcts/Rating.cpp
// Function: CalculateTacticalFeatures(unsigned char*)
inline double
CalculateTacticalFeatures( unsigned char *features )
{
  double rate =
    sim_capture[features[CAPTURE]] *
    sim_save_extension[features[SAVE_EXTENSION]] *
    sim_atari[features[ATARI]] *
    sim_extension[features[EXTENSION]] *
    sim_dame[features[DAME]] *
    sim_throw_in[features[THROW_IN]];

  return rate;
}

// Assembly:
movzbl (%rdi), %eax
leaq 0x4034c68(%rip), %rcx   # 0x4065d40
movss (%rcx,%rax,4), %xmm0
movzbl 0x1(%rdi), %eax
leaq 0x4034ca8(%rip), %rcx   # 0x4065d90
mulss (%rcx,%rax,4), %xmm0
movzbl 0x2(%rdi), %eax
leaq 0x4034cb8(%rip), %rcx   # 0x4065db0
mulss (%rcx,%rax,4), %xmm0
movzbl 0x3(%rdi), %eax
leaq 0x4034cd8(%rip), %rcx   # 0x4065de0
mulss (%rcx,%rax,4), %xmm0
movzbl 0x4(%rdi), %eax
leaq 0x4034cdc(%rip), %rcx   # 0x4065df4
mulss (%rcx,%rax,4), %xmm0
movzbl 0x5(%rdi), %eax
leaq 0x4034cd8(%rip), %rcx   # 0x4065e00
mulss (%rcx,%rax,4), %xmm0
cvtss2sd %xmm0, %xmm0
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/mcts/Simulation.cpp
// Function: Simulation(game_info_t*, int, std::mersenne_twister_engine<unsigned long, 64ul, 312ul, 156ul, 31ul, 13043109905998158313ul, 29ul, 6148914691236517205ul, 17ul, 8202884508482404352ul, 37ul, 18444473444759240704ul, 43ul, 6364136223846793005ul>&)
void
Simulation( game_info_t *game, int starting_color, std::mt19937_64 &mt )
{
  int color = starting_color, pos = -1;
  int pass_count = 0;

  // シミュレーション打ち切り手数を設定
  int length = MAX_MOVES - game->moves;

  if (length < 0) {
    return;
  }

  // レートの初期化  
  std::fill_n(game->sum_rate, 2, 0);
  std::fill(game->sum_rate_row[0], game->sum_rate_row[2], 0);
  std::fill(game->rate[0], game->rate[2], 0);

  // 黒番のレートの計算
  Rating(game, S_BLACK, &game->sum_rate[0], game->sum_rate_row[0], game->rate[0]);
  // 白番のレートの計算
  Rating(game, S_WHITE, &game->sum_rate[1], game->sum_rate_row[1], game->rate[1]);

  // 終局まで対局をシミュレート
  while (length-- && pass_count < 2) {
    // 着手を生成する
    pos = RatingMove(game, color, mt);
    // 石を置く
    PoPutStone(game, pos, color);
    // パスの確認
    pass_count = (pos == PASS) ? (pass_count + 1) : 0;
    // 手番の入れ替え
    color = GetOppositeColor(color);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0x43b0(%rdi), %r12d
cmpl $0x43a, %r12d           # imm = 0x43A
jle 0x3116a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
leaq 0x9dea8(%rdi), %rdx
leaq 0x9deb0(%rdi), %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x9dea8(%rdi)
movl $0x9dcd8, %eax          # imm = 0x9DCD8
cmpq $0x9dea8, %rax          # imm = 0x9DEA8
je 0x311a2
andq $0x0, (%r14,%rax)
addq $0x8, %rax
jmp 0x3118f
leaq 0x9dcd8(%r14), %rcx
movl $0x9a848, %eax          # imm = 0x9A848
cmpq $0x9dcd8, %rax          # imm = 0x9DCD8
je 0x311c1
andq $0x0, (%r14,%rax)
addq $0x8, %rax
jmp 0x311ae
leaq 0x9a848(%r14), %r8
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x30baa
leaq 0x9ddc0(%r14), %rcx
leaq 0x9c290(%r14), %r8
pushq $0x2
popq %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x30baa
addl $0xfffffbc6, %r12d      # imm = 0xFFFFFBC6
xorl %r13d, %r13d
testl %r12d, %r12d
je 0x3115b
cmpl $0x1, %r13d
jg 0x3115b
movq %r14, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x2fd10
movl %eax, %r15d
movq %r14, %rdi
movl %eax, %esi
movl %ebp, %edx
callq 0x3c6ac
incl %r13d
testl %r15d, %r15d
movl $0x0, %eax
cmovnel %eax, %r13d
xorl $0x3, %ebp
incl %r12d
jmp 0x311f9
nop
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/mcts/UctRating.cpp
// Function: AnalyzeUctRating(game_info_t*, int, double*)
void
AnalyzeUctRating( game_info_t *game, int color, double rate[] )
{
  const int moves = game->moves;
  unsigned int tactical_features[BOARD_MAX * UCT_INDEX_MAX] = {0};  
  const int distance_index = CheckFeaturesForTree(game, color, tactical_features);

  CheckRemove2StonesForTree(game, color, tactical_features);
  if (moves > 2 && game->ko_move == moves - 2) {
    CheckCaptureAfterKoForTree(game, color, tactical_features);
    CheckKoConnectionForTree(game, tactical_features);
  } else if (moves > 3 && game->ko_move == moves - 3) {
    CheckKoRecaptureForTree(game, color, tactical_features);
  }

  for (int i = 0; i < pure_board_max; i++) {
    const int pos = onboard_pos[i];
    if (IsLegal(game, pos, color)) {
      CheckSelfAtariForTree(game, color, pos, tactical_features);
      CheckCaptureForTree(game, color, pos, tactical_features);
      CheckAtariForTree(game, color, pos, tactical_features);

      rate[i] = CalculateMoveScoreWithBTFM(game, pos, tactical_features, distance_index);
    } else {
      rate[i] = 0.0;
    }
  }
  rate[pure_board_max] = CalculateMoveScoreWithBTFM(game, PASS, tactical_features, distance_index);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x5c18, %rsp           # imm = 0x5C18
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
movl 0x43b0(%rdi), %r15d
leaq 0x10(%rsp), %r12
movl $0x5bfc, %edx           # imm = 0x5BFC
movq %r12, %rdi
xorl %esi, %esi
callq 0x61f0
movq %r14, %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0x404a0
movl %eax, 0xc(%rsp)
movq %r14, %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0x4187b
cmpl $0x3, %r15d
jl 0x322fa
movl 0x43c8(%r14), %eax
leal -0x2(%r15), %ecx
cmpl %ecx, %eax
jne 0x322d4
leaq 0x10(%rsp), %r12
movq %r14, %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0x41413
movq %r14, %rdi
movq %r12, %rsi
callq 0x417f6
jmp 0x322fa
cmpl $0x3, %r15d
setne %cl
addl $-0x3, %r15d
cmpl %r15d, %eax
sete %al
andb %cl, %al
cmpb $0x1, %al
jne 0x322fa
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
movl %ebp, %esi
callq 0x41823
xorl %r15d, %r15d
leaq 0x10(%rsp), %r12
leaq 0x2f5a7(%rip), %rax     # 0x618b0
movslq (%rax), %rax
cmpq %rax, %r15
jge 0x3237d
leaq 0x1ab1a3d8(%rip), %rax  # 0x1ab4c6f0
movl (%rax,%r15,4), %r13d
movq %r14, %rdi
movl %r13d, %esi
movl %ebp, %edx
callq 0x3bc4c
xorps %xmm0, %xmm0
testb %al, %al
je 0x32372
movq %r14, %rdi
movl %ebp, %esi
movl %r13d, %edx
movq %r12, %rcx
callq 0x4149f
movq %r14, %rdi
movl %ebp, %esi
movl %r13d, %edx
movq %r12, %rcx
callq 0x416b8
movq %r14, %rdi
movl %ebp, %esi
movl %r13d, %edx
movq %r12, %rcx
callq 0x41774
movq %r14, %rdi
movl %r13d, %esi
movq %r12, %rdx
movl 0xc(%rsp), %ecx
callq 0x31b6b
movsd %xmm0, (%rbx,%r15,8)
incq %r15
jmp 0x32302
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
xorl %esi, %esi
movl 0xc(%rsp), %ecx
callq 0x31b6b
leaq 0x2f519(%rip), %rax     # 0x618b0
movslq (%rax), %rax
movsd %xmm0, (%rbx,%rax,8)
addq $0x5c18, %rsp           # imm = 0x5C18
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/mcts/UctRating.cpp
// Function: InputBTFMParameter(char const*, fm_t*, int)
static void
InputBTFMParameter( const char *filename, fm_t params[], const int n )
{
  FILE *fp;

#if defined (_WIN32)
  errno_t err;

  err = fopen_s(&fp, filename, "r");
  if (err != 0) {
    std::cerr << "can not open -" << filename << "-" << std::endl;
    exit(1);
  }
  for (int i = 0; i < n; i++) {
    if (fscanf_s(fp, "%le", &params[i].w) == EOF) {
      std::cerr << "Read Error : " << filename << std::endl;
      exit(1);
    }
    for (int j = 0; j < BTFM_DIMENSION; j++) {
      if (fscanf_s(fp, "%le", &params[i].v[j]) == EOF) {
        std::cerr << "Read Error : " << filename << std::endl;
        exit(1);
      }
    }
  }
#else
  fp = fopen(filename, "r");
  if (fp == NULL) {
    std::cerr << "can not open -" << filename << "-" << std::endl;
    exit(1);
  }
  for (int i = 0; i < n; i++) {
    if (fscanf(fp, "%le", &params[i].w) == EOF) {
      std::cerr << "Read Error : " << filename << std::endl;
      exit(1);
    }
    for (int j = 0; j < BTFM_DIMENSION; j++) {
      if (fscanf(fp, "%le", &params[i].v[j]) == EOF) {
        std::cerr << "Read Error : " << filename << std::endl;
        exit(1);
      }
    }
  }
#endif
  fclose(fp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %r14d
movq %rsi, %rbx
leaq 0x130d7(%rip), %rsi     # 0x454a3
movq %rdi, 0x8(%rsp)
callq 0x64a0
testq %rax, %rax
je 0x324a1
movq %rax, %r12
xorl %eax, %eax
testl %r14d, %r14d
cmovlel %eax, %r14d
leaq 0x14bdb(%rip), %r13     # 0x46fcd
movq %rbx, %r15
xorl %eax, %eax
movq %r14, 0x10(%rsp)
cmpq %r14, %rax
je 0x3245b
movq %rax, %rbp
imulq $0x30, %rax, %rdx
movq %rbx, %r14
addq %rbx, %rdx
movq %r12, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x6780
cmpl $-0x1, %eax
je 0x32471
pushq $0x8
popq %rdx
leaq 0x8(%rdx), %rbx
cmpq $0x38, %rbx
je 0x32447
addq %r15, %rdx
movq %r12, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x6780
movq %rbx, %rdx
cmpl $-0x1, %eax
jne 0x32423
jmp 0x32471
movq %rbp, %rax
incq %rax
addq $0x30, %r15
movq %r14, %rbx
movq 0x10(%rsp), %r14
jmp 0x323fc
movq %r12, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x63d0
movq 0x2eb78(%rip), %rdi     # 0x60ff0
leaq 0x12c0b(%rip), %rsi     # 0x4508a
callq 0x63c0
movq %rax, %rdi
movq 0x8(%rsp), %rsi
callq 0x63c0
movq %rax, %rdi
callq 0x6190
pushq $0x1
popq %rdi
callq 0x64b0
movq 0x2eb48(%rip), %rdi     # 0x60ff0
leaq 0x12bc9(%rip), %rsi     # 0x45078
callq 0x63c0
movq %rax, %rdi
movq 0x8(%rsp), %rsi
callq 0x63c0
leaq 0x11c33(%rip), %rsi     # 0x440fb
movq %rax, %rdi
jmp 0x3248c
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/mcts/MCTSNode.cpp
// Function: InitializeNode(uct_node_t&, int, int)
void
InitializeNode( uct_node_t &node, const int pm1, const int pm2 )
{
  node.previous_move1 = pm1;
  node.previous_move2 = pm2;
  node.move_count = 0;
  node.win = 0;
  node.virtual_loss = 0;
  node.width = 0;
  node.child_num = 0;
  std::fill_n(node.seki, BOARD_MAX, false);
  std::fill_n(node.ownership, BOARD_MAX, 0.0);
}

// Assembly:
movl %esi, (%rdi)
movl %edx, 0x4(%rdi)
xorl %eax, %eax
xchgl %eax, 0x8(%rdi)
xorl %eax, %eax
xchgl %eax, 0xc(%rdi)
xorl %eax, %eax
xchgl %eax, 0x10(%rdi)
andq $0x0, 0x14(%rdi)
movq $-0x349, %rax           # imm = 0xFCB7
testq %rax, %rax
je 0x32802
movb $0x0, 0x2afd(%rdi,%rax)
incq %rax
jmp 0x327f0
movq $-0x1a48, %rax          # imm = 0xE5B8
testq %rax, %rax
je 0x3281d
andq $0x0, 0x4548(%rdi,%rax)
addq $0x8, %rax
jmp 0x32809
retq
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/mcts/MCTSNode.cpp
// Function: ReuseRootCandidateWithoutLadderMove(uct_node_t&, bool const*)
void
ReuseRootCandidateWithoutLadderMove( uct_node_t &node, const bool ladder[] )
{
  const int child_num = node.child_num;
  child_node_t *child = node.child;

  for (int i = 0; i < child_num; i++) {
    const int pos = child[i].pos;

    child[i].rate = 0.0;
    child[i].pw = false;
    child[i].open = false;
    if (ladder[pos]) {
      node.move_count -= child[i].move_count;
      node.win -= child[i].win;
      child[i].move_count = 0;
      child[i].win = 0;
    }

    child[i].ladder = ladder[pos];
  }
}

// Assembly:
movl 0x18(%rdi), %ecx
xorl %eax, %eax
testl %ecx, %ecx
cmovlel %eax, %ecx
imulq $0x1c, %rcx, %rcx
cmpq %rax, %rcx
je 0x328c7
movswq 0x1c(%rdi,%rax), %rdx
andl $0x0, 0x30(%rdi,%rax)
andw $0x0, 0x34(%rdi,%rax)
movb (%rsi,%rdx), %r8b
cmpb $0x1, %r8b
jne 0x328bc
movl 0x20(%rdi,%rax), %r8d
lock
subl %r8d, 0x8(%rdi)
movl 0x28(%rdi,%rax), %r8d
lock
subl %r8d, 0xc(%rdi)
xorl %r8d, %r8d
xchgl %r8d, 0x20(%rdi,%rax)
xorl %r8d, %r8d
xchgl %r8d, 0x28(%rdi,%rax)
movb (%rsi,%rdx), %r8b
movb %r8b, 0x36(%rdi,%rax)
addq $0x1c, %rax
jmp 0x32874
retq
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/mcts/MCTSNode.cpp
// Function: UpdateOwnership(uct_node_t&, game_info_t*, int)
void
UpdateOwnership( uct_node_t &node, game_info_t *game, const int current_color )
{
  const char *board = game->board;

  for (int i = 0; i < pure_board_max; i++) {
    const int pos = onboard_pos[i];
    int color = board[pos];

    if (color == S_EMPTY) color = territory[Pat3(game->pat, pos)];

    if (color == current_color) {
      node.ownership[pos] += 1.0;
    } else if (color == S_EMPTY) {
      node.ownership[pos] += 0.5;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x4748(%rsi), %rax
movq %rax, (%rsp)
leaq 0x2ef87(%rip), %rax     # 0x618b0
movl (%rax), %eax
xorl %ebp, %ebp
leaq 0x1ab19dbc(%rip), %r12  # 0x1ab4c6f0
movsd 0x116cc(%rip), %xmm1    # 0x44008
movslq %eax, %rcx
cmpq %rcx, %rbp
jge 0x329ac
movslq (%r12,%rbp,4), %r13
movsbl 0x43f8(%r14,%r13), %ecx
testl %ecx, %ecx
jne 0x3297f
movq (%rsp), %rdi
movl %r13d, %esi
callq 0x37bc6
movsd 0x1169f(%rip), %xmm1    # 0x44008
movl %eax, %eax
leaq 0x1aae7d6e(%rip), %rcx  # 0x1ab1a6e0
movzbl (%rcx,%rax), %ecx
leaq 0x2ef33(%rip), %rax     # 0x618b0
movl (%rax), %eax
movapd %xmm1, %xmm0
cmpl %ebx, %ecx
je 0x32993
movsd 0x11681(%rip), %xmm0    # 0x44010
testl %ecx, %ecx
jne 0x329a7
addsd 0x2b00(%r15,%r13,8), %xmm0
movsd %xmm0, 0x2b00(%r15,%r13,8)
incq %rbp
jmp 0x3293c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/mcts/ucb/UCBEvaluation.cpp
// Function: CalculateUCB1Value(child_node_t const&, int)
double
CalculateUCB1Value( const child_node_t &child, const int total_visits )
{
  const int move_count = child.move_count + child.virtual_loss.load();
  const double exploitation_term = static_cast<double>(child.win) / move_count;
  const double exploration_term = std::sqrt(2.0 * std::log(total_visits) / move_count);

  return exploitation_term + ucb_c * exploration_term;
}

// Assembly:
subq $0x18, %rsp
movl 0x4(%rdi), %eax
movl 0x8(%rdi), %ecx
movl 0xc(%rdi), %edx
cvtsi2sd %edx, %xmm0
addl %eax, %ecx
cvtsi2sd %ecx, %xmm1
movsd %xmm1, 0x8(%rsp)
divsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
movl %esi, %edi
callq 0x32bf4
addsd %xmm0, %xmm0
divsd 0x8(%rsp), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x32a0e
sqrtsd %xmm0, %xmm0
jmp 0x32a13
callq 0x62f0
mulsd 0x145c5(%rip), %xmm0    # 0x46fe0
addsd 0x10(%rsp), %xmm0
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/mcts/ucb/UCBEvaluation.cpp
// Function: CalculateUCB1TunedValue(child_node_t const&, int)
double
CalculateUCB1TunedValue( const child_node_t &child, const int total_visits )
{
  const int move_count = child.move_count + child.virtual_loss.load();
  const double p = static_cast<double>(child.win) / move_count;
  const double div = std::log(total_visits) / move_count;
  const double v = p - p * p + std::sqrt(2.0 * div);

  return p + std::sqrt(div * ((0.25 < v) ? 0.25 : v));
}

// Assembly:
subq $0x18, %rsp
movl 0x4(%rdi), %eax
movl 0x8(%rdi), %ecx
movl 0xc(%rdi), %edx
cvtsi2sd %edx, %xmm0
addl %eax, %ecx
cvtsi2sd %ecx, %xmm1
movsd %xmm1, (%rsp)
divsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
movl %esi, %edi
callq 0x32bf4
movapd %xmm0, %xmm2
divsd (%rsp), %xmm2
movsd 0x8(%rsp), %xmm1
movapd %xmm1, %xmm0
mulsd %xmm1, %xmm0
subsd %xmm0, %xmm1
movapd %xmm2, %xmm0
addsd %xmm2, %xmm0
xorpd %xmm3, %xmm3
ucomisd %xmm3, %xmm0
jb 0x32a86
sqrtsd %xmm0, %xmm0
jmp 0x32aa5
movsd %xmm2, (%rsp)
movsd %xmm1, 0x10(%rsp)
callq 0x62f0
movsd 0x10(%rsp), %xmm1
xorpd %xmm3, %xmm3
movsd (%rsp), %xmm2
addsd %xmm1, %xmm0
movsd 0x14537(%rip), %xmm1    # 0x46fe8
minsd %xmm0, %xmm1
mulsd %xmm1, %xmm2
ucomisd %xmm3, %xmm2
jb 0x32ac5
sqrtsd %xmm2, %xmm0
jmp 0x32ace
movapd %xmm2, %xmm0
callq 0x62f0
movsd 0x8(%rsp), %xmm1
addsd %xmm0, %xmm1
movapd %xmm1, %xmm0
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/mcts/ucb/UCBEvaluation.cpp
// Function: SelectBestChildIndexByUCB1(uct_node_t const&, std::mersenne_twister_engine<unsigned long, 64ul, 312ul, 156ul, 31ul, 13043109905998158313ul, 29ul, 6148914691236517205ul, 17ul, 8202884508482404352ul, 37ul, 18444473444759240704ul, 43ul, 6364136223846793005ul>&)
int
SelectBestChildIndexByUCB1( const uct_node_t &node, std::mt19937_64 &mt )
{
  const int child_num = node.child_num;
  const int sum = node.move_count + node.virtual_loss.load();
  const double move_score_bonus_weight = bonus_weight * sqrt(bonus_equivalence / (sum + bonus_equivalence));
  const child_node_t *child = node.child;
  int max_child = 0;
  double max_value = -10000.0;

  for (int i = 0; i < child_num; i++) {
    if (child[i].pw || child[i].open) {
      const int move_count = child[i].move_count + child[i].virtual_loss.load();
      double ucb_value = 0.0;
      if (move_count == 0) {
        ucb_value = FPU + 0.0001 * (mt() % 10000);
      } else {
        ucb_value = CalculateUCB1TunedValue(child[i], sum) + CalculateMoveScoreBonus(child[i], move_score_bonus_weight);
      }
      if (ucb_value > max_value) {
        max_value = ucb_value;
        max_child = i;
      }
    }
  }
  
  return max_child;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movl 0x18(%rdi), %r12d
movl 0x8(%rdi), %eax
movl 0x10(%rdi), %ebp
addl %eax, %ebp
cvtsi2sd %ebp, %xmm1
movsd 0x144e3(%rip), %xmm0    # 0x46ff0
addsd %xmm0, %xmm1
divsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x32b25
sqrtsd %xmm0, %xmm2
jmp 0x32b2e
callq 0x62f0
movapd %xmm0, %xmm2
mulsd 0x144b2(%rip), %xmm2    # 0x46fe8
addq $0x1c, %r14
xorl %r13d, %r13d
testl %r12d, %r12d
cmovlel %r13d, %r12d
movsd 0x144ac(%rip), %xmm1    # 0x46ff8
xorl %r15d, %r15d
movsd %xmm2, 0x8(%rsp)
cmpq %r13, %r12
je 0x32be2
cmpb $0x0, 0x18(%r14)
jne 0x32b6c
cmpb $0x1, 0x19(%r14)
jne 0x32bd6
movsd %xmm1, 0x10(%rsp)
movl 0x4(%r14), %eax
movl 0x8(%r14), %ecx
addl %eax, %ecx
jne 0x32ba6
movq %rbx, %rdi
callq 0x266c6
xorl %edx, %edx
movl $0x2710, %ecx           # imm = 0x2710
divq %rcx
cvtsi2sd %edx, %xmm1
mulsd 0x14464(%rip), %xmm1    # 0x47000
addsd 0x13304(%rip), %xmm1    # 0x45ea8
jmp 0x32bc4
movq %r14, %rdi
movl %ebp, %esi
callq 0x32a26
cvtss2sd 0x14(%r14), %xmm1
movsd 0x8(%rsp), %xmm2
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
ucomisd %xmm0, %xmm1
maxsd %xmm0, %xmm1
cmoval %r13d, %r15d
incq %r13
addq $0x1c, %r14
jmp 0x32b55
movl %r15d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/mcts/UctSearch.cpp
// Function: InitializeUctSearch()
void
InitializeUctSearch( void )
{
  int i;

  // Progressive Wideningの初期化  
  pw[0] = 0;
  for (i = 1; i <= PURE_BOARD_MAX; i++) {  
    pw[i] = pw[i - 1] + static_cast<int>(40 * pow(PROGRESSIVE_WIDENING, i - 1));
    if (pw[i] > 10000000) break;
  }
  for (i = i + 1; i <= PURE_BOARD_MAX; i++) { 
    pw[i] = INT_MAX;
  }

  mutex_nodes = new std::mutex[uct_hash_size];

  // UCTのノードのメモリを確保
  uct_node = new uct_node_t[uct_hash_size];

  std::cerr << "Require " << uct_hash_size * sizeof(uct_node_t) / 1024 / 1024 << " Mbytes for Uct Node" << std::endl << std::endl;
  std::cerr << sizeof(uct_node_t) << std::endl;
  std::cerr << sizeof(child_node_t) * UCT_CHILD_MAX << std::endl;
  
  if (uct_node == NULL) {
    std::cerr << "Cannot allocate memory !!" << std::endl;
    std::cerr << "You must reduce tree size !!" << std::endl;
    exit(1);
  }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
andl $0x0, 0x1aabaed9(%rip)  # 0x1aaedb50
pushq $0x1
popq %rbx
xorl %ebp, %ebp
leaq 0x1aabaecd(%rip), %r14  # 0x1aaedb50
cmpq $0x16a, %rbx            # imm = 0x16A
je 0x32ccb
leal -0x1(%rbx), %eax
cvtsi2sd %eax, %xmm1
movsd 0x1436d(%rip), %xmm0    # 0x47008
callq 0x6710
mulsd 0x14368(%rip), %xmm0    # 0x47010
cvttsd2si %xmm0, %eax
addl %eax, %ebp
movl %ebp, (%r14,%rbx,4)
cmpl $0x989680, %ebp         # imm = 0x989680
jg 0x32ccb
incq %rbx
jmp 0x32c83
movl $0x7fffffff, 0x4(%r14,%rbx,4) # imm = 0x7FFFFFFF
incq %rbx
cmpq $0x168, %rbx            # imm = 0x168
jbe 0x32cbf
leaq 0x2ebf5(%rip), %r15     # 0x618d0
movl (%r15), %r12d
imulq $0x28, %r12, %rbx
movq %rbx, %rdi
callq 0x6030
movq %rax, %r14
testq %r12, %r12
je 0x32d15
addq $-0x28, %rbx
pushq $0x28
popq %rcx
movq %rbx, %rax
xorl %edx, %edx
divq %rcx
subq %rdx, %rbx
addq $0x28, %rbx
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x61f0
movq %r14, 0x1aabb3dc(%rip)  # 0x1aaee0f8
imulq $0x4548, %r12, %rdi     # imm = 0x4548
callq 0x6030
movq %rax, 0x1aa93c01(%rip)  # 0x1aac6930
movq 0x2e2ba(%rip), %rbx     # 0x60ff0
leaq 0x142eb(%rip), %rsi     # 0x47028
movq %rbx, %rdi
callq 0x63c0
movl (%r15), %ecx
imulq $0x4548, %rcx, %rsi     # imm = 0x4548
shrq $0x14, %rsi
movq %rax, %rdi
callq 0x6270
leaq 0x142cf(%rip), %rsi     # 0x47031
movq %rax, %rdi
callq 0x63c0
movq %rax, %rdi
callq 0x6190
movq %rax, %rdi
callq 0x6190
movl $0x4548, %esi           # imm = 0x4548
movq %rbx, %rdi
callq 0x6270
movq %rax, %rdi
callq 0x6190
movl $0x2798, %esi           # imm = 0x2798
movq %rbx, %rdi
callq 0x6270
movq %rax, %rdi
callq 0x6190
cmpq $0x0, 0x1aa93b84(%rip)  # 0x1aac6930
je 0x32db7
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x2e232(%rip), %rbx     # 0x60ff0
leaq 0x14281(%rip), %rsi     # 0x47046
movq %rbx, %rdi
callq 0x63c0
movq %rax, %rdi
callq 0x6190
leaq 0x14284(%rip), %rsi     # 0x47060
movq %rbx, %rdi
callq 0x63c0
movq %rax, %rdi
callq 0x6190
pushq $0x1
popq %rdi
callq 0x64b0
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/mcts/UctSearch.cpp
// Function: InitializeSearchSetting()
void
InitializeSearchSetting( void )
{
  // Ownerの初期化
  for (int i = 0; i < board_max; i++){
    owner[i] = 50;
    owner_index[i] = 5;
    candidates[i] = true;
  }

  // 乱数の初期化
  std::random_device rand;
  for (int i = 0; i < THREAD_MAX; i++) {
    mt[i].seed(rand());
  }


  SetTimeManagementParameter();
  InitializeTimeSetting();

  pondered = false;
  pondering_stop = true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1390, %rsp           # imm = 0x1390
leaq 0x2eab1(%rip), %rax     # 0x618b8
movslq (%rax), %rax
leaq 0x1aabcd3f(%rip), %rcx  # 0x1aaefb50
leaq 0x1aabb2e8(%rip), %rdx  # 0x1aaee100
xorl %esi, %esi
movabsq $0x4049000000000000, %rdi # imm = 0x4049000000000000
leaq 0x1aabda55(%rip), %r8   # 0x1aaf0880
cmpq %rax, %rsi
jge 0x32e4b
movq %rdi, (%rdx)
movl $0x5, (%rcx)
movb $0x1, (%rsi,%r8)
incq %rsi
addq $0x4, %rcx
addq $0x8, %rdx
jmp 0x32e2b
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x25d50
xorl %r14d, %r14d
leaq 0x1aa93ade(%rip), %r15  # 0x1aac6940
cmpq $0x27200, %r14          # imm = 0x27200
je 0x32e87
movq %rbx, %rdi
callq 0x6550
leaq (%r15,%r14), %rdi
movl %eax, %esi
callq 0x25ebc
addq $0x9c8, %r14            # imm = 0x9C8
jmp 0x32e62
callq 0x35b62
callq 0x35896
movb $0x0, 0x1aabdd31(%rip)  # 0x1aaf0bc9
movb $0x1, 0x1aabdd2b(%rip)  # 0x1aaf0bca
leaq 0x8(%rsp), %rdi
callq 0x25eac
addq $0x1390, %rsp           # imm = 0x1390
popq %rbx
popq %r14
popq %r15
retq
jmp 0x32eb8
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x25eac
movq %rbx, %rdi
callq 0x6740
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/mcts/UctSearch.cpp
// Function: StopPondering()
void
StopPondering( void )
{
  if (!pondering_mode) {
    return ;
  }

  if (ponder) {
    pondering_stop = true;
    for (int i = 0; i < threads; i++) {
      worker[i]->join();
      delete worker[i];
    }
    ponder = false;
    pondered = true;
    PrintPonderingCount(GetPoCount());
  }
}

// Assembly:
cmpb $0x1, 0x1aa93a68(%rip)  # 0x1aac693c
jne 0x32f33
cmpb $0x1, 0x1aabdcee(%rip)  # 0x1aaf0bcb
jne 0x32f33
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movb $0x1, 0x1aabdcdc(%rip)  # 0x1aaf0bca
leaq 0x1aabdcdb(%rip), %r15  # 0x1aaf0bd0
xorl %r12d, %r12d
pushq $0x8
popq %rbx
movslq 0x2e976(%rip), %rax     # 0x61878
cmpq %rax, %r12
jge 0x32f34
movq (%r15), %rdi
callq 0x66e0
movq (%r15), %r14
testq %r14, %r14
je 0x32f1f
movq %r14, %rdi
callq 0x2695c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x63f0
incq %r12
addq $0x8, %r15
jmp 0x32efb
retq
movb $0x0, 0x1aabdc90(%rip)  # 0x1aaf0bcb
movb $0x1, 0x1aabdc87(%rip)  # 0x1aaf0bc9
callq 0x35c49
movl %eax, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1062e
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/mcts/UctSearch.cpp
// Function: CorrectDescendentNodes(std::vector<int, std::allocator<int>>&, int)
static void
CorrectDescendentNodes( std::vector<int> &indexes, int index )
{
  child_node_t *uct_child = uct_node[index].child;
  const int child_num = uct_node[index].child_num;

  indexes.push_back(index);

  for (int i = 0; i < child_num; i++) {
    if (uct_child[i].index != NOT_EXPANDED) {
      CorrectDescendentNodes(indexes, uct_child[i].index);
    }
  }   
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x4(%rsp), %rax
movl %esi, (%rax)
movq 0x1aa926e8(%rip), %rcx  # 0x1aac6930
movslq %esi, %rdx
imulq $0x4548, %rdx, %rdx     # imm = 0x4548
leaq (%rcx,%rdx), %r14
addq $0x2c, %r14
movl -0x14(%r14), %r12d
movq %rax, %rsi
callq 0x350b6
xorl %r15d, %r15d
testl %r12d, %r12d
cmovlel %r15d, %r12d
imulq $0x1c, %r12, %r12
cmpq %r15, %r12
je 0x34290
movl (%r14,%r15), %esi
cmpl $-0x1, %esi
je 0x3428a
movq %rbx, %rdi
callq 0x3422f
addq $0x1c, %r15
jmp 0x34274
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/mcts/MoveSelection.cpp
// Function: SetResignThreshold(double)
void
SetResignThreshold( const double threshold )
{
  if (threshold <= 0.0) {
    PrintResignThresholdIsTooSmall(threshold);
    resign_threshold = 0.0;
  } else if (threshold > 1.0) {
    PrintResignThresholdIsTooLarge(threshold);
  } else {
    resign_threshold = threshold;
  }
}

// Assembly:
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jae 0x35671
ucomisd 0xe9a6(%rip), %xmm0     # 0x44008
ja 0x10738
movsd %xmm0, 0x2c210(%rip)    # 0x61880
retq
pushq %rax
callq 0x1080a
andq $0x0, 0x2c201(%rip)     # 0x61880
addq $0x8, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/mcts/SearchManager.cpp
// Function: InitializeTimeSetting()
void
InitializeTimeSetting( void )
{
  for (int i = 0; i < S_MAX; i++) {
    remaining_time[i] = default_remaining_time;
  }

  switch (search_setting) {
    case SearchTimeStrategy::ConstantPlayoutMode:
      time_limit = 10000.0;
      po_info.num = playout;
      extend_time = false;
      break;
    case SearchTimeStrategy::ConstantTimeMode:
      time_limit = const_thinking_time;
      po_info.num = 10000000;
      extend_time = false;
      break;
    case SearchTimeStrategy::TimeControlMode:
    case SearchTimeStrategy::TimeControlWithByoYomiMode:
      time_limit = CalculateNextTimeLimit(S_EMPTY, -1);
      po_info.num = static_cast<int>(PLAYOUT_SPEED * time_limit);
      extend_time = true;
      break;
  }
}

// Assembly:
movsd 0x2bffa(%rip), %xmm0    # 0x61898
xorl %eax, %eax
leaq 0x1aac17e9(%rip), %rcx  # 0x1aaf7090
cmpq $0x20, %rax
je 0x358b8
movsd %xmm0, (%rax,%rcx)
addq $0x8, %rax
jmp 0x358a7
movl 0x2bfca(%rip), %eax     # 0x61888
leal -0x2(%rax), %ecx
cmpl $0x2, %ecx
jb 0x358e6
testl %eax, %eax
je 0x35921
cmpl $0x1, %eax
jne 0x35948
movsd 0x2bfc9(%rip), %xmm0    # 0x618a0
movsd %xmm0, 0x1aac1799(%rip) # 0x1aaf7078
movl $0x989680, %eax         # imm = 0x989680
jmp 0x3593a
movsd 0x1aac17a2(%rip), %xmm0 # 0x1aaf7090
movl 0x2bfb8(%rip), %eax     # 0x618ac
xorl %ecx, %ecx
testl %eax, %eax
cmovgl %eax, %ecx
addl 0x2bfa7(%rip), %ecx     # 0x618a8
cvtsi2sd %ecx, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x1aac1767(%rip) # 0x1aaf7078
mulsd 0x116d7(%rip), %xmm0    # 0x46ff0
cvttsd2si %xmm0, %eax
movb $0x1, %cl
jmp 0x3593c
movabsq $0x40c3880000000000, %rax # imm = 0x40C3880000000000
movq %rax, 0x1aac1746(%rip)  # 0x1aaf7078
cvttsd2si 0x2bf56(%rip), %eax # 0x61890
xorl %ecx, %ecx
movl %eax, 0x1aac1742(%rip)  # 0x1aaf7084
movb %cl, 0x1aac1738(%rip)   # 0x1aaf7080
retq
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/mcts/SearchManager.cpp
// Function: SetTimeSettings(int, int, int)
void
SetTimeSettings( const int main_time, const int byoyomi, const int stones )
{
  if (search_setting == SearchTimeStrategy::ConstantPlayoutMode ||
      search_setting == SearchTimeStrategy::ConstantTimeMode ) {
    return ;
  }

  if (main_time == 0) {
    const_thinking_time = static_cast<double>(byoyomi) * 0.85;
    search_setting = SearchTimeStrategy::ConstantTimeMode;
    std::cerr << "Const Thinking Time Mode" << std::endl;
  } else {
    if (byoyomi == 0) {
      default_remaining_time = main_time;
      search_setting = SearchTimeStrategy::TimeControlMode;
      std::cerr << "Time Setting Mode" << std::endl;
    } else {
      default_remaining_time = main_time;
      const_thinking_time = static_cast<double>(byoyomi) / stones;
      search_setting = SearchTimeStrategy::TimeControlWithByoYomiMode;
      std::cerr << "Time Setting Mode (byoyomi)" << std::endl;
    }
  }
}

// Assembly:
cmpl $0x2, 0x2bf0b(%rip)     # 0x61888
jae 0x35980
retq
testl %edi, %edi
je 0x359ab
cvtsi2sd %edi, %xmm0
movsd %xmm0, 0x2bf08(%rip)    # 0x61898
testl %esi, %esi
je 0x359cb
cvtsi2sd %esi, %xmm0
cvtsi2sd %edx, %xmm1
divsd %xmm1, %xmm0
leaq 0x1180c(%rip), %rsi     # 0x471b3
pushq $0x3
jmp 0x359c0
cvtsi2sd %esi, %xmm0
mulsd 0x117b1(%rip), %xmm0    # 0x47168
leaq 0x117ca(%rip), %rsi     # 0x47188
pushq $0x1
popq %rax
movsd %xmm0, 0x2bed7(%rip)    # 0x618a0
jmp 0x359d5
leaq 0x117cf(%rip), %rsi     # 0x471a1
pushq $0x2
popq %rax
pushq %rax
movl %eax, 0x2beac(%rip)     # 0x61888
movq 0x2b60d(%rip), %rdi     # 0x60ff0
callq 0x63c0
movq %rax, %rdi
popq %rax
jmp 0x6190
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/mcts/SearchManager.cpp
// Function: SetTimeManagementParameter()
void
SetTimeManagementParameter( void )
{
  if (!time_c_changed) {
    if (pure_board_size < 11) {
      time_c = TIME_C_9;
    } else if (pure_board_size < 16) {
      time_c = TIME_C_13;
    } else {
      time_c = TIME_C_19;
    }
  }

  if (!time_maxply_changed) {
    if (pure_board_size < 11) {
      time_maxply = TIME_MAXPLY_9;
    } else if (pure_board_size < 16) {
      time_maxply = TIME_MAXPLY_13;
    } else {
      time_maxply = TIME_MAXPLY_19;
    }
  }
}

// Assembly:
cmpb $0x0, 0x1aac1547(%rip)  # 0x1aaf70b0
pushq $0x1e
popq %rax
jne 0x35b8f
leaq 0x2bd3f(%rip), %rcx     # 0x618b4
movl (%rcx), %ecx
cmpl $0x10, %ecx
pushq $0x3c
popq %rdx
cmovbl %eax, %edx
cmpl $0xb, %ecx
pushq $0x14
popq %rcx
cmovgel %edx, %ecx
movl %ecx, 0x2bd19(%rip)     # 0x618a8
cmpb $0x0, 0x1aac151b(%rip)  # 0x1aaf70b1
jne 0x35bb8
leaq 0x2bd15(%rip), %rcx     # 0x618b4
movl (%rcx), %ecx
cmpl $0x10, %ecx
pushq $0x50
popq %rdx
cmovbl %eax, %edx
xorl %eax, %eax
cmpl $0xb, %ecx
cmovgel %edx, %eax
movl %eax, 0x2bcf4(%rip)     # 0x618ac
retq
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/mcts/SearchManager.cpp
// Function: CalculatePlayoutSpeed(double, int)
double
CalculatePlayoutSpeed( const double consume_time, const int threads )
{
  if (consume_time < 0.001) {
    return PLAYOUT_SPEED * threads;
  } else {
    return po_info.count / consume_time;
  }
}

// Assembly:
movsd 0x102ab(%rip), %xmm1    # 0x45e88
ucomisd %xmm0, %xmm1
jbe 0x35bef
imull $0x3e8, %edi, %eax      # imm = 0x3E8
cvtsi2sd %eax, %xmm1
jmp 0x35bfd
movl 0x1aac1497(%rip), %eax  # 0x1aaf708c
cvtsi2sd %eax, %xmm1
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/mcts/SearchManager.cpp
// Function: CheckInterruption(uct_node_t const&)
bool
CheckInterruption( const uct_node_t &root )
{
  int max = 0, second = 0;
  const int child_num = root.child_num;
  const int rest = GetRestPoCount();
  const child_node_t *child = root.child;

  if (!interruption_flag) {
    return false;
  }

  if (!IsConstPlayoutMode() &&
      CalculateElapsedTime() * 10.0 < GetTimeLimit()) {
    return false;
  }

  for (int i = 0; i < child_num; i++) {
    if (child[i].move_count > max) {
      second = max;
      max = child[i].move_count;
    } else if (child[i].move_count > second) {
      second = child[i].move_count;
    }
  }

  if (max - second > rest) {
    return true;
  } else {
    return false;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl 0x18(%rdi), %r14d
movl 0x1aac13fb(%rip), %ebp  # 0x1aaf7088
movl 0x1aac13f8(%rip), %r15d # 0x1aaf708c
cmpb $0x1, 0x2bbf1(%rip)     # 0x6188c
jne 0x35cc4
movq %rdi, %rbx
cmpl $0x0, 0x2bbe1(%rip)     # 0x61888
je 0x35cc8
callq 0x35c11
mulsd 0x1136a(%rip), %xmm0    # 0x47020
movsd 0x1aac13ba(%rip), %xmm1 # 0x1aaf7078
ucomisd %xmm0, %xmm1
jbe 0x35cc8
xorl %eax, %eax
jmp 0x35d0a
subl %r15d, %ebp
xorl %eax, %eax
testl %r14d, %r14d
cmovlel %eax, %r14d
imulq $0x1c, %r14, %rcx
xorl %esi, %esi
xorl %edx, %edx
cmpq %rax, %rcx
je 0x35d03
movl 0x20(%rbx,%rax), %r8d
movl 0x20(%rbx,%rax), %edi
cmpl %edx, %r8d
jle 0x35cf5
movl %edx, %esi
movl %edi, %edx
jmp 0x35cfd
cmpl %esi, %edi
jle 0x35cfd
movl 0x20(%rbx,%rax), %esi
addq $0x1c, %rax
jmp 0x35cdc
subl %esi, %edx
cmpl %ebp, %edx
setg %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/mcts/SearchManager.cpp
// Function: ExtendTime(uct_node_t const&, int)
bool
ExtendTime( const uct_node_t &root, const int moves )
{
  const int child_num = root.child_num;
  const child_node_t *child = root.child;
  int max = 0, second = 0;

  if (!IsTimeExtensionMode() ||
      moves < pure_board_size * 3 - 17) {
    return false;
  }
  
  const double root_wp = static_cast<double>(root.win) / root.move_count;

  if (root_wp > 0.80) {
    return false;
  }

  for (int i = 0; i < child_num; i++) {
    if (child[i].move_count > max) {
      second = max;
      max = child[i].move_count;
    } else if (child[i].move_count > second) {
      second = child[i].move_count;
    }
  }
  if (max < second * 1.2) {
    return true;
  } else {
    return false;
  }
}

// Assembly:
cmpb $0x1, 0x1aac1364(%rip)  # 0x1aaf7080
jne 0x35d31
leaq 0x2bb8f(%rip), %rax     # 0x618b4
movl (%rax), %eax
leal (%rax,%rax,2), %eax
addl $-0x11, %eax
cmpl %esi, %eax
jle 0x35d34
xorl %eax, %eax
retq
movl 0x18(%rdi), %ecx
movl 0xc(%rdi), %eax
cvtsi2sd %eax, %xmm0
movl 0x8(%rdi), %eax
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
xorl %eax, %eax
ucomisd 0x11425(%rip), %xmm0    # 0x47178
ja 0x35d33
testl %ecx, %ecx
cmovlel %eax, %ecx
imulq $0x1c, %rcx, %rcx
xorl %edx, %edx
xorl %esi, %esi
cmpq %rdx, %rcx
je 0x35d94
movl 0x20(%rdi,%rdx), %r9d
movl 0x20(%rdi,%rdx), %r8d
cmpl %eax, %r9d
jg 0x35d89
cmpl %esi, %r8d
jle 0x35d84
movl %eax, %r8d
movl 0x20(%rdi,%rdx), %eax
jmp 0x35d89
movl %eax, %r8d
movl %esi, %eax
movl %eax, %esi
addq $0x1c, %rdx
movl %r8d, %eax
jmp 0x35d62
cvtsi2sd %eax, %xmm0
cvtsi2sd %esi, %xmm1
mulsd 0x113dc(%rip), %xmm1    # 0x47180
ucomisd %xmm0, %xmm1
seta %al
retq
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/pattern/Pattern.cpp
// Function: UpdatePat3Empty(pattern_t*, int)
void
UpdatePat3Empty( pattern_t *pat, const int pos )
{
  pat[pos + NW].list[MD_2] &= 0xFF3FFF;
  pat[pos +  N].list[MD_2] &= 0xFFCFFF;
  pat[pos + NE].list[MD_2] &= 0xFFF3FF;
  pat[pos +  W].list[MD_2] &= 0xFFFCFF;
  pat[pos +  E].list[MD_2] &= 0xFFFF3F;
  pat[pos + SW].list[MD_2] &= 0xFFFFCF;
  pat[pos +  S].list[MD_2] &= 0xFFFFF3;
  pat[pos + SE].list[MD_2] &= 0xFFFFFC;
}

// Assembly:
leaq 0x2b4a3(%rip), %rax     # 0x618bc
movl (%rax), %ecx
notl %ecx
addl %esi, %ecx
movslq %ecx, %rcx
imulq $0x18, %rcx, %rcx
andl $0xff3fff, (%rdi,%rcx)  # imm = 0xFF3FFF
movslq (%rax), %rcx
movslq %esi, %rdx
movq %rdx, %rsi
subq %rcx, %rsi
imulq $0x18, %rsi, %rcx
andl $0xffcfff, (%rdi,%rcx)  # imm = 0xFFCFFF
leal 0x1(%rdx), %ecx
movl %ecx, %esi
subl (%rax), %esi
movslq %esi, %rsi
imulq $0x18, %rsi, %rsi
andl $0xfff3ff, (%rdi,%rsi)  # imm = 0xFFF3FF
imulq $0x18, %rdx, %rsi
andl $0xfffcff, -0x18(%rdi,%rsi) # imm = 0xFFFCFF
andl $0xffff3f, 0x18(%rdi,%rsi) # imm = 0xFFFF3F
movl (%rax), %esi
addl %edx, %esi
decl %esi
movslq %esi, %rsi
imulq $0x18, %rsi, %rsi
andl $0xffffcf, (%rdi,%rsi)  # imm = 0xFFFFCF
movslq (%rax), %rsi
addq %rdx, %rsi
imulq $0x18, %rsi, %rdx
andl $0xfffff3, (%rdi,%rdx)  # imm = 0xFFFFF3
addl (%rax), %ecx
movslq %ecx, %rax
imulq $0x18, %rax, %rax
andl $0xfffffc, (%rdi,%rax)  # imm = 0xFFFFFC
retq
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/pattern/Pattern.cpp
// Function: UpdatePat3Stone(pattern_t*, int, int)
void
UpdatePat3Stone( pattern_t *pat, const int color, const int pos )
{
  pat[pos + NW].list[MD_2] |= update_mask[0][color];
  pat[pos +  N].list[MD_2] |= update_mask[1][color];
  pat[pos + NE].list[MD_2] |= update_mask[2][color];
  pat[pos +  W].list[MD_2] |= update_mask[3][color];
  pat[pos +  E].list[MD_2] |= update_mask[4][color];
  pat[pos + SW].list[MD_2] |= update_mask[5][color];
  pat[pos +  S].list[MD_2] |= update_mask[6][color];
  pat[pos + SE].list[MD_2] |= update_mask[7][color];
}

// Assembly:
movslq %esi, %rax
leaq 0x10d53(%rip), %rsi     # 0x47200
leaq 0x2b408(%rip), %rcx     # 0x618bc
movl (%rcx), %r8d
notl %r8d
addl %edx, %r8d
movslq %r8d, %r8
imulq $0x18, %r8, %r8
movl (%rsi,%rax,4), %r9d
movl 0xc(%rsi,%rax,4), %r10d
orl %r9d, (%rdi,%r8)
movslq (%rcx), %r8
movslq %edx, %rdx
movq %rdx, %r9
subq %r8, %r9
imulq $0x18, %r9, %r8
orl %r10d, (%rdi,%r8)
movl 0x18(%rsi,%rax,4), %r8d
leal 0x1(%rdx), %r9d
movl %r9d, %r10d
subl (%rcx), %r10d
movslq %r10d, %r10
imulq $0x18, %r10, %r10
orl %r8d, (%rdi,%r10)
movl 0x24(%rsi,%rax,4), %r8d
imulq $0x18, %rdx, %r10
orl %r8d, -0x18(%rdi,%r10)
movl 0x30(%rsi,%rax,4), %r8d
orl %r8d, 0x18(%rdi,%r10)
movl 0x3c(%rsi,%rax,4), %r8d
movl (%rcx), %r10d
addl %edx, %r10d
decl %r10d
movslq %r10d, %r10
imulq $0x18, %r10, %r10
orl %r8d, (%rdi,%r10)
movl 0x48(%rsi,%rax,4), %r8d
movslq (%rcx), %r10
addq %rdx, %r10
imulq $0x18, %r10, %rdx
orl %r8d, (%rdi,%rdx)
movl 0x54(%rsi,%rax,4), %eax
addl (%rcx), %r9d
movslq %r9d, %rcx
imulq $0x18, %rcx, %rcx
orl %eax, (%rdi,%rcx)
retq
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/pattern/Pattern.cpp
// Function: UpdateMD2Empty(pattern_t*, int)
void
UpdateMD2Empty( pattern_t *pat, const int pos )
{
  pat[pos + NW].list[MD_2] &= 0xFF3FFF;
  pat[pos +  N].list[MD_2] &= 0xFFCFFF;
  pat[pos + NE].list[MD_2] &= 0xFFF3FF;
  pat[pos +  W].list[MD_2] &= 0xFFFCFF;
  pat[pos +  E].list[MD_2] &= 0xFFFF3F;
  pat[pos + SW].list[MD_2] &= 0xFFFFCF;
  pat[pos +  S].list[MD_2] &= 0xFFFFF3;
  pat[pos + SE].list[MD_2] &= 0xFFFFFC;
  pat[pos + NN].list[MD_2] &= 0xCFFFFF;
  pat[pos + EE].list[MD_2] &= 0x3FFFFF;
  pat[pos + SS].list[MD_2] &= 0xFCFFFF;
  pat[pos + WW].list[MD_2] &= 0xF3FFFF;
}

// Assembly:
leaq 0x2b360(%rip), %rax     # 0x618bc
movl (%rax), %ecx
notl %ecx
addl %esi, %ecx
movslq %ecx, %rcx
imulq $0x18, %rcx, %rcx
andl $0xff3fff, (%rdi,%rcx)  # imm = 0xFF3FFF
movslq (%rax), %rdx
movslq %esi, %rcx
movq %rcx, %rsi
subq %rdx, %rsi
imulq $0x18, %rsi, %rdx
andl $0xffcfff, (%rdi,%rdx)  # imm = 0xFFCFFF
leal 0x1(%rcx), %esi
movl %esi, %edx
subl (%rax), %edx
movslq %edx, %rdx
imulq $0x18, %rdx, %rdx
andl $0xfff3ff, (%rdi,%rdx)  # imm = 0xFFF3FF
imulq $0x18, %rcx, %rdx
andl $0xfffcff, -0x18(%rdi,%rdx) # imm = 0xFFFCFF
andl $0xffff3f, 0x18(%rdi,%rdx) # imm = 0xFFFF3F
movl (%rax), %r8d
addl %ecx, %r8d
decl %r8d
movslq %r8d, %r8
imulq $0x18, %r8, %r8
andl $0xffffcf, (%rdi,%r8)   # imm = 0xFFFFCF
movslq (%rax), %r8
addq %rcx, %r8
imulq $0x18, %r8, %r8
andl $0xfffff3, (%rdi,%r8)   # imm = 0xFFFFF3
addl (%rax), %esi
movslq %esi, %rsi
imulq $0x18, %rsi, %rsi
andl $0xfffffc, (%rdi,%rsi)  # imm = 0xFFFFFC
movl (%rax), %esi
addl %esi, %esi
movl %ecx, %r8d
subl %esi, %r8d
movslq %r8d, %rsi
imulq $0x18, %rsi, %rsi
andl $0xcfffff, (%rdi,%rsi)  # imm = 0xCFFFFF
andl $0x3fffff, 0x30(%rdi,%rdx) # imm = 0x3FFFFF
movslq (%rax), %rax
leaq (%rcx,%rax,2), %rax
imulq $0x18, %rax, %rax
andl $0xfcffff, (%rdi,%rax)  # imm = 0xFCFFFF
andl $0xf3ffff, -0x30(%rdi,%rdx) # imm = 0xF3FFFF
retq
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/pattern/Pattern.cpp
// Function: UpdateMD2Stone(pattern_t*, int, int)
void
UpdateMD2Stone( pattern_t *pat, const int color, const int pos )
{
  pat[pos + NW].list[MD_2] |= update_mask[0][color];
  pat[pos +  N].list[MD_2] |= update_mask[1][color];
  pat[pos + NE].list[MD_2] |= update_mask[2][color];
  pat[pos +  W].list[MD_2] |= update_mask[3][color];
  pat[pos +  E].list[MD_2] |= update_mask[4][color];
  pat[pos + SW].list[MD_2] |= update_mask[5][color];
  pat[pos +  S].list[MD_2] |= update_mask[6][color];
  pat[pos + SE].list[MD_2] |= update_mask[7][color];
  pat[pos + NN].list[MD_2] |= update_mask[8][color];
  pat[pos + EE].list[MD_2] |= update_mask[9][color];
  pat[pos + SS].list[MD_2] |= update_mask[10][color];
  pat[pos + WW].list[MD_2] |= update_mask[11][color];
}

// Assembly:
movslq %esi, %rax
leaq 0x10bd1(%rip), %rcx     # 0x47200
leaq 0x2b286(%rip), %rsi     # 0x618bc
movl (%rsi), %r8d
notl %r8d
addl %edx, %r8d
movslq %r8d, %r8
imulq $0x18, %r8, %r8
movl (%rcx,%rax,4), %r9d
movl 0xc(%rcx,%rax,4), %r10d
orl %r9d, (%rdi,%r8)
movslq (%rsi), %r8
movslq %edx, %rdx
movq %rdx, %r9
subq %r8, %r9
imulq $0x18, %r9, %r8
orl %r10d, (%rdi,%r8)
movl 0x18(%rcx,%rax,4), %r8d
leal 0x1(%rdx), %r9d
movl %r9d, %r10d
subl (%rsi), %r10d
movslq %r10d, %r10
imulq $0x18, %r10, %r10
orl %r8d, (%rdi,%r10)
movl 0x24(%rcx,%rax,4), %r10d
imulq $0x18, %rdx, %r8
orl %r10d, -0x18(%rdi,%r8)
movl 0x30(%rcx,%rax,4), %r10d
orl %r10d, 0x18(%rdi,%r8)
movl 0x3c(%rcx,%rax,4), %r10d
movl (%rsi), %r11d
addl %edx, %r11d
decl %r11d
movslq %r11d, %r11
imulq $0x18, %r11, %r11
orl %r10d, (%rdi,%r11)
movl 0x48(%rcx,%rax,4), %r10d
movslq (%rsi), %r11
addq %rdx, %r11
imulq $0x18, %r11, %r11
orl %r10d, (%rdi,%r11)
movl 0x54(%rcx,%rax,4), %r10d
addl (%rsi), %r9d
movslq %r9d, %r9
imulq $0x18, %r9, %r9
orl %r10d, (%rdi,%r9)
movl 0x60(%rcx,%rax,4), %r9d
movl (%rsi), %r10d
addl %r10d, %r10d
movl %edx, %r11d
subl %r10d, %r11d
movslq %r11d, %r10
imulq $0x18, %r10, %r10
orl %r9d, (%rdi,%r10)
movl 0x6c(%rcx,%rax,4), %r9d
orl %r9d, 0x30(%rdi,%r8)
movl 0x78(%rcx,%rax,4), %r9d
movslq (%rsi), %rsi
leaq (%rdx,%rsi,2), %rdx
imulq $0x18, %rdx, %rdx
orl %r9d, (%rdi,%rdx)
movl 0x84(%rcx,%rax,4), %eax
orl %eax, -0x30(%rdi,%r8)
retq
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/pattern/Pattern.cpp
// Function: Pat3Transpose8(unsigned int, unsigned int*)
void
Pat3Transpose8( const unsigned int pat3, unsigned int *transp )
{
  transp[0] = pat3;
  transp[1] = Pat3VerticalMirror(pat3);
  transp[2] = Pat3HorizontalMirror(pat3);
  transp[3] = Pat3VerticalMirror(transp[2]);
  transp[4] = Pat3Rotate90(pat3);
  transp[5] = Pat3Rotate90(transp[1]);
  transp[6] = Pat3Rotate90(transp[2]);
  transp[7] = Pat3Rotate90(transp[3]);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
movl %edi, (%rsi)
movl %edi, %eax
shrl $0xa, %eax
andl $0x3f, %eax
movl $0x3c0, %r13d           # imm = 0x3C0
movl %edi, %ecx
andl %r13d, %ecx
orl %eax, %ecx
movl %edi, %r14d
shll $0xa, %r14d
movl $0xffff, %eax           # imm = 0xFFFF
andl %eax, %r14d
orl %ecx, %r14d
movl %r14d, 0x4(%rsi)
callq 0x372ad
movl %eax, %r15d
movl %eax, 0x8(%rbx)
shrl $0xa, %eax
andl %r15d, %r13d
orl %eax, %r13d
movl %r15d, %r12d
shll $0xa, %r12d
movl $0xffff, %eax           # imm = 0xFFFF
andl %eax, %r12d
orl %r13d, %r12d
movl %r12d, 0xc(%rbx)
movl %ebp, %edi
callq 0x372fa
movl %eax, 0x10(%rbx)
movl %r14d, %edi
callq 0x372fa
movl %eax, 0x14(%rbx)
movl %r15d, %edi
callq 0x372fa
movl %eax, 0x18(%rbx)
movl %r12d, %edi
callq 0x372fa
movl %eax, 0x1c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq