// File: /workspace/github_cpp_makefile_star2_O1/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 0x3bc80(%rip), %xmm0    # 0x5dbac
movups %xmm0, 0x28(%rdi)
movups 0x3bc85(%rip), %xmm0    # 0x5dbbc
movups %xmm0, 0x38(%rdi)
movups 0x3bc8a(%rip), %xmm0    # 0x5dbcc
movups %xmm0, 0x48(%rdi)
movupd 0x3bc8e(%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 0x2210e
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 0x22027
leaq 0x20(%r13), %rbp
xorl %r15d, %r15d
leaq 0x30(%rsp), %rbx
movl (%rbp), %eax
testl %eax, %eax
jle 0x22017
movq %rbx, %rdi
movq %r13, %rsi
movl %r15d, %edx
movl $0x64, %ecx
callq 0x22530
movq %r14, %rdi
movq %rbx, %rsi
callq 0x22738
leaq 0x50(%rsp), %rdi
callq 0x229b8
incq %r15
movslq 0x18(%r13), %rax
addq $0x1c, %rbp
cmpq %rax, %r15
jl 0x21fe8
movq 0x10(%r12), %rbx
movq 0x18(%r12), %r15
cmpq %r15, %rbx
je 0x22071
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 0x22c7b
movq %rbx, %rdi
movq %r15, %rsi
callq 0x22d39
movq 0x70(%r12), %rdx
leaq 0x3b363(%rip), %rcx     # 0x5d3e0
movq 0x8(%rsp), %rdi
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x6630
leaq 0x5381d(%rip), %rbx     # 0x758b0
cmpl $0x0, (%rbx)
jle 0x220eb
leaq 0x28(%r12), %r15
xorl %ebp, %ebp
leaq 0x1ab3e64a(%rip), %r14  # 0x1ab606f0
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 0x3b305(%rip), %xmm0    # 0x5d3d0
cvttsd2si %xmm0, %eax
cltq
movsbl (%r15,%rax), %esi
movq 0x8(%rsp), %rdi
callq 0x6360
incq %rbp
movslq (%rbx), %rax
cmpq %rax, %rbp
jl 0x220a6
movq 0x90(%r12), %rdx
leaq 0x3bb11(%rip), %rcx     # 0x5dc0b
movl $0x38, %r8d
movq 0x18(%rsp), %rdi
xorl %esi, %esi
callq 0x6630
jmp 0x2217b
movabsq $0x3fe0000000000000, %rax # imm = 0x3FE0000000000000
movq %rax, 0x8(%r12)
movq 0x70(%r12), %rdx
leaq 0x3b2b7(%rip), %rcx     # 0x5d3e0
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x6630
leaq 0x53776(%rip), %rbx     # 0x758b0
cmpl $0x0, (%rbx)
movq 0x8(%rsp), %r15
jle 0x2215a
xorl %ebp, %ebp
movsbl 0x47(%r12), %esi
movq %r15, %rdi
callq 0x6360
incl %ebp
cmpl (%rbx), %ebp
jl 0x22146
movq 0x90(%r12), %rdx
leaq 0x3ba83(%rip), %rcx     # 0x5dbec
movl $0x1e, %r8d
movq 0x18(%rsp), %rdi
xorl %esi, %esi
callq 0x6630
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2218e
jmp 0x221a6
movq %r14, 0x10(%rsp)
jmp 0x221a6
jmp 0x221a6
movq %rax, %r12
leaq 0x50(%rsp), %rdi
callq 0x229b8
jmp 0x221a9
movq %rax, %r12
movq 0x18(%rsp), %rax
movq (%rax), %rdi
cmpq 0x20(%rsp), %rdi
je 0x221c8
movq 0x20(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x6420
movq 0x8(%rsp), %rax
movq (%rax), %rdi
cmpq 0x28(%rsp), %rdi
je 0x221e7
movq 0x28(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x6420
movq 0x10(%rsp), %rdi
callq 0x226f6
movq %r12, %rdi
callq 0x6770
nop