// File: tonymuu[P]distributed-kv-store/MP2Node.cpp
// Function: MP2Node::clientDelete(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void MP2Node::clientDelete(string key){
    // start a transaction
    Transaction transaction(DELETE, par->getcurrtime());
    transaction.key = key;
    txMap.emplace(transaction.txId, transaction);

    // send messages to all nodes who should hold the key
    auto nodes = findNodes(key);
    int txId = transaction.txId;
    for (int i = 0; i < nodes.size(); i++) {
        auto node = nodes[i];
        Message msg(txId, memberNode->addr, DELETE, key);
        msg.replica = static_cast<ReplicaType>(i);
        sendMessage(node.nodeAddress, msg);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x240, %rsp            # imm = 0x240
movq %rsi, -0x210(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x218(%rbp)
movq 0x58(%rax), %rdi
callq 0x18c60
movl %eax, %edx
leaq -0x68(%rbp), %rdi
movl $0x3, %esi
callq 0x21950
movq -0x210(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x4050
jmp 0x1fbb0
movq -0x218(%rbp), %rdi
addq $0xc0, %rdi
leaq -0x60(%rbp), %rsi
leaq -0x68(%rbp), %rdx
callq 0x21f40
movb %dl, -0x221(%rbp)
movq %rax, -0x220(%rbp)
jmp 0x1fbda
movq -0x210(%rbp), %rsi
movb -0x221(%rbp), %al
movq -0x220(%rbp), %rcx
movq %rcx, -0x88(%rbp)
movb %al, -0x80(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x4160
jmp 0x1fc06
movq -0x218(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
leaq -0xc0(%rbp), %rdx
callq 0x1f030
jmp 0x1fc22
leaq -0xc0(%rbp), %rdi
callq 0x4200
movl -0x60(%rbp), %eax
movl %eax, -0xc4(%rbp)
movl $0x0, -0xc8(%rbp)
movslq -0xc8(%rbp), %rax
movq %rax, -0x230(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x150e0
movq %rax, %rcx
movq -0x230(%rbp), %rax
cmpq %rcx, %rax
jae 0x1fe34
movslq -0xc8(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
callq 0x16ff0
movq %rax, %rsi
leaq -0xe8(%rbp), %rdi
callq 0x26240
jmp 0x1fc92
movq -0x218(%rbp), %rax
movl -0xc4(%rbp), %ecx
movl %ecx, -0x234(%rbp)
movq 0x50(%rax), %rsi
addq $0x8, %rsi
leaq -0x166(%rbp), %rdi
callq 0x18e40
jmp 0x1fcbb
movq -0x210(%rbp), %rsi
leaq -0x188(%rbp), %rdi
callq 0x4160
jmp 0x1fcd0
movl -0x234(%rbp), %esi
leaq -0x160(%rbp), %rdi
leaq -0x166(%rbp), %rdx
movl $0x3, %ecx
leaq -0x188(%rbp), %r8
callq 0x2a760
jmp 0x1fcf7
leaq -0x188(%rbp), %rdi
callq 0x4200
movl -0xc8(%rbp), %eax
movl %eax, -0x15c(%rbp)
leaq -0xe0(%rbp), %rsi
leaq -0x18e(%rbp), %rdi
callq 0x18e40
jmp 0x1fd24
leaq -0x208(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0x2a530
jmp 0x1fd39
movq -0x218(%rbp), %rdi
leaq -0x18e(%rbp), %rsi
leaq -0x208(%rbp), %rdx
callq 0x1f440
jmp 0x1fd55
leaq -0x208(%rbp), %rdi
callq 0x21f90
leaq -0x160(%rbp), %rdi
callq 0x21f90
leaq -0xe8(%rbp), %rdi
callq 0x26200
movl -0xc8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc8(%rbp)
jmp 0x1fc41
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x1fe5e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x4200
jmp 0x1fe5e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x1fe52
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x1fe26
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x188(%rbp), %rdi
callq 0x4200
jmp 0x1fe26
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x1fe1a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x208(%rbp), %rdi
callq 0x21f90
leaq -0x160(%rbp), %rdi
callq 0x21f90
leaq -0xe8(%rbp), %rdi
callq 0x26200
jmp 0x1fe52
leaq -0xa0(%rbp), %rdi
callq 0x15080
leaq -0x68(%rbp), %rdi
callq 0x21fd0
addq $0x240, %rsp            # imm = 0x240
popq %rbp
retq
leaq -0xa0(%rbp), %rdi
callq 0x15080
leaq -0x68(%rbp), %rdi
callq 0x21fd0
movq -0x70(%rbp), %rdi
callq 0x45b0