// File: /workspace/github_cpp_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
leaq 0x1c927(%rip), %rsi     # 0x2c02d
movq %rsp, %rbx
movq %rbx, %rdi
callq 0xa1b8
xorl %r14d, %r14d
pushq $0x1
popq %rbp
leaq 0xedd92(%rip), %r12     # 0xfd4b0
xorl %r13d, %r13d
xorl %r15d, %r15d
cmpq $0x40, %r14
je 0xf759
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x3698
testb %al, %al
je 0xf73f
orq (%r12,%r14,8), %r13
movq %rbx, %rdi
movl %r14d, %esi
xorl %edx, %edx
callq 0x3698
testb %al, %al
je 0xf754
orq (%r12,%r14,8), %r15
incq %r14
jmp 0xf724
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 0xf8b1
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 0xf8d0
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1c798(%rip), %rdi     # 0x2c050
leaq 0x1c1a7(%rip), %rsi     # 0x2ba66
leaq 0x1c92e(%rip), %rcx     # 0x2c1f4
movl $0x90, %edx
callq 0x20c0
leaq 0x1c93b(%rip), %rdi     # 0x2c212
leaq 0x1c188(%rip), %rsi     # 0x2ba66
leaq 0x1c90f(%rip), %rcx     # 0x2c1f4
movl $0x98, %edx
callq 0x20c0