// File: /workspace/github_cpp_makefile_star2_O3/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 0x6550
movsd 0x3f36b(%rip), %xmm1    # 0x5d008
testl %ebx, %ebx
jle 0x1dca9
cvtsi2sd %ebx, %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, 0x30(%rsp)
cmpb $0x1, 0x5877a(%rip)     # 0x76430
jne 0x1e131
leaq 0x3f93b(%rip), %rsi     # 0x5d5fe
leaq 0x70(%rsp), %rdi
movl $0x3, %edx
callq 0x6490
leaq 0x58be7(%rip), %rax     # 0x768c0
movl (%rax), %ebp
leaq 0x58be2(%rip), %rax     # 0x768c4
cmpl (%rax), %ebp
jg 0x1dd37
decl %ebp
leaq 0x3f6b2(%rip), %r14     # 0x5d3a1
leaq 0x3f908(%rip), %rbx     # 0x5d5fe
leaq 0x70(%rsp), %r12
leaq 0x38(%rsp), %r13
movl $0x3, %edx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x6490
movb (%r14), %al
movb %al, 0x38(%rsp)
movl $0x1, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x6490
incq %r14
incl %ebp
leaq 0x58b91(%rip), %rax     # 0x768c4
cmpl (%rax), %ebp
jl 0x1dd00
leaq 0x42977(%rip), %rsi     # 0x606b5
leaq 0x70(%rsp), %rdi
movl $0x1, %edx
callq 0x6490
leaq 0x3f324(%rip), %rsi     # 0x5d078
leaq 0x70(%rsp), %rdi
movl $0x4, %edx
callq 0x6490
leaq 0x58b4a(%rip), %r13     # 0x768b4
cmpl $0x0, (%r13)
jle 0x1dd9c
xorl %ebp, %ebp
leaq 0x3f381(%rip), %rbx     # 0x5d0fb
leaq 0x70(%rsp), %r12
movl $0x1, %edx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x6490
incl %ebp
movl (%r13), %eax
shll $0x2, %eax
cmpl %eax, %ebp
jl 0x1dd7f
leaq 0x3f2d8(%rip), %rsi     # 0x5d07b
leaq 0x70(%rsp), %rdi
movl $0x1, %edx
callq 0x6490
leaq 0x428fc(%rip), %rsi     # 0x606b5
leaq 0x70(%rsp), %rdi
movl $0x1, %edx
callq 0x6490
leaq 0x58af1(%rip), %rax     # 0x768c0
movl (%rax), %ebp
movl $0x0, 0x4(%rsp)
movl $0x0, %r12d
leaq 0x58ade(%rip), %rax     # 0x768c4
cmpl (%rax), %ebp
jg 0x1df86
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 0x6730
movl $0x2, %edx
movq %rax, %rdi
leaq 0x3f239(%rip), %rsi     # 0x5d07d
callq 0x6490
movl %r14d, 0xc(%rsp)
leaq 0x58a6b(%rip), %rax     # 0x768c0
movslq (%rax), %r14
leaq 0x58a65(%rip), %rax     # 0x768c4
cmpl (%rax), %r14d
movq %rbp, 0x58(%rsp)
jg 0x1df32
leal -0x1(%r14), %ebx
movslq %ebp, %rax
movq %rax, 0x10(%rsp)
movl %r12d, 0x20(%rsp)
leaq 0x58a37(%rip), %rax     # 0x768bc
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 0x3f156(%rip), %xmm0    # 0x5d010
seta %r15b
setbe %r13b
mulsd 0x3f14e(%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 0x6730
movl $0x1, %edx
movq %rax, %rdi
leaq 0x3f6fa(%rip), %rsi     # 0x5d600
callq 0x6490
movb %r13b, %r12b
addl %r12d, 0x4(%rsp)
movb %r15b, %bpl
movl 0x20(%rsp), %r12d
addl %ebp, %r12d
incl %ebx
incq %r14
leaq 0x5899a(%rip), %rax     # 0x768c4
cmpl (%rax), %ebx
jl 0x1de79
movl $0x1, %edx
leaq 0x70(%rsp), %rdi
leaq 0x3f13e(%rip), %rsi     # 0x5d081
callq 0x6490
leaq 0x58965(%rip), %r13     # 0x768b4
movq 0x58(%rsp), %rbx
movl 0xc(%rsp), %r14d
movl $0x1, %edx
leaq 0x70(%rsp), %rdi
leaq 0x4274b(%rip), %rsi     # 0x606b5
callq 0x6490
leal 0x1(%rbx), %eax
incl %r14d
leaq 0x58948(%rip), %rcx     # 0x768c4
cmpl (%rcx), %ebx
movl %eax, %ebp
jl 0x1de0d
leaq 0x3f0eb(%rip), %rsi     # 0x5d078
leaq 0x70(%rsp), %rdi
movl $0x4, %edx
callq 0x6490
cmpl $0x0, (%r13)
jle 0x1dfce
xorl %ebp, %ebp
leaq 0x3f14f(%rip), %rbx     # 0x5d0fb
leaq 0x70(%rsp), %r14
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6490
incl %ebp
movl (%r13), %eax
shll $0x2, %eax
cmpl %eax, %ebp
jl 0x1dfb1
leaq 0x3f0a6(%rip), %rsi     # 0x5d07b
leaq 0x70(%rsp), %rdi
movl $0x1, %edx
callq 0x6490
leaq 0x426ca(%rip), %rsi     # 0x606b5
leaq 0x70(%rsp), %rdi
movl $0x1, %edx
callq 0x6490
subl 0x4(%rsp), %r12d
cvtsi2sd %r12d, %xmm1
leaq 0x1aaeef05(%rip), %rax  # 0x1ab0cf10
movsd (%rax), %xmm2
cmpl $0x1, 0x8(%rsp)
movapd %xmm1, 0x20(%rsp)
movapd %xmm2, 0x10(%rsp)
jne 0x1e04f
ucomisd %xmm2, %xmm1
jbe 0x1e085
leaq 0x3f0d3(%rip), %rsi     # 0x5d102
leaq 0x70(%rsp), %rdi
movl $0x6, %edx
callq 0x6490
movapd 0x20(%rsp), %xmm0
subsd 0x10(%rsp), %xmm0
jmp 0x1e0d3
movapd 0x3efd9(%rip), %xmm0    # 0x5d030
xorpd %xmm2, %xmm0
ucomisd %xmm0, %xmm1
jbe 0x1e0a9
leaq 0x3f0a1(%rip), %rsi     # 0x5d109
leaq 0x70(%rsp), %rdi
movl $0x6, %edx
callq 0x6490
movapd 0x20(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
jmp 0x1e0d3
leaq 0x3f07d(%rip), %rsi     # 0x5d109
leaq 0x70(%rsp), %rdi
movl $0x6, %edx
callq 0x6490
movapd 0x20(%rsp), %xmm0
subsd 0x10(%rsp), %xmm0
jmp 0x1e0cb
leaq 0x3f052(%rip), %rsi     # 0x5d102
leaq 0x70(%rsp), %rdi
movl $0x6, %edx
callq 0x6490
movapd 0x10(%rsp), %xmm0
addsd 0x20(%rsp), %xmm0
xorpd 0x3ef5d(%rip), %xmm0    # 0x5d030
leaq 0x70(%rsp), %rdi
callq 0x6690
leaq 0x425d1(%rip), %rsi     # 0x606b5
movl $0x1, %edx
movq %rax, %rdi
callq 0x6490
leaq 0x78(%rsp), %rsi
leaq 0x38(%rsp), %rdi
callq 0x6670
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq 0x57ed7(%rip), %rdi     # 0x75fe8
callq 0x6490
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1e131
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x6410
movq 0x57e60(%rip), %rsi     # 0x75f98
leaq 0x70(%rsp), %rdi
callq 0x61e0
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 0x1e190
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x6410
jmp 0x1e190
jmp 0x1e18d
jmp 0x1e18d
jmp 0x1e18d
jmp 0x1e18d
jmp 0x1e18d
jmp 0x1e18d
movq %rax, %rbx
movq 0x57e01(%rip), %rsi     # 0x75f98
leaq 0x70(%rsp), %rdi
callq 0x61e0
leaq 0xe0(%rsp), %rdi
callq 0x60f0
movq %rbx, %rdi
callq 0x6760