// File: /workspace/github_cpp_makefile_star2_O3/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 $0x108, %rsp            # imm = 0x108
movl %r8d, 0x10(%rsp)
movq %rcx, %r14
movq %rdx, 0x20(%rsp)
movq %rsi, %r15
movq %rdi, %rbp
movq 0x48(%rsi), %r12
leaq 0xf8(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rcx), %rsi
movq 0x8(%rcx), %rdx
addq %rsi, %rdx
leaq 0xe8(%rsp), %r13
movq %r13, %rdi
callq 0x6790
movq %rbp, 0x8(%rsp)
movq %rbp, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x14218
movq 0xe8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x10d8c
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x8(%rsp), %rax
cmpq $0x0, 0x8(%rax)
movq 0x50(%r15), %r12
movq 0x68(%r15), %r13
je 0x10eaf
leaq 0x98(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0x88(%rsp), %rdi
callq 0x6790
movl 0x10(%rsp), %r14d
leaq 0x78(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x68(%rsp), %rdi
callq 0x6790
addq $0x8, %r12
leaq 0x88(%rsp), %r8
leaq 0x68(%rsp), %r9
movq %r13, %rdi
movq %r12, %rsi
xorl %edx, %edx
movl %r14d, %ecx
callq 0xc846
movq 0x68(%rsp), %rdi
cmpq %rbx, %rdi
je 0x10e26
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x88(%rsp), %rdi
cmpq %rbp, %rdi
je 0x10e43
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3280
movl $0x78, %edi
callq 0x3270
movq %rax, %r12
movq 0x50(%r15), %rsi
addq $0x8, %rsi
leaq 0x1a(%rsp), %rdi
callq 0xd01c
leaq 0xd8(%rsp), %r13
movq %r13, -0x10(%r13)
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0xc8(%rsp), %rdi
callq 0x6790
leaq 0x1a(%rsp), %rdx
leaq 0xc8(%rsp), %rcx
movq %r12, %rdi
movl %r14d, %esi
callq 0x15fee
movq 0xc8(%rsp), %rdi
jmp 0x10f65
leaq 0x58(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %rdi
callq 0x6790
movl 0x10(%rsp), %ebp
addq $0x8, %r12
leaq 0x48(%rsp), %r8
movq %r13, %rdi
movq %r12, %rsi
xorl %edx, %edx
movl %ebp, %ecx
callq 0xcc00
movq 0x48(%rsp), %rdi
cmpq %rbx, %rdi
je 0x10eff
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3280
movl $0x78, %edi
callq 0x3270
movq %rax, %r12
movq 0x50(%r15), %rsi
addq $0x8, %rsi
leaq 0x14(%rsp), %rdi
callq 0xd01c
leaq 0xb8(%rsp), %r13
movq %r13, -0x10(%r13)
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0xa8(%rsp), %rdi
callq 0x6790
leaq 0x14(%rsp), %rdx
leaq 0xa8(%rsp), %rcx
movq %r12, %rdi
movl %ebp, %esi
callq 0x15fee
movq 0xa8(%rsp), %rdi
cmpq %r13, %rdi
je 0x10f76
movq (%r13), %rsi
incq %rsi
callq 0x3280
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
callq 0x160dc
movq 0x50(%r15), %rsi
movq 0x60(%r15), %rdi
addq $0x8, %rsi
movq 0x28(%rsp), %rcx
movl 0x30(%rsp), %r8d
movq 0x20(%rsp), %rdx
callq 0x6e4c
movq 0x58(%r12), %rdi
leaq 0x68(%r12), %rax
cmpq %rax, %rdi
je 0x10fbd
movq (%rax), %rsi
incq %rsi
callq 0x3280
movq 0x28(%r12), %rdi
leaq 0x38(%r12), %rax
cmpq %rax, %rdi
je 0x10fd7
movq (%rax), %rsi
incq %rsi
callq 0x3280
movq 0x8(%r12), %rdi
leaq 0x18(%r12), %rax
cmpq %rax, %rdi
je 0x10ff1
movq (%rax), %rsi
incq %rsi
callq 0x3280
movl $0x78, %esi
movq %r12, %rdi
callq 0x3280
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x11019
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x8(%rsp), %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq 0xa8(%rsp), %rdi
cmpq %r13, %rdi
je 0x110f2
movq 0xb8(%rsp), %rsi
jmp 0x1107e
movq %rax, %r14
movq 0x48(%rsp), %rdi
cmpq %rbx, %rdi
je 0x11104
movq 0x58(%rsp), %rsi
jmp 0x110d6
movq %rax, %r14
movq 0xc8(%rsp), %rdi
cmpq %r13, %rdi
je 0x110f2
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x110f2
movq %rax, %r14
movq 0x68(%rsp), %rdi
cmpq %rbx, %rdi
je 0x110a7
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x110a7
movq %rax, %r14
movq 0x88(%rsp), %rdi
cmpq %rbp, %rdi
je 0x11104
movq 0x98(%rsp), %rsi
jmp 0x110d6
jmp 0x110ef
movq %rax, %r14
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x11104
movq 0x38(%rsp), %rsi
incq %rsi
jmp 0x110fa
jmp 0x11101
movq %rax, %r14
movq 0xe8(%rsp), %rdi
cmpq %rbx, %rdi
jne 0x11118
jmp 0x11123
movq %rax, %r14
movl $0x78, %esi
movq %r12, %rdi
callq 0x3280
jmp 0x11104
movq %rax, %r14
movq 0x8(%rsp), %rax
movq (%rax), %rdi
addq $0x10, %rax
movq %rax, %rbx
cmpq %rax, %rdi
je 0x11123
movq (%rbx), %rsi
incq %rsi
callq 0x3280
movq %r14, %rdi
callq 0x3450
nop