// File: /workspace/github_cpp_makefile_star2_O1/jswaff[P]prophet3/test/attack__test.cpp
// Function: test_attacked_by_queen()
void test_attacked_by_queen() {
    position pos;
    set_pos(&pos,"8/1r3k2/8/3qQ3/8/8/8/3K4 b - - 0 1");

    uint64 white_map=0,black_map=0;
    for (int32 sq=A8;sq<=H1;sq++) {
        if (attacked_by_queen(&pos,(square_t)sq,WHITE)) {
            white_map |= bb_squares[sq];
        }

        if (attacked_by_queen(&pos,(square_t)sq,BLACK)) {
            black_map |= bb_squares[sq];
        }
    }

    assert(white_map==(bb_squares[D6] | bb_squares[C7] | bb_squares[B8]
            | bb_squares[F6] | bb_squares[G7] | bb_squares[H8]
            | bb_squares[D4] | bb_squares[C3] | bb_squares[B2] | bb_squares[A1]
            | bb_squares[F4] | bb_squares[G3] | bb_squares[H2]
            | bb_squares[E6] | bb_squares[E7] | bb_squares[E8]
            | bb_squares[E4] | bb_squares[E3] | bb_squares[E2] | bb_squares[E1]
            | bb_squares[D5] | bb_squares[F5] | bb_squares[G5] | bb_squares[H5] ));

    assert(black_map==(bb_squares[C6] | bb_squares[B7]
            | bb_squares[E6] | bb_squares[F7]
            | bb_squares[C4] | bb_squares[B3] | bb_squares[A2]
            | bb_squares[E4] | bb_squares[F3] | bb_squares[G2] | bb_squares[H1]
            | bb_squares[C5] | bb_squares[B5] | bb_squares[A5] | bb_squares[E5]
            | bb_squares[D6] | bb_squares[D7] | bb_squares[D8]
            | bb_squares[D4] | bb_squares[D3] | bb_squares[D2] | bb_squares[D1]));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d0, %rsp            # imm = 0x1D0
leaq 0x1da6a(%rip), %rsi     # 0x2dffd
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa74
xorl %r14d, %r14d
leaq 0xe9f06(%rip), %r12     # 0xfa4b0
xorl %r15d, %r15d
xorl %r13d, %r13d
movq %rbx, %rdi
movl %r14d, %esi
movl $0x1, %edx
callq 0x3828
testb %al, %al
je 0x105c8
orq (%r12,%r14,8), %r13
movq %rbx, %rdi
movl %r14d, %esi
xorl %edx, %edx
callq 0x3828
testb %al, %al
je 0x105dd
orq (%r12,%r14,8), %r15
incq %r14
cmpq $0x40, %r14
jne 0x105b0
movq 0x50(%r12), %rcx
movq 0x118(%r12), %rax
orq 0x8(%r12), %rcx
orq 0xa8(%r12), %rcx
orq 0x70(%r12), %rcx
orq 0x38(%r12), %rcx
orq 0x150(%r12), %rcx
orq 0x188(%r12), %rcx
orq 0x1c0(%r12), %rcx
orq 0x128(%r12), %rcx
orq 0x170(%r12), %rcx
orq 0x1b8(%r12), %rcx
orq 0x60(%r12), %rcx
orq 0x20(%r12), %rcx
orq 0x160(%r12), %rcx
orq 0x1a0(%r12), %rcx
orq 0x1e0(%r12), %rcx
orq 0xd8(%r12), %rcx
orq 0xe8(%r12), %rcx
orq 0xf0(%r12), %rcx
orq 0xf8(%r12), %rcx
orq 0x98(%r12), %rax
orq 0xa0(%r12), %rax
orq 0x120(%r12), %rax
orq %rax, %rcx
cmpq %rcx, %r13
jne 0x1073d
movq 0x90(%r12), %rcx
orq 0x48(%r12), %rcx
orq 0x68(%r12), %rcx
orq 0x110(%r12), %rcx
orq 0x148(%r12), %rcx
orq 0x180(%r12), %rcx
orq 0x168(%r12), %rcx
orq 0x1b0(%r12), %rcx
orq 0x1f8(%r12), %rcx
orq 0xd0(%r12), %rcx
orq 0xc8(%r12), %rcx
orq 0xc0(%r12), %rcx
orq 0xe0(%r12), %rcx
orq 0x58(%r12), %rcx
orq 0x18(%r12), %rcx
orq 0x158(%r12), %rcx
orq 0x198(%r12), %rcx
orq 0x1d8(%r12), %rcx
orq %rax, %rcx
cmpq %rcx, %r15
jne 0x1075c
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x1d8dc(%rip), %rdi     # 0x2e020
leaq 0x1d2eb(%rip), %rsi     # 0x2da36
leaq 0x1da72(%rip), %rcx     # 0x2e1c4
movl $0x90, %edx
callq 0x20d0
leaq 0x1da7f(%rip), %rdi     # 0x2e1e2
leaq 0x1d2cc(%rip), %rsi     # 0x2da36
leaq 0x1da53(%rip), %rcx     # 0x2e1c4
movl $0x98, %edx
callq 0x20d0