// File: jswaff[P]prophet3/test/pos__test.cpp
// Function: test_equal_pos()
void test_equal_pos() {
    position pos1;
    reset_pos(&pos1);

    position pos2;
    reset_pos(&pos2);

    assert(equal_pos(&pos1,&pos2,true));

    add_piece(&pos2,PAWN,E4);
    assert(!equal_pos(&pos1,&pos2,true));
    remove_piece(&pos2,E4);
    assert(equal_pos(&pos1,&pos2,true));

    pos2.player=BLACK;
    assert(!equal_pos(&pos1,&pos2,true));
    reset_pos(&pos2);
    assert(equal_pos(&pos1,&pos2,true));

    pos2.ep_sq=E4;
    assert(!equal_pos(&pos1,&pos2,true));
    reset_pos(&pos2);
    assert(equal_pos(&pos1,&pos2,true));

    pos2.move_counter=1;
    assert(!equal_pos(&pos1,&pos2,true));
    reset_pos(&pos2);
    assert(equal_pos(&pos1,&pos2,true));

    pos2.fifty_counter=1;
    assert(!equal_pos(&pos1,&pos2,true));
    reset_pos(&pos2);
    assert(equal_pos(&pos1,&pos2,true));

    pos2.white_king=E4;
    assert(!equal_pos(&pos1,&pos2,true));
    pos2.white_king=E1;
    assert(equal_pos(&pos1,&pos2,true));

    pos2.black_king=E4;
    assert(!equal_pos(&pos1,&pos2,true));
    pos2.black_king=E8;
    assert(equal_pos(&pos1,&pos2,true));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x390, %rsp            # imm = 0x390
leaq -0x1c8(%rbp), %rdi
callq 0xf390
leaq -0x390(%rbp), %rdi
callq 0xf390
leaq -0x1c8(%rbp), %rdi
leaq -0x390(%rbp), %rsi
movl $0x1, %edx
callq 0xe490
testb $0x1, %al
jne 0x2ca61
jmp 0x2ca63
jmp 0x2ca82
leaq 0x157c2(%rip), %rdi     # 0x4222c
leaq 0x154ec(%rip), %rsi     # 0x41f5d
movl $0x65, %edx
leaq 0x15798(%rip), %rcx     # 0x42215
callq 0x20c0
leaq -0x390(%rbp), %rdi
movl $0x1, %esi
movl $0x24, %edx
callq 0xeb20
leaq -0x1c8(%rbp), %rdi
leaq -0x390(%rbp), %rsi
movl $0x1, %edx
callq 0xe490
xorb $-0x1, %al
testb $0x1, %al
jne 0x2cab8
jmp 0x2caba
jmp 0x2cad9
leaq 0x1576a(%rip), %rdi     # 0x4222b
leaq 0x15495(%rip), %rsi     # 0x41f5d
movl $0x68, %edx
leaq 0x15741(%rip), %rcx     # 0x42215
callq 0x20c0
leaq -0x390(%rbp), %rdi
movl $0x24, %esi
callq 0xee40
leaq -0x1c8(%rbp), %rdi
leaq -0x390(%rbp), %rsi
movl $0x1, %edx
callq 0xe490
testb $0x1, %al
jne 0x2cb08
jmp 0x2cb0a
jmp 0x2cb29
leaq 0x1571b(%rip), %rdi     # 0x4222c
leaq 0x15445(%rip), %rsi     # 0x41f5d
movl $0x6a, %edx
leaq 0x156f1(%rip), %rcx     # 0x42215
callq 0x20c0
movl $0x0, -0x258(%rbp)
leaq -0x1c8(%rbp), %rdi
leaq -0x390(%rbp), %rsi
movl $0x1, %edx
callq 0xe490
xorb $-0x1, %al
testb $0x1, %al
jne 0x2cb53
jmp 0x2cb55
jmp 0x2cb74
leaq 0x156cf(%rip), %rdi     # 0x4222b
leaq 0x153fa(%rip), %rsi     # 0x41f5d
movl $0x6d, %edx
leaq 0x156a6(%rip), %rcx     # 0x42215
callq 0x20c0
leaq -0x390(%rbp), %rdi
callq 0xf390
leaq -0x1c8(%rbp), %rdi
leaq -0x390(%rbp), %rsi
movl $0x1, %edx
callq 0xe490
testb $0x1, %al
jne 0x2cb9e
jmp 0x2cba0
jmp 0x2cbbf
leaq 0x15685(%rip), %rdi     # 0x4222c
leaq 0x153af(%rip), %rsi     # 0x41f5d
movl $0x6f, %edx
leaq 0x1565b(%rip), %rcx     # 0x42215
callq 0x20c0
movl $0x24, -0x254(%rbp)
leaq -0x1c8(%rbp), %rdi
leaq -0x390(%rbp), %rsi
movl $0x1, %edx
callq 0xe490
xorb $-0x1, %al
testb $0x1, %al
jne 0x2cbe9
jmp 0x2cbeb
jmp 0x2cc0a
leaq 0x15639(%rip), %rdi     # 0x4222b
leaq 0x15364(%rip), %rsi     # 0x41f5d
movl $0x72, %edx
leaq 0x15610(%rip), %rcx     # 0x42215
callq 0x20c0
leaq -0x390(%rbp), %rdi
callq 0xf390
leaq -0x1c8(%rbp), %rdi
leaq -0x390(%rbp), %rsi
movl $0x1, %edx
callq 0xe490
testb $0x1, %al
jne 0x2cc34
jmp 0x2cc36
jmp 0x2cc55
leaq 0x155ef(%rip), %rdi     # 0x4222c
leaq 0x15319(%rip), %rsi     # 0x41f5d
movl $0x74, %edx
leaq 0x155c5(%rip), %rcx     # 0x42215
callq 0x20c0
movl $0x1, -0x24c(%rbp)
leaq -0x1c8(%rbp), %rdi
leaq -0x390(%rbp), %rsi
movl $0x1, %edx
callq 0xe490
xorb $-0x1, %al
testb $0x1, %al
jne 0x2cc7f
jmp 0x2cc81
jmp 0x2cca0
leaq 0x155a3(%rip), %rdi     # 0x4222b
leaq 0x152ce(%rip), %rsi     # 0x41f5d
movl $0x77, %edx
leaq 0x1557a(%rip), %rcx     # 0x42215
callq 0x20c0
leaq -0x390(%rbp), %rdi
callq 0xf390
leaq -0x1c8(%rbp), %rdi
leaq -0x390(%rbp), %rsi
movl $0x1, %edx
callq 0xe490
testb $0x1, %al
jne 0x2ccca
jmp 0x2cccc
jmp 0x2cceb
leaq 0x15559(%rip), %rdi     # 0x4222c
leaq 0x15283(%rip), %rsi     # 0x41f5d
movl $0x79, %edx
leaq 0x1552f(%rip), %rcx     # 0x42215
callq 0x20c0
movl $0x1, -0x248(%rbp)
leaq -0x1c8(%rbp), %rdi
leaq -0x390(%rbp), %rsi
movl $0x1, %edx
callq 0xe490
xorb $-0x1, %al
testb $0x1, %al
jne 0x2cd15
jmp 0x2cd17
jmp 0x2cd36
leaq 0x1550d(%rip), %rdi     # 0x4222b
leaq 0x15238(%rip), %rsi     # 0x41f5d
movl $0x7c, %edx
leaq 0x154e4(%rip), %rcx     # 0x42215
callq 0x20c0
leaq -0x390(%rbp), %rdi
callq 0xf390
leaq -0x1c8(%rbp), %rdi
leaq -0x390(%rbp), %rsi
movl $0x1, %edx
callq 0xe490
testb $0x1, %al
jne 0x2cd60
jmp 0x2cd62
jmp 0x2cd81
leaq 0x154c3(%rip), %rdi     # 0x4222c
leaq 0x151ed(%rip), %rsi     # 0x41f5d
movl $0x7e, %edx
leaq 0x15499(%rip), %rcx     # 0x42215
callq 0x20c0
movl $0x24, -0x244(%rbp)
leaq -0x1c8(%rbp), %rdi
leaq -0x390(%rbp), %rsi
movl $0x1, %edx
callq 0xe490
xorb $-0x1, %al
testb $0x1, %al
jne 0x2cdab
jmp 0x2cdad
jmp 0x2cdcc
leaq 0x15477(%rip), %rdi     # 0x4222b
leaq 0x151a2(%rip), %rsi     # 0x41f5d
movl $0x81, %edx
leaq 0x1544e(%rip), %rcx     # 0x42215
callq 0x20c0
movl $0x3c, -0x244(%rbp)
leaq -0x1c8(%rbp), %rdi
leaq -0x390(%rbp), %rsi
movl $0x1, %edx
callq 0xe490
testb $0x1, %al
jne 0x2cdf4
jmp 0x2cdf6
jmp 0x2ce15
leaq 0x1542f(%rip), %rdi     # 0x4222c
leaq 0x15159(%rip), %rsi     # 0x41f5d
movl $0x83, %edx
leaq 0x15405(%rip), %rcx     # 0x42215
callq 0x20c0
movl $0x24, -0x240(%rbp)
leaq -0x1c8(%rbp), %rdi
leaq -0x390(%rbp), %rsi
movl $0x1, %edx
callq 0xe490
xorb $-0x1, %al
testb $0x1, %al
jne 0x2ce3f
jmp 0x2ce41
jmp 0x2ce60
leaq 0x153e3(%rip), %rdi     # 0x4222b
leaq 0x1510e(%rip), %rsi     # 0x41f5d
movl $0x86, %edx
leaq 0x153ba(%rip), %rcx     # 0x42215
callq 0x20c0
movl $0x4, -0x240(%rbp)
leaq -0x1c8(%rbp), %rdi
leaq -0x390(%rbp), %rsi
movl $0x1, %edx
callq 0xe490
testb $0x1, %al
jne 0x2ce88
jmp 0x2ce8a
jmp 0x2cea9
leaq 0x1539b(%rip), %rdi     # 0x4222c
leaq 0x150c5(%rip), %rsi     # 0x41f5d
movl $0x88, %edx
leaq 0x15371(%rip), %rcx     # 0x42215
callq 0x20c0
addq $0x390, %rsp            # imm = 0x390
popq %rbp
retq
nopw %cs:(%rax,%rax)