// File: ATOMIC-LICHESS[P]ATOMKRAFT/position.cpp
// Function: Position::print(Move) const
void Position::print(Move move) const {

  const char* dottedLine = "\n+---+---+---+---+---+---+---+---+\n";

  if (move)
  {
      Position p(*this, thread());
      string dd = (color_of_piece_on(move_from(move)) == BLACK ? ".." : "");
      cout << "\nMove is: " << dd << move_to_san(p, move);
  }

  for (Rank rank = RANK_8; rank >= RANK_1; rank--)
  {
      cout << dottedLine << '|';
      for (File file = FILE_A; file <= FILE_H; file++)
      {
          Square sq = make_square(file, rank);
          Piece piece = piece_on(sq);

          if (piece == PIECE_NONE && square_color(sq) == DARK)
              piece = PIECE_NONE_DARK_SQ;

          char c = (color_of_piece_on(sq) == BLACK ? '=' : ' ');
          cout << c << pieceLetters.from_piece(piece) << c << '|';
      }
  }
  cout << dottedLine << "Fen is: " << to_fen() << "\nKey is: " << st->key << endl;
}

// Assembly:
subq $0x1a48, %rsp           # imm = 0x1A48
movq %rdi, 0x1a40(%rsp)
movl %esi, 0x1a3c(%rsp)
movq 0x1a40(%rsp), %rax
movq %rax, 0x58(%rsp)
leaq 0x22c34(%rip), %rax     # 0x5b1ee
movq %rax, 0x1a30(%rsp)
cmpl $0x0, 0x1a3c(%rsp)
je 0x38748
movq 0x58(%rsp), %rdi
callq 0x297f0
movq 0x58(%rsp), %rsi
movl %eax, %edx
leaq 0xf0(%rsp), %rdi
callq 0x36460
movl 0x1a3c(%rsp), %edi
callq 0xf680
movq 0x58(%rsp), %rdi
movl %eax, %esi
callq 0x3df80
subl $0x1, %eax
leaq 0x22c02(%rip), %rcx     # 0x5b212
leaq 0x1ec1d(%rip), %rax     # 0x57234
cmoveq %rcx, %rax
movq %rax, 0x48(%rsp)
leaq 0xcf(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0x6980
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
leaq 0xd0(%rsp), %rdi
callq 0x12070
jmp 0x3864b
leaq 0xcf(%rsp), %rdi
callq 0x6550
movq 0x33959(%rip), %rdi     # 0x6bfb8
leaq 0x22baf(%rip), %rsi     # 0x5b215
callq 0x64b0
movq %rax, 0x40(%rsp)
jmp 0x38672
movq 0x40(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x6420
movq %rax, 0x38(%rsp)
jmp 0x3868b
movl 0x1a3c(%rsp), %edx
leaq 0x98(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x2cee0
jmp 0x386a9
movq 0x38(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x6420
jmp 0x386bd
leaq 0x98(%rsp), %rdi
callq 0x6a78
leaq 0xd0(%rsp), %rdi
callq 0x6a78
jmp 0x38748
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
leaq 0xcf(%rsp), %rdi
callq 0x6550
jmp 0x38976
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
jmp 0x38736
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
leaq 0x98(%rsp), %rdi
callq 0x6a78
leaq 0xd0(%rsp), %rdi
callq 0x6a78
jmp 0x38976
movl $0x7, 0x94(%rsp)
cmpl $0x0, 0x94(%rsp)
jl 0x388aa
movq 0x1a30(%rsp), %rsi
movq 0x33848(%rip), %rdi     # 0x6bfb8
callq 0x64b0
movq %rax, %rdi
movl $0x7c, %esi
callq 0x65d0
movl $0x0, 0x90(%rsp)
cmpl $0x7, 0x90(%rsp)
jg 0x38894
movl 0x90(%rsp), %edi
movl 0x94(%rsp), %esi
callq 0xd740
movq 0x58(%rsp), %rdi
movl %eax, 0x8c(%rsp)
movl 0x8c(%rsp), %esi
callq 0xf530
movl %eax, 0x88(%rsp)
cmpl $0x10, 0x88(%rsp)
jne 0x387f3
movl 0x8c(%rsp), %edi
callq 0x3e1b0
cmpl $0x0, %eax
jne 0x387f3
movl $0x0, 0x88(%rsp)
movq 0x58(%rsp), %rdi
movl 0x8c(%rsp), %esi
callq 0x3df80
movl %eax, %ecx
movb $0x3d, %al
movb $0x20, %dl
movb %dl, 0x36(%rsp)
cmpl $0x1, %ecx
movb %al, 0x37(%rsp)
je 0x3881f
movb 0x36(%rsp), %al
movb %al, 0x37(%rsp)
movb 0x37(%rsp), %al
movb %al, 0x87(%rsp)
movq 0x33787(%rip), %rdi     # 0x6bfb8
movsbl 0x87(%rsp), %esi
callq 0x65d0
movq %rax, 0x28(%rsp)
movl 0x88(%rsp), %esi
leaq 0x3b2c47(%rip), %rdi    # 0x3eb498
callq 0x384f0
movq 0x28(%rsp), %rdi
movsbl %al, %esi
callq 0x65d0
movq %rax, %rdi
movsbl 0x87(%rsp), %esi
callq 0x65d0
movq %rax, %rdi
movl $0x7c, %esi
callq 0x65d0
leaq 0x90(%rsp), %rdi
xorl %esi, %esi
callq 0xe560
jmp 0x3878d
jmp 0x38896
leaq 0x94(%rsp), %rdi
xorl %esi, %esi
callq 0xe590
jmp 0x38753
movq 0x1a30(%rsp), %rsi
movq 0x336ff(%rip), %rdi     # 0x6bfb8
callq 0x64b0
movq %rax, %rdi
leaq 0x22958(%rip), %rsi     # 0x5b220
callq 0x64b0
movq 0x58(%rsp), %rsi
movq %rax, 0x10(%rsp)
leaq 0x60(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x37f70
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x6420
movq %rax, 0x20(%rsp)
jmp 0x388fc
movq 0x20(%rsp), %rdi
leaq 0x22921(%rip), %rsi     # 0x5b229
callq 0x64b0
movq %rax, 0x8(%rsp)
jmp 0x38914
movq 0x8(%rsp), %rdi
movq 0x58(%rsp), %rax
movq 0x1938(%rax), %rax
movq 0x38(%rax), %rsi
callq 0x6120
movq %rax, (%rsp)
jmp 0x38934
movq (%rsp), %rdi
movq 0x33651(%rip), %rsi     # 0x6bf90
callq 0x6520
jmp 0x38946
leaq 0x60(%rsp), %rdi
callq 0x6a78
addq $0x1a48, %rsp           # imm = 0x1A48
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x6a78
movq 0xc0(%rsp), %rdi
callq 0x6970
nopw %cs:(%rax,%rax)