// File: /workspace/github_cpp_makefile_star2_O2/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 0x14e2b(%rip), %rsi     # 0x32943
leaq 0x58(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1b8
leaq 0x220(%rsp), %rdi
pushq $0x1
popq %rbp
movq %rbx, %rsi
movl %ebp, %edx
movl %ebp, %ecx
callq 0x73f8
movq %rax, %r15
pushq $0x1b
popq %rsi
pushq $0x12
popq %rdx
movl %ebp, %edi
movl %ebp, %ecx
callq 0x72a3
leaq 0x10(%rsp), %rbx
movq %rax, (%rbx)
movq %rbx, %rdi
callq 0x7352
pushq $0x6
popq %r12
pushq $0x19
popq %rsi
pushq $0x1a
popq %r14
movl %r12d, %edi
movl %r14d, %edx
movl %ebp, %ecx
callq 0x72a3
movq %rax, %r13
pushq $0x3
popq %rdi
pushq $0x3e
popq %rsi
movl %r14d, %edx
movl %ebp, %ecx
callq 0x72a3
movq %rax, %r14
pushq $0x4
popq %rdi
pushq $0xe
popq %rdx
movl %r12d, %esi
callq 0x7284
movq %rax, %r12
movq (%rbx), %rdi
leaq 0x220(%rsp), %rsi
movq %r15, %rdx
callq 0xdacb
testb %al, %al
je 0x1dd2f
leaq 0x220(%rsp), %rsi
movq %r13, %rdi
movq %r15, %rdx
callq 0xdacb
testb %al, %al
je 0x1dd4e
leaq 0x220(%rsp), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0xdacb
testb %al, %al
je 0x1dd6d
leaq 0x220(%rsp), %rbx
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0xdacb
testb %al, %al
je 0x1dd8c
leaq 0x18(%rsp), %rdx
movq %rbx, 0x30(%rdx)
movq %rbx, 0x38(%rdx)
movq %rbx, 0x28(%rdx)
movq %r12, 0x8(%rdx)
movq 0x10(%rsp), %rax
movq %rax, 0x10(%rdx)
andl $0x0, (%rdx)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rdx)
leaq 0x58(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x8490
testb %al, %al
je 0x1ddab
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0x73f4
cmpq %r12, %rax
jne 0x1ddca
leaq 0x58(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0x8490
testb %al, %al
je 0x1dde9
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0x73f4
cmpq 0x10(%rsp), %rax
jne 0x1de08
leaq 0x58(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0x8490
testb %al, %al
je 0x1de27
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0x73f4
cmpq %r14, %rax
je 0x1dcd9
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0x73f4
cmpq %r13, %rax
jne 0x1de65
leaq 0x58(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0x8490
testb %al, %al
je 0x1de46
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0x73f4
cmpq %r14, %rax
je 0x1dd1d
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0x73f4
cmpq %r13, %rax
jne 0x1de84
addq $0xb88, %rsp            # imm = 0xB88
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x14c2e(%rip), %rdi     # 0x32964
leaq 0x14d2e(%rip), %rsi     # 0x32a6b
leaq 0x1506c(%rip), %rcx     # 0x32db0
movl $0xe5, %edx
callq 0x20c0
leaq 0x14c44(%rip), %rdi     # 0x32999
leaq 0x14d0f(%rip), %rsi     # 0x32a6b
leaq 0x1504d(%rip), %rcx     # 0x32db0
movl $0xe6, %edx
callq 0x20c0
leaq 0x14c46(%rip), %rdi     # 0x329ba
leaq 0x14cf0(%rip), %rsi     # 0x32a6b
leaq 0x1502e(%rip), %rcx     # 0x32db0
movl $0xe7, %edx
callq 0x20c0
leaq 0x15044(%rip), %rdi     # 0x32dd7
leaq 0x14cd1(%rip), %rsi     # 0x32a6b
leaq 0x1500f(%rip), %rcx     # 0x32db0
movl $0xe8, %edx
callq 0x20c0
leaq 0x14f47(%rip), %rdi     # 0x32cf9
leaq 0x14cb2(%rip), %rsi     # 0x32a6b
leaq 0x14ff0(%rip), %rcx     # 0x32db0
movl $0xf3, %edx
callq 0x20c0
leaq 0x15027(%rip), %rdi     # 0x32df8
leaq 0x14c93(%rip), %rsi     # 0x32a6b
leaq 0x14fd1(%rip), %rcx     # 0x32db0
movl $0xf4, %edx
callq 0x20c0
leaq 0x14f09(%rip), %rdi     # 0x32cf9
leaq 0x14c74(%rip), %rsi     # 0x32a6b
leaq 0x14fb2(%rip), %rcx     # 0x32db0
movl $0xf6, %edx
callq 0x20c0
leaq 0x15003(%rip), %rdi     # 0x32e12
leaq 0x14c55(%rip), %rsi     # 0x32a6b
leaq 0x14f93(%rip), %rcx     # 0x32db0
movl $0xf7, %edx
callq 0x20c0
leaq 0x14ecb(%rip), %rdi     # 0x32cf9
leaq 0x14c36(%rip), %rsi     # 0x32a6b
leaq 0x14f74(%rip), %rcx     # 0x32db0
movl $0xf9, %edx
callq 0x20c0
leaq 0x14eac(%rip), %rdi     # 0x32cf9
leaq 0x14c17(%rip), %rsi     # 0x32a6b
leaq 0x14f55(%rip), %rcx     # 0x32db0
movl $0xfc, %edx
callq 0x20c0
leaq 0x14fc0(%rip), %rdi     # 0x32e2c
leaq 0x14bf8(%rip), %rsi     # 0x32a6b
leaq 0x14f36(%rip), %rcx     # 0x32db0
movl $0xfa, %edx
callq 0x20c0
leaq 0x14fa1(%rip), %rdi     # 0x32e2c
leaq 0x14bd9(%rip), %rsi     # 0x32a6b
leaq 0x14f17(%rip), %rcx     # 0x32db0
movl $0xfd, %edx
callq 0x20c0