LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/niekh1234[P]nnchesslib/attacks.cpp
// Function: nnchesslib::Attacks::getRookAttacksRays(int, unsigned long long)
U64 Attacks::getRookAttacksRays(int sq, U64 blockers)
{
    U64 combinedAttacks = (U64)0;

    // north attacks
    U64 rookAttacksNorth = Rays::getRay(NORTH, sq);
    U64 northBlocker = rookAttacksNorth & blockers;
    if(blockers)
    {
        int index = bitScanForward(northBlocker);
        rookAttacksNorth ^= Rays::getRay(NORTH, index);
    }
    combinedAttacks |= rookAttacksNorth;

    // south attacks
    U64 rookAttacksSouth = Rays::getRay(SOUTH, sq);
    U64 southBlocker = rookAttacksSouth & blockers;
    if(blockers)
    {
        int index = bitScanReverse(southBlocker);
        rookAttacksSouth ^= Rays::getRay(SOUTH, index);
    }
    combinedAttacks |= rookAttacksSouth;

    // east attacks
    U64 rookAttacksEast = Rays::getRay(EAST, sq);
    U64 eastBlocker = rookAttacksEast & blockers;
    if(blockers)
    {
        int index = bitScanForward(eastBlocker);
        rookAttacksEast ^= Rays::getRay(EAST, index);
    }
    combinedAttacks |= rookAttacksEast;

    // west attacks
    U64 rookAttacksWest = Rays::getRay(WEST, sq);
    U64 westBlocker = rookAttacksWest & blockers;
    if(blockers)
    {
        int index = bitScanReverse(westBlocker);
        rookAttacksWest ^= Rays::getRay(WEST, index);
    }
    combinedAttacks |= rookAttacksWest;

    return combinedAttacks;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r12
movl %edi, %r14d
xorl %edi, %edi
movl %r14d, %esi
callq 0x86ce
movq %rax, %rbx
testq %r12, %r12
je 0x3000
movq %rbx, %rdi
andq %r12, %rdi
callq 0x8750
xorl %edi, %edi
movl %eax, %esi
callq 0x86ce
xorq %rax, %rbx
movq %rbx, -0x30(%rbp)
movl $0x2, %edi
movl %r14d, %esi
callq 0x86ce
movq %rax, %r13
movq %rax, %rdi
andq %r12, %rdi
callq 0x8764
movl $0x2, %edi
movl %eax, %esi
callq 0x86ce
movq %rax, %r15
xorq %r13, %r15
movl $0x1, %edi
movl %r14d, %esi
callq 0x86ce
movq %rax, %rbx
movq %rax, %rdi
andq %r12, %rdi
callq 0x8750
movl $0x1, %edi
movl %eax, %esi
callq 0x86ce
movq %rax, %r13
xorq %rbx, %r13
movl $0x3, %edi
movl %r14d, %esi
callq 0x86ce
movq %rax, %rbx
andq %rax, %r12
movq %r12, %rdi
callq 0x8764
movl $0x3, %edi
movl %eax, %esi
callq 0x86ce
xorq %rbx, %rax
movq -0x30(%rbp), %rbx
jmp 0x302d
movl $0x2, %edi
movl %r14d, %esi
callq 0x86ce
movq %rax, %r15
movl $0x1, %edi
movl %r14d, %esi
callq 0x86ce
movq %rax, %r13
movl $0x3, %edi
movl %r14d, %esi
callq 0x86ce
orq %rax, %r15
orq %rbx, %r13
orq %r15, %r13
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/niekh1234[P]nnchesslib/attacks.cpp
// Function: nnchesslib::Attacks::getBishopAttacksRays(int, unsigned long long)
U64 Attacks::getBishopAttacksRays(int sq, U64 blockers)
{
    U64 combinedAttacks = (U64)0;

    // north west attacks
    U64 bishopAttacksNorthWest = Rays::getRay(NORTH_WEST, sq);
    U64 northWestBlocker = bishopAttacksNorthWest & blockers;
    if(blockers)
    {
        int index = bitScanForward(northWestBlocker);
        bishopAttacksNorthWest ^= Rays::getRay(NORTH_WEST, index);
    }
    combinedAttacks |= bishopAttacksNorthWest;

    // north east attacks
    // this is different because above method did not work properly.
    combinedAttacks |= Rays::getRay(NORTH_EAST, sq);
    if (Rays::getRay(NORTH_EAST, sq) & blockers) {
        combinedAttacks &= ~(Rays::getRay(NORTH_EAST, bitScanForward(Rays::getRay(NORTH_EAST, sq) & blockers)));
    }

    // south east attacks
    U64 bishopAttacksSouthEast = Rays::getRay(SOUTH_EAST, sq);
    U64 southEastBlocker = bishopAttacksSouthEast & blockers;
    if(blockers)
    {
        int index = bitScanReverse(southEastBlocker);
        bishopAttacksSouthEast ^= Rays::getRay(SOUTH_EAST, index);
    }
    combinedAttacks |= bishopAttacksSouthEast;

    // south west attacks
    U64 bishopAttacksSouthWest = Rays::getRay(SOUTH_WEST, sq);
    U64 southWestBlocker = bishopAttacksSouthWest & blockers;
    if(blockers)
    {
        int index = bitScanReverse(southWestBlocker);
        bishopAttacksSouthWest ^= Rays::getRay(SOUTH_WEST, index);
    }
    combinedAttacks |= bishopAttacksSouthWest;

    return combinedAttacks;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movl %edi, %r14d
movl $0x5, %edi
movl %r14d, %esi
callq 0x86ce
movq %rax, %r12
testq %rbx, %rbx
je 0x3088
movq %r12, %rdi
andq %rbx, %rdi
callq 0x8750
movl $0x5, %edi
movl %eax, %esi
callq 0x86ce
xorq %rax, %r12
movl $0x4, %edi
movl %r14d, %esi
callq 0x86ce
movq %rax, %r15
orq %r12, %r15
movl $0x4, %edi
movl %r14d, %esi
callq 0x86ce
testq %rbx, %rax
je 0x30d7
movl $0x4, %edi
movl %r14d, %esi
callq 0x86ce
andq %rbx, %rax
movq %rax, %rdi
callq 0x8750
movl $0x4, %edi
movl %eax, %esi
callq 0x86ce
notq %rax
andq %rax, %r15
movl $0x6, %edi
movl %r14d, %esi
callq 0x86ce
movq %rax, %r12
testq %rbx, %rbx
je 0x3132
movq %r12, %rdi
andq %rbx, %rdi
callq 0x8764
movl $0x6, %edi
movl %eax, %esi
callq 0x86ce
xorq %rax, %r12
movl $0x7, %edi
movl %r14d, %esi
callq 0x86ce
movq %rax, %r14
andq %rax, %rbx
movq %rbx, %rdi
callq 0x8764
movl $0x7, %edi
movl %eax, %esi
callq 0x86ce
xorq %r14, %rax
jmp 0x313f
movl $0x7, %edi
movl %r14d, %esi
callq 0x86ce
orq %r15, %r12
orq %rax, %r12
movq %r12, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/niekh1234[P]nnchesslib/attacks.cpp
// Function: nnchesslib::Attacks::getSlidingAttacks(int, nnchesslib::PieceType, unsigned long long)
U64 Attacks::getSlidingAttacks(int sq, PieceType p, U64 blockers)
{
    assert(p == 2 || p == 3 || p == 4);
    switch(p)
    {
        case BISHOP:
            return getBishopAttacks(sq, blockers);
            break;
        case ROOK:
            return getRookAttacks(sq, blockers);
            break;
        case QUEEN:
            return (getRookAttacks(sq, blockers) | getBishopAttacks(sq, blockers));
            break;
        default:
            return (U64)0;
            break;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
cmpl $0x2, %esi
je 0x3310
cmpl $0x3, %esi
je 0x32da
cmpl $0x4, %esi
jne 0x3359
movslq %edi, %r15
leaq 0x9f57(%rip), %rax      # 0xd1c0
movq (%rax,%r15,8), %rdi
movq %rdi, %r14
andq %rbx, %r14
leaq 0x5e96(%rip), %rax      # 0x9110
imulq (%rax,%r15,8), %r14
callq 0x8738
negb %al
movl %eax, %ecx
shrq %cl, %r14
movq %r15, %rax
shlq $0xf, %rax
leaq 0xa327(%rip), %rcx      # 0xd5c0
addq %rax, %rcx
movq (%rcx,%r14,8), %r14
leaq 0xa119(%rip), %rax      # 0xd3c0
movq (%rax,%r15,8), %rdi
andq %rdi, %rbx
leaq 0x605b(%rip), %rax      # 0x9310
imulq (%rax,%r15,8), %rbx
callq 0x8738
negb %al
movl %eax, %ecx
shrq %cl, %rbx
shlq $0xd, %r15
leaq 0x20a2ef(%rip), %rax    # 0x20d5c0
addq %r15, %rax
orq (%rax,%rbx,8), %r14
jmp 0x334b
movslq %edi, %r14
leaq 0x9edc(%rip), %rax      # 0xd1c0
movq (%rax,%r14,8), %rdi
andq %rdi, %rbx
leaq 0x5e1e(%rip), %rax      # 0x9110
imulq (%rax,%r14,8), %rbx
callq 0x8738
negb %al
movl %eax, %ecx
shrq %cl, %rbx
shlq $0xf, %r14
leaq 0xa2b2(%rip), %rax      # 0xd5c0
jmp 0x3344
movslq %edi, %r14
leaq 0xa0a6(%rip), %rax      # 0xd3c0
movq (%rax,%r14,8), %rdi
andq %rdi, %rbx
leaq 0x5fe8(%rip), %rax      # 0x9310
imulq (%rax,%r14,8), %rbx
callq 0x8738
negb %al
movl %eax, %ecx
shrq %cl, %rbx
shlq $0xd, %r14
leaq 0x20a27c(%rip), %rax    # 0x20d5c0
addq %r14, %rax
movq (%rax,%rbx,8), %r14
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5d49(%rip), %rdi      # 0x90a9
leaq 0x5cf1(%rip), %rsi      # 0x9058
leaq 0x5d56(%rip), %rcx      # 0x90c4
movl $0x107, %edx            # imm = 0x107
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O3/niekh1234[P]nnchesslib/bitboard.cpp
// Function: nnchesslib::BitBoard::set(int, bool)
void BitBoard::set(int square, bool set)
{
    assert(0 <= square && square <= 63);
    if(set)
        board |= ((U64)1 << square);
    else
        board &= ~((U64)1 << square);
}

// Assembly:
cmpl $0x40, %esi
jae 0x33d4
movl $0x1, %eax
movl %esi, %ecx
shlq %cl, %rax
testb %dl, %dl
je 0x33ca
orq (%rdi), %rax
jmp 0x33d0
notq %rax
andq (%rdi), %rax
movq %rax, (%rdi)
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x6131(%rip), %rdi      # 0x9510
leaq 0x6146(%rip), %rsi      # 0x952c
leaq 0x614c(%rip), %rcx      # 0x9539
movl $0x1c, %edx
callq 0x20c0
nop
// File: /workspace/github_cpp_makefile_star2_O3/niekh1234[P]nnchesslib/bitboard.cpp
// Function: nnchesslib::BitBoard::printDebug()
void BitBoard::printDebug()
{
    std::string boardString = getBoardString();
    std::cout<<"---------------"<<std::endl;
    for (int y = 0; y <= 7; y++)
    {
        for (int x = 0; x <= 7; x++)
        {
            // if (boardString[63 - (8*y+x)] == '1')
            if (boardString[8*y+7-x] == '1')
                std::cout << "1 ";
            else
                std::cout << ". ";
        }
        std::cout << std::endl;
    }
    std::cout<<"---------------"<<std::endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq (%rdi), %rax
leaq -0x58(%rbp), %rsi
movq %rax, (%rsi)
leaq -0x50(%rbp), %rdi
callq 0x363a
movq 0x9af3(%rip), %rbx      # 0xcfd8
leaq 0x610c(%rip), %rsi      # 0x95f8
movl $0xf, %edx
movq %rbx, %rdi
callq 0x2180
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq 0x9ac1(%rip), %rbx      # 0xcfd8
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20e0
xorl %r14d, %r14d
leaq 0x60d7(%rip), %r15      # 0x9608
leaq 0x621b(%rip), %r12      # 0x9753
xorl %r13d, %r13d
movq %r13, -0x30(%rbp)
movl $0x8, %r13d
movq -0x50(%rbp), %rax
addq %r14, %rax
cmpb $0x31, -0x1(%r13,%rax)
movq %r15, %rsi
je 0x355a
movq %r12, %rsi
movl $0x2, %edx
movq %rbx, %rdi
callq 0x2180
decq %r13
jne 0x3545
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2130
movq -0x30(%rbp), %r13
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20e0
incq %r13
addq $0x8, %r14
cmpq $0x8, %r13
jne 0x353b
movq 0x9a2d(%rip), %rbx      # 0xcfd8
leaq 0x6046(%rip), %rsi      # 0x95f8
movl $0xf, %edx
movq %rbx, %rdi
callq 0x2180
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq 0x99fb(%rip), %rdi      # 0xcfd8
callq 0x2030
movq %rax, %rdi
callq 0x20e0
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3603
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2150
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3616
jmp 0x3616
movq %rax, %rbx
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3632
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2150
movq %rbx, %rdi
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O3/niekh1234[P]nnchesslib/board.cpp
// Function: nnchesslib::ChessBoard::ChessBoard(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
ChessBoard::ChessBoard(std::string fen)
{
    std::string valid_fen;

    if (!isValidFen(fen))
        valid_fen = STARTING_FEN;
    else
        valid_fen = fen;

    generateBitBoards(valid_fen);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x3378
leaq 0x8(%rbx), %rdi
callq 0x3378
leaq 0x10(%rbx), %rdi
callq 0x3378
leaq 0x18(%rbx), %rdi
callq 0x3378
leaq 0x20(%rbx), %rdi
callq 0x3378
leaq 0x28(%rbx), %rdi
callq 0x3378
leaq 0x30(%rbx), %rdi
callq 0x3378
leaq 0x38(%rbx), %rdi
callq 0x3378
movb $0x1, %r12b
movb %r12b, 0x40(%rbx)
xorl %r15d, %r15d
movq %r15, 0x48(%rbx)
movl %r15d, 0x50(%rbx)
leaq 0x58(%rbx), %rdi
movl %r15d, 0x41(%rbx)
callq 0x3378
leaq 0x60(%rbx), %rdi
callq 0x3378
leaq 0x68(%rbx), %rdi
callq 0x3378
leaq 0x70(%rbx), %rdi
callq 0x3378
leaq 0x78(%rbx), %rdi
callq 0x3378
leaq 0x80(%rbx), %rdi
callq 0x3378
leaq 0x88(%rbx), %rdi
callq 0x3378
leaq 0x90(%rbx), %rdi
callq 0x3378
leaq 0x98(%rbx), %rdi
callq 0x3378
leaq 0xa0(%rbx), %rdi
callq 0x3378
movb %r12b, 0xa8(%rbx)
movq %r15, 0xb0(%rbx)
movl %r15d, 0xb8(%rbx)
leaq 0xc0(%rbx), %rdi
movl %r15d, 0xa9(%rbx)
callq 0x3378
leaq 0xc8(%rbx), %rdi
callq 0x3378
leaq -0x38(%rbp), %r12
movq %r12, -0x10(%r12)
movq %r15, -0x8(%r12)
movb $0x0, (%r12)
leaq -0x78(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq -0x88(%rbp), %rdi
callq 0x671c
leaq -0x88(%rbp), %rsi
movq %rbx, %rdi
callq 0x3ecc
movl %eax, %r15d
movq -0x88(%rbp), %rdi
cmpq %r13, %rdi
je 0x3e05
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2150
leaq 0x28afdc(%rip), %rsi    # 0x28ede8
testb %r15b, %r15b
cmovneq %r14, %rsi
leaq -0x48(%rbp), %rdi
callq 0x20a0
leaq -0x58(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x68(%rbp), %rdi
callq 0x671c
leaq -0x68(%rbp), %rsi
movq %rbx, %rdi
callq 0x3868
movq -0x68(%rbp), %rdi
cmpq %r14, %rdi
je 0x3e59
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2150
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x3e6e
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2150
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r14, %rdi
je 0x3eaf
movq -0x58(%rbp), %rsi
jmp 0x3ea2
movq %rax, %rbx
movq -0x88(%rbp), %rdi
cmpq %r13, %rdi
je 0x3eaf
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2150
jmp 0x3eaf
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x3ec4
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2150
movq %rbx, %rdi
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O3/niekh1234[P]nnchesslib/board.cpp
// Function: nnchesslib::ChessBoard::getBoard(nnchesslib::Color, nnchesslib::PieceType)
BitBoard ChessBoard::getBoard(Color color, PieceType piece)
{
    assert(color == WHITE || color == BLACK);

    U64 boardColor = boardinfo.whitePieces.board;
    if(color == BLACK) boardColor = boardinfo.blackPieces.board;

    switch(piece){
        case PAWN:
            return (boardColor & boardinfo.pawns.board);
            break;
        case KNIGHT:
            return (boardColor & boardinfo.knights.board);
            break;
        case BISHOP:
            return (boardColor & boardinfo.bishops.board);
            break;
        case ROOK:
            return (boardColor & boardinfo.rooks.board);
            break;
        case QUEEN:
            return (boardColor & boardinfo.queens.board);
            break;
        case KING:
            return (boardColor & boardinfo.kings.board);
            break;
        default:
            return (boardinfo.whitePieces.board & boardinfo.pawns.board);
            break;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
cmpl $0x2, %esi
jae 0x4e14
xorl %ecx, %ecx
testl %esi, %esi
sete %sil
movl $0x10, %eax
cmpl $0x5, %edx
ja 0x4df7
movb %sil, %cl
movq (%rdi,%rcx,8), %rsi
movl %edx, %ecx
leaq 0x48c5(%rip), %rdx      # 0x9690
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movl $0x18, %eax
jmp 0x4dfa
movl $0x30, %eax
jmp 0x4dfa
movl $0x20, %eax
jmp 0x4dfa
movl $0x28, %eax
jmp 0x4dfa
movl $0x38, %eax
jmp 0x4dfa
movq (%rdi), %rsi
andq (%rdi,%rax), %rsi
leaq -0x10(%rbp), %rbx
movq %rbx, %rdi
callq 0x3386
movq (%rbx), %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x496e(%rip), %rdi      # 0x9789
leaq 0x470d(%rip), %rsi      # 0x952f
leaq 0x4981(%rip), %rcx      # 0x97aa
movl $0xff, %edx
callq 0x20c0
nop
// File: /workspace/github_cpp_makefile_star2_O3/niekh1234[P]nnchesslib/board.cpp
// Function: nnchesslib::ChessBoard::getPieceOnSquare(int)
BitBoard * ChessBoard::getPieceOnSquare(int index)
{
    if(boardinfo.pawns.get(index)) return(&boardinfo.pawns);
    if(boardinfo.knights.get(index)) return(&boardinfo.knights);
    if(boardinfo.bishops.get(index)) return(&boardinfo.bishops);
    if(boardinfo.rooks.get(index)) return(&boardinfo.rooks);
    if(boardinfo.queens.get(index)) return(&boardinfo.queens);
    if(boardinfo.kings.get(index)) return(&boardinfo.kings);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
leaq 0x10(%rdi), %r15
movq %r15, %rdi
callq 0x33f8
testl %eax, %eax
jne 0x4f32
leaq 0x18(%rbx), %r15
movq %r15, %rdi
movl %r14d, %esi
callq 0x33f8
testl %eax, %eax
jne 0x4f32
leaq 0x20(%rbx), %r15
movq %r15, %rdi
movl %r14d, %esi
callq 0x33f8
testl %eax, %eax
jne 0x4f32
leaq 0x28(%rbx), %r15
movq %r15, %rdi
movl %r14d, %esi
callq 0x33f8
testl %eax, %eax
jne 0x4f32
leaq 0x30(%rbx), %r15
movq %r15, %rdi
movl %r14d, %esi
callq 0x33f8
testl %eax, %eax
jne 0x4f32
addq $0x38, %rbx
movq %rbx, %rdi
movl %r14d, %esi
callq 0x33f8
xorl %r15d, %r15d
testl %eax, %eax
cmovneq %rbx, %r15
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/niekh1234[P]nnchesslib/board.cpp
// Function: nnchesslib::ChessBoard::setEnPassantPossibility(nnchesslib::BitBoard, int, int)
void ChessBoard::setEnPassantPossibility(BitBoard ourPieces, int from, int to)
{
    // There can only be one target at the time, so clearing the boards every move.
    boardinfo.whiteEnPassantTarget.board = (U64)0;
    boardinfo.blackEnPassantTarget.board = (U64)0;
    // black en passant possibility (white has double moved)
    if((from / 8 == 1 && to / 8 == 3) && ourPieces.board & boardinfo.pawns.board)
    {
        // set the square under the pawn as a target for a black pawn (in a seperate bitboard)
        boardinfo.blackEnPassantTarget.set(to - 8, true);
    }
    // white en passant possibility (black has double moved)
    else if((from / 8 == 6 && to / 8 == 4) && ourPieces.board & boardinfo.pawns.board)
    {
        boardinfo.whiteEnPassantTarget.set(to + 8, true);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
andl $-0x8, %edx
movl %edx, %r8d
xorl $0x8, %r8d
movl %ecx, %eax
andl $-0x8, %eax
movl %eax, %r9d
xorl $0x18, %r9d
xorps %xmm0, %xmm0
movups %xmm0, 0x58(%rdi)
orl %r8d, %r9d
jne 0x51cb
testq %rsi, 0x10(%rdi)
je 0x51ef
addq $0x60, %rdi
addl $-0x8, %ecx
jmp 0x51e2
xorl $0x30, %edx
xorl $0x20, %eax
orl %edx, %eax
jne 0x51ef
testq %rsi, 0x10(%rdi)
je 0x51ef
addq $0x58, %rdi
orl $0x8, %ecx
movl %ecx, %esi
movl $0x1, %edx
popq %rbp
jmp 0x33b2
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/niekh1234[P]nnchesslib/board.cpp
// Function: nnchesslib::ChessBoard::pushPromotionMove(unsigned int)
void ChessBoard::pushPromotionMove(Move move)
{
    int from = from_Square(move);
    int to = to_Square(move);

    BitBoard * ourPieces = getColorOnSquare(from);

    PieceType piece = movePromotionType(move);

    boardinfo.pawns.set(from, false);
    ourPieces->set(from, false);
    ourPieces->set(to, true);

    if(piece == QUEEN) boardinfo.queens.set(to, true);
    if(piece == ROOK) boardinfo.rooks.set(to, true);
    if(piece == BISHOP) boardinfo.bishops.set(to, true);
    if(piece == KNIGHT) boardinfo.knights.set(to, true);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r15d
movq %rdi, %rbx
movl %esi, %edi
callq 0x6a58
movl %eax, %r12d
movl %r15d, %edi
callq 0x6a66
movl %eax, %r14d
movq %rbx, %rdi
movl %r12d, %esi
callq 0x4f40
movq %rax, %r13
movl %r15d, %edi
callq 0x6a71
movl %eax, %r15d
leaq 0x10(%rbx), %rdi
movl %r12d, %esi
xorl %edx, %edx
callq 0x33b2
movq %r13, %rdi
movl %r12d, %esi
xorl %edx, %edx
callq 0x33b2
movq %r13, %rdi
movl %r14d, %esi
movl $0x1, %edx
callq 0x33b2
decl %r15d
cmpl $0x3, %r15d
ja 0x56ec
movl %r15d, %eax
leaq (%rbx,%rax,8), %rdi
addq $0x18, %rdi
movl %r14d, %esi
movl $0x1, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x33b2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/niekh1234[P]nnchesslib/board.cpp
// Function: nnchesslib::ChessBoard::pushEnPassantMove(unsigned int)
void ChessBoard::pushEnPassantMove(Move move)
{
    int from = from_Square(move);
    int to = to_Square(move);

    BitBoard * ourPieceType = getPieceOnSquare(from);

    // White double pawn move (this needs to be seperated because we need to remove the pawn above or under the targetted square)
    if(from >= A5)
    {
        BitBoard * theirPiece = getPieceOnSquare(to - 8);
        boardinfo.whitePieces.set(from, false);
        boardinfo.whitePieces.set(to, true);
        ourPieceType->set(from, false);
        ourPieceType->set(to, true);
        theirPiece->set(to - 8, false);
        boardinfo.blackPieces.set(to - 8, false);
    } 
    else if(from <= H4)
    {
        BitBoard * theirPiece = getPieceOnSquare(to + 8);
        boardinfo.blackPieces.set(from, false);
        boardinfo.blackPieces.set(to, true);
        ourPieceType->set(from, false);
        ourPieceType->set(to, true);
        theirPiece->set(to + 8, false);
        boardinfo.whitePieces.set(to + 8, false);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %r14d
movq %rdi, %rbx
movl %esi, %edi
callq 0x6a58
movl %eax, %r15d
movl %r14d, %edi
callq 0x6a66
movl %eax, %r14d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x4eae
movq %rax, %r12
movl %r14d, %r13d
cmpl $0x20, %r15d
jl 0x57a0
addl $-0x8, %r13d
movq %rbx, %rdi
movl %r13d, %esi
callq 0x4eae
movq %rax, -0x30(%rbp)
movq %rbx, %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x33b2
movq %rbx, %rdi
movl %r14d, %esi
movl $0x1, %edx
callq 0x33b2
movq %r12, %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x33b2
movq %r12, %rdi
movl %r14d, %esi
movl $0x1, %edx
callq 0x33b2
movq -0x30(%rbp), %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x33b2
addq $0x8, %rbx
jmp 0x5807
addl $0x8, %r13d
movq %rbx, %rdi
movl %r13d, %esi
callq 0x4eae
movq %rax, -0x30(%rbp)
movq %r12, -0x38(%rbp)
leaq 0x8(%rbx), %r12
movq %r12, %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x33b2
movq %r12, %rdi
movl %r14d, %esi
movl $0x1, %edx
callq 0x33b2
movq -0x38(%rbp), %r12
movq %r12, %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x33b2
movq %r12, %rdi
movl %r14d, %esi
movl $0x1, %edx
callq 0x33b2
movq -0x30(%rbp), %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x33b2
movq %rbx, %rdi
movl %r13d, %esi
xorl %edx, %edx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x33b2
// File: /workspace/github_cpp_makefile_star2_O3/niekh1234[P]nnchesslib/board.cpp
// Function: nnchesslib::ChessBoard::pushRegularMove(unsigned int)
void ChessBoard::pushRegularMove(Move move)
{
    int from = from_Square(move);
    int to = to_Square(move);

    // gets the bitboard corresponding to our piecetype, e.g. knights, pawns etc.
    BitBoard * ourPieceType = getPieceOnSquare(from);
    // gets the bitboard corresponding to the opponent piecetype (at least if it is a capture).
    BitBoard * theirPieceType = getPieceOnSquare(to);
    // if board is empty it returns 0.
    bool isCapture = theirPieceType;
    // gets the bitboard corresponding to our piece color.
    BitBoard * ourPieces = getColorOnSquare(from);

    boardinfo.fiftyMoveRule++;

    if (boardinfo.pawns.board & ourPieceType->board)    
        boardinfo.fiftyMoveRule = 0;

    if(isCapture)
    {
        theirPieceType->set(to, false);

        BitBoard * theirPieces = getColorOnSquare(to);
        theirPieces->set(to, false);
        boardinfo.fiftyMoveRule = 0;
    }
    // changing to the position of a piece on one of the piece boards: pawn, knight, rook king etc.
    ourPieceType->set(from, false);
    ourPieceType->set(to, true);
    // changing the position of the piece on the white_pieces or black_pieces board.
    ourPieces->set(from, false);
    ourPieces->set(to, true);

    setEnPassantPossibility(*ourPieces, from, to);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r15d
movq %rdi, %rbx
movl %esi, %edi
callq 0x6a58
movl %eax, %r14d
movl %r15d, %edi
callq 0x6a66
movl %eax, %r15d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x4eae
movq %rax, %r13
movq %rbx, %rdi
movl %r15d, %esi
callq 0x4eae
movq %rax, %r12
movq %rbx, %rdi
movl %r14d, %esi
callq 0x4f40
movq %rax, -0x30(%rbp)
movl 0x48(%rbx), %eax
incl %eax
movq (%r13), %rcx
xorl %edx, %edx
testq %rcx, 0x10(%rbx)
cmovel %eax, %edx
movl %edx, 0x48(%rbx)
testq %r12, %r12
je 0x58bc
movq %r12, %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x33b2
movq %rbx, %rdi
movl %r15d, %esi
callq 0x4f40
movq %rax, %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x33b2
movl $0x0, 0x48(%rbx)
movq %r13, %rdi
movl %r14d, %esi
xorl %edx, %edx
callq 0x33b2
movq %r13, %rdi
movl %r15d, %esi
movl $0x1, %edx
callq 0x33b2
movq -0x30(%rbp), %r12
movq %r12, %rdi
movl %r14d, %esi
xorl %edx, %edx
callq 0x33b2
movq %r12, %rdi
movl %r15d, %esi
movl $0x1, %edx
callq 0x33b2
movq (%r12), %rsi
movq %rbx, %rdi
movl %r14d, %edx
movl %r15d, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5196
// File: /workspace/github_cpp_makefile_star2_O3/niekh1234[P]nnchesslib/board.cpp
// Function: nnchesslib::ChessBoard::pushMove(unsigned int)
void ChessBoard::pushMove(Move move)
{
    // setting previous board information the the current position when there has not been made a move.
    previousBoard = boardinfo;
    // getting the movetype
    MoveType type = moveType(move);

    if(type == CASTLING) pushCastlingMove(move);
    else if(type == PROMOTION) pushPromotionMove(move);
    else if(type == ENPASSANT) pushEnPassantMove(move);
    else if(type == NORMAL) pushRegularMove(move);

    // Update board information
    updateCastlingRights();
    boardinfo.whiteToMove = !boardinfo.whiteToMove;

    if (boardinfo.whiteToMove)
        boardinfo.plyCount++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
addq $0x68, %rdi
movl $0xd, %ecx
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl %r14d, %edi
callq 0x6a80
cmpl $0x3, %eax
ja 0x5987
movl %eax, %eax
leaq 0x3d5c(%rip), %rcx      # 0x96a8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
movl %r14d, %esi
callq 0x5822
jmp 0x5987
movq %rbx, %rdi
movl %r14d, %esi
callq 0x56fc
jmp 0x5987
movq %rbx, %rdi
movl %r14d, %esi
callq 0x5352
jmp 0x5987
movq %rbx, %rdi
movl %r14d, %esi
callq 0x5650
movq %rbx, %rdi
callq 0x51f2
movb 0x40(%rbx), %al
movl %eax, %ecx
xorb $0x1, %cl
movb %cl, 0x40(%rbx)
testb %al, %al
jne 0x59a1
incl 0x4c(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/niekh1234[P]nnchesslib/main.cpp
// Function: initAll()
void initAll()
{
    time_t begin, end;
    begin = clock();
    std::cout << "Initializing..." << std::endl;

    Rays::initRays();
    Attacks::initAllAttacks();

    end = clock();

    std::cout << "Finished initializing." << std::endl;
    std::cout << "Time taken: " << (float)(end-begin)/CLOCKS_PER_SEC << " seconds." << std::endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
callq 0x20d0
movq %rax, %r14
movq 0x6723(%rip), %rbx      # 0xcfd8
leaq 0x30c4(%rip), %rsi      # 0x9980
movl $0xf, %edx
movq %rbx, %rdi
callq 0x2180
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20e0
callq 0x850e
callq 0x29fc
callq 0x20d0
movq %rax, %r15
leaq 0x3087(%rip), %rsi      # 0x9990
movl $0x16, %edx
movq %rbx, %rdi
callq 0x2180
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20e0
leaq 0x3063(%rip), %rsi      # 0x99a7
movl $0xc, %edx
movq %rbx, %rdi
callq 0x2180
subq %r14, %r15
cvtsi2ss %r15, %xmm0
divss 0x301b(%rip), %xmm0     # 0x997c
cvtss2sd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x2230
movq %rax, %rbx
leaq 0x303d(%rip), %rsi      # 0x99b4
movl $0x9, %edx
movq %rax, %rdi
callq 0x2180
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x20e0
// File: /workspace/github_cpp_makefile_star2_O3/niekh1234[P]nnchesslib/main.cpp
// Function: main
int main(int argc, char *argv[])
{
    initAll();

    ChessBoard myBoard = ChessBoard();

    myBoard.pushFromUci("e2e4");
    
    myBoard.print();
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xf8, %rsp
callq 0x689c
leaq -0x108(%rbp), %rbx
movq %rbx, %rdi
callq 0x36f0
leaq -0x28(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x2fd6(%rip), %rsi      # 0x99be
leaq 0x2fd3(%rip), %rdx      # 0x99c2
leaq -0x38(%rbp), %r14
movq %r14, %rdi
callq 0x667e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x652c
movq -0x38(%rbp), %rdi
cmpq %r15, %rdi
je 0x6a1b
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x2150
leaq -0x108(%rbp), %rdi
callq 0x495a
xorl %eax, %eax
addq $0xf8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x38(%rbp), %rdi
cmpq %r15, %rdi
je 0x6a4f
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x2150
movq %rbx, %rdi
callq 0x2270
nop
// File: /workspace/github_cpp_makefile_star2_O3/niekh1234[P]nnchesslib/move.cpp
// Function: nnchesslib::toUci[abi:cxx11](unsigned int)
std::string nnchesslib::toUci(Move m)
{
    std::string from = getSquareString(from_Square(m));
    std::string to = getSquareString(to_Square(m));

    std::string output = from + to;

    if(moveType(m) == PROMOTION)
    {
        switch(movePromotionType(m))
        {
            case QUEEN:
                output+="q";
                break;
            case KNIGHT:
                output+="n";
                break;
            case BISHOP:
                output+="b";
                break;
            case ROOK:
                output+="r";
                break;
        }
    }
    return output;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
movl %esi, %r14d
movq %rdi, %rbx
shrl $0x6, %esi
andl $0x3f, %esi
leaq -0x50(%rbp), %rdi
callq 0x87ba
movl %r14d, %esi
andl $0x3f, %esi
leaq -0x30(%rbp), %rdi
callq 0x87ba
leaq -0x50(%rbp), %rsi
leaq -0x30(%rbp), %rdx
movq %rbx, %rdi
callq 0x6c4f
movl %r14d, %eax
andl $0xc000, %eax           # imm = 0xC000
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x6b2d
shrl $0xa, %r14d
andl $0xc, %r14d
leaq 0x2eb2(%rip), %rax      # 0x99d0
movslq (%r14,%rax), %rsi
addq %rax, %rsi
movq %rbx, %rdi
callq 0x22a0
leaq -0x20(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6b46
movq -0x20(%rbp), %rsi
incq %rsi
callq 0x2150
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6b5f
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2150
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
movq (%rbx), %rdi
addq $0x10, %rbx
cmpq %rbx, %rdi
je 0x6b8a
movq (%rbx), %rsi
incq %rsi
callq 0x2150
jmp 0x6b8a
movq %rax, %r14
leaq -0x20(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6ba8
movq -0x20(%rbp), %rsi
incq %rsi
callq 0x2150
jmp 0x6ba8
movq %rax, %r14
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6bc1
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2150
movq %r14, %rdi
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O3/niekh1234[P]nnchesslib/movegen.cpp
// Function: nnchesslib::genLegalMoves(nnchesslib::ChessBoard)
MoveList nnchesslib::genLegalMoves(ChessBoard board)
{
    MoveList pseudoLegalMoves;
    MoveList legalMoves;

    genPseudoLegalMoves(board, pseudoLegalMoves);
    
    for(auto move : pseudoLegalMoves)
    {
        ChessBoard temp = board;
        temp.pushMove(move);

        Color boardTurn = BLACK;
        if(board.getWhiteToMove()) boardTurn = WHITE;

        if(!temp.kingInCheck(boardTurn)) 
        {
            legalMoves.push_back(move);
        }
    }
    return legalMoves;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
leaq 0x10(%rbp), %r13
xorl %ecx, %ecx
leaq -0x50(%rbp), %rax
movq %rcx, 0x10(%rax)
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movq %rcx, 0x10(%rdi)
movq %rdi, -0x38(%rbp)
movups %xmm0, (%rdi)
movl $0x1a, %ecx
movq %rsp, %rdi
movq %r13, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %rax, %rdi
callq 0x6de8
movq -0x50(%rbp), %r15
movq -0x48(%rbp), %r14
cmpq %r14, %r15
je 0x6d7b
leaq -0x120(%rbp), %r12
movl (%r15), %ebx
movl %ebx, -0x2c(%rbp)
movl $0xd0, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x2110
movq %r12, %rdi
movl %ebx, %esi
callq 0x591a
movq %r13, %rdi
callq 0x4ea4
movzbl %al, %esi
movq %r12, %rdi
callq 0x4f76
testb %al, %al
jne 0x6d6e
movq -0x38(%rbp), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x6d65
movl -0x2c(%rbp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x6d6e
leaq -0x2c(%rbp), %rdx
callq 0x83a8
addq $0x4, %r15
cmpq %r14, %r15
jne 0x6d11
movq -0x50(%rbp), %r15
testq %r15, %r15
je 0x6d8f
movq -0x40(%rbp), %rsi
subq %r15, %rsi
movq %r15, %rdi
callq 0x2150
movq -0x38(%rbp), %rax
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x6dcb
jmp 0x6dac
movq %rax, %r14
movq -0x38(%rbp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x6dcb
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rsi
subq %rdi, %rsi
callq 0x2150
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x6de0
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
movq %r14, %rdi
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O3/niekh1234[P]nnchesslib/movegen.cpp
// Function: nnchesslib::genPseudoLegalMoves(nnchesslib::ChessBoard, std::vector<unsigned int, std::allocator<unsigned int>>&)
void nnchesslib::genPseudoLegalMoves(ChessBoard board, MoveList& moveList)
{
    BitBoard blockers = board.getBlockers();
    
    if(board.getWhiteToMove())
        genWhiteMoves(board, moveList, blockers);
    else
        genBlackMoves(board, moveList, blockers);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq 0x10(%rbp), %r15
movq %r15, %rdi
callq 0x4e80
movq %rax, %r14
movq %r15, %rdi
callq 0x4ea4
movl $0x1a, %ecx
movq %rsp, %rdi
movq %r15, %rsi
testb %al, %al
je 0x6e31
rep  movsq (%rsi), %es:(%rdi)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6e4d
jmp 0x6e3f
rep  movsq (%rsi), %es:(%rdi)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6f75
addq $0xd8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/niekh1234[P]nnchesslib/movegen.cpp
// Function: nnchesslib::genWhiteMoves(nnchesslib::ChessBoard, std::vector<unsigned int, std::allocator<unsigned int>>&, nnchesslib::BitBoard)
void nnchesslib::genWhiteMoves(ChessBoard board, MoveList& moveList, BitBoard blockers)
{
    genWhiteSinglePawnMoves(board,moveList, blockers);
    genWhiteDoublePawnMoves(board,moveList, blockers);
    genWhitePawnCaptures(board,moveList, blockers);
    genNonSlidingMoves(board,moveList, WHITE, KNIGHT);
    genNonSlidingMoves(board,moveList, WHITE, KING);
    genSlidingMoves(board,moveList, WHITE, ROOK, blockers);
    genSlidingMoves(board,moveList, WHITE, BISHOP, blockers);
    genSlidingMoves(board,moveList, WHITE, QUEEN, blockers);
    genCastlingMoves(board,moveList, WHITE, blockers);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x10(%rbp), %r15
movl $0x1a, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x708b
movl $0x1a, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x7261
movl $0x1a, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
callq 0x7385
movl $0x1a, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x75e5
movl $0x1a, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
movl $0x1, %esi
movl $0x5, %edx
callq 0x75e5
movl $0x1a, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
movl $0x1, %esi
movl $0x3, %edx
movq %rbx, %rcx
callq 0x77b7
movl $0x1a, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
movl $0x1, %esi
movl $0x2, %edx
movq %rbx, %rcx
callq 0x77b7
movl $0x1a, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
movl $0x1, %esi
movl $0x4, %edx
movq %rbx, %rcx
callq 0x77b7
movq %r14, %rdi
movl $0x1, %esi
movq %rbx, %rdx
addq $0xd8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x7991
// File: /workspace/github_cpp_makefile_star2_O3/niekh1234[P]nnchesslib/movegen.cpp
// Function: nnchesslib::genBlackMoves(nnchesslib::ChessBoard, std::vector<unsigned int, std::allocator<unsigned int>>&, nnchesslib::BitBoard)
void nnchesslib::genBlackMoves(ChessBoard board, MoveList& moveList, BitBoard blockers)
{
    genBlackSinglePawnMoves(board,moveList, blockers);
    genBlackDoublePawnMoves(board,moveList, blockers);
    genBlackPawnCaptures(board,moveList, blockers);
    genNonSlidingMoves(board,moveList, BLACK, KNIGHT);
    genNonSlidingMoves(board,moveList, BLACK, KING);
    genSlidingMoves(board,moveList, BLACK, ROOK, blockers);
    genSlidingMoves(board,moveList, BLACK, BISHOP, blockers);
    genSlidingMoves(board,moveList, BLACK, QUEEN, blockers);
    genCastlingMoves(board,moveList, BLACK, blockers);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x10(%rbp), %r15
movl $0x1a, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x7c9f
movl $0x1a, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x7e6a
movl $0x1a, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
callq 0x7f90
movl $0x1a, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x75e5
movl $0x1a, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
xorl %esi, %esi
movl $0x5, %edx
callq 0x75e5
movl $0x1a, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
xorl %esi, %esi
movl $0x3, %edx
movq %rbx, %rcx
callq 0x77b7
movl $0x1a, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
xorl %esi, %esi
movl $0x2, %edx
movq %rbx, %rcx
callq 0x77b7
movl $0x1a, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
xorl %esi, %esi
movl $0x4, %edx
movq %rbx, %rcx
callq 0x77b7
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rdx
addq $0xd8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x7991
// File: /workspace/github_cpp_makefile_star2_O3/niekh1234[P]nnchesslib/movegen.cpp
// Function: nnchesslib::genWhiteDoublePawnMoves(nnchesslib::ChessBoard, std::vector<unsigned int, std::allocator<unsigned int>>&, nnchesslib::BitBoard)
void nnchesslib::genWhiteDoublePawnMoves(ChessBoard board, MoveList& moveList, BitBoard blockers)
{
    // targetting pawns that are on the second rank. These are the only pawns that can move twice.
    BitBoard unmovedPawns = board.getBoard(WHITE, PAWN).board & rank_bb[RANK_2];
    // moving pawns once to check if they are blocked:
    BitBoard firstMove = (unmovedPawns.board << 8) & ~blockers.board;
    // moving again:
    BitBoard secondMove = (firstMove.board << 8) & ~blockers.board;

    int validPawnCount = __builtin_popcountll(secondMove.board);

    for(int _ = 0; _ < validPawnCount; _++)
    {
        // finding current index of pawn.
        int index = popLsb(secondMove.board);

        if (index == -1)
            continue;
        // adding to pseudo legal movelist. 
        Move move = createMove(index - 16, index);
        moveList.push_back(move);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rbp), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x4d9e
andl $0xff00, %eax           # imm = 0xFF00
leaq -0x38(%rbp), %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0x3386
movq (%r15), %rsi
shlq $0x8, %rsi
notq %r14
andq %r14, %rsi
leaq -0x30(%rbp), %r15
movq %r15, %rdi
callq 0x3386
movq (%r15), %rsi
shlq $0x8, %rsi
andq %r14, %rsi
leaq -0x28(%rbp), %r14
movq %r14, %rdi
callq 0x3386
movq (%r14), %rax
testq %rax, %rax
je 0x737a
movq %rax, %rcx
shrq %rcx
movabsq $0x5555555555555555, %rdx # imm = 0x5555555555555555
andq %rcx, %rdx
subq %rdx, %rax
movabsq $0x3333333333333333, %rcx # imm = 0x3333333333333333
movq %rax, %rdx
andq %rcx, %rdx
shrq $0x2, %rax
andq %rcx, %rax
addq %rdx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
addq %rax, %rcx
movabsq $0xf0f0f0f0f0f0f0f, %rax # imm = 0xF0F0F0F0F0F0F0F
andq %rcx, %rax
movabsq $0x101010101010101, %r15 # imm = 0x101010101010101
imulq %rax, %r15
shrq $0x38, %r15
leaq -0x1c(%rbp), %r14
movq -0x28(%rbp), %rax
leaq -0x1(%rax), %rcx
andq %rax, %rcx
movq %rcx, -0x28(%rbp)
cmpq $0x1, %rax
jb 0x7375
bsfq %rax, %rsi
leal -0x10(%rsi), %edi
callq 0x6a8e
movl %eax, -0x1c(%rbp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x736a
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x7375
movq %rbx, %rdi
movq %r14, %rdx
callq 0x83a8
decl %r15d
jne 0x7330
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/niekh1234[P]nnchesslib/movegen.cpp
// Function: nnchesslib::genBlackDoublePawnMoves(nnchesslib::ChessBoard, std::vector<unsigned int, std::allocator<unsigned int>>&, nnchesslib::BitBoard)
void nnchesslib::genBlackDoublePawnMoves(ChessBoard board, MoveList& moveList, BitBoard blockers)
{
    // targetting pawns that are on the second rank. These are the only pawns that can move twice.
    BitBoard unmovedPawns = board.getBoard(BLACK, PAWN).board & rank_bb[RANK_7];
    // moving pawns once to check if they are blocked:
    BitBoard firstMove = (unmovedPawns.board >> 8) & ~blockers.board;
    // moving again:
    BitBoard secondMove = (firstMove.board >> 8) & ~blockers.board;

    int validPawnCount = __builtin_popcountll(secondMove.board);

    for(int _ = 0; _ < validPawnCount; _++)
    {
        // finding current index of pawn.
        int index = popLsb(secondMove.board);

        if (index == -1)
            continue;
        // adding to pseudo legal movelist. 
        Move move = createMove(index + 16, index);
        moveList.push_back(move);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4d9e
movabsq $0xff000000000000, %rsi # imm = 0xFF000000000000
andq %rax, %rsi
leaq -0x38(%rbp), %r15
movq %r15, %rdi
callq 0x3386
movq (%r15), %rsi
shrq $0x8, %rsi
notq %r14
andq %r14, %rsi
leaq -0x30(%rbp), %r15
movq %r15, %rdi
callq 0x3386
movq (%r15), %rsi
shrq $0x8, %rsi
andq %r14, %rsi
leaq -0x28(%rbp), %r14
movq %r14, %rdi
callq 0x3386
movq (%r14), %rax
testq %rax, %rax
je 0x7f85
movq %rax, %rcx
shrq %rcx
movabsq $0x5555555555555555, %rdx # imm = 0x5555555555555555
andq %rcx, %rdx
subq %rdx, %rax
movabsq $0x3333333333333333, %rcx # imm = 0x3333333333333333
movq %rax, %rdx
andq %rcx, %rdx
shrq $0x2, %rax
andq %rcx, %rax
addq %rdx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
addq %rax, %rcx
movabsq $0xf0f0f0f0f0f0f0f, %rax # imm = 0xF0F0F0F0F0F0F0F
andq %rcx, %rax
movabsq $0x101010101010101, %r15 # imm = 0x101010101010101
imulq %rax, %r15
shrq $0x38, %r15
leaq -0x1c(%rbp), %r14
movq -0x28(%rbp), %rax
leaq -0x1(%rax), %rcx
andq %rax, %rcx
movq %rcx, -0x28(%rbp)
cmpq $0x1, %rax
jb 0x7f80
bsfq %rax, %rsi
leal 0x10(%rsi), %edi
callq 0x6a8e
movl %eax, -0x1c(%rbp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x7f75
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x7f80
movq %rbx, %rdi
movq %r14, %rdx
callq 0x83a8
decl %r15d
jne 0x7f3b
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/niekh1234[P]nnchesslib/movegen.cpp
// Function: nnchesslib::genPromotions(int, std::vector<unsigned int, std::allocator<unsigned int>>&, nnchesslib::Color, nnchesslib::BitBoard)
void nnchesslib::genPromotions(int pawnIndex, MoveList& moveList, Color color, BitBoard pawns)
{
    // counting the amount of attacked pawns.
    int count = __builtin_popcountll(pawns.board);

    for(int _ = 0; _ < count; _++)
    {
        int index = popLsb(pawns.board);
        
        Move queen = createMove(pawnIndex, index, QUEEN);
        Move knight = createMove(pawnIndex, index, KNIGHT);
        Move bishop = createMove(pawnIndex, index, BISHOP);
        Move rook = createMove(pawnIndex, index, ROOK);
        moveList.push_back(queen);
        moveList.push_back(knight);
        moveList.push_back(bishop);
        moveList.push_back(rook);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edi, -0x3c(%rbp)
testq %rcx, %rcx
je 0x8399
movq %rcx, %rbx
movq %rsi, %r14
movq %rcx, %rax
shrq %rax
movabsq $0x5555555555555555, %rcx # imm = 0x5555555555555555
andq %rax, %rcx
movq %rbx, %rax
subq %rcx, %rax
movabsq $0x3333333333333333, %rcx # imm = 0x3333333333333333
movq %rax, %rdx
andq %rcx, %rdx
shrq $0x2, %rax
andq %rcx, %rax
addq %rdx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
addq %rax, %rcx
movabsq $0xf0f0f0f0f0f0f0f, %rax # imm = 0xF0F0F0F0F0F0F0F
andq %rcx, %rax
movabsq $0x101010101010101, %r13 # imm = 0x101010101010101
imulq %rax, %r13
shrq $0x38, %r13
movl -0x3c(%rbp), %r15d
bsfq %rbx, %r12
movq %rbx, %rax
subq $0x1, %rax
movq %rax, -0x48(%rbp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmovbl %eax, %r12d
movl %r15d, %edi
movl %r12d, %esi
movl $0x4, %edx
callq 0x6a9a
movl %eax, -0x38(%rbp)
movl %r15d, %edi
movl %r12d, %esi
movl $0x1, %edx
callq 0x6a9a
movl %eax, -0x34(%rbp)
movl %r15d, %edi
movl %r12d, %esi
movl $0x2, %edx
callq 0x6a9a
movl %eax, -0x30(%rbp)
movl %r15d, %edi
movl %r12d, %esi
movl $0x3, %edx
callq 0x6a9a
movl %eax, -0x2c(%rbp)
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rax
cmpq %rax, %rsi
je 0x8308
movl -0x38(%rbp), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r14)
jmp 0x831c
movq %r14, %rdi
leaq -0x38(%rbp), %rdx
callq 0x83a8
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rax
cmpq %rax, %rsi
je 0x8330
movl -0x34(%rbp), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r14)
jmp 0x8344
movq %r14, %rdi
leaq -0x34(%rbp), %rdx
callq 0x83a8
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rax
cmpq %rax, %rsi
je 0x8358
movl -0x30(%rbp), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r14)
jmp 0x836c
movq %r14, %rdi
leaq -0x30(%rbp), %rdx
callq 0x83a8
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rax
cmpq %rax, %rsi
je 0x8380
movl -0x2c(%rbp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r14)
jmp 0x838c
movq %r14, %rdi
leaq -0x2c(%rbp), %rdx
callq 0x83a8
andq -0x48(%rbp), %rbx
decl %r13d
jne 0x8288
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq