// File: niekh1234[P]nnchesslib/board.cpp
// Function: nnchesslib::ChessBoard::print()
void ChessBoard::print()
{
    std::string output;
    std::string finalOutput;

    BitBoard occupied = boardinfo.whitePieces.board | boardinfo.blackPieces.board;
    for(int i = 0; i <= 63; i++)
    {
        if(occupied.get(i))
        {
            if(BitBoard(boardinfo.pawns.board & boardinfo.whitePieces.board).get(i)) output+=" P ";
            if(BitBoard(boardinfo.knights.board & boardinfo.whitePieces.board).get(i)) output+=" N ";
            if(BitBoard(boardinfo.bishops.board & boardinfo.whitePieces.board).get(i)) output+=" B ";
            if(BitBoard(boardinfo.rooks.board & boardinfo.whitePieces.board).get(i)) output+=" R ";
            if(BitBoard(boardinfo.queens.board & boardinfo.whitePieces.board).get(i)) output+=" Q ";
            if(BitBoard(boardinfo.kings.board & boardinfo.whitePieces.board).get(i)) output+=" K ";
            if(BitBoard(boardinfo.pawns.board & boardinfo.blackPieces.board).get(i)) output+=" p ";
            if(BitBoard(boardinfo.knights.board & boardinfo.blackPieces.board).get(i)) output+=" n ";
            if(BitBoard(boardinfo.bishops.board & boardinfo.blackPieces.board).get(i)) output+=" b ";
            if(BitBoard(boardinfo.rooks.board & boardinfo.blackPieces.board).get(i)) output+=" r ";
            if(BitBoard(boardinfo.queens.board & boardinfo.blackPieces.board).get(i)) output+=" q ";
            if(BitBoard(boardinfo.kings.board & boardinfo.blackPieces.board).get(i)) output+=" k ";
        } 
        else
        {
            output+=" . ";
        }
        if((i + 1) % 8 == 0){
            finalOutput.insert(0, output + "\n");
            output = "";
        }
    }

    finalOutput.insert(0, " -  -  -  -  -  -  -  - \n");
    finalOutput+=" -  -  -  -  -  -  -  - ";
    std::cout<<finalOutput<<std::endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xe8(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x3350
leaq -0x48(%rbp), %rdi
callq 0x3350
movq -0xe8(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rax
orq %rax, %rsi
leaq -0x50(%rbp), %rdi
callq 0x4bc0
jmp 0x7188
movl $0x0, -0x60(%rbp)
cmpl $0x3f, -0x60(%rbp)
jg 0x765c
movl -0x60(%rbp), %esi
leaq -0x50(%rbp), %rdi
callq 0x4ce0
movl %eax, -0xec(%rbp)
jmp 0x71ad
movl -0xec(%rbp), %eax
cmpl $0x0, %eax
je 0x75b9
movq -0xe8(%rbp), %rcx
movq (%rcx), %rax
movq 0x10(%rcx), %rsi
andq %rax, %rsi
leaq -0x68(%rbp), %rdi
callq 0x4bc0
jmp 0x71d8
movl -0x60(%rbp), %esi
leaq -0x68(%rbp), %rdi
callq 0x4ce0
movl %eax, -0xf0(%rbp)
jmp 0x71ec
movl -0xf0(%rbp), %eax
cmpl $0x0, %eax
je 0x721c
leaq 0x76a4(%rip), %rsi      # 0xe8a2
leaq -0x28(%rbp), %rdi
callq 0x3240
jmp 0x7209
jmp 0x721c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x76cd
movq -0xe8(%rbp), %rcx
movq (%rcx), %rax
movq 0x18(%rcx), %rsi
andq %rax, %rsi
leaq -0x70(%rbp), %rdi
callq 0x4bc0
jmp 0x7238
movl -0x60(%rbp), %esi
leaq -0x70(%rbp), %rdi
callq 0x4ce0
movl %eax, -0xf4(%rbp)
jmp 0x724c
movl -0xf4(%rbp), %eax
cmpl $0x0, %eax
je 0x726b
leaq 0x7648(%rip), %rsi      # 0xe8a6
leaq -0x28(%rbp), %rdi
callq 0x3240
jmp 0x7269
jmp 0x726b
movq -0xe8(%rbp), %rcx
movq (%rcx), %rax
movq 0x20(%rcx), %rsi
andq %rax, %rsi
leaq -0x78(%rbp), %rdi
callq 0x4bc0
jmp 0x7287
movl -0x60(%rbp), %esi
leaq -0x78(%rbp), %rdi
callq 0x4ce0
movl %eax, -0xf8(%rbp)
jmp 0x729b
movl -0xf8(%rbp), %eax
cmpl $0x0, %eax
je 0x72ba
leaq 0x75fd(%rip), %rsi      # 0xe8aa
leaq -0x28(%rbp), %rdi
callq 0x3240
jmp 0x72b8
jmp 0x72ba
movq -0xe8(%rbp), %rcx
movq (%rcx), %rax
movq 0x28(%rcx), %rsi
andq %rax, %rsi
leaq -0x80(%rbp), %rdi
callq 0x4bc0
jmp 0x72d6
movl -0x60(%rbp), %esi
leaq -0x80(%rbp), %rdi
callq 0x4ce0
movl %eax, -0xfc(%rbp)
jmp 0x72ea
movl -0xfc(%rbp), %eax
cmpl $0x0, %eax
je 0x7309
leaq 0x75b2(%rip), %rsi      # 0xe8ae
leaq -0x28(%rbp), %rdi
callq 0x3240
jmp 0x7307
jmp 0x7309
movq -0xe8(%rbp), %rcx
movq (%rcx), %rax
movq 0x30(%rcx), %rsi
andq %rax, %rsi
leaq -0x88(%rbp), %rdi
callq 0x4bc0
jmp 0x7328
movl -0x60(%rbp), %esi
leaq -0x88(%rbp), %rdi
callq 0x4ce0
movl %eax, -0x100(%rbp)
jmp 0x733f
movl -0x100(%rbp), %eax
cmpl $0x0, %eax
je 0x735e
leaq 0x7561(%rip), %rsi      # 0xe8b2
leaq -0x28(%rbp), %rdi
callq 0x3240
jmp 0x735c
jmp 0x735e
movq -0xe8(%rbp), %rcx
movq (%rcx), %rax
movq 0x38(%rcx), %rsi
andq %rax, %rsi
leaq -0x90(%rbp), %rdi
callq 0x4bc0
jmp 0x737d
movl -0x60(%rbp), %esi
leaq -0x90(%rbp), %rdi
callq 0x4ce0
movl %eax, -0x104(%rbp)
jmp 0x7394
movl -0x104(%rbp), %eax
cmpl $0x0, %eax
je 0x73b3
leaq 0x7510(%rip), %rsi      # 0xe8b6
leaq -0x28(%rbp), %rdi
callq 0x3240
jmp 0x73b1
jmp 0x73b3
movq -0xe8(%rbp), %rcx
movq 0x8(%rcx), %rax
movq 0x10(%rcx), %rsi
andq %rax, %rsi
leaq -0x98(%rbp), %rdi
callq 0x4bc0
jmp 0x73d3
movl -0x60(%rbp), %esi
leaq -0x98(%rbp), %rdi
callq 0x4ce0
movl %eax, -0x108(%rbp)
jmp 0x73ea
movl -0x108(%rbp), %eax
cmpl $0x0, %eax
je 0x7409
leaq 0x74be(%rip), %rsi      # 0xe8ba
leaq -0x28(%rbp), %rdi
callq 0x3240
jmp 0x7407
jmp 0x7409
movq -0xe8(%rbp), %rcx
movq 0x8(%rcx), %rax
movq 0x18(%rcx), %rsi
andq %rax, %rsi
leaq -0xa0(%rbp), %rdi
callq 0x4bc0
jmp 0x7429
movl -0x60(%rbp), %esi
leaq -0xa0(%rbp), %rdi
callq 0x4ce0
movl %eax, -0x10c(%rbp)
jmp 0x7440
movl -0x10c(%rbp), %eax
cmpl $0x0, %eax
je 0x745f
leaq 0x746c(%rip), %rsi      # 0xe8be
leaq -0x28(%rbp), %rdi
callq 0x3240
jmp 0x745d
jmp 0x745f
movq -0xe8(%rbp), %rcx
movq 0x8(%rcx), %rax
movq 0x20(%rcx), %rsi
andq %rax, %rsi
leaq -0xa8(%rbp), %rdi
callq 0x4bc0
jmp 0x747f
movl -0x60(%rbp), %esi
leaq -0xa8(%rbp), %rdi
callq 0x4ce0
movl %eax, -0x110(%rbp)
jmp 0x7496
movl -0x110(%rbp), %eax
cmpl $0x0, %eax
je 0x74b5
leaq 0x741a(%rip), %rsi      # 0xe8c2
leaq -0x28(%rbp), %rdi
callq 0x3240
jmp 0x74b3
jmp 0x74b5
movq -0xe8(%rbp), %rcx
movq 0x8(%rcx), %rax
movq 0x28(%rcx), %rsi
andq %rax, %rsi
leaq -0xb0(%rbp), %rdi
callq 0x4bc0
jmp 0x74d5
movl -0x60(%rbp), %esi
leaq -0xb0(%rbp), %rdi
callq 0x4ce0
movl %eax, -0x114(%rbp)
jmp 0x74ec
movl -0x114(%rbp), %eax
cmpl $0x0, %eax
je 0x750b
leaq 0x73c8(%rip), %rsi      # 0xe8c6
leaq -0x28(%rbp), %rdi
callq 0x3240
jmp 0x7509
jmp 0x750b
movq -0xe8(%rbp), %rcx
movq 0x8(%rcx), %rax
movq 0x30(%rcx), %rsi
andq %rax, %rsi
leaq -0xb8(%rbp), %rdi
callq 0x4bc0
jmp 0x752b
movl -0x60(%rbp), %esi
leaq -0xb8(%rbp), %rdi
callq 0x4ce0
movl %eax, -0x118(%rbp)
jmp 0x7542
movl -0x118(%rbp), %eax
cmpl $0x0, %eax
je 0x7561
leaq 0x7376(%rip), %rsi      # 0xe8ca
leaq -0x28(%rbp), %rdi
callq 0x3240
jmp 0x755f
jmp 0x7561
movq -0xe8(%rbp), %rcx
movq 0x8(%rcx), %rax
movq 0x38(%rcx), %rsi
andq %rax, %rsi
leaq -0xc0(%rbp), %rdi
callq 0x4bc0
jmp 0x7581
movl -0x60(%rbp), %esi
leaq -0xc0(%rbp), %rdi
callq 0x4ce0
movl %eax, -0x11c(%rbp)
jmp 0x7598
movl -0x11c(%rbp), %eax
cmpl $0x0, %eax
je 0x75b7
leaq 0x7324(%rip), %rsi      # 0xe8ce
leaq -0x28(%rbp), %rdi
callq 0x3240
jmp 0x75b5
jmp 0x75b7
jmp 0x75cd
leaq 0x7312(%rip), %rsi      # 0xe8d2
leaq -0x28(%rbp), %rdi
callq 0x3240
jmp 0x75cb
jmp 0x75cd
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl $0x8, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x764c
leaq 0x7307(%rip), %rdx      # 0xe8ee
leaq -0xe0(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x9c10
jmp 0x75f9
xorl %eax, %eax
movl %eax, %esi
leaq -0x48(%rbp), %rdi
leaq -0xe0(%rbp), %rdx
callq 0x33a0
jmp 0x760f
leaq -0xe0(%rbp), %rdi
callq 0x34a8
leaq 0x72cd(%rip), %rsi      # 0xe8ef
leaq -0x28(%rbp), %rdi
callq 0x3340
jmp 0x762d
jmp 0x764c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x34a8
jmp 0x76cd
jmp 0x764e
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x718f
leaq 0x7273(%rip), %rdx      # 0xe8d6
xorl %eax, %eax
movl %eax, %esi
leaq -0x48(%rbp), %rdi
callq 0x3070
jmp 0x7672
leaq 0x7277(%rip), %rsi      # 0xe8f0
leaq -0x48(%rbp), %rdi
callq 0x3240
jmp 0x7684
movq 0xb945(%rip), %rdi      # 0x12fd0
leaq -0x48(%rbp), %rsi
callq 0x3220
movq %rax, -0x128(%rbp)
jmp 0x769d
movq -0x128(%rbp), %rdi
movq 0xb90d(%rip), %rsi      # 0x12fb8
callq 0x3290
jmp 0x76b2
leaq -0x48(%rbp), %rdi
callq 0x34a8
leaq -0x28(%rbp), %rdi
callq 0x34a8
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
leaq -0x48(%rbp), %rdi
callq 0x34a8
leaq -0x28(%rbp), %rdi
callq 0x34a8
movq -0x58(%rbp), %rdi
callq 0x3410
nopl (%rax,%rax)