// File: /workspace/github_cpp_makefile_star2_O3/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, %ebp
movl %edx, 0x8(%rsp)
movq %rsi, %r15
movq %rdi, 0x38(%rsp)
leaq 0x3c0(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x1a96a(%rip), %rsi     # 0x32c0d
leaq 0x1a964(%rip), %rdx     # 0x32c0e
leaq 0x3b0(%rsp), %r12
movq %r12, %rdi
callq 0xad16
leaq 0xb0(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0xa0(%rsp), %rdi
movl $0x1c, %esi
movl $0x20, %edx
callq 0x5480
movq 0x3b0(%rsp), %rcx
movq 0x3b8(%rsp), %r8
movq 0xa8(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %r13, %rcx
je 0x1830b
movq 0x3c0(%rsp), %rdi
movq 0xa0(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x1832f
movl $0xf, %edi
cmpq %rbx, %rsi
je 0x1832a
movq 0xb0(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x1833e
leaq 0x3b0(%rsp), %rdi
callq 0x5130
jmp 0x1834f
leaq 0xa0(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5450
leaq 0x28(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x18373
movq %rsi, 0x18(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x28(%rsp)
jmp 0x18379
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x20(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq 0xa0(%rsp), %rdi
cmpq %rbx, %rdi
je 0x183b3
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x5400
movq 0x3b0(%rsp), %rdi
cmpq %r13, %rdi
je 0x183d0
movq 0x3c0(%rsp), %rsi
incq %rsi
callq 0x5400
leaq 0x50(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x228(%rsp), %rdi
callq 0x5290
movl %ebp, %r13d
leaq 0x238(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0x2, 0x248(%rsp,%rax)
movl 0x8(%rsp), %esi
callq 0x5760
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rax
movq $0x8, 0x10(%rbp,%rax)
leaq 0xa0(%rsp), %rdi
callq 0x5290
cmpl $0x7468, %r13d          # imm = 0x7468
jge 0x184bc
leaq 0xb0(%rsp), %rbx
cmpl $0xffff8b98, %r13d      # imm = 0xFFFF8B98
jle 0x184da
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
xorps %xmm0, %xmm0
cvtsi2ss %r13d, %xmm0
leaq 0x24fa2(%rip), %rax     # 0x3d448
cvtsi2ssl (%rax), %xmm1
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x56b0
jmp 0x18509
leaq 0x1a288(%rip), %rsi     # 0x3274b
movl $0x1, %edx
movq %rbx, %rdi
callq 0x5460
movl $0x7531, %eax           # imm = 0x7531
subl %r13d, %eax
jmp 0x184f8
leaq 0x1a269(%rip), %rsi     # 0x3274a
movl $0x2, %edx
movq %rbx, %rdi
callq 0x5460
addl $0x7530, %r13d          # imm = 0x7530
movl %r13d, %eax
movl %eax, %esi
shrl $0x1f, %esi
addl %eax, %esi
sarl %esi
movq %rbx, %rdi
callq 0x5760
leaq 0xb8(%rsp), %rsi
leaq 0x80(%rsp), %rdi
callq 0x5690
movq 0x24a13(%rip), %rsi     # 0x3cf38
leaq 0xa0(%rsp), %rdi
callq 0x52c0
leaq 0x120(%rsp), %rdi
callq 0x5140
movq 0x80(%rsp), %rsi
movq 0x88(%rsp), %rdx
movq %rbp, %rdi
callq 0x5460
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rax
movq $0x8, 0x10(%rbx,%rax)
leaq 0xa0(%rsp), %rdi
callq 0x5290
movq %rbx, 0x8(%rsp)
movslq %r14d, %rax
imulq $0x4a90be59, %rax, %rbx # imm = 0x4A90BE59
movq %rbx, %rax
shrq $0x3f, %rax
sarq $0x34, %rbx
addl %eax, %ebx
leal 0x36ee7f(%r14), %eax
cmpl $0x6ddcff, %eax         # imm = 0x6DDCFF
jb 0x185c5
leaq 0xb0(%rsp), %rdi
movl %ebx, %esi
callq 0x5760
leaq 0x7(%rsp), %rsi
movb $0x3a, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x5460
movq 0xb0(%rsp), %rax
movq -0x18(%rax), %rcx
leaq (%rsp,%rcx), %rbp
addq $0xb0, %rbp
cmpb $0x0, 0xe1(%rbp)
jne 0x18601
movq %rbp, %rdi
movl $0x20, %esi
callq 0x53c0
movb $0x1, 0xe1(%rbp)
movq 0xb0(%rsp), %rax
imull $0x36ee80, %ebx, %ecx   # imm = 0x36EE80
subl %ecx, %r14d
movslq %r14d, %rcx
imulq $0x45e7b273, %rcx, %r13 # imm = 0x45E7B273
movq %r13, %rcx
shrq $0x3f, %rcx
sarq $0x2e, %r13
addl %ecx, %r13d
leaq 0xb0(%rsp), %rdi
movb $0x30, 0xe0(%rbp)
movq -0x18(%rax), %rax
movq $0x2, 0xc0(%rsp,%rax)
movl %r13d, %esi
callq 0x5760
leaq 0x7(%rsp), %rsi
movb $0x3a, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x5460
imull $0xea60, %r13d, %ecx    # imm = 0xEA60
subl %ecx, %r14d
movslq %r14d, %rcx
imulq $0x10624dd3, %rcx, %rsi # imm = 0x10624DD3
movq %rsi, %rcx
shrq $0x3f, %rcx
sarq $0x26, %rsi
addl %ecx, %esi
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0x2, 0x10(%rax,%rcx)
movq %rax, %rdi
callq 0x5760
leaq 0xb8(%rsp), %rsi
leaq 0x60(%rsp), %rdi
callq 0x5690
movq 0x24888(%rip), %rsi     # 0x3cf38
leaq 0xa0(%rsp), %rdi
callq 0x52c0
leaq 0x120(%rsp), %rdi
callq 0x5140
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
movq 0x8(%rsp), %rdi
callq 0x5460
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x186f9
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x5400
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1871a
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x5400
movq 0x1930(%r15), %rsi
cmpq $0xf423f, %rsi          # imm = 0xF423F
jg 0x1875d
movq 0x238(%rsp), %rax
movq -0x18(%rax), %rax
movq $0x8, 0x248(%rsp,%rax)
leaq 0x238(%rsp), %rdi
callq 0x5390
movl $0x2, %edx
leaq 0x18f64(%rip), %rsi     # 0x316bf
jmp 0x187d6
movq 0x238(%rsp), %rax
movq -0x18(%rax), %rax
movq $0x7, 0x248(%rsp,%rax)
cmpq $0x3b9ac9ff, %rsi       # imm = 0x3B9AC9FF
ja 0x187a6
movl %esi, %eax
imulq $0x10624dd3, %rax, %rsi # imm = 0x10624DD3
shrq $0x26, %rsi
leaq 0x238(%rsp), %rdi
callq 0x5390
movl $0x3, %edx
leaq 0x19f9e(%rip), %rsi     # 0x32742
jmp 0x187d6
movabsq $0x431bde82d7b634db, %rcx # imm = 0x431BDE82D7B634DB
movq %rsi, %rax
mulq %rcx
shrq $0x12, %rdx
leaq 0x238(%rsp), %rdi
movq %rdx, %rsi
callq 0x5390
movl $0x3, %edx
leaq 0x19f70(%rip), %rsi     # 0x32746
movq %rax, %rdi
callq 0x5460
xorl %r13d, %r13d
leaq 0xa0(%rsp), %rbp
xorl %r14d, %r14d
movq 0x10(%rsp), %rax
movl (%rax,%r13), %edx
testl %edx, %edx
je 0x188d8
movq %rbp, %rdi
movq %r15, %rsi
callq 0x17df0
leaq 0x40(%rsp), %rdi
movq %rbp, %rsi
callq 0x5200
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x1883a
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x5400
movq 0x48(%rsp), %rbx
addq %rbx, %r14
incq %r14
cmpq $0x35, %r14
jb 0x1886d
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
leaq 0x238(%rsp), %rdi
callq 0x5460
movq %rbx, %r14
incq %r14
movq 0x48(%rsp), %rbx
movq 0x40(%rsp), %rsi
leaq 0x238(%rsp), %rdi
movq %rbx, %rdx
callq 0x5460
movb $0x20, 0xa0(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x5460
movq 0x10(%rsp), %rax
movl (%rax,%r13), %esi
leaq 0xa0(%r12), %rbx
addq $0x4, %r13
movq %r15, %rdi
movq %r12, %rdx
callq 0x1f3d6
movq %rbx, %r12
jmp 0x187ec
movq 0x10(%rsp), %rax
movl -0x4(%rax,%r13), %esi
addq $-0x4, %r13
movq %r15, %rdi
callq 0x2051a
testq %r13, %r13
jne 0x188c2
leaq 0x240(%rsp), %rsi
movq 0x38(%rsp), %rdi
callq 0x5690
movq 0x24642(%rip), %rsi     # 0x3cf38
leaq 0x228(%rsp), %rdi
callq 0x52c0
leaq 0x2a8(%rsp), %rdi
callq 0x5140
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x1892c
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x5400
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x18947
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x5400
movq 0x38(%rsp), %rax
addq $0x4378, %rsp           # imm = 0x4378
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x18a33
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x5400
jmp 0x18a33
jmp 0x18987
movq %rax, %r14
jmp 0x18a33
jmp 0x18a7c
movq %rax, %r14
jmp 0x18aa0
movq %rax, %r14
movq 0xa0(%rsp), %rdi
cmpq %rbx, %rdi
je 0x189c1
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x5400
jmp 0x189c1
movq %rax, %r14
movq 0x3b0(%rsp), %rdi
cmpq %r13, %rdi
je 0x18ad7
movq 0x3c0(%rsp), %rsi
jmp 0x18acf
movq %rax, %r14
jmp 0x18ad7
movq %rax, %r14
movq 0x24547(%rip), %rsi     # 0x3cf38
leaq 0xa0(%rsp), %rdi
callq 0x52c0
leaq 0x120(%rsp), %rdi
callq 0x5140
jmp 0x18a7f
jmp 0x18a7c
movq %rax, %r14
movq 0x2451f(%rip), %rsi     # 0x3cf38
leaq 0xa0(%rsp), %rdi
callq 0x52c0
leaq 0x120(%rsp), %rdi
callq 0x5140
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x18a7f
movq 0x90(%rsp), %rsi
jmp 0x18a72
jmp 0x18a7c
jmp 0x18a7c
movq %rax, %r14
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x18a7f
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x5400
jmp 0x18a7f
movq %rax, %r14
movq 0x244b2(%rip), %rsi     # 0x3cf38
leaq 0x228(%rsp), %rdi
callq 0x52c0
leaq 0x2a8(%rsp), %rdi
callq 0x5140
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x18abc
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x5400
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x18ad7
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x5400
movq %r14, %rdi
callq 0x5790