LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: jswaff[P]prophet3/test/init__test.cpp
// Function: test_hamming_distance()
void test_hamming_distance() {
    assert(hamming_distance(0,0)==0);
    assert(hamming_distance(0,1)==1);
    assert(hamming_distance(0,3)==2);
    assert(hamming_distance(7,1)==2);

    uint64 max32 = 4294967295UL;
    assert(hamming_distance(0,max32)==32);

    uint64 max64 = 18446744073709551615UL;

    assert(hamming_distance(0,max64)==64);
    assert(hamming_distance(max64,0)==64);

    assert(hamming_distance(max32,max64)==32);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
xorl %eax, %eax
movl %eax, %esi
movq %rsi, %rdi
callq 0x214a0
cmpl $0x0, %eax
jne 0x2154b
jmp 0x2156a
leaq 0x1d67a(%rip), %rdi     # 0x3ebcc
leaq 0x1d637(%rip), %rsi     # 0x3eb90
movl $0x1e, %edx
leaq 0x1d680(%rip), %rcx     # 0x3ebe5
callq 0x20c0
xorl %eax, %eax
movl %eax, %edi
movl $0x1, %esi
callq 0x214a0
cmpl $0x1, %eax
jne 0x2157f
jmp 0x2159e
leaq 0x1d67c(%rip), %rdi     # 0x3ec02
leaq 0x1d603(%rip), %rsi     # 0x3eb90
movl $0x1f, %edx
leaq 0x1d64c(%rip), %rcx     # 0x3ebe5
callq 0x20c0
xorl %eax, %eax
movl %eax, %edi
movl $0x3, %esi
callq 0x214a0
cmpl $0x2, %eax
jne 0x215b3
jmp 0x215d2
leaq 0x1d661(%rip), %rdi     # 0x3ec1b
leaq 0x1d5cf(%rip), %rsi     # 0x3eb90
movl $0x20, %edx
leaq 0x1d618(%rip), %rcx     # 0x3ebe5
callq 0x20c0
movl $0x7, %edi
movl $0x1, %esi
callq 0x214a0
cmpl $0x2, %eax
jne 0x215e8
jmp 0x21607
leaq 0x1d645(%rip), %rdi     # 0x3ec34
leaq 0x1d59a(%rip), %rsi     # 0x3eb90
movl $0x21, %edx
leaq 0x1d5e3(%rip), %rcx     # 0x3ebe5
callq 0x20c0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edi
callq 0x214a0
cmpl $0x20, %eax
jne 0x21624
jmp 0x21643
leaq 0x1d622(%rip), %rdi     # 0x3ec4d
leaq 0x1d55e(%rip), %rsi     # 0x3eb90
movl $0x24, %edx
leaq 0x1d5a7(%rip), %rcx     # 0x3ebe5
callq 0x20c0
movq $-0x1, -0x10(%rbp)
movq -0x10(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edi
callq 0x214a0
cmpl $0x40, %eax
jne 0x2165f
jmp 0x2167e
leaq 0x1d605(%rip), %rdi     # 0x3ec6b
leaq 0x1d523(%rip), %rsi     # 0x3eb90
movl $0x28, %edx
leaq 0x1d56c(%rip), %rcx     # 0x3ebe5
callq 0x20c0
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x214a0
cmpl $0x40, %eax
jne 0x21692
jmp 0x216b1
leaq 0x1d5f0(%rip), %rdi     # 0x3ec89
leaq 0x1d4f0(%rip), %rsi     # 0x3eb90
movl $0x29, %edx
leaq 0x1d539(%rip), %rcx     # 0x3ebe5
callq 0x20c0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x214a0
cmpl $0x20, %eax
jne 0x216c5
jmp 0x216e4
leaq 0x1d5db(%rip), %rdi     # 0x3eca7
leaq 0x1d4bd(%rip), %rsi     # 0x3eb90
movl $0x2b, %edx
leaq 0x1d506(%rip), %rcx     # 0x3ebe5
callq 0x20c0
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: jswaff[P]prophet3/test/init__test.cpp
// Function: test_bb_files()
void test_bb_files() {
    assert(bb_files[FILE_A]==
            (bb_squares[A1] | bb_squares[A2] | bb_squares[A3] | bb_squares[A4]
           | bb_squares[A5] | bb_squares[A6] | bb_squares[A7] | bb_squares[A8]));
    assert(bb_files[FILE_E]==
            (bb_squares[E1] | bb_squares[E2] | bb_squares[E3] | bb_squares[E4]
           | bb_squares[E5] | bb_squares[E6] | bb_squares[E7] | bb_squares[E8]));
    assert(bb_files[FILE_H]==
            (bb_squares[H1] | bb_squares[H2] | bb_squares[H3] | bb_squares[H4]
           | bb_squares[H5] | bb_squares[H6] | bb_squares[H7] | bb_squares[H8]));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0xe3685(%rip), %rax     # 0x1055f0
movq (%rax), %rax
leaq 0xe36fb(%rip), %rcx     # 0x105670
movq 0x1c0(%rcx), %rcx
leaq 0xe36ed(%rip), %rdx     # 0x105670
orq 0x180(%rdx), %rcx
leaq 0xe36df(%rip), %rdx     # 0x105670
orq 0x140(%rdx), %rcx
leaq 0xe36d1(%rip), %rdx     # 0x105670
orq 0x100(%rdx), %rcx
leaq 0xe36c3(%rip), %rdx     # 0x105670
orq 0xc0(%rdx), %rcx
leaq 0xe36b5(%rip), %rdx     # 0x105670
orq 0x80(%rdx), %rcx
leaq 0xe36a7(%rip), %rdx     # 0x105670
orq 0x40(%rdx), %rcx
leaq 0xe369c(%rip), %rdx     # 0x105670
orq (%rdx), %rcx
cmpq %rcx, %rax
jne 0x21fde
jmp 0x21ffd
leaq 0x1cdf0(%rip), %rdi     # 0x3edd5
leaq 0x1cba4(%rip), %rsi     # 0x3eb90
movl $0x94, %edx
leaq 0x1ce78(%rip), %rcx     # 0x3ee70
callq 0x20c0
leaq 0xe35ec(%rip), %rax     # 0x1055f0
movq 0x20(%rax), %rax
leaq 0xe3661(%rip), %rcx     # 0x105670
movq 0x1e0(%rcx), %rcx
leaq 0xe3653(%rip), %rdx     # 0x105670
orq 0x1a0(%rdx), %rcx
leaq 0xe3645(%rip), %rdx     # 0x105670
orq 0x160(%rdx), %rcx
leaq 0xe3637(%rip), %rdx     # 0x105670
orq 0x120(%rdx), %rcx
leaq 0xe3629(%rip), %rdx     # 0x105670
orq 0xe0(%rdx), %rcx
leaq 0xe361b(%rip), %rdx     # 0x105670
orq 0xa0(%rdx), %rcx
leaq 0xe360d(%rip), %rdx     # 0x105670
orq 0x60(%rdx), %rcx
leaq 0xe3602(%rip), %rdx     # 0x105670
orq 0x20(%rdx), %rcx
cmpq %rcx, %rax
jne 0x22079
jmp 0x22098
leaq 0x1ce05(%rip), %rdi     # 0x3ee85
leaq 0x1cb09(%rip), %rsi     # 0x3eb90
movl $0x97, %edx
leaq 0x1cddd(%rip), %rcx     # 0x3ee70
callq 0x20c0
leaq 0xe3551(%rip), %rax     # 0x1055f0
movq 0x38(%rax), %rax
leaq 0xe35c6(%rip), %rcx     # 0x105670
movq 0x1f8(%rcx), %rcx
leaq 0xe35b8(%rip), %rdx     # 0x105670
orq 0x1b8(%rdx), %rcx
leaq 0xe35aa(%rip), %rdx     # 0x105670
orq 0x178(%rdx), %rcx
leaq 0xe359c(%rip), %rdx     # 0x105670
orq 0x138(%rdx), %rcx
leaq 0xe358e(%rip), %rdx     # 0x105670
orq 0xf8(%rdx), %rcx
leaq 0xe3580(%rip), %rdx     # 0x105670
orq 0xb8(%rdx), %rcx
leaq 0xe3572(%rip), %rdx     # 0x105670
orq 0x78(%rdx), %rcx
leaq 0xe3567(%rip), %rdx     # 0x105670
orq 0x38(%rdx), %rcx
cmpq %rcx, %rax
jne 0x22114
jmp 0x22133
leaq 0x1ce05(%rip), %rdi     # 0x3ef20
leaq 0x1ca6e(%rip), %rsi     # 0x3eb90
movl $0x9a, %edx
leaq 0x1cd42(%rip), %rcx     # 0x3ee70
callq 0x20c0
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jswaff[P]prophet3/test/init__test.cpp
// Function: test_init()
void test_init() {
    test_hamming_distance();
    test_zkeys();
    test_bb_squares();
    test_bb_files();
    test_bb_ranks();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0x21530
callq 0x216f0
callq 0x22340
callq 0x21f60
callq 0x22140
popq %rbp
retq
nop
// File: jswaff[P]prophet3/test/magic__test.cpp
// Function: test_bishop_moves()
void test_bishop_moves() {
    position pos;
    set_pos(&pos,"8/1r3k2/8/3bB3/8/8/8/3K4 b - - 0 1");

    uint64 bishop_moves = get_bishop_moves(&pos,E5,pos.black_pieces);
    assert(bishop_moves==0);

    bishop_moves = get_bishop_moves(&pos,D5,pos.black_pieces);
    assert(bishop_moves==(bb_squares[B7] | bb_squares[F7]));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
leaq -0x1c8(%rbp), %rdi
leaq 0x1785c(%rip), %rsi     # 0x39c85
callq 0xf3e0
movq -0x18(%rbp), %rdx
leaq -0x1c8(%rbp), %rdi
movl $0x1c, %esi
callq 0x8fc0
movq %rax, -0x1d0(%rbp)
cmpq $0x0, -0x1d0(%rbp)
jne 0x22456
jmp 0x22475
leaq 0x1cda5(%rip), %rdi     # 0x3f202
leaq 0x1cdae(%rip), %rsi     # 0x3f212
movl $0x11, %edx
leaq 0x1cdb7(%rip), %rcx     # 0x3f227
callq 0x20c0
movq -0x18(%rbp), %rdx
leaq -0x1c8(%rbp), %rdi
movl $0x1b, %esi
callq 0x8fc0
movq %rax, -0x1d0(%rbp)
movq -0x1d0(%rbp), %rax
leaq 0xe31d1(%rip), %rcx     # 0x105670
movq 0x48(%rcx), %rcx
leaq 0xe31c6(%rip), %rdx     # 0x105670
orq 0x68(%rdx), %rcx
cmpq %rcx, %rax
jne 0x224b5
jmp 0x224d4
leaq 0x1cd84(%rip), %rdi     # 0x3f240
leaq 0x1cd4f(%rip), %rsi     # 0x3f212
movl $0x14, %edx
leaq 0x1cd58(%rip), %rcx     # 0x3f227
callq 0x20c0
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
nopl (%rax)
// File: jswaff[P]prophet3/test/magic__test.cpp
// Function: test_rook_moves()
void test_rook_moves() {
    position pos;
    set_pos(&pos,"8/1r3k2/8/3bB3/8/8/8/3K4 b - - 0 1");

    uint64 rook_moves = get_rook_moves(&pos,B7,pos.black_pieces);
    assert(rook_moves==bb_squares[F7]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
leaq -0x1c8(%rbp), %rdi
leaq 0x1778c(%rip), %rsi     # 0x39c85
callq 0xf3e0
movq -0x18(%rbp), %rdx
leaq -0x1c8(%rbp), %rdi
movl $0x9, %esi
callq 0x9170
movq %rax, -0x1d0(%rbp)
movq -0x1d0(%rbp), %rax
leaq 0xe3148(%rip), %rcx     # 0x105670
cmpq 0x68(%rcx), %rax
jne 0x22530
jmp 0x2254f
leaq 0x1cd39(%rip), %rdi     # 0x3f270
leaq 0x1ccd4(%rip), %rsi     # 0x3f212
movl $0x1c, %edx
leaq 0x1cd41(%rip), %rcx     # 0x3f28b
callq 0x20c0
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
nopl (%rax,%rax)
// File: jswaff[P]prophet3/test/move__test.cpp
// Function: test_to_move()
void test_to_move() {
    move mv = to_move(PAWN,E2,E4);
    assert(get_piece(mv)==PAWN);
    assert(get_from_sq(mv)==E2);
    assert(get_to_sq(mv)==E4);
    assert(!is_epcapture(mv));
    assert(!is_capture(mv));
    assert(!is_castle(mv));
    assert(get_promopiece(mv)==NO_PIECE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x1, %edi
movl $0x34, %esi
movl $0x24, %edx
callq 0xa830
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0xaac0
cmpl $0x1, %eax
jne 0x225a0
jmp 0x225bf
leaq 0x1c064(%rip), %rdi     # 0x3e60b
leaq 0x1ccf4(%rip), %rsi     # 0x3f2a2
movl $0xf, %edx
leaq 0x1ccfc(%rip), %rcx     # 0x3f2b6
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xaa80
cmpl $0x34, %eax
jne 0x225cf
jmp 0x225ee
leaq 0x1ccf4(%rip), %rdi     # 0x3f2ca
leaq 0x1ccc5(%rip), %rsi     # 0x3f2a2
movl $0x10, %edx
leaq 0x1cccd(%rip), %rcx     # 0x3f2b6
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xaaa0
cmpl $0x24, %eax
jne 0x225fe
jmp 0x2261d
leaq 0x1ccd9(%rip), %rdi     # 0x3f2de
leaq 0x1cc96(%rip), %rsi     # 0x3f2a2
movl $0x11, %edx
leaq 0x1cc9e(%rip), %rcx     # 0x3f2b6
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xab50
xorb $-0x1, %al
testb $0x1, %al
jne 0x2262e
jmp 0x22630
jmp 0x2264f
leaq 0x1ccb9(%rip), %rdi     # 0x3f2f0
leaq 0x1cc64(%rip), %rsi     # 0x3f2a2
movl $0x12, %edx
leaq 0x1cc6c(%rip), %rcx     # 0x3f2b6
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xab20
xorb $-0x1, %al
testb $0x1, %al
jne 0x22660
jmp 0x22662
jmp 0x22681
leaq 0x1cc99(%rip), %rdi     # 0x3f302
leaq 0x1cc32(%rip), %rsi     # 0x3f2a2
movl $0x13, %edx
leaq 0x1cc3a(%rip), %rcx     # 0x3f2b6
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xab70
xorb $-0x1, %al
testb $0x1, %al
jne 0x22692
jmp 0x22694
jmp 0x226b3
leaq 0x1cc77(%rip), %rdi     # 0x3f312
leaq 0x1cc00(%rip), %rsi     # 0x3f2a2
movl $0x14, %edx
leaq 0x1cc08(%rip), %rcx     # 0x3f2b6
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xaae0
cmpl $0x0, %eax
jne 0x226c3
jmp 0x226e2
leaq 0x1cc57(%rip), %rdi     # 0x3f321
leaq 0x1cbd1(%rip), %rsi     # 0x3f2a2
movl $0x15, %edx
leaq 0x1cbd9(%rip), %rcx     # 0x3f2b6
callq 0x20c0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: jswaff[P]prophet3/test/move__test.cpp
// Function: test_set_epcapture()
void test_set_epcapture() {
    move mv = to_move(PAWN,D4,C3);
    set_epcapture(&mv);
    assert(get_piece(mv)==PAWN);
    assert(get_from_sq(mv)==D4);
    assert(get_to_sq(mv)==C3);
    assert(is_epcapture(mv));
    assert(is_capture(mv));
    assert(get_captured_piece(mv)==PAWN);
    assert(!is_castle(mv));
    assert(get_promopiece(mv)==NO_PIECE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x1, %edi
movl $0x23, %esi
movl $0x2a, %edx
callq 0xa830
movq %rax, -0x8(%rbp)
leaq -0x8(%rbp), %rdi
callq 0xaa20
movq -0x8(%rbp), %rdi
callq 0xaac0
cmpl $0x1, %eax
jne 0x230d9
jmp 0x230f8
leaq 0x1b52b(%rip), %rdi     # 0x3e60b
leaq 0x1c1bb(%rip), %rsi     # 0x3f2a2
movl $0x62, %edx
leaq 0x1c399(%rip), %rcx     # 0x3f48c
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xaa80
cmpl $0x23, %eax
jne 0x23108
jmp 0x23127
leaq 0x1c397(%rip), %rdi     # 0x3f4a6
leaq 0x1c18c(%rip), %rsi     # 0x3f2a2
movl $0x63, %edx
leaq 0x1c36a(%rip), %rcx     # 0x3f48c
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xaaa0
cmpl $0x2a, %eax
jne 0x23137
jmp 0x23156
leaq 0x1c37c(%rip), %rdi     # 0x3f4ba
leaq 0x1c15d(%rip), %rsi     # 0x3f2a2
movl $0x64, %edx
leaq 0x1c33b(%rip), %rcx     # 0x3f48c
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xab50
testb $0x1, %al
jne 0x23165
jmp 0x23167
jmp 0x23186
leaq 0x1c183(%rip), %rdi     # 0x3f2f1
leaq 0x1c12d(%rip), %rsi     # 0x3f2a2
movl $0x65, %edx
leaq 0x1c30b(%rip), %rcx     # 0x3f48c
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xab20
testb $0x1, %al
jne 0x23195
jmp 0x23197
jmp 0x231b6
leaq 0x1c165(%rip), %rdi     # 0x3f303
leaq 0x1c0fd(%rip), %rsi     # 0x3f2a2
movl $0x66, %edx
leaq 0x1c2db(%rip), %rcx     # 0x3f48c
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xab00
cmpl $0x1, %eax
jne 0x231c6
jmp 0x231e5
leaq 0x1c2a2(%rip), %rdi     # 0x3f46f
leaq 0x1c0ce(%rip), %rsi     # 0x3f2a2
movl $0x67, %edx
leaq 0x1c2ac(%rip), %rcx     # 0x3f48c
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xab70
xorb $-0x1, %al
testb $0x1, %al
jne 0x231f6
jmp 0x231f8
jmp 0x23217
leaq 0x1c113(%rip), %rdi     # 0x3f312
leaq 0x1c09c(%rip), %rsi     # 0x3f2a2
movl $0x68, %edx
leaq 0x1c27a(%rip), %rcx     # 0x3f48c
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xaae0
cmpl $0x0, %eax
jne 0x23227
jmp 0x23246
leaq 0x1c0f3(%rip), %rdi     # 0x3f321
leaq 0x1c06d(%rip), %rsi     # 0x3f2a2
movl $0x69, %edx
leaq 0x1c24b(%rip), %rcx     # 0x3f48c
callq 0x20c0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: jswaff[P]prophet3/test/move__test.cpp
// Function: test_set_castle()
void test_set_castle() {
    move mv = to_move(KING,E1,H1);
    set_castle(&mv);
    assert(get_piece(mv)==KING);
    assert(get_from_sq(mv)==E1);
    assert(get_to_sq(mv)==H1);
    assert(!is_epcapture(mv));
    assert(!is_capture(mv));
    assert(is_castle(mv));
    assert(get_promopiece(mv)==NO_PIECE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x6, %edi
movl $0x3c, %esi
movl $0x3f, %edx
callq 0xa830
movq %rax, -0x8(%rbp)
leaq -0x8(%rbp), %rdi
callq 0xaa60
movq -0x8(%rbp), %rdi
callq 0xaac0
cmpl $0x6, %eax
jne 0x23289
jmp 0x232a8
leaq 0x1c23c(%rip), %rdi     # 0x3f4cc
leaq 0x1c00b(%rip), %rsi     # 0x3f2a2
movl $0x6f, %edx
leaq 0x1c23d(%rip), %rcx     # 0x3f4e0
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xaa80
cmpl $0x3c, %eax
jne 0x232b8
jmp 0x232d7
leaq 0x1c238(%rip), %rdi     # 0x3f4f7
leaq 0x1bfdc(%rip), %rsi     # 0x3f2a2
movl $0x70, %edx
leaq 0x1c20e(%rip), %rcx     # 0x3f4e0
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xaaa0
cmpl $0x3f, %eax
jne 0x232e7
jmp 0x23306
leaq 0x1c21d(%rip), %rdi     # 0x3f50b
leaq 0x1bfad(%rip), %rsi     # 0x3f2a2
movl $0x71, %edx
leaq 0x1c1df(%rip), %rcx     # 0x3f4e0
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xab50
xorb $-0x1, %al
testb $0x1, %al
jne 0x23317
jmp 0x23319
jmp 0x23338
leaq 0x1bfd0(%rip), %rdi     # 0x3f2f0
leaq 0x1bf7b(%rip), %rsi     # 0x3f2a2
movl $0x72, %edx
leaq 0x1c1ad(%rip), %rcx     # 0x3f4e0
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xab20
xorb $-0x1, %al
testb $0x1, %al
jne 0x23349
jmp 0x2334b
jmp 0x2336a
leaq 0x1bfb0(%rip), %rdi     # 0x3f302
leaq 0x1bf49(%rip), %rsi     # 0x3f2a2
movl $0x73, %edx
leaq 0x1c17b(%rip), %rcx     # 0x3f4e0
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xab70
testb $0x1, %al
jne 0x23379
jmp 0x2337b
jmp 0x2339a
leaq 0x1bf91(%rip), %rdi     # 0x3f313
leaq 0x1bf19(%rip), %rsi     # 0x3f2a2
movl $0x74, %edx
leaq 0x1c14b(%rip), %rcx     # 0x3f4e0
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xaae0
cmpl $0x0, %eax
jne 0x233aa
jmp 0x233c9
leaq 0x1bf70(%rip), %rdi     # 0x3f321
leaq 0x1beea(%rip), %rsi     # 0x3f2a2
movl $0x75, %edx
leaq 0x1c11c(%rip), %rcx     # 0x3f4e0
callq 0x20c0
addq $0x10, %rsp
popq %rbp
retq
nop
// File: jswaff[P]prophet3/test/move__test.cpp
// Function: test_move()
void test_move() {
    test_to_move();
    test_set_promopiece();
    test_set_capture();
    test_set_epcapture();
    test_set_castle();
    test_move_score();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0x22570
callq 0x226f0
callq 0x22d60
callq 0x230a0
callq 0x23250
callq 0x233d0
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: jswaff[P]prophet3/test/movegen__test.cpp
// Function: test_gen_knight_moves()
void test_gen_knight_moves() {
    position pos;
    reset_pos(&pos);

    move moves[10];
    move *mp = gen_knight_moves(moves,&pos,B1,true,true);
    mp = gen_knight_moves(mp,&pos,G1,true,true);

    assert((mp - moves) == 4);
    assert(is_in_move_list(to_move(KNIGHT,B1,A3),moves,mp));
    assert(is_in_move_list(to_move(KNIGHT,B1,C3),moves,mp));
    assert(is_in_move_list(to_move(KNIGHT,G1,F3),moves,mp));
    assert(is_in_move_list(to_move(KNIGHT,G1,H3),moves,mp));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
leaq -0x1c8(%rbp), %rdi
callq 0xf390
leaq -0x220(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movl $0x39, %edx
movl $0x1, %r8d
movl %r8d, %ecx
callq 0xbf00
movq %rax, -0x228(%rbp)
movq -0x228(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movl $0x3e, %edx
movl $0x1, %r8d
movl %r8d, %ecx
callq 0xbf00
movq %rax, -0x228(%rbp)
movq -0x228(%rbp), %rax
leaq -0x220(%rbp), %rcx
subq %rcx, %rax
sarq $0x3, %rax
cmpq $0x4, %rax
jne 0x236a4
jmp 0x236c3
leaq 0x1bf33(%rip), %rdi     # 0x3f5de
leaq 0x1bf3e(%rip), %rsi     # 0x3f5f0
movl $0x15, %edx
leaq 0x1bf49(%rip), %rcx     # 0x3f607
callq 0x20c0
movl $0x2, %edi
movl $0x39, %esi
movl $0x28, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x220(%rbp), %rsi
movq -0x228(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x236f3
jmp 0x236f5
jmp 0x23714
leaq 0x1bf28(%rip), %rdi     # 0x3f624
leaq 0x1beed(%rip), %rsi     # 0x3f5f0
movl $0x16, %edx
leaq 0x1bef8(%rip), %rcx     # 0x3f607
callq 0x20c0
movl $0x2, %edi
movl $0x39, %esi
movl $0x2a, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x220(%rbp), %rsi
movq -0x228(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x23744
jmp 0x23746
jmp 0x23765
leaq 0x1bf07(%rip), %rdi     # 0x3f654
leaq 0x1be9c(%rip), %rsi     # 0x3f5f0
movl $0x17, %edx
leaq 0x1bea7(%rip), %rcx     # 0x3f607
callq 0x20c0
movl $0x2, %edi
movl $0x3e, %esi
movl $0x2d, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x220(%rbp), %rsi
movq -0x228(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x23795
jmp 0x23797
jmp 0x237b6
leaq 0x1bee6(%rip), %rdi     # 0x3f684
leaq 0x1be4b(%rip), %rsi     # 0x3f5f0
movl $0x18, %edx
leaq 0x1be56(%rip), %rcx     # 0x3f607
callq 0x20c0
movl $0x2, %edi
movl $0x3e, %esi
movl $0x2f, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x220(%rbp), %rsi
movq -0x228(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x237e6
jmp 0x237e8
jmp 0x23807
leaq 0x1bec5(%rip), %rdi     # 0x3f6b4
leaq 0x1bdfa(%rip), %rsi     # 0x3f5f0
movl $0x19, %edx
leaq 0x1be05(%rip), %rcx     # 0x3f607
callq 0x20c0
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
// File: jswaff[P]prophet3/test/movegen__test.cpp
// Function: test_gen_knight_captures()
void test_gen_knight_captures() {
    position pos;
    set_pos(&pos,"4k3/8/3P1p2/8/4N3/8/8/4K3 w - - 0 1");

    move moves[10];
    move *mp = gen_knight_moves(moves,&pos,E4,true,false);

    assert((mp-moves)==1);
    assert(is_in_move_list(to_capture(KNIGHT,E4,F6,PAWN),moves,mp));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
leaq -0x1c8(%rbp), %rdi
leaq 0x1bebb(%rip), %rsi     # 0x3f6e4
callq 0xf3e0
leaq -0x220(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movl $0x24, %edx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0xbf00
movq %rax, -0x228(%rbp)
movq -0x228(%rbp), %rax
leaq -0x220(%rbp), %rcx
subq %rcx, %rax
sarq $0x3, %rax
cmpq $0x1, %rax
jne 0x23872
jmp 0x23891
leaq 0x1be8f(%rip), %rdi     # 0x3f708
leaq 0x1bd70(%rip), %rsi     # 0x3f5f0
movl $0x23, %edx
leaq 0x1be8a(%rip), %rcx     # 0x3f716
callq 0x20c0
movl $0x2, %edi
movl $0x24, %esi
movl $0x15, %edx
movl $0x1, %ecx
callq 0xa890
movq %rax, %rdi
leaq -0x220(%rbp), %rsi
movq -0x228(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x238c6
jmp 0x238c8
jmp 0x238e7
leaq 0x1be67(%rip), %rdi     # 0x3f736
leaq 0x1bd1a(%rip), %rsi     # 0x3f5f0
movl $0x24, %edx
leaq 0x1be34(%rip), %rcx     # 0x3f716
callq 0x20c0
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
// File: jswaff[P]prophet3/test/movegen__test.cpp
// Function: test_gen_bishop_captures()
void test_gen_bishop_captures() {
    position pos;
    set_pos(&pos,"4k3/2p3P1/8/4B3/4B3/3p1P2/8/4K3 w - - 0 1");

    move moves[20];
    move *mp = gen_bishop_moves(moves,&pos,E5,true,false);
    mp = gen_bishop_moves(mp,&pos,E4,true,false);

    assert((mp - moves) == 2);
    assert(is_in_move_list(to_capture(BISHOP,E5,C7,PAWN),moves,mp));
    assert(is_in_move_list(to_capture(BISHOP,E4,D3,PAWN),moves,mp));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x280, %rsp            # imm = 0x280
leaq -0x1c8(%rbp), %rdi
leaq 0x1b6d6(%rip), %rsi     # 0x3f8bf
callq 0xf3e0
leaq -0x270(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movl $0x1c, %edx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0xc0d0
movq %rax, -0x278(%rbp)
movq -0x278(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movl $0x24, %edx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0xc0d0
movq %rax, -0x278(%rbp)
movq -0x278(%rbp), %rax
leaq -0x270(%rbp), %rcx
subq %rcx, %rax
sarq $0x3, %rax
cmpq $0x2, %rax
jne 0x24259
jmp 0x24278
leaq 0x1ba29(%rip), %rdi     # 0x3fc89
leaq 0x1b389(%rip), %rsi     # 0x3f5f0
movl $0x5c, %edx
leaq 0x1ba28(%rip), %rcx     # 0x3fc9b
callq 0x20c0
movl $0x3, %edi
movl $0x1c, %esi
movl $0xa, %edx
movl $0x1, %ecx
callq 0xa890
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x242ad
jmp 0x242af
jmp 0x242ce
leaq 0x1b813(%rip), %rdi     # 0x3fac9
leaq 0x1b333(%rip), %rsi     # 0x3f5f0
movl $0x5d, %edx
leaq 0x1b9d2(%rip), %rcx     # 0x3fc9b
callq 0x20c0
movl $0x3, %edi
movl $0x24, %esi
movl $0x2b, %edx
movl $0x1, %ecx
callq 0xa890
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x24303
jmp 0x24305
jmp 0x24324
leaq 0x1b885(%rip), %rdi     # 0x3fb91
leaq 0x1b2dd(%rip), %rsi     # 0x3f5f0
movl $0x5e, %edx
leaq 0x1b97c(%rip), %rcx     # 0x3fc9b
callq 0x20c0
addq $0x280, %rsp            # imm = 0x280
popq %rbp
retq
nopl (%rax)
// File: jswaff[P]prophet3/test/movegen__test.cpp
// Function: test_gen_rook_captures()
void test_gen_rook_captures() {
    position pos;
    reset_pos(&pos);

    move moves[20];
    move *mp = gen_rook_moves(moves,&pos,H1,true,false);
    assert((mp - moves) == 0);

    set_pos(&pos,"8/8/3k1p2/8/3K4/8/1R3r2/8 b - - 0 1");

    mp = gen_rook_moves(moves,&pos,F2,true,false);
    assert((mp - moves) == 1);

    assert(is_in_move_list(to_capture(ROOK,F2,B2,ROOK),moves,mp));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x280, %rsp            # imm = 0x280
leaq -0x1c8(%rbp), %rdi
callq 0xf390
leaq -0x270(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movl $0x3f, %edx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0xc210
movq %rax, -0x278(%rbp)
movq -0x278(%rbp), %rax
leaq -0x270(%rbp), %rcx
subq %rcx, %rax
sarq $0x3, %rax
cmpq $0x0, %rax
jne 0x24d7b
jmp 0x24d9a
leaq 0x1af6f(%rip), %rdi     # 0x3fcf1
leaq 0x1a867(%rip), %rsi     # 0x3f5f0
movl $0x9b, %edx
leaq 0x1b194(%rip), %rcx     # 0x3ff29
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
leaq 0x1af76(%rip), %rsi     # 0x3fd1e
callq 0xf3e0
leaq -0x270(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movl $0x35, %edx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0xc210
movq %rax, -0x278(%rbp)
movq -0x278(%rbp), %rax
leaq -0x270(%rbp), %rcx
subq %rcx, %rax
sarq $0x3, %rax
cmpq $0x1, %rax
jne 0x24df1
jmp 0x24e10
leaq 0x1b14f(%rip), %rdi     # 0x3ff47
leaq 0x1a7f1(%rip), %rsi     # 0x3f5f0
movl $0xa0, %edx
leaq 0x1b11e(%rip), %rcx     # 0x3ff29
callq 0x20c0
movl $0x4, %ecx
movl $0x35, %esi
movl $0x31, %edx
movl %ecx, %edi
callq 0xa890
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x24e42
jmp 0x24e44
jmp 0x24e63
leaq 0x1b0a8(%rip), %rdi     # 0x3fef3
leaq 0x1a79e(%rip), %rsi     # 0x3f5f0
movl $0xa2, %edx
leaq 0x1b0cb(%rip), %rcx     # 0x3ff29
callq 0x20c0
addq $0x280, %rsp            # imm = 0x280
popq %rbp
retq
nopl (%rax)
// File: jswaff[P]prophet3/test/movegen__test.cpp
// Function: test_gen_queen_captures()
void test_gen_queen_captures() {
    position pos;
    set_pos(&pos,"8/8/3bk3/8/8/2K3Q1/8/8 w - - 0 1");

    move moves[20];
    move *mp = gen_queen_moves(moves,&pos,G3,true,false);

    assert((mp - moves) == 1);
    assert(is_in_move_list(to_capture(QUEEN,G3,D6,BISHOP),moves,mp));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x280, %rsp            # imm = 0x280
leaq -0x1c8(%rbp), %rdi
leaq 0x1a6d3(%rip), %rsi     # 0x3ff8c
callq 0xf3e0
leaq -0x270(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movl $0x2e, %edx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0xc350
movq %rax, -0x278(%rbp)
movq -0x278(%rbp), %rax
leaq -0x270(%rbp), %rcx
subq %rcx, %rax
sarq $0x3, %rax
cmpq $0x1, %rax
jne 0x25902
jmp 0x25921
leaq 0x1a63e(%rip), %rdi     # 0x3ff47
leaq 0x19ce0(%rip), %rsi     # 0x3f5f0
movl $0xe0, %edx
leaq 0x1aa05(%rip), %rcx     # 0x40321
callq 0x20c0
movl $0x5, %edi
movl $0x2e, %esi
movl $0x13, %edx
movl $0x3, %ecx
callq 0xa890
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x25956
jmp 0x25958
jmp 0x25977
leaq 0x1a989(%rip), %rdi     # 0x402e8
leaq 0x19c8a(%rip), %rsi     # 0x3f5f0
movl $0xe1, %edx
leaq 0x1a9af(%rip), %rcx     # 0x40321
callq 0x20c0
addq $0x280, %rsp            # imm = 0x280
popq %rbp
retq
// File: jswaff[P]prophet3/test/movegen__test.cpp
// Function: test_gen_king_captures()
void test_gen_king_captures() {
    position pos;

    set_pos(&pos,"8/8/3k4/2n1P3/8/8/3rP3/R3K2R b KQ - 0 1");
    move moves[20];
    move *mp = gen_king_moves(moves,&pos,true,false);
    assert((mp - moves) == 1);
    assert(is_in_move_list(to_capture(KING,D6,E5,PAWN),moves,mp));

    // flip sides
    set_pos(&pos,"8/8/3k4/2n1P3/8/8/3rP3/RN2K2R w KQ - 0 1");
    mp = gen_king_moves(moves,&pos,true,false);
    assert((mp - moves)==1);
    assert(is_in_move_list(to_capture(KING,E1,D2,ROOK),moves,mp));

    // cannot castle if king will passed through attacked square
    set_pos(&pos,"r3k2r/8/8/8/8/5Q2/8/4K3 b kq - 0 1");
    mp = gen_king_moves(moves,&pos,true,false);
    assert((mp - moves)==0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x280, %rsp            # imm = 0x280
leaq -0x1c8(%rbp), %rdi
leaq 0x1982c(%rip), %rsi     # 0x40375
callq 0xf3e0
leaq -0x270(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0xb900
movq %rax, -0x278(%rbp)
movq -0x278(%rbp), %rax
leaq -0x270(%rbp), %rcx
subq %rcx, %rax
sarq $0x3, %rax
cmpq $0x1, %rax
jne 0x26b8c
jmp 0x26bab
leaq 0x193b4(%rip), %rdi     # 0x3ff47
leaq 0x18a56(%rip), %rsi     # 0x3f5f0
movl $0x148, %edx            # imm = 0x148
leaq 0x19d13(%rip), %rcx     # 0x408b9
callq 0x20c0
movl $0x6, %edi
movl $0x13, %esi
movl $0x1c, %edx
movl $0x1, %ecx
callq 0xa890
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x26be0
jmp 0x26be2
jmp 0x26c01
leaq 0x1986b(%rip), %rdi     # 0x40454
leaq 0x18a00(%rip), %rsi     # 0x3f5f0
movl $0x149, %edx            # imm = 0x149
leaq 0x19cbd(%rip), %rcx     # 0x408b9
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
leaq 0x14058(%rip), %rsi     # 0x3ac67
callq 0xf3e0
leaq -0x270(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0xb900
movq %rax, -0x278(%rbp)
movq -0x278(%rbp), %rax
leaq -0x270(%rbp), %rcx
subq %rcx, %rax
sarq $0x3, %rax
cmpq $0x1, %rax
jne 0x26c52
jmp 0x26c71
leaq 0x19c7e(%rip), %rdi     # 0x408d7
leaq 0x18990(%rip), %rsi     # 0x3f5f0
movl $0x14e, %edx            # imm = 0x14E
leaq 0x19c4d(%rip), %rcx     # 0x408b9
callq 0x20c0
movl $0x6, %edi
movl $0x3c, %esi
movl $0x33, %edx
movl $0x4, %ecx
callq 0xa890
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x26ca6
jmp 0x26ca8
jmp 0x26cc7
leaq 0x198ff(%rip), %rdi     # 0x405ae
leaq 0x1893a(%rip), %rsi     # 0x3f5f0
movl $0x14f, %edx            # imm = 0x14F
leaq 0x19bf7(%rip), %rcx     # 0x408b9
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
leaq 0x13ff2(%rip), %rsi     # 0x3acc7
callq 0xf3e0
leaq -0x270(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0xb900
movq %rax, -0x278(%rbp)
movq -0x278(%rbp), %rax
leaq -0x270(%rbp), %rcx
subq %rcx, %rax
sarq $0x3, %rax
cmpq $0x0, %rax
jne 0x26d18
jmp 0x26d37
leaq 0x19bc8(%rip), %rdi     # 0x408e7
leaq 0x188ca(%rip), %rsi     # 0x3f5f0
movl $0x154, %edx            # imm = 0x154
leaq 0x19b87(%rip), %rcx     # 0x408b9
callq 0x20c0
addq $0x280, %rsp            # imm = 0x280
popq %rbp
retq
// File: jswaff[P]prophet3/test/movegen__test.cpp
// Function: test_gen_pawn_noncaps()
void test_gen_pawn_noncaps() {
    position pos;
    set_pos(&pos,"2b1k3/PP6/8/3pP3/4P3/8/6P1/4K3 w - d6 0 1");
    move moves[20],*mp;

    mp = gen_pawn_moves(moves,&pos,false,true);

    assert((mp - moves)==3);
    assert(is_in_move_list(to_move(PAWN,G2,G3),moves,mp));
    assert(is_in_move_list(to_move(PAWN,G2,G4),moves,mp));
    assert(is_in_move_list(to_move(PAWN,E5,E6),moves,mp));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x280, %rsp            # imm = 0x280
leaq -0x1c8(%rbp), %rdi
leaq 0x18a21(%rip), %rsi     # 0x4092a
callq 0xf3e0
leaq -0x270(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
xorl %edx, %edx
movl $0x1, %ecx
callq 0xae70
movq %rax, -0x278(%rbp)
movq -0x278(%rbp), %rax
leaq -0x270(%rbp), %rcx
subq %rcx, %rax
sarq $0x3, %rax
cmpq $0x3, %rax
jne 0x27f4c
jmp 0x27f6b
leaq 0x186ca(%rip), %rdi     # 0x4061d
leaq 0x17696(%rip), %rsi     # 0x3f5f0
movl $0x1e7, %edx            # imm = 0x1E7
leaq 0x18b40(%rip), %rcx     # 0x40aa6
callq 0x20c0
movl $0x1, %edi
movl $0x36, %esi
movl $0x2e, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x27f9b
jmp 0x27f9d
jmp 0x27fbc
leaq 0x189dc(%rip), %rdi     # 0x40980
leaq 0x17645(%rip), %rsi     # 0x3f5f0
movl $0x1e8, %edx            # imm = 0x1E8
leaq 0x18aef(%rip), %rcx     # 0x40aa6
callq 0x20c0
movl $0x1, %edi
movl $0x36, %esi
movl $0x26, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x27fec
jmp 0x27fee
jmp 0x2800d
leaq 0x189b9(%rip), %rdi     # 0x409ae
leaq 0x175f4(%rip), %rsi     # 0x3f5f0
movl $0x1e9, %edx            # imm = 0x1E9
leaq 0x18a9e(%rip), %rcx     # 0x40aa6
callq 0x20c0
movl $0x1, %edi
movl $0x1c, %esi
movl $0x14, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x2803d
jmp 0x2803f
jmp 0x2805e
leaq 0x18996(%rip), %rdi     # 0x409dc
leaq 0x175a3(%rip), %rsi     # 0x3f5f0
movl $0x1ea, %edx            # imm = 0x1EA
leaq 0x18a4d(%rip), %rcx     # 0x40aa6
callq 0x20c0
addq $0x280, %rsp            # imm = 0x280
popq %rbp
retq
nopw (%rax,%rax)
// File: jswaff[P]prophet3/test/movegen__test.cpp
// Function: test_gen_moves()
void test_gen_moves() {
    position pos;
    reset_pos(&pos);
    move moves[50],*mp;

    mp = gen_moves(moves,&pos,true,true);
    assert((mp-moves)==20);

    set_pos(&pos,"rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1");
    mp = gen_moves(moves,&pos,true,true);
    assert((mp-moves)==20);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x370, %rsp            # imm = 0x370
leaq -0x1c8(%rbp), %rdi
callq 0xf390
leaq -0x360(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movl $0x1, %ecx
movl %ecx, %edx
callq 0xad70
movq %rax, -0x368(%rbp)
movq -0x368(%rbp), %rax
leaq -0x360(%rbp), %rcx
subq %rcx, %rax
sarq $0x3, %rax
cmpq $0x14, %rax
jne 0x280c5
jmp 0x280e4
leaq 0x189f7(%rip), %rdi     # 0x40ac3
leaq 0x1751d(%rip), %rsi     # 0x3f5f0
movl $0x1f4, %edx            # imm = 0x1F4
leaq 0x189f3(%rip), %rcx     # 0x40ad2
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
leaq 0x111f9(%rip), %rsi     # 0x392eb
callq 0xf3e0
leaq -0x360(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movl $0x1, %ecx
movl %ecx, %edx
callq 0xad70
movq %rax, -0x368(%rbp)
movq -0x368(%rbp), %rax
leaq -0x360(%rbp), %rcx
subq %rcx, %rax
sarq $0x3, %rax
cmpq $0x14, %rax
jne 0x28135
jmp 0x28154
leaq 0x18987(%rip), %rdi     # 0x40ac3
leaq 0x174ad(%rip), %rsi     # 0x3f5f0
movl $0x1f8, %edx            # imm = 0x1F8
leaq 0x18983(%rip), %rcx     # 0x40ad2
callq 0x20c0
addq $0x370, %rsp            # imm = 0x370
popq %rbp
retq
nopl (%rax)
// File: jswaff[P]prophet3/test/movegen__test.cpp
// Function: test_gen_legal_moves()
void test_gen_legal_moves() {
    position pos;
    set_pos(&pos,"7k/4Bp1p/8/8/8/8/8/1K4R1 b - - 0 1");
    move moves[50],*mp;
    mp = gen_legal_moves(moves,&pos,true,true);
    assert(num_moves(moves,mp,true,true)==4);

    set_pos(&pos,"rnb1k2r/ppq1n3/2pppp2/6pp/2PP3N/P2BP3/2PB1PPP/R2Q1RK1 w kq - -");
    assert(is_legal_move(to_move(KNIGHT,H4,G6),&pos));

    set_pos(&pos,"r2r2k1/1p2p1b1/1pp1b1pp/4P2n/PP3p1p/2P2N2/5PP1/R3KBNR b KQ b3 -");
    assert(is_legal_move(to_move(BISHOP,E6,B3),&pos));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x370, %rsp            # imm = 0x370
leaq -0x1c8(%rbp), %rdi
leaq 0x1896f(%rip), %rsi     # 0x40ae8
callq 0xf3e0
leaq -0x360(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movl $0x1, %ecx
movl %ecx, %edx
callq 0xac70
movq %rax, -0x368(%rbp)
leaq -0x360(%rbp), %rdi
movq -0x368(%rbp), %rsi
movl $0x1, %ecx
movl %ecx, %edx
callq 0x14d00
cmpl $0x4, %eax
jne 0x281c0
jmp 0x281df
leaq 0x18944(%rip), %rdi     # 0x40b0b
leaq 0x17422(%rip), %rsi     # 0x3f5f0
movl $0x200, %edx            # imm = 0x200
leaq 0x18952(%rip), %rcx     # 0x40b2c
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
leaq 0x1895b(%rip), %rsi     # 0x40b48
callq 0xf3e0
movl $0x2, %edi
movl $0x27, %esi
movl $0x16, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x14a90
testb $0x1, %al
jne 0x2821b
jmp 0x2821d
jmp 0x2823c
leaq 0x18963(%rip), %rdi     # 0x40b87
leaq 0x173c5(%rip), %rsi     # 0x3f5f0
movl $0x203, %edx            # imm = 0x203
leaq 0x188f5(%rip), %rcx     # 0x40b2c
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
leaq 0x18967(%rip), %rsi     # 0x40bb1
callq 0xf3e0
movl $0x3, %edi
movl $0x14, %esi
movl $0x29, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x14a90
testb $0x1, %al
jne 0x28278
jmp 0x2827a
jmp 0x28299
leaq 0x18970(%rip), %rdi     # 0x40bf1
leaq 0x17368(%rip), %rsi     # 0x3f5f0
movl $0x206, %edx            # imm = 0x206
leaq 0x18898(%rip), %rcx     # 0x40b2c
callq 0x20c0
addq $0x370, %rsp            # imm = 0x370
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jswaff[P]prophet3/test/movegen__test.cpp
// Function: test_movegen()
void test_movegen() {
    test_gen_knight_moves();
    test_gen_knight_captures();
    test_gen_knight_noncaptures();
    test_gen_bishop_moves();
    test_gen_bishop_captures();
    test_gen_bishop_noncaptures();
    test_gen_rook_moves();
    test_gen_rook_captures();
    test_gen_rook_noncaptures();
    test_gen_queen_moves();
    test_gen_queen_captures();
    test_gen_queen_noncaptures();
    test_gen_king_moves();
    test_gen_king_captures();
    test_gen_king_noncaptures();
    test_gen_pawn_moves();
    test_gen_pawn_captures();
    test_gen_pawn_noncaps();
    test_gen_moves();
    test_gen_legal_moves();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0x23620
callq 0x23810
callq 0x238f0
callq 0x23b60
callq 0x241d0
callq 0x24330
callq 0x248f0
callq 0x24d20
callq 0x24e70
callq 0x25250
callq 0x258a0
callq 0x25980
callq 0x25f70
callq 0x26b30
callq 0x26d40
callq 0x27180
callq 0x27900
callq 0x27ef0
callq 0x28070
callq 0x28160
popq %rbp
retq
nopw (%rax,%rax)
// File: jswaff[P]prophet3/test/mvvlva__test.cpp
// Function: get_highest_scoring(position*, unsigned long long*, unsigned long long*)
move get_highest_scoring(position *pos,move *startp,move *endp) {
    move* bestp = 0;
    int32 bestscore = 0;

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

    move bestmv = *bestp;
    *bestp = 0;
    return bestmv;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -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 0x283a1
movq -0x30(%rbp), %rax
cmpq $0x0, (%rax)
je 0x28391
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movq (%rax), %rsi
callq 0xc610
movl %eax, -0x34(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x28381
movl -0x34(%rbp), %eax
cmpl -0x24(%rbp), %eax
jle 0x2838f
movq -0x30(%rbp), %rax
movq %rax, -0x20(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0x28391
jmp 0x28393
movq -0x30(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x30(%rbp)
jmp 0x2834b
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
movq $0x0, (%rax)
movq -0x40(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jswaff[P]prophet3/test/mvvlva__test.cpp
// Function: test_mvvlva1()
void test_mvvlva1() {
    position pos;
    set_pos(&pos,"3r1rk1/p3qp1p/2bb2p1/2p5/3P4/1P6/PBQN1PPP/2R2RK1 b - - ");
    move moves[50],*endp;
    endp = gen_legal_moves(moves,&pos,true,true); // 46 moves

    move c5d4 = to_capture(PAWN,C5,D4,PAWN);
    move c6g2 = to_capture(BISHOP,C6,G2,PAWN);
    move d6h2 = to_capture(BISHOP,D6,H2,PAWN);

    move bestmv = get_highest_scoring(&pos,moves,endp);
    move bestmv2 = get_highest_scoring(&pos,moves,endp);
    move bestmv3 = get_highest_scoring(&pos,moves,endp);

    assert(bestmv==c5d4);
    assert(bestmv2 != bestmv3);
    assert(bestmv2==c6g2 || bestmv2==d6h2);
    assert(bestmv3==c6g2 || bestmv3==d6h2);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3a0, %rsp            # imm = 0x3A0
leaq -0x1c8(%rbp), %rdi
leaq 0x18832(%rip), %rsi     # 0x40c1b
callq 0xf3e0
leaq -0x360(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movl $0x1, %ecx
movl %ecx, %edx
callq 0xac70
movq %rax, -0x368(%rbp)
movl $0x1, %ecx
movl $0x1a, %esi
movl $0x23, %edx
movl %ecx, %edi
callq 0xa890
movq %rax, -0x370(%rbp)
movl $0x3, %edi
movl $0x12, %esi
movl $0x36, %edx
movl $0x1, %ecx
callq 0xa890
movq %rax, -0x378(%rbp)
movl $0x3, %edi
movl $0x13, %esi
movl $0x37, %edx
movl $0x1, %ecx
callq 0xa890
movq %rax, -0x380(%rbp)
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
leaq -0x1c8(%rbp), %rdi
callq 0x28320
movq %rax, -0x388(%rbp)
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
leaq -0x1c8(%rbp), %rdi
callq 0x28320
movq %rax, -0x390(%rbp)
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
leaq -0x1c8(%rbp), %rdi
callq 0x28320
movq %rax, -0x398(%rbp)
movq -0x388(%rbp), %rax
cmpq -0x370(%rbp), %rax
jne 0x284e1
jmp 0x28500
leaq 0x1876b(%rip), %rdi     # 0x40c53
leaq 0x18771(%rip), %rsi     # 0x40c60
movl $0x2e, %edx
leaq 0x1877b(%rip), %rcx     # 0x40c76
callq 0x20c0
movq -0x390(%rbp), %rax
cmpq -0x398(%rbp), %rax
je 0x28512
jmp 0x28531
leaq 0x18771(%rip), %rdi     # 0x40c8a
leaq 0x18740(%rip), %rsi     # 0x40c60
movl $0x2f, %edx
leaq 0x1874a(%rip), %rcx     # 0x40c76
callq 0x20c0
movq -0x390(%rbp), %rcx
movb $0x1, %al
cmpq -0x378(%rbp), %rcx
movb %al, -0x399(%rbp)
je 0x28560
movq -0x390(%rbp), %rax
cmpq -0x380(%rbp), %rax
sete %al
movb %al, -0x399(%rbp)
movb -0x399(%rbp), %al
testb $0x1, %al
jne 0x2856c
jmp 0x2856e
jmp 0x2858d
leaq 0x18728(%rip), %rdi     # 0x40c9d
leaq 0x186e4(%rip), %rsi     # 0x40c60
movl $0x30, %edx
leaq 0x186ee(%rip), %rcx     # 0x40c76
callq 0x20c0
movq -0x398(%rbp), %rcx
movb $0x1, %al
cmpq -0x378(%rbp), %rcx
movb %al, -0x39a(%rbp)
je 0x285bc
movq -0x398(%rbp), %rax
cmpq -0x380(%rbp), %rax
sete %al
movb %al, -0x39a(%rbp)
movb -0x39a(%rbp), %al
testb $0x1, %al
jne 0x285c8
jmp 0x285ca
jmp 0x285e9
leaq 0x186eb(%rip), %rdi     # 0x40cbc
leaq 0x18688(%rip), %rsi     # 0x40c60
movl $0x31, %edx
leaq 0x18692(%rip), %rcx     # 0x40c76
callq 0x20c0
addq $0x3a0, %rsp            # imm = 0x3A0
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jswaff[P]prophet3/test/mvvlva__test.cpp
// Function: test_mvvlva4()
void test_mvvlva4() {
    position pos;
    set_pos(&pos,"6R1/kp6/8/1KpP4/8/8/8/6B1 w - c6");

    move moves[50],*endp;
    endp = gen_legal_moves(moves,&pos,true,true); // 28 moves

    move d5c6 = to_capture(PAWN,D5,C6,PAWN);
    set_epcapture(&d5c6);

    move b5c5 = to_capture(KING,B5,C5,PAWN);
    move g1c5 = to_capture(BISHOP,G1,C5,PAWN);

    assert(is_in_move_list(d5c6,moves,endp));
    assert(is_in_move_list(b5c5,moves,endp));
    assert(is_in_move_list(g1c5,moves,endp));

    assert(get_highest_scoring(&pos,moves,endp)==d5c6);
    assert(get_highest_scoring(&pos,moves,endp)==g1c5);
    assert(get_highest_scoring(&pos,moves,endp)==b5c5);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x380, %rsp            # imm = 0x380
leaq -0x1c8(%rbp), %rdi
leaq 0x18159(%rip), %rsi     # 0x41122
callq 0xf3e0
leaq -0x360(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movl $0x1, %ecx
movl %ecx, %edx
callq 0xac70
movq %rax, -0x368(%rbp)
movl $0x1, %ecx
movl $0x1b, %esi
movl $0x12, %edx
movl %ecx, %edi
callq 0xa890
movq %rax, -0x370(%rbp)
leaq -0x370(%rbp), %rdi
callq 0xaa20
movl $0x6, %edi
movl $0x19, %esi
movl $0x1a, %edx
movl $0x1, %ecx
callq 0xa890
movq %rax, -0x378(%rbp)
movl $0x3, %edi
movl $0x3e, %esi
movl $0x1a, %edx
movl $0x1, %ecx
callq 0xa890
movq %rax, -0x380(%rbp)
movq -0x370(%rbp), %rdi
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x29078
jmp 0x2907a
jmp 0x29099
leaq 0x180c2(%rip), %rdi     # 0x41143
leaq 0x17bd8(%rip), %rsi     # 0x40c60
movl $0x95, %edx
leaq 0x180d0(%rip), %rcx     # 0x41164
callq 0x20c0
movq -0x378(%rbp), %rdi
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x290b9
jmp 0x290bb
jmp 0x290da
leaq 0x180b6(%rip), %rdi     # 0x41178
leaq 0x17b97(%rip), %rsi     # 0x40c60
movl $0x96, %edx
leaq 0x1808f(%rip), %rcx     # 0x41164
callq 0x20c0
movq -0x380(%rbp), %rdi
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x290fa
jmp 0x290fc
jmp 0x2911b
leaq 0x18096(%rip), %rdi     # 0x41199
leaq 0x17b56(%rip), %rsi     # 0x40c60
movl $0x97, %edx
leaq 0x1804e(%rip), %rcx     # 0x41164
callq 0x20c0
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
leaq -0x1c8(%rbp), %rdi
callq 0x28320
cmpq -0x370(%rbp), %rax
jne 0x29140
jmp 0x2915f
leaq 0x18073(%rip), %rdi     # 0x411ba
leaq 0x17b12(%rip), %rsi     # 0x40c60
movl $0x99, %edx
leaq 0x1800a(%rip), %rcx     # 0x41164
callq 0x20c0
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
leaq -0x1c8(%rbp), %rdi
callq 0x28320
cmpq -0x380(%rbp), %rax
jne 0x29184
jmp 0x291a3
leaq 0x1805a(%rip), %rdi     # 0x411e5
leaq 0x17ace(%rip), %rsi     # 0x40c60
movl $0x9a, %edx
leaq 0x17fc6(%rip), %rcx     # 0x41164
callq 0x20c0
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
leaq -0x1c8(%rbp), %rdi
callq 0x28320
cmpq -0x378(%rbp), %rax
jne 0x291c8
jmp 0x291e7
leaq 0x18041(%rip), %rdi     # 0x41210
leaq 0x17a8a(%rip), %rsi     # 0x40c60
movl $0x9b, %edx
leaq 0x17f82(%rip), %rcx     # 0x41164
callq 0x20c0
addq $0x380, %rsp            # imm = 0x380
popq %rbp
retq
// File: jswaff[P]prophet3/test/mvvlva__test.cpp
// Function: test_mvvlva()
void test_mvvlva() {
    test_mvvlva1();
    test_mvvlva2();
    test_mvvlva3();
    test_mvvlva4();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0x283d0
callq 0x28600
callq 0x289c0
callq 0x28fb0
popq %rbp
retq
nopw (%rax,%rax)
// File: jswaff[P]prophet3/test/next__test.cpp
// Function: test_pv()
void test_pv() {
    position pos;
    set_pos(&pos,"b2b1r1k/3R1ppp/4qP2/4p1PQ/4P3/5B2/4N1K1/8 w - - ");

    move moves[MAX_MOVES_PER_PLY];
    gen_legal_moves(moves,&pos,true,true);

    move_order_dto mo_dto;
    mo_dto.startp = mo_dto.currentp = mo_dto.endp = moves;
    mo_dto.pv_move = moves[5];
    mo_dto.hash_move = 0;
    mo_dto.killer1 = 0;
    mo_dto.killer2 = 0;
    mo_dto.next_stage = PVMOVE;

    move *nextp;
    assert(next(&pos,&nextp,&mo_dto));
    assert(*nextp==mo_dto.pv_move);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb80, %rsp            # imm = 0xB80
leaq -0x1c8(%rbp), %rdi
leaq 0x17ca0(%rip), %rsi     # 0x41399
callq 0xf3e0
leaq -0xb30(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movl $0x1, %ecx
movl %ecx, %edx
callq 0xac70
leaq -0xb30(%rbp), %rax
movq %rax, -0xb40(%rbp)
movq %rax, -0xb38(%rbp)
movq %rax, -0xb48(%rbp)
movq -0xb08(%rbp), %rax
movq %rax, -0xb68(%rbp)
movq $0x0, -0xb60(%rbp)
movq $0x0, -0xb58(%rbp)
movq $0x0, -0xb50(%rbp)
movl $0x0, -0xb70(%rbp)
leaq -0x1c8(%rbp), %rdi
leaq -0xb78(%rbp), %rsi
leaq -0xb70(%rbp), %rdx
callq 0xc670
testb $0x1, %al
jne 0x2978d
jmp 0x2978f
jmp 0x297ae
leaq 0x17d42(%rip), %rdi     # 0x414d8
leaq 0x17aad(%rip), %rsi     # 0x4124a
movl $0x50, %edx
leaq 0x17c21(%rip), %rcx     # 0x413ca
callq 0x20c0
movq -0xb78(%rbp), %rax
movq (%rax), %rax
cmpq -0xb68(%rbp), %rax
jne 0x297c3
jmp 0x297e2
leaq 0x17c0f(%rip), %rdi     # 0x413d9
leaq 0x17a79(%rip), %rsi     # 0x4124a
movl $0x51, %edx
leaq 0x17bed(%rip), %rcx     # 0x413ca
callq 0x20c0
addq $0xb80, %rsp            # imm = 0xB80
popq %rbp
retq
nopl (%rax,%rax)
// File: jswaff[P]prophet3/test/next__test.cpp
// Function: test_hash_next()
void test_hash_next() {
    position pos;
    set_pos(&pos,"1R6/1brk2p1/4p2p/p1P1Pp2/P7/6P1/1P4P1/2R3K1 w - - ");

    move moves[MAX_MOVES_PER_PLY];
    gen_legal_moves(moves,&pos,true,true);

    // randomly make the 5th move the hash move
    move_order_dto mo_dto;
    mo_dto.startp = mo_dto.currentp = mo_dto.endp = moves;
    mo_dto.pv_move = 0;
    mo_dto.hash_move = moves[5];
    mo_dto.killer1 = 0;
    mo_dto.killer2 = 0;
    mo_dto.next_stage = PVMOVE;

    move *nextp;
    assert(next(&pos,&nextp,&mo_dto));
    assert(*nextp==mo_dto.hash_move);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb80, %rsp            # imm = 0xB80
leaq -0x1c8(%rbp), %rdi
leaq 0x17be7(%rip), %rsi     # 0x413f0
callq 0xf3e0
leaq -0xb30(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movl $0x1, %ecx
movl %ecx, %edx
callq 0xac70
leaq -0xb30(%rbp), %rax
movq %rax, -0xb40(%rbp)
movq %rax, -0xb38(%rbp)
movq %rax, -0xb48(%rbp)
movq $0x0, -0xb68(%rbp)
movq -0xb08(%rbp), %rax
movq %rax, -0xb60(%rbp)
movq $0x0, -0xb58(%rbp)
movq $0x0, -0xb50(%rbp)
movl $0x0, -0xb70(%rbp)
leaq -0x1c8(%rbp), %rdi
leaq -0xb78(%rbp), %rsi
leaq -0xb70(%rbp), %rdx
callq 0xc670
testb $0x1, %al
jne 0x2989d
jmp 0x2989f
jmp 0x298be
leaq 0x17c32(%rip), %rdi     # 0x414d8
leaq 0x1799d(%rip), %rsi     # 0x4124a
movl $0x65, %edx
leaq 0x17b6a(%rip), %rcx     # 0x41423
callq 0x20c0
movq -0xb78(%rbp), %rax
movq (%rax), %rax
cmpq -0xb60(%rbp), %rax
jne 0x298d3
jmp 0x298f2
leaq 0x17b5f(%rip), %rdi     # 0x41439
leaq 0x17969(%rip), %rsi     # 0x4124a
movl $0x66, %edx
leaq 0x17b36(%rip), %rcx     # 0x41423
callq 0x20c0
addq $0xb80, %rsp            # imm = 0xB80
popq %rbp
retq
nopl (%rax,%rax)
// File: jswaff[P]prophet3/test/next__test.cpp
// Function: test_pv_then_hash()
void test_pv_then_hash() {
    position pos;
    set_pos(&pos,"6k1/p4p1p/1p3np1/2q5/4p3/4P1N1/PP3PPP/3Q2K1 w - - ");

    move moves[MAX_MOVES_PER_PLY];
    gen_legal_moves(moves,&pos,true,true);

    // make move 4 the PV move and move 2 the hash move
    move_order_dto mo_dto;
    mo_dto.startp = mo_dto.currentp = mo_dto.endp = moves;
    mo_dto.pv_move = moves[4];
    mo_dto.hash_move = moves[2];
    mo_dto.killer1 = 0;
    mo_dto.killer2 = 0;
    mo_dto.next_stage = PVMOVE;

    move *nextp;
    assert(next(&pos,&nextp,&mo_dto));
    assert(*nextp==mo_dto.pv_move);

    assert(next(&pos,&nextp,&mo_dto));
    assert(*nextp==mo_dto.hash_move);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb80, %rsp            # imm = 0xB80
leaq -0x1c8(%rbp), %rdi
leaq 0x17b39(%rip), %rsi     # 0x41452
callq 0xf3e0
leaq -0xb30(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movl $0x1, %ecx
movl %ecx, %edx
callq 0xac70
leaq -0xb30(%rbp), %rax
movq %rax, -0xb40(%rbp)
movq %rax, -0xb38(%rbp)
movq %rax, -0xb48(%rbp)
movq -0xb10(%rbp), %rax
movq %rax, -0xb68(%rbp)
movq -0xb20(%rbp), %rax
movq %rax, -0xb60(%rbp)
movq $0x0, -0xb58(%rbp)
movq $0x0, -0xb50(%rbp)
movl $0x0, -0xb70(%rbp)
leaq -0x1c8(%rbp), %rdi
leaq -0xb78(%rbp), %rsi
leaq -0xb70(%rbp), %rdx
callq 0xc670
testb $0x1, %al
jne 0x299b0
jmp 0x299b2
jmp 0x299d1
leaq 0x17b1f(%rip), %rdi     # 0x414d8
leaq 0x1788a(%rip), %rsi     # 0x4124a
movl $0x7a, %edx
leaq 0x17ab9(%rip), %rcx     # 0x41485
callq 0x20c0
movq -0xb78(%rbp), %rax
movq (%rax), %rax
cmpq -0xb68(%rbp), %rax
jne 0x299e6
jmp 0x29a05
leaq 0x179ec(%rip), %rdi     # 0x413d9
leaq 0x17856(%rip), %rsi     # 0x4124a
movl $0x7b, %edx
leaq 0x17a85(%rip), %rcx     # 0x41485
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
leaq -0xb78(%rbp), %rsi
leaq -0xb70(%rbp), %rdx
callq 0xc670
testb $0x1, %al
jne 0x29a25
jmp 0x29a27
jmp 0x29a46
leaq 0x17aaa(%rip), %rdi     # 0x414d8
leaq 0x17815(%rip), %rsi     # 0x4124a
movl $0x7d, %edx
leaq 0x17a44(%rip), %rcx     # 0x41485
callq 0x20c0
movq -0xb78(%rbp), %rax
movq (%rax), %rax
cmpq -0xb60(%rbp), %rax
jne 0x29a5b
jmp 0x29a7a
leaq 0x179d7(%rip), %rdi     # 0x41439
leaq 0x177e1(%rip), %rsi     # 0x4124a
movl $0x7e, %edx
leaq 0x17a10(%rip), %rcx     # 0x41485
callq 0x20c0
addq $0xb80, %rsp            # imm = 0xB80
popq %rbp
retq
nopw %cs:(%rax,%rax)