// File: /workspace/github_cpp_makefile_star2_O2/kobanium[P]Ray/src/common/Message.cpp
// Function: PrintOwner(uct_node_t const*, statistic_t const*, int, int, double*)
void
PrintOwner( const uct_node_t *root, const statistic_t *statistic, const int color, const int count, double *own )
{
  int player = 0, opponent = 0;
  double owner, score;
  std::ostringstream oss;
  const double inv_count = (count > 0) ? 1.0 / count : 1.0;

  if (!debug_message) return;

  oss << "   ";
  for (int i = 1, y = board_start; y <= board_end; y++, i++) {
    oss << "   " << gogui_x[i];
  }
  oss << "\n";

  oss << "   +";
  for (int i = 0; i < pure_board_size * 4; i++) {
    oss << "-";
  }
  oss << "+" << "\n";
  for (int i = 1, y = board_start; y <= board_end; y++, i++) {
    oss << std::setw(2) << (pure_board_size + 1 - i) << ":|";
    for (int x = board_start; x <= board_end; x++) {
      const int pos = POS(x, y);
      owner = static_cast<double>(statistic[pos].colors[color]) * inv_count;
      if (owner > 0.5) {
        player++;
      } else {
        opponent++;
      }
      own[pos] = owner * 100.0;
      oss << std::setw(3) << static_cast<int>(owner * 100) << " ";
    }
    oss << "|" << "\n";
  }

  oss << "   +";
  for (int i = 0; i < pure_board_size * 4; i++) {
    oss << "-";
  }
  oss << "+" << "\n";

  if (color == S_BLACK) {
    if (player - opponent > komi[0]) {
      score = player - opponent - komi[0];
      oss << "BLACK+" << score << "\n";
    } else {
      score = -(player - opponent - komi[0]);
      oss << "WHITE+" << score << "\n";
    }
  } else {
    if (player - opponent > -komi[0]) {
      score = player - opponent + komi[0];
      oss << "WHITE+" << score << "\n";
    } else {
      score = -(player - opponent + komi[0]);
      oss << "BLACK+" << score << "\n";
    }
  }

  std::cerr << oss.str();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1e8, %rsp            # imm = 0x1E8
movq %r8, 0x48(%rsp)
movl %ecx, %ebx
movl %edx, 0x4(%rsp)
movq %rsi, %r15
leaq 0x70(%rsp), %rdi
callq 0x6530
movsd 0x34332(%rip), %xmm1    # 0x44008
testl %ebx, %ebx
jle 0xfce2
cvtsi2sd %ebx, %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, 0x38(%rsp)
cmpb $0x1, 0x51741(%rip)     # 0x61430
jne 0x1008d
leaq 0x34750(%rip), %rsi     # 0x4444c
leaq 0x70(%rsp), %rdi
callq 0x63c0
leaq 0x51bb3(%rip), %rax     # 0x618c0
movl (%rax), %ebp
leaq 0x3468b(%rip), %r14     # 0x443a1
leaq 0x3472f(%rip), %rbx     # 0x4444c
leaq 0x70(%rsp), %r12
leaq 0x51b9b(%rip), %rax     # 0x618c4
cmpl (%rax), %ebp
jg 0xfd4b
movq %r12, %rdi
movq %rbx, %rsi
callq 0x63c0
movsbl (%r14), %esi
movq %rax, %rdi
callq 0x6480
incl %ebp
incq %r14
jmp 0xfd22
leaq 0x37883(%rip), %rsi     # 0x475d5
leaq 0x70(%rsp), %rdi
callq 0x63c0
leaq 0x34315(%rip), %rsi     # 0x44078
leaq 0x70(%rsp), %rdi
callq 0x63c0
xorl %ebp, %ebp
leaq 0x34385(%rip), %rbx     # 0x440fb
leaq 0x70(%rsp), %r12
leaq 0x51b32(%rip), %rax     # 0x618b4
movl (%rax), %eax
shll $0x2, %eax
cmpl %eax, %ebp
jge 0xfd9a
movq %r12, %rdi
movq %rbx, %rsi
callq 0x63c0
incl %ebp
jmp 0xfd7b
leaq 0x342da(%rip), %rsi     # 0x4407b
leaq 0x70(%rsp), %rdi
callq 0x63c0
leaq 0x37823(%rip), %rsi     # 0x475d5
movq %rax, %rdi
callq 0x63c0
leaq 0x51aff(%rip), %rax     # 0x618c0
movl (%rax), %ebx
movslq 0x4(%rsp), %rax
leaq (%r15,%rax,4), %rax
movq %rax, 0x40(%rsp)
xorl %r12d, %r12d
pushq $0x1
popq %rcx
xorl %r15d, %r15d
leaq 0x51ae3(%rip), %rax     # 0x618c4
cmpl (%rax), %ebx
jg 0xff2e
movq 0x70(%rsp), %rax
movq -0x18(%rax), %rax
movq $0x2, 0x80(%rsp,%rax)
leaq 0x51aaf(%rip), %rax     # 0x618b4
movl (%rax), %esi
movl %ecx, 0x8(%rsp)
subl %ecx, %esi
incl %esi
leaq 0x70(%rsp), %rdi
callq 0x6700
movq %rax, %rdi
leaq 0x3425a(%rip), %rsi     # 0x4407d
callq 0x63c0
leaq 0x51a91(%rip), %rax     # 0x618c0
movslq (%rax), %rcx
movslq %ebx, %rax
movq %rax, 0x10(%rsp)
movl %ebx, 0xc(%rsp)
leaq 0x51a7f(%rip), %rax     # 0x618c4
cmpl (%rax), %ecx
jg 0xff01
movl %r15d, %ebx
movl %r12d, %r14d
leaq 0x51a62(%rip), %rax     # 0x618bc
movslq (%rax), %rax
imulq 0x10(%rsp), %rax
movq %rcx, 0x20(%rsp)
addq %rcx, %rax
movq %rax, %rcx
shlq $0x4, %rcx
movq 0x40(%rsp), %rdx
movl (%rdx,%rcx), %ecx
cvtsi2sd %ecx, %xmm0
mulsd 0x38(%rsp), %xmm0
xorl %r15d, %r15d
xorl %r12d, %r12d
ucomisd 0x3417e(%rip), %xmm0    # 0x44010
seta %r13b
setbe %bpl
mulsd 0x34176(%rip), %xmm0    # 0x44018
movq 0x48(%rsp), %rcx
movsd %xmm0, (%rcx,%rax,8)
movq 0x70(%rsp), %rax
movq -0x18(%rax), %rax
movq $0x3, 0x80(%rsp,%rax)
cvttsd2si %xmm0, %esi
leaq 0x70(%rsp), %rdi
callq 0x6700
movq %rax, %rdi
leaq 0x34575(%rip), %rsi     # 0x4444e
callq 0x63c0
movb %bpl, %r12b
addl %r12d, %r14d
movl %r14d, %r12d
movb %r13b, %r15b
addl %r15d, %ebx
movl %ebx, %r15d
movq 0x20(%rsp), %rcx
incq %rcx
movl 0xc(%rsp), %ebx
jmp 0xfe3e
leaq 0x70(%rsp), %rdi
leaq 0x34174(%rip), %rsi     # 0x44081
callq 0x63c0
movq %rax, %rdi
leaq 0x376b9(%rip), %rsi     # 0x475d5
callq 0x63c0
incl %ebx
movl 0x8(%rsp), %ecx
incl %ecx
jmp 0xfdda
leaq 0x34143(%rip), %rsi     # 0x44078
leaq 0x70(%rsp), %rdi
callq 0x63c0
xorl %ebp, %ebp
leaq 0x341b3(%rip), %rbx     # 0x440fb
leaq 0x70(%rsp), %r14
leaq 0x51960(%rip), %rax     # 0x618b4
movl (%rax), %eax
shll $0x2, %eax
cmpl %eax, %ebp
jge 0xff6c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x63c0
incl %ebp
jmp 0xff4d
leaq 0x34108(%rip), %rsi     # 0x4407b
leaq 0x70(%rsp), %rdi
callq 0x63c0
leaq 0x37651(%rip), %rsi     # 0x475d5
movq %rax, %rdi
callq 0x63c0
subl %r12d, %r15d
cvtsi2sd %r15d, %xmm1
leaq 0x1aae7f75(%rip), %rax  # 0x1aaf7f10
movsd (%rax), %xmm2
cmpl $0x1, 0x4(%rsp)
movapd %xmm1, 0x20(%rsp)
movapd %xmm2, 0x10(%rsp)
jne 0xffd7
ucomisd %xmm2, %xmm1
jbe 0x10008
leaq 0x34143(%rip), %rsi     # 0x44102
leaq 0x70(%rsp), %rdi
callq 0x63c0
movapd 0x20(%rsp), %xmm0
subsd 0x10(%rsp), %xmm0
jmp 0x1004c
movapd 0x34051(%rip), %xmm0    # 0x44030
xorpd %xmm2, %xmm0
ucomisd %xmm0, %xmm1
jbe 0x10027
leaq 0x34119(%rip), %rsi     # 0x44109
leaq 0x70(%rsp), %rdi
callq 0x63c0
movapd 0x20(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
jmp 0x1004c
leaq 0x340fa(%rip), %rsi     # 0x44109
leaq 0x70(%rsp), %rdi
callq 0x63c0
movapd 0x20(%rsp), %xmm0
subsd 0x10(%rsp), %xmm0
jmp 0x10044
leaq 0x340d4(%rip), %rsi     # 0x44102
leaq 0x70(%rsp), %rdi
callq 0x63c0
movapd 0x10(%rsp), %xmm0
addsd 0x20(%rsp), %xmm0
xorpd 0x33fe4(%rip), %xmm0    # 0x44030
movq %rax, %rdi
callq 0x6670
leaq 0x3757a(%rip), %rsi     # 0x475d5
movq %rax, %rdi
callq 0x63c0
leaq 0x78(%rsp), %rsi
leaq 0x50(%rsp), %rdi
callq 0x6640
movq 0x50f77(%rip), %rdi     # 0x60ff0
leaq 0x50(%rsp), %rsi
callq 0x6350
leaq 0x50(%rsp), %rdi
callq 0x6838
leaq 0x70(%rsp), %rdi
callq 0x60a0
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x6838
jmp 0x100c7
jmp 0x100c4
jmp 0x100c4
jmp 0x100c4
jmp 0x100c4
jmp 0x100c4
jmp 0x100c4
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x60a0
movq %rbx, %rdi
callq 0x6740