// File: /workspace/github_cpp_makefile_star2_O1/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 0xaa43
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
movl $0x3f, %edx
movl $0x1, %ecx
movl $0x1, %r8d
callq 0x8780
cmpq %r14, %rax
jne 0x1b045
leaq 0x185a6(%rip), %rsi     # 0x333fc
leaq 0xa0(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa74
movq %r14, %rdi
movq %rbx, %rsi
movl $0x35, %edx
movl $0x1, %ecx
movl $0x1, %r8d
callq 0x8780
movq %rax, %rbx
subq %r14, %rax
cmpq $0x50, %rax
jne 0x1b064
movl $0x4, %edi
movl $0x35, %esi
movl $0x2d, %edx
callq 0x76b8
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xe727
testb %al, %al
je 0x1b083
movl $0x4, %edi
movl $0x35, %esi
movl $0x25, %edx
callq 0x76b8
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xe727
testb %al, %al
je 0x1b0a2
movl $0x4, %edi
movl $0x35, %esi
movl $0x1d, %edx
callq 0x76b8
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xe727
testb %al, %al
je 0x1b0c1
movl $0x4, %edi
movl $0x35, %esi
movl $0x3d, %edx
callq 0x76b8
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xe727
testb %al, %al
je 0x1b0e0
movl $0x4, %edi
movl $0x35, %esi
movl $0x36, %edx
callq 0x76b8
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xe727
testb %al, %al
je 0x1b0ff
movl $0x4, %edi
movl $0x35, %esi
movl $0x37, %edx
callq 0x76b8
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xe727
testb %al, %al
je 0x1b11e
movl $0x4, %edi
movl $0x35, %esi
movl $0x34, %edx
callq 0x76b8
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xe727
testb %al, %al
je 0x1b13d
movl $0x4, %edi
movl $0x35, %esi
movl $0x33, %edx
callq 0x76b8
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xe727
testb %al, %al
je 0x1b15c
movl $0x4, %edi
movl $0x35, %esi
movl $0x32, %edx
callq 0x76b8
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xe727
testb %al, %al
je 0x1b17b
movl $0x4, %edi
movl $0x35, %esi
movl $0x31, %edx
movl $0x4, %ecx
callq 0x76d7
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xe727
testb %al, %al
je 0x1b19a
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r14
retq
leaq 0x18383(%rip), %rdi     # 0x333cf
leaq 0x17c7b(%rip), %rsi     # 0x32cce
leaq 0x18387(%rip), %rcx     # 0x333e1
movl $0x82, %edx
callq 0x20d0
leaq 0x183b5(%rip), %rdi     # 0x33420
leaq 0x17c5c(%rip), %rsi     # 0x32cce
leaq 0x18368(%rip), %rcx     # 0x333e1
movl $0x87, %edx
callq 0x20d0
leaq 0x183a9(%rip), %rdi     # 0x33433
leaq 0x17c3d(%rip), %rsi     # 0x32cce
leaq 0x18349(%rip), %rcx     # 0x333e1
movl $0x89, %edx
callq 0x20d0
leaq 0x183b8(%rip), %rdi     # 0x33461
leaq 0x17c1e(%rip), %rsi     # 0x32cce
leaq 0x1832a(%rip), %rcx     # 0x333e1
movl $0x8a, %edx
callq 0x20d0
leaq 0x183c7(%rip), %rdi     # 0x3348f
leaq 0x17bff(%rip), %rsi     # 0x32cce
leaq 0x1830b(%rip), %rcx     # 0x333e1
movl $0x8b, %edx
callq 0x20d0
leaq 0x183d6(%rip), %rdi     # 0x334bd
leaq 0x17be0(%rip), %rsi     # 0x32cce
leaq 0x182ec(%rip), %rcx     # 0x333e1
movl $0x8c, %edx
callq 0x20d0
leaq 0x183e5(%rip), %rdi     # 0x334eb
leaq 0x17bc1(%rip), %rsi     # 0x32cce
leaq 0x182cd(%rip), %rcx     # 0x333e1
movl $0x8d, %edx
callq 0x20d0
leaq 0x183f4(%rip), %rdi     # 0x33519
leaq 0x17ba2(%rip), %rsi     # 0x32cce
leaq 0x182ae(%rip), %rcx     # 0x333e1
movl $0x8e, %edx
callq 0x20d0
leaq 0x18403(%rip), %rdi     # 0x33547
leaq 0x17b83(%rip), %rsi     # 0x32cce
leaq 0x1828f(%rip), %rcx     # 0x333e1
movl $0x8f, %edx
callq 0x20d0
leaq 0x18412(%rip), %rdi     # 0x33575
leaq 0x17b64(%rip), %rsi     # 0x32cce
leaq 0x18270(%rip), %rcx     # 0x333e1
movl $0x90, %edx
callq 0x20d0
leaq 0x18421(%rip), %rdi     # 0x335a3
leaq 0x17b45(%rip), %rsi     # 0x32cce
leaq 0x18251(%rip), %rcx     # 0x333e1
movl $0x91, %edx
callq 0x20d0
leaq 0x18430(%rip), %rdi     # 0x335d1
leaq 0x17b26(%rip), %rsi     # 0x32cce
leaq 0x18232(%rip), %rcx     # 0x333e1
movl $0x92, %edx
callq 0x20d0