// File: /workspace/github_cpp_makefile_star2_O3/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 $0x48, %rsp
movq %rsi, %r14
movq %rdi, %r12
movq 0x20(%rsi), %r15
movq %r15, %rdi
callq 0x12e82
movl %eax, %ebx
movl 0x8(%r12), %ebp
leaq 0x18(%rsp), %r13
movq %r13, %rdi
callq 0x10fbc
movq (%r13), %rdi
movq %r15, %rsi
callq 0x12d02
movl %ebx, %eax
xorl %edx, %edx
divl %ebp
movq (%r12), %rax
leaq (%rdx,%rdx,2), %r13
shlq $0x4, %r13
leaq (%rax,%r13), %rbx
addq $0x8, %rbx
movq %rbx, %rdi
callq 0x6580
testl %eax, %eax
jne 0x11ef4
movq (%r12), %rax
movq (%rax,%r13), %r12
movq (%r12), %r13
testq %r13, %r13
je 0x11ecf
leaq 0x18(%rsp), %rbp
movq %r13, %rdi
movq %rbp, %rsi
callq 0x111ea
testb %al, %al
jne 0x11df9
movq 0x18(%r13), %r13
testq %r13, %r13
jne 0x11ddc
jmp 0x11ecf
movq %rsp, %rdi
movq %r12, %rsi
callq 0x122ea
movq (%rsp), %r12
cmpq 0x8(%rsp), %r12
je 0x11ec2
leaq 0x34(%rsp), %r13
movq (%r12), %rsi
movq %r13, %rdi
callq 0x12cf2
movq %r13, %rdi
movq %r15, %rsi
callq 0x12d12
movl %eax, %ebp
movq %r13, %rdi
callq 0x12d00
testb %bpl, %bpl
jne 0x11e70
addq $0x18, %r12
cmpq 0x8(%rsp), %r12
jne 0x11e18
movq (%rsp), %r14
cmpq %r14, %r12
je 0x11ebf
addq $-0x18, %r12
movq %r14, %rdi
callq 0x1119a
leaq 0x18(%r14), %rax
cmpq %r14, %r12
movq %rax, %r14
jne 0x11e56
movq (%rsp), %r12
jmp 0x11ec2
leaq 0x18(%rsp), %rdi
movq %r12, %rsi
callq 0x1125e
leaq 0x18(%rsp), %rsi
movq %r14, %rdi
callq 0x1bade
movq (%rsp), %r14
movq 0x8(%rsp), %r15
cmpq %r15, %r14
je 0x11ead
movq %r14, %rdi
callq 0x1119a
addq $0x18, %r14
cmpq %r15, %r14
jne 0x11e98
movq (%rsp), %r14
testq %r14, %r14
je 0x11eba
movq %r14, %rdi
callq 0x63f0
movb $0x1, %bpl
jmp 0x11ed1
movq %r14, %r12
testq %r12, %r12
je 0x11ecf
movq %r12, %rdi
callq 0x63f0
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x6350
leaq 0x18(%rsp), %rdi
callq 0x1119a
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x62b0
jmp 0x11f06
jmp 0x11f4a
jmp 0x11f01
movq %rax, %r14
jmp 0x11f55
movq %rax, %r14
jmp 0x11f18
movq %rax, %r14
leaq 0x34(%rsp), %rdi
callq 0x12d00
movq (%rsp), %r15
movq 0x8(%rsp), %r12
cmpq %r12, %r15
je 0x11f3b
movq %r15, %rdi
callq 0x1119a
addq $0x18, %r15
cmpq %r12, %r15
jne 0x11f26
movq (%rsp), %r15
testq %r15, %r15
je 0x11f4d
movq %r15, %rdi
callq 0x63f0
jmp 0x11f4d
movq %rax, %r14
movq %rbx, %rdi
callq 0x6350
leaq 0x18(%rsp), %rdi
callq 0x1119a
movq %r14, %rdi
callq 0x6670
nop