// File: jswaff[P]prophet3/test/pos__test.cpp
// Function: test_is_enemy_and_friendly_occupied()
void test_is_enemy_and_friendly_occupied() {
    position pos;
    reset_pos(&pos);
    for (int32 sq=A8;sq <= H1; sq++) {
        int32 piece = pos.piece[sq];

        if (is_white_piece(piece)) {
            assert(is_friendly_occupied(&pos,(square_t)sq,WHITE));
            assert(!is_enemy_occupied(&pos,(square_t)sq,WHITE));
        } else if (is_black_piece(piece)) {
            assert(!is_friendly_occupied(&pos,(square_t)sq,WHITE));
            assert(is_enemy_occupied(&pos,(square_t)sq,WHITE));
        }
    }

    set_pos(&pos,"rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1");
    for (int32 sq=A8;sq <= H1; sq++) {
        int32 piece = pos.piece[sq];

        if (is_white_piece(piece)) {
            assert(!is_friendly_occupied(&pos,(square_t)sq,BLACK));
            assert(is_enemy_occupied(&pos,(square_t)sq,BLACK));
        } else if (is_black_piece(piece)) {
            assert(is_friendly_occupied(&pos,(square_t)sq,BLACK));
            assert(!is_enemy_occupied(&pos,(square_t)sq,BLACK));
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1e0, %rsp            # imm = 0x1E0
leaq -0x1c8(%rbp), %rdi
callq 0xf390
movl $0x0, -0x1cc(%rbp)
cmpl $0x3f, -0x1cc(%rbp)
jg 0x2f115
movslq -0x1cc(%rbp), %rax
movl -0x1c8(%rbp,%rax,4), %eax
movl %eax, -0x1d0(%rbp)
movl -0x1d0(%rbp), %edi
callq 0x14da0
testb $0x1, %al
jne 0x2efe6
jmp 0x2f069
movl -0x1cc(%rbp), %esi
leaq -0x1c8(%rbp), %rdi
movl $0x1, %edx
callq 0xfb20
testb $0x1, %al
jne 0x2f003
jmp 0x2f005
jmp 0x2f024
leaq 0x13ec8(%rip), %rdi     # 0x42ed4
leaq 0x12f4a(%rip), %rsi     # 0x41f5d
movl $0x1c0, %edx            # imm = 0x1C0
leaq 0x13e5d(%rip), %rcx     # 0x42e7c
callq 0x20c0
movl -0x1cc(%rbp), %esi
leaq -0x1c8(%rbp), %rdi
movl $0x1, %edx
callq 0xfa30
xorb $-0x1, %al
testb $0x1, %al
jne 0x2f043
jmp 0x2f045
jmp 0x2f064
leaq 0x13e5b(%rip), %rdi     # 0x42ea7
leaq 0x12f0a(%rip), %rsi     # 0x41f5d
movl $0x1c1, %edx            # imm = 0x1C1
leaq 0x13e1d(%rip), %rcx     # 0x42e7c
callq 0x20c0
jmp 0x2f0ff
movl -0x1d0(%rbp), %edi
callq 0x14dc0
testb $0x1, %al
jne 0x2f07d
jmp 0x2f0fd
movl -0x1cc(%rbp), %esi
leaq -0x1c8(%rbp), %rdi
movl $0x1, %edx
callq 0xfb20
xorb $-0x1, %al
testb $0x1, %al
jne 0x2f09c
jmp 0x2f09e
jmp 0x2f0bd
leaq 0x13e2e(%rip), %rdi     # 0x42ed3
leaq 0x12eb1(%rip), %rsi     # 0x41f5d
movl $0x1c3, %edx            # imm = 0x1C3
leaq 0x13dc4(%rip), %rcx     # 0x42e7c
callq 0x20c0
movl -0x1cc(%rbp), %esi
leaq -0x1c8(%rbp), %rdi
movl $0x1, %edx
callq 0xfa30
testb $0x1, %al
jne 0x2f0da
jmp 0x2f0dc
jmp 0x2f0fb
leaq 0x13dc5(%rip), %rdi     # 0x42ea8
leaq 0x12e73(%rip), %rsi     # 0x41f5d
movl $0x1c4, %edx            # imm = 0x1C4
leaq 0x13d86(%rip), %rcx     # 0x42e7c
callq 0x20c0
jmp 0x2f0fd
jmp 0x2f0ff
jmp 0x2f101
movl -0x1cc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1cc(%rbp)
jmp 0x2efb1
leaq -0x1c8(%rbp), %rdi
leaq 0xa1c8(%rip), %rsi      # 0x392eb
callq 0xf3e0
movl $0x0, -0x1d4(%rbp)
cmpl $0x3f, -0x1d4(%rbp)
jg 0x2f284
movslq -0x1d4(%rbp), %rax
movl -0x1c8(%rbp,%rax,4), %eax
movl %eax, -0x1d8(%rbp)
movl -0x1d8(%rbp), %edi
callq 0x14da0
testb $0x1, %al
jne 0x2f164
jmp 0x2f1e1
movl -0x1d4(%rbp), %esi
leaq -0x1c8(%rbp), %rdi
xorl %edx, %edx
callq 0xfb20
xorb $-0x1, %al
testb $0x1, %al
jne 0x2f180
jmp 0x2f182
jmp 0x2f1a1
leaq 0x13d79(%rip), %rdi     # 0x42f02
leaq 0x12dcd(%rip), %rsi     # 0x41f5d
movl $0x1cd, %edx            # imm = 0x1CD
leaq 0x13ce0(%rip), %rcx     # 0x42e7c
callq 0x20c0
movl -0x1d4(%rbp), %esi
leaq -0x1c8(%rbp), %rdi
xorl %edx, %edx
callq 0xfa30
testb $0x1, %al
jne 0x2f1bb
jmp 0x2f1bd
jmp 0x2f1dc
leaq 0x13d6e(%rip), %rdi     # 0x42f32
leaq 0x12d92(%rip), %rsi     # 0x41f5d
movl $0x1ce, %edx            # imm = 0x1CE
leaq 0x13ca5(%rip), %rcx     # 0x42e7c
callq 0x20c0
jmp 0x2f26e
movl -0x1d8(%rbp), %edi
callq 0x14dc0
testb $0x1, %al
jne 0x2f1f2
jmp 0x2f26c
movl -0x1d4(%rbp), %esi
leaq -0x1c8(%rbp), %rdi
xorl %edx, %edx
callq 0xfb20
testb $0x1, %al
jne 0x2f20c
jmp 0x2f20e
jmp 0x2f22d
leaq 0x13cee(%rip), %rdi     # 0x42f03
leaq 0x12d41(%rip), %rsi     # 0x41f5d
movl $0x1d0, %edx            # imm = 0x1D0
leaq 0x13c54(%rip), %rcx     # 0x42e7c
callq 0x20c0
movl -0x1d4(%rbp), %esi
leaq -0x1c8(%rbp), %rdi
xorl %edx, %edx
callq 0xfa30
xorb $-0x1, %al
testb $0x1, %al
jne 0x2f249
jmp 0x2f24b
jmp 0x2f26a
leaq 0x13cdf(%rip), %rdi     # 0x42f31
leaq 0x12d04(%rip), %rsi     # 0x41f5d
movl $0x1d1, %edx            # imm = 0x1D1
leaq 0x13c17(%rip), %rcx     # 0x42e7c
callq 0x20c0
jmp 0x2f26c
jmp 0x2f26e
jmp 0x2f270
movl -0x1d4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1d4(%rbp)
jmp 0x2f132
addq $0x1e0, %rsp            # imm = 0x1E0
popq %rbp
retq
nopl (%rax)