// File: /workspace/github_cpp_makefile_star2_O3/jswaff[P]prophet3/test/movegen__test.cpp
// Function: test_gen_pawn_moves()
void test_gen_pawn_moves() {
    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,true);

    assert((mp - moves)==17);
    assert(is_in_move_list(to_move(PAWN,G2,G3),moves,mp));
    assert(is_in_move_list(to_move(PAWN,G2,G4),moves,mp));

    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));

    assert(is_in_move_list(to_move(PAWN,E5,E6),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,true);

    assert((mp - moves)==16);
    assert(is_in_move_list(to_move(PAWN,D7,D6),moves,mp));
    assert(is_in_move_list(to_move(PAWN,D7,D5),moves,mp));
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x278, %rsp            # imm = 0x278
leaq 0x16ffa(%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
movl $0x1, %ecx
callq 0x79cf
movq %rax, %rbx
subq %r14, %rax
cmpq $0x88, %rax
jne 0x1d4a3
movl $0x1, %edi
movl $0x36, %esi
movl $0x2e, %edx
callq 0x775c
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1d4c2
movl $0x1, %edi
movl $0x36, %esi
movl $0x26, %edx
callq 0x775c
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1d4e1
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 0x1d500
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 0x1d51f
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 0x1d53e
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 0x1d55d
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 0x1d57c
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 0x1d59b
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 0x1d5ba
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 0x1d5d9
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 0x1d5f8
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 0x1d617
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 0x1d636
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 0x1d655
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 0x1d674
movl $0x1, %edi
movl $0x1c, %esi
movl $0x14, %edx
callq 0x775c
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1d693
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 0x1d6b2
leaq 0x100ea(%rip), %rsi     # 0x2d4f3
leaq 0xb0(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa82
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %edx
movl $0x1, %ecx
callq 0x79cf
movq %rax, %rbx
subq %r14, %rax
cmpq $0x80, %rax
jne 0x1d6d1
movl $0x1, %edi
movl $0xb, %esi
movl $0x13, %edx
callq 0x775c
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1d6f0
movl $0x1, %edi
movl $0xb, %esi
movl $0x1b, %edx
callq 0x775c
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1d70f
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r14
retq
leaq 0x16c08(%rip), %rdi     # 0x340b2
leaq 0x1589d(%rip), %rsi     # 0x32d4e
leaq 0x16c0b(%rip), %rcx     # 0x340c3
movl $0x178, %edx            # imm = 0x178
callq 0x20d0
leaq 0x16c15(%rip), %rdi     # 0x340de
leaq 0x1587e(%rip), %rsi     # 0x32d4e
leaq 0x16bec(%rip), %rcx     # 0x340c3
movl $0x179, %edx            # imm = 0x179
callq 0x20d0
leaq 0x16c24(%rip), %rdi     # 0x3410c
leaq 0x1585f(%rip), %rsi     # 0x32d4e
leaq 0x16bcd(%rip), %rcx     # 0x340c3
movl $0x17a, %edx            # imm = 0x17A
callq 0x20d0
leaq 0x1683b(%rip), %rdi     # 0x33d42
leaq 0x15840(%rip), %rsi     # 0x32d4e
leaq 0x16bae(%rip), %rcx     # 0x340c3
movl $0x17e, %edx            # imm = 0x17E
callq 0x20d0
leaq 0x1681c(%rip), %rdi     # 0x33d42
leaq 0x15821(%rip), %rsi     # 0x32d4e
leaq 0x16b8f(%rip), %rcx     # 0x340c3
movl $0x180, %edx            # imm = 0x180
callq 0x20d0
leaq 0x167fd(%rip), %rdi     # 0x33d42
leaq 0x15802(%rip), %rsi     # 0x32d4e
leaq 0x16b70(%rip), %rcx     # 0x340c3
movl $0x182, %edx            # imm = 0x182
callq 0x20d0
leaq 0x167de(%rip), %rdi     # 0x33d42
leaq 0x157e3(%rip), %rsi     # 0x32d4e
leaq 0x16b51(%rip), %rcx     # 0x340c3
movl $0x184, %edx            # imm = 0x184
callq 0x20d0
leaq 0x167bf(%rip), %rdi     # 0x33d42
leaq 0x157c4(%rip), %rsi     # 0x32d4e
leaq 0x16b32(%rip), %rcx     # 0x340c3
movl $0x188, %edx            # imm = 0x188
callq 0x20d0
leaq 0x167a0(%rip), %rdi     # 0x33d42
leaq 0x157a5(%rip), %rsi     # 0x32d4e
leaq 0x16b13(%rip), %rcx     # 0x340c3
movl $0x18a, %edx            # imm = 0x18A
callq 0x20d0
leaq 0x16781(%rip), %rdi     # 0x33d42
leaq 0x15786(%rip), %rsi     # 0x32d4e
leaq 0x16af4(%rip), %rcx     # 0x340c3
movl $0x18c, %edx            # imm = 0x18C
callq 0x20d0
leaq 0x16762(%rip), %rdi     # 0x33d42
leaq 0x15767(%rip), %rsi     # 0x32d4e
leaq 0x16ad5(%rip), %rcx     # 0x340c3
movl $0x18e, %edx            # imm = 0x18E
callq 0x20d0
leaq 0x16743(%rip), %rdi     # 0x33d42
leaq 0x15748(%rip), %rsi     # 0x32d4e
leaq 0x16ab6(%rip), %rcx     # 0x340c3
movl $0x192, %edx            # imm = 0x192
callq 0x20d0
leaq 0x16724(%rip), %rdi     # 0x33d42
leaq 0x15729(%rip), %rsi     # 0x32d4e
leaq 0x16a97(%rip), %rcx     # 0x340c3
movl $0x194, %edx            # imm = 0x194
callq 0x20d0
leaq 0x16705(%rip), %rdi     # 0x33d42
leaq 0x1570a(%rip), %rsi     # 0x32d4e
leaq 0x16a78(%rip), %rcx     # 0x340c3
movl $0x196, %edx            # imm = 0x196
callq 0x20d0
leaq 0x166e6(%rip), %rdi     # 0x33d42
leaq 0x156eb(%rip), %rsi     # 0x32d4e
leaq 0x16a59(%rip), %rcx     # 0x340c3
movl $0x198, %edx            # imm = 0x198
callq 0x20d0
leaq 0x166c7(%rip), %rdi     # 0x33d42
leaq 0x156cc(%rip), %rsi     # 0x32d4e
leaq 0x16a3a(%rip), %rcx     # 0x340c3
movl $0x19b, %edx            # imm = 0x19B
callq 0x20d0
leaq 0x16aa0(%rip), %rdi     # 0x3413a
leaq 0x156ad(%rip), %rsi     # 0x32d4e
leaq 0x16a1b(%rip), %rcx     # 0x340c3
movl $0x19d, %edx            # imm = 0x19D
callq 0x20d0
leaq 0x16689(%rip), %rdi     # 0x33d42
leaq 0x1568e(%rip), %rsi     # 0x32d4e
leaq 0x169fc(%rip), %rcx     # 0x340c3
movl $0x1a0, %edx            # imm = 0x1A0
callq 0x20d0
leaq 0x16a90(%rip), %rdi     # 0x34168
leaq 0x1566f(%rip), %rsi     # 0x32d4e
leaq 0x169dd(%rip), %rcx     # 0x340c3
movl $0x1a6, %edx            # imm = 0x1A6
callq 0x20d0
leaq 0x16a82(%rip), %rdi     # 0x34179
leaq 0x15650(%rip), %rsi     # 0x32d4e
leaq 0x169be(%rip), %rcx     # 0x340c3
movl $0x1a7, %edx            # imm = 0x1A7
callq 0x20d0
leaq 0x16a91(%rip), %rdi     # 0x341a7
leaq 0x15631(%rip), %rsi     # 0x32d4e
leaq 0x1699f(%rip), %rcx     # 0x340c3
movl $0x1a8, %edx            # imm = 0x1A8
callq 0x20d0