// File: bjohnsonfl[P]Overhead-Chess-Engine-/bitboard.cpp
// Function: inBetweenBitMask()
void inBetweenBitMask(){
    //credit to stockfish
    for(square sq1= a1; sq1<numOfSq; sq1++){
        for(square sq2= a1; sq2<numOfSq; sq2++){
            if(!(openBoardAttacks[p_rook][sq1] & squareBitMask[sq2])) continue;
            
            inBetweenSqBitMask[sq1][sq2] = sliderAttacks(sq1, squareBitMask[sq2], p_rook) & sliderAttacks(sq2, squareBitMask[sq1], p_rook);
            lineSqBitMask[sq1][sq2] = (sliderAttacks(sq1, 0, p_rook) & sliderAttacks(sq2, 0, p_rook)) | squareBitMask[sq1] |squareBitMask[sq2] ;
           
            
        }
        for(square sq2= a1; sq2<numOfSq; sq2++){
            
            if(!(openBoardAttacks[p_bishop][sq1] & squareBitMask[sq2])) continue;
            inBetweenSqBitMask[sq1][sq2] = sliderAttacks(sq1, squareBitMask[sq2], p_bishop) & sliderAttacks(sq2, squareBitMask[sq1], p_bishop);
            lineSqBitMask[sq1][sq2] = (sliderAttacks(sq1, 0, p_bishop) & sliderAttacks(sq2, 0, p_bishop)) | squareBitMask[sq1] |squareBitMask[sq2] ;
                
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x0, -0x4(%rbp)
cmpl $0x40, -0x4(%rbp)
jge 0x5607
movl $0x0, -0x8(%rbp)
cmpl $0x40, -0x8(%rbp)
jge 0x54df
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0xe1ba(%rip), %rax      # 0x135a0
movq 0x600(%rax,%rcx,8), %rax
movl -0x8(%rbp), %ecx
movl %ecx, %edx
leaq 0xdaa6(%rip), %rcx      # 0x12ea0
andq (%rcx,%rdx,8), %rax
cmpq $0x0, %rax
jne 0x5409
jmp 0x54cf
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0xda88(%rip), %rax      # 0x12ea0
movq (%rax,%rcx,8), %rsi
movl $0x3, %edx
callq 0x57b0
movq %rax, -0x20(%rbp)
movl -0x8(%rbp), %edi
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0xda67(%rip), %rax      # 0x12ea0
movq (%rax,%rcx,8), %rsi
movl $0x3, %edx
callq 0x57b0
movq -0x20(%rbp), %rdx
andq %rax, %rdx
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0xf146(%rip), %rax      # 0x145a0
shlq $0x9, %rcx
addq %rcx, %rax
movl -0x8(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movl -0x4(%rbp), %edi
xorl %eax, %eax
movl %eax, %esi
movl $0x3, %edx
callq 0x57b0
movq %rax, -0x18(%rbp)
movl -0x8(%rbp), %edi
xorl %eax, %eax
movl %eax, %esi
movl $0x3, %edx
callq 0x57b0
movq -0x18(%rbp), %rdx
andq %rax, %rdx
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0xd9ff(%rip), %rax      # 0x12ea0
orq (%rax,%rcx,8), %rdx
movl -0x8(%rbp), %eax
movl %eax, %ecx
leaq 0xd9ef(%rip), %rax      # 0x12ea0
orq (%rax,%rcx,8), %rdx
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x170df(%rip), %rax     # 0x1c5a0
shlq $0x9, %rcx
addq %rcx, %rax
movl -0x8(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
leaq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x5a80
jmp 0x53d0
movl $0x0, -0xc(%rbp)
cmpl $0x40, -0xc(%rbp)
jge 0x55f5
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0xe0a4(%rip), %rax      # 0x135a0
movq 0x400(%rax,%rcx,8), %rax
movl -0xc(%rbp), %ecx
movl %ecx, %edx
leaq 0xd990(%rip), %rcx      # 0x12ea0
andq (%rcx,%rdx,8), %rax
cmpq $0x0, %rax
jne 0x551f
jmp 0x55e5
movl -0x4(%rbp), %edi
movl -0xc(%rbp), %eax
movl %eax, %ecx
leaq 0xd972(%rip), %rax      # 0x12ea0
movq (%rax,%rcx,8), %rsi
movl $0x2, %edx
callq 0x57b0
movq %rax, -0x30(%rbp)
movl -0xc(%rbp), %edi
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0xd951(%rip), %rax      # 0x12ea0
movq (%rax,%rcx,8), %rsi
movl $0x2, %edx
callq 0x57b0
movq -0x30(%rbp), %rdx
andq %rax, %rdx
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0xf030(%rip), %rax      # 0x145a0
shlq $0x9, %rcx
addq %rcx, %rax
movl -0xc(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movl -0x4(%rbp), %edi
xorl %eax, %eax
movl %eax, %esi
movl $0x2, %edx
callq 0x57b0
movq %rax, -0x28(%rbp)
movl -0xc(%rbp), %edi
xorl %eax, %eax
movl %eax, %esi
movl $0x2, %edx
callq 0x57b0
movq -0x28(%rbp), %rdx
andq %rax, %rdx
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0xd8e9(%rip), %rax      # 0x12ea0
orq (%rax,%rcx,8), %rdx
movl -0xc(%rbp), %eax
movl %eax, %ecx
leaq 0xd8d9(%rip), %rax      # 0x12ea0
orq (%rax,%rcx,8), %rdx
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x16fc9(%rip), %rax     # 0x1c5a0
shlq $0x9, %rcx
addq %rcx, %rax
movl -0xc(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
leaq -0xc(%rbp), %rdi
xorl %esi, %esi
callq 0x5a80
jmp 0x54e6
jmp 0x55f7
leaq -0x4(%rbp), %rdi
xorl %esi, %esi
callq 0x5a80
jmp 0x53bf
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)