LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/cpirc[P]Monochrome/src/move_gen.cpp
// Function: generate(Position const&, unsigned int*)
int generate(const Position& pos, Move* ml) {
    int idx = 0;

    add_moves<true>(pos, ml, idx);
    add_moves<false>(pos, ml, idx);

    return idx;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x1c(%rbp), %r15
movl $0x0, (%r15)
movq %r15, %rdx
callq 0x568e
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x5558
movl (%r15), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/cpirc[P]Monochrome/src/move_gen.cpp
// Function: void add_moves<false, (Piece)4>(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
movq 0x30(%rdi), %rax
movq %rdi, -0x30(%rbp)
movq 0x20(%rdi), %rcx
andq %rax, %rcx
je 0x60a4
movq -0x30(%rbp), %rdi
orq 0x38(%rdi), %rax
movq %rax, %r8
notq %r8
leaq 0x629f(%rip), %r10      # 0xc2a0
leaq 0xb9b8(%rip), %r11      # 0x119c0
leaq 0x5f91(%rip), %rbx      # 0xbfa0
leaq 0x5d8a(%rip), %r14      # 0xbda0
leaq 0x4b9a3(%rip), %r15     # 0x519c0
bsfq %rcx, %r12
leal (,%r12,8), %r13d
leaq 0x6470(%rip), %rdi      # 0xc4a0
movq (%rdi,%r13), %r9
andq %rax, %r9
imulq (%r10,%r13), %r9
movq (%rbx,%r13), %rdi
andq %rax, %rdi
imulq (%r14,%r13), %rdi
shrq $0x37, %r9
shrq $0x34, %rdi
movl %r12d, %r13d
shll $0xf, %r13d
addq %r15, %r13
movq (%r13,%rdi,8), %r13
movl %r12d, %edi
shll $0xc, %edi
addq %r11, %rdi
orq (%rdi,%r9,8), %r13
andq %r8, %r13
je 0x6097
movl (%rdx), %r9d
bsfq %r13, %rdi
shll $0x6, %edi
orl %r12d, %edi
movslq %r9d, %r9
movl %edi, (%rsi,%r9,4)
movl (%rdx), %r9d
incl %r9d
movl %r9d, (%rdx)
leaq -0x1(%r13), %rdi
andq %rdi, %r13
jne 0x6074
leaq -0x1(%rcx), %rdi
andq %rdi, %rcx
jne 0x601d
movq -0x30(%rbp), %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x58a4
// File: /workspace/github_cpp_makefile_star2_O3/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
movl %esi, -0x2c(%rbp)
testl %esi, %esi
je 0x6487
movq %rdi, %r14
leaq -0x4a0(%rbp), %rsi
callq 0x5d4e
testl %eax, %eax
jle 0x648e
leaq 0x50(%r14), %r12
decl -0x2c(%rbp)
movl %eax, %ebx
xorl %r13d, %r13d
leaq -0xa0(%rbp), %r15
movq $0x0, -0x38(%rbp)
movl $0xa, %ecx
movq %r15, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq -0x50(%rbp), %rdi
movq %r12, %rsi
callq 0x5300
movl -0x4a0(%rbp,%r13,4), %esi
movq %r15, %rdi
callq 0x47a0
movq -0x78(%rbp), %rax
movq -0x68(%rbp), %rdx
movq %rdx, %rcx
andq %rax, %rcx
je 0x64ac
bsfq %rcx, %rdi
movq -0x70(%rbp), %rcx
orq %rcx, %rdx
leal (,%rdi,8), %esi
movq -0xa0(%rbp), %r9
movq -0x98(%rbp), %r8
leaq 0xae0a(%rip), %r10      # 0x111c0
andq 0x200(%r10,%rsi), %r9
leaq 0xb1fb(%rip), %r10      # 0x115c0
andq (%r10,%rsi), %r8
leaq 0x60d0(%rip), %r10      # 0xc4a0
movq (%r10,%rsi), %r10
andq %rdx, %r10
leaq 0x5ec2(%rip), %r11      # 0xc2a0
imulq (%r11,%rsi), %r10
orq %r9, %r8
shrq $0x37, %r10
movl %edi, %r9d
shll $0xc, %r9d
addq 0xabb8(%rip), %r9       # 0x10fb0
movq (%r9,%r10,8), %r9
movq -0x90(%rbp), %r10
andq %r9, %r10
leaq 0x5b93(%rip), %r11      # 0xbfa0
andq (%r11,%rsi), %rdx
leaq 0x5988(%rip), %r11      # 0xbda0
imulq (%r11,%rsi), %rdx
orq %r8, %r10
shrq $0x34, %rdx
shll $0xf, %edi
addq 0xab6a(%rip), %rdi      # 0x10f98
movq (%rdi,%rdx,8), %rdx
movq -0x88(%rbp), %rdi
andq %rdx, %rdi
orq %r10, %rdi
orq %r9, %rdx
leaq 0xb377(%rip), %r8       # 0x117c0
andq (%r8,%rsi), %rax
orq %rdi, %rax
andq -0x80(%rbp), %rdx
orq %rdx, %rax
testq %rcx, %rax
jne 0x646b
movq %r15, %rdi
movl -0x2c(%rbp), %esi
callq 0x6300
addq %rax, -0x38(%rbp)
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x6479
callq 0x31a0
incq %r13
cmpq %r13, %rbx
jne 0x6351
jmp 0x6496
movl $0x1, %eax
jmp 0x649a
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
addq $0x478, %rsp            # imm = 0x478
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x579d(%rip), %rdi      # 0xbc50
leaq 0x5799(%rip), %rsi      # 0xbc53
leaq 0x57a1(%rip), %rcx      # 0xbc62
movl $0x3e, %edx
callq 0x3100
movq %rax, %rbx
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x64dc
callq 0x31a0
movq %rbx, %rdi
callq 0x32d0
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
subq $0x68, %rsp
xorps %xmm0, %xmm0
leaq -0x80(%rbp), %rsi
movups %xmm0, 0x50(%rsi)
movq $0x0, 0x60(%rsi)
leaq 0x62f6(%rip), %rdi      # 0xca8f
callq 0x6afa
movl $0x1, %ebx
leaq -0x80(%rbp), %r14
leaq 0x6322(%rip), %r15      # 0xcad0
movq %r14, %rdi
movl %ebx, %esi
callq 0x6300
movq %r15, %rdi
movl %ebx, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x3040
incl %ebx
cmpl $0x7, %ebx
jne 0x67ae
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x67dc
callq 0x31a0
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x67e9
movq %rax, %rbx
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x67fa
callq 0x31a0
movq %rbx, %rdi
callq 0x32d0
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %r15d, %r15d
leaq 0x24b1b4(%rip), %rbx    # 0x2519d0
leaq 0x24d205(%rip), %r14    # 0x253a28
leaq 0x24d136(%rip), %r12    # 0x253960
movb 0x24d208(%rip), %al     # 0x253a38
testb %al, %al
je 0x6856
movq %r14, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x7492
testq %rax, %rax
je 0x6834
movq %rax, (%r12,%r15,8)
incq %r15
cmpq $0x10, %r15
jne 0x682a
jmp 0x685d
callq 0x3358
jmp 0x6834
xorl %r15d, %r15d
leaq 0x24b169(%rip), %rbx    # 0x2519d0
leaq 0x24d1ba(%rip), %r14    # 0x253a28
movq %r15, %r13
shlq $0x9, %r13
leaq 0x24c4e4(%rip), %rax    # 0x252d60
addq %rax, %r13
xorl %r12d, %r12d
movb 0x24d1b0(%rip), %al     # 0x253a38
testb %al, %al
je 0x68af
movq %r14, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x7492
testq %rax, %rax
je 0x688c
movq %rax, (%r13,%r12,8)
incq %r12
cmpq $0x40, %r12
jne 0x6882
jmp 0x68b6
callq 0x338b
jmp 0x688c
incq %r15
cmpq $0x6, %r15
jne 0x686e
xorl %r15d, %r15d
leaq 0x24b107(%rip), %rbx    # 0x2519d0
leaq 0x24d158(%rip), %r14    # 0x253a28
leaq 0x24d109(%rip), %r12    # 0x2539e0
movb 0x24d15b(%rip), %al     # 0x253a38
testb %al, %al
je 0x6903
movq %r14, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x7492
testq %rax, %rax
je 0x68e1
movq %rax, (%r12,%r15,8)
incq %r15
cmpq $0x8, %r15
jne 0x68d7
jmp 0x690a
callq 0x33be
jmp 0x68e1
movb 0x24d128(%rip), %al     # 0x253a38
testb %al, %al
je 0x694b
leaq 0x24b0b5(%rip), %rbx    # 0x2519d0
leaq 0x24d106(%rip), %r14    # 0x253a28
movq %r14, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x7492
testq %rax, %rax
je 0x6922
movq %rax, 0x24d0e4(%rip)    # 0x253a20
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x33f1
jmp 0x6914
// File: /workspace/github_cpp_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
movq $0x0, 0x48(%rdi)
movq 0x30(%rdi), %rdx
testq %rdx, %rdx
je 0x6a09
movq (%rdi), %rsi
movq 0x8(%rdi), %r8
movq 0x10(%rdi), %r9
movq 0x18(%rdi), %r10
movq 0x20(%rdi), %r11
movq 0x28(%rdi), %rbx
xorl %eax, %eax
movl $0x4, %r14d
leaq 0x24c3c6(%rip), %r15    # 0x252d60
bsfq %rdx, %rcx
movl $0x1, %r12d
shlq %cl, %r12
btq %rcx, %rsi
jae 0x69b2
xorl %r13d, %r13d
jmp 0x69ee
movl $0x1, %r13d
testq %r12, %r8
jne 0x69ee
movl $0x2, %r13d
testq %r12, %r9
jne 0x69ee
movl $0x3, %r13d
testq %r12, %r10
jne 0x69ee
movq %rbx, %r13
andq %r12, %r13
cmpq $0x1, %r13
movl $0x0, %r13d
adcq $0x5, %r13
testq %r12, %r11
cmovneq %r14, %r13
shlq $0x9, %r13
addq %r15, %r13
xorq (%r13,%rcx,8), %rax
movq %rax, 0x48(%rdi)
leaq -0x1(%rdx), %rcx
andq %rcx, %rdx
jne 0x699a
jmp 0x6a0b
xorl %eax, %eax
movq 0x38(%rdi), %rdx
testq %rdx, %rdx
je 0x6aaf
movq (%rdi), %rsi
movq 0x8(%rdi), %r8
movq 0x10(%rdi), %r9
movq 0x18(%rdi), %r10
movq 0x20(%rdi), %r11
movq 0x28(%rdi), %rbx
movl $0x4, %r14d
leaq 0x24c324(%rip), %r15    # 0x252d60
bsfq %rdx, %rcx
movl $0x1, %r12d
shlq %cl, %r12
btq %rcx, %rsi
jae 0x6a54
xorl %r13d, %r13d
jmp 0x6a90
movl $0x1, %r13d
testq %r12, %r8
jne 0x6a90
movl $0x2, %r13d
testq %r12, %r9
jne 0x6a90
movl $0x3, %r13d
testq %r12, %r10
jne 0x6a90
movq %rbx, %r13
andq %r12, %r13
cmpq $0x1, %r13
movl $0x0, %r13d
adcq $0x5, %r13
testq %r12, %r11
cmovneq %r14, %r13
shlq $0x9, %r13
addq %r15, %r13
movq (%r13,%rcx,8), %rcx
bswapq %rcx
xorq %rcx, %rax
movq %rax, 0x48(%rdi)
leaq -0x1(%rdx), %rcx
andq %rcx, %rdx
jne 0x6a3c
movzbl 0x40(%rdi), %ecx
leaq 0x24cea6(%rip), %rdx    # 0x253960
xorq (%rdx,%rcx,8), %rax
movq %rax, 0x48(%rdi)
movzbl 0x42(%rdi), %ecx
cmpq $0x40, %rcx
je 0x6ade
andl $0x7, %ecx
leaq 0x24cf0a(%rip), %rdx    # 0x2539e0
xorq (%rdx,%rcx,8), %rax
movq %rax, 0x48(%rdi)
cmpb $0x1, 0x41(%rdi)
jne 0x6aef
xorq 0x24cf35(%rip), %rax    # 0x253a20
movq %rax, 0x48(%rdi)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
subq $0x68, %rsp
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%rbp)
movq $0x0, -0x10(%rbp)
callq 0x6804
leaq 0x5beb(%rip), %rdi      # 0xcc9a
leaq -0x70(%rbp), %rsi
callq 0x6afa
leaq -0x70(%rbp), %rbx
movq %rbx, %rdi
callq 0x6ecd
leaq 0x5c0f(%rip), %rdi      # 0xccda
movq %rbx, %rsi
callq 0x6afa
movq %rbx, %rdi
callq 0x6ecd
leaq 0x5c3c(%rip), %rdi      # 0xcd1e
movq %rbx, %rsi
callq 0x6afa
movq %rbx, %rdi
callq 0x6ecd
leaq 0x5c6a(%rip), %rdi      # 0xcd63
movq %rbx, %rsi
callq 0x6afa
movq %rbx, %rdi
callq 0x6ecd
movq 0x50(%rbx), %rdi
testq %rdi, %rdi
je 0x7117
callq 0x31a0
addq $0x68, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rbx
movq -0x20(%rbp), %rdi
testq %rdi, %rdi
je 0x712f
callq 0x31a0
movq %rbx, %rdi
callq 0x32d0
// File: /workspace/github_cpp_makefile_star2_O3/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 0x78bf
testl %edx, %edx
jle 0x78b0
movl %ecx, %ebx
movq %rsi, %r14
leaq 0x3836(%rip), %rax      # 0xb010
movl (%rax), %eax
addl $0x32, %eax
movzbl %al, %eax
movl %eax, -0x2c(%rbp)
movl %edx, %r13d
xorl %r15d, %r15d
movl 0x4(%r14,%r15,4), %r12d
cmpl %ebx, %r12d
jne 0x7803
movl $0x4e20, 0x404(%r14,%r15,4) # imm = 0x4E20
jmp 0x7866
movl %r12d, %eax
andl $0x7000, %eax           # imm = 0x7000
cmpl $0x6000, %eax           # imm = 0x6000
je 0x7838
cmpl $0x3000, %eax           # imm = 0x3000
je 0x7833
cmpl $0x2000, %eax           # imm = 0x2000
jne 0x7874
movq -0x38(%rbp), %rdi
movl %r12d, %esi
callq 0x76e8
addl $0x2328, %eax           # imm = 0x2328
jmp 0x785e
movl -0x2c(%rbp), %eax
jmp 0x785e
movq -0x38(%rbp), %rdi
movl %r12d, %esi
callq 0x76e8
shrl $0xd, %r12d
andl $0x1c, %r12d
leaq 0x37bd(%rip), %rcx      # 0xb010
movl (%rcx,%r12), %ecx
addl %ecx, %eax
addl $0x2328, %eax           # imm = 0x2328
movl %eax, 0x404(%r14,%r15,4)
incq %r15
cmpq %r15, %r13
jne 0x77eb
jmp 0x78b0
cmpl %r12d, 0x804(%r14)
jne 0x788b
movl $0x1b58, 0x404(%r14,%r15,4) # imm = 0x1B58
jmp 0x7866
cmpl %r12d, 0x808(%r14)
jne 0x78a2
movl $0x1770, 0x404(%r14,%r15,4) # imm = 0x1770
jmp 0x7866
movl $0x0, 0x404(%r14,%r15,4)
jmp 0x7866
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x55fa(%rip), %rdi      # 0xcec0
leaq 0x55f6(%rip), %rsi      # 0xcec3
leaq 0x55fe(%rip), %rcx      # 0xced2
movl $0x30, %edx
callq 0x3100
// File: /workspace/github_cpp_makefile_star2_O3/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:
testq %rdi, %rdi
je 0x794a
movl (%rsi), %eax
testq %rax, %rax
je 0x7947
movslq %eax, %rcx
xorl %edx, %edx
cmpl $0x2, %eax
jl 0x7923
decq %rax
xorl %r8d, %r8d
movl 0x408(%rdi,%r8,4), %r10d
movslq %edx, %r11
incq %r8
movl %r8d, %r9d
cmpl 0x404(%rdi,%r11,4), %r10d
jg 0x7918
movl %edx, %r9d
movl %r9d, %edx
cmpq %r8, %rax
jne 0x78fa
movslq %r9d, %rdx
movl 0x4(%rdi,%rdx,4), %eax
leaq -0x1(%rcx), %r8
movl %r8d, (%rsi)
movl (%rdi,%rcx,4), %ecx
movl %ecx, 0x4(%rdi,%rdx,4)
movslq (%rsi), %rcx
movl 0x404(%rdi,%rcx,4), %ecx
movl %ecx, 0x404(%rdi,%rdx,4)
retq
xorl %eax, %eax
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x556b(%rip), %rdi      # 0xcec0
leaq 0x5567(%rip), %rsi      # 0xcec3
leaq 0x55ac(%rip), %rcx      # 0xcf0f
movl $0x4d, %edx
callq 0x3100
// File: /workspace/github_cpp_makefile_star2_O3/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 0x7c87
testl %esi, %esi
js 0x7ca6
je 0x7c85
xorl %eax, %eax
movb %al, (%rdi)
movq $0x0, 0x804(%rdi)
incb %al
addq $0x818, %rdi            # imm = 0x818
movzbl %al, %ecx
cmpl %esi, %ecx
jb 0x7c68
popq %rbp
retq
leaq 0x5232(%rip), %rdi      # 0xcec0
leaq 0x522e(%rip), %rsi      # 0xcec3
leaq 0x52dd(%rip), %rcx      # 0xcf79
movl $0x133, %edx            # imm = 0x133
callq 0x3100
leaq 0x52ee(%rip), %rdi      # 0xcf9b
leaq 0x520f(%rip), %rsi      # 0xcec3
leaq 0x52be(%rip), %rcx      # 0xcf79
movl $0x134, %edx            # imm = 0x134
callq 0x3100
// File: /workspace/github_cpp_makefile_star2_O3/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 0x7cfe
movzbl (%rdi), %eax
negq %rax
imulq $0x818, %rax, %rax      # imm = 0x818
addq %rdi, %rax
addq $0x20600, %rax          # imm = 0x20600
cmpq %rdi, %rax
jbe 0x7cfc
movq %rsi, 0x810(%rdi)
addq $0x818, %rdi            # imm = 0x818
cmpq %rax, %rdi
jb 0x7ce9
popq %rbp
retq
leaq 0x51bb(%rip), %rdi      # 0xcec0
leaq 0x51b7(%rip), %rsi      # 0xcec3
leaq 0x5292(%rip), %rcx      # 0xcfa5
movl $0x13e, %edx            # imm = 0x13E
callq 0x3100
// File: /workspace/github_cpp_makefile_star2_O3/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 0x90df
cmpl $0xffff8a8f, %edi       # imm = 0xFFFF8A8F
jle 0x90fe
movl %edi, %eax
popq %rbp
retq
leaq 0x40a4(%rip), %rdi      # 0xd18a
leaq 0x39f4(%rip), %rsi      # 0xcae1
leaq 0x40ac(%rip), %rcx      # 0xd1a0
movl $0x6d, %edx
callq 0x3100
leaq 0x40bc(%rip), %rdi      # 0xd1c1
leaq 0x39d5(%rip), %rsi      # 0xcae1
leaq 0x408d(%rip), %rcx      # 0xd1a0
movl $0x6e, %edx
callq 0x3100
// File: /workspace/github_cpp_makefile_star2_O3/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 0x913a
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x4093(%rip), %rdi      # 0xd1d8
leaq 0x3995(%rip), %rsi      # 0xcae1
leaq 0x40be(%rip), %rcx      # 0xd211
movl $0x79, %edx
callq 0x3100
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x94ba
leal -0x201(%rsi), %eax
xorl %r14d, %r14d
cmpl $0xfffffe00, %eax       # imm = 0xFFFFFE00
jb 0x94ac
movq %rdi, %rbx
movl %esi, %r15d
shll $0x10, %r15d
shll $0x14, %esi
movq %rsi, %rdi
callq 0x3210
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 0x3583(%rip), %rdi      # 0xca44
leaq 0x3db5(%rip), %rsi      # 0xd27d
leaq 0x3db9(%rip), %rcx      # 0xd288
movl $0x21, %edx
callq 0x3100
// File: /workspace/github_cpp_makefile_star2_O3/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 0x9512
movslq (%rdi), %r8
testq %r8, %r8
je 0x9531
movq 0x8(%rdi), %rcx
testq %rcx, %rcx
je 0x9550
movq %rsi, %rax
xorl %edx, %edx
divq %r8
cmpl %edx, %r8d
jle 0x956f
movslq %edx, %rdx
shlq $0x4, %rdx
movq (%rcx,%rdx), %rax
movq 0x8(%rcx,%rdx), %rdx
popq %rbp
retq
leaq 0x352b(%rip), %rdi      # 0xca44
leaq 0x3d5d(%rip), %rsi      # 0xd27d
leaq 0x3d8b(%rip), %rcx      # 0xd2b2
movl $0x39, %edx
callq 0x3100
leaq 0x3db6(%rip), %rdi      # 0xd2ee
leaq 0x3d3e(%rip), %rsi      # 0xd27d
leaq 0x3d6c(%rip), %rcx      # 0xd2b2
movl $0x3a, %edx
callq 0x3100
leaq 0x3d86(%rip), %rdi      # 0xd2dd
leaq 0x3d1f(%rip), %rsi      # 0xd27d
leaq 0x3d4d(%rip), %rcx      # 0xd2b2
movl $0x3b, %edx
callq 0x3100
leaq 0x3d70(%rip), %rdi      # 0xd2e6
leaq 0x3d00(%rip), %rsi      # 0xd27d
leaq 0x3d2e(%rip), %rcx      # 0xd2b2
movl $0x3f, %edx
callq 0x3100
// File: /workspace/github_cpp_makefile_star2_O3/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 0x95c0
movq 0x8(%rdi), %rbx
testq %rbx, %rbx
je 0x95b3
movslq (%rdi), %rdx
shlq $0x4, %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x30d0
testq %rbx, %rbx
setne %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x347d(%rip), %rdi      # 0xca44
leaq 0x3caf(%rip), %rsi      # 0xd27d
leaq 0x3d22(%rip), %rcx      # 0xd2f7
movl $0x45, %edx
callq 0x3100
// File: /workspace/github_cpp_makefile_star2_O3/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 0x960e
movq 0x8(%rdi), %rbx
testq %rbx, %rbx
je 0x9601
movl $0x0, (%rdi)
movq %rbx, %rdi
callq 0x31f0
testq %rbx, %rbx
setne %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x342f(%rip), %rdi      # 0xca44
leaq 0x3c61(%rip), %rsi      # 0xd27d
leaq 0x3ce8(%rip), %rcx      # 0xd30b
movl $0x50, %edx
callq 0x3100
// File: /workspace/github_cpp_makefile_star2_O3/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 0x969d
movl %edx, %r10d
testl %edx, %edx
je 0x96bc
testl %ecx, %ecx
js 0x96db
cmpl $0x3, %r8d
jae 0x96fa
movq 0x8(%rdi), %r11
testq %r11, %r11
je 0x9695
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 0x33a0(%rip), %rdi      # 0xca44
leaq 0x3bd2(%rip), %rsi      # 0xd27d
leaq 0x3c6c(%rip), %rcx      # 0xd31e
movl $0x5d, %edx
callq 0x3100
leaq 0x3cae(%rip), %rdi      # 0xd371
leaq 0x3bb3(%rip), %rsi      # 0xd27d
leaq 0x3c4d(%rip), %rcx      # 0xd31e
movl $0x5e, %edx
callq 0x3100
leaq 0x3c99(%rip), %rdi      # 0xd37b
leaq 0x3b94(%rip), %rsi      # 0xd27d
leaq 0x3c2e(%rip), %rcx      # 0xd31e
movl $0x5f, %edx
callq 0x3100
leaq 0x3ad7(%rip), %rdi      # 0xd1d8
leaq 0x3b75(%rip), %rsi      # 0xd27d
leaq 0x3c0f(%rip), %rcx      # 0xd31e
movl $0x60, %edx
callq 0x3100
// File: /workspace/github_cpp_makefile_star2_O3/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 0x9760
movl %edx, %r8d
testl %edx, %edx
je 0x977f
movq 0x8(%rdi), %r9
testq %r9, %r9
je 0x9758
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 0x32dd(%rip), %rdi      # 0xca44
leaq 0x3b0f(%rip), %rsi      # 0xd27d
leaq 0x3c11(%rip), %rcx      # 0xd386
movl $0x78, %edx
callq 0x3100
leaq 0x3c48(%rip), %rdi      # 0xd3ce
leaq 0x3af0(%rip), %rsi      # 0xd27d
leaq 0x3bf2(%rip), %rcx      # 0xd386
movl $0x79, %edx
callq 0x3100
nop
// File: /workspace/github_cpp_makefile_star2_O3/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
movl $0x0, (%rbx)
movq %rbx, %rsi
callq 0x30e0
cmpl $0x0, (%rbx)
jg 0x97e0
movl $0x1, -0x2c(%rbp)
xorl %ebx, %ebx
movq 0x77df(%rip), %r15      # 0x10fc8
leaq 0x3c3c(%rip), %r13      # 0xd42c
incl %ebx
callq 0x3050
movq %rax, %r12
leaq 0x24a247(%rip), %rdi    # 0x253a48
movl %ebx, %esi
callq 0x6300
movq %rax, %r14
callq 0x3050
subq %r12, %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
divsd 0x3bbd(%rip), %xmm0     # 0xd3e0
movsd %xmm0, -0x38(%rbp)
movl $0x4, %edx
movq %r15, %rdi
leaq 0x3bd9(%rip), %rsi      # 0xd410
callq 0x31e0
movl $0x7, %edx
movq %r15, %rdi
leaq 0x3bca(%rip), %rsi      # 0xd415
callq 0x31e0
movq %r15, %rdi
movl %ebx, %esi
callq 0x32a0
movq %rax, %r12
movl $0x7, %edx
movq %rax, %rdi
leaq 0x3bb1(%rip), %rsi      # 0xd41d
callq 0x31e0
movq %r12, %rdi
movq %r14, %rsi
callq 0x3120
movq %rax, %r12
movl $0x6, %edx
movq %rax, %rdi
leaq 0x3b97(%rip), %rsi      # 0xd425
callq 0x31e0
movsd -0x38(%rbp), %xmm0
mulsd 0x3b48(%rip), %xmm0     # 0xd3e8
cvttsd2si %xmm0, %esi
movq %r12, %rdi
callq 0x32a0
movq %rax, %r12
movl $0x5, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x31e0
movq %r14, %xmm0
punpckldq 0x3b24(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x3b2c(%rip), %xmm0     # 0xd400
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
divsd -0x38(%rbp), %xmm1
cvttsd2si %xmm1, %esi
movq %r12, %rdi
callq 0x32a0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x31b0
movsbl %al, %esi
movq %r12, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
cmpl -0x2c(%rbp), %ebx
jl 0x97f0
movq 0x769d(%rip), %rbx      # 0x10fc8
leaq 0x3aec(%rip), %rsi      # 0xd41e
movl $0x6, %edx
movq %rbx, %rdi
callq 0x31e0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3120
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x31b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %rdi, %rbx
leaq -0x30(%rbp), %r14
movq %r14, -0x10(%r14)
movq $0x0, -0x8(%r14)
movb $0x0, (%r14)
leaq -0x70(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x2ccf(%rip), %rdx      # 0xc8d2
leaq -0x80(%rbp), %rdi
movq %rdx, %rsi
callq 0x539e
leaq -0x50(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x2cb3(%rip), %rdx      # 0xc8d2
leaq -0x60(%rbp), %rdi
movq %rdx, %rsi
callq 0x539e
leaq -0x40(%rbp), %rsi
movq %rbx, %rdi
callq 0x3200
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
je 0x9d27
leaq -0x40(%rbp), %rsi
movq %rbx, %rdi
callq 0x3200
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x9ce7
leaq 0x380a(%rip), %rsi      # 0xd478
leaq -0x40(%rbp), %rdi
callq 0x3070
testl %eax, %eax
je 0x9ce7
leaq 0x2c50(%rip), %rsi      # 0xc8d2
leaq -0x80(%rbp), %rdi
callq 0x3070
testl %eax, %eax
je 0x9c9f
leaq 0x2fcd(%rip), %rsi      # 0xcc63
leaq -0x80(%rbp), %rdi
callq 0x3310
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdx
leaq -0x80(%rbp), %rdi
callq 0x3080
jmp 0x9c49
leaq 0x2c19(%rip), %rsi      # 0xc8d2
leaq -0x60(%rbp), %rdi
callq 0x3070
testl %eax, %eax
je 0x9cd6
leaq 0x2f96(%rip), %rsi      # 0xcc63
leaq -0x60(%rbp), %rdi
callq 0x3310
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdx
leaq -0x60(%rbp), %rdi
callq 0x3080
leaq -0x40(%rbp), %rsi
movq %rbx, %rdi
callq 0x3200
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
je 0x9cb2
leaq 0x2bca(%rip), %rsi      # 0xc8d2
leaq -0x80(%rbp), %rdi
callq 0x3070
testl %eax, %eax
je 0x9d3f
leaq 0x2bb6(%rip), %rsi      # 0xc8d2
leaq -0x60(%rbp), %rdi
callq 0x3070
jmp 0x9d3f
leaq 0x3745(%rip), %rsi      # 0xd473
leaq -0x40(%rbp), %rdi
callq 0x3070
testl %eax, %eax
je 0x9c49
movq -0x60(%rbp), %rdi
cmpq %r12, %rdi
je 0x9d4d
callq 0x31a0
movq -0x80(%rbp), %rdi
cmpq %r15, %rdi
je 0x9d5b
callq 0x31a0
movq -0x40(%rbp), %rdi
cmpq %r14, %rdi
je 0x9d69
callq 0x31a0
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9d84
movq %rax, %rbx
jmp 0x9d95
movq %rax, %rbx
jmp 0x9da3
jmp 0x9d84
movq %rax, %rbx
movq -0x60(%rbp), %rdi
cmpq %r12, %rdi
je 0x9d95
callq 0x31a0
movq -0x80(%rbp), %rdi
cmpq %r15, %rdi
je 0x9da3
callq 0x31a0
movq -0x40(%rbp), %rdi
cmpq %r14, %rdi
je 0x9db1
callq 0x31a0
movq %rbx, %rdi
callq 0x32d0
// File: /workspace/github_cpp_makefile_star2_O3/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 -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x50(%rbp), %r14
leaq 0x249a47(%rip), %r15    # 0x253a48
leaq -0x2c(%rbp), %r12
leaq -0x55(%rbp), %r13
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3200
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xa065
movq -0x50(%rbp), %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x4cd6
testb %al, %al
je 0xa065
movl -0x2c(%rbp), %esi
movq %r13, %rdi
callq 0x4bc6
movl -0x2c(%rbp), %esi
cmpb $0x1, 0x249a3f(%rip)    # 0x253a89
jne 0xa05b
andl $0x3ffff, %esi          # imm = 0x3FFFF
xorl $0xe38, %esi            # imm = 0xE38
movl %esi, -0x2c(%rbp)
movq %r15, %rdi
callq 0x47a0
jmp 0xa009
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xa077
callq 0x31a0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa08a
jmp 0xa08a
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0xa09f
callq 0x31a0
movq %rbx, %rdi
callq 0x32d0
// File: /workspace/github_cpp_makefile_star2_O3/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 -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x2808(%rip), %rdx      # 0xc8d2
leaq -0x48(%rbp), %r15
movq %r15, %rdi
movq %rdx, %rsi
callq 0x539e
leaq -0x58(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x68(%rbp), %r12
leaq 0x33b6(%rip), %r13      # 0xd4ad
leaq 0x33b5(%rip), %r14      # 0xd4b3
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3200
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xa1a3
movq %r12, %rdi
movq %r13, %rsi
callq 0x3070
testl %eax, %eax
je 0xa1a3
movq %r12, %rdi
movq %r14, %rsi
callq 0x3070
testl %eax, %eax
je 0xa183
movq %r12, %rdi
leaq 0x3379(%rip), %rsi      # 0xd4bc
callq 0x3070
testl %eax, %eax
je 0xa0fe
movq %r15, %rdi
leaq 0x277c(%rip), %rsi      # 0xc8d2
callq 0x3070
testl %eax, %eax
je 0xa16e
movq %r15, %rdi
leaq 0x2afa(%rip), %rsi      # 0xcc63
callq 0x3310
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq %r15, %rdi
callq 0x3080
jmp 0xa0fe
movq -0x40(%rbp), %rdx
movl $0x38, %r8d
movq %r15, %rdi
xorl %esi, %esi
leaq 0x3299(%rip), %rcx      # 0xd432
callq 0x3270
jmp 0xa0fe
leaq 0x2728(%rip), %rsi      # 0xc8d2
leaq -0x48(%rbp), %rdi
callq 0x3070
testl %eax, %eax
je 0xa1c7
movq -0x48(%rbp), %rdi
leaq 0x249886(%rip), %rsi    # 0x253a48
callq 0x6afa
movq %rbx, %rdi
callq 0x9fcf
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xa1e1
callq 0x31a0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xa1f3
callq 0x31a0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa204
movq %rax, %rbx
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xa219
callq 0x31a0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0xa22b
callq 0x31a0
movq %rbx, %rdi
callq 0x32d0
// File: /workspace/github_cpp_makefile_star2_O3/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, %ecx
decl %ecx
js 0x3f1a
movq (%rsi), %rdx
movl %ecx, %r8d
movq $-0x1, %r9
movq %rax, %r10
movq %rax, %rdi
movq %r9, %rcx
cmpq %rax, %r10
cmoveq %r8, %rdi
movb (%rdx,%r8), %r11b
cmpb $0x2e, %r11b
cmovneq %r10, %rdi
cmpq $-0x1, %r9
cmoveq %r8, %rcx
cmpb $0x2f, %r11b
cmovneq %r9, %rcx
movq %rdi, %r10
movq %rcx, %r9
addq $-0x1, %r8
jb 0x3ee9
jmp 0x3f24
movq $-0x1, %rcx
movq %rax, %rdi
leaq 0x1(%rcx), %rdx
notq %rcx
addq %rdi, %rcx
leaq -0x30(%rbp), %r14
movq %r14, %rdi
callq 0x2220
leaq 0x719f(%rip), %rsi      # 0xb0e0
movq %r14, %rdi
callq 0x23b0
leaq 0x10(%rbx), %rdx
movq %rdx, (%rbx)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0x3f6b
movq %rsi, (%rbx)
movq (%rcx), %rdx
movq %rdx, 0x10(%rbx)
jmp 0x3f71
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x20(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3f9a
callq 0x21f0
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x20(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3fbb
callq 0x21f0
movq %rbx, %rdi
callq 0x2370
// File: /workspace/github_cpp_makefile_star2_O3/olly-larkin[P]mips-parser/src/parser.cpp
// Function: validIntStr(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int&)
bool validIntStr(std::string arg, int32_t& returnVal){
    std::size_t pos;
    returnVal = std::stoi(arg, &pos,0);
    if(pos != arg.length()){
        return false;
    }
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movq %rdi, %r14
movq (%rdi), %r12
callq 0x2050
movq %rax, %rbx
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
movl $0x0, (%rbx)
leaq -0x38(%rbp), %r13
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x22c0
movq (%r13), %rcx
subq %r12, %rcx
je 0x41e0
movslq %eax, %rdx
cmpq %rax, %rdx
jne 0x41ec
movl (%rbx), %edx
cmpl $0x22, %edx
je 0x41ec
testl %edx, %edx
jne 0x41c7
movl -0x2c(%rbp), %edx
movl %edx, (%rbx)
movl %eax, (%r15)
cmpq 0x8(%r14), %rcx
sete %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x702d(%rip), %rdi      # 0xb214
callq 0x2150
leaq 0x7021(%rip), %rdi      # 0xb214
callq 0x22e0
cmpl $0x0, (%rbx)
jne 0x4202
movl -0x2c(%rbp), %ecx
movl %ecx, (%rbx)
movq %rax, %rdi
callq 0x2370
// File: /workspace/github_cpp_makefile_star2_O3/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)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x2c(%rbp), %rax
movl $0x10000000, (%rax)     # imm = 0x10000000
leaq -0x60(%rbp), %r12
leaq -0x70(%rbp), %r13
movq %r14, %rdi
leaq -0x50(%rbp), %rsi
callq 0x22a0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x429f
movq %r12, -0x70(%rbp)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x40ca
movq %r14, %rdi
movq %rbx, %rsi
leaq -0x2c(%rbp), %rdx
movq %r13, %rcx
callq 0x42f0
movl %eax, %r15d
movq -0x70(%rbp), %rdi
cmpq %r12, %rdi
je 0x429a
callq 0x21f0
testb %r15b, %r15b
jne 0x4246
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x42b1
callq 0x21f0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x70(%rbp), %rdi
cmpq %r12, %rdi
je 0x42d6
callq 0x21f0
jmp 0x42d6
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x42e8
callq 0x21f0
movq %rbx, %rdi
callq 0x2370
// File: /workspace/github_cpp_makefile_star2_O3/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 0xa499(%rip), %rdi      # 0xf240
movq %r14, %rsi
callq 0x6592
movq %rax, %r15
leaq 0xa48f(%rip), %r12      # 0xf248
cmpq %r12, %rax
je 0x4dd1
leaq 0xa47b(%rip), %rdi      # 0xf240
movq %r14, %rsi
callq 0x4e78
movl (%rax), %eax
movl %eax, (%rbx)
cmpq %r12, %r15
setne %al
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/olly-larkin[P]mips-parser/src/instructionList.cpp
// Function: giveStr(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::string giveStr(std::vector<std::string> strVec) {
    std::string returnStr;
    for(int i = 0; i < strVec.size(); ++i) {
        returnStr += strVec[i] + ' ';
    }
    return returnStr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq 0x10(%rdi), %rax
movq %rax, -0x58(%rbp)
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
movq %rdi, -0x30(%rbp)
movb $0x0, 0x10(%rdi)
movq (%rsi), %rax
cmpq %rax, 0x8(%rsi)
je 0x66c4
movq %rsi, %r14
movl $0x8, %r12d
leaq -0x40(%rbp), %r13
xorl %ebx, %ebx
leaq -0x50(%rbp), %r15
movq %r13, -0x50(%rbp)
movq -0x8(%rax,%r12), %rsi
movq (%rax,%r12), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x40ca
movq -0x48(%rbp), %rsi
movl $0x1, %ecx
movq %r15, %rdi
xorl %edx, %edx
movl $0x20, %r8d
callq 0x23a0
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq -0x30(%rbp), %rdi
callq 0x20d0
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x66aa
callq 0x21f0
incq %rbx
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
addq $0x20, %r12
cmpq %rbx, %rcx
ja 0x665a
movq -0x30(%rbp), %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x66ef
jmp 0x66de
movq %rax, %r14
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x66ef
callq 0x21f0
movq -0x30(%rbp), %rax
movq (%rax), %rdi
cmpq -0x58(%rbp), %rdi
je 0x6701
callq 0x21f0
movq %r14, %rdi
callq 0x2370
// File: /workspace/github_cpp_makefile_star2_O3/olly-larkin[P]mips-parser/src/instructionList.cpp
// Function: regMemSeperator(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int&, int&)
bool regMemSeperator(std::string str, int& offset, int& reg) {
    std::size_t index;
    offset = std::stoi(str, &index, 0);
    if (index == 0 || str[index] != '(')
        return false;
    str.pop_back();
    std::string regStr;
    for(int i = index+1; i < str.size(); ++i)
        regStr += str[i];
    if (regMap.find(regStr) == regMap.end())
        return false;
    reg = regMap[regStr];
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, -0x38(%rbp)
movq %rsi, %r13
movq %rdi, %r14
movq (%rdi), %r12
callq 0x2050
movq %rax, %r15
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
movl $0x0, (%r15)
leaq -0x58(%rbp), %rbx
movq %r12, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x22c0
movq (%rbx), %rbx
movq %rbx, %rcx
subq %r12, %rcx
je 0x7ca3
movslq %eax, %rdx
cmpq %rax, %rdx
jne 0x7caf
movl (%r15), %edx
cmpl $0x22, %edx
je 0x7caf
testl %edx, %edx
jne 0x7bf7
movl -0x2c(%rbp), %edx
movl %edx, (%r15)
movl %eax, (%r13)
movq (%r14), %rax
cmpb $0x28, (%rax,%rcx)
jne 0x7c46
movq %r14, %rdi
callq 0x2280
leaq -0x48(%rbp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
subl %r12d, %ebx
incl %ebx
leaq -0x58(%rbp), %r15
movslq %ebx, %rbx
cmpq %rbx, 0x8(%r14)
jbe 0x7c4b
movq (%r14), %rax
movsbl (%rax,%rbx), %esi
incl %ebx
movq %r15, %rdi
callq 0x21c0
jmp 0x7c2a
xorl %r14d, %r14d
jmp 0x7c91
leaq 0x7626(%rip), %rdi      # 0xf278
leaq -0x58(%rbp), %rsi
callq 0x6592
leaq 0x761e(%rip), %rcx      # 0xf280
cmpq %rcx, %rax
setne %r14b
je 0x7c83
leaq 0x7606(%rip), %rdi      # 0xf278
leaq -0x58(%rbp), %rsi
callq 0x4e78
movl (%rax), %eax
movq -0x38(%rbp), %rcx
movl %eax, (%rcx)
movq -0x58(%rbp), %rdi
cmpq %r13, %rdi
je 0x7c91
callq 0x21f0
movl %r14d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x356a(%rip), %rdi      # 0xb214
callq 0x2150
leaq 0x355e(%rip), %rdi      # 0xb214
callq 0x22e0
jmp 0x7cd0
jmp 0x7cd0
movq %rax, %rbx
cmpl $0x0, (%r15)
jne 0x7ce1
movl -0x2c(%rbp), %eax
movl %eax, (%r15)
jmp 0x7ce1
movq %rax, %rbx
movq -0x58(%rbp), %rdi
cmpq %r13, %rdi
je 0x7ce1
callq 0x21f0
movq %rbx, %rdi
callq 0x2370