// File: /workspace/github_cpp_makefile_star2_O2/jswaff[P]prophet3/test/pos__test.cpp
// Function: test_remove_castling_availability()
void test_remove_castling_availability() {
    position pos;
    set_pos(&pos,"r3k2r/8/8/8/8/8/8/R3K2R w KQkq - 0 1");
    assert(can_castle_wk(&pos));
    assert(can_castle_wq(&pos));
    assert(can_castle_bk(&pos));
    assert(can_castle_bq(&pos));

    move mv = to_capture(ROOK,A1,A8,ROOK);
    remove_castling_availability(&pos,mv);
    assert(can_castle_wk(&pos));
    assert(!can_castle_wq(&pos));
    assert(can_castle_bk(&pos));
    assert(!can_castle_bq(&pos));

    mv = to_move(KING,E8,E7);
    remove_castling_availability(&pos,mv);
    assert(can_castle_wk(&pos));
    assert(!can_castle_wq(&pos));
    assert(!can_castle_bk(&pos));
    assert(!can_castle_bq(&pos));

    mv = to_move(ROOK,H1,H7);
    remove_castling_availability(&pos,mv);
    assert(pos.castling_rights==0);
}

// Assembly:
pushq %rbx
subq $0x1d0, %rsp            # imm = 0x1D0
leaq 0x135ac(%rip), %rsi     # 0x33fb6
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xa1b8
movq %rbx, %rdi
callq 0xa0ba
testb %al, %al
je 0x20b5a
leaq 0x8(%rsp), %rdi
callq 0xa0c3
testb %al, %al
je 0x20b79
leaq 0x8(%rsp), %rdi
callq 0xa0ce
testb %al, %al
je 0x20b98
leaq 0x8(%rsp), %rdi
callq 0xa0da
testb %al, %al
je 0x20bb7
pushq $0x38
popq %rsi
pushq $0x4
popq %rcx
movl %ecx, %edi
xorl %edx, %edx
callq 0x72a3
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0xa10f
movq %rbx, %rdi
callq 0xa0ba
testb %al, %al
je 0x20bd6
leaq 0x8(%rsp), %rdi
callq 0xa0c3
testb %al, %al
jne 0x20bf5
leaq 0x8(%rsp), %rdi
callq 0xa0ce
testb %al, %al
je 0x20c14
leaq 0x8(%rsp), %rdi
callq 0xa0da
testb %al, %al
jne 0x20c33
pushq $0x6
popq %rdi
pushq $0x4
popq %rsi
pushq $0xc
popq %rdx
callq 0x7284
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0xa10f
movq %rbx, %rdi
callq 0xa0ba
testb %al, %al
je 0x20c52
leaq 0x8(%rsp), %rdi
callq 0xa0c3
testb %al, %al
jne 0x20c71
leaq 0x8(%rsp), %rdi
callq 0xa0ce
testb %al, %al
jne 0x20c90
leaq 0x8(%rsp), %rdi
callq 0xa0da
testb %al, %al
jne 0x20caf
pushq $0x4
popq %rdi
pushq $0x3f
popq %rsi
pushq $0xf
popq %rdx
callq 0x7284
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0xa10f
cmpl $0x0, 0x140(%rbx)
jne 0x20cce
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
retq
leaq 0x13528(%rip), %rdi     # 0x34089
leaq 0x12c64(%rip), %rsi     # 0x337cc
leaq 0x1346c(%rip), %rcx     # 0x33fdb
movl $0xd5, %edx
callq 0x20c0
leaq 0x13485(%rip), %rdi     # 0x34005
leaq 0x12c45(%rip), %rsi     # 0x337cc
leaq 0x1344d(%rip), %rcx     # 0x33fdb
movl $0xd6, %edx
callq 0x20c0
leaq 0x13490(%rip), %rdi     # 0x3402f
leaq 0x12c26(%rip), %rsi     # 0x337cc
leaq 0x1342e(%rip), %rcx     # 0x33fdb
movl $0xd7, %edx
callq 0x20c0
leaq 0x1345c(%rip), %rdi     # 0x3401a
leaq 0x12c07(%rip), %rsi     # 0x337cc
leaq 0x1340f(%rip), %rcx     # 0x33fdb
movl $0xd8, %edx
callq 0x20c0
leaq 0x134ac(%rip), %rdi     # 0x34089
leaq 0x12be8(%rip), %rsi     # 0x337cc
leaq 0x133f0(%rip), %rcx     # 0x33fdb
movl $0xdc, %edx
callq 0x20c0
leaq 0x13408(%rip), %rdi     # 0x34004
leaq 0x12bc9(%rip), %rsi     # 0x337cc
leaq 0x133d1(%rip), %rcx     # 0x33fdb
movl $0xdd, %edx
callq 0x20c0
leaq 0x13414(%rip), %rdi     # 0x3402f
leaq 0x12baa(%rip), %rsi     # 0x337cc
leaq 0x133b2(%rip), %rcx     # 0x33fdb
movl $0xde, %edx
callq 0x20c0
leaq 0x133df(%rip), %rdi     # 0x34019
leaq 0x12b8b(%rip), %rsi     # 0x337cc
leaq 0x13393(%rip), %rcx     # 0x33fdb
movl $0xdf, %edx
callq 0x20c0
leaq 0x13430(%rip), %rdi     # 0x34089
leaq 0x12b6c(%rip), %rsi     # 0x337cc
leaq 0x13374(%rip), %rcx     # 0x33fdb
movl $0xe3, %edx
callq 0x20c0
leaq 0x1338c(%rip), %rdi     # 0x34004
leaq 0x12b4d(%rip), %rsi     # 0x337cc
leaq 0x13355(%rip), %rcx     # 0x33fdb
movl $0xe4, %edx
callq 0x20c0
leaq 0x13397(%rip), %rdi     # 0x3402e
leaq 0x12b2e(%rip), %rsi     # 0x337cc
leaq 0x13336(%rip), %rcx     # 0x33fdb
movl $0xe5, %edx
callq 0x20c0
leaq 0x13363(%rip), %rdi     # 0x34019
leaq 0x12b0f(%rip), %rsi     # 0x337cc
leaq 0x13317(%rip), %rcx     # 0x33fdb
movl $0xe6, %edx
callq 0x20c0
leaq 0x1336e(%rip), %rdi     # 0x34043
leaq 0x12af0(%rip), %rsi     # 0x337cc
leaq 0x132f8(%rip), %rcx     # 0x33fdb
movl $0xea, %edx
callq 0x20c0