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

    uint64 key = build_hash_key(&pos);

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

    move mv = to_move(PAWN,E2,E4);
    store_hash_entry(&htbl,key,build_hash_val(LOWER_BOUND,3,100,mv));
    val = get_hash_entry(&htbl,key);
    assert(val > 0);
    assert(get_hash_entry_type(val)==LOWER_BOUND);
    assert(get_hash_entry_depth(val)==3);
    assert(get_hash_entry_score(val)==100);
    assert(get_hash_entry_move(val)==mv);

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

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
leaq 0xe0d07(%rip), %r14     # 0xf7ef0
movq %r14, %rdi
callq 0x62b6
movq %rsp, %rbx
movq %rbx, %rdi
callq 0xaa51
movq %rbx, %rdi
callq 0x5ee8
movq %rax, %rbx
movq %r14, %rdi
movq %rax, %rsi
callq 0x6312
testq %rax, %rax
jne 0x17338
movl $0x1, %edi
movl $0x34, %esi
movl $0x24, %edx
callq 0x775c
movq %rax, %r15
movl $0x1, %edi
movl $0x3, %esi
movl $0x64, %edx
movq %rax, %rcx
callq 0x604f
leaq 0xe0ca0(%rip), %r14     # 0xf7ef0
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x636f
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6312
testq %rax, %rax
je 0x17357
movq %rax, %r14
movq %rax, %rdi
callq 0x61e4
cmpl $0x1, %eax
jne 0x17376
movq %r14, %rdi
callq 0x61eb
cmpl $0x3, %eax
jne 0x17395
movq %r14, %rdi
callq 0x61f2
cmpl $0x64, %eax
jne 0x173b4
movq %r14, %rdi
callq 0x621c
cmpq %r15, %rax
jne 0x173d3
leaq 0xb1830(%rip), %rdx     # 0xc8af0
movq %rsp, %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x30e1
movq %r12, %rdi
callq 0x5ee8
leaq 0xe0c13(%rip), %rdi     # 0xf7ef0
movq %rax, %rsi
callq 0x6312
testq %rax, %rax
jne 0x173f2
leaq 0xb17fb(%rip), %rsi     # 0xc8af0
movq %rsp, %r15
movq %r15, %rdi
callq 0x334b
movq %r15, %rdi
callq 0x5ee8
cmpq %rax, %rbx
jne 0x17411
leaq 0xe0bd8(%rip), %rdi     # 0xf7ef0
movq %rbx, %rsi
callq 0x6312
cmpq %rax, %r14
jne 0x17430
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1aba7(%rip), %rdi     # 0x31ee6
leaq 0x1a85f(%rip), %rsi     # 0x31ba5
leaq 0x1aba0(%rip), %rcx     # 0x31eed
movl $0x15b, %edx            # imm = 0x15B
callq 0x20d0
leaq 0x11f92(%rip), %rdi     # 0x292f0
leaq 0x1a840(%rip), %rsi     # 0x31ba5
leaq 0x1ab81(%rip), %rcx     # 0x31eed
movl $0x160, %edx            # imm = 0x160
callq 0x20d0
leaq 0x1a9aa(%rip), %rdi     # 0x31d27
leaq 0x1a821(%rip), %rsi     # 0x31ba5
leaq 0x1ab62(%rip), %rcx     # 0x31eed
movl $0x161, %edx            # imm = 0x161
callq 0x20d0
leaq 0x1ab6d(%rip), %rdi     # 0x31f09
leaq 0x1a802(%rip), %rsi     # 0x31ba5
leaq 0x1ab43(%rip), %rcx     # 0x31eed
movl $0x162, %edx            # imm = 0x162
callq 0x20d0
leaq 0x1ab6b(%rip), %rdi     # 0x31f26
leaq 0x1a7e3(%rip), %rsi     # 0x31ba5
leaq 0x1ab24(%rip), %rcx     # 0x31eed
movl $0x163, %edx            # imm = 0x163
callq 0x20d0
leaq 0x1a9d6(%rip), %rdi     # 0x31db0
leaq 0x1a7c4(%rip), %rsi     # 0x31ba5
leaq 0x1ab05(%rip), %rcx     # 0x31eed
movl $0x164, %edx            # imm = 0x164
callq 0x20d0
leaq 0x1ab4c(%rip), %rdi     # 0x31f45
leaq 0x1a7a5(%rip), %rsi     # 0x31ba5
leaq 0x1aae6(%rip), %rcx     # 0x31eed
movl $0x16a, %edx            # imm = 0x16A
callq 0x20d0
leaq 0x1ab35(%rip), %rdi     # 0x31f4d
leaq 0x1a786(%rip), %rsi     # 0x31ba5
leaq 0x1aac7(%rip), %rcx     # 0x31eed
movl $0x16f, %edx            # imm = 0x16F
callq 0x20d0
leaq 0x1ab20(%rip), %rdi     # 0x31f57
leaq 0x1a767(%rip), %rsi     # 0x31ba5
leaq 0x1aaa8(%rip), %rcx     # 0x31eed
movl $0x171, %edx            # imm = 0x171
callq 0x20d0