// File: /workspace/github_cpp_makefile_star2_O1/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 0x232de(%rip), %xmm0    # 0x2e300
movaps %xmm0, 0x20(%rsp,%rax,4)
addq $0x4, %rax
cmpq $0x40, %rax
jne 0xb022
cmpq $0x0, 0x10(%rsp)
je 0xb058
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x7d37
cltq
movl $0x0, 0x20(%rsp,%rax,4)
cmpq $0x0, 0x10(%rsp)
jne 0xb03e
movq 0x30f41(%rip), %rbx     # 0x3bfa0
leaq 0x256d0(%rip), %rsi     # 0x30736
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 0x256b7(%rip), %rsi     # 0x30758
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 0x2569a(%rip), %r12     # 0x3077c
leaq 0x25557(%rip), %r13     # 0x30640
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 0x25701(%rip), %rcx     # 0x30820
movslq (%rcx,%rax), %rax
movl 0x20(%rsp,%rax,4), %ebp
cmpq $0x11, %rbp
jae 0xb21f
movl $0x1, %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x5460
leaq 0x257d8(%rip), %rax     # 0x30920
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 0xb114
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 0x25584(%rip), %rsi     # 0x30758
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 0xb0e9
movq 0x30d8f(%rip), %rdi     # 0x3bfa0
leaq 0x2556d(%rip), %rsi     # 0x30785
movl $0x21, %edx
jmp 0xb232
movq 0x30d7a(%rip), %rdi     # 0x3bfa0
leaq 0x25552(%rip), %rsi     # 0x3077f
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