// File: /workspace/github_cpp_makefile_star2_O2/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 0xa187
movq %rsp, %r14
pushq $0x3f
popq %rdx
pushq $0x1
popq %rcx
movq %r14, %rdi
movq %rbx, %rsi
movl %ecx, %r8d
callq 0x819f
cmpq %r14, %rax
jne 0x195b9
leaq 0x1812f(%rip), %rsi     # 0x3153f
leaq 0xa0(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1b8
pushq $0x35
popq %rdx
pushq $0x1
popq %rcx
movq %r14, %rdi
movq %rbx, %rsi
movl %ecx, %r8d
callq 0x819f
movq %rax, %rbx
subq %r14, %rax
cmpq $0x50, %rax
jne 0x195d8
pushq $0x4
popq %rdi
pushq $0x35
popq %rsi
pushq $0x2d
popq %rdx
callq 0x7284
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x195f7
pushq $0x4
popq %rdi
pushq $0x35
popq %rsi
pushq $0x25
popq %rdx
callq 0x7284
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x19616
pushq $0x4
popq %rdi
pushq $0x35
popq %rsi
pushq $0x1d
popq %rdx
callq 0x7284
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x19635
pushq $0x4
popq %rdi
pushq $0x35
popq %rsi
pushq $0x3d
popq %rdx
callq 0x7284
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x19654
pushq $0x4
popq %rdi
pushq $0x35
popq %rsi
pushq $0x36
popq %rdx
callq 0x7284
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x19673
pushq $0x4
popq %rdi
pushq $0x35
popq %rsi
pushq $0x37
popq %rdx
callq 0x7284
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x19692
pushq $0x4
popq %rdi
pushq $0x35
popq %rsi
pushq $0x34
popq %rdx
callq 0x7284
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x196b1
pushq $0x4
popq %rdi
pushq $0x35
popq %rsi
pushq $0x33
popq %rdx
callq 0x7284
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x196d0
pushq $0x4
popq %rdi
pushq $0x35
popq %rsi
pushq $0x32
popq %rdx
callq 0x7284
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x196ef
pushq $0x35
popq %rsi
pushq $0x31
popq %rdx
pushq $0x4
popq %rcx
movl %ecx, %edi
callq 0x72a3
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x1970e
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r14
retq
leaq 0x17f52(%rip), %rdi     # 0x31512
leaq 0x1784a(%rip), %rsi     # 0x30e11
leaq 0x17f56(%rip), %rcx     # 0x31524
movl $0x82, %edx
callq 0x20c0
leaq 0x17f84(%rip), %rdi     # 0x31563
leaq 0x1782b(%rip), %rsi     # 0x30e11
leaq 0x17f37(%rip), %rcx     # 0x31524
movl $0x87, %edx
callq 0x20c0
leaq 0x17f78(%rip), %rdi     # 0x31576
leaq 0x1780c(%rip), %rsi     # 0x30e11
leaq 0x17f18(%rip), %rcx     # 0x31524
movl $0x89, %edx
callq 0x20c0
leaq 0x17f87(%rip), %rdi     # 0x315a4
leaq 0x177ed(%rip), %rsi     # 0x30e11
leaq 0x17ef9(%rip), %rcx     # 0x31524
movl $0x8a, %edx
callq 0x20c0
leaq 0x17f96(%rip), %rdi     # 0x315d2
leaq 0x177ce(%rip), %rsi     # 0x30e11
leaq 0x17eda(%rip), %rcx     # 0x31524
movl $0x8b, %edx
callq 0x20c0
leaq 0x17fa5(%rip), %rdi     # 0x31600
leaq 0x177af(%rip), %rsi     # 0x30e11
leaq 0x17ebb(%rip), %rcx     # 0x31524
movl $0x8c, %edx
callq 0x20c0
leaq 0x17fb4(%rip), %rdi     # 0x3162e
leaq 0x17790(%rip), %rsi     # 0x30e11
leaq 0x17e9c(%rip), %rcx     # 0x31524
movl $0x8d, %edx
callq 0x20c0
leaq 0x17fc3(%rip), %rdi     # 0x3165c
leaq 0x17771(%rip), %rsi     # 0x30e11
leaq 0x17e7d(%rip), %rcx     # 0x31524
movl $0x8e, %edx
callq 0x20c0
leaq 0x17fd2(%rip), %rdi     # 0x3168a
leaq 0x17752(%rip), %rsi     # 0x30e11
leaq 0x17e5e(%rip), %rcx     # 0x31524
movl $0x8f, %edx
callq 0x20c0
leaq 0x17fe1(%rip), %rdi     # 0x316b8
leaq 0x17733(%rip), %rsi     # 0x30e11
leaq 0x17e3f(%rip), %rcx     # 0x31524
movl $0x90, %edx
callq 0x20c0
leaq 0x17ff0(%rip), %rdi     # 0x316e6
leaq 0x17714(%rip), %rsi     # 0x30e11
leaq 0x17e20(%rip), %rcx     # 0x31524
movl $0x91, %edx
callq 0x20c0
leaq 0x17fff(%rip), %rdi     # 0x31714
leaq 0x176f5(%rip), %rsi     # 0x30e11
leaq 0x17e01(%rip), %rcx     # 0x31524
movl $0x92, %edx
callq 0x20c0