// File: /workspace/github_cpp_makefile_star2_O2/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
subq $0x28, %rsp
movq $0x0, 0x10(%rsp)
leaq 0x8c70(%rip), %rsi      # 0xbde0
xorl %ebx, %ebx
cmpq $0x40, %rbx
je 0x32fb
leaq 0x935d(%rip), %rax      # 0xc4e0
movq %rbx, 0x18(%rsp)
movq 0x600(%rax,%rbx,8), %rax
movq %rax, 0x8(%rsp)
xorl %r13d, %r13d
xorl %ebp, %ebp
cmpq $0x200, %rbp            # imm = 0x200
je 0x3232
movq (%rbp,%rsi), %r12
testq %r12, 0x8(%rsp)
je 0x3226
movq 0x18(%rsp), %r15
movl %r15d, %edi
movq %r12, %rsi
pushq $0x3
popq %rdx
callq 0x33a4
movq %rax, %r14
leaq 0x8c10(%rip), %rax      # 0xbde0
movq (%rax,%r15,8), %rbx
movl %r13d, %edi
movq %rbx, %rsi
pushq $0x3
popq %rdx
callq 0x33a4
andq %r14, %rax
movq 0x10(%rsp), %rcx
addq %rbp, %rcx
leaq 0xa2ec(%rip), %rdx      # 0xd4e0
movq %rax, (%rdx,%rcx)
leaq 0x1a6e1(%rip), %rdx     # 0x1d8e0
movq (%rdx,%r15,8), %rax
movq (%rbp,%rdx), %rdx
movq (%rdx), %rdx
andq (%rax), %rdx
orq %rbx, %r12
leaq 0x8bc8(%rip), %rsi      # 0xbde0
orq %rdx, %r12
leaq 0x122be(%rip), %rax     # 0x154e0
movq %r12, (%rax,%rcx)
addq $0x8, %rbp
incl %r13d
jmp 0x319a
leaq 0x92a7(%rip), %rax      # 0xc4e0
movq 0x18(%rsp), %rbx
movq 0x400(%rax,%rbx,8), %rax
movq %rax, 0x20(%rsp)
xorl %r15d, %r15d
xorl %ebp, %ebp
cmpq $0x200, %rbp            # imm = 0x200
je 0x32ea
movq (%rbp,%rsi), %r12
testq %r12, 0x20(%rsp)
je 0x32de
movl %ebx, %edi
movq %r12, %rsi
pushq $0x2
popq %r14
movl %r14d, %edx
callq 0x33a4
movq %rax, 0x8(%rsp)
leaq 0x8b5a(%rip), %rax      # 0xbde0
movq (%rax,%rbx,8), %r13
movl %r15d, %edi
movq %r13, %rsi
movl %r14d, %edx
leaq 0xa246(%rip), %r14      # 0xd4e0
callq 0x33a4
andq 0x8(%rsp), %rax
leaq 0x8b35(%rip), %rsi      # 0xbde0
movq 0x10(%rsp), %rcx
addq %rbp, %rcx
movq %rax, (%r14,%rcx)
leaq 0xe2c22(%rip), %rdx     # 0xe5ee0
movq (%rdx,%rbx,8), %rax
movq (%rbp,%rdx), %rdx
movq (%rdx), %rdx
andq (%rax), %rdx
orq %r13, %r12
orq %rdx, %r12
leaq 0x12206(%rip), %rax     # 0x154e0
movq %r12, (%rax,%rcx)
addq $0x8, %rbp
incl %r15d
jmp 0x3250
incq %rbx
addq $0x200, 0x10(%rsp)      # imm = 0x200
jmp 0x3172
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq