// File: jswaff[P]prophet3/test/bitboards__test.cpp
// Function: test_king_moves()
void test_king_moves() {
    assert(get_num_bits(bb_king_moves[E4])==8);

    uint64 mv_map = bb_king_moves[E4];
    assert(get_lsb(mv_map)==D5);
    mv_map ^= bb_squares[D5];

    assert(get_lsb(mv_map)==E5);
    mv_map ^= bb_squares[E5];

    assert(get_lsb(mv_map)==F5);
    mv_map ^= bb_squares[F5];

    assert(get_lsb(mv_map)==D4);
    mv_map ^= bb_squares[D4];

    assert(get_lsb(mv_map)==F4);
    mv_map ^= bb_squares[F4];

    assert(get_lsb(mv_map)==D3);
    mv_map ^= bb_squares[D3];

    assert(get_lsb(mv_map)==E3);
    mv_map ^= bb_squares[E3];

    assert(get_lsb(mv_map)==F3);
    mv_map ^= bb_squares[F3];

    assert(mv_map==0);

    assert(get_num_bits(bb_king_moves[A8])==3);
    mv_map = bb_king_moves[A8];
    assert(get_lsb(mv_map)==B8);
    mv_map ^= bb_squares[B8];

    assert(get_lsb(mv_map)==A7);
    mv_map ^= bb_squares[A7];

    assert(get_lsb(mv_map)==B7);
    mv_map ^= bb_squares[B7];

    assert(mv_map==0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xed781(%rip), %rax     # 0x105a70
movq 0x120(%rax), %rdi
callq 0x47b0
cmpl $0x8, %eax
jne 0x18302
jmp 0x18321
leaq 0x223bc(%rip), %rdi     # 0x3a6c5
leaq 0x220d4(%rip), %rsi     # 0x3a3e4
movl $0x4f, %edx
leaq 0x223cc(%rip), %rcx     # 0x3a6e8
callq 0x20c0
leaq 0xed748(%rip), %rax     # 0x105a70
movq 0x120(%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4870
cmpl $0x1b, %eax
jne 0x18343
jmp 0x18362
leaq 0x223b5(%rip), %rdi     # 0x3a6ff
leaq 0x22093(%rip), %rsi     # 0x3a3e4
movl $0x52, %edx
leaq 0x2238b(%rip), %rcx     # 0x3a6e8
callq 0x20c0
leaq 0xed307(%rip), %rax     # 0x105670
movq 0xd8(%rax), %rax
xorq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4870
cmpl $0x1c, %eax
jne 0x18388
jmp 0x183a7
leaq 0x22384(%rip), %rdi     # 0x3a713
leaq 0x2204e(%rip), %rsi     # 0x3a3e4
movl $0x55, %edx
leaq 0x22346(%rip), %rcx     # 0x3a6e8
callq 0x20c0
leaq 0xed2c2(%rip), %rax     # 0x105670
movq 0xe0(%rax), %rax
xorq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4870
cmpl $0x1d, %eax
jne 0x183cd
jmp 0x183ec
leaq 0x22353(%rip), %rdi     # 0x3a727
leaq 0x22009(%rip), %rsi     # 0x3a3e4
movl $0x58, %edx
leaq 0x22301(%rip), %rcx     # 0x3a6e8
callq 0x20c0
leaq 0xed27d(%rip), %rax     # 0x105670
movq 0xe8(%rax), %rax
xorq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4870
cmpl $0x23, %eax
jne 0x18412
jmp 0x18431
leaq 0x22322(%rip), %rdi     # 0x3a73b
leaq 0x21fc4(%rip), %rsi     # 0x3a3e4
movl $0x5b, %edx
leaq 0x222bc(%rip), %rcx     # 0x3a6e8
callq 0x20c0
leaq 0xed238(%rip), %rax     # 0x105670
movq 0x118(%rax), %rax
xorq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4870
cmpl $0x25, %eax
jne 0x18457
jmp 0x18476
leaq 0x222f1(%rip), %rdi     # 0x3a74f
leaq 0x21f7f(%rip), %rsi     # 0x3a3e4
movl $0x5e, %edx
leaq 0x22277(%rip), %rcx     # 0x3a6e8
callq 0x20c0
leaq 0xed1f3(%rip), %rax     # 0x105670
movq 0x128(%rax), %rax
xorq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4870
cmpl $0x2b, %eax
jne 0x1849c
jmp 0x184bb
leaq 0x222c0(%rip), %rdi     # 0x3a763
leaq 0x21f3a(%rip), %rsi     # 0x3a3e4
movl $0x61, %edx
leaq 0x22232(%rip), %rcx     # 0x3a6e8
callq 0x20c0
leaq 0xed1ae(%rip), %rax     # 0x105670
movq 0x158(%rax), %rax
xorq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4870
cmpl $0x2c, %eax
jne 0x184e1
jmp 0x18500
leaq 0x2228f(%rip), %rdi     # 0x3a777
leaq 0x21ef5(%rip), %rsi     # 0x3a3e4
movl $0x64, %edx
leaq 0x221ed(%rip), %rcx     # 0x3a6e8
callq 0x20c0
leaq 0xed169(%rip), %rax     # 0x105670
movq 0x160(%rax), %rax
xorq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4870
cmpl $0x2d, %eax
jne 0x18526
jmp 0x18545
leaq 0x2225e(%rip), %rdi     # 0x3a78b
leaq 0x21eb0(%rip), %rsi     # 0x3a3e4
movl $0x67, %edx
leaq 0x221a8(%rip), %rcx     # 0x3a6e8
callq 0x20c0
leaq 0xed124(%rip), %rax     # 0x105670
movq 0x168(%rax), %rax
xorq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x18564
jmp 0x18583
leaq 0x22103(%rip), %rdi     # 0x3a66e
leaq 0x21e72(%rip), %rsi     # 0x3a3e4
movl $0x6a, %edx
leaq 0x2216a(%rip), %rcx     # 0x3a6e8
callq 0x20c0
leaq 0xed4e6(%rip), %rax     # 0x105a70
movq (%rax), %rdi
callq 0x47b0
cmpl $0x3, %eax
jne 0x18599
jmp 0x185b8
leaq 0x221ff(%rip), %rdi     # 0x3a79f
leaq 0x21e3d(%rip), %rsi     # 0x3a3e4
movl $0x6c, %edx
leaq 0x22135(%rip), %rcx     # 0x3a6e8
callq 0x20c0
leaq 0xed4b1(%rip), %rax     # 0x105a70
movq (%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4870
cmpl $0x1, %eax
jne 0x185d6
jmp 0x185f5
leaq 0x221e5(%rip), %rdi     # 0x3a7c2
leaq 0x21e00(%rip), %rsi     # 0x3a3e4
movl $0x6e, %edx
leaq 0x220f8(%rip), %rcx     # 0x3a6e8
callq 0x20c0
leaq 0xed074(%rip), %rax     # 0x105670
movq 0x8(%rax), %rax
xorq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4870
cmpl $0x8, %eax
jne 0x18618
jmp 0x18637
leaq 0x221b7(%rip), %rdi     # 0x3a7d6
leaq 0x21dbe(%rip), %rsi     # 0x3a3e4
movl $0x71, %edx
leaq 0x220b6(%rip), %rcx     # 0x3a6e8
callq 0x20c0
leaq 0xed032(%rip), %rax     # 0x105670
movq 0x40(%rax), %rax
xorq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4870
cmpl $0x9, %eax
jne 0x1865a
jmp 0x18679
leaq 0x22189(%rip), %rdi     # 0x3a7ea
leaq 0x21d7c(%rip), %rsi     # 0x3a3e4
movl $0x74, %edx
leaq 0x22074(%rip), %rcx     # 0x3a6e8
callq 0x20c0
leaq 0xecff0(%rip), %rax     # 0x105670
movq 0x48(%rax), %rax
xorq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x18695
jmp 0x186b4
leaq 0x21fd2(%rip), %rdi     # 0x3a66e
leaq 0x21d41(%rip), %rsi     # 0x3a3e4
movl $0x77, %edx
leaq 0x22039(%rip), %rcx     # 0x3a6e8
callq 0x20c0
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)