LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: jswaff[P]prophet3/src/magic.cpp
// Function: get_rook_moves(position*, square_t, unsigned long long)
uint64 get_rook_moves(position* p,square_t from,uint64 targets) {
    assert(p);
    assert(from >= A8 && from <= H1);
    assert(magic_numbers_rooks[from]);
    assert(magic_numbers_shift_rooks[from]);

    uint64 blockers = (p->black_pieces | p->white_pieces) & bb_rook_masks[from];
    int magic_ind = (int)((blockers * magic_numbers_rooks[from]) >> magic_numbers_shift_rooks[from]);

    return bb_magic_rook_moves[from][magic_ind] & targets;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x918c
jmp 0x91ab
leaq 0x38a0b(%rip), %rdi     # 0x41b9e
leaq 0x2d43e(%rip), %rsi     # 0x365d8
movl $0x2d, %edx
leaq 0x2d4cd(%rip), %rcx     # 0x36673
callq 0x20c0
xorl %eax, %eax
cmpl $0x0, -0xc(%rbp)
movb %al, -0x25(%rbp)
jl 0x91c0
cmpl $0x3f, -0xc(%rbp)
setle %al
movb %al, -0x25(%rbp)
movb -0x25(%rbp), %al
testb $0x1, %al
jne 0x91c9
jmp 0x91cb
jmp 0x91ea
leaq 0x2d44a(%rip), %rdi     # 0x3661c
leaq 0x2d3ff(%rip), %rsi     # 0x365d8
movl $0x2e, %edx
leaq 0x2d48e(%rip), %rcx     # 0x36673
callq 0x20c0
movl -0xc(%rbp), %eax
movl %eax, %ecx
leaq 0x6fe0ca(%rip), %rax    # 0x7072c0
cmpq $0x0, (%rax,%rcx,8)
je 0x91ff
jmp 0x921e
leaq 0x2d4a1(%rip), %rdi     # 0x366a7
leaq 0x2d3cb(%rip), %rsi     # 0x365d8
movl $0x2f, %edx
leaq 0x2d45a(%rip), %rcx     # 0x36673
callq 0x20c0
movl -0xc(%rbp), %eax
movl %eax, %ecx
leaq 0x6fe296(%rip), %rax    # 0x7074c0
cmpl $0x0, (%rax,%rcx,4)
je 0x9232
jmp 0x9251
leaq 0x2d488(%rip), %rdi     # 0x366c1
leaq 0x2d398(%rip), %rsi     # 0x365d8
movl $0x30, %edx
leaq 0x2d427(%rip), %rcx     # 0x36673
callq 0x20c0
movq -0x8(%rbp), %rax
movq 0x1b0(%rax), %rax
movq -0x8(%rbp), %rcx
orq 0x1a8(%rcx), %rax
movl -0xc(%rbp), %ecx
movl %ecx, %edx
leaq 0xfde4d(%rip), %rcx     # 0x1070c0
andq (%rcx,%rdx,8), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl -0xc(%rbp), %ecx
movl %ecx, %edx
leaq 0x6fe035(%rip), %rcx    # 0x7072c0
imulq (%rcx,%rdx,8), %rax
movl -0xc(%rbp), %ecx
movl %ecx, %edx
leaq 0x6fe224(%rip), %rcx    # 0x7074c0
movl (%rcx,%rdx,4), %ecx
shrq %cl, %rax
movl %eax, -0x24(%rbp)
movl -0xc(%rbp), %eax
movl %eax, %ecx
leaq 0xfe00f(%rip), %rax     # 0x1072c0
shlq $0xf, %rcx
addq %rcx, %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
andq -0x18(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: jswaff[P]prophet3/src/magic.cpp
// Function: gen_moves_mask(square_t, unsigned long long, square_t (*)(square_t))
uint64 gen_moves_mask(square_t sq,uint64 occupied,dirFuncType dirFunc) {
    uint64 mask = 0;

    square_t to = dirFunc(sq);
    while (to != NO_SQUARE) {
        mask |= bb_squares[to];
        if (bb_squares[to] & occupied) {
            break;
        }
        to = dirFunc(to);
    }

    return mask;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x18(%rbp), %rax
movl -0x4(%rbp), %edi
callq *%rax
movl %eax, -0x24(%rbp)
cmpl $0x40, -0x24(%rbp)
je 0x933f
movl -0x24(%rbp), %eax
movl %eax, %ecx
leaq 0xfc367(%rip), %rax     # 0x105670
movq (%rax,%rcx,8), %rax
orq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movl -0x24(%rbp), %eax
movl %eax, %ecx
leaq 0xfc34f(%rip), %rax     # 0x105670
movq (%rax,%rcx,8), %rax
andq -0x10(%rbp), %rax
cmpq $0x0, %rax
je 0x9331
jmp 0x933f
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %edi
callq *%rax
movl %eax, -0x24(%rbp)
jmp 0x92f7
movq -0x20(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: jswaff[P]prophet3/src/magic.cpp
// Function: init_bishop_masks()
void init_bishop_masks() {
    for (int i=0;i<64;i++) {
        bb_bishop_masks[i] = 0;

        // if on the same diagonal.  "End points" can be ignored.
        for (int k=0;k<64;k++) {
            rank_t my_r = get_rank((square_t)k);
            file_t my_f = get_file((square_t)k);
            if (i != k) {
                if (is_diagonal((square_t)i,(square_t)k)
                        && my_r != RANK_1 && my_r != RANK_8
                        && my_f != FILE_A && my_f != FILE_H) {
                    bb_bishop_masks[i] |= bb_squares[k];
                }
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x4(%rbp)
cmpl $0x40, -0x4(%rbp)
jge 0x941f
movslq -0x4(%rbp), %rcx
leaq 0x6fe24c(%rip), %rax    # 0x7075c0
movq $0x0, (%rax,%rcx,8)
movl $0x0, -0x8(%rbp)
cmpl $0x40, -0x8(%rbp)
jge 0x940f
movl -0x8(%rbp), %edi
callq 0x120d0
movl %eax, -0xc(%rbp)
movl -0x8(%rbp), %edi
callq 0x12070
movl %eax, -0x10(%rbp)
movl -0x4(%rbp), %eax
cmpl -0x8(%rbp), %eax
je 0x93ff
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
callq 0x12940
testb $0x1, %al
jne 0x93bc
jmp 0x93fd
cmpl $0x7, -0xc(%rbp)
je 0x93fd
cmpl $0x0, -0xc(%rbp)
je 0x93fd
cmpl $0x0, -0x10(%rbp)
je 0x93fd
cmpl $0x7, -0x10(%rbp)
je 0x93fd
movslq -0x8(%rbp), %rcx
leaq 0xfc291(%rip), %rax     # 0x105670
movq (%rax,%rcx,8), %rdx
movslq -0x4(%rbp), %rcx
leaq 0x6fe1d2(%rip), %rax    # 0x7075c0
orq (%rax,%rcx,8), %rdx
leaq 0x6fe1c7(%rip), %rax    # 0x7075c0
movq %rdx, (%rax,%rcx,8)
jmp 0x93ff
jmp 0x9401
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x9383
jmp 0x9411
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x935f
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jswaff[P]prophet3/src/magic.cpp
// Function: init_rook_masks()
void init_rook_masks() {

    for (int i=0;i<64;i++) {
        bb_rook_masks[i] = 0;

        rank_t r = get_rank((square_t)i);
        file_t f = get_file((square_t)i);

        // if on the same rank or file.  "End points" can be ignored.
        for (int k=0;k<64;k++) {
            rank_t my_r = get_rank((square_t)k);
            file_t my_f = get_file((square_t)k);
            if (i != k) {
                if ((my_r==r && my_f != FILE_A && my_f != FILE_H)
                    || (my_f==f && my_r != RANK_8 && my_r != RANK_1))
                {
                    bb_rook_masks[i] |= bb_squares[k];
                }
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x0, -0x4(%rbp)
cmpl $0x40, -0x4(%rbp)
jge 0x9514
movslq -0x4(%rbp), %rcx
leaq 0xfdc6c(%rip), %rax     # 0x1070c0
movq $0x0, (%rax,%rcx,8)
movl -0x4(%rbp), %edi
callq 0x120d0
movl %eax, -0x8(%rbp)
movl -0x4(%rbp), %edi
callq 0x12070
movl %eax, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
cmpl $0x40, -0x10(%rbp)
jge 0x9504
movl -0x10(%rbp), %edi
callq 0x120d0
movl %eax, -0x14(%rbp)
movl -0x10(%rbp), %edi
callq 0x12070
movl %eax, -0x18(%rbp)
movl -0x4(%rbp), %eax
cmpl -0x10(%rbp), %eax
je 0x94f4
movl -0x14(%rbp), %eax
cmpl -0x8(%rbp), %eax
jne 0x94b5
cmpl $0x0, -0x18(%rbp)
je 0x94b5
cmpl $0x7, -0x18(%rbp)
jne 0x94c9
movl -0x18(%rbp), %eax
cmpl -0xc(%rbp), %eax
jne 0x94f2
cmpl $0x0, -0x14(%rbp)
je 0x94f2
cmpl $0x7, -0x14(%rbp)
je 0x94f2
movslq -0x10(%rbp), %rcx
leaq 0xfc19c(%rip), %rax     # 0x105670
movq (%rax,%rcx,8), %rdx
movslq -0x4(%rbp), %rcx
leaq 0xfdbdd(%rip), %rax     # 0x1070c0
orq (%rax,%rcx,8), %rdx
leaq 0xfdbd2(%rip), %rax     # 0x1070c0
movq %rdx, (%rax,%rcx,8)
jmp 0x94f4
jmp 0x94f6
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x9479
jmp 0x9506
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x943f
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: jswaff[P]prophet3/src/magic.cpp
// Function: init_magics()
void init_magics() {
    // make sure bitboards are already initialized
    assert(bb_squares[D4]);

    init_rook_masks();
    init_bishop_masks();
    init_rook_occupancy_variations();
    init_bishop_occupancy_variations();
    init_magic_numbers(true); // rooks
    init_magic_numbers(false); // bishops
    init_rook_magic_moves();
    init_bishop_magic_moves();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0xfb315(%rip), %rax     # 0x105670
cmpq $0x0, 0x118(%rax)
je 0xa367
jmp 0xa386
leaq 0x3002c(%rip), %rdi     # 0x3a39a
leaq 0x2c263(%rip), %rsi     # 0x365d8
movl $0x13d, %edx            # imm = 0x13D
leaq 0x2c49f(%rip), %rcx     # 0x36820
callq 0x20c0
callq 0x9430
callq 0x9350
callq 0x98d0
callq 0x9520
movl $0x1, %edi
callq 0x9c80
xorl %edi, %edi
callq 0x9c80
callq 0xa1a0
callq 0x9ff0
popq %rbp
retq
nopw (%rax,%rax)
// File: jswaff[P]prophet3/src/main.cpp
// Function: run_tests()
bool run_tests() {
    print("THIS IS A DEBUG BUILD.... running tests...\n");
    test_defs();
    test_bitboards();
    test_magic();
    test_draw();
    test_init();
    test_utils();
    test_square();
    test_pos();
    test_attack();
    test_move();
    test_movegen();
    test_next();
    test_apply();
    test_eval();
    test_evalp();
    test_search();
    test_time();
    test_hash();
    test_mvvlva();
    test_extend();
    test_prune();
    test_see();
    print("testing complete.\n");
    reset_pos(&gpos);
    clear_hash_table(&htbl);
    clear_hash_table(&phtbl);

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x2c47c(%rip), %rdi     # 0x36887
movb $0x0, %al
callq 0x8c60
callq 0x18e10
callq 0x18b70
callq 0x22560
callq 0x19820
callq 0x223f0
callq 0x34880
callq 0x32de0
callq 0x2f850
callq 0x17c40
callq 0x235f0
callq 0x282b0
callq 0x2c240
callq 0x16ae0
callq 0x1b560
callq 0x1c840
callq 0x30c80
callq 0x32f80
callq 0x21440
callq 0x291f0
callq 0x1d8c0
callq 0x2f8a0
callq 0x31930
leaq 0x2c42c(%rip), %rdi     # 0x368b3
movb $0x0, %al
callq 0x8c60
leaq 0xc964b(%rip), %rdi     # 0xd3ae0
callq 0xf390
leaq 0xf8c0f(%rip), %rdi     # 0x1030b0
callq 0x88c0
leaq 0xf8c33(%rip), %rdi     # 0x1030e0
callq 0x88c0
movb $0x1, %al
andb $0x1, %al
popq %rbp
retq
nopl (%rax,%rax)
// File: jswaff[P]prophet3/src/main.cpp
// Function: process_args(int, char**)
void process_args(int argc,char *argv[]) {

    for (int i=1;i<argc;i++) {
        char *p = strchr(argv[i],'=');
        if (p) {
            if (!strncmp(argv[i],"-book",5)) {
                book_path = strdup(p+1);
            } else if (!strncmp(argv[i],"-hash",5)) {
                hash_size = atoi(p+1) *1024*1024; // MB
            } else if (!strncmp(argv[i],"-phash",6)) {
                pawn_hash_size = atoi(p+1) *1024*1024; // MB
            } else if (!strncmp(argv[i],"-suite",6)) {
                tsfile = strdup(p+1);
            } else if (!strncmp(argv[i],"-time",5)) {
                tstime = atoi(p+1);
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0xa646
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movl $0x3d, %esi
callq 0x2070
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0xa636
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2c3ac(%rip), %rsi     # 0x368c6
movl $0x5, %edx
callq 0x2090
cmpl $0x0, %eax
jne 0xa542
movq -0x20(%rbp), %rdi
addq $0x1, %rdi
callq 0x2310
movq %rax, 0x87d58b(%rip)    # 0x887ac8
jmp 0xa634
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2c377(%rip), %rsi     # 0x368cc
movl $0x5, %edx
callq 0x2090
cmpl $0x0, %eax
jne 0xa582
movq -0x20(%rbp), %rdi
addq $0x1, %rdi
callq 0x22b0
shll $0xa, %eax
shll $0xa, %eax
movl %eax, 0x87d55b(%rip)    # 0x887ad8
jmp 0xa632
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2c33d(%rip), %rsi     # 0x368d2
movl $0x6, %edx
callq 0x2090
cmpl $0x0, %eax
jne 0xa5bf
movq -0x20(%rbp), %rdi
addq $0x1, %rdi
callq 0x22b0
shll $0xa, %eax
shll $0xa, %eax
movl %eax, 0x87d51f(%rip)    # 0x887adc
jmp 0xa630
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2c307(%rip), %rsi     # 0x368d9
movl $0x6, %edx
callq 0x2090
cmpl $0x0, %eax
jne 0xa5f7
movq -0x20(%rbp), %rdi
addq $0x1, %rdi
callq 0x2310
movq %rax, 0x87d4db(%rip)    # 0x887ad0
jmp 0xa62e
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x2c2d6(%rip), %rsi     # 0x368e0
movl $0x5, %edx
callq 0x2090
cmpl $0x0, %eax
jne 0xa62c
movq -0x20(%rbp), %rdi
addq $0x1, %rdi
callq 0x22b0
movl %eax, 0x42b74(%rip)     # 0x4d1a0
jmp 0xa62e
jmp 0xa630
jmp 0xa632
jmp 0xa634
jmp 0xa636
jmp 0xa638
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xa4d6
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: jswaff[P]prophet3/src/move.cpp
// Function: set_capture(unsigned long long*, piece_t)
void set_capture(move *mv,piece_t captured_piece) {
    assert(captured_piece != NO_PIECE);
    int32 cp = captured_piece < NO_PIECE ? -captured_piece : captured_piece;
    assert(cp > 0 && cp < 8);
    *mv &= ~(7 << 18);
    *mv |= cp << 18;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0xa937
jmp 0xa956
leaq 0x2c05b(%rip), %rdi     # 0x36999
leaq 0x2c06f(%rip), %rsi     # 0x369b4
movl $0x26, %edx
leaq 0x2c070(%rip), %rcx     # 0x369c1
callq 0x20c0
cmpl $0x0, -0xc(%rbp)
jge 0xa966
xorl %eax, %eax
subl -0xc(%rbp), %eax
movl %eax, -0x14(%rbp)
jmp 0xa96c
movl -0xc(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x10(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x10(%rbp)
movb %al, -0x15(%rbp)
jle 0xa987
cmpl $0x8, -0x10(%rbp)
setl %al
movb %al, -0x15(%rbp)
movb -0x15(%rbp), %al
testb $0x1, %al
jne 0xa990
jmp 0xa992
jmp 0xa9b1
leaq 0x2c04a(%rip), %rdi     # 0x369e3
leaq 0x2c014(%rip), %rsi     # 0x369b4
movl $0x28, %edx
leaq 0x2c015(%rip), %rcx     # 0x369c1
callq 0x20c0
movq -0x8(%rbp), %rax
movq (%rax), %rcx
andq $-0x1c0001, %rcx        # imm = 0xFFE3FFFF
movq %rcx, (%rax)
movl -0x10(%rbp), %eax
shll $0x12, %eax
movslq %eax, %rcx
movq -0x8(%rbp), %rax
orq (%rax), %rcx
movq %rcx, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: jswaff[P]prophet3/src/move.cpp
// Function: get_move_score(unsigned long long*)
int32 get_move_score(move *m) {
    int32 score = ((*m >> 32) & 0x7FFFFFFF);
    if ((*m >> 63) & 1) {
        return -score;
    } else {
        return score;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
shrq $0x20, %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
shrq $0x3f, %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0xabcb
xorl %eax, %eax
subl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xabd1
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jswaff[P]prophet3/src/move.cpp
// Function: set_move_score(unsigned long long*, int)
void set_move_score(move *m,int32 score) {
    // clear high order bits
    *m &= 0xFFFFFFFF;

    // now set score
    if (score >= 0) {
        *m |= ((uint64)score)<<32;
    } else {
        *m |= ((uint64)-score)<<32;
        *m |= ((uint64)1)<<63;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movabsq $0xffffffff, %rcx       # imm = 0xFFFFFFFF
andq (%rax), %rcx
movq %rcx, (%rax)
cmpl $0x0, -0xc(%rbp)
jl 0xac19
movslq -0xc(%rbp), %rcx
shlq $0x20, %rcx
movq -0x8(%rbp), %rax
orq (%rax), %rcx
movq %rcx, (%rax)
jmp 0xac43
xorl %eax, %eax
subl -0xc(%rbp), %eax
movslq %eax, %rcx
shlq $0x20, %rcx
movq -0x8(%rbp), %rax
orq (%rax), %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
orq (%rax), %rcx
movq %rcx, (%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jswaff[P]prophet3/src/movegen.cpp
// Function: gen_legal_moves(unsigned long long*, position*, bool, bool)
move* gen_legal_moves(move *m,position *p,bool caps,bool noncaps) {
    move* endp = gen_moves(m,p,caps,noncaps);

    undo undos[p->move_counter + (endp-m)];
    for (move* mp=m;mp<endp;mp++) {
        apply_move(p,*mp,undos);
        if (in_check(p,opposite_player(p->player))) {
            // mark as 'invalid'
            *mp = 0;
        }
        undo_last_move(p,undos);
    }

    return endp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movb %cl, %al
movb %dl, %cl
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %cl
movb %cl, -0x11(%rbp)
andb $0x1, %al
movb %al, -0x12(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movzbl -0x12(%rbp), %ecx
movzbl -0x11(%rbp), %edx
andl $0x1, %edx
andl $0x1, %ecx
callq 0xad70
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl 0x144(%rax), %eax
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rdx
subq %rdx, %rcx
sarq $0x3, %rcx
addq %rcx, %rax
movq %rsp, %rcx
movq %rcx, -0x28(%rbp)
movq %rax, %rdx
shlq $0x5, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x40(%rbp)
movq %rcx, %rsp
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0xad5d
movq -0x40(%rbp), %rdx
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rax
movq (%rax), %rsi
callq 0x3620
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movl 0x138(%rax), %edi
callq 0x14130
movq -0x48(%rbp), %rdi
movl %eax, %esi
callq 0xfc10
testb $0x1, %al
jne 0xad37
jmp 0xad42
movq -0x38(%rbp), %rax
movq $0x0, (%rax)
movq -0x40(%rbp), %rsi
movq -0x10(%rbp), %rdi
callq 0x39a0
movq -0x38(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x38(%rbp)
jmp 0xacf1
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rcx
movq %rcx, %rsp
movq %rbp, %rsp
popq %rbp
retq
nopl (%rax)
// File: jswaff[P]prophet3/src/movegen.cpp
// Function: gen_moves(unsigned long long*, position*, bool, bool)
move* gen_moves(move *m,position *p,bool caps,bool noncaps) {

    m = gen_pawn_moves(m,p,caps,noncaps);
    m = gen_knight_moves(m,p,caps,noncaps);
    m = gen_bishop_moves(m,p,caps,noncaps);
    m = gen_rook_moves(m,p,caps,noncaps);
    m = gen_queen_moves(m,p,caps,noncaps);
    m = gen_king_moves(m,p,caps,noncaps);

    return m;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %cl, %al
movb %dl, %cl
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %cl
movb %cl, -0x11(%rbp)
andb $0x1, %al
movb %al, -0x12(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movb -0x11(%rbp), %cl
movb -0x12(%rbp), %al
andb $0x1, %cl
andb $0x1, %al
movzbl %cl, %edx
movzbl %al, %ecx
callq 0xae70
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movb -0x11(%rbp), %cl
movb -0x12(%rbp), %al
andb $0x1, %cl
andb $0x1, %al
movzbl %cl, %edx
movzbl %al, %ecx
callq 0xb5d0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movb -0x11(%rbp), %cl
movb -0x12(%rbp), %al
andb $0x1, %cl
andb $0x1, %al
movzbl %cl, %edx
movzbl %al, %ecx
callq 0xb6c0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movb -0x11(%rbp), %cl
movb -0x12(%rbp), %al
andb $0x1, %cl
andb $0x1, %al
movzbl %cl, %edx
movzbl %al, %ecx
callq 0xb780
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movb -0x11(%rbp), %cl
movb -0x12(%rbp), %al
andb $0x1, %cl
andb $0x1, %al
movzbl %cl, %edx
movzbl %al, %ecx
callq 0xb840
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movb -0x11(%rbp), %cl
movb -0x12(%rbp), %al
andb $0x1, %cl
andb $0x1, %al
movzbl %cl, %edx
movzbl %al, %ecx
callq 0xb900
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jswaff[P]prophet3/src/movegen.cpp
// Function: gen_knight_moves(unsigned long long*, position*, bool, bool)
move* gen_knight_moves(move* m,position* p,bool caps,bool noncaps) {
    assert(caps || noncaps);
    uint64 pmap = p->player==WHITE ? p->white_knights : p->black_knights;
    while (pmap) {
        square_t sq = (square_t)get_msb(pmap);
        m = gen_knight_moves(m,p,sq,caps,noncaps);
        pmap ^= bb_squares[sq];
    }

    return m;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %cl, %al
movb %dl, %cl
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %cl
movb %cl, -0x11(%rbp)
andb $0x1, %al
movb %al, -0x12(%rbp)
movb $0x1, %al
testb $0x1, -0x11(%rbp)
movb %al, -0x25(%rbp)
jne 0xb600
movb -0x12(%rbp), %al
movb %al, -0x25(%rbp)
movb -0x25(%rbp), %al
testb $0x1, %al
jne 0xb609
jmp 0xb60b
jmp 0xb62a
leaq 0x2b4a7(%rip), %rdi     # 0x36ab9
leaq 0x2b450(%rip), %rsi     # 0x36a69
movl $0x6e, %edx
leaq 0x2b4a4(%rip), %rcx     # 0x36ac9
callq 0x20c0
movq -0x10(%rbp), %rax
cmpl $0x1, 0x138(%rax)
jne 0xb648
movq -0x10(%rbp), %rax
movq 0x168(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0xb657
movq -0x10(%rbp), %rax
movq 0x170(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0xb6b2
movq -0x20(%rbp), %rdi
callq 0x4a00
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x24(%rbp), %edx
movb -0x11(%rbp), %cl
movb -0x12(%rbp), %al
andb $0x1, %cl
andb $0x1, %al
movzbl %cl, %ecx
movzbl %al, %r8d
callq 0xbf00
movq %rax, -0x8(%rbp)
movl -0x24(%rbp), %eax
movl %eax, %ecx
leaq 0xf9fcc(%rip), %rax     # 0x105670
movq (%rax,%rcx,8), %rax
xorq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0xb65f
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: jswaff[P]prophet3/src/movegen.cpp
// Function: gen_bishop_moves(unsigned long long*, position*, bool, bool)
move* gen_bishop_moves(move* m,position* p,bool caps,bool noncaps) {

    uint64 pmap = p->player==WHITE ? p->white_bishops : p->black_bishops;
    while (pmap) {
        square_t sq = (square_t)get_msb(pmap);
        m = gen_bishop_moves(m,p,sq,caps,noncaps);
        pmap ^= bb_squares[sq];
    }

    return m;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %cl, %al
movb %dl, %cl
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %cl
movb %cl, -0x11(%rbp)
andb $0x1, %al
movb %al, -0x12(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x1, 0x138(%rax)
jne 0xb6fd
movq -0x10(%rbp), %rax
movq 0x178(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0xb70c
movq -0x10(%rbp), %rax
movq 0x180(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0xb767
movq -0x20(%rbp), %rdi
callq 0x4a00
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x24(%rbp), %edx
movb -0x11(%rbp), %cl
movb -0x12(%rbp), %al
andb $0x1, %cl
andb $0x1, %al
movzbl %cl, %ecx
movzbl %al, %r8d
callq 0xc0d0
movq %rax, -0x8(%rbp)
movl -0x24(%rbp), %eax
movl %eax, %ecx
leaq 0xf9f17(%rip), %rax     # 0x105670
movq (%rax,%rcx,8), %rax
xorq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0xb714
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jswaff[P]prophet3/src/movegen.cpp
// Function: gen_rook_moves(unsigned long long*, position*, bool, bool)
move* gen_rook_moves(move* m,position* p,bool caps,bool noncaps) {

    uint64 pmap = p->player==WHITE ? p->white_rooks : p->black_rooks;
    while (pmap) {
        square_t sq = (square_t)get_msb(pmap);
        m = gen_rook_moves(m,p,sq,caps,noncaps);
        pmap ^= bb_squares[sq];
    }

    return m;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %cl, %al
movb %dl, %cl
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %cl
movb %cl, -0x11(%rbp)
andb $0x1, %al
movb %al, -0x12(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x1, 0x138(%rax)
jne 0xb7bd
movq -0x10(%rbp), %rax
movq 0x188(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0xb7cc
movq -0x10(%rbp), %rax
movq 0x190(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0xb827
movq -0x20(%rbp), %rdi
callq 0x4a00
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x24(%rbp), %edx
movb -0x11(%rbp), %cl
movb -0x12(%rbp), %al
andb $0x1, %cl
andb $0x1, %al
movzbl %cl, %ecx
movzbl %al, %r8d
callq 0xc210
movq %rax, -0x8(%rbp)
movl -0x24(%rbp), %eax
movl %eax, %ecx
leaq 0xf9e57(%rip), %rax     # 0x105670
movq (%rax,%rcx,8), %rax
xorq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0xb7d4
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jswaff[P]prophet3/src/movegen.cpp
// Function: gen_queen_moves(unsigned long long*, position*, bool, bool)
move* gen_queen_moves(move* m,position* p,bool caps,bool noncaps) {

    uint64 pmap = p->player==WHITE ? p->white_queens : p->black_queens;
    while (pmap) {
        square_t sq = (square_t)get_msb(pmap);
        m = gen_queen_moves(m,p,sq,caps,noncaps);
        pmap ^= bb_squares[sq];
    }

    return m;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %cl, %al
movb %dl, %cl
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %cl
movb %cl, -0x11(%rbp)
andb $0x1, %al
movb %al, -0x12(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x1, 0x138(%rax)
jne 0xb87d
movq -0x10(%rbp), %rax
movq 0x198(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0xb88c
movq -0x10(%rbp), %rax
movq 0x1a0(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0xb8e7
movq -0x20(%rbp), %rdi
callq 0x4a00
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x24(%rbp), %edx
movb -0x11(%rbp), %cl
movb -0x12(%rbp), %al
andb $0x1, %cl
andb $0x1, %al
movzbl %cl, %ecx
movzbl %al, %r8d
callq 0xc350
movq %rax, -0x8(%rbp)
movl -0x24(%rbp), %eax
movl %eax, %ecx
leaq 0xf9d97(%rip), %rax     # 0x105670
movq (%rax,%rcx,8), %rax
xorq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0xb894
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jswaff[P]prophet3/src/movegen.cpp
// Function: add_move(unsigned long long*, position*, piece_t, square_t, square_t)
move* add_move(move* m,position* p,piece_t piece,square_t from,square_t to) {
    piece_t captured_piece = (piece_t)p->piece[to];
    assert( (p->player==WHITE && is_not_white_piece(captured_piece))
        || (p->player==BLACK && is_not_black_piece(captured_piece)));

    to_move(m,piece,from,to);
    if (captured_piece != NO_PIECE) {
        set_capture(m,captured_piece);
    }
    ++m;

    return m;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x1, 0x138(%rax)
jne 0xbcb8
movl -0x20(%rbp), %edi
callq 0x14de0
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x21(%rbp)
jne 0xbcdb
movq -0x10(%rbp), %rcx
xorl %eax, %eax
cmpl $0x0, 0x138(%rcx)
movb %al, -0x22(%rbp)
jne 0xbcd5
movl -0x20(%rbp), %edi
callq 0x14e00
movb %al, -0x22(%rbp)
movb -0x22(%rbp), %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0xbce4
jmp 0xbce6
jmp 0xbd05
leaq 0x2ad07(%rip), %rdi     # 0x369f4
leaq 0x2ad75(%rip), %rsi     # 0x36a69
movl $0x39, %edx
leaq 0x2ad79(%rip), %rcx     # 0x36a79
callq 0x20c0
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
movl -0x1c(%rbp), %ecx
callq 0xa860
cmpl $0x0, -0x20(%rbp)
je 0xbd29
movq -0x8(%rbp), %rdi
movl -0x20(%rbp), %esi
callq 0xa920
movq -0x8(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: jswaff[P]prophet3/src/movegen.cpp
// Function: add_castle(unsigned long long*, square_t, square_t)
move* add_castle(move* m,square_t from,square_t to) {
    to_move(m,KING,from,to);
    set_castle(m);
    ++m;
    return m;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %edx
movl -0x10(%rbp), %ecx
movl $0x6, %esi
callq 0xa860
movq -0x8(%rbp), %rdi
callq 0xaa60
movq -0x8(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jswaff[P]prophet3/src/movegen.cpp
// Function: add_promotion(unsigned long long*, square_t, square_t, piece_t, piece_t)
move* add_promotion(move* m,square_t from,square_t to,piece_t promopiece,piece_t captured_piece) {
    to_move(m,PAWN,from,to);
    if (captured_piece != NO_PIECE) {
        set_capture(m,captured_piece);
    }
    set_promopiece(m,promopiece);
    ++m;
    return m;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl %r8d, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %edx
movl -0x10(%rbp), %ecx
movl $0x1, %esi
callq 0xa860
cmpl $0x0, -0x18(%rbp)
je 0xbdcf
movq -0x8(%rbp), %rdi
movl -0x18(%rbp), %esi
callq 0xa920
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0xa9e0
movq -0x8(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jswaff[P]prophet3/src/movegen.cpp
// Function: add_pawn_move(unsigned long long*, square_t, square_t, piece_t, bool)
move* add_pawn_move(move* m,square_t from,square_t to,piece_t captured_piece,bool epcapture) {
    rank_t r = get_rank(to);
    if (r==RANK_8 || r==RANK_1) {
        m = add_promotion(m,from,to,QUEEN,captured_piece);
        m = add_promotion(m,from,to,KNIGHT,captured_piece);
        m = add_promotion(m,from,to,ROOK,captured_piece);
        m = add_promotion(m,from,to,BISHOP,captured_piece);
    } else {
        to_move(m,PAWN,from,to);
        if (epcapture) {
            set_epcapture(m);
        } else if (captured_piece != NO_PIECE) {
            set_capture(m,captured_piece);
        }
        ++m;
    }

    return m;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %r8b, %al
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
andb $0x1, %al
movb %al, -0x15(%rbp)
movl -0x10(%rbp), %edi
callq 0x120d0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0xbe34
cmpl $0x7, -0x1c(%rbp)
jne 0xbea6
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movl -0x14(%rbp), %r8d
movl $0x5, %ecx
callq 0xbd90
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movl -0x14(%rbp), %r8d
movl $0x2, %ecx
callq 0xbd90
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movl -0x14(%rbp), %r8d
movl $0x4, %ecx
callq 0xbd90
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movl -0x14(%rbp), %r8d
movl $0x3, %ecx
callq 0xbd90
movq %rax, -0x8(%rbp)
jmp 0xbeeb
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %edx
movl -0x10(%rbp), %ecx
movl $0x1, %esi
callq 0xa860
testb $0x1, -0x15(%rbp)
je 0xbecb
movq -0x8(%rbp), %rdi
callq 0xaa20
jmp 0xbedf
cmpl $0x0, -0x14(%rbp)
je 0xbedd
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0xa920
jmp 0xbedf
movq -0x8(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jswaff[P]prophet3/src/movegen.cpp
// Function: gen_knight_moves(unsigned long long*, position*, square_t, bool, bool)
move* gen_knight_moves(move* m,position* p,square_t from,bool caps,bool noncaps) {
    assert(m);
    assert(p);
    assert(from >= A8 && from <= H1);

    uint64 mv_map = bb_knight_moves[from] & get_target_squares(p,caps,noncaps);
    while (mv_map) {
        square_t sq = (square_t)get_lsb(mv_map);
        m=add_move(m,p,KNIGHT,from,sq);
        mv_map ^= bb_squares[sq];
    }

    return m;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %r8b, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
andb $0x1, %cl
movb %cl, -0x15(%rbp)
andb $0x1, %al
movb %al, -0x16(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0xbf2a
jmp 0xbf49
leaq 0x2d2f2(%rip), %rdi     # 0x39223
leaq 0x2ab31(%rip), %rsi     # 0x36a69
movl $0x7a, %edx
leaq 0x2abbc(%rip), %rcx     # 0x36b00
callq 0x20c0
cmpq $0x0, -0x10(%rbp)
je 0xbf52
jmp 0xbf71
leaq 0x35c45(%rip), %rdi     # 0x41b9e
leaq 0x2ab09(%rip), %rsi     # 0x36a69
movl $0x7b, %edx
leaq 0x2ab94(%rip), %rcx     # 0x36b00
callq 0x20c0
xorl %eax, %eax
cmpl $0x0, -0x14(%rbp)
movb %al, -0x25(%rbp)
jl 0xbf86
cmpl $0x3f, -0x14(%rbp)
setle %al
movb %al, -0x25(%rbp)
movb -0x25(%rbp), %al
testb $0x1, %al
jne 0xbf8f
jmp 0xbf91
jmp 0xbfb0
leaq 0x2a684(%rip), %rdi     # 0x3661c
leaq 0x2aaca(%rip), %rsi     # 0x36a69
movl $0x7c, %edx
leaq 0x2ab55(%rip), %rcx     # 0x36b00
callq 0x20c0
movl -0x14(%rbp), %eax
movl %eax, %ecx
leaq 0xf98b4(%rip), %rax     # 0x105870
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movb -0x15(%rbp), %cl
movb -0x16(%rbp), %al
andb $0x1, %cl
andb $0x1, %al
movzbl %cl, %esi
movzbl %al, %edx
callq 0xc040
movq %rax, %rcx
movq -0x30(%rbp), %rax
andq %rcx, %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0xc036
movq -0x20(%rbp), %rdi
callq 0x4870
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %ecx
movl -0x24(%rbp), %r8d
movl $0x2, %edx
callq 0xbc70
movq %rax, -0x8(%rbp)
movl -0x24(%rbp), %eax
movl %eax, %ecx
leaq 0xf9648(%rip), %rax     # 0x105670
movq (%rax,%rcx,8), %rax
xorq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0xbfec
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
// File: jswaff[P]prophet3/src/movegen.cpp
// Function: get_target_squares(position*, bool, bool)
uint64 get_target_squares(position* p,bool caps,bool noncaps) {
    uint64 targets = 0;

    if (caps) {
        targets = (p->player==WHITE ? p->black_pieces : p->white_pieces);
    }

    if (noncaps) {
        targets |= ~(p->white_pieces | p->black_pieces);
    }

    return targets;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %dl, %al
movb %sil, %cl
movq %rdi, -0x8(%rbp)
andb $0x1, %cl
movb %cl, -0x9(%rbp)
andb $0x1, %al
movb %al, -0xa(%rbp)
movq $0x0, -0x18(%rbp)
testb $0x1, -0x9(%rbp)
je 0xc09b
movq -0x8(%rbp), %rax
cmpl $0x1, 0x138(%rax)
jne 0xc084
movq -0x8(%rbp), %rax
movq 0x1b0(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0xc093
movq -0x8(%rbp), %rax
movq 0x1a8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
testb $0x1, -0xa(%rbp)
je 0xc0c3
movq -0x8(%rbp), %rax
movq 0x1a8(%rax), %rax
movq -0x8(%rbp), %rcx
orq 0x1b0(%rcx), %rax
xorq $-0x1, %rax
orq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
popq %rbp
retq
nopl (%rax)
// File: jswaff[P]prophet3/src/movegen.cpp
// Function: gen_bishop_moves(unsigned long long*, position*, square_t, bool, bool)
move* gen_bishop_moves(move* m,position* p,square_t from,bool caps,bool noncaps) {
    assert(m);
    assert(p);
    assert(from >= A8 && from <= H1);

    uint64 bishop_moves = get_bishop_moves(p,from,get_target_squares(p,caps,noncaps));

    while (bishop_moves) {
        square_t sq = (square_t)get_msb(bishop_moves);
        m = add_move(m,p,BISHOP,from,sq);
        bishop_moves ^= bb_squares[sq];
    }

    return m;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %r8b, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
andb $0x1, %cl
movb %cl, -0x15(%rbp)
andb $0x1, %al
movb %al, -0x16(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0xc0fa
jmp 0xc119
leaq 0x2d122(%rip), %rdi     # 0x39223
leaq 0x2a961(%rip), %rsi     # 0x36a69
movl $0x95, %edx
leaq 0x2aa2d(%rip), %rcx     # 0x36b41
callq 0x20c0
cmpq $0x0, -0x10(%rbp)
je 0xc122
jmp 0xc141
leaq 0x35a75(%rip), %rdi     # 0x41b9e
leaq 0x2a939(%rip), %rsi     # 0x36a69
movl $0x96, %edx
leaq 0x2aa05(%rip), %rcx     # 0x36b41
callq 0x20c0
xorl %eax, %eax
cmpl $0x0, -0x14(%rbp)
movb %al, -0x25(%rbp)
jl 0xc156
cmpl $0x3f, -0x14(%rbp)
setle %al
movb %al, -0x25(%rbp)
movb -0x25(%rbp), %al
testb $0x1, %al
jne 0xc15f
jmp 0xc161
jmp 0xc180
leaq 0x2a4b4(%rip), %rdi     # 0x3661c
leaq 0x2a8fa(%rip), %rsi     # 0x36a69
movl $0x97, %edx
leaq 0x2a9c6(%rip), %rcx     # 0x36b41
callq 0x20c0
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rdi
movb -0x15(%rbp), %cl
movb -0x16(%rbp), %al
andb $0x1, %cl
andb $0x1, %al
movzbl %cl, %esi
movzbl %al, %edx
callq 0xc040
movq -0x38(%rbp), %rdi
movl -0x2c(%rbp), %esi
movq %rax, %rdx
callq 0x8fc0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0xc205
movq -0x20(%rbp), %rdi
callq 0x4a00
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %ecx
movl -0x24(%rbp), %r8d
movl $0x3, %edx
callq 0xbc70
movq %rax, -0x8(%rbp)
movl -0x24(%rbp), %eax
movl %eax, %ecx
leaq 0xf9479(%rip), %rax     # 0x105670
movq (%rax,%rcx,8), %rax
xorq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0xc1bb
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: jswaff[P]prophet3/src/movegen.cpp
// Function: gen_rook_moves(unsigned long long*, position*, square_t, bool, bool)
move* gen_rook_moves(move* m,position* p,square_t from,bool caps,bool noncaps) {
    assert(m);
    assert(p);
    assert(from >= A8 && from <= H1);

    uint64 rook_moves = get_rook_moves(p,from,get_target_squares(p,caps,noncaps));

    while (rook_moves) {
        square_t sq = (square_t)get_msb(rook_moves);
        m = add_move(m,p,ROOK,from,sq);
        rook_moves ^= bb_squares[sq];
    }

    return m;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %r8b, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
andb $0x1, %cl
movb %cl, -0x15(%rbp)
andb $0x1, %al
movb %al, -0x16(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0xc23a
jmp 0xc259
leaq 0x2cfe2(%rip), %rdi     # 0x39223
leaq 0x2a821(%rip), %rsi     # 0x36a69
movl $0xb1, %edx
leaq 0x2a92e(%rip), %rcx     # 0x36b82
callq 0x20c0
cmpq $0x0, -0x10(%rbp)
je 0xc262
jmp 0xc281
leaq 0x35935(%rip), %rdi     # 0x41b9e
leaq 0x2a7f9(%rip), %rsi     # 0x36a69
movl $0xb2, %edx
leaq 0x2a906(%rip), %rcx     # 0x36b82
callq 0x20c0
xorl %eax, %eax
cmpl $0x0, -0x14(%rbp)
movb %al, -0x25(%rbp)
jl 0xc296
cmpl $0x3f, -0x14(%rbp)
setle %al
movb %al, -0x25(%rbp)
movb -0x25(%rbp), %al
testb $0x1, %al
jne 0xc29f
jmp 0xc2a1
jmp 0xc2c0
leaq 0x2a374(%rip), %rdi     # 0x3661c
leaq 0x2a7ba(%rip), %rsi     # 0x36a69
movl $0xb3, %edx
leaq 0x2a8c7(%rip), %rcx     # 0x36b82
callq 0x20c0
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rdi
movb -0x15(%rbp), %cl
movb -0x16(%rbp), %al
andb $0x1, %cl
andb $0x1, %al
movzbl %cl, %esi
movzbl %al, %edx
callq 0xc040
movq -0x38(%rbp), %rdi
movl -0x2c(%rbp), %esi
movq %rax, %rdx
callq 0x9170
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0xc345
movq -0x20(%rbp), %rdi
callq 0x4a00
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %ecx
movl -0x24(%rbp), %r8d
movl $0x4, %edx
callq 0xbc70
movq %rax, -0x8(%rbp)
movl -0x24(%rbp), %eax
movl %eax, %ecx
leaq 0xf9339(%rip), %rax     # 0x105670
movq (%rax,%rcx,8), %rax
xorq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0xc2fb
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: jswaff[P]prophet3/src/movegen.cpp
// Function: gen_queen_moves(unsigned long long*, position*, square_t, bool, bool)
move* gen_queen_moves(move* m,position* p,square_t from,bool caps,bool noncaps) {
    assert(m);
    assert(p);
    assert(from >= A8 && from <= H1);

    uint64 queen_moves = get_queen_moves(p,from,get_target_squares(p,caps,noncaps));

    while (queen_moves) {
        square_t sq = (square_t)get_msb(queen_moves);
        m = add_move(m,p,QUEEN,from,sq);
        queen_moves ^= bb_squares[sq];
    }

    return m;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %r8b, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
andb $0x1, %cl
movb %cl, -0x15(%rbp)
andb $0x1, %al
movb %al, -0x16(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0xc37a
jmp 0xc399
leaq 0x2cea2(%rip), %rdi     # 0x39223
leaq 0x2a6e1(%rip), %rsi     # 0x36a69
movl $0xcd, %edx
leaq 0x2a82d(%rip), %rcx     # 0x36bc1
callq 0x20c0
cmpq $0x0, -0x10(%rbp)
je 0xc3a2
jmp 0xc3c1
leaq 0x357f5(%rip), %rdi     # 0x41b9e
leaq 0x2a6b9(%rip), %rsi     # 0x36a69
movl $0xce, %edx
leaq 0x2a805(%rip), %rcx     # 0x36bc1
callq 0x20c0
xorl %eax, %eax
cmpl $0x0, -0x14(%rbp)
movb %al, -0x25(%rbp)
jl 0xc3d6
cmpl $0x3f, -0x14(%rbp)
setle %al
movb %al, -0x25(%rbp)
movb -0x25(%rbp), %al
testb $0x1, %al
jne 0xc3df
jmp 0xc3e1
jmp 0xc400
leaq 0x2a234(%rip), %rdi     # 0x3661c
leaq 0x2a67a(%rip), %rsi     # 0x36a69
movl $0xcf, %edx
leaq 0x2a7c6(%rip), %rcx     # 0x36bc1
callq 0x20c0
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rdi
movb -0x15(%rbp), %cl
movb -0x16(%rbp), %al
andb $0x1, %cl
andb $0x1, %al
movzbl %cl, %esi
movzbl %al, %edx
callq 0xc040
movq -0x38(%rbp), %rdi
movl -0x2c(%rbp), %esi
movq %rax, %rdx
callq 0x9120
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0xc485
movq -0x20(%rbp), %rdi
callq 0x4a00
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %ecx
movl -0x24(%rbp), %r8d
movl $0x5, %edx
callq 0xbc70
movq %rax, -0x8(%rbp)
movl -0x24(%rbp), %eax
movl %eax, %ecx
leaq 0xf91f9(%rip), %rax     # 0x105670
movq (%rax,%rcx,8), %rax
xorq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0xc43b
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: jswaff[P]prophet3/src/mvvlva.cpp
// Function: mvvlva_capture(position*, unsigned long long)
int32 mvvlva_capture(position *pos,move mv) {
    piece_t captured;
    if (is_epcapture(mv)) {
        captured = PAWN;
    } else {
        captured = (piece_t)pos->piece[get_to_sq(mv)];
    }
    assert(captured != NO_PIECE);
    int32 captured_val = captured < NO_PIECE ? -captured : captured;

    piece_t mover = (piece_t)pos->piece[get_from_sq(mv)];
    assert(mover != NO_PIECE);
    int32 mover_val = mover < NO_PIECE ? -mover : mover;

    return 1000 + (captured_val * 10) - mover_val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0xab50
testb $0x1, %al
jne 0xc52f
jmp 0xc538
movl $0x1, -0x14(%rbp)
jmp 0xc557
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0xaaa0
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0xc55f
jmp 0xc57e
leaq 0x28b3d(%rip), %rdi     # 0x350a3
leaq 0x2a707(%rip), %rsi     # 0x36c74
movl $0x1a, %edx
leaq 0x2a723(%rip), %rcx     # 0x36c9c
callq 0x20c0
cmpl $0x0, -0x14(%rbp)
jge 0xc58e
xorl %eax, %eax
subl -0x14(%rbp), %eax
movl %eax, -0x2c(%rbp)
jmp 0xc594
movl -0x14(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
callq 0xaa80
movl %eax, %ecx
movq -0x38(%rbp), %rax
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0xc5c1
jmp 0xc5e0
leaq 0x2a6fb(%rip), %rdi     # 0x36cc3
leaq 0x2a6a5(%rip), %rsi     # 0x36c74
movl $0x1e, %edx
leaq 0x2a6c1(%rip), %rcx     # 0x36c9c
callq 0x20c0
cmpl $0x0, -0x1c(%rbp)
jge 0xc5f0
xorl %eax, %eax
subl -0x1c(%rbp), %eax
movl %eax, -0x3c(%rbp)
jmp 0xc5f6
movl -0x1c(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x20(%rbp)
imull $0xa, -0x18(%rbp), %eax
addl $0x3e8, %eax            # imm = 0x3E8
subl -0x20(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: jswaff[P]prophet3/src/mvvlva.cpp
// Function: mvvlva(position*, unsigned long long)
int32 mvvlva(position *pos,move mv) {
    int32 score = 0;

    if (get_promopiece(mv)!=NO_PIECE) {
        score = mvvlva_promo(mv);
    }
    if (is_capture(mv)) {
        score += mvvlva_capture(pos,mv);
    }

    return score;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x10(%rbp), %rdi
callq 0xaae0
cmpl $0x0, %eax
je 0xc641
movq -0x10(%rbp), %rdi
callq 0xc490
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rdi
callq 0xab20
testb $0x1, %al
jne 0xc650
jmp 0xc663
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xc510
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: jswaff[P]prophet3/src/next.cpp
// Function: test_good_move(unsigned long long, position*)
bool test_good_move(move mv,position *pos) {
    move moves[MAX_MOVES_PER_PLY];
    move *endp = gen_moves(moves,pos,true,true);

    bool valid =  is_in_move_list(mv,moves,endp);
    if (!valid) {
        char mv_text[10];
        move_to_str(mv,mv_text);
        print("good_move says move %s is good.\n",mv_text);
        draw_board(pos);
    }

    return valid;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x990, %rsp            # imm = 0x990
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x970(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x1, %ecx
movl %ecx, %edx
callq 0xad70
movq %rax, -0x978(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x970(%rbp), %rsi
movq -0x978(%rbp), %rdx
callq 0x14c10
andb $0x1, %al
movb %al, -0x979(%rbp)
testb $0x1, -0x979(%rbp)
jne 0xd497
movq -0x8(%rbp), %rdi
leaq -0x983(%rbp), %rsi
callq 0x14350
leaq -0x983(%rbp), %rsi
leaq 0x29afc(%rip), %rdi     # 0x36f83
movb $0x0, %al
callq 0x8c60
movq -0x10(%rbp), %rdi
callq 0x64e0
movb -0x979(%rbp), %al
andb $0x1, %al
addq $0x990, %rsp            # imm = 0x990
popq %rbp
retq
nopl (%rax,%rax)
// File: jswaff[P]prophet3/src/next.cpp
// Function: best_at_top(unsigned long long*, unsigned long long*)
bool best_at_top(move *startp,move *endp) {

    move *bestp = 0;
    int32 bestscore = 0;

    for (move *mp=startp;mp<endp;mp++) {
        if (*mp != 0) {
            int32 score = get_move_score(mp);
            if (bestp==0 || score > bestscore) {
                bestp = mp;
                bestscore = score;
            }
        }
    }

    if (bestp) {
        move tmpmv = *startp;
        *startp = *bestp;
        *bestp = tmpmv;
        return true;
    }

    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0xd526
movq -0x30(%rbp), %rax
cmpq $0x0, (%rax)
je 0xd516
movq -0x30(%rbp), %rdi
callq 0xab90
movl %eax, -0x34(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0xd506
movl -0x34(%rbp), %eax
cmpl -0x24(%rbp), %eax
jle 0xd514
movq -0x30(%rbp), %rax
movq %rax, -0x20(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0xd516
jmp 0xd518
movq -0x30(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x30(%rbp)
jmp 0xd4d7
cmpq $0x0, -0x20(%rbp)
je 0xd557
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0xd55b
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jswaff[P]prophet3/src/next.cpp
// Function: place_move_on_top(unsigned long long*, unsigned long long*, unsigned long long)
bool place_move_on_top(move *start,move *end,move top_move) {
    assert(start);
    assert(end);

    if (top_move==BADMOVE) return false;

    assert(clear_score(top_move)==top_move);

    bool found_move=false;
    for (move *mp=start;mp<end;mp++) {
        if (*mp == top_move) {
            move tmp_move = *start;
            *start = top_move;
            *mp = tmp_move;
            found_move=true;
            break;
        }
    }
    return found_move;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xd58d
jmp 0xd5ac
leaq 0x29998(%rip), %rdi     # 0x36f2c
leaq 0x29755(%rip), %rsi     # 0x36cf0
movl $0xa0, %edx
leaq 0x2998b(%rip), %rcx     # 0x36f32
callq 0x20c0
cmpq $0x0, -0x18(%rbp)
je 0xd5b5
jmp 0xd5d4
leaq 0x299a3(%rip), %rdi     # 0x36f5f
leaq 0x2972d(%rip), %rsi     # 0x36cf0
movl $0xa1, %edx
leaq 0x29963(%rip), %rcx     # 0x36f32
callq 0x20c0
cmpq $0x0, -0x20(%rbp)
jne 0xd5e4
movb $0x0, -0x1(%rbp)
jmp 0xd676
movq -0x20(%rbp), %rdi
callq 0xac50
cmpq -0x20(%rbp), %rax
jne 0xd5f5
jmp 0xd614
leaq 0x29967(%rip), %rdi     # 0x36f63
leaq 0x296ed(%rip), %rsi     # 0x36cf0
movl $0xa5, %edx
leaq 0x29923(%rip), %rcx     # 0x36f32
callq 0x20c0
movb $0x0, -0x21(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0xd66e
movq -0x30(%rbp), %rax
movq (%rax), %rax
cmpq -0x20(%rbp), %rax
jne 0xd65e
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movb $0x1, -0x21(%rbp)
jmp 0xd66e
jmp 0xd660
movq -0x30(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x30(%rbp)
jmp 0xd620
movb -0x21(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)