// File: /workspace/github_cpp_makefile_star2_O2/zkl94[P]distributed-key-value-store/MP2Node.cpp
// Function: MP2Node::readKey(Address, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, MessageType)
string MP2Node::readKey(Address fromAddr, string key, int transID, MessageType t) {
    // Read key from local hash table and return value
    string result = this->ht->read(key);
    Message *message;
    if (!result.empty()) {
        // success
        log->logReadSuccess(&(this->memberNode->addr), false, transID, key, result);
        // determine success or failure by whether result is empty or not
        message = new Message(transID, this->memberNode->addr, result);
    } else {
        log->logReadFail(&(this->memberNode->addr), false, transID, key);
        message = new Message(transID, this->memberNode->addr, result);
    }

    string _string = message->toString();
    emulNet->ENsend(&(this->memberNode->addr), &fromAddr, (char *)_string.c_str(), _string.size());

    delete message;

    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movl %r8d, %ebp
movq %rcx, %r14
movq %rdx, 0x10(%rsp)
movq %rsi, %r15
movq %rdi, %rbx
movq 0x48(%rsi), %r13
leaq 0xd8(%rsp), %r12
movq %r12, %rdi
movq %rcx, %rsi
callq 0x3340
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0xfb9a
leaq 0xd8(%rsp), %rdi
callq 0x3110
cmpq $0x0, 0x8(%rbx)
movq 0x50(%r15), %r12
movq 0x68(%r15), %r13
je 0xd54e
leaq 0x78(%rsp), %rdi
movq %r14, %rsi
callq 0x3340
leaq 0x58(%rsp), %rdi
movq %rbx, %rsi
callq 0x3340
addq $0x8, %r12
leaq 0x78(%rsp), %r8
leaq 0x58(%rsp), %r9
movq %r13, %rdi
movq %r12, %rsi
xorl %edx, %edx
movl %ebp, %ecx
callq 0x98b0
leaq 0x58(%rsp), %rdi
callq 0x3110
leaq 0x78(%rsp), %rdi
callq 0x3110
pushq $0x78
popq %rdi
callq 0x3260
movq %rax, %r12
movq 0x50(%r15), %rsi
addq $0x8, %rsi
leaq 0xa(%rsp), %rdi
callq 0x9f14
leaq 0xb8(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x3340
leaq 0xa(%rsp), %rdx
movq %r12, %rdi
movl %ebp, %esi
movq %r13, %rcx
callq 0x10efa
jmp 0xd5bf
leaq 0x38(%rsp), %rdi
movq %r14, %rsi
callq 0x3340
addq $0x8, %r12
leaq 0x38(%rsp), %r8
movq %r13, %rdi
movq %r12, %rsi
xorl %edx, %edx
movl %ebp, %ecx
callq 0x9ba2
leaq 0x38(%rsp), %rdi
callq 0x3110
pushq $0x78
popq %rdi
callq 0x3260
movq %rax, %r12
movq 0x50(%r15), %rsi
addq $0x8, %rsi
leaq 0x4(%rsp), %rdi
callq 0x9f14
leaq 0x98(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x3340
leaq 0x4(%rsp), %rdx
movq %r12, %rdi
movl %ebp, %esi
movq %r13, %rcx
callq 0x10efa
movq %r13, %rdi
callq 0x3110
leaq 0x18(%rsp), %rdi
movq %r12, %rsi
callq 0x10fb8
movq 0x50(%r15), %rsi
movq 0x60(%r15), %rdi
addq $0x8, %rsi
movq 0x18(%rsp), %rcx
movl 0x20(%rsp), %r8d
movq 0x10(%rsp), %rdx
callq 0x56ee
movq %r12, %rdi
callq 0xe704
pushq $0x78
popq %rsi
movq %r12, %rdi
callq 0x3270
leaq 0x18(%rsp), %rdi
callq 0x3110
movq %rbx, %rax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x98(%rsp), %rdi
jmp 0xd648
movq %rax, %r14
leaq 0x38(%rsp), %rdi
jmp 0xd672
movq %rax, %r14
leaq 0xb8(%rsp), %rdi
callq 0x3110
jmp 0xd686
movq %rax, %r14
leaq 0x58(%rsp), %rdi
callq 0x3110
jmp 0xd661
movq %rax, %r14
leaq 0x78(%rsp), %rdi
jmp 0xd672
jmp 0xd683
movq %rax, %r14
leaq 0x18(%rsp), %rdi
callq 0x3110
jmp 0xd696
jmp 0xd693
movq %rax, %r14
movq %r12, %rbx
jmp 0xd696
movq %rax, %r14
pushq $0x78
popq %rsi
movq %r12, %rdi
callq 0x3270
jmp 0xd696
movq %rax, %r14
movq %rbx, %rdi
callq 0x3110
movq %r14, %rdi
callq 0x3420