// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/Kvdb_Impl.cc
// Function: hlkvds::KVDS::Get(char const*, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
Status KVDS::Get(const char* key, uint32_t key_len, string &data) {
    bool res = false;
    if (key == NULL) {
        return Status::InvalidArgument("Key is null.");
    }

    KVSlice slice(key, key_len, NULL, 0);

    if(!options_.disable_cache) {
        if(rdCache_->Get(slice.GetKeyStr(), data)) {
            rdCache_->Put(slice.GetKeyStr(), data);
            return Status::OK();
        }
    }

    res = idxMgr_->GetHashEntry(&slice);
    if (!res) {
        //The key is not exist
        return Status::NotFound("Key is not found.");
    }

    Status s = dataStor_->ReadData(slice, data);

    if (s.ok()) {
        if(!options_.disable_cache) {
            rdCache_->Put(slice.GetKeyStr(), data);
        }
    }

    return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xe0, %rsp
movq %rdi, %rbx
testq %rdx, %rdx
je 0x1422e
movq %r8, %r14
movq %rsi, %r15
leaq 0xa0(%rsp), %rdi
movq %rdx, %rsi
movl %ecx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x1b8ca
cmpb $0x0, 0x50(%r15)
jne 0x14184
movq 0x38(%r15), %r12
leaq 0x80(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x1ba98
leaq 0x80(%rsp), %rsi
movq %r12, %rdi
movq %r14, %rdx
callq 0x17be2
movl %eax, %ebp
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x14104
callq 0x63f0
testb %bpl, %bpl
je 0x14184
movq 0x38(%r15), %r15
leaq 0x60(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x1ba98
leaq 0x30(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0x20(%rsp), %rdi
callq 0xa7cc
leaq 0x60(%rsp), %rsi
leaq 0x20(%rsp), %rdx
movq %r15, %rdi
callq 0x17514
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x1415e
callq 0x63f0
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x14171
callq 0x63f0
movl $0x0, (%rbx)
movq $0x0, 0x8(%rbx)
jmp 0x14258
movq 0x30(%r15), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x11d58
testb %al, %al
je 0x14244
movq 0x48(%r15), %rsi
movq (%rsi), %rax
leaq 0xa0(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rcx
callq *0x50(%rax)
cmpl $0x0, (%rbx)
jne 0x14258
cmpb $0x0, 0x50(%r15)
jne 0x14258
movq 0x38(%r15), %r15
leaq 0x40(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x1ba98
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
movq %rsp, %rdi
callq 0xa7cc
leaq 0x40(%rsp), %rsi
movq %rsp, %rdx
movq %r15, %rdi
callq 0x17514
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x14219
callq 0x63f0
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x14258
callq 0x63f0
jmp 0x14258
leaq 0xecf7(%rip), %rdx      # 0x22f2c
movq %rbx, %rdi
movl $0x4, %esi
callq 0x1de28
jmp 0x14265
leaq 0xe39d(%rip), %rdx      # 0x225e8
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1de28
leaq 0xa0(%rsp), %rdi
callq 0x1b7ac
movq %rbx, %rax
addq $0xe0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x1428e
callq 0x63f0
jmp 0x1428e
movq %rax, %rbx
leaq 0x50(%rsp), %rax
jmp 0x142c0
jmp 0x142d0
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x142ae
callq 0x63f0
jmp 0x142ae
movq %rax, %rbx
leaq 0x70(%rsp), %rax
jmp 0x142c0
movq %rax, %rbx
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x142d3
callq 0x63f0
jmp 0x142d3
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x1b7ac
movq %rbx, %rdi
callq 0x6670