// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/test/movegen__test.cpp
// Function: test_gen_rook_moves()
void test_gen_rook_moves() {
    position pos;
    reset_pos(&pos);

    move moves[20];
    move *mp = gen_rook_moves(moves,&pos,H1,true,true);
    assert((mp - moves) == 0);

    set_pos(&pos,"8/8/3k1p2/8/3K4/8/1R3r2/8 b - - 0 1");

    mp = gen_rook_moves(moves,&pos,F2,true,true);
    assert((mp - moves) == 10);

    assert(is_in_move_list(to_move(ROOK,F2,F3),moves,mp));
    assert(is_in_move_list(to_move(ROOK,F2,F4),moves,mp));
    assert(is_in_move_list(to_move(ROOK,F2,F5),moves,mp));
    assert(is_in_move_list(to_move(ROOK,F2,F1),moves,mp));
    assert(is_in_move_list(to_move(ROOK,F2,G2),moves,mp));
    assert(is_in_move_list(to_move(ROOK,F2,H2),moves,mp));
    assert(is_in_move_list(to_move(ROOK,F2,E2),moves,mp));
    assert(is_in_move_list(to_move(ROOK,F2,D2),moves,mp));
    assert(is_in_move_list(to_move(ROOK,F2,C2),moves,mp));
    assert(is_in_move_list(to_capture(ROOK,F2,B2,ROOK),moves,mp));
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
leaq 0xa0(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa51
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
movl $0x3f, %edx
movl $0x1, %ecx
movl $0x1, %r8d
callq 0x8814
cmpq %r14, %rax
jne 0x1aed1
leaq 0x1879a(%rip), %rsi     # 0x3347c
leaq 0xa0(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa82
movq %r14, %rdi
movq %rbx, %rsi
movl $0x35, %edx
movl $0x1, %ecx
movl $0x1, %r8d
callq 0x8814
movq %rax, %rbx
subq %r14, %rax
cmpq $0x50, %rax
jne 0x1aef0
movl $0x4, %edi
movl $0x35, %esi
movl $0x2d, %edx
callq 0x775c
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1af0f
movl $0x4, %edi
movl $0x35, %esi
movl $0x25, %edx
callq 0x775c
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1af2e
movl $0x4, %edi
movl $0x35, %esi
movl $0x1d, %edx
callq 0x775c
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1af4d
movl $0x4, %edi
movl $0x35, %esi
movl $0x3d, %edx
callq 0x775c
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1af6c
movl $0x4, %edi
movl $0x35, %esi
movl $0x36, %edx
callq 0x775c
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1af8b
movl $0x4, %edi
movl $0x35, %esi
movl $0x37, %edx
callq 0x775c
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1afaa
movl $0x4, %edi
movl $0x35, %esi
movl $0x34, %edx
callq 0x775c
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1afc9
movl $0x4, %edi
movl $0x35, %esi
movl $0x33, %edx
callq 0x775c
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1afe8
movl $0x4, %edi
movl $0x35, %esi
movl $0x32, %edx
callq 0x775c
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1b007
movl $0x4, %edi
movl $0x35, %esi
movl $0x31, %edx
movl $0x4, %ecx
callq 0x777b
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1b026
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r14
retq
leaq 0x18577(%rip), %rdi     # 0x3344f
leaq 0x17e6f(%rip), %rsi     # 0x32d4e
leaq 0x1857b(%rip), %rcx     # 0x33461
movl $0x82, %edx
callq 0x20d0
leaq 0x185a9(%rip), %rdi     # 0x334a0
leaq 0x17e50(%rip), %rsi     # 0x32d4e
leaq 0x1855c(%rip), %rcx     # 0x33461
movl $0x87, %edx
callq 0x20d0
leaq 0x1859d(%rip), %rdi     # 0x334b3
leaq 0x17e31(%rip), %rsi     # 0x32d4e
leaq 0x1853d(%rip), %rcx     # 0x33461
movl $0x89, %edx
callq 0x20d0
leaq 0x185ac(%rip), %rdi     # 0x334e1
leaq 0x17e12(%rip), %rsi     # 0x32d4e
leaq 0x1851e(%rip), %rcx     # 0x33461
movl $0x8a, %edx
callq 0x20d0
leaq 0x185bb(%rip), %rdi     # 0x3350f
leaq 0x17df3(%rip), %rsi     # 0x32d4e
leaq 0x184ff(%rip), %rcx     # 0x33461
movl $0x8b, %edx
callq 0x20d0
leaq 0x185ca(%rip), %rdi     # 0x3353d
leaq 0x17dd4(%rip), %rsi     # 0x32d4e
leaq 0x184e0(%rip), %rcx     # 0x33461
movl $0x8c, %edx
callq 0x20d0
leaq 0x185d9(%rip), %rdi     # 0x3356b
leaq 0x17db5(%rip), %rsi     # 0x32d4e
leaq 0x184c1(%rip), %rcx     # 0x33461
movl $0x8d, %edx
callq 0x20d0
leaq 0x185e8(%rip), %rdi     # 0x33599
leaq 0x17d96(%rip), %rsi     # 0x32d4e
leaq 0x184a2(%rip), %rcx     # 0x33461
movl $0x8e, %edx
callq 0x20d0
leaq 0x185f7(%rip), %rdi     # 0x335c7
leaq 0x17d77(%rip), %rsi     # 0x32d4e
leaq 0x18483(%rip), %rcx     # 0x33461
movl $0x8f, %edx
callq 0x20d0
leaq 0x18606(%rip), %rdi     # 0x335f5
leaq 0x17d58(%rip), %rsi     # 0x32d4e
leaq 0x18464(%rip), %rcx     # 0x33461
movl $0x90, %edx
callq 0x20d0
leaq 0x18615(%rip), %rdi     # 0x33623
leaq 0x17d39(%rip), %rsi     # 0x32d4e
leaq 0x18445(%rip), %rcx     # 0x33461
movl $0x91, %edx
callq 0x20d0
leaq 0x18624(%rip), %rdi     # 0x33651
leaq 0x17d1a(%rip), %rsi     # 0x32d4e
leaq 0x18426(%rip), %rcx     # 0x33461
movl $0x92, %edx
callq 0x20d0