// File: /workspace/github_cpp_makefile_star2_O1/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, 0x68(%rsp)
movl %ecx, %ebx
movl %edx, 0x8(%rsp)
movq %rsi, %r15
leaq 0x70(%rsp), %rdi
callq 0x6560
movsd 0x3f15b(%rip), %xmm1    # 0x5d008
testl %ebx, %ebx
jle 0x1deb9
cvtsi2sd %ebx, %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, 0x30(%rsp)
cmpb $0x1, 0x5756a(%rip)     # 0x75430
jne 0x1e341
leaq 0x3f72b(%rip), %rsi     # 0x5d5fe
leaq 0x70(%rsp), %rdi
movl $0x3, %edx
callq 0x64a0
leaq 0x579d7(%rip), %rax     # 0x758c0
movl (%rax), %ebp
leaq 0x579d2(%rip), %rax     # 0x758c4
cmpl (%rax), %ebp
jg 0x1df47
decl %ebp
leaq 0x3f4a2(%rip), %r14     # 0x5d3a1
leaq 0x3f6f8(%rip), %rbx     # 0x5d5fe
leaq 0x70(%rsp), %r12
leaq 0x38(%rsp), %r13
movl $0x3, %edx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x64a0
movb (%r14), %al
movb %al, 0x38(%rsp)
movl $0x1, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x64a0
incq %r14
incl %ebp
leaq 0x57981(%rip), %rax     # 0x758c4
cmpl (%rax), %ebp
jl 0x1df10
leaq 0x425f7(%rip), %rsi     # 0x60545
leaq 0x70(%rsp), %rdi
movl $0x1, %edx
callq 0x64a0
leaq 0x3f114(%rip), %rsi     # 0x5d078
leaq 0x70(%rsp), %rdi
movl $0x4, %edx
callq 0x64a0
leaq 0x5793a(%rip), %r13     # 0x758b4
cmpl $0x0, (%r13)
jle 0x1dfac
xorl %ebp, %ebp
leaq 0x3f171(%rip), %rbx     # 0x5d0fb
leaq 0x70(%rsp), %r12
movl $0x1, %edx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x64a0
incl %ebp
movl (%r13), %eax
shll $0x2, %eax
cmpl %eax, %ebp
jl 0x1df8f
leaq 0x3f0c8(%rip), %rsi     # 0x5d07b
leaq 0x70(%rsp), %rdi
movl $0x1, %edx
callq 0x64a0
leaq 0x4257c(%rip), %rsi     # 0x60545
leaq 0x70(%rsp), %rdi
movl $0x1, %edx
callq 0x64a0
leaq 0x578e1(%rip), %rax     # 0x758c0
movl (%rax), %ebp
movl $0x0, 0x4(%rsp)
movl $0x0, %r12d
leaq 0x578ce(%rip), %rax     # 0x758c4
cmpl (%rax), %ebp
jg 0x1e196
movslq 0x8(%rsp), %rax
leaq (%r15,%rax,4), %rax
movq %rax, 0x60(%rsp)
movl $0x1, %r14d
xorl %r12d, %r12d
movl $0x0, 0x4(%rsp)
movq 0x70(%rsp), %rax
movq -0x18(%rax), %rax
movq $0x2, 0x80(%rsp,%rax)
movl (%r13), %esi
subl %r14d, %esi
incl %esi
leaq 0x70(%rsp), %rdi
callq 0x6740
movl $0x2, %edx
movq %rax, %rdi
leaq 0x3f029(%rip), %rsi     # 0x5d07d
callq 0x64a0
movl %r14d, 0xc(%rsp)
leaq 0x5785b(%rip), %rax     # 0x758c0
movslq (%rax), %r14
leaq 0x57855(%rip), %rax     # 0x758c4
cmpl (%rax), %r14d
movq %rbp, 0x58(%rsp)
jg 0x1e142
leal -0x1(%r14), %ebx
movslq %ebp, %rax
movq %rax, 0x10(%rsp)
movl %r12d, 0x20(%rsp)
leaq 0x57827(%rip), %rax     # 0x758bc
movslq (%rax), %rax
imulq 0x10(%rsp), %rax
addq %r14, %rax
movq %rax, %rcx
shlq $0x4, %rcx
movq 0x60(%rsp), %rdx
movl (%rdx,%rcx), %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
mulsd 0x30(%rsp), %xmm0
xorl %ebp, %ebp
xorl %r12d, %r12d
ucomisd 0x3ef46(%rip), %xmm0    # 0x5d010
seta %r15b
setbe %r13b
mulsd 0x3ef3e(%rip), %xmm0    # 0x5d018
movq 0x68(%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 0x6740
movl $0x1, %edx
movq %rax, %rdi
leaq 0x3f4ea(%rip), %rsi     # 0x5d600
callq 0x64a0
movb %r13b, %r12b
addl %r12d, 0x4(%rsp)
movb %r15b, %bpl
movl 0x20(%rsp), %r12d
addl %ebp, %r12d
incl %ebx
incq %r14
leaq 0x5778a(%rip), %rax     # 0x758c4
cmpl (%rax), %ebx
jl 0x1e089
movl $0x1, %edx
leaq 0x70(%rsp), %rdi
leaq 0x3ef2e(%rip), %rsi     # 0x5d081
callq 0x64a0
leaq 0x57755(%rip), %r13     # 0x758b4
movq 0x58(%rsp), %rbx
movl 0xc(%rsp), %r14d
movl $0x1, %edx
leaq 0x70(%rsp), %rdi
leaq 0x423cb(%rip), %rsi     # 0x60545
callq 0x64a0
leal 0x1(%rbx), %eax
incl %r14d
leaq 0x57738(%rip), %rcx     # 0x758c4
cmpl (%rcx), %ebx
movl %eax, %ebp
jl 0x1e01d
leaq 0x3eedb(%rip), %rsi     # 0x5d078
leaq 0x70(%rsp), %rdi
movl $0x4, %edx
callq 0x64a0
cmpl $0x0, (%r13)
jle 0x1e1de
xorl %ebp, %ebp
leaq 0x3ef3f(%rip), %rbx     # 0x5d0fb
leaq 0x70(%rsp), %r14
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x64a0
incl %ebp
movl (%r13), %eax
shll $0x2, %eax
cmpl %eax, %ebp
jl 0x1e1c1
leaq 0x3ee96(%rip), %rsi     # 0x5d07b
leaq 0x70(%rsp), %rdi
movl $0x1, %edx
callq 0x64a0
leaq 0x4234a(%rip), %rsi     # 0x60545
leaq 0x70(%rsp), %rdi
movl $0x1, %edx
callq 0x64a0
subl 0x4(%rsp), %r12d
cvtsi2sd %r12d, %xmm1
leaq 0x1aaedcf5(%rip), %rax  # 0x1ab0bf10
movsd (%rax), %xmm2
cmpl $0x1, 0x8(%rsp)
movapd %xmm1, 0x20(%rsp)
movapd %xmm2, 0x10(%rsp)
jne 0x1e25f
ucomisd %xmm2, %xmm1
jbe 0x1e295
leaq 0x3eec3(%rip), %rsi     # 0x5d102
leaq 0x70(%rsp), %rdi
movl $0x6, %edx
callq 0x64a0
movapd 0x20(%rsp), %xmm0
subsd 0x10(%rsp), %xmm0
jmp 0x1e2e3
movapd 0x3edc9(%rip), %xmm0    # 0x5d030
xorpd %xmm2, %xmm0
ucomisd %xmm0, %xmm1
jbe 0x1e2b9
leaq 0x3ee91(%rip), %rsi     # 0x5d109
leaq 0x70(%rsp), %rdi
movl $0x6, %edx
callq 0x64a0
movapd 0x20(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
jmp 0x1e2e3
leaq 0x3ee6d(%rip), %rsi     # 0x5d109
leaq 0x70(%rsp), %rdi
movl $0x6, %edx
callq 0x64a0
movapd 0x20(%rsp), %xmm0
subsd 0x10(%rsp), %xmm0
jmp 0x1e2db
leaq 0x3ee42(%rip), %rsi     # 0x5d102
leaq 0x70(%rsp), %rdi
movl $0x6, %edx
callq 0x64a0
movapd 0x10(%rsp), %xmm0
addsd 0x20(%rsp), %xmm0
xorpd 0x3ed4d(%rip), %xmm0    # 0x5d030
leaq 0x70(%rsp), %rdi
callq 0x66a0
leaq 0x42251(%rip), %rsi     # 0x60545
movl $0x1, %edx
movq %rax, %rdi
callq 0x64a0
leaq 0x78(%rsp), %rsi
leaq 0x38(%rsp), %rdi
callq 0x6680
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq 0x56cc7(%rip), %rdi     # 0x74fe8
callq 0x64a0
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1e341
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x6420
movq 0x56c50(%rip), %rsi     # 0x74f98
leaq 0x70(%rsp), %rdi
callq 0x61f0
leaq 0xe0(%rsp), %rdi
callq 0x60f0
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1e3a0
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x6420
jmp 0x1e3a0
jmp 0x1e39d
jmp 0x1e39d
jmp 0x1e39d
jmp 0x1e39d
jmp 0x1e39d
jmp 0x1e39d
movq %rax, %rbx
movq 0x56bf1(%rip), %rsi     # 0x74f98
leaq 0x70(%rsp), %rdi
callq 0x61f0
leaq 0xe0(%rsp), %rdi
callq 0x60f0
movq %rbx, %rdi
callq 0x6770