// File: /workspace/github_cpp_makefile_star2_O1/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 0x14d5b(%rip), %rsi     # 0x34800
leaq 0x58(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa74
leaq 0x220(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
movl $0x1, %edx
movl $0x1, %ecx
callq 0x7840
movq %rax, %r15
movl $0x1, %edi
movl $0x1b, %esi
movl $0x12, %edx
movl $0x1, %ecx
callq 0x76d7
leaq 0x10(%rsp), %rbp
movq %rax, (%rbp)
movq %rbp, %rdi
callq 0x7797
movl $0x6, %edi
movl $0x19, %esi
movl $0x1a, %edx
movl $0x1, %ecx
callq 0x76d7
movq %rax, %rbx
movl $0x3, %edi
movl $0x3e, %esi
movl $0x1a, %edx
movl $0x1, %ecx
callq 0x76d7
movq %rax, %r14
movl $0x4, %edi
movl $0x6, %esi
movl $0xe, %edx
callq 0x76b8
movq %rax, %r12
movq (%rbp), %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0xe727
testb %al, %al
je 0x1fcdc
leaq 0x220(%rsp), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0xe727
testb %al, %al
je 0x1fcfb
leaq 0x220(%rsp), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0xe727
testb %al, %al
je 0x1fd1a
leaq 0x220(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0xe727
testb %al, %al
je 0x1fd39
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 0x8adc
testb %al, %al
je 0x1fd58
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0x783c
cmpq %r12, %rax
jne 0x1fd77
leaq 0x58(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0x8adc
testb %al, %al
je 0x1fd96
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0x783c
cmpq 0x10(%rsp), %rax
jne 0x1fdb5
leaq 0x58(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0x8adc
testb %al, %al
je 0x1fdd4
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0x783c
cmpq %r14, %rax
je 0x1fc86
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0x783c
cmpq %rbx, %rax
jne 0x1fe12
leaq 0x58(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0x8adc
testb %al, %al
je 0x1fdf3
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0x783c
cmpq %r14, %rax
je 0x1fcca
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0x783c
cmpq %rbx, %rax
jne 0x1fe31
addq $0xb88, %rsp            # imm = 0xB88
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x14b3e(%rip), %rdi     # 0x34821
leaq 0x14c3e(%rip), %rsi     # 0x34928
leaq 0x14f7c(%rip), %rcx     # 0x34c6d
movl $0xe5, %edx
callq 0x20d0
leaq 0x14b54(%rip), %rdi     # 0x34856
leaq 0x14c1f(%rip), %rsi     # 0x34928
leaq 0x14f5d(%rip), %rcx     # 0x34c6d
movl $0xe6, %edx
callq 0x20d0
leaq 0x14b56(%rip), %rdi     # 0x34877
leaq 0x14c00(%rip), %rsi     # 0x34928
leaq 0x14f3e(%rip), %rcx     # 0x34c6d
movl $0xe7, %edx
callq 0x20d0
leaq 0x14f54(%rip), %rdi     # 0x34c94
leaq 0x14be1(%rip), %rsi     # 0x34928
leaq 0x14f1f(%rip), %rcx     # 0x34c6d
movl $0xe8, %edx
callq 0x20d0
leaq 0x14e57(%rip), %rdi     # 0x34bb6
leaq 0x14bc2(%rip), %rsi     # 0x34928
leaq 0x14f00(%rip), %rcx     # 0x34c6d
movl $0xf3, %edx
callq 0x20d0
leaq 0x14f37(%rip), %rdi     # 0x34cb5
leaq 0x14ba3(%rip), %rsi     # 0x34928
leaq 0x14ee1(%rip), %rcx     # 0x34c6d
movl $0xf4, %edx
callq 0x20d0
leaq 0x14e19(%rip), %rdi     # 0x34bb6
leaq 0x14b84(%rip), %rsi     # 0x34928
leaq 0x14ec2(%rip), %rcx     # 0x34c6d
movl $0xf6, %edx
callq 0x20d0
leaq 0x14f13(%rip), %rdi     # 0x34ccf
leaq 0x14b65(%rip), %rsi     # 0x34928
leaq 0x14ea3(%rip), %rcx     # 0x34c6d
movl $0xf7, %edx
callq 0x20d0
leaq 0x14ddb(%rip), %rdi     # 0x34bb6
leaq 0x14b46(%rip), %rsi     # 0x34928
leaq 0x14e84(%rip), %rcx     # 0x34c6d
movl $0xf9, %edx
callq 0x20d0
leaq 0x14dbc(%rip), %rdi     # 0x34bb6
leaq 0x14b27(%rip), %rsi     # 0x34928
leaq 0x14e65(%rip), %rcx     # 0x34c6d
movl $0xfc, %edx
callq 0x20d0
leaq 0x14ed0(%rip), %rdi     # 0x34ce9
leaq 0x14b08(%rip), %rsi     # 0x34928
leaq 0x14e46(%rip), %rcx     # 0x34c6d
movl $0xfa, %edx
callq 0x20d0
leaq 0x14eb1(%rip), %rdi     # 0x34ce9
leaq 0x14ae9(%rip), %rsi     # 0x34928
leaq 0x14e27(%rip), %rcx     # 0x34c6d
movl $0xfd, %edx
callq 0x20d0