// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
movq %rsp, %rbx
movq %rbx, %rdi
callq 0xa187
xorl %r14d, %r14d
pushq $0x1
popq %rbp
cmpq $0x40, %r14
je 0x21d00
movl (%rsp,%r14,4), %r15d
movl %r15d, %edi
callq 0xdba0
testb %al, %al
je 0x21cc5
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0xa59c
testb %al, %al
je 0x21dbc
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0xa519
testb %al, %al
je 0x21cfb
jmp 0x21d9d
movl %r15d, %edi
callq 0xdba6
testb %al, %al
je 0x21cfb
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0xa59c
testb %al, %al
jne 0x21e38
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0xa519
testb %al, %al
je 0x21e19
incq %r14
jmp 0x21c84
leaq 0x979c(%rip), %rsi      # 0x2b4a3
movq %rsp, %rbx
movq %rbx, %rdi
callq 0xa1b8
xorl %r14d, %r14d
cmpq $0x40, %r14
je 0x21d8f
movl (%rsp,%r14,4), %ebp
movl %ebp, %edi
callq 0xdba0
testb %al, %al
je 0x21d55
movq %rbx, %rdi
movl %r14d, %esi
xorl %edx, %edx
callq 0xa59c
testb %al, %al
jne 0x21ddb
movq %rbx, %rdi
movl %r14d, %esi
xorl %edx, %edx
callq 0xa519
testb %al, %al
jne 0x21d8a
jmp 0x21dfa
movl %ebp, %edi
callq 0xdba6
testb %al, %al
je 0x21d8a
movq %rbx, %rdi
movl %r14d, %esi
xorl %edx, %edx
callq 0xa59c
testb %al, %al
je 0x21e57
movq %rbx, %rdi
movl %r14d, %esi
xorl %edx, %edx
callq 0xa519
testb %al, %al
jne 0x21e76
incq %r14
jmp 0x21d15
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x12972(%rip), %rdi     # 0x34716
leaq 0x11a21(%rip), %rsi     # 0x337cc
leaq 0x12939(%rip), %rcx     # 0x346eb
movl $0x1c1, %edx            # imm = 0x1C1
callq 0x20c0
leaq 0x12980(%rip), %rdi     # 0x34743
leaq 0x11a02(%rip), %rsi     # 0x337cc
leaq 0x1291a(%rip), %rcx     # 0x346eb
movl $0x1c0, %edx            # imm = 0x1C0
callq 0x20c0
leaq 0x1298f(%rip), %rdi     # 0x34771
leaq 0x119e3(%rip), %rsi     # 0x337cc
leaq 0x128fb(%rip), %rcx     # 0x346eb
movl $0x1cd, %edx            # imm = 0x1CD
callq 0x20c0
leaq 0x129a0(%rip), %rdi     # 0x347a1
leaq 0x119c4(%rip), %rsi     # 0x337cc
leaq 0x128dc(%rip), %rcx     # 0x346eb
movl $0x1ce, %edx            # imm = 0x1CE
callq 0x20c0
leaq 0x128f7(%rip), %rdi     # 0x34717
leaq 0x119a5(%rip), %rsi     # 0x337cc
leaq 0x128bd(%rip), %rcx     # 0x346eb
movl $0x1c4, %edx            # imm = 0x1C4
callq 0x20c0
leaq 0x12903(%rip), %rdi     # 0x34742
leaq 0x11986(%rip), %rsi     # 0x337cc
leaq 0x1289e(%rip), %rcx     # 0x346eb
movl $0x1c3, %edx            # imm = 0x1C3
callq 0x20c0
leaq 0x12914(%rip), %rdi     # 0x34772
leaq 0x11967(%rip), %rsi     # 0x337cc
leaq 0x1287f(%rip), %rcx     # 0x346eb
movl $0x1d0, %edx            # imm = 0x1D0
callq 0x20c0
leaq 0x12923(%rip), %rdi     # 0x347a0
leaq 0x11948(%rip), %rsi     # 0x337cc
leaq 0x12860(%rip), %rcx     # 0x346eb
movl $0x1d1, %edx            # imm = 0x1D1
callq 0x20c0