// File: /workspace/github_cpp_makefile_star2_O2/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 0x165da(%rip), %rsi     # 0x3214b
leaq 0xb0(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1b8
leaq 0x10(%rsp), %r14
pushq $0x1
popq %rdx
movq %r14, %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
callq 0x74e1
movq %rax, %rbx
subq %r14, %rax
cmpq $0x70, %rax
jne 0x1be5b
pushq $0x1
popq %rdi
pushq $0x8
popq %rsi
xorl %edx, %edx
callq 0x7284
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
pushq $0x5
popq %rsi
movq %r14, %rdi
callq 0x733b
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x1be7a
leaq 0x8(%rsp), %r14
pushq $0x4
popq %rsi
movq %r14, %rdi
callq 0x733b
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x1be99
leaq 0x8(%rsp), %r14
pushq $0x3
popq %rsi
movq %r14, %rdi
callq 0x733b
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x1beb8
leaq 0x8(%rsp), %r14
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x733b
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x1bed7
pushq $0x9
popq %rsi
pushq $0x1
popq %rdi
movl %edi, %edx
callq 0x7284
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
pushq $0x5
popq %rsi
movq %r14, %rdi
callq 0x733b
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x1bef6
leaq 0x8(%rsp), %r14
pushq $0x4
popq %rsi
movq %r14, %rdi
callq 0x733b
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x1bf15
leaq 0x8(%rsp), %r14
pushq $0x3
popq %rsi
movq %r14, %rdi
callq 0x733b
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x1bf34
leaq 0x8(%rsp), %r14
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x733b
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x1bf53
pushq $0x1
popq %rdi
pushq $0x9
popq %rsi
pushq $0x2
popq %rdx
pushq $0x3
popq %rcx
callq 0x72a3
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
pushq $0x5
popq %rsi
movq %r14, %rdi
callq 0x733b
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x1bf72
leaq 0x8(%rsp), %r14
pushq $0x4
popq %rsi
movq %r14, %rdi
callq 0x733b
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x1bf91
leaq 0x8(%rsp), %r14
pushq $0x3
popq %rsi
movq %r14, %rdi
callq 0x733b
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x1bfb0
leaq 0x8(%rsp), %r14
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x733b
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x1bfcf
pushq $0x24
popq %rsi
pushq $0x1b
popq %rdx
pushq $0x1
popq %rcx
movl %ecx, %edi
callq 0x72a3
movq %rax, 0x8(%rsp)
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x1bfee
pushq $0x1
popq %rdi
pushq $0x1c
popq %rsi
pushq $0x13
popq %rdx
callq 0x7284
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movq %r14, %rdi
callq 0x7352
movq (%r14), %rdi
leaq 0x10(%rsp), %r14
movq %r14, %rsi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x1c00d
leaq 0xf67c(%rip), %rsi      # 0x2b4a3
leaq 0xb0(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1b8
pushq $0x1
popq %rdx
movq %r14, %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
callq 0x74e1
cmpq %r14, %rax
jne 0x1c02c
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r14
retq
leaq 0x16436(%rip), %rdi     # 0x32298
leaq 0x14fa8(%rip), %rsi     # 0x30e11
leaq 0x16439(%rip), %rcx     # 0x322a9
movl $0x1b2, %edx            # imm = 0x1B2
callq 0x20c0
leaq 0x15f84(%rip), %rdi     # 0x31e05
leaq 0x14f89(%rip), %rsi     # 0x30e11
leaq 0x1641a(%rip), %rcx     # 0x322a9
movl $0x1b6, %edx            # imm = 0x1B6
callq 0x20c0
leaq 0x15f65(%rip), %rdi     # 0x31e05
leaq 0x14f6a(%rip), %rsi     # 0x30e11
leaq 0x163fb(%rip), %rcx     # 0x322a9
movl $0x1b8, %edx            # imm = 0x1B8
callq 0x20c0
leaq 0x15f46(%rip), %rdi     # 0x31e05
leaq 0x14f4b(%rip), %rsi     # 0x30e11
leaq 0x163dc(%rip), %rcx     # 0x322a9
movl $0x1ba, %edx            # imm = 0x1BA
callq 0x20c0
leaq 0x15f27(%rip), %rdi     # 0x31e05
leaq 0x14f2c(%rip), %rsi     # 0x30e11
leaq 0x163bd(%rip), %rcx     # 0x322a9
movl $0x1bc, %edx            # imm = 0x1BC
callq 0x20c0
leaq 0x15f08(%rip), %rdi     # 0x31e05
leaq 0x14f0d(%rip), %rsi     # 0x30e11
leaq 0x1639e(%rip), %rcx     # 0x322a9
movl $0x1c0, %edx            # imm = 0x1C0
callq 0x20c0
leaq 0x15ee9(%rip), %rdi     # 0x31e05
leaq 0x14eee(%rip), %rsi     # 0x30e11
leaq 0x1637f(%rip), %rcx     # 0x322a9
movl $0x1c2, %edx            # imm = 0x1C2
callq 0x20c0
leaq 0x15eca(%rip), %rdi     # 0x31e05
leaq 0x14ecf(%rip), %rsi     # 0x30e11
leaq 0x16360(%rip), %rcx     # 0x322a9
movl $0x1c4, %edx            # imm = 0x1C4
callq 0x20c0
leaq 0x15eab(%rip), %rdi     # 0x31e05
leaq 0x14eb0(%rip), %rsi     # 0x30e11
leaq 0x16341(%rip), %rcx     # 0x322a9
movl $0x1c6, %edx            # imm = 0x1C6
callq 0x20c0
leaq 0x15e8c(%rip), %rdi     # 0x31e05
leaq 0x14e91(%rip), %rsi     # 0x30e11
leaq 0x16322(%rip), %rcx     # 0x322a9
movl $0x1ca, %edx            # imm = 0x1CA
callq 0x20c0
leaq 0x15e6d(%rip), %rdi     # 0x31e05
leaq 0x14e72(%rip), %rsi     # 0x30e11
leaq 0x16303(%rip), %rcx     # 0x322a9
movl $0x1cc, %edx            # imm = 0x1CC
callq 0x20c0
leaq 0x15e4e(%rip), %rdi     # 0x31e05
leaq 0x14e53(%rip), %rsi     # 0x30e11
leaq 0x162e4(%rip), %rcx     # 0x322a9
movl $0x1ce, %edx            # imm = 0x1CE
callq 0x20c0
leaq 0x15e2f(%rip), %rdi     # 0x31e05
leaq 0x14e34(%rip), %rsi     # 0x30e11
leaq 0x162c5(%rip), %rcx     # 0x322a9
movl $0x1d0, %edx            # imm = 0x1D0
callq 0x20c0
leaq 0x15e10(%rip), %rdi     # 0x31e05
leaq 0x14e15(%rip), %rsi     # 0x30e11
leaq 0x162a6(%rip), %rcx     # 0x322a9
movl $0x1d3, %edx            # imm = 0x1D3
callq 0x20c0
leaq 0x15df1(%rip), %rdi     # 0x31e05
leaq 0x14df6(%rip), %rsi     # 0x30e11
leaq 0x16287(%rip), %rcx     # 0x322a9
movl $0x1d7, %edx            # imm = 0x1D7
callq 0x20c0
leaq 0x160d5(%rip), %rdi     # 0x32108
leaq 0x14dd7(%rip), %rsi     # 0x30e11
leaq 0x16268(%rip), %rcx     # 0x322a9
movl $0x1dd, %edx            # imm = 0x1DD
callq 0x20c0