// File: jswaff[P]prophet3/test/mvvlva__test.cpp
// Function: test_mvvlva3()
void test_mvvlva3() {
    position pos;
    set_pos(&pos,"6r1/pp1b1P1p/5Q2/3p3k/5K2/8/2P3P1/8 w - - ");

    move moves[50],*endp;
    endp = gen_legal_moves(moves,&pos,true,true); // 39 moves

    move f7f8q = to_move(PAWN,F7,F8);
    set_promopiece(&f7f8q,QUEEN);

    move f7f8r = to_move(PAWN,F7,F8);
    set_promopiece(&f7f8r,ROOK);

    move f7f8b = to_move(PAWN,F7,F8);
    set_promopiece(&f7f8b,BISHOP);

    move f7f8n = to_move(PAWN,F7,F8);
    set_promopiece(&f7f8n,KNIGHT);

    move f7g8q = to_capture(PAWN,F7,G8,ROOK);
    set_promopiece(&f7g8q,QUEEN);

    move f7g8r = to_capture(PAWN,F7,G8,ROOK);
    set_promopiece(&f7g8r,ROOK);

    move f7g8b = to_capture(PAWN,F7,G8,ROOK);
    set_promopiece(&f7g8b,BISHOP);

    move f7g8n = to_capture(PAWN,F7,G8,ROOK);
    set_promopiece(&f7g8n,KNIGHT);

    assert(is_in_move_list(f7f8q,moves,endp));
    assert(is_in_move_list(f7f8r,moves,endp));
    assert(is_in_move_list(f7f8b,moves,endp));
    assert(is_in_move_list(f7f8n,moves,endp));
    assert(is_in_move_list(f7g8q,moves,endp));
    assert(is_in_move_list(f7g8r,moves,endp));
    assert(is_in_move_list(f7g8b,moves,endp));
    assert(is_in_move_list(f7g8n,moves,endp));

    assert(get_highest_scoring(&pos,moves,endp)==f7g8q);
    assert(get_highest_scoring(&pos,moves,endp)==f7g8r);
    assert(get_highest_scoring(&pos,moves,endp)==f7g8b);
    assert(get_highest_scoring(&pos,moves,endp)==f7g8n);
    assert(get_highest_scoring(&pos,moves,endp)==f7f8q);
    assert(get_highest_scoring(&pos,moves,endp)==f7f8r);
    assert(get_highest_scoring(&pos,moves,endp)==f7f8b);
    assert(get_highest_scoring(&pos,moves,endp)==f7f8n);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3b0, %rsp            # imm = 0x3B0
leaq -0x1c8(%rbp), %rdi
leaq 0x1849a(%rip), %rsi     # 0x40e73
callq 0xf3e0
leaq -0x360(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movl $0x1, %ecx
movl %ecx, %edx
callq 0xac70
movq %rax, -0x368(%rbp)
movl $0x1, %edi
movl $0xd, %esi
movl $0x5, %edx
callq 0xa830
movq %rax, -0x370(%rbp)
leaq -0x370(%rbp), %rdi
movl $0x5, %esi
callq 0xa9e0
movl $0x1, %edi
movl $0xd, %esi
movl $0x5, %edx
callq 0xa830
movq %rax, -0x378(%rbp)
leaq -0x378(%rbp), %rdi
movl $0x4, %esi
callq 0xa9e0
movl $0x1, %edi
movl $0xd, %esi
movl $0x5, %edx
callq 0xa830
movq %rax, -0x380(%rbp)
leaq -0x380(%rbp), %rdi
movl $0x3, %esi
callq 0xa9e0
movl $0x1, %edi
movl $0xd, %esi
movl $0x5, %edx
callq 0xa830
movq %rax, -0x388(%rbp)
leaq -0x388(%rbp), %rdi
movl $0x2, %esi
callq 0xa9e0
movl $0x1, %edi
movl $0xd, %esi
movl $0x6, %edx
movl $0x4, %ecx
callq 0xa890
movq %rax, -0x390(%rbp)
leaq -0x390(%rbp), %rdi
movl $0x5, %esi
callq 0xa9e0
movl $0x1, %edi
movl $0xd, %esi
movl $0x6, %edx
movl $0x4, %ecx
callq 0xa890
movq %rax, -0x398(%rbp)
leaq -0x398(%rbp), %rdi
movl $0x4, %esi
callq 0xa9e0
movl $0x1, %edi
movl $0xd, %esi
movl $0x6, %edx
movl $0x4, %ecx
callq 0xa890
movq %rax, -0x3a0(%rbp)
leaq -0x3a0(%rbp), %rdi
movl $0x3, %esi
callq 0xa9e0
movl $0x1, %edi
movl $0xd, %esi
movl $0x6, %edx
movl $0x4, %ecx
callq 0xa890
movq %rax, -0x3a8(%rbp)
leaq -0x3a8(%rbp), %rdi
movl $0x2, %esi
callq 0xa9e0
movq -0x370(%rbp), %rdi
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x28b93
jmp 0x28b95
jmp 0x28bb4
leaq 0x18302(%rip), %rdi     # 0x40e9e
leaq 0x180bd(%rip), %rsi     # 0x40c60
movl $0x75, %edx
leaq 0x18311(%rip), %rcx     # 0x40ec0
callq 0x20c0
movq -0x378(%rbp), %rdi
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x28bd4
jmp 0x28bd6
jmp 0x28bf5
leaq 0x182f7(%rip), %rdi     # 0x40ed4
leaq 0x1807c(%rip), %rsi     # 0x40c60
movl $0x76, %edx
leaq 0x182d0(%rip), %rcx     # 0x40ec0
callq 0x20c0
movq -0x380(%rbp), %rdi
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x28c15
jmp 0x28c17
jmp 0x28c36
leaq 0x182d8(%rip), %rdi     # 0x40ef6
leaq 0x1803b(%rip), %rsi     # 0x40c60
movl $0x77, %edx
leaq 0x1828f(%rip), %rcx     # 0x40ec0
callq 0x20c0
movq -0x388(%rbp), %rdi
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x28c56
jmp 0x28c58
jmp 0x28c77
leaq 0x182b9(%rip), %rdi     # 0x40f18
leaq 0x17ffa(%rip), %rsi     # 0x40c60
movl $0x78, %edx
leaq 0x1824e(%rip), %rcx     # 0x40ec0
callq 0x20c0
movq -0x390(%rbp), %rdi
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x28c97
jmp 0x28c99
jmp 0x28cb8
leaq 0x1829a(%rip), %rdi     # 0x40f3a
leaq 0x17fb9(%rip), %rsi     # 0x40c60
movl $0x79, %edx
leaq 0x1820d(%rip), %rcx     # 0x40ec0
callq 0x20c0
movq -0x398(%rbp), %rdi
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x28cd8
jmp 0x28cda
jmp 0x28cf9
leaq 0x1827b(%rip), %rdi     # 0x40f5c
leaq 0x17f78(%rip), %rsi     # 0x40c60
movl $0x7a, %edx
leaq 0x181cc(%rip), %rcx     # 0x40ec0
callq 0x20c0
movq -0x3a0(%rbp), %rdi
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x28d19
jmp 0x28d1b
jmp 0x28d3a
leaq 0x1825c(%rip), %rdi     # 0x40f7e
leaq 0x17f37(%rip), %rsi     # 0x40c60
movl $0x7b, %edx
leaq 0x1818b(%rip), %rcx     # 0x40ec0
callq 0x20c0
movq -0x3a8(%rbp), %rdi
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x28d5a
jmp 0x28d5c
jmp 0x28d7b
leaq 0x1823d(%rip), %rdi     # 0x40fa0
leaq 0x17ef6(%rip), %rsi     # 0x40c60
movl $0x7c, %edx
leaq 0x1814a(%rip), %rcx     # 0x40ec0
callq 0x20c0
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
leaq -0x1c8(%rbp), %rdi
callq 0x28320
cmpq -0x390(%rbp), %rax
jne 0x28da0
jmp 0x28dbf
leaq 0x1821b(%rip), %rdi     # 0x40fc2
leaq 0x17eb2(%rip), %rsi     # 0x40c60
movl $0x7e, %edx
leaq 0x18106(%rip), %rcx     # 0x40ec0
callq 0x20c0
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
leaq -0x1c8(%rbp), %rdi
callq 0x28320
cmpq -0x398(%rbp), %rax
jne 0x28de4
jmp 0x28e03
leaq 0x18203(%rip), %rdi     # 0x40fee
leaq 0x17e6e(%rip), %rsi     # 0x40c60
movl $0x7f, %edx
leaq 0x180c2(%rip), %rcx     # 0x40ec0
callq 0x20c0
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
leaq -0x1c8(%rbp), %rdi
callq 0x28320
cmpq -0x3a0(%rbp), %rax
jne 0x28e28
jmp 0x28e47
leaq 0x181eb(%rip), %rdi     # 0x4101a
leaq 0x17e2a(%rip), %rsi     # 0x40c60
movl $0x80, %edx
leaq 0x1807e(%rip), %rcx     # 0x40ec0
callq 0x20c0
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
leaq -0x1c8(%rbp), %rdi
callq 0x28320
cmpq -0x3a8(%rbp), %rax
jne 0x28e6c
jmp 0x28e8b
leaq 0x181d3(%rip), %rdi     # 0x41046
leaq 0x17de6(%rip), %rsi     # 0x40c60
movl $0x81, %edx
leaq 0x1803a(%rip), %rcx     # 0x40ec0
callq 0x20c0
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
leaq -0x1c8(%rbp), %rdi
callq 0x28320
cmpq -0x370(%rbp), %rax
jne 0x28eb0
jmp 0x28ecf
leaq 0x181bb(%rip), %rdi     # 0x41072
leaq 0x17da2(%rip), %rsi     # 0x40c60
movl $0x82, %edx
leaq 0x17ff6(%rip), %rcx     # 0x40ec0
callq 0x20c0
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
leaq -0x1c8(%rbp), %rdi
callq 0x28320
cmpq -0x378(%rbp), %rax
jne 0x28ef4
jmp 0x28f13
leaq 0x181a3(%rip), %rdi     # 0x4109e
leaq 0x17d5e(%rip), %rsi     # 0x40c60
movl $0x83, %edx
leaq 0x17fb2(%rip), %rcx     # 0x40ec0
callq 0x20c0
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
leaq -0x1c8(%rbp), %rdi
callq 0x28320
cmpq -0x380(%rbp), %rax
jne 0x28f38
jmp 0x28f57
leaq 0x1818b(%rip), %rdi     # 0x410ca
leaq 0x17d1a(%rip), %rsi     # 0x40c60
movl $0x84, %edx
leaq 0x17f6e(%rip), %rcx     # 0x40ec0
callq 0x20c0
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
leaq -0x1c8(%rbp), %rdi
callq 0x28320
cmpq -0x388(%rbp), %rax
jne 0x28f7c
jmp 0x28f9b
leaq 0x18173(%rip), %rdi     # 0x410f6
leaq 0x17cd6(%rip), %rsi     # 0x40c60
movl $0x85, %edx
leaq 0x17f2a(%rip), %rcx     # 0x40ec0
callq 0x20c0
addq $0x3b0, %rsp            # imm = 0x3B0
popq %rbp
retq
nopw %cs:(%rax,%rax)