// File: /workspace/github_cpp_makefile_star2_O2/jswaff[P]prophet3/test/pos__test.cpp
// Function: test_remove_rook_castling_availability()
void test_remove_rook_castling_availability() {
    position pos;
    reset_pos(&pos);
    assert(can_castle_wk(&pos));
    assert(can_castle_wq(&pos));
    assert(can_castle_bk(&pos));
    assert(can_castle_bq(&pos));

    remove_rook_castling_availability(&pos,A1);
    assert(can_castle_wk(&pos));
    assert(!can_castle_wq(&pos));
    assert(can_castle_bk(&pos));
    assert(can_castle_bq(&pos));

    remove_rook_castling_availability(&pos,H8);
    assert(can_castle_wk(&pos));
    assert(!can_castle_wq(&pos));
    assert(!can_castle_bk(&pos));
    assert(can_castle_bq(&pos));

    remove_rook_castling_availability(&pos,H8);
    assert(can_castle_wk(&pos));
    assert(!can_castle_wq(&pos));
    assert(!can_castle_bk(&pos));
    assert(can_castle_bq(&pos));

    remove_rook_castling_availability(&pos,H1);
    assert(!can_castle_wk(&pos));
    assert(!can_castle_wq(&pos));
    assert(!can_castle_bk(&pos));
    assert(can_castle_bq(&pos));

    remove_rook_castling_availability(&pos,A8);
    assert(pos.castling_rights==0);

}

// Assembly:
pushq %rbx
subq $0x1d0, %rsp            # imm = 0x1D0
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xa187
movq %rbx, %rdi
callq 0xa0ba
testb %al, %al
je 0x20ec5
leaq 0x8(%rsp), %rdi
callq 0xa0c3
testb %al, %al
je 0x20ee4
leaq 0x8(%rsp), %rdi
callq 0xa0ce
testb %al, %al
je 0x20f03
leaq 0x8(%rsp), %rdi
callq 0xa0da
testb %al, %al
je 0x20f22
leaq 0x8(%rsp), %rbx
pushq $0x38
popq %rsi
movq %rbx, %rdi
callq 0xa0e6
movq %rbx, %rdi
callq 0xa0ba
testb %al, %al
je 0x20f41
leaq 0x8(%rsp), %rdi
callq 0xa0c3
testb %al, %al
jne 0x20f60
leaq 0x8(%rsp), %rdi
callq 0xa0ce
testb %al, %al
je 0x20f7f
leaq 0x8(%rsp), %rdi
callq 0xa0da
testb %al, %al
je 0x20f9e
leaq 0x8(%rsp), %rbx
pushq $0x7
popq %rsi
movq %rbx, %rdi
callq 0xa0e6
movq %rbx, %rdi
callq 0xa0ba
testb %al, %al
je 0x20fbd
leaq 0x8(%rsp), %rdi
callq 0xa0c3
testb %al, %al
jne 0x20fdc
leaq 0x8(%rsp), %rdi
callq 0xa0ce
testb %al, %al
jne 0x20ffb
leaq 0x8(%rsp), %rdi
callq 0xa0da
testb %al, %al
je 0x2101a
leaq 0x8(%rsp), %rbx
pushq $0x7
popq %rsi
movq %rbx, %rdi
callq 0xa0e6
movq %rbx, %rdi
callq 0xa0ba
testb %al, %al
je 0x21039
leaq 0x8(%rsp), %rdi
callq 0xa0c3
testb %al, %al
jne 0x21058
leaq 0x8(%rsp), %rdi
callq 0xa0ce
testb %al, %al
jne 0x21077
leaq 0x8(%rsp), %rdi
callq 0xa0da
testb %al, %al
je 0x21096
leaq 0x8(%rsp), %rbx
pushq $0x3f
popq %rsi
movq %rbx, %rdi
callq 0xa0e6
movq %rbx, %rdi
callq 0xa0ba
testb %al, %al
jne 0x210b5
leaq 0x8(%rsp), %rdi
callq 0xa0c3
testb %al, %al
jne 0x210d4
leaq 0x8(%rsp), %rdi
callq 0xa0ce
testb %al, %al
jne 0x210f3
leaq 0x8(%rsp), %rdi
callq 0xa0da
testb %al, %al
je 0x21112
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xa0e6
cmpl $0x0, 0x140(%rbx)
jne 0x21131
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
retq
leaq 0x131bd(%rip), %rdi     # 0x34089
leaq 0x128f9(%rip), %rsi     # 0x337cc
leaq 0x13180(%rip), %rcx     # 0x3405a
movl $0xf0, %edx
callq 0x20c0
leaq 0x1311a(%rip), %rdi     # 0x34005
leaq 0x128da(%rip), %rsi     # 0x337cc
leaq 0x13161(%rip), %rcx     # 0x3405a
movl $0xf1, %edx
callq 0x20c0
leaq 0x13125(%rip), %rdi     # 0x3402f
leaq 0x128bb(%rip), %rsi     # 0x337cc
leaq 0x13142(%rip), %rcx     # 0x3405a
movl $0xf2, %edx
callq 0x20c0
leaq 0x130f1(%rip), %rdi     # 0x3401a
leaq 0x1289c(%rip), %rsi     # 0x337cc
leaq 0x13123(%rip), %rcx     # 0x3405a
movl $0xf3, %edx
callq 0x20c0
leaq 0x13141(%rip), %rdi     # 0x34089
leaq 0x1287d(%rip), %rsi     # 0x337cc
leaq 0x13104(%rip), %rcx     # 0x3405a
movl $0xf6, %edx
callq 0x20c0
leaq 0x1309d(%rip), %rdi     # 0x34004
leaq 0x1285e(%rip), %rsi     # 0x337cc
leaq 0x130e5(%rip), %rcx     # 0x3405a
movl $0xf7, %edx
callq 0x20c0
leaq 0x130a9(%rip), %rdi     # 0x3402f
leaq 0x1283f(%rip), %rsi     # 0x337cc
leaq 0x130c6(%rip), %rcx     # 0x3405a
movl $0xf8, %edx
callq 0x20c0
leaq 0x13075(%rip), %rdi     # 0x3401a
leaq 0x12820(%rip), %rsi     # 0x337cc
leaq 0x130a7(%rip), %rcx     # 0x3405a
movl $0xf9, %edx
callq 0x20c0
leaq 0x130c5(%rip), %rdi     # 0x34089
leaq 0x12801(%rip), %rsi     # 0x337cc
leaq 0x13088(%rip), %rcx     # 0x3405a
movl $0xfc, %edx
callq 0x20c0
leaq 0x13021(%rip), %rdi     # 0x34004
leaq 0x127e2(%rip), %rsi     # 0x337cc
leaq 0x13069(%rip), %rcx     # 0x3405a
movl $0xfd, %edx
callq 0x20c0
leaq 0x1302c(%rip), %rdi     # 0x3402e
leaq 0x127c3(%rip), %rsi     # 0x337cc
leaq 0x1304a(%rip), %rcx     # 0x3405a
movl $0xfe, %edx
callq 0x20c0
leaq 0x12ff9(%rip), %rdi     # 0x3401a
leaq 0x127a4(%rip), %rsi     # 0x337cc
leaq 0x1302b(%rip), %rcx     # 0x3405a
movl $0xff, %edx
callq 0x20c0
leaq 0x13049(%rip), %rdi     # 0x34089
leaq 0x12785(%rip), %rsi     # 0x337cc
leaq 0x1300c(%rip), %rcx     # 0x3405a
movl $0x102, %edx            # imm = 0x102
callq 0x20c0
leaq 0x12fa5(%rip), %rdi     # 0x34004
leaq 0x12766(%rip), %rsi     # 0x337cc
leaq 0x12fed(%rip), %rcx     # 0x3405a
movl $0x103, %edx            # imm = 0x103
callq 0x20c0
leaq 0x12fb0(%rip), %rdi     # 0x3402e
leaq 0x12747(%rip), %rsi     # 0x337cc
leaq 0x12fce(%rip), %rcx     # 0x3405a
movl $0x104, %edx            # imm = 0x104
callq 0x20c0
leaq 0x12f7d(%rip), %rdi     # 0x3401a
leaq 0x12728(%rip), %rsi     # 0x337cc
leaq 0x12faf(%rip), %rcx     # 0x3405a
movl $0x105, %edx            # imm = 0x105
callq 0x20c0
leaq 0x12fcc(%rip), %rdi     # 0x34088
leaq 0x12709(%rip), %rsi     # 0x337cc
leaq 0x12f90(%rip), %rcx     # 0x3405a
movl $0x108, %edx            # imm = 0x108
callq 0x20c0
leaq 0x12f29(%rip), %rdi     # 0x34004
leaq 0x126ea(%rip), %rsi     # 0x337cc
leaq 0x12f71(%rip), %rcx     # 0x3405a
movl $0x109, %edx            # imm = 0x109
callq 0x20c0
leaq 0x12f34(%rip), %rdi     # 0x3402e
leaq 0x126cb(%rip), %rsi     # 0x337cc
leaq 0x12f52(%rip), %rcx     # 0x3405a
movl $0x10a, %edx            # imm = 0x10A
callq 0x20c0
leaq 0x12f01(%rip), %rdi     # 0x3401a
leaq 0x126ac(%rip), %rsi     # 0x337cc
leaq 0x12f33(%rip), %rcx     # 0x3405a
movl $0x10b, %edx            # imm = 0x10B
callq 0x20c0
leaq 0x12f0b(%rip), %rdi     # 0x34043
leaq 0x1268d(%rip), %rsi     # 0x337cc
leaq 0x12f14(%rip), %rcx     # 0x3405a
movl $0x10e, %edx            # imm = 0x10E
callq 0x20c0