// File: niekh1234[P]nnchesslib/rays.cpp
// Function: nnchesslib::Rays::initRays()
void Rays::initRays()
{
    for(int sq = 0; sq < 64; sq++)
    {
        rays[NORTH][sq] = 0x0101010101010100ULL << sq;

        rays[EAST][sq] = 2 * (((U64)1 << (sq | 7)) - ((U64)1 << sq));

        rays[SOUTH][sq] = 0x0080808080808080ULL >> (63 - sq);

        rays[WEST][sq] = ((U64)1 << sq) - ((U64)1 << (sq & 56)) ;

        rays[NORTH_WEST][sq] = northWest(0x102040810204000ULL, 7 - file(sq)) << (rank(sq) * 8);

        rays[NORTH_EAST][sq] = northEast(0x8040201008040200ULL, file(sq)) << (rank(sq) * 8);

        rays[SOUTH_WEST][sq] = northWest(0x40201008040201ULL, 7 - file(sq)) >> ((7 - rank(sq)) * 8);

        rays[SOUTH_EAST][sq] = northEast(0x2040810204080ULL, file(sq)) >> ((7 - rank(sq)) * 8);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x0, -0x4(%rbp)
cmpl $0x40, -0x4(%rbp)
jge 0xd625
movl -0x4(%rbp), %eax
movl %eax, %ecx
movabsq $0x101010101010100, %rdx # imm = 0x101010101010100
shlq %cl, %rdx
movslq -0x4(%rbp), %rcx
leaq 0x287b6a(%rip), %rax    # 0x294fb0
movq %rdx, (%rax,%rcx,8)
movl -0x4(%rbp), %eax
orl $0x7, %eax
movl %eax, %eax
movl %eax, %ecx
movl $0x1, %edx
shlq %cl, %rdx
movl -0x4(%rbp), %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
subq %rax, %rdx
shlq %rdx
movslq -0x4(%rbp), %rcx
leaq 0x287b36(%rip), %rax    # 0x294fb0
movq %rdx, 0x200(%rax,%rcx,8)
movl $0x3f, %eax
subl -0x4(%rbp), %eax
movl %eax, %eax
movl %eax, %ecx
movabsq $0x80808080808080, %rdx # imm = 0x80808080808080
shrq %cl, %rdx
movslq -0x4(%rbp), %rcx
leaq 0x287b0a(%rip), %rax    # 0x294fb0
movq %rdx, 0x400(%rax,%rcx,8)
movl -0x4(%rbp), %eax
movl %eax, %ecx
movl $0x1, %edx
shlq %cl, %rdx
movl -0x4(%rbp), %eax
andl $0x38, %eax
movl %eax, %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
subq %rax, %rdx
movslq -0x4(%rbp), %rcx
leaq 0x287ad5(%rip), %rax    # 0x294fb0
movq %rdx, 0x600(%rax,%rcx,8)
movl -0x4(%rbp), %edi
callq 0xd3d0
movl $0x7, %esi
subl %eax, %esi
movabsq $0x102040810204000, %rdi # imm = 0x102040810204000
callq 0xd6f0
movq %rax, -0x28(%rbp)
movl -0x4(%rbp), %edi
callq 0xd3f0
movq -0x28(%rbp), %rdx
shll $0x3, %eax
movl %eax, %eax
movl %eax, %ecx
shlq %cl, %rdx
movslq -0x4(%rbp), %rcx
leaq 0x287a8a(%rip), %rax    # 0x294fb0
movq %rdx, 0xa00(%rax,%rcx,8)
movl -0x4(%rbp), %edi
callq 0xd3d0
movl %eax, %esi
movabsq $-0x7fbfdfeff7fbfe00, %rdi # imm = 0x8040201008040200
callq 0xd740
movq %rax, -0x20(%rbp)
movl -0x4(%rbp), %edi
callq 0xd3f0
movq -0x20(%rbp), %rdx
shll $0x3, %eax
movl %eax, %eax
movl %eax, %ecx
shlq %cl, %rdx
movslq -0x4(%rbp), %rcx
leaq 0x287a44(%rip), %rax    # 0x294fb0
movq %rdx, 0x800(%rax,%rcx,8)
movl -0x4(%rbp), %edi
callq 0xd3d0
movl $0x7, %esi
subl %eax, %esi
movabsq $0x40201008040201, %rdi # imm = 0x40201008040201
callq 0xd6f0
movq %rax, -0x18(%rbp)
movl -0x4(%rbp), %edi
callq 0xd3f0
movq -0x18(%rbp), %rdx
movl %eax, %ecx
movl $0x7, %eax
subl %ecx, %eax
shll $0x3, %eax
movl %eax, %eax
movl %eax, %ecx
shrq %cl, %rdx
movslq -0x4(%rbp), %rcx
leaq 0x2879f0(%rip), %rax    # 0x294fb0
movq %rdx, 0xe00(%rax,%rcx,8)
movl -0x4(%rbp), %edi
callq 0xd3d0
movl %eax, %esi
movabsq $0x2040810204080, %rdi  # imm = 0x2040810204080
callq 0xd740
movq %rax, -0x10(%rbp)
movl -0x4(%rbp), %edi
callq 0xd3f0
movq -0x10(%rbp), %rdx
movl %eax, %ecx
movl $0x7, %eax
subl %ecx, %eax
shll $0x3, %eax
movl %eax, %eax
movl %eax, %ecx
shrq %cl, %rdx
movslq -0x4(%rbp), %rcx
leaq 0x2879a1(%rip), %rax    # 0x294fb0
movq %rdx, 0xc00(%rax,%rcx,8)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xd41f
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)