// File: /workspace/github_cpp_makefile_star2_O1/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 0x132a5(%rip), %rsi     # 0x35e72
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xaa74
movq %rbx, %rdi
callq 0xa966
testb %al, %al
je 0x22d30
leaq 0x8(%rsp), %rdi
callq 0xa96f
testb %al, %al
je 0x22d4f
leaq 0x8(%rsp), %rdi
callq 0xa97a
testb %al, %al
je 0x22d6e
leaq 0x8(%rsp), %rdi
callq 0xa986
testb %al, %al
je 0x22d8d
movl $0x4, %edi
movl $0x38, %esi
xorl %edx, %edx
movl $0x4, %ecx
callq 0x76d7
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0xa9cb
movq %rbx, %rdi
callq 0xa966
testb %al, %al
je 0x22dac
leaq 0x8(%rsp), %rdi
callq 0xa96f
testb %al, %al
jne 0x22dcb
leaq 0x8(%rsp), %rdi
callq 0xa97a
testb %al, %al
je 0x22dea
leaq 0x8(%rsp), %rdi
callq 0xa986
testb %al, %al
jne 0x22e09
movl $0x6, %edi
movl $0x4, %esi
movl $0xc, %edx
callq 0x76b8
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0xa9cb
movq %rbx, %rdi
callq 0xa966
testb %al, %al
je 0x22e28
leaq 0x8(%rsp), %rdi
callq 0xa96f
testb %al, %al
jne 0x22e47
leaq 0x8(%rsp), %rdi
callq 0xa97a
testb %al, %al
jne 0x22e66
leaq 0x8(%rsp), %rdi
callq 0xa986
testb %al, %al
jne 0x22e85
movl $0x4, %edi
movl $0x3f, %esi
movl $0xf, %edx
callq 0x76b8
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0xa9cb
cmpl $0x0, 0x140(%rbx)
jne 0x22ea4
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
retq
leaq 0x1320e(%rip), %rdi     # 0x35f45
leaq 0x1294a(%rip), %rsi     # 0x35688
leaq 0x13152(%rip), %rcx     # 0x35e97
movl $0xd5, %edx
callq 0x20d0
leaq 0x1316b(%rip), %rdi     # 0x35ec1
leaq 0x1292b(%rip), %rsi     # 0x35688
leaq 0x13133(%rip), %rcx     # 0x35e97
movl $0xd6, %edx
callq 0x20d0
leaq 0x13176(%rip), %rdi     # 0x35eeb
leaq 0x1290c(%rip), %rsi     # 0x35688
leaq 0x13114(%rip), %rcx     # 0x35e97
movl $0xd7, %edx
callq 0x20d0
leaq 0x13142(%rip), %rdi     # 0x35ed6
leaq 0x128ed(%rip), %rsi     # 0x35688
leaq 0x130f5(%rip), %rcx     # 0x35e97
movl $0xd8, %edx
callq 0x20d0
leaq 0x13192(%rip), %rdi     # 0x35f45
leaq 0x128ce(%rip), %rsi     # 0x35688
leaq 0x130d6(%rip), %rcx     # 0x35e97
movl $0xdc, %edx
callq 0x20d0
leaq 0x130ee(%rip), %rdi     # 0x35ec0
leaq 0x128af(%rip), %rsi     # 0x35688
leaq 0x130b7(%rip), %rcx     # 0x35e97
movl $0xdd, %edx
callq 0x20d0
leaq 0x130fa(%rip), %rdi     # 0x35eeb
leaq 0x12890(%rip), %rsi     # 0x35688
leaq 0x13098(%rip), %rcx     # 0x35e97
movl $0xde, %edx
callq 0x20d0
leaq 0x130c5(%rip), %rdi     # 0x35ed5
leaq 0x12871(%rip), %rsi     # 0x35688
leaq 0x13079(%rip), %rcx     # 0x35e97
movl $0xdf, %edx
callq 0x20d0
leaq 0x13116(%rip), %rdi     # 0x35f45
leaq 0x12852(%rip), %rsi     # 0x35688
leaq 0x1305a(%rip), %rcx     # 0x35e97
movl $0xe3, %edx
callq 0x20d0
leaq 0x13072(%rip), %rdi     # 0x35ec0
leaq 0x12833(%rip), %rsi     # 0x35688
leaq 0x1303b(%rip), %rcx     # 0x35e97
movl $0xe4, %edx
callq 0x20d0
leaq 0x1307d(%rip), %rdi     # 0x35eea
leaq 0x12814(%rip), %rsi     # 0x35688
leaq 0x1301c(%rip), %rcx     # 0x35e97
movl $0xe5, %edx
callq 0x20d0
leaq 0x13049(%rip), %rdi     # 0x35ed5
leaq 0x127f5(%rip), %rsi     # 0x35688
leaq 0x12ffd(%rip), %rcx     # 0x35e97
movl $0xe6, %edx
callq 0x20d0
leaq 0x13054(%rip), %rdi     # 0x35eff
leaq 0x127d6(%rip), %rsi     # 0x35688
leaq 0x12fde(%rip), %rcx     # 0x35e97
movl $0xea, %edx
callq 0x20d0