// File: /workspace/github_cpp_makefile_star2_O2/jswaff[P]prophet3/test/see__test.cpp
// Function: test_see()
void test_see() {
    test_queen_takes_undefended_pawn();
    test_queen_takes_defended_pawn();
    test_rook_takes_undefended_pawn();
    test_with_xrays();
    test_rook_xrays();
    test_knight_takes_defended_pawn_as_white();
    test_knight_takes_defended_pawn_as_black();
    test_crazy_rooks();
    test_crazy_rooks2();
    test_knight_takes_defended_pawn();
    test_bishop_takes_defended_pawn();
    test_knight_takes_defended_pawn_with_crazy_bishops();

    test_case_see("4R3/2r3p1/5bk1/1p1r3p/p2PR1P1/P1BK1P2/1P6/8 b - -","hxg4",0);
    test_case_see("4R3/2r3p1/5bk1/1p1r1p1p/p2PR1P1/P1BK1P2/1P6/8 b - -","hxg4",0);
    test_case_see("4r1k1/5pp1/nbp4p/1p2p2q/1P2P1b1/1BP2N1P/1B2QPPK/3R4 b - -","Bxf3",knight_val-bishop_val);
    test_case_see("2r1r1k1/pp1bppbp/3p1np1/q3P3/2P2P2/1P2B3/P1N1B1PP/2RQ1RK1 b - -","dxe5",pawn_val);
    test_case_see("7r/5qpk/p1Qp1b1p/3r3n/BB3p2/5p2/P1P2P2/4RK1R w - -","Re8",0);
    test_case_see("7R/4bP2/8/8/1q6/3K4/5p2/4k3 w - -","f8=R",10004);
    test_case_see("8/4kp2/2npp3/1Nn5/1p2PQP1/7q/1PP1B3/4KR1r b - -","Rxf1+",0);
    test_case_see("2r2r1k/6bp/p7/2q2p1Q/3PpP2/1B6/P5PP/2RR3K b - -","Qxc1",2*rook_val-queen_val);
    test_case_see("r2qk1nr/pp2ppbp/2b3p1/2p1p3/8/2N2N2/PPPP1PPP/R1BQR1K1 w kq -","Nxe5",pawn_val);
    test_case_see("6r1/4kq2/b2p1p2/p1pPb3/p1P2B1Q/2P4P/2B1R1P1/6K1 w - -","Bxe5",0);
    test_case_see("3q2nk/pb1r1p2/np6/3P2Pp/2p1P3/2R4B/PQ3P1P/3R2K1 w - h6","gxh6",0);
    test_case_see("3q2nk/pb1r1p2/np6/3P2Pp/2p1P3/2R1B2B/PQ3P1P/3R2K1 w - h6","gxh6",pawn_val);
    test_case_see("2r4r/1P4pk/p2p1b1p/7n/BB3p2/2R2p2/P1P2P2/4RK2 w - -","Rxc8",rook_val);

    // Arasan says +rook for this, but RxR then BxR then PxB ==> Bishop Val
    // Note the last pawn capture is also a promotion so that could be added
    test_case_see("2r5/1P4pk/p2p1b1p/5b1n/BB3p2/2R2p2/P1P2P2/4RK2 w - -","Rxc8",bishop_val);

    test_case_see("2r4k/2r4p/p7/2b2p1b/4pP2/1BR5/P1R3PP/2Q4K w - -","Rxc5",bishop_val);
    test_case_see("8/pp6/2pkp3/4bp2/2R3b1/2P5/PP4B1/1K6 w - -","Bxc6",pawn_val-bishop_val);
    test_case_see("4q3/1p1pr1k1/1B2rp2/6p1/p3PP2/P3R1P1/1P2R1K1/4Q3 b - -","Rxe4",pawn_val-rook_val);
    test_case_see("4q3/1p1pr1kb/1B2rp2/6p1/p3PP2/P3R1P1/1P2R1K1/4Q3 b - -","Bxe4",pawn_val);

/*
    // not captures
    //test_case_see("6rr/6pk/p1Qp1b1p/2n5/1B3p2/5p2/P1P2P2/4RK1R w - -","Re8",-Eval.ROOK_VAL);
    //test_case_see("7r/5qpk/2Qp1b1p/1N1r3n/BB3p2/5p2/P1P2P2/4RK1R w - -","Re8",-Eval.ROOK_VAL);

    // promotion that doesn't capture
    //test_case_see("6RR/4bP2/8/8/5r2/3K4/5p2/4k3 w - -","f8=Q",Eval.BISHOP_VAL-Eval.PAWN_VAL);
    //test_case_see("6RR/4bP2/8/8/5r2/3K4/5p2/4k3 w - -","f8=N",Eval.KNIGHT_VAL-Eval.PAWN_VAL);
    //test_case_see("7R/5P2/8/8/8/3K2r1/5p2/4k3 w - -","f8=Q",Eval.QUEEN_VAL-Eval.PAWN_VAL);
    //test_case_see("7R/5P2/8/8/8/3K2r1/5p2/4k3 w - -","f8=B",Eval.BISHOP_VAL-Eval.PAWN_VAL);
*/
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
callq 0x2349c
callq 0x23541
callq 0x235e8
callq 0x2368d
callq 0x23734
callq 0x237d9
callq 0x2387e
callq 0x23923
callq 0x239ca
callq 0x23a6f
callq 0x23b1c
callq 0x23bc9
leaq 0x11533(%rip), %rdi     # 0x352ef
leaq 0x1155e(%rip), %rbx     # 0x35321
movq %rbx, %rsi
xorl %edx, %edx
callq 0x23c78
leaq 0x11552(%rip), %rdi     # 0x35326
movq %rbx, %rsi
xorl %edx, %edx
callq 0x23c78
leaq 0x11575(%rip), %rdi     # 0x3535a
leaq 0x115a8(%rip), %rsi     # 0x35394
pushq $-0x14
popq %rdx
callq 0x23c78
leaq 0x1159e(%rip), %rdi     # 0x35399
leaq 0x115d7(%rip), %rsi     # 0x353d9
pushq $0x64
popq %rbx
movl %ebx, %edx
callq 0x23c78
leaq 0x115cb(%rip), %rdi     # 0x353de
leaq 0x115f7(%rip), %rsi     # 0x35411
xorl %edx, %edx
callq 0x23c78
leaq 0x115ed(%rip), %rdi     # 0x35415
leaq 0x11608(%rip), %rsi     # 0x35437
movl $0x2714, %edx           # imm = 0x2714
callq 0x23c78
leaq 0x115fc(%rip), %rdi     # 0x3543c
leaq 0x11625(%rip), %rsi     # 0x3546c
xorl %edx, %edx
callq 0x23c78
leaq 0x1161d(%rip), %rdi     # 0x35472
leaq 0x11646(%rip), %rsi     # 0x354a2
movl %ebx, %edx
callq 0x23c78
leaq 0x1163d(%rip), %rdi     # 0x354a7
leaq 0x11673(%rip), %rsi     # 0x354e4
movl %ebx, %edx
callq 0x23c78
leaq 0x1166a(%rip), %rdi     # 0x354e9
leaq 0x11699(%rip), %rsi     # 0x3551f
xorl %edx, %edx
callq 0x23c78
leaq 0x11690(%rip), %rdi     # 0x35524
leaq 0x116c0(%rip), %r14     # 0x3555b
movq %r14, %rsi
xorl %edx, %edx
callq 0x23c78
leaq 0x116b4(%rip), %rdi     # 0x35560
movq %r14, %rsi
movl %ebx, %edx
callq 0x23c78
leaq 0x116dc(%rip), %rdi     # 0x35599
leaq 0x11709(%rip), %r14     # 0x355cd
movq %r14, %rsi
movl $0x1f4, %edx            # imm = 0x1F4
callq 0x23c78
leaq 0x116fa(%rip), %rdi     # 0x355d2
movq %r14, %rsi
movl $0x140, %edx            # imm = 0x140
callq 0x23c78
leaq 0x1171b(%rip), %rdi     # 0x35607
leaq 0x11744(%rip), %rsi     # 0x35637
movl $0x140, %edx            # imm = 0x140
callq 0x23c78
leaq 0x11738(%rip), %rdi     # 0x3563c
leaq 0x1175c(%rip), %rsi     # 0x35667
movl $0xffffff24, %edx       # imm = 0xFFFFFF24
callq 0x23c78
leaq 0x11750(%rip), %rdi     # 0x3566c
leaq 0x11780(%rip), %rsi     # 0x356a3
movl $0xfffffe70, %edx       # imm = 0xFFFFFE70
callq 0x23c78
leaq 0x11774(%rip), %rdi     # 0x356a8
leaq 0x117a4(%rip), %rsi     # 0x356df
movl %ebx, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x23c78
nopl (%rax)