// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/test/movegen__test.cpp
// Function: test_gen_pawn_captures()
void test_gen_pawn_captures() {
    position pos;
    set_pos(&pos,"2b1k3/PP6/8/3pP3/4P3/8/6P1/4K3 w - d6 0 1");
    move moves[20],*mp,mv;

    mp = gen_pawn_moves(moves,&pos,true,false);

    assert((mp - moves)==14);

    mv = to_move(PAWN,A7,A8);
    set_promopiece(&mv,QUEEN);
    assert(is_in_move_list(mv,moves,mp));
    set_promopiece(&mv,ROOK);
    assert(is_in_move_list(mv,moves,mp));
    set_promopiece(&mv,BISHOP);
    assert(is_in_move_list(mv,moves,mp));
    set_promopiece(&mv,KNIGHT);
    assert(is_in_move_list(mv,moves,mp));

    mv = to_move(PAWN,B7,B8);
    set_promopiece(&mv,QUEEN);
    assert(is_in_move_list(mv,moves,mp));
    set_promopiece(&mv,ROOK);
    assert(is_in_move_list(mv,moves,mp));
    set_promopiece(&mv,BISHOP);
    assert(is_in_move_list(mv,moves,mp));
    set_promopiece(&mv,KNIGHT);
    assert(is_in_move_list(mv,moves,mp));

    mv = to_capture(PAWN,B7,C8,BISHOP);
    set_promopiece(&mv,QUEEN);
    assert(is_in_move_list(mv,moves,mp));
    set_promopiece(&mv,ROOK);
    assert(is_in_move_list(mv,moves,mp));
    set_promopiece(&mv,BISHOP);
    assert(is_in_move_list(mv,moves,mp));
    set_promopiece(&mv,KNIGHT);
    assert(is_in_move_list(mv,moves,mp));

    mv = to_capture(PAWN,E4,D5,PAWN);
    assert(is_in_move_list(mv,moves,mp));

    mv = to_move(PAWN,E5,D6);
    set_epcapture(&mv);
    assert(is_in_move_list(mv,moves,mp));

    // from black
    set_pos(&pos,"rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1");
    mp = gen_pawn_moves(moves,&pos,true,false);

    assert((mp - moves)==0);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x278, %rsp            # imm = 0x278
leaq 0x16949(%rip), %rsi     # 0x34088
leaq 0xb0(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa82
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x79cf
movq %rax, %rbx
subq %r14, %rax
cmpq $0x70, %rax
jne 0x1da67
movl $0x1, %edi
movl $0x8, %esi
xorl %edx, %edx
callq 0x775c
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movq %r14, %rdi
movl $0x5, %esi
callq 0x7824
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1da86
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x4, %esi
callq 0x7824
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1daa5
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x3, %esi
callq 0x7824
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1dac4
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x2, %esi
callq 0x7824
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1dae3
movl $0x1, %edi
movl $0x9, %esi
movl $0x1, %edx
callq 0x775c
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movq %r14, %rdi
movl $0x5, %esi
callq 0x7824
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1db02
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x4, %esi
callq 0x7824
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1db21
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x3, %esi
callq 0x7824
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1db40
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x2, %esi
callq 0x7824
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1db5f
movl $0x1, %edi
movl $0x9, %esi
movl $0x2, %edx
movl $0x3, %ecx
callq 0x777b
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movq %r14, %rdi
movl $0x5, %esi
callq 0x7824
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1db7e
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x4, %esi
callq 0x7824
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1db9d
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x3, %esi
callq 0x7824
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1dbbc
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x2, %esi
callq 0x7824
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1dbdb
movl $0x1, %edi
movl $0x24, %esi
movl $0x1b, %edx
movl $0x1, %ecx
callq 0x777b
movq %rax, 0x8(%rsp)
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1dbfa
movl $0x1, %edi
movl $0x1c, %esi
movl $0x13, %edx
callq 0x775c
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movq %r14, %rdi
callq 0x783b
movq (%r14), %rdi
leaq 0x10(%rsp), %r14
movq %r14, %rsi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1dc19
leaq 0xfac2(%rip), %rsi      # 0x2d4f3
leaq 0xb0(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa82
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x79cf
cmpq %r14, %rax
jne 0x1dc38
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r14
retq
leaq 0x16767(%rip), %rdi     # 0x341d5
leaq 0x152d9(%rip), %rsi     # 0x32d4e
leaq 0x1676a(%rip), %rcx     # 0x341e6
movl $0x1b2, %edx            # imm = 0x1B2
callq 0x20d0
leaq 0x162b5(%rip), %rdi     # 0x33d42
leaq 0x152ba(%rip), %rsi     # 0x32d4e
leaq 0x1674b(%rip), %rcx     # 0x341e6
movl $0x1b6, %edx            # imm = 0x1B6
callq 0x20d0
leaq 0x16296(%rip), %rdi     # 0x33d42
leaq 0x1529b(%rip), %rsi     # 0x32d4e
leaq 0x1672c(%rip), %rcx     # 0x341e6
movl $0x1b8, %edx            # imm = 0x1B8
callq 0x20d0
leaq 0x16277(%rip), %rdi     # 0x33d42
leaq 0x1527c(%rip), %rsi     # 0x32d4e
leaq 0x1670d(%rip), %rcx     # 0x341e6
movl $0x1ba, %edx            # imm = 0x1BA
callq 0x20d0
leaq 0x16258(%rip), %rdi     # 0x33d42
leaq 0x1525d(%rip), %rsi     # 0x32d4e
leaq 0x166ee(%rip), %rcx     # 0x341e6
movl $0x1bc, %edx            # imm = 0x1BC
callq 0x20d0
leaq 0x16239(%rip), %rdi     # 0x33d42
leaq 0x1523e(%rip), %rsi     # 0x32d4e
leaq 0x166cf(%rip), %rcx     # 0x341e6
movl $0x1c0, %edx            # imm = 0x1C0
callq 0x20d0
leaq 0x1621a(%rip), %rdi     # 0x33d42
leaq 0x1521f(%rip), %rsi     # 0x32d4e
leaq 0x166b0(%rip), %rcx     # 0x341e6
movl $0x1c2, %edx            # imm = 0x1C2
callq 0x20d0
leaq 0x161fb(%rip), %rdi     # 0x33d42
leaq 0x15200(%rip), %rsi     # 0x32d4e
leaq 0x16691(%rip), %rcx     # 0x341e6
movl $0x1c4, %edx            # imm = 0x1C4
callq 0x20d0
leaq 0x161dc(%rip), %rdi     # 0x33d42
leaq 0x151e1(%rip), %rsi     # 0x32d4e
leaq 0x16672(%rip), %rcx     # 0x341e6
movl $0x1c6, %edx            # imm = 0x1C6
callq 0x20d0
leaq 0x161bd(%rip), %rdi     # 0x33d42
leaq 0x151c2(%rip), %rsi     # 0x32d4e
leaq 0x16653(%rip), %rcx     # 0x341e6
movl $0x1ca, %edx            # imm = 0x1CA
callq 0x20d0
leaq 0x1619e(%rip), %rdi     # 0x33d42
leaq 0x151a3(%rip), %rsi     # 0x32d4e
leaq 0x16634(%rip), %rcx     # 0x341e6
movl $0x1cc, %edx            # imm = 0x1CC
callq 0x20d0
leaq 0x1617f(%rip), %rdi     # 0x33d42
leaq 0x15184(%rip), %rsi     # 0x32d4e
leaq 0x16615(%rip), %rcx     # 0x341e6
movl $0x1ce, %edx            # imm = 0x1CE
callq 0x20d0
leaq 0x16160(%rip), %rdi     # 0x33d42
leaq 0x15165(%rip), %rsi     # 0x32d4e
leaq 0x165f6(%rip), %rcx     # 0x341e6
movl $0x1d0, %edx            # imm = 0x1D0
callq 0x20d0
leaq 0x16141(%rip), %rdi     # 0x33d42
leaq 0x15146(%rip), %rsi     # 0x32d4e
leaq 0x165d7(%rip), %rcx     # 0x341e6
movl $0x1d3, %edx            # imm = 0x1D3
callq 0x20d0
leaq 0x16122(%rip), %rdi     # 0x33d42
leaq 0x15127(%rip), %rsi     # 0x32d4e
leaq 0x165b8(%rip), %rcx     # 0x341e6
movl $0x1d7, %edx            # imm = 0x1D7
callq 0x20d0
leaq 0x16406(%rip), %rdi     # 0x34045
leaq 0x15108(%rip), %rsi     # 0x32d4e
leaq 0x16599(%rip), %rcx     # 0x341e6
movl $0x1dd, %edx            # imm = 0x1DD
callq 0x20d0