// File: /workspace/github_cpp_makefile_star2_O1/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 0x16755(%rip), %rsi     # 0x34008
leaq 0xb0(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa74
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x792f
movq %rax, %rbx
subq %r14, %rax
cmpq $0x70, %rax
jne 0x1dbdb
movl $0x1, %edi
movl $0x8, %esi
xorl %edx, %edx
callq 0x76b8
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movq %r14, %rdi
movl $0x5, %esi
callq 0x7780
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xe727
testb %al, %al
je 0x1dbfa
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x4, %esi
callq 0x7780
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xe727
testb %al, %al
je 0x1dc19
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x3, %esi
callq 0x7780
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xe727
testb %al, %al
je 0x1dc38
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x2, %esi
callq 0x7780
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xe727
testb %al, %al
je 0x1dc57
movl $0x1, %edi
movl $0x9, %esi
movl $0x1, %edx
callq 0x76b8
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movq %r14, %rdi
movl $0x5, %esi
callq 0x7780
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xe727
testb %al, %al
je 0x1dc76
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x4, %esi
callq 0x7780
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xe727
testb %al, %al
je 0x1dc95
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x3, %esi
callq 0x7780
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xe727
testb %al, %al
je 0x1dcb4
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x2, %esi
callq 0x7780
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xe727
testb %al, %al
je 0x1dcd3
movl $0x1, %edi
movl $0x9, %esi
movl $0x2, %edx
movl $0x3, %ecx
callq 0x76d7
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movq %r14, %rdi
movl $0x5, %esi
callq 0x7780
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xe727
testb %al, %al
je 0x1dcf2
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x4, %esi
callq 0x7780
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xe727
testb %al, %al
je 0x1dd11
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x3, %esi
callq 0x7780
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xe727
testb %al, %al
je 0x1dd30
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x2, %esi
callq 0x7780
movq (%r14), %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0xe727
testb %al, %al
je 0x1dd4f
movl $0x1, %edi
movl $0x24, %esi
movl $0x1b, %edx
movl $0x1, %ecx
callq 0x76d7
movq %rax, 0x8(%rsp)
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xe727
testb %al, %al
je 0x1dd6e
movl $0x1, %edi
movl $0x1c, %esi
movl $0x13, %edx
callq 0x76b8
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movq %r14, %rdi
callq 0x7797
movq (%r14), %rdi
leaq 0x10(%rsp), %r14
movq %r14, %rsi
movq %rbx, %rdx
callq 0xe727
testb %al, %al
je 0x1dd8d
leaq 0xf8ce(%rip), %rsi      # 0x2d473
leaq 0xb0(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa74
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x792f
cmpq %r14, %rax
jne 0x1ddac
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r14
retq
leaq 0x16573(%rip), %rdi     # 0x34155
leaq 0x150e5(%rip), %rsi     # 0x32cce
leaq 0x16576(%rip), %rcx     # 0x34166
movl $0x1b2, %edx            # imm = 0x1B2
callq 0x20d0
leaq 0x160c1(%rip), %rdi     # 0x33cc2
leaq 0x150c6(%rip), %rsi     # 0x32cce
leaq 0x16557(%rip), %rcx     # 0x34166
movl $0x1b6, %edx            # imm = 0x1B6
callq 0x20d0
leaq 0x160a2(%rip), %rdi     # 0x33cc2
leaq 0x150a7(%rip), %rsi     # 0x32cce
leaq 0x16538(%rip), %rcx     # 0x34166
movl $0x1b8, %edx            # imm = 0x1B8
callq 0x20d0
leaq 0x16083(%rip), %rdi     # 0x33cc2
leaq 0x15088(%rip), %rsi     # 0x32cce
leaq 0x16519(%rip), %rcx     # 0x34166
movl $0x1ba, %edx            # imm = 0x1BA
callq 0x20d0
leaq 0x16064(%rip), %rdi     # 0x33cc2
leaq 0x15069(%rip), %rsi     # 0x32cce
leaq 0x164fa(%rip), %rcx     # 0x34166
movl $0x1bc, %edx            # imm = 0x1BC
callq 0x20d0
leaq 0x16045(%rip), %rdi     # 0x33cc2
leaq 0x1504a(%rip), %rsi     # 0x32cce
leaq 0x164db(%rip), %rcx     # 0x34166
movl $0x1c0, %edx            # imm = 0x1C0
callq 0x20d0
leaq 0x16026(%rip), %rdi     # 0x33cc2
leaq 0x1502b(%rip), %rsi     # 0x32cce
leaq 0x164bc(%rip), %rcx     # 0x34166
movl $0x1c2, %edx            # imm = 0x1C2
callq 0x20d0
leaq 0x16007(%rip), %rdi     # 0x33cc2
leaq 0x1500c(%rip), %rsi     # 0x32cce
leaq 0x1649d(%rip), %rcx     # 0x34166
movl $0x1c4, %edx            # imm = 0x1C4
callq 0x20d0
leaq 0x15fe8(%rip), %rdi     # 0x33cc2
leaq 0x14fed(%rip), %rsi     # 0x32cce
leaq 0x1647e(%rip), %rcx     # 0x34166
movl $0x1c6, %edx            # imm = 0x1C6
callq 0x20d0
leaq 0x15fc9(%rip), %rdi     # 0x33cc2
leaq 0x14fce(%rip), %rsi     # 0x32cce
leaq 0x1645f(%rip), %rcx     # 0x34166
movl $0x1ca, %edx            # imm = 0x1CA
callq 0x20d0
leaq 0x15faa(%rip), %rdi     # 0x33cc2
leaq 0x14faf(%rip), %rsi     # 0x32cce
leaq 0x16440(%rip), %rcx     # 0x34166
movl $0x1cc, %edx            # imm = 0x1CC
callq 0x20d0
leaq 0x15f8b(%rip), %rdi     # 0x33cc2
leaq 0x14f90(%rip), %rsi     # 0x32cce
leaq 0x16421(%rip), %rcx     # 0x34166
movl $0x1ce, %edx            # imm = 0x1CE
callq 0x20d0
leaq 0x15f6c(%rip), %rdi     # 0x33cc2
leaq 0x14f71(%rip), %rsi     # 0x32cce
leaq 0x16402(%rip), %rcx     # 0x34166
movl $0x1d0, %edx            # imm = 0x1D0
callq 0x20d0
leaq 0x15f4d(%rip), %rdi     # 0x33cc2
leaq 0x14f52(%rip), %rsi     # 0x32cce
leaq 0x163e3(%rip), %rcx     # 0x34166
movl $0x1d3, %edx            # imm = 0x1D3
callq 0x20d0
leaq 0x15f2e(%rip), %rdi     # 0x33cc2
leaq 0x14f33(%rip), %rsi     # 0x32cce
leaq 0x163c4(%rip), %rcx     # 0x34166
movl $0x1d7, %edx            # imm = 0x1D7
callq 0x20d0
leaq 0x16212(%rip), %rdi     # 0x33fc5
leaq 0x14f14(%rip), %rsi     # 0x32cce
leaq 0x163a5(%rip), %rcx     # 0x34166
movl $0x1dd, %edx            # imm = 0x1DD
callq 0x20d0