// File: /workspace/github_cpp_makefile_star2_O1/jswaff[P]prophet3/src/pos.cpp
// Function: equal_pos(position*, position*, bool)
bool equal_pos(position* p1,position* p2,bool strict) {
    for (int32 sq=0;sq<64;sq++) {
        if (p1->piece[sq] != p2->piece[sq]) {
            return false;
        }
    }
    assert(p1->white_pawns==p2->white_pawns);
    assert(p1->black_pawns==p2->black_pawns);

    assert(p1->white_knights==p2->white_knights);
    assert(p1->black_knights==p2->black_knights);

    assert(p1->white_bishops==p2->white_bishops);
    assert(p1->black_bishops==p2->black_bishops);

    assert(p1->white_rooks==p2->white_rooks);
    assert(p1->black_rooks==p2->black_rooks);

    assert(p1->white_queens==p2->white_queens);
    assert(p1->black_queens==p2->black_queens);

    assert(p1->white_pieces==p2->white_pieces);
    assert(p1->black_pieces==p2->black_pieces);

    // if that's true then piece counts should be equal
    assert(p1->piece_counts[WHITE][PAWN]==p2->piece_counts[WHITE][PAWN]);
    assert(p1->piece_counts[WHITE][ROOK]==p2->piece_counts[WHITE][ROOK]);
    assert(p1->piece_counts[WHITE][KNIGHT]==p2->piece_counts[WHITE][KNIGHT]);
    assert(p1->piece_counts[WHITE][BISHOP]==p2->piece_counts[WHITE][BISHOP]);
    assert(p1->piece_counts[WHITE][QUEEN]==p2->piece_counts[WHITE][QUEEN]);

    assert(p1->piece_counts[BLACK][PAWN]==p2->piece_counts[BLACK][PAWN]);
    assert(p1->piece_counts[BLACK][ROOK]==p2->piece_counts[BLACK][ROOK]);
    assert(p1->piece_counts[BLACK][KNIGHT]==p2->piece_counts[BLACK][KNIGHT]);
    assert(p1->piece_counts[BLACK][BISHOP]==p2->piece_counts[BLACK][BISHOP]);
    assert(p1->piece_counts[BLACK][QUEEN]==p2->piece_counts[BLACK][QUEEN]);

    if (p1->player != p2->player) return false;
    if (p1->ep_sq != p2->ep_sq) return false;
    if (p1->castling_rights != p2->castling_rights) return false;
    if (p1->white_king != p2->white_king) return false;
    if (p1->black_king != p2->black_king) return false;
    if (strict) {
        if (p1->move_counter != p2->move_counter) return false;
        if (p1->fifty_counter != p2->fifty_counter) return false;
    }

    // if all that is equal the hash keys should be too
    assert(p1->hash_key==p2->hash_key);
    assert(p1->pawn_key==p2->pawn_key);

    return true;
}

// Assembly:
pushq %rax
movl (%rdi), %eax
cmpl (%rsi), %eax
jne 0xa370
movq $-0x1, %rax
cmpq $0x3e, %rax
je 0xa115
movl 0x8(%rdi,%rax,4), %r8d
leaq 0x1(%rax), %rcx
cmpl 0x8(%rsi,%rax,4), %r8d
movq %rcx, %rax
je 0xa0f2
cmpq $0x3f, %rcx
jb 0xa370
movq 0x158(%rdi), %rax
cmpq 0x158(%rsi), %rax
jne 0xa374
movq 0x160(%rdi), %rax
cmpq 0x160(%rsi), %rax
jne 0xa393
movq 0x168(%rdi), %rax
cmpq 0x168(%rsi), %rax
jne 0xa3b2
movq 0x170(%rdi), %rax
cmpq 0x170(%rsi), %rax
jne 0xa3d1
movq 0x178(%rdi), %rax
cmpq 0x178(%rsi), %rax
jne 0xa3f0
movq 0x180(%rdi), %rax
cmpq 0x180(%rsi), %rax
jne 0xa40f
movq 0x188(%rdi), %rax
cmpq 0x188(%rsi), %rax
jne 0xa42e
movq 0x190(%rdi), %rax
cmpq 0x190(%rsi), %rax
jne 0xa44d
movq 0x198(%rdi), %rax
cmpq 0x198(%rsi), %rax
jne 0xa46c
movq 0x1a0(%rdi), %rax
cmpq 0x1a0(%rsi), %rax
jne 0xa48b
movq 0x1a8(%rdi), %rax
cmpq 0x1a8(%rsi), %rax
jne 0xa4aa
movq 0x1b0(%rdi), %rax
cmpq 0x1b0(%rsi), %rax
jne 0xa4c9
movl 0x120(%rdi), %eax
cmpl 0x120(%rsi), %eax
jne 0xa4e8
movl 0x12c(%rdi), %eax
cmpl 0x12c(%rsi), %eax
jne 0xa507
movl 0x124(%rdi), %eax
cmpl 0x124(%rsi), %eax
jne 0xa526
movl 0x128(%rdi), %eax
cmpl 0x128(%rsi), %eax
jne 0xa545
movl 0x130(%rdi), %eax
cmpl 0x130(%rsi), %eax
jne 0xa564
movl 0x104(%rdi), %eax
cmpl 0x104(%rsi), %eax
jne 0xa583
movl 0x110(%rdi), %eax
cmpl 0x110(%rsi), %eax
jne 0xa5a2
movl 0x108(%rdi), %eax
cmpl 0x108(%rsi), %eax
jne 0xa5c1
movl 0x10c(%rdi), %eax
cmpl 0x10c(%rsi), %eax
jne 0xa5e0
movl 0x114(%rdi), %eax
cmpl 0x114(%rsi), %eax
jne 0xa5ff
movl 0x138(%rdi), %eax
cmpl 0x138(%rsi), %eax
jne 0xa370
movl 0x13c(%rdi), %eax
cmpl 0x13c(%rsi), %eax
jne 0xa370
movl 0x140(%rdi), %eax
cmpl 0x140(%rsi), %eax
jne 0xa370
movl 0x14c(%rdi), %eax
cmpl 0x14c(%rsi), %eax
jne 0xa370
movl 0x150(%rdi), %eax
cmpl 0x150(%rsi), %eax
jne 0xa370
testb %dl, %dl
je 0xa32b
movl 0x144(%rdi), %eax
cmpl 0x144(%rsi), %eax
jne 0xa370
movl 0x148(%rdi), %eax
cmpl 0x148(%rsi), %eax
jne 0xa370
movq 0x1b8(%rdi), %rax
cmpq 0x1b8(%rsi), %rax
jne 0xa61e
movq 0x1c0(%rdi), %rcx
movb $0x1, %al
cmpq 0x1c0(%rsi), %rcx
je 0xa372
leaq 0x21906(%rip), %rdi     # 0x2bc5e
leaq 0x214b2(%rip), %rsi     # 0x2b811
leaq 0x214b7(%rip), %rcx     # 0x2b81d
movl $0x4b, %edx
callq 0x20d0
xorl %eax, %eax
popq %rcx
retq
leaq 0x21475(%rip), %rdi     # 0x2b7f0
leaq 0x2148f(%rip), %rsi     # 0x2b811
leaq 0x21494(%rip), %rcx     # 0x2b81d
movl $0x20, %edx
callq 0x20d0
leaq 0x214b0(%rip), %rdi     # 0x2b84a
leaq 0x21470(%rip), %rsi     # 0x2b811
leaq 0x21475(%rip), %rcx     # 0x2b81d
movl $0x21, %edx
callq 0x20d0
leaq 0x214b2(%rip), %rdi     # 0x2b86b
leaq 0x21451(%rip), %rsi     # 0x2b811
leaq 0x21456(%rip), %rcx     # 0x2b81d
movl $0x23, %edx
callq 0x20d0
leaq 0x214b8(%rip), %rdi     # 0x2b890
leaq 0x21432(%rip), %rsi     # 0x2b811
leaq 0x21437(%rip), %rcx     # 0x2b81d
movl $0x24, %edx
callq 0x20d0
leaq 0x214be(%rip), %rdi     # 0x2b8b5
leaq 0x21413(%rip), %rsi     # 0x2b811
leaq 0x21418(%rip), %rcx     # 0x2b81d
movl $0x26, %edx
callq 0x20d0
leaq 0x214c4(%rip), %rdi     # 0x2b8da
leaq 0x213f4(%rip), %rsi     # 0x2b811
leaq 0x213f9(%rip), %rcx     # 0x2b81d
movl $0x27, %edx
callq 0x20d0
leaq 0x214ca(%rip), %rdi     # 0x2b8ff
leaq 0x213d5(%rip), %rsi     # 0x2b811
leaq 0x213da(%rip), %rcx     # 0x2b81d
movl $0x29, %edx
callq 0x20d0
leaq 0x214cc(%rip), %rdi     # 0x2b920
leaq 0x213b6(%rip), %rsi     # 0x2b811
leaq 0x213bb(%rip), %rcx     # 0x2b81d
movl $0x2a, %edx
callq 0x20d0
leaq 0x214ce(%rip), %rdi     # 0x2b941
leaq 0x21397(%rip), %rsi     # 0x2b811
leaq 0x2139c(%rip), %rcx     # 0x2b81d
movl $0x2c, %edx
callq 0x20d0
leaq 0x214d2(%rip), %rdi     # 0x2b964
leaq 0x21378(%rip), %rsi     # 0x2b811
leaq 0x2137d(%rip), %rcx     # 0x2b81d
movl $0x2d, %edx
callq 0x20d0
leaq 0x214d6(%rip), %rdi     # 0x2b987
leaq 0x21359(%rip), %rsi     # 0x2b811
leaq 0x2135e(%rip), %rcx     # 0x2b81d
movl $0x2f, %edx
callq 0x20d0
leaq 0x214da(%rip), %rdi     # 0x2b9aa
leaq 0x2133a(%rip), %rsi     # 0x2b811
leaq 0x2133f(%rip), %rcx     # 0x2b81d
movl $0x30, %edx
callq 0x20d0
leaq 0x214de(%rip), %rdi     # 0x2b9cd
leaq 0x2131b(%rip), %rsi     # 0x2b811
leaq 0x21320(%rip), %rcx     # 0x2b81d
movl $0x33, %edx
callq 0x20d0
leaq 0x214fc(%rip), %rdi     # 0x2ba0a
leaq 0x212fc(%rip), %rsi     # 0x2b811
leaq 0x21301(%rip), %rcx     # 0x2b81d
movl $0x34, %edx
callq 0x20d0
leaq 0x2151a(%rip), %rdi     # 0x2ba47
leaq 0x212dd(%rip), %rsi     # 0x2b811
leaq 0x212e2(%rip), %rcx     # 0x2b81d
movl $0x35, %edx
callq 0x20d0
leaq 0x2153c(%rip), %rdi     # 0x2ba88
leaq 0x212be(%rip), %rsi     # 0x2b811
leaq 0x212c3(%rip), %rcx     # 0x2b81d
movl $0x36, %edx
callq 0x20d0
leaq 0x2155e(%rip), %rdi     # 0x2bac9
leaq 0x2129f(%rip), %rsi     # 0x2b811
leaq 0x212a4(%rip), %rcx     # 0x2b81d
movl $0x37, %edx
callq 0x20d0
leaq 0x2157e(%rip), %rdi     # 0x2bb08
leaq 0x21280(%rip), %rsi     # 0x2b811
leaq 0x21285(%rip), %rcx     # 0x2b81d
movl $0x39, %edx
callq 0x20d0
leaq 0x2159c(%rip), %rdi     # 0x2bb45
leaq 0x21261(%rip), %rsi     # 0x2b811
leaq 0x21266(%rip), %rcx     # 0x2b81d
movl $0x3a, %edx
callq 0x20d0
leaq 0x215ba(%rip), %rdi     # 0x2bb82
leaq 0x21242(%rip), %rsi     # 0x2b811
leaq 0x21247(%rip), %rcx     # 0x2b81d
movl $0x3b, %edx
callq 0x20d0
leaq 0x215dc(%rip), %rdi     # 0x2bbc3
leaq 0x21223(%rip), %rsi     # 0x2b811
leaq 0x21228(%rip), %rcx     # 0x2b81d
movl $0x3c, %edx
callq 0x20d0
leaq 0x215fe(%rip), %rdi     # 0x2bc04
leaq 0x21204(%rip), %rsi     # 0x2b811
leaq 0x21209(%rip), %rcx     # 0x2b81d
movl $0x3d, %edx
callq 0x20d0
leaq 0x2161e(%rip), %rdi     # 0x2bc43
leaq 0x211e5(%rip), %rsi     # 0x2b811
leaq 0x211ea(%rip), %rcx     # 0x2b81d
movl $0x4a, %edx
callq 0x20d0