// File: /workspace/github_cpp_makefile_star2_O3/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 0x1d028(%rip), %rsi     # 0x2f3cd
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa82
movq %rbx, %rdi
xorl %esi, %esi
callq 0x58f7
cmpl $0x23f, %eax            # imm = 0x23F
jne 0x124b2
leaq 0x1d064(%rip), %rsi     # 0x2f432
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa82
movq %rbx, %rdi
xorl %esi, %esi
callq 0x58f7
cmpl $0x4ce, %eax            # imm = 0x4CE
jne 0x124d1
leaq 0x1d0ab(%rip), %rsi     # 0x2f4a2
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa82
movq %rbx, %rdi
xorl %esi, %esi
callq 0x58f7
cmpl $0x2c1, %eax            # imm = 0x2C1
jne 0x124f0
leaq 0x1d0ef(%rip), %rsi     # 0x2f50f
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa82
movq %rbx, %rdi
xorl %esi, %esi
callq 0x58f7
cmpl $0x82, %eax
jne 0x1250f
leaq 0x1d116(%rip), %rsi     # 0x2f55f
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa82
movq %rbx, %rdi
xorl %esi, %esi
callq 0x58f7
cmpl $0xb9, %eax
jne 0x1252e
leaq 0x1d158(%rip), %rsi     # 0x2f5ca
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa82
movq %rbx, %rdi
xorl %esi, %esi
callq 0x58f7
movl %eax, %ebx
movl $0xffffffb5, %edi       # imm = 0xFFFFFFB5
movl $0x578, %esi            # imm = 0x578
callq 0x5545
movl $0x644, %ecx            # imm = 0x644
subl %eax, %ecx
cmpl %ecx, %ebx
jne 0x1254d
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
retq
leaq 0x1cf34(%rip), %rdi     # 0x2f3ed
leaq 0x1cc49(%rip), %rsi     # 0x2f109
leaq 0x1cf55(%rip), %rcx     # 0x2f41c
movl $0x35, %edx
callq 0x20d0
leaq 0x1cf7b(%rip), %rdi     # 0x2f453
leaq 0x1cc2a(%rip), %rsi     # 0x2f109
leaq 0x1cf36(%rip), %rcx     # 0x2f41c
movl $0x39, %edx
callq 0x20d0
leaq 0x1cfcd(%rip), %rdi     # 0x2f4c4
leaq 0x1cc0b(%rip), %rsi     # 0x2f109
leaq 0x1cf17(%rip), %rcx     # 0x2f41c
movl $0x3e, %edx
callq 0x20d0
leaq 0x1d01c(%rip), %rdi     # 0x2f532
leaq 0x1cbec(%rip), %rsi     # 0x2f109
leaq 0x1cef8(%rip), %rcx     # 0x2f41c
movl $0x42, %edx
callq 0x20d0
leaq 0x1d04d(%rip), %rdi     # 0x2f582
leaq 0x1cbcd(%rip), %rsi     # 0x2f109
leaq 0x1ced9(%rip), %rcx     # 0x2f41c
movl $0x47, %edx
callq 0x20d0
leaq 0x1d095(%rip), %rdi     # 0x2f5e9
leaq 0x1cbae(%rip), %rsi     # 0x2f109
leaq 0x1ceba(%rip), %rcx     # 0x2f41c
movl $0x4e, %edx
callq 0x20d0