// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
xorl %eax, %eax
leaq 0x8b62(%rip), %rdi      # 0xbde0
leaq 0x1a45b(%rip), %r12     # 0x1d6e0
leaq 0x1a654(%rip), %r13     # 0x1d8e0
xorl %ebp, %ebp
leaq 0x924b(%rip), %rcx      # 0xc4e0
movq 0x600(%rcx,%rbp,8), %rdx
leaq 0x4d8c(%rip), %rsi      # 0x8030
xorl %r8d, %r8d
movq (%r8,%rdi), %r9
testq %rdx, %r9
je 0x332a
leaq 0x1a229(%rip), %rbx     # 0x1d4e0
movq (%rbx,%rbp,8), %r10
andq %r9, %r10
imulq (%r12,%rbp,8), %r10
xorl %ecx, %ecx
leaq 0x4d64(%rip), %r11      # 0x8030
subb (%r11,%rbp,4), %cl
shrq %cl, %r10
movq (%rdi,%rbp,8), %r11
movq (%r8,%rbx), %rbx
andq %r11, %rbx
imulq (%r8,%r12), %rbx
movb (%rsi), %r14b
xorl %ecx, %ecx
subb %r14b, %cl
shrq %cl, %rbx
movl %r10d, %ecx
movq (%r13,%rbp,8), %r10
movl %ebx, %ebx
movq (%r8,%r13), %r14
movq (%r14,%rbx,8), %rbx
andq (%r10,%rcx,8), %rbx
leaq (%rax,%r8), %rcx
leaq 0xa1d1(%rip), %r15      # 0xd4e0
movq %rbx, (%r15,%rcx)
movq (%r14), %rbx
andq (%r10), %rbx
orq %r11, %r9
orq %rbx, %r9
leaq 0x121ba(%rip), %r10     # 0x154e0
movq %r9, (%r10,%rcx)
addq $0x8, %r8
addq $0x4, %rsi
cmpq $0x200, %r8             # imm = 0x200
jne 0x32a7
leaq 0x919a(%rip), %rcx      # 0xc4e0
movq 0x400(%rcx,%rbp,8), %rdx
leaq 0x4ddb(%rip), %rsi      # 0x8130
xorl %r8d, %r8d
movq (%r8,%rdi), %r9
testq %rdx, %r9
je 0x33ec
leaq 0xe2774(%rip), %rbx     # 0xe5ae0
movq (%rbx,%rbp,8), %r10
andq %r9, %r10
leaq 0xe2966(%rip), %r14     # 0xe5ce0
imulq (%r14,%rbp,8), %r10
xorl %ecx, %ecx
leaq 0x4da8(%rip), %r11      # 0x8130
subb (%r11,%rbp,4), %cl
shrq %cl, %r10
movq (%rdi,%rbp,8), %r11
movq (%r8,%rbx), %rbx
andq %r11, %rbx
imulq (%r8,%r14), %rbx
movb (%rsi), %r14b
xorl %ecx, %ecx
subb %r14b, %cl
shrq %cl, %rbx
movl %r10d, %ecx
leaq 0xe2b2c(%rip), %r14     # 0xe5ee0
movq (%r14,%rbp,8), %r10
movl %ebx, %ebx
movq (%r8,%r14), %r14
movq (%r14,%rbx,8), %rbx
andq (%r10,%rcx,8), %rbx
leaq (%rax,%r8), %rcx
leaq 0xa10f(%rip), %r15      # 0xd4e0
movq %rbx, (%r15,%rcx)
movq (%r14), %rbx
andq (%r10), %rbx
orq %r11, %r9
orq %rbx, %r9
leaq 0x120f8(%rip), %r10     # 0x154e0
movq %r9, (%r10,%rcx)
addq $0x8, %r8
addq $0x4, %rsi
cmpq $0x200, %r8             # imm = 0x200
jne 0x3358
incq %rbp
addq $0x200, %rax            # imm = 0x200
cmpq $0x40, %rbp
jne 0x328e
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq