// File: /workspace/github_cpp_makefile_star2_O3/SeanChao[P]KV-Store/kvstore.cc
// Function: KVStore::get[abi:cxx11](unsigned long)
std::string KVStore::get(uint64_t key) {
    std::clog << "? " << key << std::endl;
    // looks for key in memTable
    std::string *strPointer = memTable->get(key);
    if (strPointer) {
        std::clog << "\t[m]->" << std::string(*strPointer, 0, 40) << std::endl;
        return *strPointer;
    }
    // looks for key in SsTables using indexTable
    uint64_t offset = 0;
    int count = findIndexedKey(key, &offset);
    bool found = count != -1;
    // calculate coresponding ssTable level and id
    // int back = count;
    int level = 0;
    while (count - fileNum[level] >= 0) {
        count -= fileNum[level];
        level++;
    }
    int fileId = count;
    if (found) {
        // reads value on disk according to offest
        std::clog << "\t@" << level << "-" << fileId << std::endl;
        return readPair(resolvePath(level, fileId), offset);
    }
    return "";
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
movq 0x94e6(%rip), %r15      # 0xefa8
leaq 0x582a(%rip), %rsi      # 0xb2f3
movl $0x2, %edx
movq %r15, %rdi
callq 0x32b0
movq %r15, %rdi
movq %r12, %rsi
callq 0x31a0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3250
movsbl %al, %esi
movq %r15, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31b0
movq 0x38(%r14), %rdi
movq %r12, %rsi
callq 0x8cca
testq %rax, %rax
je 0x5bd2
movq %rax, %r15
movq 0x947e(%rip), %r14      # 0xefa8
leaq 0x57c5(%rip), %rsi      # 0xb2f6
movl $0x6, %edx
movq %r14, %rdi
callq 0x32b0
movq %rsp, %r12
movl $0x28, %ecx
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x3070
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %r14, %rdi
callq 0x32b0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3250
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31b0
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5ba9
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3280
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x95b2
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rsp, %rdx
movq $0x0, (%rdx)
movq %r14, %rdi
movq %r12, %rsi
callq 0x5d2e
movq 0x60(%r14), %rcx
movl (%rcx), %edx
xorl %r15d, %r15d
cmpl %edx, %eax
jge 0x5bf8
movl %eax, %ebp
jmp 0x5c0b
xorl %r15d, %r15d
movl %eax, %ebp
subl %edx, %ebp
movl 0x4(%rcx,%r15,4), %edx
incq %r15
cmpl %edx, %ebp
jge 0x5bfd
cmpl $-0x1, %eax
je 0x5ccd
movq 0x938d(%rip), %r12      # 0xefa8
leaq 0x56db(%rip), %rsi      # 0xb2fd
movl $0x2, %edx
movq %r12, %rdi
callq 0x32b0
movq %r12, %rdi
movl %r15d, %esi
callq 0x33d0
movq %rax, %r12
leaq 0x56fb(%rip), %rsi      # 0xb33f
movl $0x1, %edx
movq %rax, %rdi
callq 0x32b0
movq %r12, %rdi
movl %ebp, %esi
callq 0x33d0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x3250
movsbl %al, %esi
movq %r12, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31b0
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movl %r15d, %edx
movl %ebp, %ecx
callq 0x5f1a
movq (%rsp), %rcx
movq %rbx, %rdi
movq %r12, %rdx
callq 0x5e3a
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5bc2
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x5bc2
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x5617(%rip), %rdx      # 0xb2f2
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x4ea6
jmp 0x5bc2
movq %rax, %rbx
jmp 0x5d26
movq %rax, %rbx
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5d26
movq 0x30(%rsp), %rsi
jmp 0x5d1e
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5d26
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3280
movq %rbx, %rdi
callq 0x33f0