LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/cpirc[P]Monochrome/src/move_gen.cpp
// Function: void add_moves<false, (Piece)1>(Position const&, unsigned int*, int&)
void add_moves(const Position& pos, Move* ml, int& idx) {
    std::uint64_t pieces = get_piece(pos, pc, US);
    std::uint64_t occ = get_occupancy(pos);
    std::uint64_t capturemask = (captures) ? get_colour(pos, THEM) : ~occ;
    MoveType mt = captures ? CAPTURE : NORMAL;

    while (pieces) {
        Square from = lsb(pieces);

        std::uint64_t attack_bb = attacks<pc>(from, occ) & capturemask;

        while (attack_bb) {
            Square dest = lsb(attack_bb);

            ml[idx] = get_move(from, dest, mt);
            idx++;

            attack_bb &= attack_bb - 1;
        }

        pieces &= pieces - 1;
    }

    add_moves<captures, pc + 1>(pos, ml, idx);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq 0x30(%rdi), %rax
movq 0x8(%rdi), %r12
andq %rax, %r12
movq %rdi, -0x30(%rbp)
orq 0x38(%rdi), %rax
notq %rax
movq %rax, -0x38(%rbp)
testq %r12, %r12
je 0x4a8b
movq %r12, %rdi
callq 0x2939
movzbl %al, %r15d
leaq 0xab4f(%rip), %rax      # 0xf5a0
movq (%rax,%r15,8), %r13
andq -0x38(%rbp), %r13
testq %r13, %r13
je 0x4a81
movq %r13, %rdi
callq 0x2939
movzbl %al, %eax
shll $0x6, %eax
orl %r15d, %eax
movslq (%rbx), %rcx
movl %eax, (%r14,%rcx,4)
incl (%rbx)
leaq -0x1(%r13), %rax
andq %rax, %r13
jmp 0x4a59
leaq -0x1(%r12), %rax
andq %rax, %r12
jmp 0x4a39
movq -0x30(%rbp), %rdi
movq %r14, %rsi
movq %rbx, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4b47
// File: /workspace/github_cpp_makefile_star2_O2/cpirc[P]Monochrome/src/perft.cpp
// Function: perft(Position const&, int)
std::uint64_t perft(const Position& pos, const int depth) {
    if (depth == 0) {
        return 1;
    }

    uint64_t nodes = 0;
    Move moves[256];
    int movecount = generate(pos, moves);

    for (int i = 0; i < movecount; i++) {
        Position npos = pos;

        make_move(npos, moves[i]);
        if (is_checked(npos, THEM)) continue;

        nodes += perft(npos, depth - 1);
    }

    return nodes;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x478, %rsp            # imm = 0x478
testl %esi, %esi
je 0x4fd5
movl %esi, %ebx
movq %rdi, %r14
leaq -0x4a0(%rbp), %rsi
callq 0x49ae
movl %eax, %r15d
decl %ebx
movl %ebx, -0x2c(%rbp)
xorl %ebx, %ebx
testl %eax, %eax
cmovlel %ebx, %r15d
leaq -0x98(%rbp), %r12
xorl %r13d, %r13d
cmpq %rbx, %r15
je 0x4fd9
movq %r12, %rdi
movq %r14, %rsi
callq 0x40d2
movl -0x4a0(%rbp,%rbx,4), %esi
movq %r12, %rdi
callq 0x3988
movq %r12, %rdi
pushq $0x1
popq %rsi
callq 0x40fd
testb %al, %al
jne 0x4fc7
movq %r12, %rdi
movl -0x2c(%rbp), %esi
callq 0x4f48
addq %rax, %r13
leaq -0x48(%rbp), %rdi
callq 0x41a8
incq %rbx
jmp 0x4f8b
pushq $0x1
popq %r13
movq %r13, %rax
addq $0x478, %rsp            # imm = 0x478
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x41a8
movq %rbx, %rdi
callq 0x2290
// File: /workspace/github_cpp_makefile_star2_O2/cpirc[P]Monochrome/src/perft.cpp
// Function: perft_tt(TT*, Position const&, int)
std::uint64_t perft_tt(TT* tt, const Position& pos, const int depth) {
    assert(tt);

    if (depth == 0) {
        return 1;
    }

    TTEntry entry = tt_poll(tt, pos.hash_key);
    if (entry.hash_key == pos.hash_key && tt_depth(entry.data) == depth) {
        return tt_nodes(entry.data);
    }

    uint64_t nodes = 0;
    Move moves[256];
    int movecount = generate(pos, moves);
    for (int i = 0; i < movecount; i++) {
        Position npos = pos;

        make_move(npos, moves[i]);
        if (is_checked(npos, THEM)) continue;

        nodes += perft_tt(tt, npos, depth - 1);
    }

    tt_add_perft(tt, pos.hash_key, depth, nodes);

    return nodes;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x488, %rsp            # imm = 0x488
movq %rdi, -0x30(%rbp)
testq %rdi, %rdi
je 0x510d
movl %edx, %r14d
testl %edx, %edx
je 0x50f4
movq %rsi, %r15
movq 0x48(%rsi), %rsi
movq -0x30(%rbp), %rdi
callq 0x7407
cmpq 0x48(%r15), %rdx
jne 0x5060
movq %rax, %rbx
movq %rax, %rdi
callq 0x51d1
cmpl %r14d, %eax
jne 0x5060
shrq $0x7, %rbx
movslq %ebx, %r12
jmp 0x50f8
leaq -0x4b0(%rbp), %rsi
movq %r15, %rdi
callq 0x49ae
movl %eax, %r13d
movq %r14, -0x40(%rbp)
leal -0x1(%r14), %eax
movl %eax, -0x34(%rbp)
xorl %ebx, %ebx
testl %r13d, %r13d
cmovlel %ebx, %r13d
leaq -0xa8(%rbp), %r14
xorl %r12d, %r12d
cmpq %rbx, %r13
je 0x50de
movq %r14, %rdi
movq %r15, %rsi
callq 0x40d2
movl -0x4b0(%rbp,%rbx,4), %esi
movq %r14, %rdi
callq 0x3988
movq %r14, %rdi
pushq $0x1
popq %rsi
callq 0x40fd
testb %al, %al
jne 0x50d0
movq -0x30(%rbp), %rdi
movq %r14, %rsi
movl -0x34(%rbp), %edx
callq 0x5002
addq %rax, %r12
leaq -0x58(%rbp), %rdi
callq 0x41a8
incq %rbx
jmp 0x5090
movq 0x48(%r15), %rsi
movq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rdx
movq %r12, %rcx
callq 0x7618
jmp 0x50f8
pushq $0x1
popq %r12
movq %r12, %rax
addq $0x488, %rsp            # imm = 0x488
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x58c6(%rip), %rdi      # 0xa9da
leaq 0x58c2(%rip), %rsi      # 0xa9dd
leaq 0x58c9(%rip), %rcx      # 0xa9eb
pushq $0x38
popq %rdx
callq 0x2110
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x41a8
movq %rbx, %rdi
callq 0x2290
// File: /workspace/github_cpp_makefile_star2_O2/cpirc[P]Monochrome/src/perft.cpp
// Function: run_perft_tests()
void run_perft_tests() {
    Position pos;
    parse_fen_to_position((const char*)"r3k2r/Pppp1ppp/1b3nbN/nP6/BBP1P3/q4N2/Pp1P2PP/R2Q1RK1 w kq - 0 1", pos);
    for (int i = 1; i <= 6; i++) {
        std::printf("Perft(%d) = %" PRIu64 "\n", i, perft(pos, i));
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x70, %rsp
leaq -0x38(%rbp), %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
andq $0x0, 0x10(%rbx)
leaq 0x58c2(%rip), %rdi      # 0xaa25
leaq -0x88(%rbp), %rsi
callq 0x5372
pushq $0x1
popq %r14
leaq -0x88(%rbp), %r15
leaq 0x58e5(%rip), %r12      # 0xaa66
cmpl $0x7, %r14d
je 0x51a7
movq %r15, %rdi
movl %r14d, %esi
callq 0x4f48
movq %r12, %rdi
movl %r14d, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2030
incl %r14d
jmp 0x5181
movq %rbx, %rdi
callq 0x41a8
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x51be
movq %rax, %r14
movq %rbx, %rdi
callq 0x41a8
movq %r14, %rdi
callq 0x2290
// File: /workspace/github_cpp_makefile_star2_O2/cpirc[P]Monochrome/src/tt.h
// Function: tt_depth(unsigned long)
inline int tt_depth(const std::uint64_t data) {
    int depth = (data >> TT_DEPTH_SHIFT) & TT_DEPTH_MASK;
    assert(depth >= 0);
    assert(depth < MAX_PLY);
    return depth;

    // return (data >> TT_DEPTH_SHIFT) & TT_DEPTH_MASK;
}

// Assembly:
andl $0x7f, %edi
cmpl $0x40, %edi
jae 0x51dc
movl %edi, %eax
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x58bb(%rip), %rdi      # 0xaaa2
leaq 0x5889(%rip), %rsi      # 0xaa77
leaq 0x588b(%rip), %rcx      # 0xaa80
pushq $0x64
popq %rdx
callq 0x2110
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/cpirc[P]Monochrome/src/position.cpp
// Function: init_keys()
void init_keys() {
    int i, j;
    for (i = 0; i < 16; ++i) {
        castle_keys[i] = get_rand64();
    }
    for (i = 0; i < 6; ++i) {
        for (j = 0; j < 64; ++j) {
            piece_sq_keys[i][j] = get_rand64();
        }
    }
    for (i = 0; i < 8; i++) {
        ep_keys[i] = get_rand64();
    }
    flip_key = get_rand64();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
xorl %ebx, %ebx
leaq 0x2528dd(%rip), %r14    # 0x257af0
cmpq $0x80, %rbx
je 0x522b
callq 0x5ac6
movq %rax, (%rbx,%r14)
addq $0x8, %rbx
jmp 0x5213
leaq 0x251cbe(%rip), %rbx    # 0x256ef0
xorl %r14d, %r14d
cmpq $0x6, %r14
je 0x525e
xorl %r15d, %r15d
cmpq $0x40, %r15
je 0x5252
callq 0x5ac6
movq %rax, (%rbx,%r15,8)
incq %r15
jmp 0x523e
incq %r14
addq $0x200, %rbx            # imm = 0x200
jmp 0x5235
xorl %ebx, %ebx
leaq 0x252909(%rip), %r14    # 0x257b70
callq 0x5ac6
cmpq $0x40, %rbx
je 0x527c
movq %rax, (%rbx,%r14)
addq $0x8, %rbx
jmp 0x5267
movq %rax, 0x25292d(%rip)    # 0x257bb0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/cpirc[P]Monochrome/src/position.cpp
// Function: calculate_key(Position&)
void calculate_key(Position &pos) {
    std::uint64_t pieces;

    pos.hash_key = 0;
    pieces = get_colour(pos, US);

    while (pieces) {
        Square sq = lsb(pieces);
        Piece pc = get_piece_on_square(pos, sq);

        pos.hash_key ^= piece_sq_keys[pc][sq];

        pieces &= pieces - 1;
    }

    pieces = get_colour(pos, THEM);

    while (pieces) {
        Square sq = lsb(pieces);
        Piece pc = get_piece_on_square(pos, sq);

        pos.hash_key ^= bswap(piece_sq_keys[pc][sq]);

        pieces &= pieces - 1;
    }

    pos.hash_key ^= castle_keys[pos.castle];

    if (pos.epsq != INVALID_SQUARE) {
        pos.hash_key ^= ep_keys[pos.epsq & 7];
    }

    if (pos.flipped) pos.hash_key ^= flip_key;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
andq $0x0, 0x48(%rdi)
movq 0x30(%rdi), %r14
xorl %eax, %eax
leaq 0x251c42(%rip), %r12    # 0x256ef0
testq %r14, %r14
je 0x52e8
movq %r14, %rdi
callq 0x2939
movzbl %al, %r15d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x4091
movzbl %al, %ecx
shll $0x9, %ecx
addq %r12, %rcx
movq 0x48(%rbx), %rax
xorq (%rcx,%r15,8), %rax
movq %rax, 0x48(%rbx)
leaq -0x1(%r14), %rcx
andq %rcx, %r14
jmp 0x52ae
movq 0x38(%rbx), %r14
testq %r14, %r14
je 0x5329
movq %r14, %rdi
callq 0x2939
movzbl %al, %r15d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x4091
movzbl %al, %eax
shll $0x9, %eax
addq %r12, %rax
movq (%rax,%r15,8), %rax
bswapq %rax
xorq 0x48(%rbx), %rax
movq %rax, 0x48(%rbx)
leaq -0x1(%r14), %rcx
andq %rcx, %r14
jmp 0x52ec
movzbl 0x40(%rbx), %ecx
leaq 0x2527bc(%rip), %rdx    # 0x257af0
xorq (%rdx,%rcx,8), %rax
movq %rax, 0x48(%rbx)
movzbl 0x42(%rbx), %ecx
cmpq $0x40, %rcx
je 0x5358
andl $0x7, %ecx
leaq 0x252820(%rip), %rdx    # 0x257b70
xorq (%rdx,%rcx,8), %rax
movq %rax, 0x48(%rbx)
cmpb $0x1, 0x41(%rbx)
jne 0x5369
xorq 0x25284b(%rip), %rax    # 0x257bb0
movq %rax, 0x48(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/cpirc[P]Monochrome/src/position.cpp
// Function: run_fen_parser_tests()
void run_fen_parser_tests() {
    Position tmp;

    init_keys();
    parse_fen_to_position((const char*)"rnbqkbnr//pppppppp//8//8//8//8//PPPPPPPP//RNBQKBNR w KQkq - 0 1", tmp);
    print_position_struct(tmp);
    parse_fen_to_position((const char*)"rnbqkbnr//pppppppp//8///8//4P3//8//PPPP1PPP//RNBQKBNR b KQkq e3 0 1", tmp);
    print_position_struct(tmp);
    parse_fen_to_position((const char*)"rnbqkbnr//pp1ppppp//8//2p5//4P3//8//PPPP1PPP//RNBQKBNR w KQkq c6 0 2", tmp);
    print_position_struct(tmp);
    parse_fen_to_position((const char*)"rnbqkbnr//pp1ppppp//8//2p5//4P3//5N2//PPPP1PPP//RNBQKB1R b Qkq - 1 2", tmp);
    print_position_struct(tmp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x70, %rsp
leaq -0x28(%rbp), %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
andq $0x0, 0x10(%rbx)
callq 0x5200
leaq 0x53ce(%rip), %rdi      # 0xac3a
leaq -0x78(%rbp), %rsi
callq 0x5372
leaq -0x78(%rbp), %r14
movq %r14, %rdi
callq 0x5680
leaq 0x53f2(%rip), %rdi      # 0xac7a
movq %r14, %rsi
callq 0x5372
movq %r14, %rdi
callq 0x5680
leaq 0x541f(%rip), %rdi      # 0xacbe
movq %r14, %rsi
callq 0x5372
movq %r14, %rdi
callq 0x5680
leaq 0x544d(%rip), %rdi      # 0xad03
movq %r14, %rsi
callq 0x5372
leaq -0x78(%rbp), %rdi
callq 0x5680
movq %rbx, %rdi
callq 0x41a8
addq $0x70, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x41a8
movq %r14, %rdi
callq 0x2290
// File: /workspace/github_cpp_makefile_star2_O2/cpirc[P]Monochrome/src/position.cpp
// Function: print_position(Position const&)
void print_position(const Position &pos) {
    Position npos = pos;
    if (pos.flipped) {
        flip_position(npos);
        calculate_key(npos);
    }

    int sq = A8;
    while (sq >= 0) {
        Piece piece = get_piece_on_square(npos, (std::uint64_t)1 << sq);
        bool white = ((std::uint64_t)1 << sq) & get_colour(npos, US);

        if (white)
            printf("%c", Piece_ASCII[piece]);
        else
            printf("%c", tolower(Piece_ASCII[piece]));

        if (sq % 8 == 7) {
            printf("\n");
            sq -= 16;
        }
        sq++;
    }

    printf("Flipped: %i\n", pos.flipped);
    printf("Eval: %i\n", evaluate(npos));
    printf("Hash: %" PRIx64 "\n", pos.hash_key);
    printf("Halfmoves: %i\n", pos.halfmoves);
    printf("History: %" PRIu64 "\n", pos.history.size());
    for (auto &i : pos.history) {
        printf("  %" PRIx64 "\n", i);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, %rbx
leaq -0x98(%rbp), %rdi
movq %rbx, %rsi
callq 0x40d2
movq %rbx, -0x30(%rbp)
cmpb $0x1, 0x41(%rbx)
jne 0x592f
leaq -0x98(%rbp), %r14
movq %r14, %rdi
callq 0x2c63
movq %r14, %rdi
callq 0x528e
pushq $0x38
popq %r14
pushq $0x1
popq %rbx
leaq -0x98(%rbp), %r15
leaq 0x5284(%rip), %r12      # 0xabc8
testl %r14d, %r14d
js 0x5991
movq %rbx, %r13
movl %r14d, %ecx
shlq %cl, %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0x434a
movzbl %al, %eax
movsbl (%rax,%r12), %edi
testq %r13, -0x68(%rbp)
jne 0x5972
callq 0x2210
movl %eax, %edi
callq 0x21f0
movl %r14d, %eax
notl %eax
testb $0x7, %al
jne 0x598c
pushq $0xa
popq %rdi
callq 0x21f0
addl $-0x10, %r14d
incl %r14d
jmp 0x5944
movq -0x30(%rbp), %rbx
movzbl 0x41(%rbx), %esi
leaq 0x53a8(%rip), %rdi      # 0xad48
xorl %eax, %eax
callq 0x2030
leaq -0x98(%rbp), %rdi
callq 0x27dd
leaq 0x539b(%rip), %rdi      # 0xad55
movl %eax, %esi
xorl %eax, %eax
callq 0x2030
movq 0x48(%rbx), %rsi
leaq 0x5391(%rip), %rdi      # 0xad5f
xorl %eax, %eax
callq 0x2030
movzbl 0x43(%rbx), %esi
leaq 0x538a(%rip), %rdi      # 0xad6a
xorl %eax, %eax
callq 0x2030
movq 0x58(%rbx), %rsi
subq 0x50(%rbx), %rsi
sarq $0x3, %rsi
leaq 0x537f(%rip), %rdi      # 0xad79
xorl %eax, %eax
callq 0x2030
movq 0x50(%rbx), %r14
movq 0x58(%rbx), %r15
leaq 0x5377(%rip), %rbx      # 0xad87
cmpq %r15, %r14
je 0x5a28
movq (%r14), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2030
addq $0x8, %r14
jmp 0x5a10
leaq -0x48(%rbp), %rdi
callq 0x41a8
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5a44
jmp 0x5a44
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x41a8
movq %rbx, %rdi
callq 0x2290
// File: /workspace/github_cpp_makefile_star2_O2/cpirc[P]Monochrome/src/position.cpp
// Function: repetitions(Position const&)
int repetitions(const Position &pos) {
    int count = 0;
    for (int i = pos.history.size() - 3; i >= 0; --i) {
        if (pos.history[i] == pos.history.back()) {
            count++;
        }
    }
    return count;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x50(%rdi), %rcx
movq 0x58(%rdi), %rdx
movq %rdx, %rsi
subq %rcx, %rsi
shrq $0x3, %rsi
addl $-0x3, %esi
xorl %eax, %eax
testl %esi, %esi
js 0x5a8f
movl %esi, %edi
movq (%rcx,%rdi,8), %rdi
xorl %r8d, %r8d
cmpq -0x8(%rdx), %rdi
sete %r8b
addl %r8d, %eax
decl %esi
jmp 0x5a73
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/cpirc[P]Monochrome/src/misc.h
// Function: get_rand64()
inline std::uint64_t get_rand64() {
    static std::uniform_int_distribution<std::uint64_t> dist;
    std::uint64_t r;
    do {
        r = dist(rng);
    } while (!r);
    return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movb 0x2520f5(%rip), %al     # 0x257bc8
testb %al, %al
je 0x5afa
leaq 0x2520da(%rip), %rbx    # 0x257bb8
leaq 0x25007b(%rip), %r14    # 0x255b60
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5bc2
testq %rax, %rax
je 0x5ae5
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x2520c7(%rip), %rdi    # 0x257bc8
callq 0x22a0
testl %eax, %eax
je 0x5ad7
andq $0x0, 0x2520a6(%rip)    # 0x257bb8
orq $-0x1, 0x2520a6(%rip)   # 0x257bc0
leaq 0x2520a7(%rip), %rdi    # 0x257bc8
callq 0x2100
jmp 0x5ad7
// File: /workspace/github_cpp_makefile_star2_O2/cpirc[P]Monochrome/src/search.cpp
// Function: score_moves(Position const&, SearchStack*, int, unsigned int)
void score_moves(const Position& pos, SearchStack* ss, int size,
                 Move hash_move) {
    assert(ss);

    for (int i = 0; i < size; i++) {
        Move move = ss->ml[i];

        if (move == hash_move) {
            ss->score[i] = 20000;
            continue;
        }

        int mt = move_type(move);
        if (mt == CAPTURE)
            ss->score[i] = 9000 + mvv_lva(pos, move);
        else if (mt == PROM_CAPTURE)
            ss->score[i] = 9000 + mvv_lva(pos, move) +
                           piecevals[OPENING][promotion_type(move)];
        else if (mt == ENPASSANT)
            ss->score[i] = 9000 + piecevals[OPENING][PAWN] - PAWN + 10;
        else if (ss->killers[0] == move)
            ss->score[i] = 7000;
        else if (ss->killers[1] == move)
            ss->score[i] = 6000;
        else
            ss->score[i] = 0;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, -0x38(%rbp)
testq %rsi, %rsi
je 0x5f89
movl %ecx, %ebx
movl %edx, %r14d
movq %rsi, %r15
leaq 0x316f(%rip), %rax      # 0x9010
movl (%rax), %eax
addl $0x32, %eax
movzbl %al, %eax
movl %eax, -0x2c(%rbp)
xorl %r12d, %r12d
testl %edx, %edx
cmovlel %r12d, %r14d
cmpq %r12, %r14
je 0x5f7a
movl 0x4(%r15,%r12,4), %r13d
cmpl %ebx, %r13d
jne 0x5ed6
movl $0x4e20, 0x404(%r15,%r12,4) # imm = 0x4E20
jmp 0x5f39
movl %r13d, %eax
andl $0x7000, %eax           # imm = 0x7000
cmpl $0x6000, %eax           # imm = 0x6000
je 0x5f0b
cmpl $0x3000, %eax           # imm = 0x3000
je 0x5f06
cmpl $0x2000, %eax           # imm = 0x2000
jne 0x5f41
movq -0x38(%rbp), %rdi
movl %r13d, %esi
callq 0x5e2c
addl $0x2328, %eax           # imm = 0x2328
jmp 0x5f31
movl -0x2c(%rbp), %eax
jmp 0x5f31
movq -0x38(%rbp), %rdi
movl %r13d, %esi
callq 0x5e2c
shrl $0xd, %r13d
andl $0x1c, %r13d
leaq 0x30ea(%rip), %rcx      # 0x9010
movl (%rcx,%r13), %ecx
addl %ecx, %eax
addl $0x2328, %eax           # imm = 0x2328
movl %eax, 0x404(%r15,%r12,4)
incq %r12
jmp 0x5eb5
cmpl %r13d, 0x804(%r15)
jne 0x5f58
movl $0x1b58, 0x404(%r15,%r12,4) # imm = 0x1B58
jmp 0x5f39
cmpl %r13d, 0x808(%r15)
jne 0x5f6f
movl $0x1770, 0x404(%r15,%r12,4) # imm = 0x1770
jmp 0x5f39
andl $0x0, 0x404(%r15,%r12,4)
jmp 0x5f39
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4ed0(%rip), %rdi      # 0xae60
leaq 0x4ecc(%rip), %rsi      # 0xae63
leaq 0x4ed4(%rip), %rcx      # 0xae72
pushq $0x30
popq %rdx
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O2/cpirc[P]Monochrome/src/search.cpp
// Function: next_move(SearchStack*, int&)
Move next_move(SearchStack* ss, int& size) {
    assert(ss);

    if (!size) return 0;

    // Find best move index
    int best_index = 0;
    for (int i = 1; i < size; ++i) {
        if (ss->score[i] > ss->score[best_index]) {
            best_index = i;
        }
    }

    // Store the best move to return
    Move best_move = ss->ml[best_index];

    // Reduce ml/score size
    --size;

    // Bring the last move to current index
    ss->ml[best_index] = ss->ml[size];
    ss->score[best_index] = ss->score[size];

    return best_move;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x6015
movslq (%rsi), %rcx
testq %rcx, %rcx
je 0x6011
leaq 0x408(%rdi), %rax
xorl %r8d, %r8d
pushq $0x1
popq %rdx
movslq %r8d, %r9
cmpq %rcx, %rdx
jge 0x5feb
movl (%rax), %r11d
movl %edx, %r10d
cmpl 0x404(%rdi,%r9,4), %r11d
jg 0x5fdf
movl %r8d, %r10d
incq %rdx
addq $0x4, %rax
movl %r10d, %r8d
jmp 0x5fc4
movl 0x4(%rdi,%r9,4), %eax
leal -0x1(%rcx), %edx
movl %edx, (%rsi)
movl (%rdi,%rcx,4), %ecx
movl %ecx, 0x4(%rdi,%r9,4)
movslq (%rsi), %rcx
movl 0x404(%rdi,%rcx,4), %ecx
movl %ecx, 0x404(%rdi,%r9,4)
jmp 0x6013
xorl %eax, %eax
popq %rbp
retq
leaq 0x4e44(%rip), %rdi      # 0xae60
leaq 0x4e40(%rip), %rsi      # 0xae63
leaq 0x4e85(%rip), %rcx      # 0xaeaf
pushq $0x4d
popq %rdx
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O2/cpirc[P]Monochrome/src/search.cpp
// Function: quiesce(SearchController&, Position&, int, int, SearchStack*)
int quiesce(SearchController& sc, Position& pos, int alpha, int beta,
            SearchStack* ss) {
    assert(ss);

    if (ss->ply >= MAX_PLY) {
        return evaluate(pos);
    }

    // Check time left
    clock_t current_time = clock() * 1000 / CLOCKS_PER_SEC;
    if (current_time >= sc.search_end_time) {
        return 0;
    }

    int movecount, value;

    value = evaluate(pos);
    if (value >= beta) return beta;

    if (value > alpha) alpha = value;

    movecount = generate_captures(pos, ss->ml);

    ++ss->stats->node_count;

    score_moves(pos, ss, movecount, 0);

    Move move;
    while ((move = next_move(ss, movecount))) {
        Position npos = pos;

        make_move(npos, move);
        if (is_checked(npos, THEM)) {
            continue;
        }

        value = -quiesce(sc, npos, -beta, -alpha, ss + 1);

        if (value >= beta) {
            return beta;
        }
        if (value > alpha) {
            alpha = value;
        }
    }

    return alpha;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, -0x40(%rbp)
testq %r8, %r8
je 0x618c
movq %r8, %r14
movq %rsi, %r12
cmpb $0x40, (%r8)
jb 0x6078
movq %r12, %rdi
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x27dd
movl %ecx, %ebx
movl %edx, %r15d
callq 0x2120
movl $0x3e8, %ecx            # imm = 0x3E8
cqto
idivq %rcx
movq %rax, %rcx
xorl %eax, %eax
movq -0x40(%rbp), %rdx
cmpq 0x80(%rdx), %rcx
jge 0x617a
movq %r12, %rdi
callq 0x27dd
cmpl %ebx, %eax
jge 0x6178
cmpl %r15d, %eax
cmovgl %eax, %r15d
leaq 0x4(%r14), %rsi
movq %r12, %rdi
callq 0x49ea
leaq -0x34(%rbp), %rcx
movl %eax, (%rcx)
movq 0x810(%r14), %rcx
incq (%rcx)
movq %r12, %rdi
movq %r14, %rsi
movl %eax, %edx
xorl %ecx, %ecx
callq 0x5e74
movl %ebx, -0x2c(%rbp)
negl %ebx
movl %ebx, -0x30(%rbp)
leaq 0x818(%r14), %rax
movq %rax, -0x48(%rbp)
leaq -0xb0(%rbp), %rbx
movq %r14, %rdi
leaq -0x34(%rbp), %rsi
callq 0x5fa6
testl %eax, %eax
je 0x6167
movl %eax, %r13d
movq %rbx, %rdi
movq %r12, %rsi
callq 0x40d2
movq %rbx, %rdi
movl %r13d, %esi
callq 0x3988
movq %rbx, %rdi
pushq $0x1
popq %rsi
callq 0x40fd
testb %al, %al
jne 0x615c
movl %r15d, %ecx
negl %ecx
movq -0x40(%rbp), %rdi
movq %rbx, %rsi
movl -0x30(%rbp), %edx
movq -0x48(%rbp), %r8
callq 0x6032
negl %eax
cmpl -0x2c(%rbp), %eax
jge 0x616c
cmpl %eax, %r15d
cmovlel %eax, %r15d
leaq -0x60(%rbp), %rdi
callq 0x41a8
jmp 0x60fe
movl %r15d, %ebx
jmp 0x6178
leaq -0x60(%rbp), %rdi
callq 0x41a8
movl -0x2c(%rbp), %ebx
movl %ebx, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4ccd(%rip), %rdi      # 0xae60
leaq 0x4cc9(%rip), %rsi      # 0xae63
leaq 0x4d33(%rip), %rcx      # 0xaed4
pushq $0x6a
popq %rdx
callq 0x2110
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x41a8
movq %rbx, %rdi
callq 0x2290
// File: /workspace/github_cpp_makefile_star2_O2/cpirc[P]Monochrome/src/search.cpp
// Function: clear_ss(SearchStack*, int)
void clear_ss(SearchStack* ss, int size) {
    assert(ss);
    assert(size >= 0);

    for (std::uint8_t i = 0; i < size; ++i, ++ss) {
        ss->ply = i;
        ss->killers[0] = ss->killers[1] = 0;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x61f4
testl %esi, %esi
js 0x6213
xorl %eax, %eax
movzbl %al, %ecx
cmpl %esi, %ecx
jae 0x61f2
movb %al, (%rdi)
andq $0x0, 0x804(%rdi)
incb %al
addq $0x818, %rdi            # imm = 0x818
jmp 0x61d6
popq %rbp
retq
leaq 0x4c65(%rip), %rdi      # 0xae60
leaq 0x4c61(%rip), %rsi      # 0xae63
leaq 0x4d10(%rip), %rcx      # 0xaf19
movl $0x133, %edx            # imm = 0x133
callq 0x2110
leaq 0x4d21(%rip), %rdi      # 0xaf3b
leaq 0x4c42(%rip), %rsi      # 0xae63
leaq 0x4cf1(%rip), %rcx      # 0xaf19
movl $0x134, %edx            # imm = 0x134
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O2/cpirc[P]Monochrome/src/search.cpp
// Function: set_stats(SearchStack*, Stats&)
void set_stats(SearchStack* ss, Stats& stats) {
    assert(ss);

    SearchStack* end = ss - ss->ply + MAX_PLY;
    for (; ss < end; ++ss) {
        ss->stats = &stats;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x6268
movzbl (%rdi), %eax
negq %rax
imulq $0x818, %rax, %rax      # imm = 0x818
addq %rdi, %rax
addq $0x20600, %rax          # imm = 0x20600
cmpq %rax, %rdi
jae 0x6266
movq %rsi, 0x810(%rdi)
addq $0x818, %rdi            # imm = 0x818
jmp 0x6251
popq %rbp
retq
leaq 0x4bf1(%rip), %rdi      # 0xae60
leaq 0x4bed(%rip), %rsi      # 0xae63
leaq 0x4cc8(%rip), %rcx      # 0xaf45
movl $0x13e, %edx            # imm = 0x13E
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O2/cpirc[P]Monochrome/src/tt.h
// Function: tt_eval(unsigned long)
inline int tt_eval(const std::uint64_t data) {
    int eval = (data >> TT_EVAL_SHIFT) & TT_EVAL_MASK;
    assert(eval <= INF + MAX_PLY);
    assert(eval >= -INF - MAX_PLY);
    // assert(eval <= INF);
    // assert(eval >= -INF);
    return eval;

    // return (data >> TT_EVAL_SHIFT) & TT_EVAL_MASK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
shrq $0x7, %rdi
cmpl $0x7571, %edi           # imm = 0x7571
jge 0x6fea
cmpl $0xffff8a8f, %edi       # imm = 0xFFFF8A8F
jle 0x7003
movl %edi, %eax
popq %rbp
retq
leaq 0x4139(%rip), %rdi      # 0xb12a
leaq 0x3a7f(%rip), %rsi      # 0xaa77
leaq 0x4141(%rip), %rcx      # 0xb140
pushq $0x6d
jmp 0x701a
leaq 0x4157(%rip), %rdi      # 0xb161
leaq 0x3a66(%rip), %rsi      # 0xaa77
leaq 0x4128(%rip), %rcx      # 0xb140
pushq $0x6e
popq %rdx
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O2/cpirc[P]Monochrome/src/tt.h
// Function: tt_flag(unsigned long)
inline int tt_flag(const std::uint64_t data) {
    int flag = (data >> TT_FLAG_SHIFT) & TT_FLAG_MASK;
    assert(flag == TT_EXACT || flag == TT_LOWER || flag == TT_UPPER);
    return flag;

    // return (data >> TT_FLAG_SHIFT) & TT_FLAG_MASK;
}

// Assembly:
movq %rdi, %rax
shrq $0x27, %rax
andl $0x3, %eax
btq $0x27, %rdi
setae %cl
cmpl $0x1, %eax
sete %dl
orb %cl, %dl
je 0x703d
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x4130(%rip), %rdi      # 0xb178
leaq 0x3a28(%rip), %rsi      # 0xaa77
leaq 0x415b(%rip), %rcx      # 0xb1b1
pushq $0x79
popq %rdx
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O2/cpirc[P]Monochrome/src/tt.cpp
// Function: tt_create(TT*, unsigned int)
bool tt_create(TT* tt, const std::uint32_t megabytes) {
    assert(tt);

    if (megabytes <= 0) {
        return false;
    } else if (megabytes > 512) {
        return false;
    }

    int num_entries = 1024 * 1024 * megabytes / sizeof(TTEntry);

    assert(num_entries * sizeof(TTEntry) <= 1024 * 1024 * megabytes);

    tt->data = (TTEntry*)malloc(num_entries * sizeof(TTEntry));

    if (tt->data) {
        tt->size = num_entries;
        return true;
    }

    tt->size = 0;
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x73ea
leal -0x201(%rsi), %eax
xorl %r14d, %r14d
cmpl $0xfffffe00, %eax       # imm = 0xFFFFFE00
jb 0x73dc
movq %rdi, %rbx
movl %esi, %r15d
shll $0x10, %r15d
shll $0x14, %esi
movq %rsi, %rdi
callq 0x21e0
movq %rax, 0x8(%rbx)
testq %rax, %rax
setne %al
cmovnel %r15d, %r14d
movl %r14d, (%rbx)
movl %eax, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x35e9(%rip), %rdi      # 0xa9da
leaq 0x3e25(%rip), %rsi      # 0xb21d
leaq 0x3e29(%rip), %rcx      # 0xb228
pushq $0x21
popq %rdx
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O2/cpirc[P]Monochrome/src/tt.cpp
// Function: tt_poll(TT*, unsigned long)
TTEntry tt_poll(TT* tt, const std::uint64_t key) {
    assert(tt);
    assert(tt->size);
    assert(tt->data);

    int index = key % tt->size;

    assert(index < tt->size);

    return tt->data[index];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x7440
movslq (%rdi), %r8
testq %r8, %r8
je 0x7459
movq 0x8(%rdi), %rcx
testq %rcx, %rcx
je 0x7472
movq %rsi, %rax
xorl %edx, %edx
divq %r8
cmpl %edx, %r8d
jle 0x748b
movslq %edx, %rdx
shlq $0x4, %rdx
movq (%rcx,%rdx), %rax
movq 0x8(%rcx,%rdx), %rdx
popq %rbp
retq
leaq 0x3593(%rip), %rdi      # 0xa9da
leaq 0x3dcf(%rip), %rsi      # 0xb21d
leaq 0x3dfd(%rip), %rcx      # 0xb252
pushq $0x39
jmp 0x74a2
leaq 0x3e2e(%rip), %rdi      # 0xb28e
leaq 0x3db6(%rip), %rsi      # 0xb21d
leaq 0x3de4(%rip), %rcx      # 0xb252
pushq $0x3a
jmp 0x74a2
leaq 0x3e04(%rip), %rdi      # 0xb27d
leaq 0x3d9d(%rip), %rsi      # 0xb21d
leaq 0x3dcb(%rip), %rcx      # 0xb252
pushq $0x3b
jmp 0x74a2
leaq 0x3df4(%rip), %rdi      # 0xb286
leaq 0x3d84(%rip), %rsi      # 0xb21d
leaq 0x3db2(%rip), %rcx      # 0xb252
pushq $0x3f
popq %rdx
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O2/cpirc[P]Monochrome/src/tt.cpp
// Function: tt_clear(TT*)
bool tt_clear(TT* tt) {
    assert(tt);

    if (!tt->data) {
        return false;
    }

    memset(tt->data, 0, tt->size * sizeof(TTEntry));
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x74da
movq 0x8(%rdi), %rbx
testq %rbx, %rbx
je 0x74cd
movslq (%rdi), %rdx
shlq $0x4, %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x20e0
testq %rbx, %rbx
setne %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x34f9(%rip), %rdi      # 0xa9da
leaq 0x3d35(%rip), %rsi      # 0xb21d
leaq 0x3da8(%rip), %rcx      # 0xb297
pushq $0x45
popq %rdx
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O2/cpirc[P]Monochrome/src/tt.cpp
// Function: tt_free(TT*)
bool tt_free(TT* tt) {
    assert(tt);

    if (!tt->data) {
        return false;
    }

    tt->size = 0;
    free(tt->data);
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x7523
movq 0x8(%rdi), %rbx
testq %rbx, %rbx
je 0x7516
andl $0x0, (%rdi)
movq %rbx, %rdi
callq 0x21c0
testq %rbx, %rbx
setne %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x34b0(%rip), %rdi      # 0xa9da
leaq 0x3cec(%rip), %rsi      # 0xb21d
leaq 0x3d73(%rip), %rcx      # 0xb2ab
pushq $0x50
popq %rdx
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O2/cpirc[P]Monochrome/src/tt.cpp
// Function: tt_add(TT*, unsigned long, int, int, int, int)
bool tt_add(TT* tt, const std::uint64_t hash_key, const int move,
            const int depth, const int flag, const int eval) {
    assert(tt);
    assert(move != 0);
    assert(depth >= 0);
    assert(flag == TT_EXACT || flag == TT_LOWER || flag == TT_UPPER);

    if (!tt->data) {
        return false;
    }

    int index = hash_key % tt->size;

    TTEntry entry;
    entry.data = 0ULL;
    entry.hash_key = hash_key;

    entry.data = ((std::uint64_t)(move & TT_MOVE_MASK) << TT_MOVE_SHIFT) |
                 ((std::uint64_t)(depth & TT_DEPTH_MASK) << TT_DEPTH_SHIFT) |
                 ((std::uint64_t)(flag & TT_FLAG_MASK) << TT_FLAG_SHIFT) |
                 ((std::uint64_t)(eval & TT_EVAL_MASK) << TT_EVAL_SHIFT);

    tt->data[index] = entry;

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x75b0
movl %edx, %r10d
testl %edx, %edx
je 0x75c9
testl %ecx, %ecx
js 0x75e2
cmpl $0x3, %r8d
jae 0x75fb
movq 0x8(%rdi), %r11
testq %r11, %r11
je 0x75a8
movslq (%rdi), %rdi
movq %rsi, %rax
xorl %edx, %edx
divq %rdi
andl $0x3ffff, %r10d         # imm = 0x3FFFF
shlq $0x29, %r10
andl $0x7f, %ecx
orq %r10, %rcx
shlq $0x27, %r8
orq %rcx, %r8
movl %r9d, %eax
shlq $0x7, %rax
orq %r8, %rax
movslq %edx, %rcx
shlq $0x4, %rcx
movq %rax, (%r11,%rcx)
movq %rsi, 0x8(%r11,%rcx)
testq %r11, %r11
setne %al
popq %rbp
retq
leaq 0x3423(%rip), %rdi      # 0xa9da
leaq 0x3c5f(%rip), %rsi      # 0xb21d
leaq 0x3cf9(%rip), %rcx      # 0xb2be
pushq $0x5d
jmp 0x7612
leaq 0x3d41(%rip), %rdi      # 0xb311
leaq 0x3c46(%rip), %rsi      # 0xb21d
leaq 0x3ce0(%rip), %rcx      # 0xb2be
pushq $0x5e
jmp 0x7612
leaq 0x3d32(%rip), %rdi      # 0xb31b
leaq 0x3c2d(%rip), %rsi      # 0xb21d
leaq 0x3cc7(%rip), %rcx      # 0xb2be
pushq $0x5f
jmp 0x7612
leaq 0x3b76(%rip), %rdi      # 0xb178
leaq 0x3c14(%rip), %rsi      # 0xb21d
leaq 0x3cae(%rip), %rcx      # 0xb2be
pushq $0x60
popq %rdx
callq 0x2110
// File: /workspace/github_cpp_makefile_star2_O2/cpirc[P]Monochrome/src/tt.cpp
// Function: tt_add_perft(TT*, unsigned long, int, unsigned long)
bool tt_add_perft(TT* tt, const std::uint64_t hash_key, const int depth,
                  const uint64_t nodes) {
    assert(tt);
    assert(depth != 0);

    if (!tt->data) {
        return false;
    }

    int index = hash_key % tt->size;

    TTEntry entry;
    entry.data = 0ULL;
    entry.hash_key = hash_key;

    entry.data = ((std::uint64_t)(depth & TT_DEPTH_MASK) << TT_DEPTH_SHIFT) |
                 ((std::uint64_t)(nodes & TT_NODES_MASK) << TT_NODES_SHIFT);

    tt->data[index] = entry;

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x765f
movl %edx, %r8d
testl %edx, %edx
je 0x7678
movq 0x8(%rdi), %r9
testq %r9, %r9
je 0x7657
movslq (%rdi), %rdi
movq %rsi, %rax
xorl %edx, %edx
divq %rdi
andl $0x7f, %r8d
shlq $0x7, %rcx
orq %r8, %rcx
movslq %edx, %rax
shlq $0x4, %rax
movq %rcx, (%r9,%rax)
movq %rsi, 0x8(%r9,%rax)
testq %r9, %r9
setne %al
popq %rbp
retq
leaq 0x3374(%rip), %rdi      # 0xa9da
leaq 0x3bb0(%rip), %rsi      # 0xb21d
leaq 0x3cb2(%rip), %rcx      # 0xb326
pushq $0x78
jmp 0x768f
leaq 0x3cef(%rip), %rdi      # 0xb36e
leaq 0x3b97(%rip), %rsi      # 0xb21d
leaq 0x3c99(%rip), %rcx      # 0xb326
pushq $0x79
popq %rdx
callq 0x2110
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/cpirc[P]Monochrome/src/uci.cpp
// Function: UCI::Extension::perft(std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char>>&)
void perft(std::stringstream& ss) {
    int depth = 0;
    ss >> depth;
    if (depth < 1) {
        depth = 1;
    }

    std::uint64_t nodes = 0ULL;
    for (int i = 1; i <= depth; ++i) {
        auto start = std::chrono::high_resolution_clock::now();
        nodes = perft(sc.pos, i);
        auto finish = std::chrono::high_resolution_clock::now();
        std::chrono::duration<double> elapsed = finish - start;

        std::cout << "info"
                  << " depth " << i << " nodes " << nodes << " time "
                  << static_cast<int>(elapsed.count() * 1000) << " nps "
                  << static_cast<int>(nodes / elapsed.count()) << std::endl;
    }

    std::cout << "nodes " << nodes << std::endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq -0x2c(%rbp), %rbx
andl $0x0, (%rbx)
movq %rbx, %rsi
callq 0x20f0
movl (%rbx), %eax
testl %eax, %eax
jg 0x76d9
movl $0x1, -0x2c(%rbp)
pushq $0x1
popq %rax
pushq $0x1
popq %r14
xorl %ebx, %ebx
leaq 0x3cdf(%rip), %r13      # 0xb3c5
leaq 0x3cdf(%rip), %r15      # 0xb3cc
cmpl %eax, %r14d
jg 0x77e5
callq 0x2040
movq %rax, %r12
leaq 0x253f6b(%rip), %rdi    # 0x25b670
movl %r14d, %esi
callq 0x4f48
movq %rax, %rbx
callq 0x2040
subq %r12, %rax
cvtsi2sd %rax, %xmm0
divsd 0x3c5b(%rip), %xmm0     # 0xb380
movsd %xmm0, -0x38(%rbp)
movq 0x788f(%rip), %rdi      # 0xefc0
leaq 0x3c78(%rip), %rsi      # 0xb3b0
callq 0x2190
movq %rax, %rdi
leaq 0x3c6e(%rip), %rsi      # 0xb3b5
callq 0x2190
movq %rax, %rdi
movl %r14d, %esi
callq 0x2260
movq %rax, %rdi
leaq 0x3c5c(%rip), %rsi      # 0xb3bd
callq 0x2190
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2130
movq %rax, %rdi
movq %r13, %rsi
callq 0x2190
movsd -0x38(%rbp), %xmm0
mulsd 0x3bff(%rip), %xmm0     # 0xb388
cvttsd2si %xmm0, %esi
movq %rax, %rdi
callq 0x2260
movq %rax, %rdi
movq %r15, %rsi
callq 0x2190
movq %rbx, %xmm0
punpckldq 0x3be3(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x3beb(%rip), %xmm0     # 0xb3a0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
divsd -0x38(%rbp), %xmm1
cvttsd2si %xmm1, %esi
movq %rax, %rdi
callq 0x2260
movq %rax, %rdi
callq 0x20c0
incl %r14d
movl -0x2c(%rbp), %eax
jmp 0x76ed
movq 0x77d4(%rip), %rdi      # 0xefc0
leaq 0x3bcb(%rip), %rsi      # 0xb3be
callq 0x2190
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2130
movq %rax, %rdi
callq 0x20c0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/cpirc[P]Monochrome/src/uci.cpp
// Function: UCI::setoption(std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char>>&)
void setoption(std::stringstream& ss) {
    std::string word;
    std::string name = "";
    std::string value = "";

    if (ss >> word && word != "name") {
        return;
    }

    // Collect the name
    while (ss >> word && word != "value") {
        if (name != "") {
            name += " ";
        }
        name += word;
    }

    // Collect the value
    while (ss >> word) {
        if (value != "") {
            value += " ";
        }
        value += word;
    }

    // Set the option
    if (name != "" && value != "") {
        // TODO:
        // Set the option if found
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
leaq -0x20(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x2e9d(%rip), %rsi      # 0xa892
leaq -0x70(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x2090
leaq 0x2e89(%rip), %rsi      # 0xa892
leaq -0x50(%rbp), %rdi
leaq -0x9(%rbp), %rdx
callq 0x2090
leaq -0x30(%rbp), %rsi
movq %rbx, %rdi
callq 0x21d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x7a48
leaq 0x39dc(%rip), %rsi      # 0xb413
leaq -0x30(%rbp), %rdi
callq 0x827a
testb %al, %al
jne 0x7b18
leaq -0x30(%rbp), %rsi
movq %rbx, %rdi
callq 0x21d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x7ada
leaq 0x39af(%rip), %rsi      # 0xb418
leaq -0x30(%rbp), %rdi
callq 0x827a
testb %al, %al
je 0x7ada
leaq 0x2e15(%rip), %rsi      # 0xa892
leaq -0x70(%rbp), %rdi
callq 0x827a
testb %al, %al
je 0x7a9a
leaq 0x3172(%rip), %rsi      # 0xac03
leaq -0x70(%rbp), %rdi
callq 0x22b0
leaq -0x70(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x22d0
jmp 0x7a48
leaq 0x2de2(%rip), %rsi      # 0xa892
leaq -0x50(%rbp), %rdi
callq 0x827a
testb %al, %al
je 0x7acd
leaq 0x313f(%rip), %rsi      # 0xac03
leaq -0x50(%rbp), %rdi
callq 0x22b0
leaq -0x50(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x22d0
leaq -0x30(%rbp), %rsi
movq %rbx, %rdi
callq 0x21d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
je 0x7aa9
leaq 0x2d97(%rip), %rsi      # 0xa892
leaq -0x70(%rbp), %rdi
callq 0x827a
testb %al, %al
je 0x7b18
leaq 0x2d83(%rip), %rsi      # 0xa892
leaq -0x50(%rbp), %rdi
callq 0x827a
leaq -0x50(%rbp), %rdi
callq 0x20a0
leaq -0x70(%rbp), %rdi
callq 0x20a0
leaq -0x30(%rbp), %rdi
callq 0x20a0
addq $0x68, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rbx
jmp 0x7b54
movq %rax, %rbx
jmp 0x7b5d
jmp 0x7b48
jmp 0x7b48
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x20a0
leaq -0x70(%rbp), %rdi
callq 0x20a0
leaq -0x30(%rbp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x2290
// File: /workspace/github_cpp_makefile_star2_O2/cpirc[P]Monochrome/src/uci.cpp
// Function: UCI::moves(std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char>>&)
void moves(std::stringstream& ss) {
    std::string word;
    while (ss >> word) {
        Move move;
        if (!lan_to_move(sc.pos, word.c_str(), move)) {
            return;
        }

        char move_str[5];
        move_to_lan(move_str, move);

        if (sc.pos.flipped) {
            move = flip_move(move);
        }

        make_move(sc.pos, move);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
leaq -0x48(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x58(%rbp), %r14
leaq 0x2538d5(%rip), %r15    # 0x25b670
leaq -0x2c(%rbp), %r12
leaq -0x31(%rbp), %r13
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x7dff
movq -0x58(%rbp), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x3cb4
testb %al, %al
je 0x7dff
movl -0x2c(%rbp), %esi
movq %r13, %rdi
callq 0x3baa
movl -0x2c(%rbp), %esi
cmpb $0x1, 0x2538cd(%rip)    # 0x25b6b1
jne 0x7df5
andl $0x3ffff, %esi          # imm = 0x3FFFF
xorl $0xe38, %esi            # imm = 0xE38
movl %esi, -0x2c(%rbp)
movq %r15, %rdi
callq 0x3988
jmp 0x7da3
leaq -0x58(%rbp), %rdi
callq 0x20a0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7e1b
jmp 0x7e1b
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x2290
// File: /workspace/github_cpp_makefile_star2_O2/cpirc[P]Monochrome/src/uci.cpp
// Function: UCI::position(std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char>>&)
void position(std::stringstream& ss) {
    std::string fen = "";

    std::string word;
    while (ss >> word && word != "moves") {
        if (word == "startpos") {
            fen = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1";
        } else if (word != "fen") {
            if (fen != "") {
                fen += " ";
            }
            fen += word;
        }
    }

    if (fen != "") {
        parse_fen_to_position(fen.c_str(), sc.pos);
    }

    moves(ss);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
leaq 0x2a48(%rip), %rsi      # 0xa892
leaq -0x48(%rbp), %r15
leaq -0x68(%rbp), %r12
movq %r15, %rdi
movq %r12, %rdx
callq 0x2090
leaq -0x58(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x35d9(%rip), %r13      # 0xb44d
leaq 0x35d8(%rip), %r14      # 0xb453
movq %rbx, %rdi
movq %r12, %rsi
callq 0x21d0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x7f08
movq %r12, %rdi
movq %r13, %rsi
callq 0x827a
testb %al, %al
je 0x7f08
movq %r12, %rdi
movq %r14, %rsi
callq 0x3977
testb %al, %al
je 0x7ec3
movq %r15, %rdi
leaq 0x3516(%rip), %rsi      # 0xb3d2
callq 0x22c0
jmp 0x7e7b
movq %r12, %rdi
leaq 0x358f(%rip), %rsi      # 0xb45c
callq 0x827a
testb %al, %al
je 0x7e7b
movq %r15, %rdi
leaq 0x29b2(%rip), %rsi      # 0xa892
callq 0x827a
testb %al, %al
je 0x7ef8
movq %r15, %rdi
leaq 0x2d10(%rip), %rsi      # 0xac03
callq 0x22b0
movq %r15, %rdi
movq %r12, %rsi
callq 0x22d0
jmp 0x7e7b
leaq 0x2983(%rip), %rsi      # 0xa892
leaq -0x48(%rbp), %rdi
callq 0x827a
testb %al, %al
je 0x7f2c
movq -0x48(%rbp), %rdi
leaq 0x253749(%rip), %rsi    # 0x25b670
callq 0x5372
movq %rbx, %rdi
callq 0x7d6c
leaq -0x68(%rbp), %rdi
callq 0x20a0
leaq -0x48(%rbp), %rdi
callq 0x20a0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7f57
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x20a0
leaq -0x48(%rbp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x2290
// File: /workspace/github_cpp_makefile_star2_O2/olly-larkin[P]mips-parser/src/main.cpp
// Function: formatName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::string formatName(std::string str) {
	std::size_t dotIndex = str.size();
	std::size_t slashIndex = -1;
	for(int i = str.size()-1; i >= 0; --i) {
		if (str[i] == '.' && dotIndex == str.size())
			dotIndex = i;
		if (str[i] == '/' && slashIndex == -1)
			slashIndex = i;
	}
	return str.substr(slashIndex+1, (dotIndex - slashIndex - 1)) + ".bin";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movq 0x8(%rsi), %rax
movl %eax, %edx
decq %rdx
pushq $-0x1
popq %rdi
movq %rax, %rcx
testl %edx, %edx
js 0x3dce
movl %edx, %r8d
andl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movq (%rsi), %r9
cmpq %rax, %rcx
movq %rcx, %r10
cmoveq %r8, %r10
movb (%r9,%r8), %r9b
cmpb $0x2e, %r9b
cmoveq %r10, %rcx
cmpq $-0x1, %rdi
cmovneq %rdi, %r8
cmpb $0x2f, %r9b
cmoveq %r8, %rdi
decq %rdx
jmp 0x3d92
leaq 0x1(%rdi), %rdx
notq %rdi
addq %rdi, %rcx
leaq -0x30(%rbp), %r14
movq %r14, %rdi
callq 0x21e0
leaq 0x52f5(%rip), %rdx      # 0x90e0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3e83
leaq -0x30(%rbp), %rdi
callq 0x2120
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x2120
movq %rbx, %rdi
callq 0x2330
// File: /workspace/github_cpp_makefile_star2_O2/olly-larkin[P]mips-parser/src/parser.cpp
// Function: vecParser(std::istream&, std::vector<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>, std::allocator<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>>&)
void vecParser(std::istream& inStream, std::vector< std::vector<std::string> >& commVector) {
    std::string inComm;
    unsigned int count = 0x10000000;

    while(1) {
        if (!(inStream >> inComm) || !(addVec(inStream, commVector, count, inComm)))
            break;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x2c(%rbp), %rax
movl $0x10000000, (%rax)     # imm = 0x10000000
leaq -0x50(%rbp), %r12
leaq -0x70(%rbp), %r13
movq %r14, %rdi
movq %r12, %rsi
callq 0x2250
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x4010
movq %r13, %rdi
movq %r12, %rsi
callq 0x2280
movq %r14, %rdi
movq %rbx, %rsi
leaq -0x2c(%rbp), %rdx
movq %r13, %rcx
callq 0x404a
movl %eax, %r15d
movq %r13, %rdi
callq 0x2120
testb %r15b, %r15b
jne 0x3fca
leaq -0x50(%rbp), %rdi
callq 0x2120
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x2120
jmp 0x4039
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x2120
movq %rbx, %rdi
callq 0x2330
// File: /workspace/github_cpp_makefile_star2_O2/olly-larkin[P]mips-parser/src/parser.cpp
// Function: binGen(std::basic_ofstream<char, std::char_traits<char>>&, std::vector<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>, std::allocator<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>>&)
void binGen(std::ofstream& outStream, std::vector< std::vector<std::string> >& commVector) {
    for(int i = 0; i < commVector.size(); ++i) {
        char memBlock[4];
        uint32_t val = commMap[commVector[i][0]].fn(commVector[i], i);
        fillMem(memBlock, val);
        outStream.write(memBlock, 4);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %r12d, %r12d
pushq $0x4
popq %r13
xorl %r15d, %r15d
movq (%rbx), %rcx
movq 0x8(%rbx), %rax
subq %rcx, %rax
cqto
pushq $0x18
popq %rsi
idivq %rsi
cmpq %r15, %rax
jbe 0x473a
movq (%rcx,%r12), %rsi
leaq 0x9adc(%rip), %rdi      # 0xe1e8
callq 0x4ba2
movq (%rbx), %rdi
addq %r12, %rdi
movl %r15d, %esi
callq *0x8(%rax)
bswapl %eax
movl %eax, -0x2c(%rbp)
movq %r14, %rdi
leaq -0x2c(%rbp), %rsi
movq %r13, %rdx
callq 0x2270
incq %r15
addq $0x18, %r12
jmp 0x46ea
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/olly-larkin[P]mips-parser/src/parser.cpp
// Function: labelReturn(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int&)
bool labelReturn(std::string str, int32_t& addr) {
    if (labelMap.find(str) == labelMap.end())
        return false;
    addr = labelMap[str];
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x9aad(%rip), %rdi      # 0xe218
movq %r14, %rsi
callq 0x5ff0
movq %rax, %r15
leaq 0x9aa3(%rip), %r12      # 0xe220
cmpq %r12, %rax
je 0x4795
leaq 0x9a8f(%rip), %rdi      # 0xe218
movq %r14, %rsi
callq 0x493a
movl (%rax), %eax
movl %eax, (%rbx)
cmpq %r12, %r15
setne %al
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq