// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/test/next__test.cpp
// Function: test_pv_then_hash_then_captures()
void test_pv_then_hash_then_captures() {
    position pos;
    set_pos(&pos,"6R1/kp6/8/1KpP4/8/8/8/6B1 w - c6");

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

    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);
    move g8g7 = to_move(ROOK,G8,G7);

    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(is_in_move_list(g8g7,moves,endp));

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

    move *nextp;
    assert(next(&pos,&nextp,&mo_dto));
    assert(clear_score(*nextp)==g8g7);

    assert(next(&pos,&nextp,&mo_dto));
    assert(clear_score(*nextp)==d5c6);

    assert(next(&pos,&nextp,&mo_dto));
    assert(clear_score(*nextp)==g1c5 || clear_score(*nextp)==b5c5);

    assert(next(&pos,&nextp,&mo_dto));
    assert(clear_score(*nextp)==g1c5 || clear_score(*nextp)==b5c5);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb88, %rsp            # imm = 0xB88
leaq 0x14f4f(%rip), %rsi     # 0x34880
leaq 0x58(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa82
leaq 0x220(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
movl $0x1, %edx
movl $0x1, %ecx
callq 0x78e0
movq %rax, %r15
movl $0x1, %edi
movl $0x1b, %esi
movl $0x12, %edx
movl $0x1, %ecx
callq 0x777b
leaq 0x10(%rsp), %rbp
movq %rax, (%rbp)
movq %rbp, %rdi
callq 0x783b
movl $0x6, %edi
movl $0x19, %esi
movl $0x1a, %edx
movl $0x1, %ecx
callq 0x777b
movq %rax, %rbx
movl $0x3, %edi
movl $0x3e, %esi
movl $0x1a, %edx
movl $0x1, %ecx
callq 0x777b
movq %rax, %r14
movl $0x4, %edi
movl $0x6, %esi
movl $0xe, %edx
callq 0x775c
movq %rax, %r12
movq (%rbp), %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0xe682
testb %al, %al
je 0x1fb68
leaq 0x220(%rsp), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0xe682
testb %al, %al
je 0x1fb87
leaq 0x220(%rsp), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0xe682
testb %al, %al
je 0x1fba6
leaq 0x220(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0xe682
testb %al, %al
je 0x1fbc5
leaq 0x18(%rsp), %rdx
movq %r13, 0x30(%rdx)
movq %r13, 0x38(%rdx)
movq %r13, 0x28(%rdx)
movq %r12, 0x8(%rdx)
movq 0x10(%rsp), %rax
movq %rax, 0x10(%rdx)
movl $0x0, (%rdx)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rdx)
leaq 0x58(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x8b70
testb %al, %al
je 0x1fbe4
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0x78dd
cmpq %r12, %rax
jne 0x1fc03
leaq 0x58(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0x8b70
testb %al, %al
je 0x1fc22
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0x78dd
cmpq 0x10(%rsp), %rax
jne 0x1fc41
leaq 0x58(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0x8b70
testb %al, %al
je 0x1fc60
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0x78dd
cmpq %r14, %rax
je 0x1fb12
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0x78dd
cmpq %rbx, %rax
jne 0x1fc9e
leaq 0x58(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0x8b70
testb %al, %al
je 0x1fc7f
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0x78dd
cmpq %r14, %rax
je 0x1fb56
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0x78dd
cmpq %rbx, %rax
jne 0x1fcbd
addq $0xb88, %rsp            # imm = 0xB88
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x14d32(%rip), %rdi     # 0x348a1
leaq 0x14e32(%rip), %rsi     # 0x349a8
leaq 0x15170(%rip), %rcx     # 0x34ced
movl $0xe5, %edx
callq 0x20d0
leaq 0x14d48(%rip), %rdi     # 0x348d6
leaq 0x14e13(%rip), %rsi     # 0x349a8
leaq 0x15151(%rip), %rcx     # 0x34ced
movl $0xe6, %edx
callq 0x20d0
leaq 0x14d4a(%rip), %rdi     # 0x348f7
leaq 0x14df4(%rip), %rsi     # 0x349a8
leaq 0x15132(%rip), %rcx     # 0x34ced
movl $0xe7, %edx
callq 0x20d0
leaq 0x15148(%rip), %rdi     # 0x34d14
leaq 0x14dd5(%rip), %rsi     # 0x349a8
leaq 0x15113(%rip), %rcx     # 0x34ced
movl $0xe8, %edx
callq 0x20d0
leaq 0x1504b(%rip), %rdi     # 0x34c36
leaq 0x14db6(%rip), %rsi     # 0x349a8
leaq 0x150f4(%rip), %rcx     # 0x34ced
movl $0xf3, %edx
callq 0x20d0
leaq 0x1512b(%rip), %rdi     # 0x34d35
leaq 0x14d97(%rip), %rsi     # 0x349a8
leaq 0x150d5(%rip), %rcx     # 0x34ced
movl $0xf4, %edx
callq 0x20d0
leaq 0x1500d(%rip), %rdi     # 0x34c36
leaq 0x14d78(%rip), %rsi     # 0x349a8
leaq 0x150b6(%rip), %rcx     # 0x34ced
movl $0xf6, %edx
callq 0x20d0
leaq 0x15107(%rip), %rdi     # 0x34d4f
leaq 0x14d59(%rip), %rsi     # 0x349a8
leaq 0x15097(%rip), %rcx     # 0x34ced
movl $0xf7, %edx
callq 0x20d0
leaq 0x14fcf(%rip), %rdi     # 0x34c36
leaq 0x14d3a(%rip), %rsi     # 0x349a8
leaq 0x15078(%rip), %rcx     # 0x34ced
movl $0xf9, %edx
callq 0x20d0
leaq 0x14fb0(%rip), %rdi     # 0x34c36
leaq 0x14d1b(%rip), %rsi     # 0x349a8
leaq 0x15059(%rip), %rcx     # 0x34ced
movl $0xfc, %edx
callq 0x20d0
leaq 0x150c4(%rip), %rdi     # 0x34d69
leaq 0x14cfc(%rip), %rsi     # 0x349a8
leaq 0x1503a(%rip), %rcx     # 0x34ced
movl $0xfa, %edx
callq 0x20d0
leaq 0x150a5(%rip), %rdi     # 0x34d69
leaq 0x14cdd(%rip), %rsi     # 0x349a8
leaq 0x1501b(%rip), %rcx     # 0x34ced
movl $0xfd, %edx
callq 0x20d0