// File: jswaff[P]prophet3/test/mvvlva__test.cpp
// Function: test_mvvlva2()
void test_mvvlva2() {
    position pos;
    set_pos(&pos,"8/4Pk1p/6p1/1r6/8/5N2/2B2PPP/b5K1 w - - ");

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

    move e7e8q = to_move(PAWN,E7,E8);
    set_promopiece(&e7e8q,QUEEN);

    move e7e8r = to_move(PAWN,E7,E8);
    set_promopiece(&e7e8r,ROOK);

    move e7e8b = to_move(PAWN,E7,E8);
    set_promopiece(&e7e8b,BISHOP);

    move e7e8n = to_move(PAWN,E7,E8);
    set_promopiece(&e7e8n,KNIGHT);

    move c2g6 = to_capture(BISHOP,C2,G6,PAWN);

    assert(is_in_move_list(e7e8q,moves,endp));
    assert(is_in_move_list(e7e8r,moves,endp));
    assert(is_in_move_list(e7e8b,moves,endp));
    assert(is_in_move_list(e7e8n,moves,endp));
    assert(is_in_move_list(c2g6,moves,endp));

    assert(get_highest_scoring(&pos,moves,endp)==e7e8q);
    assert(get_highest_scoring(&pos,moves,endp)==e7e8r);
    assert(get_highest_scoring(&pos,moves,endp)==e7e8b);
    assert(get_highest_scoring(&pos,moves,endp)==e7e8n);
    assert(get_highest_scoring(&pos,moves,endp)==c2g6);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x390, %rsp            # imm = 0x390
leaq -0x1c8(%rbp), %rdi
leaq 0x1260a(%rip), %rsi     # 0x3ac23
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 $0xc, %esi
movl $0x4, %edx
callq 0xa830
movq %rax, -0x370(%rbp)
leaq -0x370(%rbp), %rdi
movl $0x5, %esi
callq 0xa9e0
movl $0x1, %edi
movl $0xc, %esi
movl $0x4, %edx
callq 0xa830
movq %rax, -0x378(%rbp)
leaq -0x378(%rbp), %rdi
movl $0x4, %esi
callq 0xa9e0
movl $0x1, %edi
movl $0xc, %esi
movl $0x4, %edx
callq 0xa830
movq %rax, -0x380(%rbp)
leaq -0x380(%rbp), %rdi
movl $0x3, %esi
callq 0xa9e0
movl $0x1, %edi
movl $0xc, %esi
movl $0x4, %edx
callq 0xa830
movq %rax, -0x388(%rbp)
leaq -0x388(%rbp), %rdi
movl $0x2, %esi
callq 0xa9e0
movl $0x3, %edi
movl $0x32, %esi
movl $0x16, %edx
movl $0x1, %ecx
callq 0xa890
movq %rax, -0x390(%rbp)
movq -0x370(%rbp), %rdi
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x2872f
jmp 0x28731
jmp 0x28750
leaq 0x185a3(%rip), %rdi     # 0x40cdb
leaq 0x18521(%rip), %rsi     # 0x40c60
movl $0x49, %edx
leaq 0x185b2(%rip), %rcx     # 0x40cfd
callq 0x20c0
movq -0x378(%rbp), %rdi
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x28770
jmp 0x28772
jmp 0x28791
leaq 0x18598(%rip), %rdi     # 0x40d11
leaq 0x184e0(%rip), %rsi     # 0x40c60
movl $0x4a, %edx
leaq 0x18571(%rip), %rcx     # 0x40cfd
callq 0x20c0
movq -0x380(%rbp), %rdi
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x287b1
jmp 0x287b3
jmp 0x287d2
leaq 0x18579(%rip), %rdi     # 0x40d33
leaq 0x1849f(%rip), %rsi     # 0x40c60
movl $0x4b, %edx
leaq 0x18530(%rip), %rcx     # 0x40cfd
callq 0x20c0
movq -0x388(%rbp), %rdi
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x287f2
jmp 0x287f4
jmp 0x28813
leaq 0x1855a(%rip), %rdi     # 0x40d55
leaq 0x1845e(%rip), %rsi     # 0x40c60
movl $0x4c, %edx
leaq 0x184ef(%rip), %rcx     # 0x40cfd
callq 0x20c0
movq -0x390(%rbp), %rdi
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x28833
jmp 0x28835
jmp 0x28854
leaq 0x1853b(%rip), %rdi     # 0x40d77
leaq 0x1841d(%rip), %rsi     # 0x40c60
movl $0x4d, %edx
leaq 0x184ae(%rip), %rcx     # 0x40cfd
callq 0x20c0
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
leaq -0x1c8(%rbp), %rdi
callq 0x28320
cmpq -0x370(%rbp), %rax
jne 0x28879
jmp 0x28898
leaq 0x18518(%rip), %rdi     # 0x40d98
leaq 0x183d9(%rip), %rsi     # 0x40c60
movl $0x4f, %edx
leaq 0x1846a(%rip), %rcx     # 0x40cfd
callq 0x20c0
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
leaq -0x1c8(%rbp), %rdi
callq 0x28320
cmpq -0x378(%rbp), %rax
jne 0x288bd
jmp 0x288dc
leaq 0x18500(%rip), %rdi     # 0x40dc4
leaq 0x18395(%rip), %rsi     # 0x40c60
movl $0x50, %edx
leaq 0x18426(%rip), %rcx     # 0x40cfd
callq 0x20c0
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
leaq -0x1c8(%rbp), %rdi
callq 0x28320
cmpq -0x380(%rbp), %rax
jne 0x28901
jmp 0x28920
leaq 0x184e8(%rip), %rdi     # 0x40df0
leaq 0x18351(%rip), %rsi     # 0x40c60
movl $0x51, %edx
leaq 0x183e2(%rip), %rcx     # 0x40cfd
callq 0x20c0
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
leaq -0x1c8(%rbp), %rdi
callq 0x28320
cmpq -0x388(%rbp), %rax
jne 0x28945
jmp 0x28964
leaq 0x184d0(%rip), %rdi     # 0x40e1c
leaq 0x1830d(%rip), %rsi     # 0x40c60
movl $0x52, %edx
leaq 0x1839e(%rip), %rcx     # 0x40cfd
callq 0x20c0
leaq -0x360(%rbp), %rsi
movq -0x368(%rbp), %rdx
leaq -0x1c8(%rbp), %rdi
callq 0x28320
cmpq -0x390(%rbp), %rax
jne 0x28989
jmp 0x289a8
leaq 0x184b8(%rip), %rdi     # 0x40e48
leaq 0x182c9(%rip), %rsi     # 0x40c60
movl $0x53, %edx
leaq 0x1835a(%rip), %rcx     # 0x40cfd
callq 0x20c0
addq $0x390, %rsp            # imm = 0x390
popq %rbp
retq
nopw %cs:(%rax,%rax)