// File: devanshdalal[P]cloud-computing-concepts-part-2/MP2Node.cpp
// Function: MP2Node::clientDelete(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void MP2Node::clientDelete(string key)
{
	int current = g_transID++;
	// std::cout << "Start clientDelete " << key << " " << current << "\n";
	auto nodes = findNodes(key);
	for (auto node_id = 0; node_id < nodes.size(); ++node_id)
	{
		auto req = Message(current, memberNode->addr, MessageType::DELETE, key);
		emulNet->ENsend(&(memberNode->addr), nodes[node_id].getAddress(), req.toString());
	}
	local_state_[current] = {MessageType::DELETE, key, "", par->getcurrtime() + WRITE_TIMEOUT, 0};
	// std::cout << "End clientDelete\n";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1f0, %rsp            # imm = 0x1F0
movq %rsi, -0x198(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x190(%rbp)
movl 0x245d1(%rip), %eax     # 0x4295c
movl %eax, %ecx
incl %ecx
movl %ecx, 0x245c7(%rip)     # 0x4295c
movl %eax, -0x14(%rbp)
leaq -0x50(%rbp), %rdi
movq %rdi, -0x188(%rbp)
callq 0x4150
movq -0x190(%rbp), %rsi
movq -0x188(%rbp), %rdx
leaq -0x30(%rbp), %rdi
callq 0x1d870
jmp 0x1e3c1
leaq -0x50(%rbp), %rdi
callq 0x41e0
movl $0x0, -0x60(%rbp)
movslq -0x60(%rbp), %rax
movq %rax, -0x1a0(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x12c90
movq %rax, %rcx
movq -0x1a0(%rbp), %rax
cmpq %rcx, %rax
jae 0x1e582
movq -0x190(%rbp), %rax
movl -0x14(%rbp), %ecx
movl %ecx, -0x1a4(%rbp)
movq 0x60(%rax), %rsi
addq $0x8, %rsi
leaq -0xde(%rbp), %rdi
callq 0x170d0
jmp 0x1e41e
movq -0x198(%rbp), %rsi
leaq -0x100(%rbp), %rdi
callq 0x4150
jmp 0x1e433
movl -0x1a4(%rbp), %esi
leaq -0xd8(%rbp), %rdi
leaq -0xde(%rbp), %rdx
movl $0x3, %ecx
leaq -0x100(%rbp), %r8
callq 0x288e0
jmp 0x1e45a
leaq -0x100(%rbp), %rdi
callq 0x41e0
movq -0x190(%rbp), %rcx
movq 0x60(%rcx), %rax
movq 0x70(%rcx), %rcx
movq %rcx, -0x1c0(%rbp)
addq $0x8, %rax
movq %rax, -0x1b8(%rbp)
movslq -0x60(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x15460
movq %rax, %rdi
callq 0x25a90
movq %rax, -0x1b0(%rbp)
jmp 0x1e4a5
leaq -0x120(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x28bb0
jmp 0x1e4ba
movq -0x1b0(%rbp), %rdx
movq -0x1b8(%rbp), %rsi
movq -0x1c0(%rbp), %rdi
leaq -0x120(%rbp), %rcx
callq 0xcce0
jmp 0x1e4dd
leaq -0x120(%rbp), %rdi
callq 0x41e0
leaq -0xd8(%rbp), %rdi
callq 0x21280
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x1e3d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x41e0
jmp 0x1e6fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x1e6f5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x41e0
jmp 0x1e6f5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x1e571
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x41e0
leaq -0xd8(%rbp), %rdi
callq 0x21280
jmp 0x1e6f5
movq -0x198(%rbp), %rsi
movl $0x3, -0x178(%rbp)
leaq -0x170(%rbp), %rdi
movq %rdi, -0x1c8(%rbp)
callq 0x4150
jmp 0x1e5a8
movb $0x1, -0x17a(%rbp)
leaq -0x150(%rbp), %rax
movq %rax, -0x1d8(%rbp)
leaq -0x179(%rbp), %rdi
movq %rdi, -0x1d0(%rbp)
callq 0x4580
movq -0x1d8(%rbp), %rdi
movq -0x1d0(%rbp), %rdx
leaq 0xbd61(%rip), %rsi      # 0x2a346
callq 0x12b10
jmp 0x1e5ec
movq -0x190(%rbp), %rax
leaq -0x130(%rbp), %rcx
movq %rcx, -0x1e8(%rbp)
movq 0x68(%rax), %rdi
callq 0x17080
movl %eax, -0x1dc(%rbp)
jmp 0x1e612
movq -0x190(%rbp), %rdi
movq -0x1e8(%rbp), %rax
movl -0x1dc(%rbp), %ecx
addl $0xf, %ecx
movl %ecx, (%rax)
movq $0x0, -0x128(%rbp)
movb $0x0, -0x17a(%rbp)
subq $-0x80, %rdi
leaq -0x14(%rbp), %rsi
callq 0x212c0
movq %rax, -0x1f0(%rbp)
jmp 0x1e653
movq -0x1f0(%rbp), %rdi
leaq -0x178(%rbp), %rsi
callq 0x213a0
leaq -0x178(%rbp), %rdi
callq 0x21410
leaq -0x179(%rbp), %rdi
callq 0x4370
leaq -0x30(%rbp), %rdi
callq 0x12c30
addq $0x1f0, %rsp            # imm = 0x1F0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x1e6d0
movq -0x1d8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
callq 0x41e0
jmp 0x1e6d0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x178(%rbp), %rdi
callq 0x21410
leaq -0x179(%rbp), %rdi
callq 0x4370
testb $0x1, -0x17a(%rbp)
jne 0x1e6e7
jmp 0x1e6f3
movq -0x1c8(%rbp), %rdi
callq 0x41e0
jmp 0x1e6f5
leaq -0x30(%rbp), %rdi
callq 0x12c30
movq -0x58(%rbp), %rdi
callq 0x4570
nopw (%rax,%rax)