// File: /workspace/github_cpp_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1d0, %rsp            # imm = 0x1D0
leaq 0xe535b(%rip), %r14     # 0xfaef0
movq %r14, %rdi
callq 0x5dd9
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xa187
movq %rbx, %rdi
callq 0x5a50
movq %rax, %rbx
movq %r14, %rdi
movq %rax, %rsi
callq 0x5e2e
testq %rax, %rax
jne 0x15ce0
pushq $0x1
popq %rbp
pushq $0x34
popq %rsi
pushq $0x24
popq %rdx
movl %ebp, %edi
callq 0x7284
movq %rax, %r15
pushq $0x3
popq %rsi
pushq $0x64
popq %rdx
movl %ebp, %edi
movq %rax, %rcx
callq 0x5b8a
leaq 0xe52fd(%rip), %r14     # 0xfaef0
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x5e8b
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5e2e
testq %rax, %rax
je 0x15cff
movq %rax, %r14
movq %rax, %rdi
callq 0x5d09
cmpl $0x1, %eax
jne 0x15d1e
movq %r14, %rdi
callq 0x5d10
cmpl $0x3, %eax
jne 0x15d3d
movq %r14, %rdi
callq 0x5d17
cmpl $0x64, %eax
jne 0x15d5c
movq %r14, %rdi
callq 0x5d41
cmpq %r15, %rax
jne 0x15d7b
leaq 0xb5e8d(%rip), %rdx     # 0xcbaf0
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x2fa5
movq %r12, %rdi
callq 0x5a50
leaq 0xe526e(%rip), %rdi     # 0xfaef0
movq %rax, %rsi
callq 0x5e2e
testq %rax, %rax
jne 0x15d9a
leaq 0xb5e56(%rip), %rsi     # 0xcbaf0
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x31f8
movq %r15, %rdi
callq 0x5a50
cmpq %rax, %rbx
jne 0x15db9
leaq 0xe5231(%rip), %rdi     # 0xfaef0
movq %rbx, %rsi
callq 0x5e2e
cmpq %rax, %r14
jne 0x15dd8
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1a1af(%rip), %rdi     # 0x2fe96
leaq 0x19e67(%rip), %rsi     # 0x2fb55
leaq 0x1a1a8(%rip), %rcx     # 0x2fe9d
movl $0x15b, %edx            # imm = 0x15B
callq 0x20c0
leaq 0x115ba(%rip), %rdi     # 0x272c0
leaq 0x19e48(%rip), %rsi     # 0x2fb55
leaq 0x1a189(%rip), %rcx     # 0x2fe9d
movl $0x160, %edx            # imm = 0x160
callq 0x20c0
leaq 0x19fb2(%rip), %rdi     # 0x2fcd7
leaq 0x19e29(%rip), %rsi     # 0x2fb55
leaq 0x1a16a(%rip), %rcx     # 0x2fe9d
movl $0x161, %edx            # imm = 0x161
callq 0x20c0
leaq 0x1a175(%rip), %rdi     # 0x2feb9
leaq 0x19e0a(%rip), %rsi     # 0x2fb55
leaq 0x1a14b(%rip), %rcx     # 0x2fe9d
movl $0x162, %edx            # imm = 0x162
callq 0x20c0
leaq 0x1a173(%rip), %rdi     # 0x2fed6
leaq 0x19deb(%rip), %rsi     # 0x2fb55
leaq 0x1a12c(%rip), %rcx     # 0x2fe9d
movl $0x163, %edx            # imm = 0x163
callq 0x20c0
leaq 0x19fde(%rip), %rdi     # 0x2fd60
leaq 0x19dcc(%rip), %rsi     # 0x2fb55
leaq 0x1a10d(%rip), %rcx     # 0x2fe9d
movl $0x164, %edx            # imm = 0x164
callq 0x20c0
leaq 0x1a154(%rip), %rdi     # 0x2fef5
leaq 0x19dad(%rip), %rsi     # 0x2fb55
leaq 0x1a0ee(%rip), %rcx     # 0x2fe9d
movl $0x16a, %edx            # imm = 0x16A
callq 0x20c0
leaq 0x1a13d(%rip), %rdi     # 0x2fefd
leaq 0x19d8e(%rip), %rsi     # 0x2fb55
leaq 0x1a0cf(%rip), %rcx     # 0x2fe9d
movl $0x16f, %edx            # imm = 0x16F
callq 0x20c0
leaq 0x1a128(%rip), %rdi     # 0x2ff07
leaq 0x19d6f(%rip), %rsi     # 0x2fb55
leaq 0x1a0b0(%rip), %rcx     # 0x2fe9d
movl $0x171, %edx            # imm = 0x171
callq 0x20c0