// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/./include/mcts/AnalysisData.hpp
// Function: CgosAnalyzeData::CgosAnalyzeData(uct_node_t const&, int)
CgosAnalyzeData( const uct_node_t &root, const int color )
    : visits(root.move_count)
  {
    if (root.move_count == 0) {
      win_rate = 0.5;
      ownership = "";
      for (int i = 0; i < pure_board_max; i++) {
        ownership += owner_char[31];
      }
      comment = u8"Ray selected pass immediately.";
    } else {
      win_rate = static_cast<double>(root.win) / root.move_count;

      const child_node_t *children = root.child;

      for (int i = 0; i < root.child_num; i++) {
        if (children[i].move_count > 0) {
          pv_data.push_back(PrincipalVariationData(root, i));
        }
      }
      std::sort(pv_data.begin(), pv_data.end(), std::greater<PrincipalVariationData>());
      ownership = "";
      for (int i = 0; i < pure_board_max; i++) {
        const double owner = static_cast<double>(root.ownership[onboard_pos[i]]) / root.move_count;
        const int owner_index = static_cast<int>(owner * 62);
        ownership += owner_char[owner_index];
      }
      comment = u8"Ray selected next move based on Monte-Carlo tree search.";
    }

  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %r13
movl 0x8(%rsi), %eax
movl %eax, (%rdi)
leaq 0x10(%rdi), %rax
movq %rax, 0x18(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
andq $0x0, 0x20(%rdi)
movups 0x31d36(%rip), %xmm0    # 0x449fa
movups %xmm0, 0x28(%rdi)
movups 0x31d3b(%rip), %xmm0    # 0x44a0a
movups %xmm0, 0x38(%rdi)
movups 0x31d40(%rip), %xmm0    # 0x44a1a
movups %xmm0, 0x48(%rdi)
movupd 0x31d44(%rip), %xmm0    # 0x44a2a
movupd %xmm0, 0x58(%rdi)
leaq 0x78(%rdi), %rax
movq %rax, 0x68(%rdi)
andq $0x0, 0x70(%rdi)
addq $0x68, %rdi
xorl %eax, %eax
movb %al, 0x78(%r13)
leaq 0x98(%r13), %rcx
movq %rcx, 0x88(%r13)
andq $0x0, 0x90(%r13)
leaq 0x88(%r13), %rcx
movq %rcx, 0x10(%rsp)
movb %al, 0x98(%r13)
movl 0x8(%rsi), %eax
testl %eax, %eax
movq %rdi, 0x8(%rsp)
je 0x12e31
movq %rsi, %r12
movl 0xc(%rsi), %eax
cvtsi2sd %eax, %xmm0
movl 0x8(%rsi), %eax
cvtsi2sd %eax, %xmm1
leaq 0x28(%r13), %rbp
divsd %xmm1, %xmm0
movsd %xmm0, 0x8(%r13)
leaq 0x20(%rsi), %r14
xorl %r15d, %r15d
leaq 0x20(%rsp), %rbx
movslq 0x18(%r12), %rax
cmpq %rax, %r15
jge 0x12da8
movl (%r14), %eax
testl %eax, %eax
jle 0x12d9f
movq %rbx, %rdi
movq %r12, %rsi
movl %r15d, %edx
pushq $0x64
popq %rcx
callq 0x13114
movq 0x18(%rsp), %rdi
movq %rbx, %rsi
callq 0x13280
leaq 0x40(%rsp), %rdi
callq 0x134e4
incq %r15
addq $0x1c, %r14
jmp 0x12d66
movq 0x10(%r13), %rdi
movq 0x18(%r13), %rsi
callq 0x13727
leaq 0x31df4(%rip), %rsi     # 0x44bb0
movq 0x8(%rsp), %rdi
callq 0x67f0
xorl %ebx, %ebx
leaq 0x4eae1(%rip), %r14     # 0x618b0
leaq 0x1ab3991a(%rip), %r15  # 0x1ab4c6f0
movq 0x8(%rsp), %r13
movslq (%r14), %rax
cmpq %rax, %rbx
jge 0x12e1e
movslq (%r15,%rbx,4), %rax
movsd 0x2b00(%r12,%rax,8), %xmm0
movl 0x8(%r12), %eax
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
mulsd 0x315ca(%rip), %xmm0    # 0x443d0
cvttsd2si %xmm0, %eax
cltq
movsbl (%rbp,%rax), %esi
movq %r13, %rdi
callq 0x6330
incq %rbx
jmp 0x12ddb
leaq 0x31c34(%rip), %rsi     # 0x44a59
movq 0x10(%rsp), %rdi
callq 0x67f0
jmp 0x12e7d
movabsq $0x3fe0000000000000, %rax # imm = 0x3FE0000000000000
movq %rax, 0x8(%r13)
leaq 0x31d6a(%rip), %rsi     # 0x44bb0
callq 0x67f0
xorl %ebx, %ebx
leaq 0x4ea5c(%rip), %r14     # 0x618b0
cmpl (%r14), %ebx
jge 0x12e6c
movsbl 0x47(%r13), %esi
movq 0x8(%rsp), %rdi
callq 0x6330
incl %ebx
jmp 0x12e54
leaq 0x31bc7(%rip), %rsi     # 0x44a3a
movq 0x10(%rsp), %rdi
callq 0x67f0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x12ea3
jmp 0x12ea3
jmp 0x12ea3
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x134e4
jmp 0x12ea6
jmp 0x12ea3
movq %rax, %rbx
movq 0x10(%rsp), %rdi
callq 0x6838
movq 0x8(%rsp), %rdi
callq 0x6838
movq 0x18(%rsp), %rdi
callq 0x1325e
movq %rbx, %rdi
callq 0x6740