// File: jswaff[P]prophet3/test/movegen__test.cpp
// Function: test_gen_bishop_moves()
void test_gen_bishop_moves() {
    position pos;
    set_pos(&pos,"4k3/2p3P1/8/4B3/4B3/3p1P2/8/4K3 w - - 0 1");

    move moves[20];
    move *mp = gen_bishop_moves(moves,&pos,E5,true,true);
    mp = gen_bishop_moves(mp,&pos,E4,true,true);

    assert((mp - moves) == 18);
    assert(is_in_move_list(to_move(BISHOP,E5,F6),moves,mp));
    assert(is_in_move_list(to_move(BISHOP,E5,F4),moves,mp));
    assert(is_in_move_list(to_move(BISHOP,E5,G3),moves,mp));
    assert(is_in_move_list(to_move(BISHOP,E5,H2),moves,mp));
    assert(is_in_move_list(to_move(BISHOP,E5,D4),moves,mp));
    assert(is_in_move_list(to_move(BISHOP,E5,C3),moves,mp));
    assert(is_in_move_list(to_move(BISHOP,E5,B2),moves,mp));
    assert(is_in_move_list(to_move(BISHOP,E5,A1),moves,mp));
    assert(is_in_move_list(to_move(BISHOP,E5,D6),moves,mp));
    assert(is_in_move_list(to_capture(BISHOP,E5,C7,PAWN),moves,mp));
    assert(is_in_move_list(to_move(BISHOP,E4,F5),moves,mp));
    assert(is_in_move_list(to_move(BISHOP,E4,G6),moves,mp));
    assert(is_in_move_list(to_move(BISHOP,E4,H7),moves,mp));
    assert(is_in_move_list(to_capture(BISHOP,E4,D3,PAWN),moves,mp));
    assert(is_in_move_list(to_move(BISHOP,E4,D5),moves,mp));
    assert(is_in_move_list(to_move(BISHOP,E4,C6),moves,mp));
    assert(is_in_move_list(to_move(BISHOP,E4,B7),moves,mp));
    assert(is_in_move_list(to_move(BISHOP,E4,A8),moves,mp));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x280, %rsp            # imm = 0x280
leaq -0x1c8(%rbp), %rdi
leaq 0x1bd46(%rip), %rsi     # 0x3f8bf
callq 0xf3e0
leaq -0x270(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movl $0x1c, %edx
movl $0x1, %r8d
movl %r8d, %ecx
callq 0xc0d0
movq %rax, -0x278(%rbp)
movq -0x278(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movl $0x24, %edx
movl $0x1, %r8d
movl %r8d, %ecx
callq 0xc0d0
movq %rax, -0x278(%rbp)
movq -0x278(%rbp), %rax
leaq -0x270(%rbp), %rcx
subq %rcx, %rax
sarq $0x3, %rax
cmpq $0x12, %rax
jne 0x23beb
jmp 0x23c0a
leaq 0x1bcf7(%rip), %rdi     # 0x3f8e9
leaq 0x1b9f7(%rip), %rsi     # 0x3f5f0
movl $0x3f, %edx
leaq 0x1bcf7(%rip), %rcx     # 0x3f8fc
callq 0x20c0
movl $0x3, %edi
movl $0x1c, %esi
movl $0x15, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x23c3a
jmp 0x23c3c
jmp 0x23c5b
leaq 0x1bcd6(%rip), %rdi     # 0x3f919
leaq 0x1b9a6(%rip), %rsi     # 0x3f5f0
movl $0x40, %edx
leaq 0x1bca6(%rip), %rcx     # 0x3f8fc
callq 0x20c0
movl $0x3, %edi
movl $0x1c, %esi
movl $0x25, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x23c8b
jmp 0x23c8d
jmp 0x23cac
leaq 0x1bcb5(%rip), %rdi     # 0x3f949
leaq 0x1b955(%rip), %rsi     # 0x3f5f0
movl $0x41, %edx
leaq 0x1bc55(%rip), %rcx     # 0x3f8fc
callq 0x20c0
movl $0x3, %edi
movl $0x1c, %esi
movl $0x2e, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x23cdc
jmp 0x23cde
jmp 0x23cfd
leaq 0x1bc94(%rip), %rdi     # 0x3f979
leaq 0x1b904(%rip), %rsi     # 0x3f5f0
movl $0x42, %edx
leaq 0x1bc04(%rip), %rcx     # 0x3f8fc
callq 0x20c0
movl $0x3, %edi
movl $0x1c, %esi
movl $0x37, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x23d2d
jmp 0x23d2f
jmp 0x23d4e
leaq 0x1bc73(%rip), %rdi     # 0x3f9a9
leaq 0x1b8b3(%rip), %rsi     # 0x3f5f0
movl $0x43, %edx
leaq 0x1bbb3(%rip), %rcx     # 0x3f8fc
callq 0x20c0
movl $0x3, %edi
movl $0x1c, %esi
movl $0x23, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x23d7e
jmp 0x23d80
jmp 0x23d9f
leaq 0x1bc52(%rip), %rdi     # 0x3f9d9
leaq 0x1b862(%rip), %rsi     # 0x3f5f0
movl $0x44, %edx
leaq 0x1bb62(%rip), %rcx     # 0x3f8fc
callq 0x20c0
movl $0x3, %edi
movl $0x1c, %esi
movl $0x2a, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x23dcf
jmp 0x23dd1
jmp 0x23df0
leaq 0x1bc31(%rip), %rdi     # 0x3fa09
leaq 0x1b811(%rip), %rsi     # 0x3f5f0
movl $0x45, %edx
leaq 0x1bb11(%rip), %rcx     # 0x3f8fc
callq 0x20c0
movl $0x3, %edi
movl $0x1c, %esi
movl $0x31, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x23e20
jmp 0x23e22
jmp 0x23e41
leaq 0x1bc10(%rip), %rdi     # 0x3fa39
leaq 0x1b7c0(%rip), %rsi     # 0x3f5f0
movl $0x46, %edx
leaq 0x1bac0(%rip), %rcx     # 0x3f8fc
callq 0x20c0
movl $0x3, %edi
movl $0x1c, %esi
movl $0x38, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x23e71
jmp 0x23e73
jmp 0x23e92
leaq 0x1bbef(%rip), %rdi     # 0x3fa69
leaq 0x1b76f(%rip), %rsi     # 0x3f5f0
movl $0x47, %edx
leaq 0x1ba6f(%rip), %rcx     # 0x3f8fc
callq 0x20c0
movl $0x3, %edi
movl $0x1c, %esi
movl $0x13, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x23ec2
jmp 0x23ec4
jmp 0x23ee3
leaq 0x1bbce(%rip), %rdi     # 0x3fa99
leaq 0x1b71e(%rip), %rsi     # 0x3f5f0
movl $0x48, %edx
leaq 0x1ba1e(%rip), %rcx     # 0x3f8fc
callq 0x20c0
movl $0x3, %edi
movl $0x1c, %esi
movl $0xa, %edx
movl $0x1, %ecx
callq 0xa890
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x23f18
jmp 0x23f1a
jmp 0x23f39
leaq 0x1bba8(%rip), %rdi     # 0x3fac9
leaq 0x1b6c8(%rip), %rsi     # 0x3f5f0
movl $0x49, %edx
leaq 0x1b9c8(%rip), %rcx     # 0x3f8fc
callq 0x20c0
movl $0x3, %edi
movl $0x24, %esi
movl $0x1d, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x23f69
jmp 0x23f6b
jmp 0x23f8a
leaq 0x1bb8f(%rip), %rdi     # 0x3fb01
leaq 0x1b677(%rip), %rsi     # 0x3f5f0
movl $0x4a, %edx
leaq 0x1b977(%rip), %rcx     # 0x3f8fc
callq 0x20c0
movl $0x3, %edi
movl $0x24, %esi
movl $0x16, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x23fba
jmp 0x23fbc
jmp 0x23fdb
leaq 0x1bb6e(%rip), %rdi     # 0x3fb31
leaq 0x1b626(%rip), %rsi     # 0x3f5f0
movl $0x4b, %edx
leaq 0x1b926(%rip), %rcx     # 0x3f8fc
callq 0x20c0
movl $0x3, %edi
movl $0x24, %esi
movl $0xf, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x2400b
jmp 0x2400d
jmp 0x2402c
leaq 0x1bb4d(%rip), %rdi     # 0x3fb61
leaq 0x1b5d5(%rip), %rsi     # 0x3f5f0
movl $0x4c, %edx
leaq 0x1b8d5(%rip), %rcx     # 0x3f8fc
callq 0x20c0
movl $0x3, %edi
movl $0x24, %esi
movl $0x2b, %edx
movl $0x1, %ecx
callq 0xa890
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x24061
jmp 0x24063
jmp 0x24082
leaq 0x1bb27(%rip), %rdi     # 0x3fb91
leaq 0x1b57f(%rip), %rsi     # 0x3f5f0
movl $0x4d, %edx
leaq 0x1b87f(%rip), %rcx     # 0x3f8fc
callq 0x20c0
movl $0x3, %edi
movl $0x24, %esi
movl $0x1b, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x240b2
jmp 0x240b4
jmp 0x240d3
leaq 0x1bb0e(%rip), %rdi     # 0x3fbc9
leaq 0x1b52e(%rip), %rsi     # 0x3f5f0
movl $0x4e, %edx
leaq 0x1b82e(%rip), %rcx     # 0x3f8fc
callq 0x20c0
movl $0x3, %edi
movl $0x24, %esi
movl $0x12, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x24103
jmp 0x24105
jmp 0x24124
leaq 0x1baed(%rip), %rdi     # 0x3fbf9
leaq 0x1b4dd(%rip), %rsi     # 0x3f5f0
movl $0x4f, %edx
leaq 0x1b7dd(%rip), %rcx     # 0x3f8fc
callq 0x20c0
movl $0x3, %edi
movl $0x24, %esi
movl $0x9, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x24154
jmp 0x24156
jmp 0x24175
leaq 0x1bacc(%rip), %rdi     # 0x3fc29
leaq 0x1b48c(%rip), %rsi     # 0x3f5f0
movl $0x50, %edx
leaq 0x1b78c(%rip), %rcx     # 0x3f8fc
callq 0x20c0
movl $0x3, %edi
movl $0x24, %esi
xorl %edx, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x241a2
jmp 0x241a4
jmp 0x241c3
leaq 0x1baae(%rip), %rdi     # 0x3fc59
leaq 0x1b43e(%rip), %rsi     # 0x3f5f0
movl $0x51, %edx
leaq 0x1b73e(%rip), %rcx     # 0x3f8fc
callq 0x20c0
addq $0x280, %rsp            # imm = 0x280
popq %rbp
retq
nopl (%rax)