// File: SethKasmann[P]clever-girl/src/state.h
// Function: State::isAttacked(Square, Color, unsigned long long) const
inline
bool State::isAttacked(Square pSquare, Color pColor, U64 pChange) const
{
    U64 occupancy = getOccupancyBB() ^ pChange;
    return getAttackBB<pawn>(pSquare, pColor) & getPieceBB<pawn>(!pColor)
        || getAttackBB<knight>(pSquare) & getPieceBB<knight>(!pColor)
        || Bmagic(pSquare, occupancy) & (getPieceBB<bishop>(!pColor) | getPieceBB<queen>(!pColor))
        || Rmagic(pSquare, occupancy) & (getPieceBB<rook>(!pColor) | getPieceBB<queen>(!pColor))
        || getAttackBB<king>(pSquare) & getPieceBB<king>(!pColor);
}

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x60(%rsp)
movl %esi, 0x5c(%rsp)
movl %edx, 0x58(%rsp)
movq %rcx, 0x50(%rsp)
movq 0x60(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x24bc0
movq 0x30(%rsp), %rdi
xorq 0x50(%rsp), %rax
movq %rax, 0x48(%rsp)
movl 0x5c(%rsp), %esi
movl 0x58(%rsp), %edx
callq 0x257b0
movq %rax, 0x38(%rsp)
movl 0x58(%rsp), %edi
callq 0x24ce0
movq 0x30(%rsp), %rdi
movl %eax, %esi
callq 0x24b80
movq 0x38(%rsp), %rcx
andq %rax, %rcx
movb $0x1, %al
cmpq $0x0, %rcx
movb %al, 0x47(%rsp)
jne 0x3a469
movq 0x30(%rsp), %rdi
movl 0x5c(%rsp), %esi
xorl %edx, %edx
callq 0x25160
movq %rax, 0x28(%rsp)
movl 0x58(%rsp), %edi
callq 0x24ce0
movq 0x30(%rsp), %rdi
movl %eax, %esi
callq 0x25bb0
movq 0x28(%rsp), %rcx
andq %rax, %rcx
movb $0x1, %al
cmpq $0x0, %rcx
movb %al, 0x47(%rsp)
jne 0x3a469
movl 0x5c(%rsp), %ecx
movq 0x48(%rsp), %rax
movl %ecx, 0x74(%rsp)
movq %rax, 0x68(%rsp)
movl 0x74(%rsp), %eax
movl %eax, %ecx
leaq 0x16ff9(%rip), %rax     # 0x512c0
movq (%rax,%rcx,8), %rax
movq 0x68(%rsp), %rdx
movl 0x74(%rsp), %ecx
movl %ecx, %esi
leaq 0x65f3(%rip), %rcx      # 0x408d0
andq (%rcx,%rsi,8), %rdx
movl 0x74(%rsp), %ecx
movl %ecx, %esi
leaq 0x63e2(%rip), %rcx      # 0x406d0
imulq (%rcx,%rsi,8), %rdx
movl 0x74(%rsp), %ecx
movl %ecx, %esi
leaq 0x62d0(%rip), %rcx      # 0x405d0
movl (%rcx,%rsi,4), %ecx
shrq %cl, %rdx
movq %rdx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x18(%rsp)
movl 0x58(%rsp), %edi
callq 0x24ce0
movq 0x30(%rsp), %rdi
movl %eax, %esi
callq 0x25bf0
movq %rax, 0x20(%rsp)
movl 0x58(%rsp), %edi
callq 0x24ce0
movq 0x30(%rsp), %rdi
movl %eax, %esi
callq 0x2b3d0
movq 0x18(%rsp), %rcx
movq %rax, %rdx
movq 0x20(%rsp), %rax
orq %rdx, %rax
andq %rax, %rcx
movb $0x1, %al
cmpq $0x0, %rcx
movb %al, 0x47(%rsp)
jne 0x3a469
movl 0x5c(%rsp), %ecx
movq 0x48(%rsp), %rax
movl %ecx, 0x84(%rsp)
movq %rax, 0x78(%rsp)
movl 0x84(%rsp), %eax
movl %eax, %ecx
leaq 0x17137(%rip), %rax     # 0x514c0
movq (%rax,%rcx,8), %rax
movq 0x78(%rsp), %rdx
movl 0x84(%rsp), %ecx
movl %ecx, %esi
leaq 0x602e(%rip), %rcx      # 0x403d0
andq (%rcx,%rsi,8), %rdx
movl 0x84(%rsp), %ecx
movl %ecx, %esi
leaq 0x5e1a(%rip), %rcx      # 0x401d0
imulq (%rcx,%rsi,8), %rdx
movl 0x84(%rsp), %ecx
movl %ecx, %esi
leaq 0x5d05(%rip), %rcx      # 0x400d0
movl (%rcx,%rsi,4), %ecx
shrq %cl, %rdx
movq %rdx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x8(%rsp)
movl 0x58(%rsp), %edi
callq 0x24ce0
movq 0x30(%rsp), %rdi
movl %eax, %esi
callq 0x2b410
movq %rax, 0x10(%rsp)
movl 0x58(%rsp), %edi
callq 0x24ce0
movq 0x30(%rsp), %rdi
movl %eax, %esi
callq 0x2b3d0
movq 0x8(%rsp), %rcx
movq %rax, %rdx
movq 0x10(%rsp), %rax
orq %rdx, %rax
andq %rax, %rcx
movb $0x1, %al
cmpq $0x0, %rcx
movb %al, 0x47(%rsp)
jne 0x3a469
movq 0x30(%rsp), %rdi
movl 0x5c(%rsp), %esi
xorl %edx, %edx
callq 0x2a790
movq %rax, (%rsp)
movl 0x58(%rsp), %edi
callq 0x24ce0
movq 0x30(%rsp), %rdi
movl %eax, %esi
callq 0x25510
movq %rax, %rcx
movq (%rsp), %rax
andq %rcx, %rax
cmpq $0x0, %rax
setne %al
movb %al, 0x47(%rsp)
movb 0x47(%rsp), %al
andb $0x1, %al
addq $0x88, %rsp
retq
nopw (%rax,%rax)