// File: /workspace/github_cpp_makefile_star2_O1/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 0xe096d(%rip), %r14     # 0xf7f20
movq %r14, %rdi
callq 0x6207
movq %rsp, %rbx
movq %rbx, %rdi
callq 0xaa43
movq %rbx, %rdi
callq 0x5f0f
movq %rax, %rbx
movq %r14, %rdi
movq %rax, %rsi
callq 0x6263
testq %rax, %rax
jne 0x176c2
movl $0x1, %edi
movl $0x34, %esi
movl $0x24, %edx
callq 0x76b8
movq %rax, %r15
movl $0xffffff9c, %edi       # imm = 0xFFFFFF9C
callq 0x60ed
leaq 0xe0913(%rip), %r14     # 0xf7f20
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x62c0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6263
testq %rax, %rax
je 0x176e1
movq %rax, %r14
movq %rax, %rdi
callq 0x615a
cmpl $-0x64, %eax
jne 0x17700
leaq 0xb14a6(%rip), %rdx     # 0xc8af0
movq %rsp, %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x30e3
movq %r12, %rdi
callq 0x5f0f
leaq 0xe08b9(%rip), %rdi     # 0xf7f20
movq %rax, %rsi
callq 0x6263
testq %rax, %rax
jne 0x1771f
leaq 0xb1471(%rip), %rsi     # 0xc8af0
movq %rsp, %r15
movq %r15, %rdi
callq 0x3341
movq %r15, %rdi
callq 0x5f0f
cmpq %rax, %rbx
jne 0x1773e
leaq 0xe087e(%rip), %rdi     # 0xf7f20
movq %rax, %rsi
callq 0x6263
cmpq %rax, %r14
jne 0x1775d
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1a79d(%rip), %rdi     # 0x31e66
leaq 0x1a455(%rip), %rsi     # 0x31b25
leaq 0x1a80a(%rip), %rcx     # 0x31ee1
movl $0x17d, %edx            # imm = 0x17D
callq 0x20d0
leaq 0x11bd8(%rip), %rdi     # 0x292c0
leaq 0x1a436(%rip), %rsi     # 0x31b25
leaq 0x1a7eb(%rip), %rcx     # 0x31ee1
movl $0x182, %edx            # imm = 0x182
callq 0x20d0
leaq 0x1a7fb(%rip), %rdi     # 0x31f02
leaq 0x1a417(%rip), %rsi     # 0x31b25
leaq 0x1a7cc(%rip), %rcx     # 0x31ee1
movl $0x183, %edx            # imm = 0x183
callq 0x20d0
leaq 0x1a79f(%rip), %rdi     # 0x31ec5
leaq 0x1a3f8(%rip), %rsi     # 0x31b25
leaq 0x1a7ad(%rip), %rcx     # 0x31ee1
movl $0x189, %edx            # imm = 0x189
callq 0x20d0
leaq 0x1a788(%rip), %rdi     # 0x31ecd
leaq 0x1a3d9(%rip), %rsi     # 0x31b25
leaq 0x1a78e(%rip), %rcx     # 0x31ee1
movl $0x18e, %edx            # imm = 0x18E
callq 0x20d0
leaq 0x1a773(%rip), %rdi     # 0x31ed7
leaq 0x1a3ba(%rip), %rsi     # 0x31b25
leaq 0x1a76f(%rip), %rcx     # 0x31ee1
movl $0x190, %edx            # imm = 0x190
callq 0x20d0