// File: /workspace/github_cpp_makefile_star2_O1/zkl94[P]distributed-key-value-store/MP2Node.cpp
// Function: MP2Node::updateKeyValue(Address, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, ReplicaType, int, MessageType)
bool MP2Node::updateKeyValue(Address fromAddr, string key, string value, ReplicaType replica, int transID, MessageType t) {
    // Update key in local hash table and return true or false
    bool success = this->ht->update(key, value);
    Message *message;
    if (success) {
        log->logUpdateSuccess(&(this->memberNode->addr), false, transID, key, value);
        message = new Message(transID, this->memberNode->addr, REPLY, true);
    } else {
        log->logUpdateFail(&(this->memberNode->addr), false, transID, key, value);
        message = new Message(transID, this->memberNode->addr, REPLY, false);
    }

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

    delete message;

    return success;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movl %r9d, (%rsp)
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, 0x50(%rsp)
movq %rdi, %r15
movq 0x48(%rdi), %rbx
leaq 0xc8(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rdx), %rsi
movq 0x8(%rdx), %rdx
addq %rsi, %rdx
leaq 0xb8(%rsp), %rdi
callq 0x6810
leaq 0xa8(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq 0x98(%rsp), %rdi
callq 0x6810
leaq 0xb8(%rsp), %rsi
leaq 0x98(%rsp), %rdx
movq %rbx, %rdi
callq 0x144fc
movl %eax, %ebx
movq 0x98(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1151e
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0xb8(%rsp), %rdi
cmpq %r14, %rdi
movl %ebx, %ebp
je 0x1153d
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x50(%r15), %r14
movq 0x68(%r15), %rbx
testb %bpl, %bpl
je 0x11622
leaq 0x40(%rsp), %rax
movq %rax, -0x10(%rax)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %rdi
callq 0x6810
leaq 0x88(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq 0x78(%rsp), %rdi
callq 0x6810
addq $0x8, %r14
leaq 0x30(%rsp), %r8
leaq 0x78(%rsp), %r9
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
movl (%rsp), %ebx
movl %ebx, %ecx
callq 0xca8c
movq 0x78(%rsp), %rdi
cmpq %r13, %rdi
je 0x115c8
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x115e4
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3280
movl $0x78, %edi
callq 0x3270
movq %rax, %r12
movq 0x50(%r15), %rsi
addq $0x8, %rsi
leaq 0xa(%rsp), %rdi
callq 0xd170
leaq 0xa(%rsp), %rdx
movq %r12, %rdi
movl %ebx, %esi
movl $0x4, %ecx
movl $0x1, %r8d
callq 0x161ac
jmp 0x116e8
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0x6810
leaq 0x68(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq 0x58(%rsp), %rdi
callq 0x6810
addq $0x8, %r14
leaq 0x10(%rsp), %r8
leaq 0x58(%rsp), %r9
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
movl (%rsp), %ebx
movl %ebx, %ecx
callq 0xce38
movq 0x58(%rsp), %rdi
cmpq %r13, %rdi
je 0x11696
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x116b2
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3280
movl $0x78, %edi
callq 0x3270
movq %rax, %r12
movq 0x50(%r15), %rsi
addq $0x8, %rsi
leaq 0x4(%rsp), %rdi
callq 0xd170
leaq 0x4(%rsp), %rdx
movq %r12, %rdi
movl %ebx, %esi
movl $0x4, %ecx
xorl %r8d, %r8d
callq 0x161ac
leaq 0xd8(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x16384
movq 0x50(%r15), %rsi
movq 0x60(%r15), %rdi
addq $0x8, %rsi
movq (%rbx), %rcx
movl 0x8(%rbx), %r8d
movq 0x50(%rsp), %rdx
callq 0x6ed0
movq 0x58(%r12), %rdi
leaq 0x68(%r12), %rax
cmpq %rax, %rdi
je 0x11732
movq (%rax), %rsi
incq %rsi
callq 0x3280
movq 0x28(%r12), %rdi
leaq 0x38(%r12), %rax
cmpq %rax, %rdi
je 0x1174c
movq (%rax), %rsi
incq %rsi
callq 0x3280
movq 0x8(%r12), %rdi
leaq 0x18(%r12), %rax
cmpq %rax, %rdi
je 0x11766
movq (%rax), %rsi
incq %rsi
callq 0x3280
movl $0x78, %esi
movq %r12, %rdi
callq 0x3280
leaq 0xe8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x11794
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x3280
movl %ebp, %eax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x58(%rsp), %rdi
cmpq %r13, %rdi
je 0x117e6
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x117e6
movq %rax, %rbx
movq 0x78(%rsp), %rdi
cmpq %r13, %rdi
je 0x11806
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x11806
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1188b
movq 0x20(%rsp), %rsi
jmp 0x11883
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x1188b
movq 0x40(%rsp), %rsi
jmp 0x11883
movq %rax, %rbx
leaq 0xe8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1188b
movq 0xe8(%rsp), %rsi
jmp 0x11883
jmp 0x1183c
movq %rax, %rbx
movl $0x78, %esi
movq %r12, %rdi
jmp 0x11886
movq %rax, %rbx
movq 0x98(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1186e
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x1186e
movq %rax, %rbx
movq 0xb8(%rsp), %rdi
cmpq %r14, %rdi
je 0x1188b
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x3280
movq %rbx, %rdi
callq 0x3450
nop