// File: /workspace/github_cpp_makefile_star2_O3/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 $0x68, %rsp
movq %rdi, %r12
movl 0x8(%rsi), %eax
movl %eax, (%rdi)
leaq 0x10(%rdi), %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
xorl %eax, %eax
movq %rax, 0x20(%rdi)
movups 0x3be94(%rip), %xmm0    # 0x5dbac
movups %xmm0, 0x28(%rdi)
movups 0x3be99(%rip), %xmm0    # 0x5dbbc
movups %xmm0, 0x38(%rdi)
movups 0x3be9e(%rip), %xmm0    # 0x5dbcc
movups %xmm0, 0x48(%rdi)
movupd 0x3bea2(%rip), %xmm0    # 0x5dbdc
movupd %xmm0, 0x58(%rdi)
addq $0x68, %rdi
leaq 0x78(%r12), %rcx
movq %rcx, 0x28(%rsp)
movq %rcx, 0x68(%r12)
movq %rax, 0x70(%r12)
movb %al, 0x78(%r12)
leaq 0x88(%r12), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x98(%r12), %rcx
movq %rcx, 0x20(%rsp)
movq %rcx, 0x88(%r12)
movq %rax, 0x90(%r12)
movb %al, 0x98(%r12)
movl 0x8(%rsi), %eax
testl %eax, %eax
movq %rdi, 0x8(%rsp)
je 0x21efa
movq %rsi, %r13
movl 0xc(%rsi), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movl 0x8(%rsi), %eax
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x8(%r12)
cmpl $0x0, 0x18(%rsi)
movq %r14, 0x10(%rsp)
jle 0x21e13
leaq 0x20(%r13), %rbp
xorl %r15d, %r15d
leaq 0x30(%rsp), %rbx
movl (%rbp), %eax
testl %eax, %eax
jle 0x21e03
movq %rbx, %rdi
movq %r13, %rsi
movl %r15d, %edx
movl $0x64, %ecx
callq 0x2231c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2253c
leaq 0x50(%rsp), %rdi
callq 0x227a2
incq %r15
movslq 0x18(%r13), %rax
addq $0x1c, %rbp
cmpq %rax, %r15
jl 0x21dd4
movq 0x10(%r12), %rbx
movq 0x18(%r12), %r15
cmpq %r15, %rbx
je 0x21e5d
movq %r15, %rax
subq %rbx, %rax
sarq $0x3, %rax
movabsq $0x6db6db6db6db6db7, %rcx # imm = 0x6DB6DB6DB6DB6DB7
imulq %rax, %rcx
bsrq %rcx, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x22a6f
movq %rbx, %rdi
movq %r15, %rsi
callq 0x22b2d
movq 0x70(%r12), %rdx
leaq 0x3b577(%rip), %rcx     # 0x5d3e0
movq 0x8(%rsp), %rdi
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x6620
leaq 0x54a31(%rip), %rbx     # 0x768b0
cmpl $0x0, (%rbx)
jle 0x21ed7
leaq 0x28(%r12), %r15
xorl %ebp, %ebp
leaq 0x1ab3f85e(%rip), %r14  # 0x1ab616f0
movslq (%r14,%rbp,4), %rax
movsd 0x2b00(%r13,%rax,8), %xmm0
movl 0x8(%r13), %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
mulsd 0x3b519(%rip), %xmm0    # 0x5d3d0
cvttsd2si %xmm0, %eax
cltq
movsbl (%r15,%rax), %esi
movq 0x8(%rsp), %rdi
callq 0x6350
incq %rbp
movslq (%rbx), %rax
cmpq %rax, %rbp
jl 0x21e92
movq 0x90(%r12), %rdx
leaq 0x3bd25(%rip), %rcx     # 0x5dc0b
movl $0x38, %r8d
movq 0x18(%rsp), %rdi
xorl %esi, %esi
callq 0x6620
jmp 0x21f67
movabsq $0x3fe0000000000000, %rax # imm = 0x3FE0000000000000
movq %rax, 0x8(%r12)
movq 0x70(%r12), %rdx
leaq 0x3b4cb(%rip), %rcx     # 0x5d3e0
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x6620
leaq 0x5498a(%rip), %rbx     # 0x768b0
cmpl $0x0, (%rbx)
movq 0x8(%rsp), %r15
jle 0x21f46
xorl %ebp, %ebp
movsbl 0x47(%r12), %esi
movq %r15, %rdi
callq 0x6350
incl %ebp
cmpl (%rbx), %ebp
jl 0x21f32
movq 0x90(%r12), %rdx
leaq 0x3bc97(%rip), %rcx     # 0x5dbec
movl $0x1e, %r8d
movq 0x18(%rsp), %rdi
xorl %esi, %esi
callq 0x6620
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x21f7a
jmp 0x21f92
movq %r14, 0x10(%rsp)
jmp 0x21f92
jmp 0x21f92
movq %rax, %r12
leaq 0x50(%rsp), %rdi
callq 0x227a2
jmp 0x21f95
movq %rax, %r12
movq 0x18(%rsp), %rax
movq (%rax), %rdi
cmpq 0x20(%rsp), %rdi
je 0x21fb4
movq 0x20(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x6410
movq 0x8(%rsp), %rax
movq (%rax), %rdi
cmpq 0x28(%rsp), %rdi
je 0x21fd3
movq 0x28(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x6410
movq 0x10(%rsp), %rdi
callq 0x224f4
movq %r12, %rdi
callq 0x6760
nop