// File: /workspace/github_cpp_makefile_star2_O1/jswaff[P]prophet3/test/eval__test.cpp
// Function: test_eval_rook()
void test_eval_rook() {
    position pos;

    set_pos(&pos,"6k1/3R4/8/8/8/8/8/3K4 w - - 0 1");
    int32 score = eval(&pos,false);
    assert(score==rook_val + rook_on_7th + rook_open_file);

    set_pos(&pos,"6k1/3RR3/8/8/8/8/8/3K4 w - - 0 1");
    score = eval(&pos,false);
    assert(score==rook_val*2 + rook_on_7th*2 + connected_majors_on_7th + rook_open_file*2);

    set_pos(&pos,"6k1/3RRr2/8/8/8/8/8/3K4 w - - 0 1");
    score = eval(&pos,false);
    // white has two rooks on open files and black one, so net 1 for white
    assert(score==rook_val + rook_on_7th*2 + connected_majors_on_7th + rook_open_file);

    set_pos(&pos,"6k1/3RRr2/8/8/8/8/r7/3K4 w - - 0 1");
    score = eval(&pos,false);
    assert(score==rook_on_7th + connected_majors_on_7th);

    set_pos(&pos,"6k1/3RRr2/8/8/8/r7/8/3K4 w - - 0 1");
    score = eval(&pos,false);
    // deduct for black for rook on A file
    assert(score==rook_on_7th*2 + connected_majors_on_7th - rook_pst[fliprank[A3]]);

    set_pos(&pos,"6k1/8/8/8/8/8/qr6/7K b - - 0 1");
    score = eval(&pos,false);
    assert(score==queen_val + rook_val + rook_on_7th*2 + connected_majors_on_7th
            + rook_open_file
            + queen_pst[A2]
            - eval_scale(king_safety_pawn_far_away*2+king_safety_pawn_far_away/2,queen_val+rook_val));
}

// Assembly:
pushq %rbx
subq $0x1d0, %rsp            # imm = 0x1D0
leaq 0x1cef4(%rip), %rsi     # 0x2f34d
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa74
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5846
cmpl $0x23f, %eax            # imm = 0x23F
jne 0x12566
leaq 0x1cf30(%rip), %rsi     # 0x2f3b2
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa74
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5846
cmpl $0x4ce, %eax            # imm = 0x4CE
jne 0x12585
leaq 0x1cf77(%rip), %rsi     # 0x2f422
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa74
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5846
cmpl $0x2c1, %eax            # imm = 0x2C1
jne 0x125a4
leaq 0x1cfbb(%rip), %rsi     # 0x2f48f
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa74
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5846
cmpl $0x82, %eax
jne 0x125c3
leaq 0x1cfe2(%rip), %rsi     # 0x2f4df
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa74
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5846
cmpl $0xb9, %eax
jne 0x125e2
leaq 0x1d024(%rip), %rsi     # 0x2f54a
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa74
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5846
movl %eax, %ebx
movl $0xffffffb5, %edi       # imm = 0xFFFFFFB5
movl $0x578, %esi            # imm = 0x578
callq 0x54f4
movl $0x644, %ecx            # imm = 0x644
subl %eax, %ecx
cmpl %ecx, %ebx
jne 0x12601
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
retq
leaq 0x1ce00(%rip), %rdi     # 0x2f36d
leaq 0x1cb15(%rip), %rsi     # 0x2f089
leaq 0x1ce21(%rip), %rcx     # 0x2f39c
movl $0x35, %edx
callq 0x20d0
leaq 0x1ce47(%rip), %rdi     # 0x2f3d3
leaq 0x1caf6(%rip), %rsi     # 0x2f089
leaq 0x1ce02(%rip), %rcx     # 0x2f39c
movl $0x39, %edx
callq 0x20d0
leaq 0x1ce99(%rip), %rdi     # 0x2f444
leaq 0x1cad7(%rip), %rsi     # 0x2f089
leaq 0x1cde3(%rip), %rcx     # 0x2f39c
movl $0x3e, %edx
callq 0x20d0
leaq 0x1cee8(%rip), %rdi     # 0x2f4b2
leaq 0x1cab8(%rip), %rsi     # 0x2f089
leaq 0x1cdc4(%rip), %rcx     # 0x2f39c
movl $0x42, %edx
callq 0x20d0
leaq 0x1cf19(%rip), %rdi     # 0x2f502
leaq 0x1ca99(%rip), %rsi     # 0x2f089
leaq 0x1cda5(%rip), %rcx     # 0x2f39c
movl $0x47, %edx
callq 0x20d0
leaq 0x1cf61(%rip), %rdi     # 0x2f569
leaq 0x1ca7a(%rip), %rsi     # 0x2f089
leaq 0x1cd86(%rip), %rcx     # 0x2f39c
movl $0x4e, %edx
callq 0x20d0