// File: /workspace/github_cpp_makefile_star2_O1/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 0x9564(%rip), %r15      # 0xefa8
leaq 0x58a8(%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 0x8ca0
testq %rax, %rax
je 0x5b54
movq %rax, %r15
movq 0x94fc(%rip), %r14      # 0xefa8
leaq 0x5843(%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 0x5b2b
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 0x9582
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 0x5cb0
movq 0x60(%r14), %rcx
movl (%rcx), %edx
xorl %r15d, %r15d
cmpl %edx, %eax
jge 0x5b7a
movl %eax, %ebp
jmp 0x5b8d
xorl %r15d, %r15d
movl %eax, %ebp
subl %edx, %ebp
movl 0x4(%rcx,%r15,4), %edx
incq %r15
cmpl %edx, %ebp
jge 0x5b7f
cmpl $-0x1, %eax
je 0x5c4f
movq 0x940b(%rip), %r12      # 0xefa8
leaq 0x5759(%rip), %rsi      # 0xb2fd
movl $0x2, %edx
movq %r12, %rdi
callq 0x32b0
movq %r12, %rdi
movl %r15d, %esi
callq 0x33d0
movq %rax, %r12
leaq 0x5779(%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 0x5ea6
movq (%rsp), %rcx
movq %rbx, %rdi
movq %r12, %rdx
callq 0x5dc6
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5b44
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x5b44
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x5695(%rip), %rdx      # 0xb2f2
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x4e24
jmp 0x5b44
movq %rax, %rbx
jmp 0x5ca8
movq %rax, %rbx
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5ca8
movq 0x30(%rsp), %rsi
jmp 0x5ca0
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5ca8
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3280
movq %rbx, %rdi
callq 0x33f0