// File: /workspace/github_cpp_makefile_star2_O3/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 0xaa51
movq %rbx, %rdi
callq 0xa921
testb %al, %al
je 0x22f23
leaq 0x8(%rsp), %rdi
callq 0xa92a
testb %al, %al
je 0x22f42
leaq 0x8(%rsp), %rdi
callq 0xa935
testb %al, %al
je 0x22f61
leaq 0x8(%rsp), %rdi
callq 0xa941
testb %al, %al
je 0x22f80
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movl $0x38, %esi
callq 0xa94d
movq %rbx, %rdi
callq 0xa921
testb %al, %al
je 0x22f9f
leaq 0x8(%rsp), %rdi
callq 0xa92a
testb %al, %al
jne 0x22fbe
leaq 0x8(%rsp), %rdi
callq 0xa935
testb %al, %al
je 0x22fdd
leaq 0x8(%rsp), %rdi
callq 0xa941
testb %al, %al
je 0x22ffc
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movl $0x7, %esi
callq 0xa94d
movq %rbx, %rdi
callq 0xa921
testb %al, %al
je 0x2301b
leaq 0x8(%rsp), %rdi
callq 0xa92a
testb %al, %al
jne 0x2303a
leaq 0x8(%rsp), %rdi
callq 0xa935
testb %al, %al
jne 0x23059
leaq 0x8(%rsp), %rdi
callq 0xa941
testb %al, %al
je 0x23078
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movl $0x7, %esi
callq 0xa94d
movq %rbx, %rdi
callq 0xa921
testb %al, %al
je 0x23097
leaq 0x8(%rsp), %rdi
callq 0xa92a
testb %al, %al
jne 0x230b6
leaq 0x8(%rsp), %rdi
callq 0xa935
testb %al, %al
jne 0x230d5
leaq 0x8(%rsp), %rdi
callq 0xa941
testb %al, %al
je 0x230f4
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movl $0x3f, %esi
callq 0xa94d
movq %rbx, %rdi
callq 0xa921
testb %al, %al
jne 0x23113
leaq 0x8(%rsp), %rdi
callq 0xa92a
testb %al, %al
jne 0x23132
leaq 0x8(%rsp), %rdi
callq 0xa935
testb %al, %al
jne 0x23151
leaq 0x8(%rsp), %rdi
callq 0xa941
testb %al, %al
je 0x23170
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xa94d
cmpl $0x0, 0x140(%rbx)
jne 0x2318f
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
retq
leaq 0x1309b(%rip), %rdi     # 0x35fc5
leaq 0x127d7(%rip), %rsi     # 0x35708
leaq 0x1305e(%rip), %rcx     # 0x35f96
movl $0xf0, %edx
callq 0x20d0
leaq 0x12ff8(%rip), %rdi     # 0x35f41
leaq 0x127b8(%rip), %rsi     # 0x35708
leaq 0x1303f(%rip), %rcx     # 0x35f96
movl $0xf1, %edx
callq 0x20d0
leaq 0x13003(%rip), %rdi     # 0x35f6b
leaq 0x12799(%rip), %rsi     # 0x35708
leaq 0x13020(%rip), %rcx     # 0x35f96
movl $0xf2, %edx
callq 0x20d0
leaq 0x12fcf(%rip), %rdi     # 0x35f56
leaq 0x1277a(%rip), %rsi     # 0x35708
leaq 0x13001(%rip), %rcx     # 0x35f96
movl $0xf3, %edx
callq 0x20d0
leaq 0x1301f(%rip), %rdi     # 0x35fc5
leaq 0x1275b(%rip), %rsi     # 0x35708
leaq 0x12fe2(%rip), %rcx     # 0x35f96
movl $0xf6, %edx
callq 0x20d0
leaq 0x12f7b(%rip), %rdi     # 0x35f40
leaq 0x1273c(%rip), %rsi     # 0x35708
leaq 0x12fc3(%rip), %rcx     # 0x35f96
movl $0xf7, %edx
callq 0x20d0
leaq 0x12f87(%rip), %rdi     # 0x35f6b
leaq 0x1271d(%rip), %rsi     # 0x35708
leaq 0x12fa4(%rip), %rcx     # 0x35f96
movl $0xf8, %edx
callq 0x20d0
leaq 0x12f53(%rip), %rdi     # 0x35f56
leaq 0x126fe(%rip), %rsi     # 0x35708
leaq 0x12f85(%rip), %rcx     # 0x35f96
movl $0xf9, %edx
callq 0x20d0
leaq 0x12fa3(%rip), %rdi     # 0x35fc5
leaq 0x126df(%rip), %rsi     # 0x35708
leaq 0x12f66(%rip), %rcx     # 0x35f96
movl $0xfc, %edx
callq 0x20d0
leaq 0x12eff(%rip), %rdi     # 0x35f40
leaq 0x126c0(%rip), %rsi     # 0x35708
leaq 0x12f47(%rip), %rcx     # 0x35f96
movl $0xfd, %edx
callq 0x20d0
leaq 0x12f0a(%rip), %rdi     # 0x35f6a
leaq 0x126a1(%rip), %rsi     # 0x35708
leaq 0x12f28(%rip), %rcx     # 0x35f96
movl $0xfe, %edx
callq 0x20d0
leaq 0x12ed7(%rip), %rdi     # 0x35f56
leaq 0x12682(%rip), %rsi     # 0x35708
leaq 0x12f09(%rip), %rcx     # 0x35f96
movl $0xff, %edx
callq 0x20d0
leaq 0x12f27(%rip), %rdi     # 0x35fc5
leaq 0x12663(%rip), %rsi     # 0x35708
leaq 0x12eea(%rip), %rcx     # 0x35f96
movl $0x102, %edx            # imm = 0x102
callq 0x20d0
leaq 0x12e83(%rip), %rdi     # 0x35f40
leaq 0x12644(%rip), %rsi     # 0x35708
leaq 0x12ecb(%rip), %rcx     # 0x35f96
movl $0x103, %edx            # imm = 0x103
callq 0x20d0
leaq 0x12e8e(%rip), %rdi     # 0x35f6a
leaq 0x12625(%rip), %rsi     # 0x35708
leaq 0x12eac(%rip), %rcx     # 0x35f96
movl $0x104, %edx            # imm = 0x104
callq 0x20d0
leaq 0x12e5b(%rip), %rdi     # 0x35f56
leaq 0x12606(%rip), %rsi     # 0x35708
leaq 0x12e8d(%rip), %rcx     # 0x35f96
movl $0x105, %edx            # imm = 0x105
callq 0x20d0
leaq 0x12eaa(%rip), %rdi     # 0x35fc4
leaq 0x125e7(%rip), %rsi     # 0x35708
leaq 0x12e6e(%rip), %rcx     # 0x35f96
movl $0x108, %edx            # imm = 0x108
callq 0x20d0
leaq 0x12e07(%rip), %rdi     # 0x35f40
leaq 0x125c8(%rip), %rsi     # 0x35708
leaq 0x12e4f(%rip), %rcx     # 0x35f96
movl $0x109, %edx            # imm = 0x109
callq 0x20d0
leaq 0x12e12(%rip), %rdi     # 0x35f6a
leaq 0x125a9(%rip), %rsi     # 0x35708
leaq 0x12e30(%rip), %rcx     # 0x35f96
movl $0x10a, %edx            # imm = 0x10A
callq 0x20d0
leaq 0x12ddf(%rip), %rdi     # 0x35f56
leaq 0x1258a(%rip), %rsi     # 0x35708
leaq 0x12e11(%rip), %rcx     # 0x35f96
movl $0x10b, %edx            # imm = 0x10B
callq 0x20d0
leaq 0x12de9(%rip), %rdi     # 0x35f7f
leaq 0x1256b(%rip), %rsi     # 0x35708
leaq 0x12df2(%rip), %rcx     # 0x35f96
movl $0x10e, %edx            # imm = 0x10E
callq 0x20d0