// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r14
pushq %rbx
subq $0x270, %rsp            # imm = 0x270
leaq 0x18772(%rip), %rsi     # 0x310e0
leaq 0xa8(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1b8
movq %rsp, %r14
pushq $0x1c
popq %rdx
pushq $0x1
popq %rbp
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %ecx
movl %ebp, %r8d
callq 0x80ac
pushq $0x24
popq %rdx
movq %rax, %rdi
movq %rbx, %rsi
movl %ebp, %ecx
movl %ebp, %r8d
callq 0x80ac
movq %rax, %rbx
subq %r14, %rax
cmpq $0x90, %rax
jne 0x18c55
pushq $0x3
popq %rdi
pushq $0x1c
popq %rsi
pushq $0x15
popq %rdx
callq 0x7284
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x18c71
pushq $0x3
popq %rdi
pushq $0x1c
popq %rsi
pushq $0x25
popq %rdx
callq 0x7284
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x18c8d
pushq $0x3
popq %rdi
pushq $0x1c
popq %rsi
pushq $0x2e
popq %rdx
callq 0x7284
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x18ca9
pushq $0x3
popq %rdi
pushq $0x1c
popq %rsi
pushq $0x37
popq %rdx
callq 0x7284
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x18cc5
pushq $0x3
popq %rdi
pushq $0x1c
popq %rsi
pushq $0x23
popq %rdx
callq 0x7284
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x18ce1
pushq $0x3
popq %rdi
pushq $0x1c
popq %rsi
pushq $0x2a
popq %rdx
callq 0x7284
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x18cfd
pushq $0x3
popq %rdi
pushq $0x1c
popq %rsi
pushq $0x31
popq %rdx
callq 0x7284
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x18d19
pushq $0x3
popq %rdi
pushq $0x1c
popq %rsi
pushq $0x38
popq %rdx
callq 0x7284
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x18d35
pushq $0x3
popq %rdi
pushq $0x1c
popq %rsi
pushq $0x13
popq %rdx
callq 0x7284
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x18d51
pushq $0x3
popq %rdi
pushq $0x1c
popq %rsi
pushq $0xa
popq %rdx
pushq $0x1
popq %rcx
callq 0x72a3
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x18d6d
pushq $0x3
popq %rdi
pushq $0x24
popq %rsi
pushq $0x1d
popq %rdx
callq 0x7284
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x18d89
pushq $0x3
popq %rdi
pushq $0x24
popq %rsi
pushq $0x16
popq %rdx
callq 0x7284
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x18da5
pushq $0x3
popq %rdi
pushq $0x24
popq %rsi
pushq $0xf
popq %rdx
callq 0x7284
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x18dc1
pushq $0x3
popq %rdi
pushq $0x24
popq %rsi
pushq $0x2b
popq %rdx
pushq $0x1
popq %rcx
callq 0x72a3
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x18dda
pushq $0x3
popq %rdi
pushq $0x24
popq %rsi
pushq $0x1b
popq %rdx
callq 0x7284
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x18df3
pushq $0x3
popq %rdi
pushq $0x24
popq %rsi
pushq $0x12
popq %rdx
callq 0x7284
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x18e0c
pushq $0x3
popq %rdi
pushq $0x24
popq %rsi
pushq $0x9
popq %rdx
callq 0x7284
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x18e25
pushq $0x3
popq %rdi
pushq $0x24
popq %rsi
xorl %edx, %edx
callq 0x7284
movq %rsp, %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x18e3e
addq $0x270, %rsp            # imm = 0x270
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x184ae(%rip), %rdi     # 0x3110a
leaq 0x181ae(%rip), %rsi     # 0x30e11
leaq 0x184b3(%rip), %rcx     # 0x3111d
pushq $0x3f
jmp 0x18e55
leaq 0x184c2(%rip), %rdi     # 0x3113a
leaq 0x18192(%rip), %rsi     # 0x30e11
leaq 0x18497(%rip), %rcx     # 0x3111d
pushq $0x40
jmp 0x18e55
leaq 0x184d6(%rip), %rdi     # 0x3116a
leaq 0x18176(%rip), %rsi     # 0x30e11
leaq 0x1847b(%rip), %rcx     # 0x3111d
pushq $0x41
jmp 0x18e55
leaq 0x184ea(%rip), %rdi     # 0x3119a
leaq 0x1815a(%rip), %rsi     # 0x30e11
leaq 0x1845f(%rip), %rcx     # 0x3111d
pushq $0x42
jmp 0x18e55
leaq 0x184fe(%rip), %rdi     # 0x311ca
leaq 0x1813e(%rip), %rsi     # 0x30e11
leaq 0x18443(%rip), %rcx     # 0x3111d
pushq $0x43
jmp 0x18e55
leaq 0x18512(%rip), %rdi     # 0x311fa
leaq 0x18122(%rip), %rsi     # 0x30e11
leaq 0x18427(%rip), %rcx     # 0x3111d
pushq $0x44
jmp 0x18e55
leaq 0x18526(%rip), %rdi     # 0x3122a
leaq 0x18106(%rip), %rsi     # 0x30e11
leaq 0x1840b(%rip), %rcx     # 0x3111d
pushq $0x45
jmp 0x18e55
leaq 0x1853a(%rip), %rdi     # 0x3125a
leaq 0x180ea(%rip), %rsi     # 0x30e11
leaq 0x183ef(%rip), %rcx     # 0x3111d
pushq $0x46
jmp 0x18e55
leaq 0x1854e(%rip), %rdi     # 0x3128a
leaq 0x180ce(%rip), %rsi     # 0x30e11
leaq 0x183d3(%rip), %rcx     # 0x3111d
pushq $0x47
jmp 0x18e55
leaq 0x18562(%rip), %rdi     # 0x312ba
leaq 0x180b2(%rip), %rsi     # 0x30e11
leaq 0x183b7(%rip), %rcx     # 0x3111d
pushq $0x48
jmp 0x18e55
leaq 0x18576(%rip), %rdi     # 0x312ea
leaq 0x18096(%rip), %rsi     # 0x30e11
leaq 0x1839b(%rip), %rcx     # 0x3111d
pushq $0x49
jmp 0x18e55
leaq 0x18592(%rip), %rdi     # 0x31322
leaq 0x1807a(%rip), %rsi     # 0x30e11
leaq 0x1837f(%rip), %rcx     # 0x3111d
pushq $0x4a
jmp 0x18e55
leaq 0x185a6(%rip), %rdi     # 0x31352
leaq 0x1805e(%rip), %rsi     # 0x30e11
leaq 0x18363(%rip), %rcx     # 0x3111d
pushq $0x4b
jmp 0x18e55
leaq 0x185ba(%rip), %rdi     # 0x31382
leaq 0x18042(%rip), %rsi     # 0x30e11
leaq 0x18347(%rip), %rcx     # 0x3111d
pushq $0x4c
jmp 0x18e55
leaq 0x185d1(%rip), %rdi     # 0x313b2
leaq 0x18029(%rip), %rsi     # 0x30e11
leaq 0x1832e(%rip), %rcx     # 0x3111d
pushq $0x4d
jmp 0x18e55
leaq 0x185f0(%rip), %rdi     # 0x313ea
leaq 0x18010(%rip), %rsi     # 0x30e11
leaq 0x18315(%rip), %rcx     # 0x3111d
pushq $0x4e
jmp 0x18e55
leaq 0x18607(%rip), %rdi     # 0x3141a
leaq 0x17ff7(%rip), %rsi     # 0x30e11
leaq 0x182fc(%rip), %rcx     # 0x3111d
pushq $0x4f
jmp 0x18e55
leaq 0x1861e(%rip), %rdi     # 0x3144a
leaq 0x17fde(%rip), %rsi     # 0x30e11
leaq 0x182e3(%rip), %rcx     # 0x3111d
pushq $0x50
jmp 0x18e55
leaq 0x18635(%rip), %rdi     # 0x3147a
leaq 0x17fc5(%rip), %rsi     # 0x30e11
leaq 0x182ca(%rip), %rcx     # 0x3111d
pushq $0x51
popq %rdx
callq 0x20c0