// File: /workspace/github_cpp_makefile_star2_O3/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 0xe0abc(%rip), %r14     # 0xf7f20
movq %r14, %rdi
callq 0x62b6
movq %rsp, %rbx
movq %rbx, %rdi
callq 0xaa51
movq %rbx, %rdi
callq 0x5fb7
movq %rax, %rbx
movq %r14, %rdi
movq %rax, %rsi
callq 0x6312
testq %rax, %rax
jne 0x17573
movl $0x1, %edi
movl $0x34, %esi
movl $0x24, %edx
callq 0x775c
movq %rax, %r15
movl $0xffffff9c, %edi       # imm = 0xFFFFFF9C
callq 0x619c
leaq 0xe0a62(%rip), %r14     # 0xf7f20
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x636f
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6312
testq %rax, %rax
je 0x17592
movq %rax, %r14
movq %rax, %rdi
callq 0x6209
cmpl $-0x64, %eax
jne 0x175b1
leaq 0xb15f5(%rip), %rdx     # 0xc8af0
movq %rsp, %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x30e1
movq %r12, %rdi
callq 0x5fb7
leaq 0xe0a08(%rip), %rdi     # 0xf7f20
movq %rax, %rsi
callq 0x6312
testq %rax, %rax
jne 0x175d0
leaq 0xb15c0(%rip), %rsi     # 0xc8af0
movq %rsp, %r15
movq %r15, %rdi
callq 0x334b
movq %r15, %rdi
callq 0x5fb7
cmpq %rax, %rbx
jne 0x175ef
leaq 0xe09cd(%rip), %rdi     # 0xf7f20
movq %rbx, %rsi
callq 0x6312
cmpq %rax, %r14
jne 0x1760e
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1a96c(%rip), %rdi     # 0x31ee6
leaq 0x1a624(%rip), %rsi     # 0x31ba5
leaq 0x1a9d9(%rip), %rcx     # 0x31f61
movl $0x17d, %edx            # imm = 0x17D
callq 0x20d0
leaq 0x11d57(%rip), %rdi     # 0x292f0
leaq 0x1a605(%rip), %rsi     # 0x31ba5
leaq 0x1a9ba(%rip), %rcx     # 0x31f61
movl $0x182, %edx            # imm = 0x182
callq 0x20d0
leaq 0x1a9ca(%rip), %rdi     # 0x31f82
leaq 0x1a5e6(%rip), %rsi     # 0x31ba5
leaq 0x1a99b(%rip), %rcx     # 0x31f61
movl $0x183, %edx            # imm = 0x183
callq 0x20d0
leaq 0x1a96e(%rip), %rdi     # 0x31f45
leaq 0x1a5c7(%rip), %rsi     # 0x31ba5
leaq 0x1a97c(%rip), %rcx     # 0x31f61
movl $0x189, %edx            # imm = 0x189
callq 0x20d0
leaq 0x1a957(%rip), %rdi     # 0x31f4d
leaq 0x1a5a8(%rip), %rsi     # 0x31ba5
leaq 0x1a95d(%rip), %rcx     # 0x31f61
movl $0x18e, %edx            # imm = 0x18E
callq 0x20d0
leaq 0x1a942(%rip), %rdi     # 0x31f57
leaq 0x1a589(%rip), %rsi     # 0x31ba5
leaq 0x1a93e(%rip), %rcx     # 0x31f61
movl $0x190, %edx            # imm = 0x190
callq 0x20d0