// File: 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:
subq $0x168, %rsp            # imm = 0x168
movq %rdi, 0x28(%rsp)
movq %rdi, %rax
movq %rax, 0x30(%rsp)
movq %rdi, 0x160(%rsp)
movq %rsi, 0x158(%rsp)
movq %rdx, 0x150(%rsp)
movl %ecx, 0x14c(%rsp)
movq %r8, 0x140(%rsp)
movq 0x158(%rsp), %rax
movq %rax, 0x38(%rsp)
movb $0x0, 0x13f(%rsp)
cmpq $0x0, 0x150(%rsp)
jne 0x2ca71
movq 0x28(%rsp), %rdi
leaq 0x266ad(%rip), %rsi     # 0x53114
callq 0x2d710
jmp 0x2cddb
movq 0x150(%rsp), %rsi
movl 0x14c(%rsp), %edx
leaq 0xf8(%rsp), %rdi
xorl %eax, %eax
movl %eax, %ecx
xorl %r9d, %r9d
movl %r9d, %r8d
callq 0x40eb0
movq 0x38(%rsp), %rax
testb $0x1, 0x50(%rax)
jne 0x2cc1d
movq 0x38(%rsp), %rax
movq 0x38(%rax), %rax
movq %rax, 0x20(%rsp)
leaq 0xd8(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x411e0
jmp 0x2cacb
movq 0x20(%rsp), %rdi
movq 0x140(%rsp), %rdx
leaq 0xd8(%rsp), %rsi
callq 0x38190
movb %al, 0x1f(%rsp)
jmp 0x2caeb
leaq 0xd8(%rsp), %rdi
callq 0x8928
movb 0x1f(%rsp), %al
testb $0x1, %al
jne 0x2cb05
jmp 0x2cc1b
movq 0x38(%rsp), %rax
movq 0x38(%rax), %rax
movq %rax, 0x10(%rsp)
leaq 0xa8(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x411e0
jmp 0x2cb2a
movq 0x140(%rsp), %rsi
leaq 0x88(%rsp), %rdi
callq 0x81a0
jmp 0x2cb41
movq 0x10(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
leaq 0x88(%rsp), %rdx
callq 0x37640
jmp 0x2cb5d
leaq 0x88(%rsp), %rdi
callq 0x8928
leaq 0xa8(%rsp), %rdi
callq 0x8928
movq 0x28(%rsp), %rdi
callq 0x16560
jmp 0x2cb83
movl $0x1, 0x84(%rsp)
jmp 0x2cdbd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd0(%rsp)
movl %eax, 0xcc(%rsp)
jmp 0x2cdcc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd0(%rsp)
movl %eax, 0xcc(%rsp)
leaq 0xd8(%rsp), %rdi
callq 0x8928
jmp 0x2cdcc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd0(%rsp)
movl %eax, 0xcc(%rsp)
jmp 0x2cc09
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd0(%rsp)
movl %eax, 0xcc(%rsp)
leaq 0x88(%rsp), %rdi
callq 0x8928
leaq 0xa8(%rsp), %rdi
callq 0x8928
jmp 0x2cdcc
jmp 0x2cc1d
movq 0x38(%rsp), %rax
movq 0x30(%rax), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x26c50
movb %al, 0xf(%rsp)
jmp 0x2cc39
movb 0xf(%rsp), %al
andb $0x1, %al
movb %al, 0x13f(%rsp)
testb $0x1, 0x13f(%rsp)
jne 0x2cc73
movq 0x28(%rsp), %rdi
leaq 0x25b5d(%rip), %rsi     # 0x527b9
callq 0x165a0
jmp 0x2cc63
movl $0x1, 0x84(%rsp)
jmp 0x2cdbd
movq 0x28(%rsp), %rdi
movq 0x38(%rsp), %rax
movb $0x0, 0x83(%rsp)
movq 0x48(%rax), %rsi
movq 0x140(%rsp), %rcx
movq (%rsi), %rax
movq 0x50(%rax), %rax
leaq 0xf8(%rsp), %rdx
callq *%rax
jmp 0x2cca4
movq 0x28(%rsp), %rdi
callq 0xa890
movb %al, 0xe(%rsp)
jmp 0x2ccb4
movb 0xe(%rsp), %al
testb $0x1, %al
jne 0x2ccc1
jmp 0x2cd88
movq 0x38(%rsp), %rax
testb $0x1, 0x50(%rax)
jne 0x2cd86
movq 0x38(%rsp), %rax
movq 0x38(%rax), %rax
movq %rax, (%rsp)
leaq 0x60(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x411e0
jmp 0x2ccf1
movq 0x140(%rsp), %rsi
leaq 0x40(%rsp), %rdi
callq 0x81a0
jmp 0x2cd05
movq (%rsp), %rdi
leaq 0x60(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x37640
jmp 0x2cd1a
leaq 0x40(%rsp), %rdi
callq 0x8928
leaq 0x60(%rsp), %rdi
callq 0x8928
jmp 0x2cd86
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd0(%rsp)
movl %eax, 0xcc(%rsp)
jmp 0x2cdb1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd0(%rsp)
movl %eax, 0xcc(%rsp)
jmp 0x2cd7a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd0(%rsp)
movl %eax, 0xcc(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x8928
leaq 0x60(%rsp), %rdi
callq 0x8928
jmp 0x2cdb1
jmp 0x2cd88
movb $0x1, 0x83(%rsp)
movl $0x1, 0x84(%rsp)
testb $0x1, 0x83(%rsp)
jne 0x2cdaf
movq 0x28(%rsp), %rdi
callq 0xa8b0
jmp 0x2cdbd
movq 0x28(%rsp), %rdi
callq 0xa8b0
jmp 0x2cdcc
leaq 0xf8(%rsp), %rdi
callq 0x40c40
jmp 0x2cddb
leaq 0xf8(%rsp), %rdi
callq 0x40c40
jmp 0x2cde8
movq 0x30(%rsp), %rax
addq $0x168, %rsp            # imm = 0x168
retq
movq 0xd0(%rsp), %rdi
callq 0x8820
nopw %cs:(%rax,%rax)