// File: /workspace/github_cpp_makefile_star2_O2/ATOMIC-LICHESS[P]ATOMKRAFT/move.cpp
// Function: pretty_pv[abi:cxx11](Position&, int, Value, int, Move*)
const string pretty_pv(Position& pos, int depth, Value score, int time, Move pv[]) {

  const int64_t K = 1000;
  const int64_t M = 1000000;
  const int startColumn = 28;
  const size_t maxLength = 80 - startColumn;
  const string lf = string("\n") + string(startColumn, ' ');

  StateInfo state[PLY_MAX_PLUS_2], *st = state;
  Move* m = pv;
  string san;
  std::stringstream s;
  size_t length = 0;

  // First print depth, score, time and searched nodes...
  s << std::setw(2) << depth
    << std::setw(8) << score_string(score)
    << std::setw(8) << time_string(time);

  if (pos.nodes_searched() < M)
      s << std::setw(8) << pos.nodes_searched() / 1 << "  ";
  else if (pos.nodes_searched() < K * M)
      s << std::setw(7) << pos.nodes_searched() / K << "K  ";
  else
      s << std::setw(7) << pos.nodes_searched() / M << "M  ";

  // ...then print the full PV line in short algebraic notation
  while (*m != MOVE_NONE)
  {
      san = move_to_san(pos, *m);
      length += san.length() + 1;

      if (length > maxLength)
      {
          length = san.length() + 1;
          s << lf;
      }
      s << san << ' ';

      pos.do_move(*m++, *st++);
  }

  // Restore original position before to leave
  while (m != pv) pos.undo_move(*--m);

  return s.str();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4378, %rsp           # imm = 0x4378
movq %r9, 0x10(%rsp)
movl %r8d, %r14d
movl %ecx, %ebx
movl %edx, %ebp
movq %rsi, 0x8(%rsp)
movq %rdi, 0x18(%rsp)
leaq 0x16014(%rip), %rsi     # 0x29a9d
leaq 0x3b0(%rsp), %rdi
leaq 0x228(%rsp), %rdx
callq 0x9c42
leaq 0xb0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0xa0(%rsp), %rdi
pushq $0x1c
popq %rsi
pushq $0x20
popq %rdx
callq 0x5440
leaq 0x80(%rsp), %rdi
leaq 0x3b0(%rsp), %rsi
leaq 0xa0(%rsp), %rdx
callq 0xd198
leaq 0xa0(%rsp), %rdi
callq 0x5858
leaq 0x3b0(%rsp), %r12
movq %r12, %rdi
callq 0x5858
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x228(%rsp), %rdi
callq 0x5280
leaq 0x238(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0x2, 0x248(%rsp,%rax)
movl %ebp, %esi
callq 0x5760
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rax
movq $0x8, 0x10(%rbp,%rax)
leaq 0xa0(%rsp), %rdi
callq 0x5280
leaq 0xb0(%rsp), %rdi
cmpl $0x7468, %ebx           # imm = 0x7468
jge 0x13bca
cmpl $0xffff8b98, %ebx       # imm = 0xFFFF8B98
jle 0x13be2
movq 0xb0(%rsp), %rax
movq -0x18(%rax), %rcx
movq $0x2, 0xb8(%rsp,%rcx)
movq -0x18(%rax), %rcx
movl $0xfffffefb, %edx       # imm = 0xFFFFFEFB
andl 0xc8(%rsp,%rcx), %edx
orl $0x4, %edx
movl %edx, 0xc8(%rsp,%rcx)
movq -0x18(%rax), %rax
orl $0x800, 0xc8(%rsp,%rax) # imm = 0x800
cvtsi2ss %ebx, %xmm0
leaq 0x2188d(%rip), %rax     # 0x35448
cvtsi2ssl (%rax), %xmm1
divss %xmm1, %xmm0
callq 0x52c0
jmp 0x13c06
leaq 0x15a0a(%rip), %rsi     # 0x295db
callq 0x53b0
movq %rax, %rdi
movl $0x7531, %eax           # imm = 0x7531
subl %ebx, %eax
jmp 0x13bf9
leaq 0x159f1(%rip), %rsi     # 0x295da
callq 0x53b0
movq %rax, %rdi
addl $0x7530, %ebx           # imm = 0x7530
movl %ebx, %eax
pushq $0x2
popq %rcx
cltd
idivl %ecx
movl %eax, %esi
callq 0x5760
leaq 0xb8(%rsp), %rsi
leaq 0x60(%rsp), %rdi
callq 0x5670
leaq 0xa0(%rsp), %rdi
callq 0x5860
leaq 0x60(%rsp), %rsi
movq %rbp, %rdi
callq 0x5340
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rax
movq $0x8, 0x10(%rbx,%rax)
movl $0x36ee80, %ecx         # imm = 0x36EE80
movl %r14d, %eax
cltd
idivl %ecx
movl %eax, %ebp
movl %edx, %eax
movl $0xea60, %ecx           # imm = 0xEA60
cltd
idivl %ecx
movl %eax, %r13d
movl %edx, %eax
movl $0x3e8, %ecx            # imm = 0x3E8
cltd
idivl %ecx
movl %eax, %r15d
leaq 0xa0(%rsp), %rdi
callq 0x5280
addl $0x36ee7f, %r14d        # imm = 0x36EE7F
cmpl $0x6ddcff, %r14d        # imm = 0x6DDCFF
jb 0x13ca3
leaq 0xb0(%rsp), %rdi
movl %ebp, %esi
callq 0x5760
pushq $0x3a
popq %rsi
movq %rax, %rdi
callq 0x5450
leaq 0xb0(%rsp), %rdi
pushq $0x30
popq %rsi
callq 0x5650
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0x2, 0x10(%rax,%rcx)
movq %rax, %rdi
movl %r13d, %esi
callq 0x5760
pushq $0x3a
popq %rsi
movq %rax, %rdi
callq 0x5450
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0x2, 0x10(%rax,%rcx)
movq %rax, %rdi
movl %r15d, %esi
callq 0x5760
leaq 0xb8(%rsp), %rsi
leaq 0x40(%rsp), %rdi
callq 0x5670
leaq 0xa0(%rsp), %rdi
callq 0x5860
leaq 0x40(%rsp), %rsi
movq %rbx, %rdi
callq 0x5340
leaq 0x40(%rsp), %rdi
callq 0x5858
leaq 0x60(%rsp), %rdi
callq 0x5858
movq 0x8(%rsp), %rax
movq 0x1930(%rax), %rax
cmpq $0xf423f, %rax          # imm = 0xF423F
jg 0x13d79
movq 0x238(%rsp), %rcx
movq -0x18(%rcx), %rcx
movq $0x8, 0x248(%rsp,%rcx)
leaq 0x238(%rsp), %rdi
movq %rax, %rsi
callq 0x5380
leaq 0x147e8(%rip), %rsi     # 0x2855f
jmp 0x13ddc
movq 0x238(%rsp), %rcx
movq -0x18(%rcx), %rcx
movq $0x7, 0x248(%rsp,%rcx)
cmpq $0x3b9ac9ff, %rax       # imm = 0x3B9AC9FF
ja 0x13dbb
movl $0x3e8, %ecx            # imm = 0x3E8
xorl %edx, %edx
divl %ecx
leaq 0x238(%rsp), %rdi
movq %rax, %rsi
callq 0x5380
leaq 0x15819(%rip), %rsi     # 0x295d2
jmp 0x13ddc
movl $0xf4240, %ecx          # imm = 0xF4240
xorl %edx, %edx
divq %rcx
leaq 0x238(%rsp), %rdi
movq %rax, %rsi
callq 0x5380
leaq 0x157fa(%rip), %rsi     # 0x295d6
movq %rax, %rdi
callq 0x53b0
xorl %r13d, %r13d
leaq 0xa0(%rsp), %rbx
leaq 0x20(%rsp), %rbp
xorl %r15d, %r15d
movq 0x10(%rsp), %rax
movl (%rax,%r13), %edx
testl %edx, %edx
je 0x13eb1
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
callq 0x136d4
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x5200
movq %rbx, %rdi
callq 0x5858
movq 0x28(%rsp), %r14
addq %r14, %r15
incq %r15
cmpq $0x35, %r15
jb 0x13e54
leaq 0x238(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x5340
incq %r14
movq %r14, %r15
leaq 0x238(%rsp), %rdi
movq %rbp, %rsi
callq 0x5340
movq %rax, %rdi
pushq $0x20
popq %rsi
callq 0x5450
movq 0x10(%rsp), %rax
movl (%rax,%r13), %esi
leaq 0xa0(%r12), %r14
addq $0x4, %r13
movq 0x8(%rsp), %rdi
movq %r12, %rdx
callq 0x19114
movq %r14, %r12
jmp 0x13df7
movq 0x10(%rsp), %rax
movl -0x4(%rax,%r13), %esi
addq $-0x4, %r13
movq 0x8(%rsp), %rdi
callq 0x1a056
testq %r13, %r13
jne 0x13e99
leaq 0x240(%rsp), %rsi
movq 0x18(%rsp), %rdi
callq 0x5670
leaq 0x228(%rsp), %rdi
callq 0x5860
leaq 0x20(%rsp), %rdi
callq 0x5858
leaq 0x80(%rsp), %rdi
callq 0x5858
movq 0x18(%rsp), %rax
addq $0x4378, %rsp           # imm = 0x4378
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x5858
jmp 0x13f68
jmp 0x13f14
movq %rax, %rbx
jmp 0x13f68
jmp 0x13f85
movq %rax, %rbx
jmp 0x13f95
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x5858
jmp 0x13f35
movq %rax, %rbx
leaq 0x3b0(%rsp), %rdi
jmp 0x13fa7
movq %rax, %rbx
jmp 0x13fac
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x5860
jmp 0x13f88
jmp 0x13f85
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x5860
leaq 0x60(%rsp), %rdi
jmp 0x13f7e
jmp 0x13f85
jmp 0x13f85
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x5858
jmp 0x13f88
movq %rax, %rbx
leaq 0x228(%rsp), %rdi
callq 0x5860
leaq 0x20(%rsp), %rdi
callq 0x5858
leaq 0x80(%rsp), %rdi
callq 0x5858
movq %rbx, %rdi
callq 0x5780