// File: /workspace/github_cpp_makefile_star2_O2/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 0x16c29(%rip), %rsi     # 0x3214b
leaq 0xb0(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1b8
leaq 0x10(%rsp), %r14
pushq $0x1
popq %rcx
movq %r14, %rdi
movq %rbx, %rsi
movl %ecx, %edx
callq 0x74e1
movq %rax, %rbx
subq %r14, %rax
cmpq $0x88, %rax
jne 0x1b8d5
pushq $0x1
popq %rdi
pushq $0x36
popq %rsi
pushq $0x2e
popq %rdx
callq 0x7284
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x1b8f4
pushq $0x1
popq %rdi
pushq $0x36
popq %rsi
pushq $0x26
popq %rdx
callq 0x7284
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x1b913
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 0x1b932
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 0x1b951
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 0x1b970
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 0x1b98f
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 0x1b9ae
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 0x1b9cd
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 0x1b9ec
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 0x1ba0b
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 0x1ba2a
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 0x1ba49
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 0x1ba68
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 0x1ba87
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 0x1baa6
pushq $0x1
popq %rdi
pushq $0x1c
popq %rsi
pushq $0x14
popq %rdx
callq 0x7284
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x1bac5
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 0x1bae4
leaq 0xfc57(%rip), %rsi      # 0x2b4a3
leaq 0xb0(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1b8
pushq $0x1
popq %rcx
movq %r14, %rdi
movq %rbx, %rsi
movl %ecx, %edx
callq 0x74e1
movq %rax, %rbx
subq %r14, %rax
cmpq $0x80, %rax
jne 0x1bb03
pushq $0x1
popq %rdi
pushq $0xb
popq %rsi
pushq $0x13
popq %rdx
callq 0x7284
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x1bb22
pushq $0x1
popq %rdi
pushq $0xb
popq %rsi
pushq $0x1b
popq %rdx
callq 0x7284
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0xdacb
testb %al, %al
je 0x1bb41
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r14
retq
leaq 0x16899(%rip), %rdi     # 0x32175
leaq 0x1552e(%rip), %rsi     # 0x30e11
leaq 0x1689c(%rip), %rcx     # 0x32186
movl $0x178, %edx            # imm = 0x178
callq 0x20c0
leaq 0x168a6(%rip), %rdi     # 0x321a1
leaq 0x1550f(%rip), %rsi     # 0x30e11
leaq 0x1687d(%rip), %rcx     # 0x32186
movl $0x179, %edx            # imm = 0x179
callq 0x20c0
leaq 0x168b5(%rip), %rdi     # 0x321cf
leaq 0x154f0(%rip), %rsi     # 0x30e11
leaq 0x1685e(%rip), %rcx     # 0x32186
movl $0x17a, %edx            # imm = 0x17A
callq 0x20c0
leaq 0x164cc(%rip), %rdi     # 0x31e05
leaq 0x154d1(%rip), %rsi     # 0x30e11
leaq 0x1683f(%rip), %rcx     # 0x32186
movl $0x17e, %edx            # imm = 0x17E
callq 0x20c0
leaq 0x164ad(%rip), %rdi     # 0x31e05
leaq 0x154b2(%rip), %rsi     # 0x30e11
leaq 0x16820(%rip), %rcx     # 0x32186
movl $0x180, %edx            # imm = 0x180
callq 0x20c0
leaq 0x1648e(%rip), %rdi     # 0x31e05
leaq 0x15493(%rip), %rsi     # 0x30e11
leaq 0x16801(%rip), %rcx     # 0x32186
movl $0x182, %edx            # imm = 0x182
callq 0x20c0
leaq 0x1646f(%rip), %rdi     # 0x31e05
leaq 0x15474(%rip), %rsi     # 0x30e11
leaq 0x167e2(%rip), %rcx     # 0x32186
movl $0x184, %edx            # imm = 0x184
callq 0x20c0
leaq 0x16450(%rip), %rdi     # 0x31e05
leaq 0x15455(%rip), %rsi     # 0x30e11
leaq 0x167c3(%rip), %rcx     # 0x32186
movl $0x188, %edx            # imm = 0x188
callq 0x20c0
leaq 0x16431(%rip), %rdi     # 0x31e05
leaq 0x15436(%rip), %rsi     # 0x30e11
leaq 0x167a4(%rip), %rcx     # 0x32186
movl $0x18a, %edx            # imm = 0x18A
callq 0x20c0
leaq 0x16412(%rip), %rdi     # 0x31e05
leaq 0x15417(%rip), %rsi     # 0x30e11
leaq 0x16785(%rip), %rcx     # 0x32186
movl $0x18c, %edx            # imm = 0x18C
callq 0x20c0
leaq 0x163f3(%rip), %rdi     # 0x31e05
leaq 0x153f8(%rip), %rsi     # 0x30e11
leaq 0x16766(%rip), %rcx     # 0x32186
movl $0x18e, %edx            # imm = 0x18E
callq 0x20c0
leaq 0x163d4(%rip), %rdi     # 0x31e05
leaq 0x153d9(%rip), %rsi     # 0x30e11
leaq 0x16747(%rip), %rcx     # 0x32186
movl $0x192, %edx            # imm = 0x192
callq 0x20c0
leaq 0x163b5(%rip), %rdi     # 0x31e05
leaq 0x153ba(%rip), %rsi     # 0x30e11
leaq 0x16728(%rip), %rcx     # 0x32186
movl $0x194, %edx            # imm = 0x194
callq 0x20c0
leaq 0x16396(%rip), %rdi     # 0x31e05
leaq 0x1539b(%rip), %rsi     # 0x30e11
leaq 0x16709(%rip), %rcx     # 0x32186
movl $0x196, %edx            # imm = 0x196
callq 0x20c0
leaq 0x16377(%rip), %rdi     # 0x31e05
leaq 0x1537c(%rip), %rsi     # 0x30e11
leaq 0x166ea(%rip), %rcx     # 0x32186
movl $0x198, %edx            # imm = 0x198
callq 0x20c0
leaq 0x16358(%rip), %rdi     # 0x31e05
leaq 0x1535d(%rip), %rsi     # 0x30e11
leaq 0x166cb(%rip), %rcx     # 0x32186
movl $0x19b, %edx            # imm = 0x19B
callq 0x20c0
leaq 0x16731(%rip), %rdi     # 0x321fd
leaq 0x1533e(%rip), %rsi     # 0x30e11
leaq 0x166ac(%rip), %rcx     # 0x32186
movl $0x19d, %edx            # imm = 0x19D
callq 0x20c0
leaq 0x1631a(%rip), %rdi     # 0x31e05
leaq 0x1531f(%rip), %rsi     # 0x30e11
leaq 0x1668d(%rip), %rcx     # 0x32186
movl $0x1a0, %edx            # imm = 0x1A0
callq 0x20c0
leaq 0x16721(%rip), %rdi     # 0x3222b
leaq 0x15300(%rip), %rsi     # 0x30e11
leaq 0x1666e(%rip), %rcx     # 0x32186
movl $0x1a6, %edx            # imm = 0x1A6
callq 0x20c0
leaq 0x16713(%rip), %rdi     # 0x3223c
leaq 0x152e1(%rip), %rsi     # 0x30e11
leaq 0x1664f(%rip), %rcx     # 0x32186
movl $0x1a7, %edx            # imm = 0x1A7
callq 0x20c0
leaq 0x16722(%rip), %rdi     # 0x3226a
leaq 0x152c2(%rip), %rsi     # 0x30e11
leaq 0x16630(%rip), %rcx     # 0x32186
movl $0x1a8, %edx            # imm = 0x1A8
callq 0x20c0