// File: jswaff[P]prophet3/test/movegen__test.cpp
// Function: test_gen_queen_moves()
void test_gen_queen_moves() {
    position pos;
    set_pos(&pos,"8/8/3bk3/8/8/2K3Q1/8/8 w - - 0 1");

    move moves[20];
    move *mp = gen_queen_moves(moves,&pos,G3,true,true);

    assert((mp - moves) == 18);
    assert(is_in_move_list(to_move(QUEEN,G3,G4),moves,mp));
    assert(is_in_move_list(to_move(QUEEN,G3,G5),moves,mp));
    assert(is_in_move_list(to_move(QUEEN,G3,G6),moves,mp));
    assert(is_in_move_list(to_move(QUEEN,G3,G7),moves,mp));
    assert(is_in_move_list(to_move(QUEEN,G3,G8),moves,mp));
    assert(is_in_move_list(to_move(QUEEN,G3,H4),moves,mp));
    assert(is_in_move_list(to_move(QUEEN,G3,H3),moves,mp));
    assert(is_in_move_list(to_move(QUEEN,G3,H2),moves,mp));
    assert(is_in_move_list(to_move(QUEEN,G3,G2),moves,mp));
    assert(is_in_move_list(to_move(QUEEN,G3,G1),moves,mp));
    assert(is_in_move_list(to_move(QUEEN,G3,F2),moves,mp));
    assert(is_in_move_list(to_move(QUEEN,G3,E1),moves,mp));
    assert(is_in_move_list(to_move(QUEEN,G3,F3),moves,mp));
    assert(is_in_move_list(to_move(QUEEN,G3,E3),moves,mp));
    assert(is_in_move_list(to_move(QUEEN,G3,D3),moves,mp));
    assert(is_in_move_list(to_move(QUEEN,G3,F4),moves,mp));
    assert(is_in_move_list(to_move(QUEEN,G3,E5),moves,mp));
    assert(is_in_move_list(to_capture(QUEEN,G3,D6,BISHOP),moves,mp));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x280, %rsp            # imm = 0x280
leaq -0x1c8(%rbp), %rdi
leaq 0x1ad23(%rip), %rsi     # 0x3ff8c
callq 0xf3e0
leaq -0x270(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movl $0x2e, %edx
movl $0x1, %r8d
movl %r8d, %ecx
callq 0xc350
movq %rax, -0x278(%rbp)
movq -0x278(%rbp), %rax
leaq -0x270(%rbp), %rcx
subq %rcx, %rax
sarq $0x3, %rax
cmpq $0x12, %rax
jne 0x252b3
jmp 0x252d2
leaq 0x1a62f(%rip), %rdi     # 0x3f8e9
leaq 0x1a32f(%rip), %rsi     # 0x3f5f0
movl $0xc4, %edx
leaq 0x1ace0(%rip), %rcx     # 0x3ffad
callq 0x20c0
movl $0x5, %edi
movl $0x2e, %esi
movl $0x26, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x25302
jmp 0x25304
jmp 0x25323
leaq 0x1acbe(%rip), %rdi     # 0x3ffc9
leaq 0x1a2de(%rip), %rsi     # 0x3f5f0
movl $0xc5, %edx
leaq 0x1ac8f(%rip), %rcx     # 0x3ffad
callq 0x20c0
movl $0x5, %edi
movl $0x2e, %esi
movl $0x1e, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x25353
jmp 0x25355
jmp 0x25374
leaq 0x1ac9c(%rip), %rdi     # 0x3fff8
leaq 0x1a28d(%rip), %rsi     # 0x3f5f0
movl $0xc6, %edx
leaq 0x1ac3e(%rip), %rcx     # 0x3ffad
callq 0x20c0
movl $0x5, %edi
movl $0x2e, %esi
movl $0x16, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x253a4
jmp 0x253a6
jmp 0x253c5
leaq 0x1ac7a(%rip), %rdi     # 0x40027
leaq 0x1a23c(%rip), %rsi     # 0x3f5f0
movl $0xc7, %edx
leaq 0x1abed(%rip), %rcx     # 0x3ffad
callq 0x20c0
movl $0x5, %edi
movl $0x2e, %esi
movl $0xe, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x253f5
jmp 0x253f7
jmp 0x25416
leaq 0x1ac58(%rip), %rdi     # 0x40056
leaq 0x1a1eb(%rip), %rsi     # 0x3f5f0
movl $0xc8, %edx
leaq 0x1ab9c(%rip), %rcx     # 0x3ffad
callq 0x20c0
movl $0x5, %edi
movl $0x2e, %esi
movl $0x6, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x25446
jmp 0x25448
jmp 0x25467
leaq 0x1ac36(%rip), %rdi     # 0x40085
leaq 0x1a19a(%rip), %rsi     # 0x3f5f0
movl $0xc9, %edx
leaq 0x1ab4b(%rip), %rcx     # 0x3ffad
callq 0x20c0
movl $0x5, %edi
movl $0x2e, %esi
movl $0x27, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x25497
jmp 0x25499
jmp 0x254b8
leaq 0x1ac14(%rip), %rdi     # 0x400b4
leaq 0x1a149(%rip), %rsi     # 0x3f5f0
movl $0xca, %edx
leaq 0x1aafa(%rip), %rcx     # 0x3ffad
callq 0x20c0
movl $0x5, %edi
movl $0x2e, %esi
movl $0x2f, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x254e8
jmp 0x254ea
jmp 0x25509
leaq 0x1abf2(%rip), %rdi     # 0x400e3
leaq 0x1a0f8(%rip), %rsi     # 0x3f5f0
movl $0xcb, %edx
leaq 0x1aaa9(%rip), %rcx     # 0x3ffad
callq 0x20c0
movl $0x5, %edi
movl $0x2e, %esi
movl $0x37, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x25539
jmp 0x2553b
jmp 0x2555a
leaq 0x1abd0(%rip), %rdi     # 0x40112
leaq 0x1a0a7(%rip), %rsi     # 0x3f5f0
movl $0xcc, %edx
leaq 0x1aa58(%rip), %rcx     # 0x3ffad
callq 0x20c0
movl $0x5, %edi
movl $0x2e, %esi
movl $0x36, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x2558a
jmp 0x2558c
jmp 0x255ab
leaq 0x1abae(%rip), %rdi     # 0x40141
leaq 0x1a056(%rip), %rsi     # 0x3f5f0
movl $0xcd, %edx
leaq 0x1aa07(%rip), %rcx     # 0x3ffad
callq 0x20c0
movl $0x5, %edi
movl $0x2e, %esi
movl $0x3e, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x255db
jmp 0x255dd
jmp 0x255fc
leaq 0x1ab8c(%rip), %rdi     # 0x40170
leaq 0x1a005(%rip), %rsi     # 0x3f5f0
movl $0xce, %edx
leaq 0x1a9b6(%rip), %rcx     # 0x3ffad
callq 0x20c0
movl $0x5, %edi
movl $0x2e, %esi
movl $0x35, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x2562c
jmp 0x2562e
jmp 0x2564d
leaq 0x1ab6a(%rip), %rdi     # 0x4019f
leaq 0x19fb4(%rip), %rsi     # 0x3f5f0
movl $0xcf, %edx
leaq 0x1a965(%rip), %rcx     # 0x3ffad
callq 0x20c0
movl $0x5, %edi
movl $0x2e, %esi
movl $0x3c, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x2567d
jmp 0x2567f
jmp 0x2569e
leaq 0x1ab48(%rip), %rdi     # 0x401ce
leaq 0x19f63(%rip), %rsi     # 0x3f5f0
movl $0xd0, %edx
leaq 0x1a914(%rip), %rcx     # 0x3ffad
callq 0x20c0
movl $0x5, %edi
movl $0x2e, %esi
movl $0x2d, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x256ce
jmp 0x256d0
jmp 0x256ef
leaq 0x1ab26(%rip), %rdi     # 0x401fd
leaq 0x19f12(%rip), %rsi     # 0x3f5f0
movl $0xd1, %edx
leaq 0x1a8c3(%rip), %rcx     # 0x3ffad
callq 0x20c0
movl $0x5, %edi
movl $0x2e, %esi
movl $0x2c, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x2571f
jmp 0x25721
jmp 0x25740
leaq 0x1ab04(%rip), %rdi     # 0x4022c
leaq 0x19ec1(%rip), %rsi     # 0x3f5f0
movl $0xd2, %edx
leaq 0x1a872(%rip), %rcx     # 0x3ffad
callq 0x20c0
movl $0x5, %edi
movl $0x2e, %esi
movl $0x2b, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x25770
jmp 0x25772
jmp 0x25791
leaq 0x1aae2(%rip), %rdi     # 0x4025b
leaq 0x19e70(%rip), %rsi     # 0x3f5f0
movl $0xd3, %edx
leaq 0x1a821(%rip), %rcx     # 0x3ffad
callq 0x20c0
movl $0x5, %edi
movl $0x2e, %esi
movl $0x25, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x257c1
jmp 0x257c3
jmp 0x257e2
leaq 0x1aac0(%rip), %rdi     # 0x4028a
leaq 0x19e1f(%rip), %rsi     # 0x3f5f0
movl $0xd4, %edx
leaq 0x1a7d0(%rip), %rcx     # 0x3ffad
callq 0x20c0
movl $0x5, %edi
movl $0x2e, %esi
movl $0x1c, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x25812
jmp 0x25814
jmp 0x25833
leaq 0x1aa9e(%rip), %rdi     # 0x402b9
leaq 0x19dce(%rip), %rsi     # 0x3f5f0
movl $0xd5, %edx
leaq 0x1a77f(%rip), %rcx     # 0x3ffad
callq 0x20c0
movl $0x5, %edi
movl $0x2e, %esi
movl $0x13, %edx
movl $0x3, %ecx
callq 0xa890
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x25868
jmp 0x2586a
jmp 0x25889
leaq 0x1aa77(%rip), %rdi     # 0x402e8
leaq 0x19d78(%rip), %rsi     # 0x3f5f0
movl $0xd6, %edx
leaq 0x1a729(%rip), %rcx     # 0x3ffad
callq 0x20c0
addq $0x280, %rsp            # imm = 0x280
popq %rbp
retq
nopw %cs:(%rax,%rax)