// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
subq $0x3a0, %rsp            # imm = 0x3A0
leaq 0x160a1(%rip), %rsi     # 0x345d1
leaq 0x1d8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa82
leaq 0x40(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %edx
movl $0x1, %ecx
callq 0x78e0
movq %rax, %rbx
movl $0x1, %edi
movl $0xd, %esi
movl $0x5, %edx
callq 0x775c
leaq 0x38(%rsp), %r15
movq %rax, (%r15)
movq %r15, %rdi
movl $0x5, %esi
callq 0x7824
movl $0x1, %edi
movl $0xd, %esi
movl $0x5, %edx
callq 0x775c
leaq 0x30(%rsp), %rdi
movq %rax, (%rdi)
movl $0x4, %esi
callq 0x7824
movl $0x1, %edi
movl $0xd, %esi
movl $0x5, %edx
callq 0x775c
leaq 0x28(%rsp), %rdi
movq %rax, (%rdi)
movl $0x3, %esi
callq 0x7824
movl $0x1, %edi
movl $0xd, %esi
movl $0x5, %edx
callq 0x775c
leaq 0x20(%rsp), %rdi
movq %rax, (%rdi)
movl $0x2, %esi
callq 0x7824
movl $0x1, %edi
movl $0xd, %esi
movl $0x6, %edx
movl $0x4, %ecx
callq 0x777b
leaq 0x18(%rsp), %rdi
movq %rax, (%rdi)
movl $0x5, %esi
callq 0x7824
movl $0x1, %edi
movl $0xd, %esi
movl $0x6, %edx
movl $0x4, %ecx
callq 0x777b
leaq 0x10(%rsp), %rdi
movq %rax, (%rdi)
movl $0x4, %esi
callq 0x7824
movl $0x1, %edi
movl $0xd, %esi
movl $0x6, %edx
movl $0x4, %ecx
callq 0x777b
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
movl $0x3, %esi
callq 0x7824
movl $0x1, %edi
movl $0xd, %esi
movl $0x6, %edx
movl $0x4, %ecx
callq 0x777b
movq %rsp, %rdi
movq %rax, (%rdi)
movl $0x2, %esi
callq 0x7824
movq (%r15), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1e879
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1e898
movq 0x28(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1e8b7
movq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1e8d6
movq 0x18(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1e8f5
movq 0x10(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1e914
movq 0x8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1e933
movq (%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %rbx, %rdx
callq 0xe682
testb %al, %al
je 0x1e952
leaq 0x1d8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %rbx, %rdx
callq 0x1dfe0
cmpq 0x18(%rsp), %rax
jne 0x1e971
leaq 0x1d8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %rbx, %rdx
callq 0x1dfe0
cmpq 0x10(%rsp), %rax
jne 0x1e990
leaq 0x1d8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %rbx, %rdx
callq 0x1dfe0
cmpq 0x8(%rsp), %rax
jne 0x1e9af
leaq 0x1d8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %rbx, %rdx
callq 0x1dfe0
cmpq (%rsp), %rax
jne 0x1e9ce
leaq 0x1d8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %rbx, %rdx
callq 0x1dfe0
cmpq 0x38(%rsp), %rax
jne 0x1e9ed
leaq 0x1d8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %rbx, %rdx
callq 0x1dfe0
cmpq 0x30(%rsp), %rax
jne 0x1ea0c
leaq 0x1d8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %rbx, %rdx
callq 0x1dfe0
cmpq 0x28(%rsp), %rax
jne 0x1ea2b
leaq 0x1d8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movq %rbx, %rdx
callq 0x1dfe0
cmpq 0x20(%rsp), %rax
jne 0x1ea4a
addq $0x3a0, %rsp            # imm = 0x3A0
popq %rbx
popq %r14
popq %r15
retq
leaq 0x15d7c(%rip), %rdi     # 0x345fc
leaq 0x15b37(%rip), %rsi     # 0x343be
leaq 0x15d90(%rip), %rcx     # 0x3461e
movl $0x75, %edx
callq 0x20d0
leaq 0x15d93(%rip), %rdi     # 0x34632
leaq 0x15b18(%rip), %rsi     # 0x343be
leaq 0x15d71(%rip), %rcx     # 0x3461e
movl $0x76, %edx
callq 0x20d0
leaq 0x15d96(%rip), %rdi     # 0x34654
leaq 0x15af9(%rip), %rsi     # 0x343be
leaq 0x15d52(%rip), %rcx     # 0x3461e
movl $0x77, %edx
callq 0x20d0
leaq 0x15d99(%rip), %rdi     # 0x34676
leaq 0x15ada(%rip), %rsi     # 0x343be
leaq 0x15d33(%rip), %rcx     # 0x3461e
movl $0x78, %edx
callq 0x20d0
leaq 0x15d9c(%rip), %rdi     # 0x34698
leaq 0x15abb(%rip), %rsi     # 0x343be
leaq 0x15d14(%rip), %rcx     # 0x3461e
movl $0x79, %edx
callq 0x20d0
leaq 0x15d9f(%rip), %rdi     # 0x346ba
leaq 0x15a9c(%rip), %rsi     # 0x343be
leaq 0x15cf5(%rip), %rcx     # 0x3461e
movl $0x7a, %edx
callq 0x20d0
leaq 0x15da2(%rip), %rdi     # 0x346dc
leaq 0x15a7d(%rip), %rsi     # 0x343be
leaq 0x15cd6(%rip), %rcx     # 0x3461e
movl $0x7b, %edx
callq 0x20d0
leaq 0x15da5(%rip), %rdi     # 0x346fe
leaq 0x15a5e(%rip), %rsi     # 0x343be
leaq 0x15cb7(%rip), %rcx     # 0x3461e
movl $0x7c, %edx
callq 0x20d0
leaq 0x15da8(%rip), %rdi     # 0x34720
leaq 0x15a3f(%rip), %rsi     # 0x343be
leaq 0x15c98(%rip), %rcx     # 0x3461e
movl $0x7e, %edx
callq 0x20d0
leaq 0x15db5(%rip), %rdi     # 0x3474c
leaq 0x15a20(%rip), %rsi     # 0x343be
leaq 0x15c79(%rip), %rcx     # 0x3461e
movl $0x7f, %edx
callq 0x20d0
leaq 0x15dc2(%rip), %rdi     # 0x34778
leaq 0x15a01(%rip), %rsi     # 0x343be
leaq 0x15c5a(%rip), %rcx     # 0x3461e
movl $0x80, %edx
callq 0x20d0
leaq 0x15dcf(%rip), %rdi     # 0x347a4
leaq 0x159e2(%rip), %rsi     # 0x343be
leaq 0x15c3b(%rip), %rcx     # 0x3461e
movl $0x81, %edx
callq 0x20d0
leaq 0x15ddc(%rip), %rdi     # 0x347d0
leaq 0x159c3(%rip), %rsi     # 0x343be
leaq 0x15c1c(%rip), %rcx     # 0x3461e
movl $0x82, %edx
callq 0x20d0
leaq 0x15de9(%rip), %rdi     # 0x347fc
leaq 0x159a4(%rip), %rsi     # 0x343be
leaq 0x15bfd(%rip), %rcx     # 0x3461e
movl $0x83, %edx
callq 0x20d0
leaq 0x15df6(%rip), %rdi     # 0x34828
leaq 0x15985(%rip), %rsi     # 0x343be
leaq 0x15bde(%rip), %rcx     # 0x3461e
movl $0x84, %edx
callq 0x20d0
leaq 0x15e03(%rip), %rdi     # 0x34854
leaq 0x15966(%rip), %rsi     # 0x343be
leaq 0x15bbf(%rip), %rcx     # 0x3461e
movl $0x85, %edx
callq 0x20d0