// File: /workspace/github_cpp_makefile_star2_O1/jswaff[P]prophet3/test/next__test.cpp
// Function: test_caps_in_order_white()
void test_caps_in_order_white() {
    position pos;
    set_pos(&pos,"7k/8/4p3/R2p2Q1/4P3/1B6/8/7K w - - ");

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

    move e4d5 = to_capture(PAWN,E4,D5,PAWN);
    assert(is_in_move_list(e4d5,moves,endp));

    move b3d5 = to_capture(BISHOP,B3,D5,PAWN);
    assert(is_in_move_list(b3d5,moves,endp));

    move a5d5 = to_capture(ROOK,A5,D5,PAWN);
    assert(is_in_move_list(a5d5,moves,endp));

    move g5d5 = to_capture(QUEEN,G5,D5,PAWN);
    assert(is_in_move_list(g5d5,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) == e4d5);

    next(&pos,&m,&mo_dto);
    assert(clear_score(*m) == b3d5);

    next(&pos,&m,&mo_dto);
    assert(clear_score(*m) == a5d5);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3a8, %rsp            # imm = 0x3A8
leaq 0x1473e(%rip), %rsi     # 0x35060
leaq 0x48(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa74
leaq 0x210(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x7840
movq %rax, %r13
movl $0x1, %edi
movl $0x24, %esi
movl $0x1b, %edx
movl $0x1, %ecx
callq 0x76d7
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0xe727
testb %al, %al
je 0x20afa
movl $0x3, %edi
movl $0x29, %esi
movl $0x1b, %edx
movl $0x1, %ecx
callq 0x76d7
movq %rax, %r14
leaq 0x210(%rsp), %rsi
movq %rax, %rdi
movq %r13, %rdx
callq 0xe727
testb %al, %al
je 0x20b19
movl $0x4, %edi
movl $0x18, %esi
movl $0x1b, %edx
movl $0x1, %ecx
callq 0x76d7
movq %rax, %r15
leaq 0x210(%rsp), %rsi
movq %rax, %rdi
movq %r13, %rdx
callq 0xe727
testb %al, %al
je 0x20b38
movl $0x5, %edi
movl $0x1e, %esi
movl $0x1b, %edx
movl $0x1, %ecx
callq 0x76d7
movq %rax, %r12
leaq 0x210(%rsp), %rbp
movq %rax, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0xe727
testb %al, %al
je 0x20b57
leaq 0x8(%rsp), %rdx
movq %rbp, 0x30(%rdx)
movq %rbp, 0x38(%rdx)
movq %rbp, 0x28(%rdx)
movl $0x0, (%rdx)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdx)
movups %xmm0, 0x18(%rdx)
leaq 0x48(%rsp), %rdi
movq %rsp, %r13
movq %r13, %rsi
callq 0x8adc
movq (%r13), %rax
movq (%rax), %rdi
callq 0x783c
cmpq %rbx, %rax
jne 0x20b76
leaq 0x48(%rsp), %rdi
movq %rsp, %rbx
leaq 0x8(%rsp), %rdx
movq %rbx, %rsi
callq 0x8adc
movq (%rbx), %rax
movq (%rax), %rdi
callq 0x783c
cmpq %r14, %rax
jne 0x20b95
leaq 0x48(%rsp), %rdi
movq %rsp, %rbx
leaq 0x8(%rsp), %rdx
movq %rbx, %rsi
callq 0x8adc
movq (%rbx), %rax
movq (%rax), %rdi
callq 0x783c
cmpq %r15, %rax
jne 0x20bb4
leaq 0x48(%rsp), %rdi
movq %rsp, %rbx
leaq 0x8(%rsp), %rdx
movq %rbx, %rsi
callq 0x8adc
movq (%rbx), %rax
movq (%rax), %rdi
callq 0x783c
cmpq %r12, %rax
jne 0x20bd3
addq $0x3a8, %rsp            # imm = 0x3A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x14583(%rip), %rdi     # 0x35084
leaq 0x13e20(%rip), %rsi     # 0x34928
leaq 0x14596(%rip), %rcx     # 0x350a5
movl $0x174, %edx            # imm = 0x174
callq 0x20d0
leaq 0x145a5(%rip), %rdi     # 0x350c5
leaq 0x13e01(%rip), %rsi     # 0x34928
leaq 0x14577(%rip), %rcx     # 0x350a5
movl $0x177, %edx            # imm = 0x177
callq 0x20d0
leaq 0x145a7(%rip), %rdi     # 0x350e6
leaq 0x13de2(%rip), %rsi     # 0x34928
leaq 0x14558(%rip), %rcx     # 0x350a5
movl $0x17a, %edx            # imm = 0x17A
callq 0x20d0
leaq 0x145a9(%rip), %rdi     # 0x35107
leaq 0x13dc3(%rip), %rsi     # 0x34928
leaq 0x14539(%rip), %rcx     # 0x350a5
movl $0x17d, %edx            # imm = 0x17D
callq 0x20d0
leaq 0x145ab(%rip), %rdi     # 0x35128
leaq 0x13da4(%rip), %rsi     # 0x34928
leaq 0x1451a(%rip), %rcx     # 0x350a5
movl $0x189, %edx            # imm = 0x189
callq 0x20d0
leaq 0x145a4(%rip), %rdi     # 0x35140
leaq 0x13d85(%rip), %rsi     # 0x34928
leaq 0x144fb(%rip), %rcx     # 0x350a5
movl $0x18c, %edx            # imm = 0x18C
callq 0x20d0
leaq 0x1459d(%rip), %rdi     # 0x35158
leaq 0x13d66(%rip), %rsi     # 0x34928
leaq 0x144dc(%rip), %rcx     # 0x350a5
movl $0x18f, %edx            # imm = 0x18F
callq 0x20d0
leaq 0x14596(%rip), %rdi     # 0x35170
leaq 0x13d47(%rip), %rsi     # 0x34928
leaq 0x144bd(%rip), %rcx     # 0x350a5
movl $0x192, %edx            # imm = 0x192
callq 0x20d0