LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r14
pushq %rbx
subq $0x360, %rsp            # imm = 0x360
leaq 0x160d3(%rip), %rsi     # 0x32309
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1b8
leaq 0x1d0(%rsp), %r14
pushq $0x1
popq %rbp
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
movl %ebp, %ecx
callq 0x73f8
movq %r14, %rdi
movq %rax, %rsi
movl %ebp, %edx
movl %ebp, %ecx
callq 0xdb4d
cmpl $0x4, %eax
jne 0x1c2df
leaq 0x160f1(%rip), %rsi     # 0x32369
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1b8
pushq $0x2
popq %rdi
pushq $0x27
popq %rsi
pushq $0x16
popq %rdx
callq 0x7284
movq %rax, %rdi
movq %rbx, %rsi
callq 0xd9e8
testb %al, %al
je 0x1c2fe
leaq 0x16129(%rip), %rsi     # 0x323d2
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1b8
pushq $0x3
popq %rdi
pushq $0x14
popq %rsi
pushq $0x29
popq %rdx
callq 0x7284
movq %rax, %rdi
movq %rbx, %rsi
callq 0xd9e8
testb %al, %al
je 0x1c31d
addq $0x360, %rsp            # imm = 0x360
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x16046(%rip), %rdi     # 0x3232c
leaq 0x14b24(%rip), %rsi     # 0x30e11
leaq 0x16059(%rip), %rcx     # 0x3234d
movl $0x200, %edx            # imm = 0x200
callq 0x20c0
leaq 0x160a3(%rip), %rdi     # 0x323a8
leaq 0x14b05(%rip), %rsi     # 0x30e11
leaq 0x1603a(%rip), %rcx     # 0x3234d
movl $0x203, %edx            # imm = 0x203
callq 0x20c0
leaq 0x160ee(%rip), %rdi     # 0x32412
leaq 0x14ae6(%rip), %rsi     # 0x30e11
leaq 0x1601b(%rip), %rcx     # 0x3234d
movl $0x206, %edx            # imm = 0x206
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O2/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 %rax
callq 0x18574
callq 0x186d9
callq 0x1877e
callq 0x1895c
callq 0x18e5b
callq 0x18f56
callq 0x193cf
callq 0x1972d
callq 0x19824
callq 0x19b3d
callq 0x1a06a
callq 0x1a11a
callq 0x1a601
callq 0x1afdd
callq 0x1b186
callq 0x1b511
callq 0x1bb60
callq 0x1c04b
callq 0x1c172
popq %rax
jmp 0x1c224
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %r12d, %r12d
xorl %r13d, %r13d
cmpq %rbx, %r14
jae 0x1c3f6
movq (%r14), %rsi
testq %rsi, %rsi
je 0x1c3f0
movq %r15, %rdi
callq 0x844b
testq %r13, %r13
sete %cl
cmpl %r12d, %eax
setg %dl
orb %cl, %dl
movq %r14, %rcx
jne 0x1c3ea
movl %r12d, %eax
movq %r13, %rcx
movl %eax, %r12d
movq %rcx, %r13
addq $0x8, %r14
jmp 0x1c3bc
movq (%r13), %rax
andq $0x0, (%r13)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x368, %rsp            # imm = 0x368
leaq 0x1601b(%rip), %rsi     # 0x3243c
leaq 0x1a0(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1b8
leaq 0x10(%rsp), %rdi
pushq $0x1
popq %rbp
movq %rdi, %r14
movq %rbx, %rsi
movl %ebp, %edx
movl %ebp, %ecx
callq 0x73f8
movq %rax, %r15
pushq $0x1a
popq %rsi
pushq $0x23
popq %rdx
movl %ebp, %edi
movl %ebp, %ecx
callq 0x72a3
movq %rax, 0x8(%rsp)
pushq $0x3
popq %r13
pushq $0x12
popq %rsi
pushq $0x36
popq %rdx
movl %r13d, %edi
movl %ebp, %ecx
callq 0x72a3
movq %rax, %r12
pushq $0x13
popq %rsi
pushq $0x37
popq %rdx
movl %r13d, %edi
movl %ebp, %ecx
callq 0x72a3
movq %rax, %rbp
movq %rbx, %rdi
movq %r14, %r13
movq %r14, %rsi
movq %r15, %rdx
callq 0x1c3a4
movq %rax, %r14
movq %rbx, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x1c3a4
movq %rax, %r13
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
movq %r15, %rdx
callq 0x1c3a4
cmpq 0x8(%rsp), %r14
jne 0x1c4fc
cmpq %rax, %r13
je 0x1c515
cmpq %r12, %r13
sete %cl
cmpq %rbp, %r13
sete %dl
orb %cl, %dl
je 0x1c52e
cmpq %r12, %rax
sete %cl
cmpq %rbp, %rax
sete %al
orb %cl, %al
je 0x1c547
addq $0x368, %rsp            # imm = 0x368
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x15f71(%rip), %rdi     # 0x32474
leaq 0x15f77(%rip), %rsi     # 0x32481
leaq 0x15f86(%rip), %rcx     # 0x32497
pushq $0x2e
jmp 0x1c55e
leaq 0x15f8f(%rip), %rdi     # 0x324ab
leaq 0x15f5e(%rip), %rsi     # 0x32481
leaq 0x15f6d(%rip), %rcx     # 0x32497
pushq $0x2f
jmp 0x1c55e
leaq 0x15f89(%rip), %rdi     # 0x324be
leaq 0x15f45(%rip), %rsi     # 0x32481
leaq 0x15f54(%rip), %rcx     # 0x32497
pushq $0x30
jmp 0x1c55e
leaq 0x15f8f(%rip), %rdi     # 0x324dd
leaq 0x15f2c(%rip), %rsi     # 0x32481
leaq 0x15f3b(%rip), %rcx     # 0x32497
pushq $0x31
popq %rdx
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x368, %rsp            # imm = 0x368
leaq 0x15bd4(%rip), %rsi     # 0x32943
leaq 0x1a0(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1b8
leaq 0x10(%rsp), %r12
pushq $0x1
popq %rbp
movq %r12, %rdi
movq %rbx, %rsi
movl %ebp, %edx
movl %ebp, %ecx
callq 0x73f8
movq %rax, %rbx
pushq $0x1b
popq %rsi
pushq $0x12
popq %rdx
movl %ebp, %edi
movl %ebp, %ecx
callq 0x72a3
leaq 0x8(%rsp), %r13
movq %rax, (%r13)
movq %r13, %rdi
callq 0x7352
pushq $0x6
popq %rdi
pushq $0x19
popq %rsi
pushq $0x1a
popq %r15
movl %r15d, %edx
movl %ebp, %ecx
callq 0x72a3
movq %rax, %r14
pushq $0x3
popq %rdi
pushq $0x3e
popq %rsi
movl %r15d, %edx
movl %ebp, %ecx
callq 0x72a3
movq %rax, %r15
movq (%r13), %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x1ce98
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x1ceb7
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x1ced6
leaq 0x1a0(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0x1c3a4
cmpq 0x8(%rsp), %rax
jne 0x1cef5
leaq 0x1a0(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0x1c3a4
cmpq %r15, %rax
jne 0x1cf14
leaq 0x1a0(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0x1c3a4
cmpq %r14, %rax
jne 0x1cf33
addq $0x368, %rsp            # imm = 0x368
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x15ac5(%rip), %rdi     # 0x32964
leaq 0x155db(%rip), %rsi     # 0x32481
leaq 0x15ad8(%rip), %rcx     # 0x32985
movl $0x95, %edx
callq 0x20c0
leaq 0x15adb(%rip), %rdi     # 0x32999
leaq 0x155bc(%rip), %rsi     # 0x32481
leaq 0x15ab9(%rip), %rcx     # 0x32985
movl $0x96, %edx
callq 0x20c0
leaq 0x15add(%rip), %rdi     # 0x329ba
leaq 0x1559d(%rip), %rsi     # 0x32481
leaq 0x15a9a(%rip), %rcx     # 0x32985
movl $0x97, %edx
callq 0x20c0
leaq 0x15adf(%rip), %rdi     # 0x329db
leaq 0x1557e(%rip), %rsi     # 0x32481
leaq 0x15a7b(%rip), %rcx     # 0x32985
movl $0x99, %edx
callq 0x20c0
leaq 0x15aeb(%rip), %rdi     # 0x32a06
leaq 0x1555f(%rip), %rsi     # 0x32481
leaq 0x15a5c(%rip), %rcx     # 0x32985
movl $0x9a, %edx
callq 0x20c0
leaq 0x15af7(%rip), %rdi     # 0x32a31
leaq 0x15540(%rip), %rsi     # 0x32481
leaq 0x15a3d(%rip), %rcx     # 0x32985
movl $0x9b, %edx
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O2/jswaff[P]prophet3/test/mvvlva__test.cpp
// Function: test_mvvlva()
void test_mvvlva() {
    test_mvvlva1();
    test_mvvlva2();
    test_mvvlva3();
    test_mvvlva4();
}

// Assembly:
pushq %rax
callq 0x1c409
callq 0x1c564
callq 0x1c86f
popq %rax
jmp 0x1cd57
// File: /workspace/github_cpp_makefile_star2_O2/jswaff[P]prophet3/test/next__test.cpp
// Function: test_best_at_top()
void test_best_at_top() {
    position pos;
    reset_pos(&pos);

    move moves[20];
    move *endp = gen_legal_moves(moves,&pos,true,true);
    assert(endp-moves==20);

    set_move_score(moves+4,1000);
    set_move_score(moves+11,900);
    set_move_score(moves+7,-1500);
    move mv1 = moves[4];
    move mv2 = moves[11];
    move mv3 = moves[7];

    int i=0;
    for (move *mp=moves;mp<endp;mp++) {
        if (*mp != mv1 && *mp != mv2 && *mp != mv3) {
            assert(get_move_score(mp)==0);
        }
        best_at_top(mp,endp);

        if (i==0) {
            assert(*mp==mv1);
        } else if (i==1) {
            assert(*mp==mv2);
        } else if (i==19) {
            assert(*mp==mv3);
        }
        i++;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
leaq 0xa0(%rsp), %r14
movq %r14, %rdi
callq 0xa187
movq %rsp, %rbx
pushq $0x1
popq %rcx
movq %rbx, %rdi
movq %r14, %rsi
movl %ecx, %edx
callq 0x73f8
movq %rax, %r14
subq %rbx, %rax
cmpq $0xa0, %rax
jne 0x1d0c5
leaq 0x20(%rsp), %rdi
movl $0x3e8, %esi            # imm = 0x3E8
callq 0x73d3
leaq 0x58(%rsp), %rdi
movl $0x384, %esi            # imm = 0x384
callq 0x73d3
leaq 0x38(%rsp), %r15
movq %r15, %rdi
movl $0xfffffa24, %esi       # imm = 0xFFFFFA24
callq 0x73d3
movq -0x18(%r15), %r12
movq (%r15), %r13
movq 0x20(%r15), %r15
xorl %ebp, %ebp
cmpq %r14, %rbx
jae 0x1d04b
movq (%rbx), %rax
cmpq %r12, %rax
sete %cl
cmpq %r15, %rax
sete %dl
orb %cl, %dl
cmpq %r13, %rax
sete %al
orb %dl, %al
jne 0x1d017
movq %rbx, %rdi
callq 0x73b8
testl %eax, %eax
jne 0x1d05d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8de5
cmpl $0x13, %ebp
je 0x1d03e
cmpl $0x1, %ebp
je 0x1d037
testl %ebp, %ebp
jne 0x1d043
cmpq %r12, (%rbx)
je 0x1d043
jmp 0x1d076
cmpq %r15, (%rbx)
je 0x1d043
jmp 0x1d08f
cmpq %r13, (%rbx)
jne 0x1d0a8
incl %ebp
addq $0x8, %rbx
jmp 0x1cfeb
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd09e(%rip), %rdi      # 0x2a102
leaq 0x15a00(%rip), %rsi     # 0x32a6b
leaq 0x15a0d(%rip), %rcx     # 0x32a7f
pushq $0x1e
jmp 0x1d0bf
leaq 0x15a1a(%rip), %rdi     # 0x32a97
leaq 0x159e7(%rip), %rsi     # 0x32a6b
leaq 0x159f4(%rip), %rcx     # 0x32a7f
pushq $0x23
jmp 0x1d0bf
leaq 0x15a0a(%rip), %rdi     # 0x32aa0
leaq 0x159ce(%rip), %rsi     # 0x32a6b
leaq 0x159db(%rip), %rcx     # 0x32a7f
pushq $0x25
jmp 0x1d0bf
leaq 0x159fa(%rip), %rdi     # 0x32aa9
leaq 0x159b5(%rip), %rsi     # 0x32a6b
leaq 0x159c2(%rip), %rcx     # 0x32a7f
pushq $0x27
popq %rdx
callq 0x20c0
leaq 0x15990(%rip), %rdi     # 0x32a5c
leaq 0x15998(%rip), %rsi     # 0x32a6b
leaq 0x159a5(%rip), %rcx     # 0x32a7f
pushq $0x12
jmp 0x1d0bf
// File: /workspace/github_cpp_makefile_star2_O2/jswaff[P]prophet3/test/next__test.cpp
// Function: test_place_move_on_top()
void test_place_move_on_top() {
    move moves[5];
    move e2e3 = moves[0] = to_move(PAWN,E2,E3);
    move e2e4 = moves[1] = to_move(PAWN,E2,E4);
    moves[2] = BADMOVE;
    move a2a3 = moves[3] = to_move(PAWN,A2,A3);
    move g1f3 = moves[4] = to_move(KNIGHT,G1,F3);

    assert(!place_move_on_top(moves,moves+5,BADMOVE));
    assert(!place_move_on_top(moves,moves+5,to_move(PAWN,B1,B2)));
    assert(place_move_on_top(moves,moves+5,a2a3));
    assert(moves[0]==a2a3);
    assert(moves[3]==e2e3);

    assert(place_move_on_top(moves+1,moves+5,g1f3));
    assert(moves[1]==g1f3);
    assert(moves[4]==e2e4);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
pushq $0x1
popq %rbp
pushq $0x34
popq %rbx
pushq $0x2c
popq %rdx
movl %ebp, %edi
movl %ebx, %esi
callq 0x7284
movq %rax, %r15
leaq 0x28(%rsp), %r14
movq %rax, -0x28(%r14)
pushq $0x24
popq %rdx
movl %ebp, %edi
movl %ebx, %esi
callq 0x7284
movq %rax, %rbx
movq %rax, -0x20(%r14)
andq $0x0, -0x18(%r14)
pushq $0x30
popq %rsi
pushq $0x28
popq %rdx
movl %ebp, %edi
callq 0x7284
movq %rax, %r13
movq %rax, -0x10(%r14)
pushq $0x2
popq %rdi
pushq $0x3e
popq %rsi
pushq $0x2d
popq %rdx
callq 0x7284
movq %rax, %r12
movq %rax, -0x8(%r14)
movq %rsp, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x8e58
testb %al, %al
jne 0x1d1ec
pushq $0x1
popq %rdi
pushq $0x39
popq %rsi
pushq $0x31
popq %rdx
callq 0x7284
movq %rsp, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x8e58
testb %al, %al
jne 0x1d208
movq %rsp, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x8e58
testb %al, %al
je 0x1d224
cmpq %r13, (%rsp)
jne 0x1d23d
cmpq %r15, 0x18(%rsp)
jne 0x1d256
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x8e58
testb %al, %al
je 0x1d26f
cmpq %r12, 0x8(%rsp)
jne 0x1d288
cmpq %rbx, 0x20(%rsp)
jne 0x1d2a1
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x158bf(%rip), %rdi     # 0x32ab2
leaq 0x15871(%rip), %rsi     # 0x32a6b
leaq 0x158db(%rip), %rcx     # 0x32adc
pushq $0x35
jmp 0x1d2b8
leaq 0x158eb(%rip), %rdi     # 0x32afa
leaq 0x15855(%rip), %rsi     # 0x32a6b
leaq 0x158bf(%rip), %rcx     # 0x32adc
pushq $0x36
jmp 0x1d2b8
leaq 0x15905(%rip), %rdi     # 0x32b30
leaq 0x15839(%rip), %rsi     # 0x32a6b
leaq 0x158a3(%rip), %rcx     # 0x32adc
pushq $0x37
jmp 0x1d2b8
leaq 0x15912(%rip), %rdi     # 0x32b56
leaq 0x15820(%rip), %rsi     # 0x32a6b
leaq 0x1588a(%rip), %rcx     # 0x32adc
pushq $0x38
jmp 0x1d2b8
leaq 0x15908(%rip), %rdi     # 0x32b65
leaq 0x15807(%rip), %rsi     # 0x32a6b
leaq 0x15871(%rip), %rcx     # 0x32adc
pushq $0x39
jmp 0x1d2b8
leaq 0x158fe(%rip), %rdi     # 0x32b74
leaq 0x157ee(%rip), %rsi     # 0x32a6b
leaq 0x15858(%rip), %rcx     # 0x32adc
pushq $0x3b
jmp 0x1d2b8
leaq 0x1590d(%rip), %rdi     # 0x32b9c
leaq 0x157d5(%rip), %rsi     # 0x32a6b
leaq 0x1583f(%rip), %rcx     # 0x32adc
pushq $0x3c
jmp 0x1d2b8
leaq 0x15903(%rip), %rdi     # 0x32bab
leaq 0x157bc(%rip), %rsi     # 0x32a6b
leaq 0x15826(%rip), %rcx     # 0x32adc
pushq $0x3d
popq %rdx
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0xb78, %rsp            # imm = 0xB78
leaq 0x158eb(%rip), %rsi     # 0x32bba
leaq 0x48(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1b8
leaq 0x210(%rsp), %r14
pushq $0x1
popq %rcx
movq %r14, %rdi
movq %rbx, %rsi
movl %ecx, %edx
callq 0x73f8
leaq 0x8(%rsp), %rdx
movq %r14, 0x30(%rdx)
movq %r14, 0x38(%rdx)
movq %r14, 0x28(%rdx)
movq 0x28(%r14), %rax
movq %rax, 0x8(%rdx)
andl $0x0, (%rdx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdx)
andq $0x0, 0x20(%rdx)
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x8490
testb %al, %al
je 0x1d344
movq (%rsp), %rax
movq (%rax), %rax
cmpq 0x10(%rsp), %rax
jne 0x1d35d
addq $0xb78, %rsp            # imm = 0xB78
popq %rbx
popq %r14
retq
leaq 0x159ae(%rip), %rdi     # 0x32cf9
leaq 0x15719(%rip), %rsi     # 0x32a6b
leaq 0x15892(%rip), %rcx     # 0x32beb
pushq $0x50
jmp 0x1d374
leaq 0x15896(%rip), %rdi     # 0x32bfa
leaq 0x15700(%rip), %rsi     # 0x32a6b
leaq 0x15879(%rip), %rcx     # 0x32beb
pushq $0x51
popq %rdx
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0xb78, %rsp            # imm = 0xB78
leaq 0x15886(%rip), %rsi     # 0x32c11
leaq 0x48(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1b8
leaq 0x210(%rsp), %r14
pushq $0x1
popq %rcx
movq %r14, %rdi
movq %rbx, %rsi
movl %ecx, %edx
callq 0x73f8
leaq 0x8(%rsp), %rdx
movq %r14, 0x30(%rdx)
movq %r14, 0x38(%rdx)
movq %r14, 0x28(%rdx)
andq $0x0, 0x8(%rdx)
movq 0x28(%r14), %rax
movq %rax, 0x10(%rdx)
andl $0x0, (%rdx)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rdx)
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x8490
testb %al, %al
je 0x1d400
movq (%rsp), %rax
movq (%rax), %rax
cmpq 0x18(%rsp), %rax
jne 0x1d419
addq $0xb78, %rsp            # imm = 0xB78
popq %rbx
popq %r14
retq
leaq 0x158f2(%rip), %rdi     # 0x32cf9
leaq 0x1565d(%rip), %rsi     # 0x32a6b
leaq 0x1582f(%rip), %rcx     # 0x32c44
pushq $0x65
jmp 0x1d430
leaq 0x1583a(%rip), %rdi     # 0x32c5a
leaq 0x15644(%rip), %rsi     # 0x32a6b
leaq 0x15816(%rip), %rcx     # 0x32c44
pushq $0x66
popq %rdx
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
subq $0xb78, %rsp            # imm = 0xB78
leaq 0x1582c(%rip), %rsi     # 0x32c73
leaq 0x48(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1b8
leaq 0x210(%rsp), %r14
pushq $0x1
popq %rcx
movq %r14, %rdi
movq %rbx, %rsi
movl %ecx, %edx
callq 0x73f8
leaq 0x8(%rsp), %rdx
movq %r14, 0x30(%rdx)
movq %r14, 0x38(%rdx)
movq %r14, 0x28(%rdx)
movq 0x10(%r14), %rax
movq 0x20(%r14), %rcx
movq %rcx, 0x8(%rdx)
movq %rax, 0x10(%rdx)
andl $0x0, (%rdx)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rdx)
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x8490
testb %al, %al
je 0x1d4e3
movq (%rsp), %rax
movq (%rax), %rax
cmpq 0x10(%rsp), %rax
jne 0x1d4fc
leaq 0x48(%rsp), %rdi
movq %rsp, %rsi
leaq 0x8(%rsp), %rdx
callq 0x8490
testb %al, %al
je 0x1d515
movq (%rsp), %rax
movq (%rax), %rax
cmpq 0x18(%rsp), %rax
jne 0x1d52e
addq $0xb78, %rsp            # imm = 0xB78
popq %rbx
popq %r14
retq
leaq 0x1580f(%rip), %rdi     # 0x32cf9
leaq 0x1557a(%rip), %rsi     # 0x32a6b
leaq 0x157ae(%rip), %rcx     # 0x32ca6
pushq $0x7a
jmp 0x1d545
leaq 0x156f7(%rip), %rdi     # 0x32bfa
leaq 0x15561(%rip), %rsi     # 0x32a6b
leaq 0x15795(%rip), %rcx     # 0x32ca6
pushq $0x7b
jmp 0x1d545
leaq 0x157dd(%rip), %rdi     # 0x32cf9
leaq 0x15548(%rip), %rsi     # 0x32a6b
leaq 0x1577c(%rip), %rcx     # 0x32ca6
pushq $0x7d
jmp 0x1d545
leaq 0x15725(%rip), %rdi     # 0x32c5a
leaq 0x1552f(%rip), %rsi     # 0x32a6b
leaq 0x15763(%rip), %rcx     # 0x32ca6
pushq $0x7e
popq %rdx
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O2/jswaff[P]prophet3/test/next__test.cpp
// Function: test_pv_and_hash_same_move()
void test_pv_and_hash_same_move() {
    position pos;
    reset_pos(&pos);

    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[7];
    mo_dto.hash_move = mo_dto.pv_move;
    mo_dto.killer1 = 0;
    mo_dto.killer2 = 0;
    mo_dto.caps_only = false;
    mo_dto.next_stage = PVMOVE;

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

    for (int i=1;i<20;i++) {
        assert(next(&pos,&nextp,&mo_dto));
        assert(*nextp!=mo_dto.pv_move);
    }

    // 21st call should return false
    assert(!next(&pos,&nextp,&mo_dto));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xb78, %rsp            # imm = 0xB78
leaq 0x48(%rsp), %rbx
movq %rbx, %rdi
callq 0xa187
leaq 0x210(%rsp), %r14
pushq $0x1
popq %rcx
movq %r14, %rdi
movq %rbx, %rsi
movl %ecx, %edx
callq 0x73f8
leaq 0x8(%rsp), %rdx
movq %r14, 0x30(%rdx)
movq %r14, 0x38(%rdx)
movq %r14, 0x28(%rdx)
movq 0x38(%r14), %rax
movq %rax, 0x8(%rdx)
movq %rax, 0x10(%rdx)
movb $0x0, 0x4(%rdx)
andl $0x0, (%rdx)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rdx)
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x8490
testb %al, %al
je 0x1d651
movq (%rsp), %rax
movq (%rax), %rax
cmpq 0x10(%rsp), %rax
jne 0x1d670
pushq $0x14
popq %rbp
leaq 0x48(%rsp), %rbx
movq %rsp, %r14
leaq 0x8(%rsp), %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x8490
decl %ebp
je 0x1d620
testb %al, %al
je 0x1d632
movq (%rsp), %rax
movq (%rax), %rax
cmpq 0x10(%rsp), %rax
jne 0x1d5dd
leaq 0x156d9(%rip), %rdi     # 0x32ce1
leaq 0x1545c(%rip), %rsi     # 0x32a6b
leaq 0x156a9(%rip), %rcx     # 0x32cbf
movl $0x98, %edx
callq 0x20c0
testb %al, %al
jne 0x1d68f
addq $0xb78, %rsp            # imm = 0xB78
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x156c0(%rip), %rdi     # 0x32cf9
leaq 0x1542b(%rip), %rsi     # 0x32a6b
leaq 0x15678(%rip), %rcx     # 0x32cbf
movl $0x97, %edx
callq 0x20c0
leaq 0x156a1(%rip), %rdi     # 0x32cf9
leaq 0x1540c(%rip), %rsi     # 0x32a6b
leaq 0x15659(%rip), %rcx     # 0x32cbf
movl $0x93, %edx
callq 0x20c0
leaq 0x15583(%rip), %rdi     # 0x32bfa
leaq 0x153ed(%rip), %rsi     # 0x32a6b
leaq 0x1563a(%rip), %rcx     # 0x32cbf
movl $0x94, %edx
callq 0x20c0
leaq 0x15662(%rip), %rdi     # 0x32cf8
leaq 0x153ce(%rip), %rsi     # 0x32a6b
leaq 0x1561b(%rip), %rcx     # 0x32cbf
movl $0x9c, %edx
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O2/jswaff[P]prophet3/test/next__test.cpp
// Function: test_ep_ordered_as_capture()
void test_ep_ordered_as_capture() {
    position pos;
    set_pos(&pos,"8/3p4/8/4P3/8/8/K6k/8 b - -");

    apply_move(&pos,to_move(PAWN,D7,D5),gundos);

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

    move epcap = to_capture(PAWN,E5,D6,PAWN);
    set_epcapture(&epcap);
    assert(is_in_move_list(epcap,moves,endp));

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

    move *m;
    next(&pos,&m,&mo_dto);
    assert(clear_score(*m) == epcap);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x3b8, %rsp            # imm = 0x3B8
leaq 0x1449b(%rip), %rsi     # 0x33348
leaq 0x58(%rsp), %r14
movq %r14, %rdi
callq 0xa1b8
pushq $0x1
popq %rbp
pushq $0xb
popq %rsi
pushq $0x1b
popq %rdx
movl %ebp, %edi
callq 0x7284
leaq 0xacc1f(%rip), %rdx     # 0xcbaf0
movq %r14, %rdi
movq %rax, %rsi
callq 0x2fa5
leaq 0x220(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
xorl %ecx, %ecx
callq 0x73f8
movq %rax, %r14
pushq $0x1c
popq %rsi
pushq $0x13
popq %rdx
movl %ebp, %edi
movl %ebp, %ecx
callq 0x72a3
leaq 0x8(%rsp), %r15
movq %rax, (%r15)
movq %r15, %rdi
callq 0x7352
movq (%r15), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xdacb
testb %al, %al
je 0x1ef78
leaq 0x18(%rsp), %rdx
movq %rbx, 0x30(%rdx)
movq %rbx, 0x38(%rdx)
movq %rbx, 0x28(%rdx)
andl $0x0, (%rdx)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdx)
movups %xmm0, 0x18(%rdx)
leaq 0x58(%rsp), %rdi
leaq 0x10(%rsp), %rbx
movq %rbx, %rsi
callq 0x8490
movq (%rbx), %rax
movq (%rax), %rdi
callq 0x73f4
cmpq 0x8(%rsp), %rax
jne 0x1ef97
addq $0x3b8, %rsp            # imm = 0x3B8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x143e5(%rip), %rdi     # 0x33364
leaq 0x13ae5(%rip), %rsi     # 0x32a6b
leaq 0x143f9(%rip), %rcx     # 0x33386
movl $0x1c9, %edx            # imm = 0x1C9
callq 0x20c0
leaq 0x1440a(%rip), %rdi     # 0x333a8
leaq 0x13ac6(%rip), %rsi     # 0x32a6b
leaq 0x143da(%rip), %rcx     # 0x33386
movl $0x1d5, %edx            # imm = 0x1D5
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O2/jswaff[P]prophet3/test/next__test.cpp
// Function: test_killers()
void test_killers() {
    position pos;
    reset_pos(&pos);

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

    move h2h3 = to_move(PAWN,H2,H3);
    assert(is_in_move_list(h2h3,moves,endp));

    move g2g4 = to_move(PAWN,G2,G4);
    assert(is_in_move_list(g2g4,moves,endp));

    move_order_dto mo_dto;
    mo_dto.startp = mo_dto.currentp = mo_dto.endp = moves;
    mo_dto.pv_move = 0;
    mo_dto.hash_move = 0;
    mo_dto.killer1 = h2h3;
    mo_dto.killer2 = g2g4;
    mo_dto.next_stage = PVMOVE;

    move *m;
    next(&pos,&m,&mo_dto);
    assert(clear_score(*m) == h2h3);
    next(&pos,&m,&mo_dto);
    assert(clear_score(*m) == g2g4);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x3a0, %rsp            # imm = 0x3A0
leaq 0x48(%rsp), %rbx
movq %rbx, %rdi
callq 0xa187
leaq 0x210(%rsp), %r14
pushq $0x1
popq %rbp
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
movl %ebp, %ecx
callq 0x73f8
movq %rax, %r15
pushq $0x37
popq %rsi
pushq $0x2f
popq %rdx
movl %ebp, %edi
callq 0x7284
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0xdacb
testb %al, %al
je 0x1f0bc
pushq $0x1
popq %rdi
pushq $0x36
popq %rsi
pushq $0x26
popq %rdx
callq 0x7284
movq %rax, %r14
leaq 0x210(%rsp), %r12
movq %rax, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0xdacb
testb %al, %al
je 0x1f0db
leaq 0x8(%rsp), %rdx
movq %r12, 0x30(%rdx)
movq %r12, 0x38(%rdx)
movq %r12, 0x28(%rdx)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdx)
movq %rbx, 0x18(%rdx)
movq %r14, 0x20(%rdx)
andl $0x0, (%rdx)
leaq 0x48(%rsp), %rdi
movq %rsp, %r15
movq %r15, %rsi
callq 0x8490
movq (%r15), %rax
movq (%rax), %rdi
callq 0x73f4
cmpq %rbx, %rax
jne 0x1f0fa
leaq 0x48(%rsp), %rdi
movq %rsp, %rbx
leaq 0x8(%rsp), %rdx
movq %rbx, %rsi
callq 0x8490
movq (%rbx), %rax
movq (%rax), %rdi
callq 0x73f4
cmpq %r14, %rax
jne 0x1f119
addq $0x3a0, %rsp            # imm = 0x3A0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x142fe(%rip), %rdi     # 0x333c1
leaq 0x139a1(%rip), %rsi     # 0x32a6b
leaq 0x14311(%rip), %rcx     # 0x333e2
movl $0x1e0, %edx            # imm = 0x1E0
callq 0x20c0
leaq 0x14314(%rip), %rdi     # 0x333f6
leaq 0x13982(%rip), %rsi     # 0x32a6b
leaq 0x142f2(%rip), %rcx     # 0x333e2
movl $0x1e3, %edx            # imm = 0x1E3
callq 0x20c0
leaq 0x14316(%rip), %rdi     # 0x33417
leaq 0x13963(%rip), %rsi     # 0x32a6b
leaq 0x142d3(%rip), %rcx     # 0x333e2
movl $0x1ef, %edx            # imm = 0x1EF
callq 0x20c0
leaq 0x1430f(%rip), %rdi     # 0x3342f
leaq 0x13944(%rip), %rsi     # 0x32a6b
leaq 0x142b4(%rip), %rcx     # 0x333e2
movl $0x1f1, %edx            # imm = 0x1F1
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O2/jswaff[P]prophet3/test/next__test.cpp
// Function: assert_all_moves_good(position*)
void assert_all_moves_good(position *pos) {
    move moves[200];
    move *endp = gen_legal_moves(&moves[0],pos,true,true);
    for (move* mp=moves;mp<endp;mp++) {
        assert(good_move(pos,*mp)==(*mp != BADMOVE));
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x640, %rsp            # imm = 0x640
movq %rdi, %rbx
movq %rsp, %r14
pushq $0x1
popq %rcx
movq %r14, %rdi
movq %rbx, %rsi
movl %ecx, %edx
callq 0x73f8
movq %rax, %r15
cmpq %r15, %r14
jae 0x1f19d
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x89da
cmpq $0x0, (%r14)
sete %cl
xorb %al, %cl
addq $0x8, %r14
testb %cl, %cl
jne 0x1f15d
leaq 0x142c2(%rip), %rdi     # 0x33447
leaq 0x138df(%rip), %rsi     # 0x32a6b
leaq 0x142d9(%rip), %rcx     # 0x3346c
movl $0x1f8, %edx            # imm = 0x1F8
callq 0x20c0
addq $0x640, %rsp            # imm = 0x640
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/jswaff[P]prophet3/test/next__test.cpp
// Function: test_next()
void test_next() {
    test_best_at_top();
    test_place_move_on_top();
    test_pv();
    test_hash_next();
    test_pv_then_hash();
    test_pv_and_hash_same_move();
    test_promotions();
    test_pv_then_hash_then_captures();
    test_winning_caps_before_noncaps();
    test_caps_in_order_white();
    test_caps_in_order_black();
    test_ep_ordered_as_capture();
    test_killers();
    test_good_move();
}

// Assembly:
pushq %rax
callq 0x1cf68
callq 0x1d0de
callq 0x1d2be
callq 0x1d37a
callq 0x1d436
callq 0x1d54b
callq 0x1d6ae
callq 0x1db00
callq 0x1dea3
callq 0x1e913
callq 0x1ebd6
callq 0x1ee99
callq 0x1efb6
popq %rax
jmp 0x1f1aa
nop
// File: /workspace/github_cpp_makefile_star2_O2/jswaff[P]prophet3/test/pos__test.cpp
// Function: test_add_piece()
void test_add_piece() {
    position pos;
    reset_pos(&pos);

    add_piece(&pos,PAWN,E4);
    assert(pos.piece[E4]==PAWN);

    add_piece(&pos,-PAWN,E5);
    assert(pos.piece[E5]==-PAWN);

    add_piece(&pos,KNIGHT,F3);
    assert(pos.piece[F3]==KNIGHT);
}

// Assembly:
pushq %rbx
subq $0x1d0, %rsp            # imm = 0x1D0
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xa187
pushq $0x1
popq %rsi
pushq $0x24
popq %rdx
movq %rbx, %rdi
callq 0x9db0
cmpl $0x1, 0x90(%rbx)
jne 0x1fb71
leaq 0x8(%rsp), %rbx
pushq $-0x1
popq %rsi
pushq $0x1c
popq %rdx
movq %rbx, %rdi
callq 0x9db0
cmpl $-0x1, 0x70(%rbx)
jne 0x1fb8a
leaq 0x8(%rsp), %rbx
pushq $0x2
popq %rsi
pushq $0x2d
popq %rdx
movq %rbx, %rdi
callq 0x9db0
cmpl $0x2, 0xb4(%rbx)
jne 0x1fba3
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
retq
leaq 0x13e56(%rip), %rdi     # 0x339ce
leaq 0x13c4d(%rip), %rsi     # 0x337cc
leaq 0x13e5c(%rip), %rcx     # 0x339e2
pushq $0x47
jmp 0x1fbba
leaq 0x13e67(%rip), %rdi     # 0x339f8
leaq 0x13c34(%rip), %rsi     # 0x337cc
leaq 0x13e43(%rip), %rcx     # 0x339e2
pushq $0x4a
jmp 0x1fbba
leaq 0x13e63(%rip), %rdi     # 0x33a0d
leaq 0x13c1b(%rip), %rsi     # 0x337cc
leaq 0x13e2a(%rip), %rcx     # 0x339e2
pushq $0x4d
popq %rdx
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O2/jswaff[P]prophet3/test/pos__test.cpp
// Function: test_remove_piece()
void test_remove_piece() {
    position pos;
    reset_pos(&pos);

    remove_piece(&pos,E2);
    assert(pos.piece[E2]==NO_PIECE);

    remove_piece(&pos,H1);
    assert(pos.piece[H1]==NO_PIECE);

    remove_piece(&pos,E8);
    assert(pos.piece[E8]==NO_PIECE);
}

// Assembly:
pushq %rbx
subq $0x1d0, %rsp            # imm = 0x1D0
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xa187
pushq $0x34
popq %rsi
movq %rbx, %rdi
callq 0x9f37
cmpl $0x0, 0xd0(%rbx)
jne 0x1fc21
leaq 0x8(%rsp), %rbx
pushq $0x3f
popq %rsi
movq %rbx, %rdi
callq 0x9f37
cmpl $0x0, 0xfc(%rbx)
jne 0x1fc3a
leaq 0x8(%rsp), %rbx
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0x9f37
cmpl $0x0, 0x10(%rbx)
jne 0x1fc53
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
retq
leaq 0x13dfb(%rip), %rdi     # 0x33a23
leaq 0x13b9d(%rip), %rsi     # 0x337cc
leaq 0x13e05(%rip), %rcx     # 0x33a3b
pushq $0x55
jmp 0x1fc6a
leaq 0x13e13(%rip), %rdi     # 0x33a54
leaq 0x13b84(%rip), %rsi     # 0x337cc
leaq 0x13dec(%rip), %rcx     # 0x33a3b
pushq $0x58
jmp 0x1fc6a
leaq 0x13e12(%rip), %rdi     # 0x33a6c
leaq 0x13b6b(%rip), %rsi     # 0x337cc
leaq 0x13dd3(%rip), %rcx     # 0x33a3b
pushq $0x5b
popq %rdx
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O2/jswaff[P]prophet3/test/pos__test.cpp
// Function: test_is_empty_sq()
void test_is_empty_sq() {
    position pos;
    reset_pos(&pos);
    assert(is_empty_sq(&pos,D4));
    assert(!is_empty_sq(&pos,D8));
}

// Assembly:
pushq %rbx
subq $0x1d0, %rsp            # imm = 0x1D0
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xa187
pushq $0x23
popq %rsi
movq %rbx, %rdi
callq 0xa4ea
testb %al, %al
je 0x21c28
leaq 0x8(%rsp), %rdi
pushq $0x3
popq %rsi
callq 0xa4ea
testb %al, %al
jne 0x21c47
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
retq
leaq 0x12a79(%rip), %rdi     # 0x346a8
leaq 0x11b96(%rip), %rsi     # 0x337cc
leaq 0x12a80(%rip), %rcx     # 0x346bd
movl $0x1b5, %edx            # imm = 0x1B5
callq 0x20c0
leaq 0x12a87(%rip), %rdi     # 0x346d5
leaq 0x11b77(%rip), %rsi     # 0x337cc
leaq 0x12a61(%rip), %rcx     # 0x346bd
movl $0x1b6, %edx            # imm = 0x1B6
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O2/jswaff[P]prophet3/test/pos__test.cpp
// Function: test_flip_vertical()
void test_flip_vertical() {
    position pos;
    position save_pos;

    reset_pos(&pos);
    memcpy(&save_pos,&pos,sizeof(position));
    flip_board(&pos);
    flip_board(&pos);
    assert(equal_pos(&pos,&save_pos,true));

    ///
    set_pos(&pos,"7r/R6p/2K4P/5k1P/2p4n/5p2/8/8 w - - 0 1");
    memcpy(&save_pos,&pos,sizeof(position));
    flip_board(&pos);
    flip_board(&pos);
    assert(equal_pos(&pos,&save_pos,true));
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x398, %rsp            # imm = 0x398
leaq 0x1d0(%rsp), %rbx
movq %rbx, %rdi
callq 0xa187
leaq 0x8(%rsp), %r14
movl $0x1c8, %edx            # imm = 0x1C8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x20f0
movq %rbx, %rdi
callq 0xa64d
movq %rbx, %rdi
callq 0xa64d
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x98c8
testb %al, %al
je 0x21f3f
leaq 0xc67d(%rip), %rsi      # 0x2e56a
leaq 0x1d0(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1b8
leaq 0x8(%rsp), %r14
movl $0x1c8, %edx            # imm = 0x1C8
movq %r14, %rdi
movq %rbx, %rsi
callq 0x20f0
movq %rbx, %rdi
callq 0xa64d
movq %rbx, %rdi
callq 0xa64d
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x98c8
testb %al, %al
je 0x21f5e
addq $0x398, %rsp            # imm = 0x398
popq %rbx
popq %r14
retq
leaq 0x9982(%rip), %rdi      # 0x2b8c8
leaq 0x1187f(%rip), %rsi     # 0x337cc
leaq 0x12878(%rip), %rcx     # 0x347cc
movl $0x1de, %edx            # imm = 0x1DE
callq 0x20c0
leaq 0x9963(%rip), %rdi      # 0x2b8c8
leaq 0x11860(%rip), %rsi     # 0x337cc
leaq 0x12859(%rip), %rcx     # 0x347cc
movl $0x1e5, %edx            # imm = 0x1E5
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O2/jswaff[P]prophet3/test/pos__test.cpp
// Function: test_is_checkmate()
void test_is_checkmate() {
    position pos;

    // Fool's mate!
    set_pos(&pos,"rnb1kbnr/pppp1ppp/8/4p3/6Pq/5P2/PPPPP2P/RNBQKBNR w KQkq -");
    assert(is_checkmate(&pos));

    // Byrne vs Fischer
    set_pos(&pos,"1Q6/5pk1/2p3p1/1p2N2p/1b5P/1bn5/2r3P1/2K5 w - -");
    assert(is_checkmate(&pos));

    // Simple mate with rook
    set_pos(&pos,"3k2R1/8/3K4/8/8/8/8/8 b - -");
    assert(is_checkmate(&pos));

    // Starting position
    reset_pos(&pos);
    assert(!is_checkmate(&pos));

    set_pos(&pos,"8/8/8/6K1/8/1Q6/p7/k7 b - -");
    assert(!is_checkmate(&pos));
}

// Assembly:
pushq %rbx
subq $0x1d0, %rsp            # imm = 0x1D0
leaq 0x1285a(%rip), %rsi     # 0x347e6
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1b8
movq %rbx, %rdi
callq 0xa76e
testb %al, %al
je 0x2203b
leaq 0x12889(%rip), %rsi     # 0x34839
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1b8
movq %rbx, %rdi
callq 0xa76e
testb %al, %al
je 0x2205a
leaq 0x12895(%rip), %rsi     # 0x34869
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1b8
movq %rbx, %rdi
callq 0xa76e
testb %al, %al
je 0x22079
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xa187
movq %rbx, %rdi
callq 0xa76e
testb %al, %al
jne 0x22098
leaq 0x12884(%rip), %rsi     # 0x34899
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1b8
movq %rbx, %rdi
callq 0xa76e
testb %al, %al
jne 0x220b7
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
retq
leaq 0x12844(%rip), %rdi     # 0x34886
leaq 0x11783(%rip), %rsi     # 0x337cc
leaq 0x127d0(%rip), %rcx     # 0x34820
movl $0x1ed, %edx            # imm = 0x1ED
callq 0x20c0
leaq 0x12825(%rip), %rdi     # 0x34886
leaq 0x11764(%rip), %rsi     # 0x337cc
leaq 0x127b1(%rip), %rcx     # 0x34820
movl $0x1f1, %edx            # imm = 0x1F1
callq 0x20c0
leaq 0x12806(%rip), %rdi     # 0x34886
leaq 0x11745(%rip), %rsi     # 0x337cc
leaq 0x12792(%rip), %rcx     # 0x34820
movl $0x1f5, %edx            # imm = 0x1F5
callq 0x20c0
leaq 0x127e6(%rip), %rdi     # 0x34885
leaq 0x11726(%rip), %rsi     # 0x337cc
leaq 0x12773(%rip), %rcx     # 0x34820
movl $0x1f9, %edx            # imm = 0x1F9
callq 0x20c0
leaq 0x127c7(%rip), %rdi     # 0x34885
leaq 0x11707(%rip), %rsi     # 0x337cc
leaq 0x12754(%rip), %rcx     # 0x34820
movl $0x1fc, %edx            # imm = 0x1FC
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O2/jswaff[P]prophet3/test/pos__test.cpp
// Function: test_is_stalemate()
void test_is_stalemate() {
    position pos;

    // Burn vs Pilsbury, 1898
    set_pos(&pos,"5k2/5P2/5K2/8/8/8/8/8 b - -");
    assert(is_stalemate(&pos));

    set_pos(&pos,"kb6/8/1K6/8/8/8/8/8 b - - ");
    assert(!is_stalemate(&pos));
    set_pos(&pos,"kb5R/8/1K6/8/8/8/8/8 b - - ");
    assert(is_stalemate(&pos));

    set_pos(&pos,"8/8/8/8/8/2K5/1R6/k7 b - -");
    assert(is_stalemate(&pos));

    set_pos(&pos,"8/8/8/6K1/8/1Q6/p7/k7 b - -");
    assert(is_stalemate(&pos));

    set_pos(&pos,"rnb1kbnr/pppp1ppp/8/4p3/6Pq/5P2/PPPPP2P/RNBQKBNR w KQkq -");
    assert(!is_stalemate(&pos));
}

// Assembly:
pushq %rbx
subq $0x1d0, %rsp            # imm = 0x1D0
leaq 0x127d0(%rip), %rsi     # 0x348b5
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1b8
movq %rbx, %rdi
callq 0xa7bd
testb %al, %al
je 0x221bf
leaq 0x127e1(%rip), %rsi     # 0x348ea
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1b8
movq %rbx, %rdi
callq 0xa7bd
testb %al, %al
jne 0x221de
leaq 0x127ec(%rip), %rsi     # 0x34919
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1b8
movq %rbx, %rdi
callq 0xa7bd
testb %al, %al
je 0x221fd
leaq 0x127e4(%rip), %rsi     # 0x34935
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1b8
movq %rbx, %rdi
callq 0xa7bd
testb %al, %al
je 0x2221c
leaq 0x12724(%rip), %rsi     # 0x34899
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1b8
movq %rbx, %rdi
callq 0xa7bd
testb %al, %al
je 0x2223b
leaq 0x1264d(%rip), %rsi     # 0x347e6
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1b8
movq %rbx, %rdi
callq 0xa7bd
testb %al, %al
jne 0x2225a
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
retq
leaq 0x12740(%rip), %rdi     # 0x34906
leaq 0x115ff(%rip), %rsi     # 0x337cc
leaq 0x126fd(%rip), %rcx     # 0x348d1
movl $0x204, %edx            # imm = 0x204
callq 0x20c0
leaq 0x12720(%rip), %rdi     # 0x34905
leaq 0x115e0(%rip), %rsi     # 0x337cc
leaq 0x126de(%rip), %rcx     # 0x348d1
movl $0x207, %edx            # imm = 0x207
callq 0x20c0
leaq 0x12702(%rip), %rdi     # 0x34906
leaq 0x115c1(%rip), %rsi     # 0x337cc
leaq 0x126bf(%rip), %rcx     # 0x348d1
movl $0x209, %edx            # imm = 0x209
callq 0x20c0
leaq 0x126e3(%rip), %rdi     # 0x34906
leaq 0x115a2(%rip), %rsi     # 0x337cc
leaq 0x126a0(%rip), %rcx     # 0x348d1
movl $0x20c, %edx            # imm = 0x20C
callq 0x20c0
leaq 0x126c4(%rip), %rdi     # 0x34906
leaq 0x11583(%rip), %rsi     # 0x337cc
leaq 0x12681(%rip), %rcx     # 0x348d1
movl $0x20f, %edx            # imm = 0x20F
callq 0x20c0
leaq 0x126a4(%rip), %rdi     # 0x34905
leaq 0x11564(%rip), %rsi     # 0x337cc
leaq 0x12662(%rip), %rcx     # 0x348d1
movl $0x212, %edx            # imm = 0x212
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O2/jswaff[P]prophet3/test/pos__test.cpp
// Function: test_is_zugzwang()
void test_is_zugzwang() {
    position pos;
    reset_pos(&pos);
    assert(!is_zugzwang(&pos));

    // just kings
    set_pos(&pos,"7k/8/8/8/8/8/8/7K w - - ");
    assert(is_zugzwang(&pos));

    // single white bishop
    set_pos(&pos,"7k/8/8/B7/8/8/8/7K b - - ");
    assert(is_zugzwang(&pos));

    // white pawn black knight
    set_pos(&pos,"7k/8/8/n7/P7/8/8/7K b - - ");
    assert(is_zugzwang(&pos));

    // white rook black knight
    set_pos(&pos,"7k/8/8/n7/R7/8/8/7K b - - ");
    assert(!is_zugzwang(&pos));

}

// Assembly:
pushq %rbx
subq $0x1d0, %rsp            # imm = 0x1D0
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xa187
movq %rbx, %rdi
callq 0xa80c
testb %al, %al
jne 0x22337
leaq 0x126d6(%rip), %rsi     # 0x3497b
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1b8
movq %rbx, %rdi
callq 0xa80c
testb %al, %al
je 0x22356
leaq 0x126cb(%rip), %rsi     # 0x34994
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1b8
movq %rbx, %rdi
callq 0xa80c
testb %al, %al
je 0x22375
leaq 0x126c1(%rip), %rsi     # 0x349ae
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1b8
movq %rbx, %rdi
callq 0xa80c
testb %al, %al
je 0x22394
leaq 0x126b8(%rip), %rsi     # 0x349c9
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1b8
movq %rbx, %rdi
callq 0xa80c
testb %al, %al
jne 0x223b3
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
retq
leaq 0x12612(%rip), %rdi     # 0x34950
leaq 0x11487(%rip), %rsi     # 0x337cc
leaq 0x12617(%rip), %rcx     # 0x34963
movl $0x218, %edx            # imm = 0x218
callq 0x20c0
leaq 0x125f4(%rip), %rdi     # 0x34951
leaq 0x11468(%rip), %rsi     # 0x337cc
leaq 0x125f8(%rip), %rcx     # 0x34963
movl $0x21c, %edx            # imm = 0x21C
callq 0x20c0
leaq 0x125d5(%rip), %rdi     # 0x34951
leaq 0x11449(%rip), %rsi     # 0x337cc
leaq 0x125d9(%rip), %rcx     # 0x34963
movl $0x220, %edx            # imm = 0x220
callq 0x20c0
leaq 0x125b6(%rip), %rdi     # 0x34951
leaq 0x1142a(%rip), %rsi     # 0x337cc
leaq 0x125ba(%rip), %rcx     # 0x34963
movl $0x224, %edx            # imm = 0x224
callq 0x20c0
leaq 0x12596(%rip), %rdi     # 0x34950
leaq 0x1140b(%rip), %rsi     # 0x337cc
leaq 0x1259b(%rip), %rcx     # 0x34963
movl $0x228, %edx            # imm = 0x228
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O2/jswaff[P]prophet3/test/pos__test.cpp
// Function: test_pos()
void test_pos() {
    test_pos_consistency();
    test_equal_pos();
    test_reset_pos();
    test_add_piece();
    test_remove_piece();
    test_set_pos();
    test_remove_rook_castling_availability();
    test_remove_castling_availability();
    test_is_empty_sq();
    test_is_enemy_and_friendly_occupied();
    test_flip_vertical();
    test_is_checkmate();
    test_is_stalemate();
    test_is_zugzwang();
}

// Assembly:
pushq %rax
callq 0x21150
callq 0x1fc70
callq 0x1f5fc
callq 0x1fb07
callq 0x1fbc0
callq 0x2006d
callq 0x20ced
callq 0x209fb
callq 0x21bea
callq 0x21c66
callq 0x21e95
callq 0x21f7d
callq 0x220d6
popq %rax
jmp 0x22279
nop
// File: /workspace/github_cpp_makefile_star2_O2/jswaff[P]prophet3/test/search__test.cpp
// Function: test_matein1()
void test_matein1() {
    position pos;
    set_pos(&pos,"4k3/8/3Q4/2B5/8/8/1K6/8 w - -");
    clear_hash_table(&htbl);

    move_line pv; pv.n=0;
    search_stats stats; stats.nodes=0; stats.last_pv.n=0;
    start_timer(10000);
    int32 score=search(&pos,&pv,-INF,INF,2,&stats,move_stack,gundos,false);
    assert(score==CHECKMATE-1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xb70, %rsp            # imm = 0xB70
leaq 0x12593(%rip), %rsi     # 0x349e4
movq %rsp, %rbx
movq %rbx, %rdi
callq 0xa1b8
leaq 0xd8a8d(%rip), %rdi     # 0xfaef0
callq 0x5dd9
leaq 0x1c8(%rsp), %r14
andl $0x0, (%r14)
leaq 0x4f0(%rsp), %r15
andq $0x0, 0x18(%r15)
andl $0x0, 0x28(%r15)
movl $0x2710, %edi           # imm = 0x2710
callq 0x22420
subq $0x8, %rsp
leaq 0xa9655(%rip), %rax     # 0xcbaf0
leaq 0x89691e(%rip), %r10    # 0x8b8dc0
pushq $0x2
popq %r8
movq %rbx, %rdi
movq %r14, %rsi
movl $0xfffcf2c0, %edx       # imm = 0xFFFCF2C0
movl $0x30d40, %ecx          # imm = 0x30D40
movq %r15, %r9
pushq $0x0
pushq %rax
pushq %r10
callq 0xaa1d
addq $0x20, %rsp
cmpl $0xfffe, %eax           # imm = 0xFFFE
jne 0x224db
addq $0xb70, %rsp            # imm = 0xB70
popq %rbx
popq %r14
popq %r15
retq
leaq 0x12520(%rip), %rdi     # 0x34a02
leaq 0x1252c(%rip), %rsi     # 0x34a15
leaq 0x1253b(%rip), %rcx     # 0x34a2b
pushq $0x1f
popq %rdx
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O2/jswaff[P]prophet3/test/search__test.cpp
// Function: test_matein1b()
void test_matein1b() {
    position pos;
    set_pos(&pos,"4K3/8/8/3n2q1/8/8/3k4/8 b - -");
    clear_hash_table(&htbl);

    move_line pv; pv.n=0;
    search_stats stats; stats.nodes=0; stats.last_pv.n=0;
    start_timer(10000);
    int32 score=search(&pos,&pv,-INF,INF,2,&stats,move_stack,gundos,false);
    assert(score==CHECKMATE-1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xb70, %rsp            # imm = 0xB70
leaq 0x12534(%rip), %rsi     # 0x34a3f
movq %rsp, %rbx
movq %rbx, %rdi
callq 0xa1b8
leaq 0xd89d3(%rip), %rdi     # 0xfaef0
callq 0x5dd9
leaq 0x1c8(%rsp), %r14
andl $0x0, (%r14)
leaq 0x4f0(%rsp), %r15
andq $0x0, 0x18(%r15)
andl $0x0, 0x28(%r15)
movl $0x2710, %edi           # imm = 0x2710
callq 0x22420
subq $0x8, %rsp
leaq 0xa959b(%rip), %rax     # 0xcbaf0
leaq 0x896864(%rip), %r10    # 0x8b8dc0
pushq $0x2
popq %r8
movq %rbx, %rdi
movq %r14, %rsi
movl $0xfffcf2c0, %edx       # imm = 0xFFFCF2C0
movl $0x30d40, %ecx          # imm = 0x30D40
movq %r15, %r9
pushq $0x0
pushq %rax
pushq %r10
callq 0xaa1d
addq $0x20, %rsp
cmpl $0xfffe, %eax           # imm = 0xFFFE
jne 0x22595
addq $0xb70, %rsp            # imm = 0xB70
popq %rbx
popq %r14
popq %r15
retq
leaq 0x12466(%rip), %rdi     # 0x34a02
leaq 0x12472(%rip), %rsi     # 0x34a15
leaq 0x124b3(%rip), %rcx     # 0x34a5d
pushq $0x2b
popq %rdx
callq 0x20c0