// File: 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 %rbp
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
leaq -0x1c8(%rbp), %rdi
callq 0xf390
leaq -0x1c8(%rbp), %rdi
callq 0xf1e0
testb $0x1, %al
jne 0x2dc09
jmp 0x2dc0b
jmp 0x2dc2a
leaq 0x14c08(%rip), %rdi     # 0x4281a
leaq 0x14344(%rip), %rsi     # 0x41f5d
movl $0xf0, %edx
leaq 0x14bc6(%rip), %rcx     # 0x427eb
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
callq 0xf200
testb $0x1, %al
jne 0x2dc3c
jmp 0x2dc3e
jmp 0x2dc5d
leaq 0x14b51(%rip), %rdi     # 0x42796
leaq 0x14311(%rip), %rsi     # 0x41f5d
movl $0xf1, %edx
leaq 0x14b93(%rip), %rcx     # 0x427eb
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
callq 0xf220
testb $0x1, %al
jne 0x2dc6f
jmp 0x2dc71
jmp 0x2dc90
leaq 0x14b48(%rip), %rdi     # 0x427c0
leaq 0x142de(%rip), %rsi     # 0x41f5d
movl $0xf2, %edx
leaq 0x14b60(%rip), %rcx     # 0x427eb
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
callq 0xf240
testb $0x1, %al
jne 0x2dca2
jmp 0x2dca4
jmp 0x2dcc3
leaq 0x14b00(%rip), %rdi     # 0x427ab
leaq 0x142ab(%rip), %rsi     # 0x41f5d
movl $0xf3, %edx
leaq 0x14b2d(%rip), %rcx     # 0x427eb
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
movl $0x38, %esi
callq 0xf260
leaq -0x1c8(%rbp), %rdi
callq 0xf1e0
testb $0x1, %al
jne 0x2dce6
jmp 0x2dce8
jmp 0x2dd07
leaq 0x14b2b(%rip), %rdi     # 0x4281a
leaq 0x14267(%rip), %rsi     # 0x41f5d
movl $0xf6, %edx
leaq 0x14ae9(%rip), %rcx     # 0x427eb
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
callq 0xf200
xorb $-0x1, %al
testb $0x1, %al
jne 0x2dd1b
jmp 0x2dd1d
jmp 0x2dd3c
leaq 0x14a71(%rip), %rdi     # 0x42795
leaq 0x14232(%rip), %rsi     # 0x41f5d
movl $0xf7, %edx
leaq 0x14ab4(%rip), %rcx     # 0x427eb
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
callq 0xf220
testb $0x1, %al
jne 0x2dd4e
jmp 0x2dd50
jmp 0x2dd6f
leaq 0x14a69(%rip), %rdi     # 0x427c0
leaq 0x141ff(%rip), %rsi     # 0x41f5d
movl $0xf8, %edx
leaq 0x14a81(%rip), %rcx     # 0x427eb
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
callq 0xf240
testb $0x1, %al
jne 0x2dd81
jmp 0x2dd83
jmp 0x2dda2
leaq 0x14a21(%rip), %rdi     # 0x427ab
leaq 0x141cc(%rip), %rsi     # 0x41f5d
movl $0xf9, %edx
leaq 0x14a4e(%rip), %rcx     # 0x427eb
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
movl $0x7, %esi
callq 0xf260
leaq -0x1c8(%rbp), %rdi
callq 0xf1e0
testb $0x1, %al
jne 0x2ddc5
jmp 0x2ddc7
jmp 0x2dde6
leaq 0x14a4c(%rip), %rdi     # 0x4281a
leaq 0x14188(%rip), %rsi     # 0x41f5d
movl $0xfc, %edx
leaq 0x14a0a(%rip), %rcx     # 0x427eb
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
callq 0xf200
xorb $-0x1, %al
testb $0x1, %al
jne 0x2ddfa
jmp 0x2ddfc
jmp 0x2de1b
leaq 0x14992(%rip), %rdi     # 0x42795
leaq 0x14153(%rip), %rsi     # 0x41f5d
movl $0xfd, %edx
leaq 0x149d5(%rip), %rcx     # 0x427eb
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
callq 0xf220
xorb $-0x1, %al
testb $0x1, %al
jne 0x2de2f
jmp 0x2de31
jmp 0x2de50
leaq 0x14987(%rip), %rdi     # 0x427bf
leaq 0x1411e(%rip), %rsi     # 0x41f5d
movl $0xfe, %edx
leaq 0x149a0(%rip), %rcx     # 0x427eb
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
callq 0xf240
testb $0x1, %al
jne 0x2de62
jmp 0x2de64
jmp 0x2de83
leaq 0x14940(%rip), %rdi     # 0x427ab
leaq 0x140eb(%rip), %rsi     # 0x41f5d
movl $0xff, %edx
leaq 0x1496d(%rip), %rcx     # 0x427eb
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
movl $0x7, %esi
callq 0xf260
leaq -0x1c8(%rbp), %rdi
callq 0xf1e0
testb $0x1, %al
jne 0x2dea6
jmp 0x2dea8
jmp 0x2dec7
leaq 0x1496b(%rip), %rdi     # 0x4281a
leaq 0x140a7(%rip), %rsi     # 0x41f5d
movl $0x102, %edx            # imm = 0x102
leaq 0x14929(%rip), %rcx     # 0x427eb
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
callq 0xf200
xorb $-0x1, %al
testb $0x1, %al
jne 0x2dedb
jmp 0x2dedd
jmp 0x2defc
leaq 0x148b1(%rip), %rdi     # 0x42795
leaq 0x14072(%rip), %rsi     # 0x41f5d
movl $0x103, %edx            # imm = 0x103
leaq 0x148f4(%rip), %rcx     # 0x427eb
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
callq 0xf220
xorb $-0x1, %al
testb $0x1, %al
jne 0x2df10
jmp 0x2df12
jmp 0x2df31
leaq 0x148a6(%rip), %rdi     # 0x427bf
leaq 0x1403d(%rip), %rsi     # 0x41f5d
movl $0x104, %edx            # imm = 0x104
leaq 0x148bf(%rip), %rcx     # 0x427eb
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
callq 0xf240
testb $0x1, %al
jne 0x2df43
jmp 0x2df45
jmp 0x2df64
leaq 0x1485f(%rip), %rdi     # 0x427ab
leaq 0x1400a(%rip), %rsi     # 0x41f5d
movl $0x105, %edx            # imm = 0x105
leaq 0x1488c(%rip), %rcx     # 0x427eb
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
movl $0x3f, %esi
callq 0xf260
leaq -0x1c8(%rbp), %rdi
callq 0xf1e0
xorb $-0x1, %al
testb $0x1, %al
jne 0x2df89
jmp 0x2df8b
jmp 0x2dfaa
leaq 0x14887(%rip), %rdi     # 0x42819
leaq 0x13fc4(%rip), %rsi     # 0x41f5d
movl $0x108, %edx            # imm = 0x108
leaq 0x14846(%rip), %rcx     # 0x427eb
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
callq 0xf200
xorb $-0x1, %al
testb $0x1, %al
jne 0x2dfbe
jmp 0x2dfc0
jmp 0x2dfdf
leaq 0x147ce(%rip), %rdi     # 0x42795
leaq 0x13f8f(%rip), %rsi     # 0x41f5d
movl $0x109, %edx            # imm = 0x109
leaq 0x14811(%rip), %rcx     # 0x427eb
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
callq 0xf220
xorb $-0x1, %al
testb $0x1, %al
jne 0x2dff3
jmp 0x2dff5
jmp 0x2e014
leaq 0x147c3(%rip), %rdi     # 0x427bf
leaq 0x13f5a(%rip), %rsi     # 0x41f5d
movl $0x10a, %edx            # imm = 0x10A
leaq 0x147dc(%rip), %rcx     # 0x427eb
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
callq 0xf240
testb $0x1, %al
jne 0x2e026
jmp 0x2e028
jmp 0x2e047
leaq 0x1477c(%rip), %rdi     # 0x427ab
leaq 0x13f27(%rip), %rsi     # 0x41f5d
movl $0x10b, %edx            # imm = 0x10B
leaq 0x147a9(%rip), %rcx     # 0x427eb
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
xorl %esi, %esi
callq 0xf260
cmpl $0x0, -0x88(%rbp)
jne 0x2e060
jmp 0x2e07f
leaq 0x1476d(%rip), %rdi     # 0x427d4
leaq 0x13eef(%rip), %rsi     # 0x41f5d
movl $0x10e, %edx            # imm = 0x10E
leaq 0x14771(%rip), %rcx     # 0x427eb
callq 0x20c0
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
nopl (%rax,%rax)