// File: zkl94[P]distributed-key-value-store/MP2Node.cpp
// Function: MP2Node::deletekey(Address, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, MessageType)
bool MP2Node::deletekey(Address fromAddr, string key, int transID, MessageType t) {
    // Delete the key from the local hash table
    bool success = this->ht->deleteKey(key);
    Message *message;
    if (success) {
        log->logDeleteSuccess(&(this->memberNode->addr), false, transID, key);
        message = new Message(transID, this->memberNode->addr, REPLY, true);
    } else {
        log->logDeleteFail(&(this->memberNode->addr), false, transID, key);
        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
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rdx, -0x108(%rbp)
movq %rsi, %rax
movq -0x108(%rbp), %rsi
movq %rax, -0x100(%rbp)
movq %rsi, -0xf8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rax, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq 0x48(%rax), %rax
movq %rax, -0xe8(%rbp)
leaq -0x48(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
callq 0x4150
movq -0xe8(%rbp), %rdi
movq -0xe0(%rbp), %rsi
callq 0x23b60
movb %al, -0xd1(%rbp)
jmp 0x1cd8e
leaq -0x48(%rbp), %rdi
callq 0x41e0
movb -0xd1(%rbp), %al
andb $0x1, %al
movb %al, -0x21(%rbp)
testb $0x1, -0x21(%rbp)
je 0x1cee0
movq -0xf8(%rbp), %rsi
movq -0xf0(%rbp), %rcx
movq 0x50(%rcx), %rax
movq 0x68(%rcx), %rcx
movq %rcx, -0x128(%rbp)
addq $0x8, %rax
movq %rax, -0x120(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x114(%rbp)
leaq -0x80(%rbp), %rdi
movq %rdi, -0x110(%rbp)
callq 0x4150
movq -0x128(%rbp), %rdi
movq -0x120(%rbp), %rsi
movl -0x114(%rbp), %ecx
movq -0x110(%rbp), %r8
xorl %edx, %edx
callq 0x14880
jmp 0x1ce11
leaq -0x80(%rbp), %rdi
callq 0x41e0
movl $0x78, %edi
callq 0x4310
movq %rax, %rcx
movq -0xf0(%rbp), %rax
movq %rcx, -0x138(%rbp)
movl -0x1c(%rbp), %ecx
movl %ecx, -0x12c(%rbp)
movq 0x50(%rax), %rsi
addq $0x8, %rsi
leaq -0x86(%rbp), %rdi
callq 0x15070
jmp 0x1ce54
movl -0x12c(%rbp), %esi
movq -0x138(%rbp), %rdi
leaq -0x86(%rbp), %rdx
movl $0x4, %ecx
movl $0x1, %r8d
callq 0x267a0
jmp 0x1ce7a
movq -0x138(%rbp), %rax
movq %rax, -0x60(%rbp)
jmp 0x1cffd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x41e0
jmp 0x1d0e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x41e0
jmp 0x1d0e6
movq -0x138(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
movl $0x78, %esi
callq 0x4320
jmp 0x1d0e6
movq -0xf8(%rbp), %rsi
movq -0xf0(%rbp), %rcx
movq 0x50(%rcx), %rax
movq 0x68(%rcx), %rcx
movq %rcx, -0x158(%rbp)
addq $0x8, %rax
movq %rax, -0x150(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x144(%rbp)
leaq -0xa8(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x4150
movq -0x158(%rbp), %rdi
movq -0x150(%rbp), %rsi
movl -0x144(%rbp), %ecx
movq -0x140(%rbp), %r8
xorl %edx, %edx
callq 0x14d40
jmp 0x1cf48
leaq -0xa8(%rbp), %rdi
callq 0x41e0
movl $0x78, %edi
callq 0x4310
movq %rax, %rcx
movq -0xf0(%rbp), %rax
movq %rcx, -0x168(%rbp)
movl -0x1c(%rbp), %ecx
movl %ecx, -0x15c(%rbp)
movq 0x50(%rax), %rsi
addq $0x8, %rsi
leaq -0xae(%rbp), %rdi
callq 0x15070
jmp 0x1cf8e
movl -0x15c(%rbp), %esi
movq -0x168(%rbp), %rdi
leaq -0xae(%rbp), %rdx
movl $0x4, %ecx
xorl %r8d, %r8d
callq 0x267a0
jmp 0x1cfb1
movq -0x168(%rbp), %rax
movq %rax, -0x60(%rbp)
jmp 0x1cffd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x41e0
jmp 0x1d0e6
movq -0x168(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
movl $0x78, %esi
callq 0x4320
jmp 0x1d0e6
movq -0x60(%rbp), %rsi
leaq -0xd0(%rbp), %rdi
movq %rdi, -0x188(%rbp)
callq 0x26980
movq -0xf0(%rbp), %rcx
movq -0x188(%rbp), %rdi
movq 0x50(%rcx), %rax
movq 0x60(%rcx), %rcx
movq %rcx, -0x180(%rbp)
addq $0x8, %rax
movq %rax, -0x178(%rbp)
callq 0x4140
movq -0x188(%rbp), %rdi
movq %rax, -0x170(%rbp)
callq 0x4220
movq -0x180(%rbp), %rdi
movq -0x178(%rbp), %rsi
movq -0x100(%rbp), %rdx
movq -0x170(%rbp), %rcx
movl %eax, %r8d
callq 0xac80
jmp 0x1d07a
movq -0x60(%rbp), %rax
movq %rax, -0x190(%rbp)
cmpq $0x0, %rax
je 0x1d0a8
movq -0x190(%rbp), %rdi
callq 0x1ea70
movq -0x190(%rbp), %rdi
movl $0x78, %esi
callq 0x4320
movb -0x21(%rbp), %al
movb %al, -0x191(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x41e0
movb -0x191(%rbp), %al
andb $0x1, %al
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x41e0
movq -0x50(%rbp), %rdi
callq 0x4550
nop