LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/./include/mcts/AnalysisData.hpp
// Function: PrincipalVariationData::GetJsonData[abi:cxx11]() const
std::string
  GetJsonData( void ) const
  {
    std::ostringstream oss;

    oss << "{ ";
    oss << "\"move\": \"" << ParsePoint(move) << "\",";
    oss << "\"winrate\": " << std::fixed << std::setprecision(4) << playout_win_rate << ",";
    oss << "\"prior\": " << std::fixed << std::setprecision(6) << prior << ",";
    oss << "\"pv\" : \"" << JoinStrings(pv, " ") << "\",";
    oss << "\"visits\" : " << visits;
    oss << "}";

    return oss.str();
  }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0x6530
leaq 0x30aba(%rip), %rsi     # 0x44a92
movq %r15, %rdi
callq 0x63c0
leaq 0x30af8(%rip), %rsi     # 0x44adf
leaq 0x28(%rsp), %rdi
callq 0x63c0
movq %rax, %r15
movl (%r14), %esi
leaq 0x8(%rsp), %rdi
callq 0x3cd06
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x6350
leaq 0x30ab7(%rip), %rsi     # 0x44acc
movq %rax, %rdi
callq 0x63c0
leaq 0x8(%rsp), %rdi
callq 0x6838
leaq 0x30a67(%rip), %rsi     # 0x44a95
leaq 0x28(%rsp), %rdi
callq 0x63c0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movl $0xfffffefb, %esi       # imm = 0xFFFFFEFB
andl 0x18(%rax,%rdx), %esi
orl $0x4, %esi
movl %esi, 0x18(%rax,%rdx)
movq -0x18(%rcx), %rcx
movq $0x4, 0x8(%rax,%rcx)
movsd 0x8(%r14), %xmm0
movq %rax, %rdi
callq 0x6670
leaq 0x30a5c(%rip), %rsi     # 0x44acd
movq %rax, %rdi
callq 0x63c0
leaq 0x30a69(%rip), %rsi     # 0x44ae9
leaq 0x28(%rsp), %rdi
callq 0x63c0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movl $0xfffffefb, %esi       # imm = 0xFFFFFEFB
andl 0x18(%rax,%rdx), %esi
orl $0x4, %esi
movl %esi, 0x18(%rax,%rdx)
movq -0x18(%rcx), %rcx
movq $0x6, 0x8(%rax,%rcx)
movsd 0x10(%r14), %xmm0
movq %rax, %rdi
callq 0x6670
leaq 0x30a0a(%rip), %rsi     # 0x44acd
movq %rax, %rdi
callq 0x63c0
leaq 0x30a21(%rip), %rsi     # 0x44af3
leaq 0x28(%rsp), %rdi
callq 0x63c0
movq %rax, %r15
leaq 0x20(%r14), %rsi
leaq 0x30ae8(%rip), %rdx     # 0x44bd2
leaq 0x8(%rsp), %rdi
callq 0x1460f
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x6350
leaq 0x309c4(%rip), %rsi     # 0x44acc
movq %rax, %rdi
callq 0x63c0
leaq 0x8(%rsp), %rdi
callq 0x6838
leaq 0x309db(%rip), %rsi     # 0x44afc
leaq 0x28(%rsp), %rdi
callq 0x63c0
movl 0x18(%r14), %esi
movq %rax, %rdi
callq 0x6700
leaq 0x3099f(%rip), %rsi     # 0x44add
leaq 0x28(%rsp), %rdi
callq 0x63c0
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0x6640
leaq 0x28(%rsp), %rdi
callq 0x60a0
movq %rbx, %rax
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbx
popq %r14
popq %r15
retq
jmp 0x14184
jmp 0x14184
jmp 0x14175
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x6838
jmp 0x14187
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x60a0
movq %rbx, %rdi
callq 0x6740
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/util/Utility.cpp
// Function: InputTxtFLT(char const*, float*, int)
void
InputTxtFLT( const char *filename, float *ap, 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, "%f", &ap[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;
  }
  for (int i = 0; i < array_size; i++) {
    if (fscanf(fp, "%f", &ap[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 0x31018(%rip), %rsi     # 0x454a3
callq 0x64a0
movq %rax, %r12
testq %rax, %rax
jne 0x144cd
movq 0x4cb51(%rip), %rdi     # 0x60ff0
leaq 0x30bd2(%rip), %rsi     # 0x45078
callq 0x63c0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x63c0
leaq 0x2fc3e(%rip), %rsi     # 0x440fb
movq %rax, %rdi
callq 0x63c0
movq %rax, %rdi
callq 0x6190
xorl %eax, %eax
testl %r14d, %r14d
cmovlel %eax, %r14d
incq %r14
leaq 0x30ba7(%rip), %r13     # 0x45087
decq %r14
je 0x1452f
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 0x144e0
movq 0x4cae8(%rip), %rdi     # 0x60ff0
leaq 0x30b7b(%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
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/util/Utility.cpp
// Function: InputTxtDBL(char const*, double*, int)
void
InputTxtDBL( const char *filename, double *ap, 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;
  }
  for (int i = 0; i < array_size; i++) {
    if (fscanf_s(fp, "%lf", &ap[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;
  }
  for (int i = 0; i < array_size; i++) {
    if (fscanf(fp, "%lf", &ap[i]) == EOF) {
      std::cerr << "Read Error : " << filename << std::endl;
    }
  }
#endif
  fclose(fp);
}

// 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 0x30f44(%rip), %rsi     # 0x454a3
callq 0x64a0
movq %rax, %r12
testq %rax, %rax
jne 0x145a1
movq 0x4ca7d(%rip), %rdi     # 0x60ff0
leaq 0x30afe(%rip), %rsi     # 0x45078
callq 0x63c0
movq %rax, %rdi
movq %r15, %rsi
callq 0x63c0
leaq 0x2fb6a(%rip), %rsi     # 0x440fb
movq %rax, %rdi
callq 0x63c0
movq %rax, %rdi
callq 0x6190
xorl %eax, %eax
testl %ebx, %ebx
cmovlel %eax, %ebx
leaq 0x3057a(%rip), %r13     # 0x44b29
leaq 0x30ad4(%rip), %rbp     # 0x4508a
subq $0x1, %rbx
jb 0x145f9
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x6780
cmpl $-0x1, %eax
jne 0x145f3
movq 0x4ca18(%rip), %rdi     # 0x60ff0
movq %rbp, %rsi
callq 0x63c0
movq %rax, %rdi
movq %r15, %rsi
callq 0x63c0
movq %rax, %rdi
callq 0x6190
addq $0x8, %r14
jmp 0x145b6
movq %r12, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x63d0
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/util/Utility.cpp
// Function: JoinStrings(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&, char const*)
std::string
JoinStrings( const std::vector<std::string> &str_vec, const char *delimiter = 0 )
{
  std::string result;

  if (!str_vec.empty()) {
    result += str_vec[0];
    for (decltype(str_vec.size()) i = 1, c = str_vec.size(); i < c; i++) {
      if (delimiter) result += delimiter;
      result += str_vec[i];
    }
  }
  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
movq (%rsi), %rsi
cmpq 0x8(%r15), %rsi
je 0x14682
movq %rdx, %r14
movq %rbx, %rdi
callq 0x6810
movq 0x8(%r15), %r12
subq (%r15), %r12
sarq $0x5, %r12
pushq $0x1
popq %r13
pushq $0x20
popq %rbp
cmpq %r12, %r13
jae 0x14682
testq %r14, %r14
je 0x1466b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x67e0
movq (%r15), %rsi
addq %rbp, %rsi
movq %rbx, %rdi
callq 0x6810
incq %r13
addq $0x20, %rbp
jmp 0x14656
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x14696
movq %rax, %r14
movq %rbx, %rdi
callq 0x6838
movq %r14, %rdi
callq 0x6740
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/util/Utility.cpp
// Function: SplitString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::vector<std::string>
SplitString( const std::string &str, const std::string pattern )
{
  std::vector<std::string> result;
  std::regex reg{pattern};

  std::copy(std::sregex_token_iterator{str.begin(), str.end(), reg, -1},
            std::sregex_token_iterator{},
            std::back_inserter(result));

  return result;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
leaq 0x8(%rsp), %rdi
pushq $0x10
popq %rax
movq %rdx, %rsi
movl %eax, %edx
callq 0x147a2
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rcx
pushq $-0x1
popq %r8
xorl %r9d, %r9d
callq 0x148f6
xorps %xmm0, %xmm0
leaq 0xb0(%rsp), %rsi
movups %xmm0, 0x59(%rsi)
movaps %xmm0, 0x50(%rsi)
movaps %xmm0, 0x40(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
movaps %xmm0, 0x70(%rsi)
movb $0x0, 0x80(%rsi)
leaq 0x28(%rsp), %rdi
movq %rbx, %rdx
callq 0x14803
leaq 0xb0(%rsp), %rdi
callq 0x14984
leaq 0x28(%rsp), %rdi
callq 0x14984
leaq 0x8(%rsp), %rdi
callq 0x1499e
movq %rbx, %rax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r14
retq
movq %rax, %r14
leaq 0xb0(%rsp), %rdi
callq 0x14984
leaq 0x28(%rsp), %rdi
callq 0x14984
jmp 0x14782
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x1499e
jmp 0x14791
movq %rax, %r14
movq %rbx, %rdi
callq 0x134e4
movq %r14, %rdi
callq 0x6740
nop
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/learn/FactorizationMachines.cpp
// Function: InitializeWeights(std::vector<btfm_t, std::allocator<btfm_t>>&, int, std::mersenne_twister_engine<unsigned long, 64ul, 312ul, 156ul, 31ul, 13043109905998158313ul, 29ul, 6148914691236517205ul, 17ul, 8202884508482404352ul, 37ul, 18444473444759240704ul, 43ul, 6364136223846793005ul>&, std::normal_distribution<double>&, int&)
static void
InitializeWeights( std::vector<btfm_t> &data, const int size, std::mt19937_64 &mt, std::normal_distribution<> &dist, int &data_id )
{
  data.resize(size);

  for (btfm_t &datum : data) {
    datum.w = 1.0;
    for (int k = 0; k < FM_DIMENSION; k++) {
      datum.v[k] = exp(dist(mt));
    }
    datum.id = data_id++;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rdi, %r12
movslq %esi, %rsi
callq 0x2620a
movq (%r12), %r13
movq 0x8(%r12), %r12
cmpq %r12, %r13
je 0x236c0
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, (%r13)
pushq $0x1
popq %rbp
cmpq $0x6, %rbp
je 0x236a9
movq %r14, %rdi
movq %r15, %rsi
callq 0x26248
callq 0x6750
movsd %xmm0, (%r13,%rbp,8)
incq %rbp
jmp 0x23687
movl (%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, (%rbx)
movl %eax, 0x210(%r13)
addq $0x218, %r13            # imm = 0x218
jmp 0x23671
addq $0x8, %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/learn/FactorizationMachines.cpp
// Function: CalculateFirstTerm(std::vector<btfm_t*, std::allocator<btfm_t*>> const&, int)
static double
CalculateFirstTerm( const std::vector<btfm_t*> &t, const int n )
{
  double gamma = 1.0;

  for (int i = 0; i < n; i++) {
    gamma *= t[i]->w;
  }

  return gamma;
}

// Assembly:
movq (%rdi), %rax
xorl %ecx, %ecx
testl %esi, %esi
cmovlel %ecx, %esi
movsd 0x1ef9e(%rip), %xmm0    # 0x44008
cmpq %rcx, %rsi
je 0x2507c
movq (%rax,%rcx,8), %rdx
mulsd (%rdx), %xmm0
incq %rcx
jmp 0x2506a
retq
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/learn/FactorizationMachines.cpp
// Function: CalculateSecondTerm(std::vector<btfm_t*, std::allocator<btfm_t*>> const&, int, int)
static double
CalculateSecondTerm( const std::vector<btfm_t*> &t, const int i, const int j )
{
  double theta = 0.0;

  for (int k = 0; k < FM_DIMENSION; k++) {
    theta += t[i]->v[k] * t[j]->v[k];
  }
  return theta * (1.0 / static_cast<double>(FM_DIMENSION));
}

// Assembly:
movslq %esi, %rax
movq (%rdi), %rcx
movq (%rcx,%rax,8), %rax
movslq %edx, %rdx
movq (%rcx,%rdx,8), %rcx
xorpd %xmm0, %xmm0
pushq $0x1
popq %rdx
cmpq $0x6, %rdx
je 0x250ae
movsd (%rax,%rdx,8), %xmm1
mulsd (%rcx,%rdx,8), %xmm1
addsd %xmm1, %xmm0
incq %rdx
jmp 0x25095
mulsd 0x20e3a(%rip), %xmm0    # 0x45ef0
retq
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/learn/FactorizationMachines.cpp
// Function: CorrectMoveDistanceFeature(std::vector<btfm_t*, std::allocator<btfm_t*>>*, std::map<int, btfm_t*, std::less<int>, std::allocator<std::pair<int const, btfm_t*>>>&, std::vector<btfm_t, std::allocator<btfm_t>>&, int, int, int)
static void
CorrectMoveDistanceFeature( std::vector<btfm_t*> feature_list[],
                            std::map<int, btfm_t*> &feature_map,
                            std::vector<btfm_t> &move_distance_feature,
                            const int pos,
                            const int previous_move,
                            const int shift )
{
  if (previous_move != PASS) {
    int distance = DIS(previous_move, pos);
    if (distance > MOVE_DISTANCE_MAX - 1) {
      distance = MOVE_DISTANCE_MAX - 1;
    }
    distance += shift;
    feature_list[pos].push_back(&move_distance_feature[distance]);
    const int id = move_distance_feature[distance].id;
    if (!feature_map.count(id)) {
      feature_map[id] = &move_distance_feature[distance];
    }
  }
}

// Assembly:
testl %r8d, %r8d
je 0x25211
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movslq %r8d, %rax
leaq 0x1aad3b0c(%rip), %rdx  # 0x1aaf8c80
movl (%rdx,%rax,4), %esi
movslq %ecx, %rcx
subl (%rdx,%rcx,4), %esi
movl %esi, %edx
negl %edx
cmovsl %esi, %edx
leaq 0x1aad4825(%rip), %rsi  # 0x1aaf99b0
movl (%rsi,%rax,4), %eax
subl (%rsi,%rcx,4), %eax
movl %eax, %esi
negl %esi
cmovsl %eax, %esi
imulq $0x4c, %rdx, %rax
addq 0x3bde5(%rip), %rax     # 0x60f88
movl (%rax,%rsi,4), %eax
cmpl $0xf, %eax
pushq $0xf
popq %rdx
cmovll %eax, %edx
addl %r9d, %edx
imulq $0x18, %rcx, %rax
addq %rax, %rdi
movslq %edx, %rax
imulq $0x218, %rax, %r15      # imm = 0x218
movq (%r14), %rax
addq %r15, %rax
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
callq 0x26cea
movq (%r14), %rax
movl 0x210(%rax,%r15), %eax
leaq 0x4(%rsp), %rsi
movl %eax, (%rsi)
movq %rbx, %rdi
callq 0x26cb2
testq %rax, %rax
jne 0x25208
addq (%r14), %r15
leaq 0x4(%rsp), %rsi
movq %rbx, %rdi
callq 0x26c64
movq %r15, (%rax)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/learn/FactorizationMachines.cpp
// Function: OutputFMAdd(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, btfm_t&)
static void
OutputFMAdd( std::string filename, btfm_t &t )
{
  std::ofstream ofs(filename, std::ios::app);

  if (ofs.fail()) {
    std::cerr << "cannot open " << filename << std::endl;
    return;
  }

  ofs << std::scientific << t.w;
  for (int j = 0; j < FM_DIMENSION; j++) {
    ofs << " " << std::scientific << t.v[j];
  }
  ofs << std::endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
movq %rsi, %rbx
movq %rdi, %r14
movq %rsp, %r15
pushq $0x1
popq %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x6800
movq (%r15), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%rsp,%rax)
je 0x25287
movq 0x3bda3(%rip), %rdi     # 0x60ff0
leaq 0x20e67(%rip), %rsi     # 0x460bb
callq 0x63c0
movq %rax, %rdi
movq %r14, %rsi
callq 0x6350
movq %rax, %r14
movq %r14, %rdi
callq 0x6190
movq %rsp, %rdi
callq 0x65e0
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0xfffffefb, %ebp       # imm = 0xFFFFFEFB
movl 0x18(%rsp,%rax), %ecx
andl %ebp, %ecx
orl $0x100, %ecx            # imm = 0x100
movl %ecx, 0x18(%rsp,%rax)
movsd (%rbx), %xmm0
movq %rsp, %r14
movq %r14, %rdi
callq 0x6670
pushq $0x1
popq %r12
leaq 0x1f198(%rip), %r15     # 0x4444e
cmpq $0x6, %r12
je 0x25267
movq %r14, %rdi
movq %r15, %rsi
callq 0x63c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl %ebp, %edx
orl $0x100, %edx            # imm = 0x100
movl %edx, 0x18(%rax,%rcx)
movsd (%rbx,%r12,8), %xmm0
movq %rax, %rdi
callq 0x6670
incq %r12
jmp 0x252b6
jmp 0x252f3
movq %rax, %rbx
movq %rsp, %rdi
callq 0x65e0
movq %rbx, %rdi
callq 0x6740
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/learn/MinorizationMaximization.cpp
// Function: InitializeLearningData(std::vector<std::vector<mm_t, std::allocator<mm_t>>, std::allocator<std::vector<mm_t, std::allocator<mm_t>>>>&, int, int)
static void
InitializeLearningData( std::vector<std::vector<mm_t> > &data, const int threads, const int data_size )
{
  data.resize(threads);

  for (std::vector<mm_t> &vec : data) {
    vec.resize(data_size);
    for (mm_t &datum : vec) {
      datum.gamma = 1.0;
      datum.w = 0;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
pushq $0x8
popq %rsi
callq 0x2bb4e
movq (%r14), %rbx
movq 0x8(%r14), %r15
movslq %ebp, %r14
movabsq $0x3ff0000000000000, %r12 # imm = 0x3FF0000000000000
cmpq %r15, %rbx
je 0x2a823
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2bb84
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
cmpq %rcx, %rax
je 0x2a81d
movq %r12, 0x18(%rax)
andl $0x0, (%rax)
addq $0x20, %rax
jmp 0x2a80b
addq $0x18, %rbx
jmp 0x2a7f4
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/learn/MovePredictionTest.cpp
// Function: EvaluateMovePrediction()
void
EvaluateMovePrediction( void )
{
  std::thread *workers[TEST_WORKER_THREADS];

  for (int i = 0; i < TEST_WORKER_THREADS; i++) {
    workers[i] = new std::thread(PredictionTestWorker, i);
  }

  int sum = 0;

  for (int i = 0; i < TEST_WORKER_THREADS; i++) {
    workers[i]->join();
    delete workers[i];
  }
  

  for (int i = 0; i < pure_board_max + 1; i++) {
    sum += appearance[i];
  }

  for (int i = 0, part = 0; i < 10; i++) {
    part += appearance[i];
    std::cout << i + 1 << " " << static_cast<double>(part) / sum << std::endl;
    std::cerr << i + 1 << " " << appearance[i] << std::endl;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
xorl %eax, %eax
pushq $0x8
popq %rbx
leaq 0x14e(%rip), %r14       # 0x2c7d0
leaq 0x4(%rsp), %r15
movl %eax, 0x4(%rsp)
cmpl $0x8, %eax
jge 0x2c6b7
movq %rbx, %rdi
callq 0x63e0
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2cb18
movslq 0x4(%rsp), %rax
movq %r12, 0x10(%rsp,%rax,8)
incl %eax
jmp 0x2c687
xorl %r15d, %r15d
pushq $0x8
popq %rbx
cmpq $0x8, %r15
je 0x2c6e8
movq 0x10(%rsp,%r15,8), %r14
movq %r14, %rdi
callq 0x66e0
movq %r14, %rdi
callq 0x2695c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x63f0
incq %r15
jmp 0x2c6bd
xorl %eax, %eax
leaq 0x3899f(%rip), %rcx     # 0x65090
leaq 0x351b8(%rip), %rdx     # 0x618b0
xorl %esi, %esi
movslq (%rdx), %rdi
cmpq %rdi, %rax
jg 0x2c70f
movl (%rcx), %edi
addl %edi, %esi
incq %rax
addq $0x4, %rcx
jmp 0x2c6fa
cvtsi2sd %esi, %xmm0
movsd %xmm0, 0x8(%rsp)
xorl %r13d, %r13d
pushq $0x1
popq %rbx
leaq 0x3896a(%rip), %rbp     # 0x65090
leaq 0x17d21(%rip), %r15     # 0x4444e
movq 0x348bc(%rip), %r12     # 0x60ff0
xorl %r14d, %r14d
cmpq $0x28, %r13
je 0x2c7ab
movl (%r13,%rbp), %eax
addl %eax, %r14d
movq 0x34864(%rip), %rdi     # 0x60fb0
movl %ebx, %esi
callq 0x6700
movq %rax, %rdi
movq %r15, %rsi
callq 0x63c0
cvtsi2sd %r14d, %xmm0
divsd 0x8(%rsp), %xmm0
movq %rax, %rdi
callq 0x6670
movq %rax, %rdi
callq 0x6190
movq %r12, %rdi
movl %ebx, %esi
callq 0x6700
movq %rax, %rdi
movq %r15, %rsi
callq 0x63c0
movl (%r13,%rbp), %esi
movq %rax, %rdi
callq 0x6700
movq %rax, %rdi
callq 0x6190
addq $0x4, %r13
incl %ebx
jmp 0x2c737
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
pushq $0x8
popq %rsi
movq %r12, %rdi
callq 0x63f0
movq %rbx, %rdi
callq 0x6740
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/learn/LearningUtility.cpp
// Function: OutputGamma(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<mm_t, std::allocator<mm_t>> const&)
void
OutputGamma( const std::string filename, const std::vector<mm_t> &data )
{
  std::ofstream ofs(filename, std::ios::out);

  if (!ofs) {
    std::cerr << "Cannot open \"" << filename << "\"" << std::endl;
    return;
  }

  for (const mm_t &datum : data) {
    ofs << std::scientific << datum.gamma << "\n";
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
movq %rsi, %r14
movq %rdi, %rbx
movq %rsp, %r15
pushq $0x10
popq %rdx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6800
movq (%r15), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%rsp,%rax)
je 0x2cc31
movq 0x34405(%rip), %rdi     # 0x60ff0
leaq 0x1a0c6(%rip), %rsi     # 0x46cb8
callq 0x63c0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x6350
leaq 0x17ed2(%rip), %rsi     # 0x44adb
movq %rax, %rdi
callq 0x63c0
movq %rax, %rdi
callq 0x6190
movq %rsp, %rdi
callq 0x65e0
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq (%r14), %r15
movq 0x8(%r14), %r12
movl $0xfffffefb, %ebp       # imm = 0xFFFFFEFB
movq %rsp, %rbx
leaq 0x1a98e(%rip), %r14     # 0x475d5
cmpq %r12, %r15
je 0x2cc19
movq (%rsp), %rax
movq -0x18(%rax), %rax
movl 0x18(%rsp,%rax), %ecx
andl %ebp, %ecx
orl $0x100, %ecx            # imm = 0x100
movl %ecx, 0x18(%rsp,%rax)
movsd 0x18(%r15), %xmm0
movq %rbx, %rdi
callq 0x6670
movq %rax, %rdi
movq %r14, %rsi
callq 0x63c0
addq $0x20, %r15
jmp 0x2cc47
jmp 0x2cc85
movq %rax, %rbx
movq %rsp, %rdi
callq 0x65e0
movq %rbx, %rdi
callq 0x6740
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/learn/LearningUtility.cpp
// Function: OutputGamma(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<mm_t, std::allocator<mm_t>> const&, std::vector<unsigned int, std::allocator<unsigned int>> const&)
void
OutputGamma( const std::string filename, const std::vector<mm_t> &data, const std::vector<unsigned int> &index_list )
{
  std::ofstream ofs(filename, std::ios::out);

  if (!ofs) {
    std::cerr << "Cannot open \"" << filename << "\"" << std::endl;
    return;
  }

  const std::size_t data_size = data.size();

  for (std::size_t i = 0; i < data_size; i++) {
    if (data[i].gamma != 1.0) {
      ofs << index_list[i] << "\t" << std::scientific << data[i].gamma << "\n";
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x8(%rsp), %r12
pushq $0x10
popq %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x6800
movq (%r12), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x28(%rsp,%rax)
je 0x2cd25
movq 0x34315(%rip), %rdi     # 0x60ff0
leaq 0x19fd6(%rip), %rsi     # 0x46cb8
callq 0x63c0
movq %rax, %rdi
movq %r15, %rsi
callq 0x6350
leaq 0x17de2(%rip), %rsi     # 0x44adb
movq %rax, %rdi
callq 0x63c0
movq %rax, %rdi
callq 0x6190
leaq 0x8(%rsp), %rdi
callq 0x65e0
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%r14), %rbp
subq (%r14), %rbp
sarq $0x5, %rbp
xorl %r15d, %r15d
leaq 0x1a04c(%rip), %r12     # 0x46d86
leaq 0x1a894(%rip), %r13     # 0x475d5
subq $0x1, %rbp
jb 0x2cd09
movq (%r14), %rax
movsd 0x18(%rax,%r15,8), %xmm0
ucomisd 0x172af(%rip), %xmm0    # 0x44008
jne 0x2cd5d
jnp 0x2cdb2
movq (%rbx), %rax
movl (%rax,%r15), %esi
leaq 0x8(%rsp), %rdi
callq 0x6270
movq %rax, %rdi
movq %r12, %rsi
callq 0x63c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
movl $0xfffffefb, %esi       # imm = 0xFFFFFEFB
andl %esi, %edx
orl $0x100, %edx            # imm = 0x100
movl %edx, 0x18(%rax,%rcx)
movq (%r14), %rcx
movsd 0x18(%rcx,%r15,8), %xmm0
movq %rax, %rdi
callq 0x6670
movq %rax, %rdi
movq %r13, %rsi
callq 0x63c0
addq $0x4, %r15
jmp 0x2cd41
jmp 0x2cdba
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x65e0
movq %rbx, %rdi
callq 0x6740
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/learn/LearningUtility.cpp
// Function: OutputBTFMParameter(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<btfm_t, std::allocator<btfm_t>> const&)
void
OutputBTFMParameter( const std::string filename, const std::vector<btfm_t> &data )
{
  std::ofstream ofs(filename, std::ios::out);

  if (!ofs) {
    std::cerr << "Cannot open \"" << filename << "\"" << std::endl;
    return;
  }

  for (const btfm_t &datum : data) {
    ofs << std::scientific << datum.w;
    for (int k = 0; k < FM_DIMENSION; k++) {
      ofs << " " << std::scientific << datum.v[k];
    }
    ofs << "\n";
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %r15
pushq $0x10
popq %rdx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6800
movq (%r15), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x28(%rsp,%rax)
je 0x2ce58
movq 0x341e2(%rip), %rdi     # 0x60ff0
leaq 0x19ea3(%rip), %rsi     # 0x46cb8
callq 0x63c0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x6350
leaq 0x17caf(%rip), %rsi     # 0x44adb
movq %rax, %rdi
callq 0x63c0
movq %rax, %rdi
callq 0x6190
leaq 0x8(%rsp), %rdi
callq 0x65e0
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r14), %r12
movq 0x8(%r14), %r13
movl $0xfffffefb, %ebp       # imm = 0xFFFFFEFB
leaq 0x8(%rsp), %rbx
leaq 0x175de(%rip), %r15     # 0x4444e
cmpq %r13, %r12
je 0x2ce3c
movq 0x8(%rsp), %rax
movq -0x18(%rax), %rax
movl 0x20(%rsp,%rax), %ecx
andl %ebp, %ecx
orl $0x100, %ecx            # imm = 0x100
movl %ecx, 0x20(%rsp,%rax)
movsd (%r12), %xmm0
movq %rbx, %rdi
callq 0x6670
pushq $0x1
popq %r14
cmpq $0x6, %r14
je 0x2cedb
movq %rbx, %rdi
movq %r15, %rsi
callq 0x63c0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl %ebp, %edx
orl $0x100, %edx            # imm = 0x100
movl %edx, 0x18(%rax,%rcx)
movsd (%r12,%r14,8), %xmm0
movq %rax, %rdi
callq 0x6670
incq %r14
jmp 0x2cea0
movq %rbx, %rdi
leaq 0x1a6f0(%rip), %rsi     # 0x475d5
callq 0x63c0
addq $0x218, %r12            # imm = 0x218
jmp 0x2ce70
jmp 0x2cefa
jmp 0x2cefa
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x65e0
movq %rbx, %rdi
callq 0x6740
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/learn/LearningUtility.cpp
// Function: OutputGammaAdditionMode(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, mm_t const&)
void
OutputGammaAdditionMode( const std::string filename, const mm_t &datum )
{
  std::ofstream ofs(filename, std::ios::app);

  if (!ofs) {
    std::cerr << "Cannot open \"" << filename << "\"" << std::endl;
    return;
  }

  ofs << std::scientific << datum.gamma << "\n";
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
movq %rsi, %r14
movq %rdi, %rbx
movq %rsp, %r15
pushq $0x1
popq %rdx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6800
movq (%r15), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%rsp,%rax)
je 0x2d325
movq 0x33cfb(%rip), %rdi     # 0x60ff0
leaq 0x199bc(%rip), %rsi     # 0x46cb8
callq 0x63c0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x6350
leaq 0x177c8(%rip), %rsi     # 0x44adb
movq %rax, %rdi
callq 0x63c0
movq %rax, %rdi
callq 0x6190
jmp 0x2d355
movl $0xfffffefb, %ecx       # imm = 0xFFFFFEFB
andl 0x18(%rsp,%rax), %ecx
orl $0x100, %ecx            # imm = 0x100
movl %ecx, 0x18(%rsp,%rax)
movsd 0x18(%r14), %xmm0
movq %rsp, %rdi
callq 0x6670
leaq 0x1a288(%rip), %rsi     # 0x475d5
movq %rax, %rdi
callq 0x63c0
movq %rsp, %rdi
callq 0x65e0
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x65e0
movq %rbx, %rdi
callq 0x6740
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/learn/LearningUtility.cpp
// Function: InputMD2Target(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<int, std::allocator<int>>&, std::vector<unsigned int, std::allocator<unsigned int>>&, std::vector<bool, std::allocator<bool>>&)
void
InputMD2Target( const std::string filename, std::vector<int> &md2_index, std::vector<unsigned int> &md2_list, std::vector<bool> &md2_target )
{
  std::ifstream ifs(filename, std::ios::in);
  int target_index = 1;
  unsigned int index, md2_transpose16[16];

  if (ifs.fail()) {
    std::cerr << "Cannot open \"" << filename << "\"" << std::endl;
    return;
  }

  md2_index = std::vector<int>(MD2_MAX, 0);

  // 学習対象でないMD2パターン用のデータ
  md2_list.push_back(0);
  md2_target.push_back(false);

  while (ifs >> index) {
    MD2Transpose16(index, md2_transpose16);
    for (int i = 0; i < 16; i++) {
      md2_index[md2_transpose16[i]] = target_index;
    }
    md2_list.push_back(index);
    md2_target.push_back(true);
    target_index++;
  }
  std::cerr << "MD2 Target : " << md2_target.size() << std::endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x278, %rsp            # imm = 0x278
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x70(%rsp), %r13
pushq $0x8
popq %rdx
movq %r13, %rdi
movq %r12, %rsi
callq 0x6680
movq (%r13), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x90(%rsp,%rax)
je 0x2d3f1
movq 0x33c2a(%rip), %rdi     # 0x60ff0
leaq 0x198eb(%rip), %rsi     # 0x46cb8
callq 0x63c0
movq %rax, %rdi
movq %r12, %rsi
callq 0x6350
leaq 0x176f7(%rip), %rsi     # 0x44adb
movq %rax, %rdi
callq 0x63c0
jmp 0x2d4cf
leaq 0x14(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0x18(%rsp), %rdi
leaq 0xf(%rsp), %rcx
movl $0x1000000, %esi        # imm = 0x1000000
callq 0x1e220
leaq 0x18(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x26828
movq %r12, %rdi
callq 0x149b8
andl $0x0, (%r12)
leaq 0x18(%rsp), %rsi
movq %r14, %rdi
callq 0x2d854
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2d772
pushq $0x1
popq %rbp
leaq 0x70(%rsp), %r12
leaq 0x10(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x6720
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2d4a6
movl 0x10(%rsp), %edi
leaq 0x30(%rsp), %rsi
callq 0x374d5
movq (%r15), %rax
xorl %ecx, %ecx
cmpq $0x10, %rcx
je 0x2d48c
movl 0x30(%rsp,%rcx,4), %edx
movl %ebp, (%rax,%rdx,4)
incq %rcx
jmp 0x2d47a
movq %r14, %rdi
movq %r13, %rsi
callq 0x2d7b0
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0x2d772
incl %ebp
jmp 0x2d44e
movq 0x33b43(%rip), %rdi     # 0x60ff0
leaq 0x198d4(%rip), %rsi     # 0x46d88
callq 0x63c0
movq 0x10(%rbx), %rcx
movl 0x18(%rbx), %edx
subq (%rbx), %rcx
leaq (%rdx,%rcx,8), %rsi
movq %rax, %rdi
callq 0x6270
movq %rax, %rdi
callq 0x6190
leaq 0x70(%rsp), %rdi
callq 0x60b0
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2d4f9
jmp 0x2d4f9
jmp 0x2d4f9
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x60b0
movq %rbx, %rdi
callq 0x6740
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/learn/LearningUtility.cpp
// Function: GetUniquePattern(unsigned int*, int)
int
GetUniquePattern( unsigned int pattern[], const int array_size )
{
  int size = 0;

  for (int i = 0; i < array_size; i++) {
    bool is_unique = true;
    for (int j = 0; j < size; j++) {
      if (pattern[i] == pattern[j]) {
        is_unique = false;
        break;
      }
    }
    if (is_unique) {
      pattern[size++] = pattern[i];
    }
  }

  return size;
}

// Assembly:
xorl %ecx, %ecx
testl %esi, %esi
cmovlel %ecx, %esi
xorl %eax, %eax
cmpq %rsi, %rcx
je 0x2d6df
testl %eax, %eax
movl $0x0, %r8d
cmovgl %eax, %r8d
movl (%rdi,%rcx,4), %edx
xorl %r9d, %r9d
cmpq %r9, %r8
je 0x2d6d1
leaq 0x1(%r9), %r10
cmpl (%rdi,%r9,4), %edx
movq %r10, %r9
jne 0x2d6bd
jmp 0x2d6da
movslq %eax, %r8
incl %eax
movl %edx, (%rdi,%r8,4)
incq %rcx
jmp 0x2d6a6
retq
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/learn/PatternAnalyzer.cpp
// Function: ClearAllHashData(std::unique_ptr<hash_table_t, std::default_delete<hash_table_t>>&)
static void
ClearAllHashData( std::unique_ptr<hash_table_t> &count )
{
  for (int i = 0; i < HASH_TABLE_MAX; i++) {
    count->data[i].hash = 0;
    for (int j = 0; j < 3; j++) {
      count->data[i].pattern[j] = 0;
    }
    count->data[i].large_pat[0] = 0;
    count->data[i].count = 0;
    count->data[i].appearance = 0;
    count->data[i].hash_flag = PatternHashStatus::Empty;
  }
  count->num;
}

// Assembly:
movq (%rdi), %rax
leaq 0x8(%rax), %rcx
xorl %edx, %edx
xorps %xmm0, %xmm0
cmpq $0x1000000, %rdx        # imm = 0x1000000
je 0x2e851
imulq $0x30, %rdx, %rsi
andq $0x0, (%rax,%rsi)
xorl %edi, %edi
cmpq $0x3, %rdi
je 0x2e83e
andl $0x0, (%rcx,%rdi,4)
incq %rdi
jmp 0x2e82f
incq %rdx
movups %xmm0, 0x18(%rax,%rsi)
andl $0x0, 0x28(%rax,%rsi)
addq $0x30, %rcx
jmp 0x2e81b
retq
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/learn/LearningLog.cpp
// Function: OutputLearningLogFile(int, int, double)
void
OutputLearningLogFile( const int update_steps, const int all_moves, const double consume_time )
{
  std::ofstream ofs(learning_log_file_path, std::ios::app);

  if (!ofs) {
    std::cerr << "Training log file open error." << std::endl;
    std::cerr << update_steps << ", all_moves : " << all_moves << ", run_time : " << consume_time << " seconds" << std::endl;
  } else {
    ofs << "step " << update_steps << ", all_moves : " << all_moves << ", run_time : ";
    ofs << std::fixed << std::setprecision(3) << consume_time << " seconds\n";
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x210, %rsp            # imm = 0x210
movsd %xmm0, 0x8(%rsp)
movl %esi, %ebx
movl %edi, %ebp
leaq 0x36bb0(%rip), %rsi     # 0x65690
leaq 0x10(%rsp), %r14
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0x6800
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x30(%rsp,%rax)
je 0x2eb79
movq 0x324eb(%rip), %rdi     # 0x60ff0
leaq 0x18347(%rip), %rsi     # 0x46e53
callq 0x63c0
movq %rax, %rdi
callq 0x6190
movq 0x324d0(%rip), %rdi     # 0x60ff0
movl %ebp, %esi
callq 0x6700
leaq 0x18343(%rip), %rsi     # 0x46e71
movq %rax, %rdi
callq 0x63c0
movq %rax, %rdi
movl %ebx, %esi
callq 0x6700
leaq 0x18339(%rip), %rsi     # 0x46e80
movq %rax, %rdi
callq 0x63c0
movq %rax, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x6670
leaq 0x15635(%rip), %rsi     # 0x44199
movq %rax, %rdi
callq 0x63c0
movq %rax, %rdi
callq 0x6190
jmp 0x2ebff
leaq 0x1832b(%rip), %rsi     # 0x46eab
leaq 0x10(%rsp), %rdi
callq 0x63c0
movq %rax, %rdi
movl %ebp, %esi
callq 0x6700
leaq 0x182d6(%rip), %rsi     # 0x46e71
movq %rax, %rdi
callq 0x63c0
movq %rax, %rdi
movl %ebx, %esi
callq 0x6700
leaq 0x182cc(%rip), %rsi     # 0x46e80
movq %rax, %rdi
callq 0x63c0
leaq 0x10(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rcx
movl $0xfffffefb, %edx       # imm = 0xFFFFFEFB
andl 0x28(%rsp,%rcx), %edx
orl $0x4, %edx
movl %edx, 0x28(%rsp,%rcx)
movq -0x18(%rax), %rax
movq $0x3, 0x18(%rsp,%rax)
movsd 0x8(%rsp), %xmm0
callq 0x6670
leaq 0x18297(%rip), %rsi     # 0x46e8e
movq %rax, %rdi
callq 0x63c0
leaq 0x10(%rsp), %rdi
callq 0x65e0
addq $0x210, %rsp            # imm = 0x210
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x65e0
movq %rbx, %rdi
callq 0x6740
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/sgf/SgfExtractor.cpp
// Function: GetPlayerName(SGF_record_t*, char const*, int, int)
static int
GetPlayerName( SGF_record_t *kifu, const char *sgf_text, const int cursor, const int color )
{
  int tmp_cursor = 0;

  while ((cursor + tmp_cursor < 100000) && (sgf_text[cursor + tmp_cursor] != ']')) tmp_cursor++;

  if (color == S_BLACK) {
    for (int i = 0; i < tmp_cursor - 3; i++) {
      if (cursor + i + 3 < 100000){
        kifu->black_name[i] = sgf_text[cursor + i + 3];
      }
    }
  } else {
    for (int i = 0; i < tmp_cursor - 3; i++) {
      if (cursor + i + 3 < 100000){
        kifu->white_name[i] = sgf_text[cursor + i + 3];
      }
    }
  }

  while ((cursor + tmp_cursor < 100000) && (sgf_text[cursor + tmp_cursor] != ']')) tmp_cursor++;  
  return cursor + tmp_cursor;
}

// Assembly:
movslq %edx, %rax
movabsq $-0x300000000, %r8      # imm = 0xFFFFFFFD00000000
movabsq $0x100000000, %r9       # imm = 0x100000000
movq %rax, %rdx
cmpq $0x1869f, %rdx          # imm = 0x1869F
jg 0x2f676
cmpb $0x5d, (%rsi,%rdx)
je 0x2f676
incq %rdx
addq %r9, %r8
jmp 0x2f65f
sarq $0x20, %r8
cmpl $0x1, %ecx
jne 0x2f6ad
leaq (%rax,%rsi), %rcx
addq $0x3, %rcx
xorl %r9d, %r9d
cmpq %r8, %r9
jge 0x2f6e5
leaq (%rax,%r9), %r10
cmpq $0x1869c, %r10          # imm = 0x1869C
jg 0x2f6a8
movb (%rcx,%r9), %r10b
movb %r10b, 0x3e98(%rdi,%r9)
incq %r9
jmp 0x2f68a
leaq (%rax,%rsi), %rcx
addq $0x3, %rcx
xorl %r9d, %r9d
cmpq %r8, %r9
jge 0x2f6e5
leaq (%rax,%r9), %r10
cmpq $0x1869c, %r10          # imm = 0x1869C
jg 0x2f6d6
movb (%rcx,%r9), %r10b
movb %r10b, 0x3f98(%rdi,%r9)
incq %r9
jmp 0x2f6b8
leaq 0x1(%rax), %rdx
cmpb $0x5d, (%rsi,%rax)
je 0x2f6f1
movq %rdx, %rax
cmpq $0x1869f, %rdx          # imm = 0x1869F
jle 0x2f6db
retq
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/sgf/SgfExtractor.cpp
// Function: GetMove(SGF_record_t*, char const*, int)
static int
GetMove( SGF_record_t *kifu, const char *sgf_text, const int cursor )
{
  int tmp_cursor = 0;

  if (cursor + 3 < 100000){
    if (kifu->moves == 0) {
      if (sgf_text[cursor] == 'B') {
        kifu->start_color = S_BLACK;
      } else {
        kifu->start_color = S_WHITE;
      }
    }
  
    if (sgf_text[cursor + 2] == ']') {
      kifu->move_x[kifu->moves] = PASS;
      kifu->move_y[kifu->moves] = PASS;
      tmp_cursor = 2;
    } else {
      kifu->move_x[kifu->moves] = ParsePosition(sgf_text[cursor + 2]);
      kifu->move_y[kifu->moves] = ParsePosition(sgf_text[cursor + 3]);
      tmp_cursor = 4;
      while ((cursor + tmp_cursor < 100000) && (sgf_text[cursor + tmp_cursor] != ']')) tmp_cursor++;        
    }

    kifu->moves++;
  }

  return cursor + tmp_cursor;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %edx, %ebx
xorl %eax, %eax
cmpl $0x1869c, %edx          # imm = 0x1869C
jg 0x2f74b
movq %rsi, %r15
movq %rdi, %r14
movslq 0x4(%rdi), %r13
movslq %ebx, %r12
testq %r13, %r13
jne 0x2f728
xorl %eax, %eax
cmpb $0x42, (%r15,%r12)
setne %al
incl %eax
movl %eax, (%r14)
movb 0x2(%r15,%r12), %al
cmpb $0x5d, %al
jne 0x2f757
andl $0x0, 0x8(%r14,%r13,4)
movslq 0x4(%r14), %rax
andl $0x0, 0xc88(%r14,%rax,4)
pushq $0x2
popq %rax
incl 0x4(%r14)
addl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movsbl %al, %edi
callq 0x2f79a
movl %eax, 0x8(%r14,%r13,4)
movsbl 0x3(%r15,%r12), %edi
addq %r12, %r15
callq 0x2f79a
movslq 0x4(%r14), %rcx
movl %eax, 0xc88(%r14,%rcx,4)
pushq $0x4
popq %rax
leaq (%r12,%rax), %rcx
cmpq $0x1869f, %rcx          # imm = 0x1869F
jg 0x2f747
cmpb $0x5d, (%r15,%rax)
je 0x2f747
incq %rax
jmp 0x2f781
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/mcts/Rating.cpp
// Function: SetNeighbor()
void
SetNeighbor( void )
{
  neighbor[ 0] = -2 * board_size;
  neighbor[ 1] = - board_size - 1;
  neighbor[ 2] = - board_size;
  neighbor[ 3] = - board_size + 1;
  neighbor[ 4] = -2;
  neighbor[ 5] = -1;
  neighbor[ 6] = 0;
  neighbor[ 7] = 1;
  neighbor[ 8] = 2;
  neighbor[ 9] = board_size - 1;
  neighbor[10] = board_size;
  neighbor[11] = board_size + 1;
  neighbor[12] = 2 * board_size;

  SetCrossPosition();
}

// Assembly:
leaq 0x32105(%rip), %rax     # 0x618bc
movl (%rax), %eax
leal (%rax,%rax), %ecx
movl %ecx, %edx
negl %edx
movl %edx, 0x3651a(%rip)     # 0x65ce0
movl %eax, %edx
notl %edx
movl %edx, 0x36514(%rip)     # 0x65ce4
movd %eax, %xmm0
pshufd $0x50, %xmm0, %xmm0     # xmm0 = xmm0[0,0,1,1]
movq 0x1776f(%rip), %xmm1    # 0x46f50
psubd %xmm0, %xmm1
movq %xmm1, 0x364fb(%rip)    # 0x65ce8
movaps 0x1776c(%rip), %xmm0    # 0x46f60
movaps %xmm0, 0x364f5(%rip)    # 0x65cf0
movl $0x2, 0x364fb(%rip)     # 0x65d00
leal -0x1(%rax), %edx
movl %edx, 0x364f6(%rip)     # 0x65d04
movl %eax, 0x364f4(%rip)     # 0x65d08
incl %eax
movl %eax, 0x364f0(%rip)     # 0x65d0c
movl %ecx, 0x364ee(%rip)     # 0x65d10
jmp 0x3d6f4
// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/mcts/Rating.cpp
// Function: RatingMove(game_info_t*, int, std::mersenne_twister_engine<unsigned long, 64ul, 312ul, 156ul, 31ul, 13043109905998158313ul, 29ul, 6148914691236517205ul, 17ul, 8202884508482404352ul, 37ul, 18444473444759240704ul, 43ul, 6364136223846793005ul>&)
int
RatingMove( game_info_t *game, int color, std::mt19937_64 &mt )
{
  long long *rate = game->rate[color - 1];
  long long *sum_rate_row = game->sum_rate_row[color - 1];
  long long *sum_rate = &game->sum_rate[color - 1];
  int y, pos;
  long long rand_num;

  // レートの部分更新
  PartialRating(game, color, sum_rate, sum_rate_row, rate);

  // 合法手を選択するまでループ
  while (true) {
    if (*sum_rate == 0) {
      pos = PASS;
      break;
    }

    rand_num = (mt() % (*sum_rate)) + 1;

    // 縦方向の位置を求める
    y = board_start;
    while (rand_num > sum_rate_row[y]){
      rand_num -= sum_rate_row[y++];
    }

    // 横方向の位置を求める
    pos = POS(board_start, y);
    do {
      rand_num -= rate[pos];
      if (rand_num <= 0) break;
      pos++;
    } while (true);

    // 選ばれた手が合法手ならループを抜け出し
    // そうでなければその箇所のレートを0にし, 手を選びなおす
    if (IsLegalNotEye(game, pos, color)) {
      break;
    } else {
      *sum_rate -= rate[pos];
      sum_rate_row[y] -= rate[pos];
      rate[pos] = 0;
    }
  }

  return pos;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, 0x10(%rsp)
movq %rdi, %r14
movl %esi, 0x4(%rsp)
movslq %esi, %rsi
imulq $0x1a48, %rsi, %rax     # imm = 0x1A48
leaq (%rax,%rdi), %r8
addq $0x98e00, %r8           # imm = 0x98E00
leaq (%rdi,%rsi,8), %r12
addq $0x9dea0, %r12          # imm = 0x9DEA0
imulq $0xe8, %rsi, %rax
leaq (%rax,%rdi), %r13
addq $0x9dbf0, %r13          # imm = 0x9DBF0
movq %r12, %rdx
movq %r13, %rcx
movq %r8, 0x8(%rsp)
callq 0x2fe22
cmpq $0x0, (%r12)
je 0x2fe0f
movq 0x10(%rsp), %rdi
callq 0x266c6
xorl %edx, %edx
divq (%r12)
incq %rdx
leaq 0x31b2f(%rip), %rax     # 0x618c0
movslq (%rax), %rax
leaq (,%rax,8), %rbp
addq %r13, %rbp
movl %eax, %ecx
movq %rdx, %rsi
subq (%rbp), %rsi
jle 0x2fdb5
incl %ecx
addq $0x8, %rbp
movq %rsi, %rdx
jmp 0x2fda4
leaq 0x31b00(%rip), %rsi     # 0x618bc
imull (%rsi), %ecx
leal (%rax,%rcx), %esi
movslq %esi, %rsi
movq 0x8(%rsp), %rdi
leaq (%rdi,%rsi,8), %r15
addq $-0x8, %r15
leal (%rax,%rcx), %ebx
decl %ebx
movq %r15, %rax
addq $0x8, %r15
incl %ebx
subq 0x8(%rax), %rdx
jg 0x2fdd7
movq %r14, %rdi
movl %ebx, %esi
movl 0x4(%rsp), %edx
callq 0x3beae
testb %al, %al
jne 0x2fe11
movq (%r15), %rax
subq %rax, (%r12)
movq (%r15), %rax
subq %rax, (%rbp)
andq $0x0, (%r15)
jmp 0x2fd6c
xorl %ebx, %ebx
movl %ebx, %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/Rating.cpp
// Function: UpdateNeighborCoordinates(game_info_t*, int, long long*, long long*, long long*, int, int*, bool*)
static void
UpdateNeighborCoordinates( 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++) {
    for (int j = 0; j < UPDATE_NUM; j++) {
      const int pos = update[i] + neighbor[j];
      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 0x70(%rsp), %rdx
leaq 0x4748(%rdi), %rax
movq %rax, 0x28(%rsp)
leaq 0x97372(%rdi), %rax
movq %rax, 0x20(%rsp)
xorl %r12d, %r12d
leaq 0x353d4(%rip), %rbx     # 0x65ce0
leaq 0x1aac909d(%rip), %r13  # 0x1aaf99b0
movq %r9, 0x8(%rsp)
movq %r8, 0x18(%rsp)
movq %r10, 0x10(%rsp)
cmpq $0x34, %r12
je 0x30a33
movslq (%r9), %rax
movslq (%r12,%rbx), %r15
addq %rax, %r15
cmpb $0x0, (%rdx,%r15)
jne 0x30a2a
cmpb $0x1, 0x96ce0(%rdi,%r15)
jne 0x30a0e
movq %rdi, %rbx
movl %ebp, %esi
movl %r15d, %edx
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 (%r13,%r15,4), %rdx
subq %rcx, (%r14,%rdx,8)
testb %al, %al
je 0x309f2
movq %rbx, %rdi
movl %ebp, %esi
movl %r15d, %edx
callq 0x3f18e
movq 0x28(%rsp), %rdi
movl %r15d, %esi
callq 0x37bd2
movl %eax, %eax
leaq 0x3537b(%rip), %rcx     # 0x65d20
cvtss2sd (%rcx,%rax,4), %xmm0
movsd %xmm0, 0x30(%rsp)
imull $0x6, %r15d, %eax
movslq %eax, %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 (%r13,%r15,4), %rcx
addq %rax, (%r14,%rcx,8)
movq %r14, %rcx
jmp 0x309fa
movq %r14, %rcx
andq $0x0, (%r8,%r15,8)
movq 0x8(%rsp), %r9
movq %rbx, %rdi
movq 0x70(%rsp), %rdx
leaq 0x352d2(%rip), %rbx     # 0x65ce0
imull $0x6, %r15d, %eax
cltq
movq 0x20(%rsp), %r11
andw $0x0, 0x4(%r11,%rax)
andl $0x0, (%r11,%rax)
movb $0x1, (%rdx,%r15)
addq $0x4, %r12
jmp 0x30922
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq