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

    move moves[20];
    move *mp = gen_rook_moves(moves,&pos,H1,false,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,false,true);
    assert((mp - moves) == 9);

    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));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x280, %rsp            # imm = 0x280
leaq -0x1c8(%rbp), %rdi
callq 0xf390
leaq -0x270(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movl $0x3f, %edx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0xc210
movq %rax, -0x278(%rbp)
movq -0x278(%rbp), %rax
leaq -0x270(%rbp), %rcx
subq %rcx, %rax
sarq $0x3, %rax
cmpq $0x0, %rax
jne 0x24ecb
jmp 0x24eea
leaq 0x1ae1f(%rip), %rdi     # 0x3fcf1
leaq 0x1a717(%rip), %rsi     # 0x3f5f0
movl $0xab, %edx
leaq 0x1b074(%rip), %rcx     # 0x3ff59
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
leaq 0x1ae26(%rip), %rsi     # 0x3fd1e
callq 0xf3e0
leaq -0x270(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movl $0x35, %edx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0xc210
movq %rax, -0x278(%rbp)
movq -0x278(%rbp), %rax
leaq -0x270(%rbp), %rcx
subq %rcx, %rax
sarq $0x3, %rax
cmpq $0x9, %rax
jne 0x24f41
jmp 0x24f60
leaq 0x1b032(%rip), %rdi     # 0x3ff7a
leaq 0x1a6a1(%rip), %rsi     # 0x3f5f0
movl $0xb0, %edx
leaq 0x1affe(%rip), %rcx     # 0x3ff59
callq 0x20c0
movl $0x4, %edi
movl $0x35, %esi
movl $0x2d, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x24f90
jmp 0x24f92
jmp 0x24fb1
leaq 0x1adbc(%rip), %rdi     # 0x3fd55
leaq 0x1a650(%rip), %rsi     # 0x3f5f0
movl $0xb2, %edx
leaq 0x1afad(%rip), %rcx     # 0x3ff59
callq 0x20c0
movl $0x4, %edi
movl $0x35, %esi
movl $0x25, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x24fe1
jmp 0x24fe3
jmp 0x25002
leaq 0x1ad99(%rip), %rdi     # 0x3fd83
leaq 0x1a5ff(%rip), %rsi     # 0x3f5f0
movl $0xb3, %edx
leaq 0x1af5c(%rip), %rcx     # 0x3ff59
callq 0x20c0
movl $0x4, %edi
movl $0x35, %esi
movl $0x1d, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x25032
jmp 0x25034
jmp 0x25053
leaq 0x1ad76(%rip), %rdi     # 0x3fdb1
leaq 0x1a5ae(%rip), %rsi     # 0x3f5f0
movl $0xb4, %edx
leaq 0x1af0b(%rip), %rcx     # 0x3ff59
callq 0x20c0
movl $0x4, %edi
movl $0x35, %esi
movl $0x3d, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x25083
jmp 0x25085
jmp 0x250a4
leaq 0x1ad53(%rip), %rdi     # 0x3fddf
leaq 0x1a55d(%rip), %rsi     # 0x3f5f0
movl $0xb5, %edx
leaq 0x1aeba(%rip), %rcx     # 0x3ff59
callq 0x20c0
movl $0x4, %edi
movl $0x35, %esi
movl $0x36, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x250d4
jmp 0x250d6
jmp 0x250f5
leaq 0x1ad30(%rip), %rdi     # 0x3fe0d
leaq 0x1a50c(%rip), %rsi     # 0x3f5f0
movl $0xb6, %edx
leaq 0x1ae69(%rip), %rcx     # 0x3ff59
callq 0x20c0
movl $0x4, %edi
movl $0x35, %esi
movl $0x37, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x25125
jmp 0x25127
jmp 0x25146
leaq 0x1ad0d(%rip), %rdi     # 0x3fe3b
leaq 0x1a4bb(%rip), %rsi     # 0x3f5f0
movl $0xb7, %edx
leaq 0x1ae18(%rip), %rcx     # 0x3ff59
callq 0x20c0
movl $0x4, %edi
movl $0x35, %esi
movl $0x34, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x25176
jmp 0x25178
jmp 0x25197
leaq 0x1acea(%rip), %rdi     # 0x3fe69
leaq 0x1a46a(%rip), %rsi     # 0x3f5f0
movl $0xb8, %edx
leaq 0x1adc7(%rip), %rcx     # 0x3ff59
callq 0x20c0
movl $0x4, %edi
movl $0x35, %esi
movl $0x33, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x251c7
jmp 0x251c9
jmp 0x251e8
leaq 0x1acc7(%rip), %rdi     # 0x3fe97
leaq 0x1a419(%rip), %rsi     # 0x3f5f0
movl $0xb9, %edx
leaq 0x1ad76(%rip), %rcx     # 0x3ff59
callq 0x20c0
movl $0x4, %edi
movl $0x35, %esi
movl $0x32, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x25218
jmp 0x2521a
jmp 0x25239
leaq 0x1aca4(%rip), %rdi     # 0x3fec5
leaq 0x1a3c8(%rip), %rsi     # 0x3f5f0
movl $0xba, %edx
leaq 0x1ad25(%rip), %rcx     # 0x3ff59
callq 0x20c0
addq $0x280, %rsp            # imm = 0x280
popq %rbp
retq
nopw %cs:(%rax,%rax)