// File: antoniogarro[P]Hara/tree.cpp
// Function: Tree::print() const
void Tree::print() const
{
  int threshold = root[active]->get_visits()/30;
  std::string sp = "  ";
  std::cerr << "Active tree: " << active << " " << get_size() <<" nodes.\n";
  print(root[active], threshold, 0);

  Node *best = get_best();
  std::cerr << "#Expected: " << best->get_value(1) << ", visits "
            << best->get_visits() << " PV:\n";

  bool side = !goban->get_side();
  for (Node *n = root[active]->get_best_child(); n; n = n->get_best_child()) {
      side ? std::cerr << "B" :  std::cerr << "W";
      n->print(goban->get_size());
      side = !side;
  }
  std::cerr << "\n";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
movslq 0x1c(%rax), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x4700
movsd 0x18d4(%rip), %xmm1     # 0x147e0
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0xc(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x68(%rbp)
callq 0x3420
movq -0x68(%rbp), %rdx
leaq 0x1565(%rip), %rsi      # 0x14494
leaq -0x30(%rbp), %rdi
callq 0xa590
jmp 0x12f3a
leaq -0x31(%rbp), %rdi
callq 0x32c0
movq 0x80a6(%rip), %rdi      # 0x1aff0
leaq 0x18cb(%rip), %rsi      # 0x1481c
callq 0x3270
movq %rax, -0x78(%rbp)
jmp 0x12f5c
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rax
movl 0x1c(%rax), %esi
callq 0x3400
movq %rax, -0x80(%rbp)
jmp 0x12f72
movq -0x80(%rbp), %rdi
leaq 0x1518(%rip), %rsi      # 0x14495
callq 0x3270
movq %rax, -0x88(%rbp)
jmp 0x12f8b
movq -0x70(%rbp), %rdi
callq 0x13370
movl %eax, -0x8c(%rbp)
jmp 0x12f9c
movl -0x8c(%rbp), %esi
movq -0x88(%rbp), %rdi
callq 0x3400
movq %rax, -0x98(%rbp)
jmp 0x12fb7
movq -0x98(%rbp), %rdi
leaq 0x1865(%rip), %rsi      # 0x1482a
callq 0x3270
jmp 0x12fcc
movq -0x70(%rbp), %rdi
movslq 0x1c(%rdi), %rax
movq (%rdi,%rax,8), %rsi
movl -0xc(%rbp), %edx
xorl %ecx, %ecx
callq 0x12cc0
jmp 0x12fe4
movq -0x70(%rbp), %rdi
callq 0x4750
movq %rax, -0xa0(%rbp)
jmp 0x12ff6
movq -0xa0(%rbp), %rax
movq %rax, -0x50(%rbp)
movq 0x7fe8(%rip), %rdi      # 0x1aff0
leaq 0x1824(%rip), %rsi      # 0x14833
callq 0x3270
movq %rax, -0xa8(%rbp)
jmp 0x1301d
movq -0x50(%rbp), %rdi
movsd 0xff7(%rip), %xmm0      # 0x14020
callq 0x11fe0
movq -0xa8(%rbp), %rdi
callq 0x3460
movq %rax, -0xb0(%rbp)
jmp 0x13043
movq -0xb0(%rbp), %rdi
leaq 0x17ee(%rip), %rsi      # 0x1483f
callq 0x3270
movq %rax, -0xb8(%rbp)
jmp 0x1305f
movq -0x50(%rbp), %rdi
callq 0x4700
movsd %xmm0, -0xc0(%rbp)
jmp 0x13072
movsd -0xc0(%rbp), %xmm0
movq -0xb8(%rbp), %rdi
callq 0x3460
movq %rax, -0xc8(%rbp)
jmp 0x1308f
movq -0xc8(%rbp), %rdi
leaq 0x17ac(%rip), %rsi      # 0x14849
callq 0x3270
jmp 0x130a4
movq -0x70(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x45e0
movb %al, -0xc9(%rbp)
jmp 0x130b9
movq -0x70(%rbp), %rax
movb -0xc9(%rbp), %cl
xorb $-0x1, %cl
andb $0x1, %cl
movb %cl, -0x51(%rbp)
movslq 0x1c(%rax), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x121c0
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
je 0x1319a
testb $0x1, -0x51(%rbp)
je 0x13105
movq 0x7efb(%rip), %rdi      # 0x1aff0
leaq 0x1753(%rip), %rsi      # 0x1484f
callq 0x3270
jmp 0x13103
jmp 0x1311c
movq 0x7ee4(%rip), %rdi      # 0x1aff0
leaq 0x173e(%rip), %rsi      # 0x14851
callq 0x3270
jmp 0x1311a
jmp 0x1311c
movq -0x70(%rbp), %rax
movq -0x60(%rbp), %rcx
movq %rcx, -0xd8(%rbp)
movq 0x20(%rax), %rdi
callq 0x4530
movl %eax, -0xd0(%rbp)
jmp 0x1313c
movl -0xd0(%rbp), %esi
movq -0xd8(%rbp), %rdi
callq 0x12240
jmp 0x13150
movb -0x51(%rbp), %al
xorb $-0x1, %al
andb $0x1, %al
movb %al, -0x51(%rbp)
movq -0x60(%rbp), %rdi
callq 0x121c0
movq %rax, -0x60(%rbp)
jmp 0x130dd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x32c0
jmp 0x131c1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x3160
jmp 0x131c1
movq 0x7e4f(%rip), %rdi      # 0x1aff0
leaq 0x147c(%rip), %rsi      # 0x14624
callq 0x3270
jmp 0x131af
leaq -0x30(%rbp), %rdi
callq 0x3160
addq $0xe0, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x3410
nopw (%rax,%rax)