// File: /workspace/github_cpp_makefile_star2_O2/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 $0x108, %rsp            # imm = 0x108
movl %r9d, 0x10(%rsp)
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, 0x20(%rsp)
movq %rdi, %r14
movq 0x48(%rdi), %rbx
leaq 0xc8(%rsp), %rdi
movq %rdx, %rsi
callq 0x3340
leaq 0xa8(%rsp), %rdi
movq %r12, %rsi
callq 0x3340
leaq 0xc8(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
movq %rbx, %rdi
callq 0xfbea
movl %eax, %r15d
leaq 0xa8(%rsp), %rdi
callq 0x3110
leaq 0xc8(%rsp), %rdi
callq 0x3110
movq 0x50(%r14), %rbx
movq 0x68(%r14), %rbp
movb %r15b, 0xf(%rsp)
testb %r15b, %r15b
je 0xd7ce
leaq 0x88(%rsp), %rdi
movq %r13, %rsi
callq 0x3340
leaq 0x68(%rsp), %rdi
movq %r12, %rsi
callq 0x3340
addq $0x8, %rbx
leaq 0x88(%rsp), %r8
leaq 0x68(%rsp), %r9
movq %rbp, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movl 0x10(%rsp), %ebx
movl %ebx, %ecx
callq 0x9972
leaq 0x68(%rsp), %rdi
callq 0x3110
leaq 0x88(%rsp), %rdi
callq 0x3110
pushq $0x78
popq %rdi
callq 0x3260
movq %rax, %r12
movq 0x50(%r14), %rsi
addq $0x8, %rsi
leaq 0x1a(%rsp), %rdi
callq 0x9f14
movb 0xf(%rsp), %bpl
leaq 0x1a(%rsp), %rdx
pushq $0x4
popq %rcx
pushq $0x1
popq %r8
movq %r12, %rdi
movl %ebx, %esi
callq 0x10e3a
jmp 0xd854
leaq 0x48(%rsp), %rdi
movq %r13, %rsi
callq 0x3340
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
callq 0x3340
addq $0x8, %rbx
leaq 0x48(%rsp), %r8
leaq 0x28(%rsp), %r9
movq %rbp, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movl 0x10(%rsp), %ebx
movl %ebx, %ecx
callq 0x9c4e
leaq 0x28(%rsp), %rdi
callq 0x3110
leaq 0x48(%rsp), %rdi
callq 0x3110
pushq $0x78
popq %rdi
callq 0x3260
movq %rax, %r12
movq 0x50(%r14), %rsi
addq $0x8, %rsi
leaq 0x14(%rsp), %rdi
callq 0x9f14
movb 0xf(%rsp), %bpl
leaq 0x14(%rsp), %rdx
pushq $0x4
popq %rcx
movq %r12, %rdi
movl %ebx, %esi
xorl %r8d, %r8d
callq 0x10e3a
leaq 0xe8(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x10fb8
movq 0x50(%r14), %rsi
movq 0x60(%r14), %rdi
addq $0x8, %rsi
movq (%rbx), %rcx
movl 0x8(%rbx), %r8d
movq 0x20(%rsp), %rdx
callq 0x56ee
movq %r12, %rdi
callq 0xe704
pushq $0x78
popq %rsi
movq %r12, %rdi
callq 0x3270
leaq 0xe8(%rsp), %rdi
callq 0x3110
movl %ebp, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3110
jmp 0xd8d9
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x3110
jmp 0xd8e3
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
jmp 0xd929
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
jmp 0xd929
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
jmp 0xd929
jmp 0xd8fc
movq %rax, %rbx
pushq $0x78
popq %rsi
movq %r12, %rdi
callq 0x3270
jmp 0xd92e
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x3110
jmp 0xd921
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0x3110
movq %rbx, %rdi
callq 0x3420