// File: /workspace/github_cpp_makefile_star2_O3/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 0x134a5(%rip), %rsi     # 0x35ef2
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa82
movq %rbx, %rdi
callq 0xa921
testb %al, %al
je 0x22bb0
leaq 0x8(%rsp), %rdi
callq 0xa92a
testb %al, %al
je 0x22bcf
leaq 0x8(%rsp), %rdi
callq 0xa935
testb %al, %al
je 0x22bee
leaq 0x8(%rsp), %rdi
callq 0xa941
testb %al, %al
je 0x22c0d
movl $0x4, %edi
movl $0x38, %esi
xorl %edx, %edx
movl $0x4, %ecx
callq 0x777b
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0xa986
movq %rbx, %rdi
callq 0xa921
testb %al, %al
je 0x22c2c
leaq 0x8(%rsp), %rdi
callq 0xa92a
testb %al, %al
jne 0x22c4b
leaq 0x8(%rsp), %rdi
callq 0xa935
testb %al, %al
je 0x22c6a
leaq 0x8(%rsp), %rdi
callq 0xa941
testb %al, %al
jne 0x22c89
movl $0x6, %edi
movl $0x4, %esi
movl $0xc, %edx
callq 0x775c
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0xa986
movq %rbx, %rdi
callq 0xa921
testb %al, %al
je 0x22ca8
leaq 0x8(%rsp), %rdi
callq 0xa92a
testb %al, %al
jne 0x22cc7
leaq 0x8(%rsp), %rdi
callq 0xa935
testb %al, %al
jne 0x22ce6
leaq 0x8(%rsp), %rdi
callq 0xa941
testb %al, %al
jne 0x22d05
movl $0x4, %edi
movl $0x3f, %esi
movl $0xf, %edx
callq 0x775c
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0xa986
cmpl $0x0, 0x140(%rbx)
jne 0x22d24
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
retq
leaq 0x1340e(%rip), %rdi     # 0x35fc5
leaq 0x12b4a(%rip), %rsi     # 0x35708
leaq 0x13352(%rip), %rcx     # 0x35f17
movl $0xd5, %edx
callq 0x20d0
leaq 0x1336b(%rip), %rdi     # 0x35f41
leaq 0x12b2b(%rip), %rsi     # 0x35708
leaq 0x13333(%rip), %rcx     # 0x35f17
movl $0xd6, %edx
callq 0x20d0
leaq 0x13376(%rip), %rdi     # 0x35f6b
leaq 0x12b0c(%rip), %rsi     # 0x35708
leaq 0x13314(%rip), %rcx     # 0x35f17
movl $0xd7, %edx
callq 0x20d0
leaq 0x13342(%rip), %rdi     # 0x35f56
leaq 0x12aed(%rip), %rsi     # 0x35708
leaq 0x132f5(%rip), %rcx     # 0x35f17
movl $0xd8, %edx
callq 0x20d0
leaq 0x13392(%rip), %rdi     # 0x35fc5
leaq 0x12ace(%rip), %rsi     # 0x35708
leaq 0x132d6(%rip), %rcx     # 0x35f17
movl $0xdc, %edx
callq 0x20d0
leaq 0x132ee(%rip), %rdi     # 0x35f40
leaq 0x12aaf(%rip), %rsi     # 0x35708
leaq 0x132b7(%rip), %rcx     # 0x35f17
movl $0xdd, %edx
callq 0x20d0
leaq 0x132fa(%rip), %rdi     # 0x35f6b
leaq 0x12a90(%rip), %rsi     # 0x35708
leaq 0x13298(%rip), %rcx     # 0x35f17
movl $0xde, %edx
callq 0x20d0
leaq 0x132c5(%rip), %rdi     # 0x35f55
leaq 0x12a71(%rip), %rsi     # 0x35708
leaq 0x13279(%rip), %rcx     # 0x35f17
movl $0xdf, %edx
callq 0x20d0
leaq 0x13316(%rip), %rdi     # 0x35fc5
leaq 0x12a52(%rip), %rsi     # 0x35708
leaq 0x1325a(%rip), %rcx     # 0x35f17
movl $0xe3, %edx
callq 0x20d0
leaq 0x13272(%rip), %rdi     # 0x35f40
leaq 0x12a33(%rip), %rsi     # 0x35708
leaq 0x1323b(%rip), %rcx     # 0x35f17
movl $0xe4, %edx
callq 0x20d0
leaq 0x1327d(%rip), %rdi     # 0x35f6a
leaq 0x12a14(%rip), %rsi     # 0x35708
leaq 0x1321c(%rip), %rcx     # 0x35f17
movl $0xe5, %edx
callq 0x20d0
leaq 0x13249(%rip), %rdi     # 0x35f55
leaq 0x129f5(%rip), %rsi     # 0x35708
leaq 0x131fd(%rip), %rcx     # 0x35f17
movl $0xe6, %edx
callq 0x20d0
leaq 0x13254(%rip), %rdi     # 0x35f7f
leaq 0x129d6(%rip), %rsi     # 0x35708
leaq 0x131de(%rip), %rcx     # 0x35f17
movl $0xea, %edx
callq 0x20d0