// File: 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
movq %rsp, %rbp
subq $0x1f0, %rsp            # imm = 0x1F0
movq %rcx, -0x178(%rbp)
movq %rdx, -0x180(%rbp)
movq %rsi, %rax
movq -0x178(%rbp), %rsi
movq %rdi, -0x160(%rbp)
movq %rdi, %rcx
movq %rcx, -0x170(%rbp)
movq %rdi, -0x8(%rbp)
movq %rax, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl %r9d, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x168(%rbp)
movb $0x0, -0x29(%rbp)
movq 0x48(%rax), %rax
movq %rax, -0x158(%rbp)
leaq -0x50(%rbp), %rdi
movq %rdi, -0x150(%rbp)
callq 0x4150
movq -0x160(%rbp), %rdi
movq -0x158(%rbp), %rsi
movq -0x150(%rbp), %rdx
callq 0x23980
jmp 0x1c3f2
leaq -0x50(%rbp), %rdi
callq 0x41e0
movq -0x160(%rbp), %rdi
callq 0x4530
testb $0x1, %al
jne 0x1c5e9
movq -0x178(%rbp), %rsi
movq -0x168(%rbp), %rcx
movq 0x50(%rcx), %rax
movq 0x68(%rcx), %rcx
movq %rcx, -0x198(%rbp)
addq $0x8, %rax
movq %rax, -0x190(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x184(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x4150
jmp 0x1c44e
movq -0x160(%rbp), %rsi
leaq -0xa8(%rbp), %rdi
callq 0x4150
jmp 0x1c463
movl -0x184(%rbp), %ecx
movq -0x190(%rbp), %rsi
movq -0x198(%rbp), %rdi
xorl %edx, %edx
leaq -0x88(%rbp), %r8
leaq -0xa8(%rbp), %r9
callq 0x145e0
jmp 0x1c48e
leaq -0xa8(%rbp), %rdi
callq 0x41e0
leaq -0x88(%rbp), %rdi
callq 0x41e0
movl $0x78, %edi
callq 0x4310
movq %rax, -0x1a0(%rbp)
jmp 0x1c4b9
movq -0x168(%rbp), %rax
movb $0x1, -0xd1(%rbp)
movl -0x24(%rbp), %ecx
movl %ecx, -0x1a4(%rbp)
movq 0x50(%rax), %rsi
addq $0x8, %rsi
leaq -0xae(%rbp), %rdi
callq 0x15070
jmp 0x1c4e6
movq -0x160(%rbp), %rsi
leaq -0xd0(%rbp), %rdi
callq 0x4150
jmp 0x1c4fb
movl -0x1a4(%rbp), %esi
movq -0x1a0(%rbp), %rdi
leaq -0xae(%rbp), %rdx
leaq -0xd0(%rbp), %rcx
callq 0x26890
jmp 0x1c51d
movq -0x1a0(%rbp), %rax
movb $0x0, -0xd1(%rbp)
movq %rax, -0x68(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x41e0
jmp 0x1c753
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x41e0
jmp 0x1c85a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x1c84e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x1c591
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x41e0
leaq -0x88(%rbp), %rdi
callq 0x41e0
jmp 0x1c84e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x1c5c8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x41e0
testb $0x1, -0xd1(%rbp)
jne 0x1c5d3
jmp 0x1c5e4
movq -0x1a0(%rbp), %rdi
movl $0x78, %esi
callq 0x4320
jmp 0x1c84e
movq -0x178(%rbp), %rsi
movq -0x168(%rbp), %rcx
movq 0x50(%rcx), %rax
movq 0x68(%rcx), %rcx
movq %rcx, -0x1b8(%rbp)
addq $0x8, %rax
movq %rax, -0x1b0(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x1a8(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0x4150
jmp 0x1c628
movl -0x1a8(%rbp), %ecx
movq -0x1b0(%rbp), %rsi
movq -0x1b8(%rbp), %rdi
xorl %edx, %edx
leaq -0xf8(%rbp), %r8
callq 0x14ae0
jmp 0x1c64c
leaq -0xf8(%rbp), %rdi
callq 0x41e0
movl $0x78, %edi
callq 0x4310
movq %rax, -0x1c0(%rbp)
jmp 0x1c66b
movq -0x168(%rbp), %rax
movb $0x1, -0x121(%rbp)
movl -0x24(%rbp), %ecx
movl %ecx, -0x1c4(%rbp)
movq 0x50(%rax), %rsi
addq $0x8, %rsi
leaq -0xfe(%rbp), %rdi
callq 0x15070
jmp 0x1c698
movq -0x160(%rbp), %rsi
leaq -0x120(%rbp), %rdi
callq 0x4150
jmp 0x1c6ad
movl -0x1c4(%rbp), %esi
movq -0x1c0(%rbp), %rdi
leaq -0xfe(%rbp), %rdx
leaq -0x120(%rbp), %rcx
callq 0x26890
jmp 0x1c6cf
movq -0x1c0(%rbp), %rax
movb $0x0, -0x121(%rbp)
movq %rax, -0x68(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x41e0
jmp 0x1c753
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0x41e0
jmp 0x1c84e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x1c732
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x41e0
testb $0x1, -0x121(%rbp)
jne 0x1c73d
jmp 0x1c74e
movq -0x1c0(%rbp), %rdi
movl $0x78, %esi
callq 0x4320
jmp 0x1c84e
movq -0x68(%rbp), %rsi
leaq -0x148(%rbp), %rdi
callq 0x26980
jmp 0x1c765
movq -0x168(%rbp), %rcx
movq 0x50(%rcx), %rax
movq 0x60(%rcx), %rcx
movq %rcx, -0x1e0(%rbp)
addq $0x8, %rax
movq %rax, -0x1d8(%rbp)
leaq -0x148(%rbp), %rdi
movq %rdi, -0x1e8(%rbp)
callq 0x4140
movq -0x1e8(%rbp), %rdi
movq %rax, -0x1d0(%rbp)
callq 0x4220
movq -0x1e0(%rbp), %rdi
movq -0x1d8(%rbp), %rsi
movq -0x180(%rbp), %rdx
movq -0x1d0(%rbp), %rcx
movl %eax, %r8d
callq 0xac80
jmp 0x1c7d2
movq -0x68(%rbp), %rax
movq %rax, -0x1f0(%rbp)
cmpq $0x0, %rax
je 0x1c800
movq -0x1f0(%rbp), %rdi
callq 0x1ea70
movq -0x1f0(%rbp), %rdi
movl $0x78, %esi
callq 0x4320
movb $0x1, -0x29(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x41e0
testb $0x1, -0x29(%rbp)
jne 0x1c83e
jmp 0x1c832
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x41e0
jmp 0x1c84e
movq -0x160(%rbp), %rdi
callq 0x41e0
movq -0x170(%rbp), %rax
addq $0x1f0, %rsp            # imm = 0x1F0
popq %rbp
retq
movq -0x160(%rbp), %rdi
callq 0x41e0
movq -0x58(%rbp), %rdi
callq 0x4550
nopw %cs:(%rax,%rax)