// File: /workspace/github_cpp_makefile_star2_O3/ATOMIC-LICHESS[P]ATOMKRAFT/debug.cpp
// Function: print_bb(unsigned long)
void print_bb(Bitboard bb) {
	Piece piece;
	Piece pieces[64];
	
	for (int k = 0; k < 64; ++k) {
		pieces[k] = PIECE_NONE;
	}
	
	while (bb) {
		pieces[pop_1st_bit(&bb)] = PIECE_NONE_DARK_SQ;
	}
	
	cout << "    0   1   2   3   4   5   6   7" << endl;
	cout << "  +---+---+---+---+---+---+---+---+" << endl;
	
	for (int rank = 7; rank >= 0; --rank) {
		cout << rank + 1 << " |";
		for (int file = 0; file < 8; ++file) {
			piece = pieces[BOARDVTOI[rank][file]];
			if (piece < 0 || piece > 16) {
				cout << "ERROR" << endl;
				return;
			}
			cout << " " << PIECE_NAME[piece] << " |";
		}
		cout << " " << rank << endl;
		cout << "  +---+---+---+---+---+---+---+---+" << endl;
	}
	
	cout << "    a   b   c   d   e   f   g   h" << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rdi, 0x10(%rsp)
xorl %eax, %eax
movaps 0x23bca(%rip), %xmm0    # 0x2f130
movaps %xmm0, 0x20(%rsp,%rax,4)
addq $0x4, %rax
cmpq $0x40, %rax
jne 0xb566
testq %rdi, %rdi
je 0xb599
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x827b
cltq
movl $0x0, 0x20(%rsp,%rax,4)
cmpq $0x0, 0x10(%rsp)
jne 0xb57f
movq 0x31a00(%rip), %rbx     # 0x3cfa0
leaq 0x2620f(%rip), %rsi     # 0x317b6
movl $0x21, %edx
movq %rbx, %rdi
callq 0x5460
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5050
movq %rax, %rdi
callq 0x5270
leaq 0x261f6(%rip), %rsi     # 0x317d8
movl $0x23, %edx
movq %rbx, %rdi
callq 0x5460
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5050
movq %rax, %rdi
callq 0x5270
movl $0x7, %r15d
leaq 0x261d9(%rip), %r12     # 0x317fc
leaq 0x26096(%rip), %r13     # 0x316c0
movl %r15d, %r14d
shlq $0x5, %r14
movq %r15, 0x18(%rsp)
leal 0x1(%r15), %esi
movq %rbx, %rdi
callq 0x5760
movl $0x2, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x5460
xorl %r15d, %r15d
leaq (%r14,%r15,4), %rax
leaq 0x26240(%rip), %rcx     # 0x318a0
movslq (%rcx,%rax), %rax
movl 0x20(%rsp,%rax,4), %ebp
cmpq $0x10, %rbp
ja 0xb760
movl $0x1, %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x5460
leaq 0x26317(%rip), %rax     # 0x319a0
movb (%rbp,%rax), %al
movb %al, 0xf(%rsp)
movl $0x1, %edx
movq %rbx, %rdi
leaq 0xf(%rsp), %rsi
callq 0x5460
movl $0x2, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x5460
incq %r15
cmpq $0x8, %r15
jne 0xb655
movl $0x1, %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x5460
movq %rbx, %rdi
movq 0x18(%rsp), %r15
movl %r15d, %esi
callq 0x5760
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53c0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5050
movq %rax, %rdi
callq 0x5270
movl $0x23, %edx
movq %rbx, %rdi
leaq 0x260c3(%rip), %rsi     # 0x317d8
callq 0x5460
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5050
movq %rax, %rdi
callq 0x5270
subl $0x1, %r15d
jae 0xb62a
movq 0x3184e(%rip), %rdi     # 0x3cfa0
leaq 0x260ac(%rip), %rsi     # 0x31805
movl $0x21, %edx
jmp 0xb773
movq 0x31839(%rip), %rdi     # 0x3cfa0
leaq 0x26091(%rip), %rsi     # 0x317ff
movl $0x5, %edx
callq 0x5460
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5050
movq %rax, %rdi
callq 0x5270
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq