// File: /workspace/github_cpp_makefile_star2_O2/jswaff[P]prophet3/test/next__test.cpp
// Function: test_caps_in_order_black()
void test_caps_in_order_black() {
    position pos;
    set_pos(&pos,"7k/8/4p3/r2P2q1/4P3/1b6/8/7K b - - ");

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

    move e6d5 = to_capture(PAWN,E6,D5,PAWN);
    assert(is_in_move_list(e6d5,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) == e6d5);

    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 0x146dd(%rip), %rsi     # 0x332cb
leaq 0x48(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1b8
leaq 0x210(%rsp), %r14
pushq $0x1
popq %rbp
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
xorl %ecx, %ecx
callq 0x73f8
movq %rax, %r13
pushq $0x14
popq %rsi
pushq $0x1b
popq %rdx
movl %ebp, %edi
movl %ebp, %ecx
callq 0x72a3
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0xdacb
testb %al, %al
je 0x1eda1
pushq $0x3
popq %rdi
pushq $0x29
popq %rsi
pushq $0x1b
popq %rdx
pushq $0x1
popq %rcx
callq 0x72a3
movq %rax, %r14
leaq 0x210(%rsp), %rsi
movq %rax, %rdi
movq %r13, %rdx
callq 0xdacb
testb %al, %al
je 0x1edc0
pushq $0x4
popq %rdi
pushq $0x18
popq %rsi
pushq $0x1b
popq %rdx
pushq $0x1
popq %rcx
callq 0x72a3
movq %rax, %r15
leaq 0x210(%rsp), %rsi
movq %rax, %rdi
movq %r13, %rdx
callq 0xdacb
testb %al, %al
je 0x1eddf
pushq $0x5
popq %rdi
pushq $0x1e
popq %rsi
pushq $0x1b
popq %rdx
pushq $0x1
popq %rcx
callq 0x72a3
movq %rax, %r12
leaq 0x210(%rsp), %rbp
movq %rax, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0xdacb
testb %al, %al
je 0x1edfe
leaq 0x8(%rsp), %rdx
movq %rbp, 0x30(%rdx)
movq %rbp, 0x38(%rdx)
movq %rbp, 0x28(%rdx)
andl $0x0, (%rdx)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdx)
movups %xmm0, 0x18(%rdx)
leaq 0x48(%rsp), %rdi
movq %rsp, %r13
movq %r13, %rsi
callq 0x8490
movq (%r13), %rax
movq (%rax), %rdi
callq 0x73f4
cmpq %rbx, %rax
jne 0x1ee1d
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 0x1ee3c
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 %r15, %rax
jne 0x1ee5b
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 %r12, %rax
jne 0x1ee7a
addq $0x3a8, %rsp            # imm = 0x3A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x14547(%rip), %rdi     # 0x332ef
leaq 0x13cbc(%rip), %rsi     # 0x32a6b
leaq 0x1455a(%rip), %rcx     # 0x33310
movl $0x19d, %edx            # imm = 0x19D
callq 0x20c0
leaq 0x14441(%rip), %rdi     # 0x33208
leaq 0x13c9d(%rip), %rsi     # 0x32a6b
leaq 0x1453b(%rip), %rcx     # 0x33310
movl $0x1a0, %edx            # imm = 0x1A0
callq 0x20c0
leaq 0x14443(%rip), %rdi     # 0x33229
leaq 0x13c7e(%rip), %rsi     # 0x32a6b
leaq 0x1451c(%rip), %rcx     # 0x33310
movl $0x1a3, %edx            # imm = 0x1A3
callq 0x20c0
leaq 0x14445(%rip), %rdi     # 0x3324a
leaq 0x13c5f(%rip), %rsi     # 0x32a6b
leaq 0x144fd(%rip), %rcx     # 0x33310
movl $0x1a6, %edx            # imm = 0x1A6
callq 0x20c0
leaq 0x1450c(%rip), %rdi     # 0x33330
leaq 0x13c40(%rip), %rsi     # 0x32a6b
leaq 0x144de(%rip), %rcx     # 0x33310
movl $0x1b2, %edx            # imm = 0x1B2
callq 0x20c0
leaq 0x14440(%rip), %rdi     # 0x33283
leaq 0x13c21(%rip), %rsi     # 0x32a6b
leaq 0x144bf(%rip), %rcx     # 0x33310
movl $0x1b5, %edx            # imm = 0x1B5
callq 0x20c0
leaq 0x14439(%rip), %rdi     # 0x3329b
leaq 0x13c02(%rip), %rsi     # 0x32a6b
leaq 0x144a0(%rip), %rcx     # 0x33310
movl $0x1b8, %edx            # imm = 0x1B8
callq 0x20c0
leaq 0x14432(%rip), %rdi     # 0x332b3
leaq 0x13be3(%rip), %rsi     # 0x32a6b
leaq 0x14481(%rip), %rcx     # 0x33310
movl $0x1bb, %edx            # imm = 0x1BB
callq 0x20c0