// File: /workspace/github_cpp_makefile_star2_O1/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 0x6810
movq %rbp, 0x8(%rsp)
movq %rbp, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x1449c
movq 0xe8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x110d8
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 0x111fb
leaq 0x98(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0x88(%rsp), %rdi
callq 0x6810
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 0x6810
addq $0x8, %r12
leaq 0x88(%rsp), %r8
leaq 0x68(%rsp), %r9
movq %r13, %rdi
movq %r12, %rsi
xorl %edx, %edx
movl %r14d, %ecx
callq 0xc99a
movq 0x68(%rsp), %rdi
cmpq %rbx, %rdi
je 0x11172
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x88(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1118f
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 0xd170
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 0x6810
leaq 0x1a(%rsp), %rdx
leaq 0xc8(%rsp), %rcx
movq %r12, %rdi
movl %r14d, %esi
callq 0x16296
movq 0xc8(%rsp), %rdi
jmp 0x112b1
leaq 0x58(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %rdi
callq 0x6810
movl 0x10(%rsp), %ebp
addq $0x8, %r12
leaq 0x48(%rsp), %r8
movq %r13, %rdi
movq %r12, %rsi
xorl %edx, %edx
movl %ebp, %ecx
callq 0xcd54
movq 0x48(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1124b
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 0xd170
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 0x6810
leaq 0x14(%rsp), %rdx
leaq 0xa8(%rsp), %rcx
movq %r12, %rdi
movl %ebp, %esi
callq 0x16296
movq 0xa8(%rsp), %rdi
cmpq %r13, %rdi
je 0x112c2
movq (%r13), %rsi
incq %rsi
callq 0x3280
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
callq 0x16384
movq 0x50(%r15), %rsi
movq 0x60(%r15), %rdi
addq $0x8, %rsi
movq 0x28(%rsp), %rcx
movl 0x30(%rsp), %r8d
movq 0x20(%rsp), %rdx
callq 0x6ed0
movq 0x58(%r12), %rdi
leaq 0x68(%r12), %rax
cmpq %rax, %rdi
je 0x11309
movq (%rax), %rsi
incq %rsi
callq 0x3280
movq 0x28(%r12), %rdi
leaq 0x38(%r12), %rax
cmpq %rax, %rdi
je 0x11323
movq (%rax), %rsi
incq %rsi
callq 0x3280
movq 0x8(%r12), %rdi
leaq 0x18(%r12), %rax
cmpq %rax, %rdi
je 0x1133d
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 0x11365
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 0x1143e
movq 0xb8(%rsp), %rsi
jmp 0x113ca
movq %rax, %r14
movq 0x48(%rsp), %rdi
cmpq %rbx, %rdi
je 0x11450
movq 0x58(%rsp), %rsi
jmp 0x11422
movq %rax, %r14
movq 0xc8(%rsp), %rdi
cmpq %r13, %rdi
je 0x1143e
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x1143e
movq %rax, %r14
movq 0x68(%rsp), %rdi
cmpq %rbx, %rdi
je 0x113f3
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x113f3
movq %rax, %r14
movq 0x88(%rsp), %rdi
cmpq %rbp, %rdi
je 0x11450
movq 0x98(%rsp), %rsi
jmp 0x11422
jmp 0x1143b
movq %rax, %r14
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x11450
movq 0x38(%rsp), %rsi
incq %rsi
jmp 0x11446
jmp 0x1144d
movq %rax, %r14
movq 0xe8(%rsp), %rdi
cmpq %rbx, %rdi
jne 0x11464
jmp 0x1146f
movq %rax, %r14
movl $0x78, %esi
movq %r12, %rdi
callq 0x3280
jmp 0x11450
movq %rax, %r14
movq 0x8(%rsp), %rax
movq (%rax), %rdi
addq $0x10, %rax
movq %rax, %rbx
cmpq %rax, %rdi
je 0x1146f
movq (%rbx), %rsi
incq %rsi
callq 0x3280
movq %r14, %rdi
callq 0x3450
nop