// File: /workspace/github_cpp_makefile_star2_O1/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 0xe0bb8(%rip), %r14     # 0xf7ef0
movq %r14, %rdi
callq 0x6207
movq %rsp, %rbx
movq %rbx, %rdi
callq 0xaa43
movq %rbx, %rdi
callq 0x5e40
movq %rax, %rbx
movq %r14, %rdi
movq %rax, %rsi
callq 0x6263
testq %rax, %rax
jne 0x17487
movl $0x1, %edi
movl $0x34, %esi
movl $0x24, %edx
callq 0x76b8
movq %rax, %r15
movl $0x1, %edi
movl $0x3, %esi
movl $0x64, %edx
movq %rax, %rcx
callq 0x5fa7
leaq 0xe0b51(%rip), %r14     # 0xf7ef0
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x62c0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6263
testq %rax, %rax
je 0x174a6
movq %rax, %r14
movq %rax, %rdi
callq 0x6135
cmpl $0x1, %eax
jne 0x174c5
movq %r14, %rdi
callq 0x613c
cmpl $0x3, %eax
jne 0x174e4
movq %r14, %rdi
callq 0x6143
cmpl $0x64, %eax
jne 0x17503
movq %r14, %rdi
callq 0x616d
cmpq %r15, %rax
jne 0x17522
leaq 0xb16e1(%rip), %rdx     # 0xc8af0
movq %rsp, %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x30e3
movq %r12, %rdi
callq 0x5e40
leaq 0xe0ac4(%rip), %rdi     # 0xf7ef0
movq %rax, %rsi
callq 0x6263
testq %rax, %rax
jne 0x17541
leaq 0xb16ac(%rip), %rsi     # 0xc8af0
movq %rsp, %r15
movq %r15, %rdi
callq 0x3341
movq %r15, %rdi
callq 0x5e40
cmpq %rax, %rbx
jne 0x17560
leaq 0xe0a89(%rip), %rdi     # 0xf7ef0
movq %rax, %rsi
callq 0x6263
cmpq %rax, %r14
jne 0x1757f
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1a9d8(%rip), %rdi     # 0x31e66
leaq 0x1a690(%rip), %rsi     # 0x31b25
leaq 0x1a9d1(%rip), %rcx     # 0x31e6d
movl $0x15b, %edx            # imm = 0x15B
callq 0x20d0
leaq 0x11e13(%rip), %rdi     # 0x292c0
leaq 0x1a671(%rip), %rsi     # 0x31b25
leaq 0x1a9b2(%rip), %rcx     # 0x31e6d
movl $0x160, %edx            # imm = 0x160
callq 0x20d0
leaq 0x1a7db(%rip), %rdi     # 0x31ca7
leaq 0x1a652(%rip), %rsi     # 0x31b25
leaq 0x1a993(%rip), %rcx     # 0x31e6d
movl $0x161, %edx            # imm = 0x161
callq 0x20d0
leaq 0x1a99e(%rip), %rdi     # 0x31e89
leaq 0x1a633(%rip), %rsi     # 0x31b25
leaq 0x1a974(%rip), %rcx     # 0x31e6d
movl $0x162, %edx            # imm = 0x162
callq 0x20d0
leaq 0x1a99c(%rip), %rdi     # 0x31ea6
leaq 0x1a614(%rip), %rsi     # 0x31b25
leaq 0x1a955(%rip), %rcx     # 0x31e6d
movl $0x163, %edx            # imm = 0x163
callq 0x20d0
leaq 0x1a807(%rip), %rdi     # 0x31d30
leaq 0x1a5f5(%rip), %rsi     # 0x31b25
leaq 0x1a936(%rip), %rcx     # 0x31e6d
movl $0x164, %edx            # imm = 0x164
callq 0x20d0
leaq 0x1a97d(%rip), %rdi     # 0x31ec5
leaq 0x1a5d6(%rip), %rsi     # 0x31b25
leaq 0x1a917(%rip), %rcx     # 0x31e6d
movl $0x16a, %edx            # imm = 0x16A
callq 0x20d0
leaq 0x1a966(%rip), %rdi     # 0x31ecd
leaq 0x1a5b7(%rip), %rsi     # 0x31b25
leaq 0x1a8f8(%rip), %rcx     # 0x31e6d
movl $0x16f, %edx            # imm = 0x16F
callq 0x20d0
leaq 0x1a951(%rip), %rdi     # 0x31ed7
leaq 0x1a598(%rip), %rsi     # 0x31b25
leaq 0x1a8d9(%rip), %rcx     # 0x31e6d
movl $0x171, %edx            # imm = 0x171
callq 0x20d0