// File: /workspace/github_cpp_makefile_star2_O1/yangwanyuan[P]HLKVDS/src/IndexManager.cc
// Function: hlkvds::IndexManager::GetHashEntry(hlkvds::KVSlice*)
bool IndexManager::GetHashEntry(KVSlice *slice) {
    const Kvdb_Digest *digest = &slice->GetDigest();
    uint32_t hash_index = KeyDigestHandle::Hash(digest) % htSize_;
    HashEntry entry;
    entry.SetKeyDigest(*digest);

    std::lock_guard<std::mutex> l(hashtable_[hash_index].slotMtx_);
    LinkedList<HashEntry> *entry_list = hashtable_[hash_index].entryList_;

    if (entry_list->search(entry)) {
        vector<HashEntry> tmp_vec = entry_list->get();
        for (vector<HashEntry>::iterator iter = tmp_vec.begin(); iter!=tmp_vec.end(); iter++) {
            if (iter->GetKeyDigest() == *digest) {
                entry = *iter;
                slice->SetHashEntry(&entry);
                __DEBUG("IndexManger: entry : header_offset = %lu, data_offset = %u, next_header=%u",
                        entry.GetHeaderOffset(), entry.GetDataOffsetInSeg(),
                        entry.GetNextHeadOffsetInSeg());
                return true;
            }
        }
    }
    return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r14
movq %rdi, %r12
movq 0x20(%rsi), %r15
movq %r15, %rdi
callq 0x12d5e
movl %eax, %ebx
movl 0x8(%r12), %ebp
leaq 0x28(%rsp), %r13
movq %r13, %rdi
callq 0x10e88
movq (%r13), %rdi
movq %r15, %rsi
callq 0x12bde
movl %ebx, %eax
xorl %edx, %edx
divl %ebp
movq (%r12), %rax
leaq (%rdx,%rdx,2), %rbx
shlq $0x4, %rbx
leaq (%rax,%rbx), %r13
addq $0x8, %r13
movq %r13, %rdi
callq 0x6590
testl %eax, %eax
jne 0x11dc2
movq %r13, 0x20(%rsp)
movq (%r12), %rax
movq (%rax,%rbx), %r12
movq (%r12), %r13
testq %r13, %r13
setne %bl
je 0x11ccf
leaq 0x28(%rsp), %rbp
movq %r13, %rdi
movq %rbp, %rsi
callq 0x110b6
testb %al, %al
jne 0x11ccf
movq 0x18(%r13), %r13
testq %r13, %r13
setne %bl
jne 0x11cb4
testb $0x1, %bl
je 0x11d50
leaq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x121b6
movq 0x8(%rsp), %r12
movq 0x10(%rsp), %rbx
cmpq %rbx, %r12
je 0x11d29
leaq 0x44(%rsp), %r13
movq (%r12), %rsi
movq %r13, %rdi
callq 0x12bce
movq %r13, %rdi
movq %r15, %rsi
callq 0x12bee
movl %eax, %ebp
movq %r13, %rdi
callq 0x12bdc
testb %bpl, %bpl
jne 0x11d77
addq $0x18, %r12
movq 0x10(%rsp), %rbx
cmpq %rbx, %r12
jne 0x11cf5
movq 0x8(%rsp), %r14
cmpq %rbx, %r14
je 0x11d41
movq %r14, %rdi
callq 0x11066
addq $0x18, %r14
jmp 0x11d2e
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x11d50
callq 0x6400
xorl %ebp, %ebp
movq 0x20(%rsp), %rdi
callq 0x6360
leaq 0x28(%rsp), %rdi
callq 0x11066
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
callq 0x1112a
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x1bab2
movq 0x8(%rsp), %r14
movq 0x10(%rsp), %rbx
cmpq %rbx, %r14
je 0x11dae
movq %r14, %rdi
callq 0x11066
addq $0x18, %r14
jmp 0x11d9b
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x11dbd
callq 0x6400
movb $0x1, %bpl
jmp 0x11d52
movl %eax, %edi
callq 0x62c0
jmp 0x11dd4
jmp 0x11e14
jmp 0x11dcf
movq %rax, %r14
jmp 0x11e21
movq %rax, %r14
jmp 0x11de6
movq %rax, %r14
leaq 0x44(%rsp), %rdi
callq 0x12bdc
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %rbx
cmpq %rbx, %r15
je 0x11e03
movq %r15, %rdi
callq 0x11066
addq $0x18, %r15
jmp 0x11df0
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x11e17
callq 0x6400
jmp 0x11e17
movq %rax, %r14
movq 0x20(%rsp), %rdi
callq 0x6360
leaq 0x28(%rsp), %rdi
callq 0x11066
movq %r14, %rdi
callq 0x6680
nop