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

    uint64 mv_map = bb_knight_moves[E4];
    assert(get_lsb(mv_map)==D6);
    mv_map ^= bb_squares[D6];

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

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

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

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

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

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

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

    assert(mv_map==0);

    assert(get_num_bits(bb_knight_moves[A8])==2);
    mv_map = bb_knight_moves[A8];
    assert(get_lsb(mv_map)==C7);
    mv_map ^= bb_squares[C7];

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

    assert(mv_map==0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xed921(%rip), %rax     # 0x105870
movq 0x120(%rax), %rdi
callq 0x47b0
cmpl $0x8, %eax
jne 0x17f62
jmp 0x17f81
leaq 0x22627(%rip), %rdi     # 0x3a590
leaq 0x22474(%rip), %rsi     # 0x3a3e4
movl $0x26, %edx
leaq 0x22639(%rip), %rcx     # 0x3a5b5
callq 0x20c0
leaq 0xed8e8(%rip), %rax     # 0x105870
movq 0x120(%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4870
cmpl $0x13, %eax
jne 0x17fa3
jmp 0x17fc2
leaq 0x22624(%rip), %rdi     # 0x3a5ce
leaq 0x22433(%rip), %rsi     # 0x3a3e4
movl $0x29, %edx
leaq 0x225f8(%rip), %rcx     # 0x3a5b5
callq 0x20c0
leaq 0xed6a7(%rip), %rax     # 0x105670
movq 0x98(%rax), %rax
xorq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4870
cmpl $0x15, %eax
jne 0x17fe8
jmp 0x18007
leaq 0x225f3(%rip), %rdi     # 0x3a5e2
leaq 0x223ee(%rip), %rsi     # 0x3a3e4
movl $0x2c, %edx
leaq 0x225b3(%rip), %rcx     # 0x3a5b5
callq 0x20c0
leaq 0xed662(%rip), %rax     # 0x105670
movq 0xa8(%rax), %rax
xorq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4870
cmpl $0x1a, %eax
jne 0x1802d
jmp 0x1804c
leaq 0x225c2(%rip), %rdi     # 0x3a5f6
leaq 0x223a9(%rip), %rsi     # 0x3a3e4
movl $0x2f, %edx
leaq 0x2256e(%rip), %rcx     # 0x3a5b5
callq 0x20c0
leaq 0xed61d(%rip), %rax     # 0x105670
movq 0xd0(%rax), %rax
xorq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4870
cmpl $0x1e, %eax
jne 0x18072
jmp 0x18091
leaq 0x22591(%rip), %rdi     # 0x3a60a
leaq 0x22364(%rip), %rsi     # 0x3a3e4
movl $0x32, %edx
leaq 0x22529(%rip), %rcx     # 0x3a5b5
callq 0x20c0
leaq 0xed5d8(%rip), %rax     # 0x105670
movq 0xf0(%rax), %rax
xorq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4870
cmpl $0x2a, %eax
jne 0x180b7
jmp 0x180d6
leaq 0x22560(%rip), %rdi     # 0x3a61e
leaq 0x2231f(%rip), %rsi     # 0x3a3e4
movl $0x35, %edx
leaq 0x224e4(%rip), %rcx     # 0x3a5b5
callq 0x20c0
leaq 0xed593(%rip), %rax     # 0x105670
movq 0x150(%rax), %rax
xorq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4870
cmpl $0x2e, %eax
jne 0x180fc
jmp 0x1811b
leaq 0x2252f(%rip), %rdi     # 0x3a632
leaq 0x222da(%rip), %rsi     # 0x3a3e4
movl $0x38, %edx
leaq 0x2249f(%rip), %rcx     # 0x3a5b5
callq 0x20c0
leaq 0xed54e(%rip), %rax     # 0x105670
movq 0x170(%rax), %rax
xorq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4870
cmpl $0x33, %eax
jne 0x18141
jmp 0x18160
leaq 0x224fe(%rip), %rdi     # 0x3a646
leaq 0x22295(%rip), %rsi     # 0x3a3e4
movl $0x3b, %edx
leaq 0x2245a(%rip), %rcx     # 0x3a5b5
callq 0x20c0
leaq 0xed509(%rip), %rax     # 0x105670
movq 0x198(%rax), %rax
xorq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4870
cmpl $0x35, %eax
jne 0x18186
jmp 0x181a5
leaq 0x224cd(%rip), %rdi     # 0x3a65a
leaq 0x22250(%rip), %rsi     # 0x3a3e4
movl $0x3e, %edx
leaq 0x22415(%rip), %rcx     # 0x3a5b5
callq 0x20c0
leaq 0xed4c4(%rip), %rax     # 0x105670
movq 0x1a8(%rax), %rax
xorq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x181c4
jmp 0x181e3
leaq 0x224a3(%rip), %rdi     # 0x3a66e
leaq 0x22212(%rip), %rsi     # 0x3a3e4
movl $0x41, %edx
leaq 0x223d7(%rip), %rcx     # 0x3a5b5
callq 0x20c0
leaq 0xed686(%rip), %rax     # 0x105870
movq (%rax), %rdi
callq 0x47b0
cmpl $0x2, %eax
jne 0x181f9
jmp 0x18218
leaq 0x22478(%rip), %rdi     # 0x3a678
leaq 0x221dd(%rip), %rsi     # 0x3a3e4
movl $0x43, %edx
leaq 0x223a2(%rip), %rcx     # 0x3a5b5
callq 0x20c0
leaq 0xed651(%rip), %rax     # 0x105870
movq (%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4870
cmpl $0xa, %eax
jne 0x18236
jmp 0x18255
leaq 0x22460(%rip), %rdi     # 0x3a69d
leaq 0x221a0(%rip), %rsi     # 0x3a3e4
movl $0x45, %edx
leaq 0x22365(%rip), %rcx     # 0x3a5b5
callq 0x20c0
leaq 0xed414(%rip), %rax     # 0x105670
movq 0x50(%rax), %rax
xorq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4870
cmpl $0x11, %eax
jne 0x18278
jmp 0x18297
leaq 0x22432(%rip), %rdi     # 0x3a6b1
leaq 0x2215e(%rip), %rsi     # 0x3a3e4
movl $0x48, %edx
leaq 0x22323(%rip), %rcx     # 0x3a5b5
callq 0x20c0
leaq 0xed3d2(%rip), %rax     # 0x105670
movq 0x88(%rax), %rax
xorq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x182b6
jmp 0x182d5
leaq 0x223b1(%rip), %rdi     # 0x3a66e
leaq 0x22120(%rip), %rsi     # 0x3a3e4
movl $0x4b, %edx
leaq 0x222e5(%rip), %rcx     # 0x3a5b5
callq 0x20c0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)