// File: /workspace/github_cpp_makefile_star2_O1/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 0x16e06(%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
movl $0x1, %ecx
callq 0x792f
movq %rax, %rbx
subq %r14, %rax
cmpq $0x88, %rax
jne 0x1d617
movl $0x1, %edi
movl $0x36, %esi
movl $0x2e, %edx
callq 0x76b8
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xe727
testb %al, %al
je 0x1d636
movl $0x1, %edi
movl $0x36, %esi
movl $0x26, %edx
callq 0x76b8
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xe727
testb %al, %al
je 0x1d655
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 0x1d674
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 0x1d693
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 0x1d6b2
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 0x1d6d1
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 0x1d6f0
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 0x1d70f
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 0x1d72e
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 0x1d74d
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 0x1d76c
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 0x1d78b
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 0x1d7aa
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 0x1d7c9
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 0x1d7e8
movl $0x1, %edi
movl $0x1c, %esi
movl $0x14, %edx
callq 0x76b8
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xe727
testb %al, %al
je 0x1d807
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 0x1d826
leaq 0xfef6(%rip), %rsi      # 0x2d473
leaq 0xb0(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa74
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %edx
movl $0x1, %ecx
callq 0x792f
movq %rax, %rbx
subq %r14, %rax
cmpq $0x80, %rax
jne 0x1d845
movl $0x1, %edi
movl $0xb, %esi
movl $0x13, %edx
callq 0x76b8
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xe727
testb %al, %al
je 0x1d864
movl $0x1, %edi
movl $0xb, %esi
movl $0x1b, %edx
callq 0x76b8
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xe727
testb %al, %al
je 0x1d883
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r14
retq
leaq 0x16a14(%rip), %rdi     # 0x34032
leaq 0x156a9(%rip), %rsi     # 0x32cce
leaq 0x16a17(%rip), %rcx     # 0x34043
movl $0x178, %edx            # imm = 0x178
callq 0x20d0
leaq 0x16a21(%rip), %rdi     # 0x3405e
leaq 0x1568a(%rip), %rsi     # 0x32cce
leaq 0x169f8(%rip), %rcx     # 0x34043
movl $0x179, %edx            # imm = 0x179
callq 0x20d0
leaq 0x16a30(%rip), %rdi     # 0x3408c
leaq 0x1566b(%rip), %rsi     # 0x32cce
leaq 0x169d9(%rip), %rcx     # 0x34043
movl $0x17a, %edx            # imm = 0x17A
callq 0x20d0
leaq 0x16647(%rip), %rdi     # 0x33cc2
leaq 0x1564c(%rip), %rsi     # 0x32cce
leaq 0x169ba(%rip), %rcx     # 0x34043
movl $0x17e, %edx            # imm = 0x17E
callq 0x20d0
leaq 0x16628(%rip), %rdi     # 0x33cc2
leaq 0x1562d(%rip), %rsi     # 0x32cce
leaq 0x1699b(%rip), %rcx     # 0x34043
movl $0x180, %edx            # imm = 0x180
callq 0x20d0
leaq 0x16609(%rip), %rdi     # 0x33cc2
leaq 0x1560e(%rip), %rsi     # 0x32cce
leaq 0x1697c(%rip), %rcx     # 0x34043
movl $0x182, %edx            # imm = 0x182
callq 0x20d0
leaq 0x165ea(%rip), %rdi     # 0x33cc2
leaq 0x155ef(%rip), %rsi     # 0x32cce
leaq 0x1695d(%rip), %rcx     # 0x34043
movl $0x184, %edx            # imm = 0x184
callq 0x20d0
leaq 0x165cb(%rip), %rdi     # 0x33cc2
leaq 0x155d0(%rip), %rsi     # 0x32cce
leaq 0x1693e(%rip), %rcx     # 0x34043
movl $0x188, %edx            # imm = 0x188
callq 0x20d0
leaq 0x165ac(%rip), %rdi     # 0x33cc2
leaq 0x155b1(%rip), %rsi     # 0x32cce
leaq 0x1691f(%rip), %rcx     # 0x34043
movl $0x18a, %edx            # imm = 0x18A
callq 0x20d0
leaq 0x1658d(%rip), %rdi     # 0x33cc2
leaq 0x15592(%rip), %rsi     # 0x32cce
leaq 0x16900(%rip), %rcx     # 0x34043
movl $0x18c, %edx            # imm = 0x18C
callq 0x20d0
leaq 0x1656e(%rip), %rdi     # 0x33cc2
leaq 0x15573(%rip), %rsi     # 0x32cce
leaq 0x168e1(%rip), %rcx     # 0x34043
movl $0x18e, %edx            # imm = 0x18E
callq 0x20d0
leaq 0x1654f(%rip), %rdi     # 0x33cc2
leaq 0x15554(%rip), %rsi     # 0x32cce
leaq 0x168c2(%rip), %rcx     # 0x34043
movl $0x192, %edx            # imm = 0x192
callq 0x20d0
leaq 0x16530(%rip), %rdi     # 0x33cc2
leaq 0x15535(%rip), %rsi     # 0x32cce
leaq 0x168a3(%rip), %rcx     # 0x34043
movl $0x194, %edx            # imm = 0x194
callq 0x20d0
leaq 0x16511(%rip), %rdi     # 0x33cc2
leaq 0x15516(%rip), %rsi     # 0x32cce
leaq 0x16884(%rip), %rcx     # 0x34043
movl $0x196, %edx            # imm = 0x196
callq 0x20d0
leaq 0x164f2(%rip), %rdi     # 0x33cc2
leaq 0x154f7(%rip), %rsi     # 0x32cce
leaq 0x16865(%rip), %rcx     # 0x34043
movl $0x198, %edx            # imm = 0x198
callq 0x20d0
leaq 0x164d3(%rip), %rdi     # 0x33cc2
leaq 0x154d8(%rip), %rsi     # 0x32cce
leaq 0x16846(%rip), %rcx     # 0x34043
movl $0x19b, %edx            # imm = 0x19B
callq 0x20d0
leaq 0x168ac(%rip), %rdi     # 0x340ba
leaq 0x154b9(%rip), %rsi     # 0x32cce
leaq 0x16827(%rip), %rcx     # 0x34043
movl $0x19d, %edx            # imm = 0x19D
callq 0x20d0
leaq 0x16495(%rip), %rdi     # 0x33cc2
leaq 0x1549a(%rip), %rsi     # 0x32cce
leaq 0x16808(%rip), %rcx     # 0x34043
movl $0x1a0, %edx            # imm = 0x1A0
callq 0x20d0
leaq 0x1689c(%rip), %rdi     # 0x340e8
leaq 0x1547b(%rip), %rsi     # 0x32cce
leaq 0x167e9(%rip), %rcx     # 0x34043
movl $0x1a6, %edx            # imm = 0x1A6
callq 0x20d0
leaq 0x1688e(%rip), %rdi     # 0x340f9
leaq 0x1545c(%rip), %rsi     # 0x32cce
leaq 0x167ca(%rip), %rcx     # 0x34043
movl $0x1a7, %edx            # imm = 0x1A7
callq 0x20d0
leaq 0x1689d(%rip), %rdi     # 0x34127
leaq 0x1543d(%rip), %rsi     # 0x32cce
leaq 0x167ab(%rip), %rcx     # 0x34043
movl $0x1a8, %edx            # imm = 0x1A8
callq 0x20d0