LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/niekh1234[P]nnchesslib/attacks.cpp
// Function: nnchesslib::Attacks::initKnightAttacks()
void Attacks::initKnightAttacks()
{
    for (int i = 0; i <= 63; i++)
    {
        U64 pos = (U64)1 << i;

        U64 kAttacks =  (((pos >> 6) | (pos << 10)) & ~(file_bb[FILE_B] | file_bb[FILE_A])) |   //Knight moves two to the left
                        (((pos << 6) | (pos >> 10)) & ~(file_bb[FILE_H] | file_bb[FILE_G])) |   //Knight moves two to the right
                        (((pos >> 15) | (pos << 17)) & ~(file_bb[FILE_A])) |                    //Knight moves one to the left
                        (((pos << 15) | (pos >> 17)) & ~(file_bb[FILE_H]));                     //Knight moves one to the right

        nonSlidingAttacks[WHITE][KNIGHT][i] = kAttacks;
        nonSlidingAttacks[BLACK][KNIGHT][i] = kAttacks;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
xorl %ecx, %ecx
movabsq $-0x303030303030304, %rax # imm = 0xFCFCFCFCFCFCFCFC
movabsq $0x3f3f3f3f3f3f3f3f, %rdx # imm = 0x3F3F3F3F3F3F3F3F
movabsq $-0x101010101010102, %rsi # imm = 0xFEFEFEFEFEFEFEFE
movabsq $0x7f7f7f7f7f7f7f7f, %rdi # imm = 0x7F7F7F7F7F7F7F7F
leaq 0x28a7d4(%rip), %r8     # 0x28d5c0
movl $0x1, %r9d
shlq %cl, %r9
movq %r9, %r10
movl $0x400, %r11d           # imm = 0x400
shlq %cl, %r11
shrq $0x6, %r10
orq %r10, %r11
andq %rax, %r11
movl $0x40, %ebx
shlq %cl, %rbx
movq %r9, %r10
shrq $0xa, %r10
orq %rbx, %r10
andq %rdx, %r10
orq %r11, %r10
movq %r9, %r11
shrq $0xf, %r11
movl $0x20000, %ebx          # imm = 0x20000
shlq %cl, %rbx
orq %r11, %rbx
andq %rsi, %rbx
movl $0x8000, %r11d          # imm = 0x8000
shlq %cl, %r11
shrq $0x11, %r9
orq %r11, %r9
andq %rdi, %r9
orq %rbx, %r9
orq %r10, %r9
movq %r9, 0xe00(%r8,%rcx,8)
movq %r9, 0x200(%r8,%rcx,8)
incq %rcx
cmpq $0x40, %rcx
jne 0x2dec
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/niekh1234[P]nnchesslib/attacks.cpp
// Function: nnchesslib::Attacks::initKingAttacks()
void Attacks::initKingAttacks()
{
    for (int i = 0; i <= 63; i++)
    {
        U64 pos = (U64)1 << i;

        U64 kAttacks =  ((pos << 7) | (pos >> 1) | (pos >> 9)) & ~file_bb[FILE_H] | //King moves to the right
                        ((pos >> 7) | (pos << 1) | (pos << 9)) & ~file_bb[FILE_A] | //King moves to the left
                        ((pos >> 8) | (pos << 8));                                  //King moves up and down | easy, no bounds checking :^)

        nonSlidingAttacks[WHITE][KING][i] = kAttacks;
        nonSlidingAttacks[BLACK][KING][i] = kAttacks;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %ecx, %ecx
movabsq $0x7f7f7f7f7f7f7f7f, %rax # imm = 0x7F7F7F7F7F7F7F7F
movabsq $-0x101010101010102, %rdx # imm = 0xFEFEFEFEFEFEFEFE
leaq 0x28a732(%rip), %rsi    # 0x28d5c0
movl $0x1, %edi
shlq %cl, %rdi
movl $0x80, %r8d
shlq %cl, %r8
movq %rdi, %r9
shrq %r9
orq %r8, %r9
movq %rdi, %r8
shrq $0x9, %r8
orq %r9, %r8
andq %rax, %r8
movq %rdi, %r9
movl $0x202, %r10d           # imm = 0x202
shlq %cl, %r10
shrq $0x7, %r9
orq %r9, %r10
andq %rdx, %r10
movl $0x100, %r9d            # imm = 0x100
shlq %cl, %r9
shrq $0x8, %rdi
orq %rdi, %r9
orq %r10, %r9
orq %r8, %r9
movq %r9, 0x1600(%rsi,%rcx,8)
movq %r9, 0xa00(%rsi,%rcx,8)
incq %rcx
cmpq $0x40, %rcx
jne 0x2e8e
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/niekh1234[P]nnchesslib/attacks.cpp
// Function: nnchesslib::Attacks::genBlockers(int, unsigned long long)
U64 Attacks::genBlockers(int index, U64 mask)
{
    U64 blockerBoard = (U64)0;

    int bitIndex = 0;
    for(int i = 0; i <= 63; i++)
    {
        if(mask & (U64)1 << i)
        {
            if(index & (1 << bitIndex))
            {
                blockerBoard |= ((U64)1 << i);
            }

            bitIndex++;
        }
    }

    return blockerBoard;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %eax, %eax
movl $0x1, %r9d
shlq %cl, %r9
btq %rcx, %rsi
jae 0x2f26
btl %r8d, %edi
cmovaeq %rdx, %r9
orq %r9, %rax
incl %r8d
incq %rcx
cmpq $0x40, %rcx
jne 0x2f09
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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, %r14
movl %edi, %r15d
xorl %edi, %edi
movl %r15d, %esi
callq 0x874a
movq %rax, %rbx
testq %r14, %r14
je 0x2f6e
movq %rbx, %rdi
andq %r14, %rdi
callq 0x87cc
xorl %edi, %edi
movl %eax, %esi
callq 0x874a
xorq %rax, %rbx
movl $0x2, %edi
movl %r15d, %esi
callq 0x874a
movq %rax, %r12
testq %r14, %r14
je 0x2f9d
movq %r12, %rdi
andq %r14, %rdi
callq 0x87e0
movl $0x2, %edi
movl %eax, %esi
callq 0x874a
xorq %rax, %r12
movl $0x1, %edi
movl %r15d, %esi
callq 0x874a
movq %rax, %r13
testq %r14, %r14
je 0x2fcc
movq %r13, %rdi
andq %r14, %rdi
callq 0x87cc
movl $0x1, %edi
movl %eax, %esi
callq 0x874a
xorq %rax, %r13
movl $0x3, %edi
movl %r15d, %esi
callq 0x874a
movq %rax, %r15
testq %r14, %r14
je 0x2ffb
andq %r15, %r14
movq %r14, %rdi
callq 0x87e0
movl $0x3, %edi
movl %eax, %esi
callq 0x874a
xorq %rax, %r15
orq %r15, %r13
orq %rbx, %r12
orq %r13, %r12
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x874a
movq %rax, %r12
testq %rbx, %rbx
je 0x3056
movq %r12, %rdi
andq %rbx, %rdi
callq 0x87cc
movl $0x5, %edi
movl %eax, %esi
callq 0x874a
xorq %rax, %r12
movl $0x4, %edi
movl %r14d, %esi
callq 0x874a
movq %rax, %r15
orq %r12, %r15
movl $0x4, %edi
movl %r14d, %esi
callq 0x874a
testq %rbx, %rax
je 0x30a5
movl $0x4, %edi
movl %r14d, %esi
callq 0x874a
andq %rbx, %rax
movq %rax, %rdi
callq 0x87cc
movl $0x4, %edi
movl %eax, %esi
callq 0x874a
notq %rax
andq %rax, %r15
movl $0x6, %edi
movl %r14d, %esi
callq 0x874a
movq %rax, %r12
testq %rbx, %rbx
je 0x30d4
movq %r12, %rdi
andq %rbx, %rdi
callq 0x87e0
movl $0x6, %edi
movl %eax, %esi
callq 0x874a
xorq %rax, %r12
movl $0x7, %edi
movl %r14d, %esi
callq 0x874a
movq %rax, %r14
testq %rbx, %rbx
je 0x3103
andq %r14, %rbx
movq %rbx, %rdi
callq 0x87e0
movl $0x7, %edi
movl %eax, %esi
callq 0x874a
xorq %rax, %r14
orq %r15, %r12
orq %r14, %r12
movq %r12, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x32d4
cmpl $0x3, %esi
je 0x329e
cmpl $0x4, %esi
jne 0x331d
movslq %edi, %r15
leaq 0x9f93(%rip), %rax      # 0xd1c0
movq (%rax,%r15,8), %rdi
movq %rdi, %r14
andq %rbx, %r14
leaq 0x5ed2(%rip), %rax      # 0x9110
imulq (%rax,%r15,8), %r14
callq 0x87b4
negb %al
movl %eax, %ecx
shrq %cl, %r14
movq %r15, %rax
shlq $0xf, %rax
leaq 0xa363(%rip), %rcx      # 0xd5c0
addq %rax, %rcx
movq (%rcx,%r14,8), %r14
leaq 0xa155(%rip), %rax      # 0xd3c0
movq (%rax,%r15,8), %rdi
andq %rdi, %rbx
leaq 0x6097(%rip), %rax      # 0x9310
imulq (%rax,%r15,8), %rbx
callq 0x87b4
negb %al
movl %eax, %ecx
shrq %cl, %rbx
shlq $0xd, %r15
leaq 0x20a32b(%rip), %rax    # 0x20d5c0
addq %r15, %rax
orq (%rax,%rbx,8), %r14
jmp 0x330f
movslq %edi, %r14
leaq 0x9f18(%rip), %rax      # 0xd1c0
movq (%rax,%r14,8), %rdi
andq %rdi, %rbx
leaq 0x5e5a(%rip), %rax      # 0x9110
imulq (%rax,%r14,8), %rbx
callq 0x87b4
negb %al
movl %eax, %ecx
shrq %cl, %rbx
shlq $0xf, %r14
leaq 0xa2ee(%rip), %rax      # 0xd5c0
jmp 0x3308
movslq %edi, %r14
leaq 0xa0e2(%rip), %rax      # 0xd3c0
movq (%rax,%r14,8), %rdi
andq %rdi, %rbx
leaq 0x6024(%rip), %rax      # 0x9310
imulq (%rax,%r14,8), %rbx
callq 0x87b4
negb %al
movl %eax, %ecx
shrq %cl, %rbx
shlq $0xd, %r14
leaq 0x20a2b8(%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 0x5d85(%rip), %rdi      # 0x90a9
leaq 0x5d2d(%rip), %rsi      # 0x9058
leaq 0x5d92(%rip), %rcx      # 0x90c4
movl $0x107, %edx            # imm = 0x107
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3398
movl $0x1, %eax
movl %esi, %ecx
shlq %cl, %rax
testb %dl, %dl
je 0x338e
orq (%rdi), %rax
jmp 0x3394
notq %rax
andq (%rdi), %rax
movq %rax, (%rdi)
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x616d(%rip), %rdi      # 0x9510
leaq 0x6182(%rip), %rsi      # 0x952c
leaq 0x6188(%rip), %rcx      # 0x9539
movl $0x1c, %edx
callq 0x20c0
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x35fe
movq 0x9b2f(%rip), %rbx      # 0xcfd8
leaq 0x6148(%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 0x9afd(%rip), %rbx      # 0xcfd8
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20e0
xorl %r14d, %r14d
leaq 0x6113(%rip), %r15      # 0x9608
leaq 0x6257(%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 0x351e
movq %r12, %rsi
movl $0x2, %edx
movq %rbx, %rdi
callq 0x2180
decq %r13
jne 0x3509
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 0x34ff
movq 0x9a69(%rip), %rbx      # 0xcfd8
leaq 0x6082(%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 0x9a37(%rip), %rdi      # 0xcfd8
callq 0x2030
movq %rax, %rdi
callq 0x20e0
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x35c7
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 0x35da
jmp 0x35da
movq %rax, %rbx
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x35f6
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2150
movq %rbx, %rdi
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O1/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 0x333c
leaq 0x8(%rbx), %rdi
callq 0x333c
leaq 0x10(%rbx), %rdi
callq 0x333c
leaq 0x18(%rbx), %rdi
callq 0x333c
leaq 0x20(%rbx), %rdi
callq 0x333c
leaq 0x28(%rbx), %rdi
callq 0x333c
leaq 0x30(%rbx), %rdi
callq 0x333c
leaq 0x38(%rbx), %rdi
callq 0x333c
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 0x333c
leaq 0x60(%rbx), %rdi
callq 0x333c
leaq 0x68(%rbx), %rdi
callq 0x333c
leaq 0x70(%rbx), %rdi
callq 0x333c
leaq 0x78(%rbx), %rdi
callq 0x333c
leaq 0x80(%rbx), %rdi
callq 0x333c
leaq 0x88(%rbx), %rdi
callq 0x333c
leaq 0x90(%rbx), %rdi
callq 0x333c
leaq 0x98(%rbx), %rdi
callq 0x333c
leaq 0xa0(%rbx), %rdi
callq 0x333c
movb %r12b, 0xa8(%rbx)
movq %r15, 0xb0(%rbx)
movl %r15d, 0xb8(%rbx)
leaq 0xc0(%rbx), %rdi
movl %r15d, 0xa9(%rbx)
callq 0x333c
leaq 0xc8(%rbx), %rdi
callq 0x333c
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 0x6722
leaq -0x88(%rbp), %rsi
movq %rbx, %rdi
callq 0x3e70
movl %eax, %r15d
movq -0x88(%rbp), %rdi
cmpq %r13, %rdi
je 0x3da9
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2150
leaq 0x28b038(%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 0x6722
leaq -0x68(%rbp), %rsi
movq %rbx, %rdi
callq 0x382c
movq -0x68(%rbp), %rdi
cmpq %r14, %rdi
je 0x3dfd
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2150
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x3e12
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 0x3e53
movq -0x58(%rbp), %rsi
jmp 0x3e46
movq %rax, %rbx
movq -0x88(%rbp), %rdi
cmpq %r13, %rdi
je 0x3e53
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2150
jmp 0x3e53
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x3e68
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2150
movq %rbx, %rdi
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O1/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 0x4e00
xorl %ecx, %ecx
testl %esi, %esi
sete %sil
movl $0x10, %eax
cmpl $0x5, %edx
ja 0x4de3
movb %sil, %cl
movq (%rdi,%rcx,8), %rsi
movl %edx, %ecx
leaq 0x48d9(%rip), %rdx      # 0x9690
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movl $0x18, %eax
jmp 0x4de6
movl $0x30, %eax
jmp 0x4de6
movl $0x20, %eax
jmp 0x4de6
movl $0x28, %eax
jmp 0x4de6
movl $0x38, %eax
jmp 0x4de6
movq (%rdi), %rsi
andq (%rdi,%rax), %rsi
leaq -0x10(%rbp), %rbx
movq %rbx, %rdi
callq 0x334a
movq (%rbx), %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x4982(%rip), %rdi      # 0x9789
leaq 0x4721(%rip), %rsi      # 0x952f
leaq 0x4995(%rip), %rcx      # 0x97aa
movl $0xff, %edx
callq 0x20c0
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x33bc
testl %eax, %eax
jne 0x4f1e
leaq 0x18(%rbx), %r15
movq %r15, %rdi
movl %r14d, %esi
callq 0x33bc
testl %eax, %eax
jne 0x4f1e
leaq 0x20(%rbx), %r15
movq %r15, %rdi
movl %r14d, %esi
callq 0x33bc
testl %eax, %eax
jne 0x4f1e
leaq 0x28(%rbx), %r15
movq %r15, %rdi
movl %r14d, %esi
callq 0x33bc
testl %eax, %eax
jne 0x4f1e
leaq 0x30(%rbx), %r15
movq %r15, %rdi
movl %r14d, %esi
callq 0x33bc
testl %eax, %eax
jne 0x4f1e
addq $0x38, %rbx
movq %rbx, %rdi
movl %r14d, %esi
callq 0x33bc
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_O1/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 0x51b7
testq %rsi, 0x10(%rdi)
je 0x51b7
addq $0x60, %rdi
addl $-0x8, %ecx
jmp 0x51ce
xorl $0x30, %edx
xorl $0x20, %eax
orl %edx, %eax
jne 0x51db
testq %rsi, 0x10(%rdi)
je 0x51db
addq $0x58, %rdi
orl $0x8, %ecx
movl %ecx, %esi
movl $0x1, %edx
popq %rbp
jmp 0x3376
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x6a54
movl %eax, %r12d
movl %r15d, %edi
callq 0x6a62
movl %eax, %r14d
movq %rbx, %rdi
movl %r12d, %esi
callq 0x4f2c
movq %rax, %r13
movl %r15d, %edi
callq 0x6a6d
movl %eax, %r15d
leaq 0x10(%rbx), %rdi
movl %r12d, %esi
xorl %edx, %edx
callq 0x3376
movq %r13, %rdi
movl %r12d, %esi
xorl %edx, %edx
callq 0x3376
movq %r13, %rdi
movl %r14d, %esi
movl $0x1, %edx
callq 0x3376
decl %r15d
cmpl $0x3, %r15d
ja 0x570a
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 0x3376
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x6a54
movl %eax, %r15d
movl %r14d, %edi
callq 0x6a62
movl %eax, %r14d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x4e9a
movq %rax, %r12
movl %r14d, %r13d
cmpl $0x20, %r15d
jl 0x57be
addl $-0x8, %r13d
movq %rbx, %rdi
movl %r13d, %esi
callq 0x4e9a
movq %rax, -0x30(%rbp)
movq %rbx, %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x3376
movq %rbx, %rdi
movl %r14d, %esi
movl $0x1, %edx
callq 0x3376
movq %r12, %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x3376
movq %r12, %rdi
movl %r14d, %esi
movl $0x1, %edx
callq 0x3376
movq -0x30(%rbp), %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x3376
addq $0x8, %rbx
jmp 0x5825
addl $0x8, %r13d
movq %rbx, %rdi
movl %r13d, %esi
callq 0x4e9a
movq %rax, -0x30(%rbp)
movq %r12, -0x38(%rbp)
leaq 0x8(%rbx), %r12
movq %r12, %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x3376
movq %r12, %rdi
movl %r14d, %esi
movl $0x1, %edx
callq 0x3376
movq -0x38(%rbp), %r12
movq %r12, %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x3376
movq %r12, %rdi
movl %r14d, %esi
movl $0x1, %edx
callq 0x3376
movq -0x30(%rbp), %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x3376
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 0x3376
// File: /workspace/github_cpp_makefile_star2_O1/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 0x6a54
movl %eax, %r14d
movl %r15d, %edi
callq 0x6a62
movl %eax, %r15d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x4e9a
movq %rax, %r13
movq %rbx, %rdi
movl %r15d, %esi
callq 0x4e9a
movq %rax, %r12
movq %rbx, %rdi
movl %r14d, %esi
callq 0x4f2c
movq %rax, -0x30(%rbp)
movl 0x48(%rbx), %eax
incl %eax
movl %eax, 0x48(%rbx)
movq (%r13), %rcx
xorl %edx, %edx
testq %rcx, 0x10(%rbx)
cmovel %eax, %edx
movl %edx, 0x48(%rbx)
testq %r12, %r12
je 0x58dd
movq %r12, %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x3376
movq %rbx, %rdi
movl %r15d, %esi
callq 0x4f2c
movq %rax, %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x3376
movl $0x0, 0x48(%rbx)
movq %r13, %rdi
movl %r14d, %esi
xorl %edx, %edx
callq 0x3376
movq %r13, %rdi
movl %r15d, %esi
movl $0x1, %edx
callq 0x3376
movq -0x30(%rbp), %r12
movq %r12, %rdi
movl %r14d, %esi
xorl %edx, %edx
callq 0x3376
movq %r12, %rdi
movl %r15d, %esi
movl $0x1, %edx
callq 0x3376
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 0x5182
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x6a7c
cmpl $0x3, %eax
ja 0x59a9
movl %eax, %eax
leaq 0x3d3a(%rip), %rcx      # 0x96a8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
movl %r14d, %esi
callq 0x5840
jmp 0x59a9
movq %rbx, %rdi
movl %r14d, %esi
callq 0x571a
jmp 0x59a9
movq %rbx, %rdi
movl %r14d, %esi
callq 0x533e
jmp 0x59a9
movq %rbx, %rdi
movl %r14d, %esi
callq 0x566e
movq %rbx, %rdi
callq 0x51de
movb 0x40(%rbx), %al
movl %eax, %ecx
xorb $0x1, %cl
movb %cl, 0x40(%rbx)
testb %al, %al
jne 0x59c3
incl 0x4c(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x6727(%rip), %rbx      # 0xcfd8
leaq 0x30c8(%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 0x85c2
callq 0x29fc
callq 0x20d0
movq %rax, %r15
leaq 0x308b(%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 0x3067(%rip), %rsi      # 0x99a7
movl $0xc, %edx
movq %rbx, %rdi
callq 0x2180
subq %r14, %r15
cvtsi2ss %r15, %xmm0
divss 0x301f(%rip), %xmm0     # 0x997c
cvtss2sd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x2230
movq %rax, %rbx
leaq 0x3041(%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_O1/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 0x6898
leaq -0x108(%rbp), %rbx
movq %rbx, %rdi
callq 0x36b4
leaq -0x28(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x2fda(%rip), %rsi      # 0x99be
leaq 0x2fd7(%rip), %rdx      # 0x99c2
leaq -0x38(%rbp), %r14
movq %r14, %rdi
callq 0x6688
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6536
movq -0x38(%rbp), %rdi
cmpq %r15, %rdi
je 0x6a17
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x2150
leaq -0x108(%rbp), %rdi
callq 0x4946
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 0x6a4b
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x2150
movq %rbx, %rdi
callq 0x2270
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x882f
movl %r14d, %esi
andl $0x3f, %esi
leaq -0x30(%rbp), %rdi
callq 0x882f
leaq -0x50(%rbp), %rsi
leaq -0x30(%rbp), %rdx
movq %rbx, %rdi
callq 0x6c4b
movl %r14d, %eax
andl $0xc000, %eax           # imm = 0xC000
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x6b29
shrl $0xa, %r14d
andl $0xc, %r14d
leaq 0x2eb6(%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 0x6b42
movq -0x20(%rbp), %rsi
incq %rsi
callq 0x2150
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6b5b
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 0x6b86
movq (%rbx), %rsi
incq %rsi
callq 0x2150
jmp 0x6b86
movq %rax, %r14
leaq -0x20(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6ba4
movq -0x20(%rbp), %rsi
incq %rsi
callq 0x2150
jmp 0x6ba4
movq %rax, %r14
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6bbd
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x2150
movq %r14, %rdi
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O1/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 0x6ddf
movq -0x50(%rbp), %r12
movq -0x48(%rbp), %r14
cmpq %r14, %r12
je 0x6d74
leaq -0x120(%rbp), %r15
movl (%r12), %ebx
movl %ebx, -0x2c(%rbp)
movl $0xd0, %edx
movq %r15, %rdi
movq %r13, %rsi
callq 0x2110
movq %r15, %rdi
movl %ebx, %esi
callq 0x593c
movq %r13, %rdi
callq 0x4e90
movzbl %al, %esi
movq %r15, %rdi
callq 0x4f62
testb %al, %al
jne 0x6d6b
movq -0x38(%rbp), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x6d62
movl -0x2c(%rbp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x6d6b
leaq -0x2c(%rbp), %rdx
callq 0x845c
addq $0x4, %r12
cmpq %r14, %r12
jne 0x6d0d
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x6d89
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
movq -0x38(%rbp), %rax
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6da3
jmp 0x6da3
movq %rax, %r14
movq -0x38(%rbp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x6dc2
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rsi
subq %rdi, %rsi
callq 0x2150
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x6dd7
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x2150
movq %r14, %rdi
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O1/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 0x4e6c
movq %rax, %r14
movq %r15, %rdi
callq 0x4e90
movl $0x1a, %ecx
movq %rsp, %rdi
movq %r15, %rsi
testb %al, %al
je 0x6e28
rep  movsq (%rsi), %es:(%rdi)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6e44
jmp 0x6e36
rep  movsq (%rsi), %es:(%rdi)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6f6c
addq $0xd8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x7082
movl $0x1a, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x7272
movl $0x1a, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
callq 0x73a7
movl $0x1a, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x7623
movl $0x1a, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
movl $0x1, %esi
movl $0x5, %edx
callq 0x7623
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 0x780d
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 0x780d
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 0x780d
movq %r14, %rdi
movl $0x1, %esi
movq %rbx, %rdx
addq $0xd8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x79ff
// File: /workspace/github_cpp_makefile_star2_O1/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 0x7d0d
movl $0x1a, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x7ef2
movl $0x1a, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
callq 0x8025
movl $0x1a, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x7623
movl $0x1a, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
xorl %esi, %esi
movl $0x5, %edx
callq 0x7623
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 0x780d
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 0x780d
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 0x780d
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rdx
addq $0xd8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x79ff
// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rbp), %rdi
movl $0x1, %r12d
movl $0x1, %esi
xorl %edx, %edx
callq 0x4d8a
andl $0xff00, %eax           # imm = 0xFF00
leaq -0x40(%rbp), %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0x334a
movq (%r15), %rsi
shlq $0x8, %rsi
notq %r14
andq %r14, %rsi
leaq -0x38(%rbp), %r15
movq %r15, %rdi
callq 0x334a
movq (%r15), %rsi
shlq $0x8, %rsi
andq %r14, %rsi
leaq -0x30(%rbp), %r14
movq %r14, %rdi
callq 0x334a
movq (%r14), %rax
testq %rax, %rax
je 0x739a
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, %rcx # imm = 0x101010101010101
imulq %rax, %rcx
shrq $0x38, %rcx
cmpl $0x2, %ecx
cmovael %ecx, %r12d
leaq -0x24(%rbp), %r14
movq -0x30(%rbp), %rax
leaq -0x1(%rax), %rcx
andq %rax, %rcx
movq %rcx, -0x30(%rbp)
cmpq $0x1, %rax
jb 0x7395
bsfq %rax, %rsi
leal -0x10(%rsi), %edi
callq 0x6a8a
movl %eax, -0x24(%rbp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x738a
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x7395
movq %rbx, %rdi
movq %r14, %rdx
callq 0x845c
decl %r12d
jne 0x7350
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x4d8a
movabsq $0xff000000000000, %rsi # imm = 0xFF000000000000
andq %rax, %rsi
leaq -0x38(%rbp), %r15
movq %r15, %rdi
callq 0x334a
movq (%r15), %rsi
shrq $0x8, %rsi
notq %r14
andq %r14, %rsi
leaq -0x30(%rbp), %r15
movq %r15, %rdi
callq 0x334a
movq (%r15), %rsi
shrq $0x8, %rsi
andq %r14, %rsi
leaq -0x28(%rbp), %r14
movq %r14, %rdi
callq 0x334a
movq (%r14), %rax
testq %rax, %rax
je 0x801a
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, %rcx # imm = 0x101010101010101
imulq %rax, %rcx
shrq $0x38, %rcx
cmpl $0x2, %ecx
movl $0x1, %r15d
cmovael %ecx, %r15d
leaq -0x1c(%rbp), %r14
movq -0x28(%rbp), %rax
leaq -0x1(%rax), %rcx
andq %rax, %rcx
movq %rcx, -0x28(%rbp)
cmpq $0x1, %rax
jb 0x8015
bsfq %rax, %rsi
leal 0x10(%rsi), %edi
callq 0x6a8a
movl %eax, -0x1c(%rbp)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x800a
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x8015
movq %rbx, %rdi
movq %r14, %rdx
callq 0x845c
decl %r15d
jne 0x7fd0
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq