// File: /workspace/github_cpp_makefile_star2_O2/jswaff[P]prophet3/test/hash__test.cpp
// Function: test_pawn_store_and_probe()
void test_pawn_store_and_probe() {
    clear_hash_table(&phtbl);
    position pos;
    reset_pos(&pos);

    uint64 key = build_pawn_key(&pos);

    // shouldn't be anything
    uint64 val = get_hash_entry(&phtbl,key);
    assert(val==0);

    move mv = to_move(PAWN,E2,E4);
    store_hash_entry(&phtbl,key,build_pawn_hash_val(-100));
    val = get_hash_entry(&phtbl,key);
    assert(val > 0);
    assert(get_pawn_hash_entry_score(val)==-100);

    // now make move and reprobe
    apply_move(&pos,mv,gundos);
    uint64 key2 = build_pawn_key(&pos);
    uint64 val2 = get_hash_entry(&phtbl,key2);
    assert(val2==0);

    // finally undo and reprobe
    undo_last_move(&pos,gundos);
    key2 = build_pawn_key(&pos);
    assert(key==key2);
    val2 = get_hash_entry(&phtbl,key2);
    assert(val==val2);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
leaq 0xe5114(%rip), %r14     # 0xfaf20
movq %r14, %rdi
callq 0x5dd9
movq %rsp, %rbx
movq %rbx, %rdi
callq 0xa187
movq %rbx, %rdi
callq 0x5b17
movq %rax, %rbx
movq %r14, %rdi
movq %rax, %rsi
callq 0x5e2e
testq %rax, %rax
jne 0x15f13
pushq $0x1
popq %rdi
pushq $0x34
popq %rsi
pushq $0x24
popq %rdx
callq 0x7284
movq %rax, %r15
pushq $-0x64
popq %rdi
callq 0x5cc3
leaq 0xe50c2(%rip), %r14     # 0xfaf20
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x5e8b
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5e2e
testq %rax, %rax
je 0x15f32
movq %rax, %r14
movq %rax, %rdi
callq 0x5d2e
cmpl $-0x64, %eax
jne 0x15f51
leaq 0xb5c55(%rip), %rdx     # 0xcbaf0
movq %rsp, %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x2fa5
movq %r12, %rdi
callq 0x5b17
leaq 0xe5068(%rip), %rdi     # 0xfaf20
movq %rax, %rsi
callq 0x5e2e
testq %rax, %rax
jne 0x15f70
leaq 0xb5c20(%rip), %rsi     # 0xcbaf0
movq %rsp, %r15
movq %r15, %rdi
callq 0x31f8
movq %r15, %rdi
callq 0x5b17
cmpq %rax, %rbx
jne 0x15f8f
leaq 0xe502d(%rip), %rdi     # 0xfaf20
movq %rbx, %rsi
callq 0x5e2e
cmpq %rax, %r14
jne 0x15fae
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x19f7c(%rip), %rdi     # 0x2fe96
leaq 0x19c34(%rip), %rsi     # 0x2fb55
leaq 0x19fe9(%rip), %rcx     # 0x2ff11
movl $0x17d, %edx            # imm = 0x17D
callq 0x20c0
leaq 0x11387(%rip), %rdi     # 0x272c0
leaq 0x19c15(%rip), %rsi     # 0x2fb55
leaq 0x19fca(%rip), %rcx     # 0x2ff11
movl $0x182, %edx            # imm = 0x182
callq 0x20c0
leaq 0x19fda(%rip), %rdi     # 0x2ff32
leaq 0x19bf6(%rip), %rsi     # 0x2fb55
leaq 0x19fab(%rip), %rcx     # 0x2ff11
movl $0x183, %edx            # imm = 0x183
callq 0x20c0
leaq 0x19f7e(%rip), %rdi     # 0x2fef5
leaq 0x19bd7(%rip), %rsi     # 0x2fb55
leaq 0x19f8c(%rip), %rcx     # 0x2ff11
movl $0x189, %edx            # imm = 0x189
callq 0x20c0
leaq 0x19f67(%rip), %rdi     # 0x2fefd
leaq 0x19bb8(%rip), %rsi     # 0x2fb55
leaq 0x19f6d(%rip), %rcx     # 0x2ff11
movl $0x18e, %edx            # imm = 0x18E
callq 0x20c0
leaq 0x19f52(%rip), %rdi     # 0x2ff07
leaq 0x19b99(%rip), %rsi     # 0x2fb55
leaq 0x19f4e(%rip), %rcx     # 0x2ff11
movl $0x190, %edx            # imm = 0x190
callq 0x20c0