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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rsi, 0x10(%rsp)
movq %rdi, %rbx
movl 0x1819f(%rip), %eax     # 0x288ac
leal 0x1(%rax), %ecx
movl %ecx, 0x18196(%rip)     # 0x288ac
movl %eax, 0x4(%rsp)
movq 0xf8af(%rip), %r15      # 0x1ffd0
leaq 0x85b8(%rip), %rsi      # 0x18ce0
movl $0x11, %edx
movq %r15, %rdi
callq 0x32d0
movq %rbx, 0x8(%rsp)
movq 0x60(%rbx), %rsi
addq $0x8, %rsi
leaq 0x30(%rsp), %r12
movq %r12, %rdi
callq 0xb51c
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %r15, %rdi
callq 0x32d0
leaq 0x7b4f(%rip), %rsi      # 0x182b6
movl $0x1, %edx
movq %rax, %rdi
callq 0x32d0
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1078f
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x8(%rsp), %rbx
leaq 0x30(%rbx), %rsi
leaq 0x110(%rsp), %r15
movq %r15, %rdi
callq 0x13ae4
movq %r15, %rdi
callq 0xebac
leaq 0x110(%rsp), %rdi
callq 0xb860
leaq 0x100(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x10(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0xf0(%rsp), %r15
movq %r15, %rdi
callq 0xbb34
leaq 0x18(%rsp), %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x103c0
movq 0xf0(%rsp), %rdi
cmpq %r12, %rdi
je 0x10816
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x20(%rsp), %rax
cmpq 0x18(%rsp), %rax
je 0x10a43
xorl %r13d, %r13d
leaq 0xd0(%rsp), %r14
xorl %ebx, %ebx
movl $0xe, %edx
movq 0xf791(%rip), %rdi      # 0x1ffd0
leaq 0x84ac(%rip), %rsi      # 0x18cf2
callq 0x32d0
movq 0x18(%rsp), %rdi
addq %r13, %rdi
callq 0x14cc4
leaq 0x30(%rsp), %rdi
movq %rax, %rsi
callq 0xb51c
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq 0xf75a(%rip), %rdi      # 0x1ffd0
callq 0x32d0
movq %rax, %r12
movl $0x5, %edx
movq %rax, %rdi
leaq 0x84c3(%rip), %rsi      # 0x18d50
callq 0x32d0
movq 0x10(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %r12, %rdi
callq 0x32d0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7a40(%rip), %rsi      # 0x182f5
callq 0x32d0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x108d6
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3280
movl 0x4(%rsp), %ebp
movq 0x8(%rsp), %rax
movq 0x60(%rax), %rsi
addq $0x8, %rsi
leaq 0xaa(%rsp), %rdi
callq 0xce50
leaq 0xb0(%rsp), %r15
leaq 0xc0(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0x10(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0xbb34
leaq 0x30(%rsp), %rdi
movl %ebp, %esi
leaq 0xaa(%rsp), %rdx
movl $0x1, %ecx
movq %r15, %r8
callq 0x16930
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x10964
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x8(%rsp), %rax
movq 0x60(%rax), %rbp
movq 0x70(%rax), %r12
movq 0x18(%rsp), %rdi
addq %r13, %rdi
callq 0x14cc4
movq %rax, %r15
movq %r14, %rdi
leaq 0x30(%rsp), %rsi
callq 0x16bf4
addq $0x8, %rbp
movq %r12, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x6b8c
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x109c8
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x109ed
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x10a09
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x10a25
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x20(%rsp), %rax
subq 0x18(%rsp), %rax
incq %rbx
sarq $0x5, %rax
addq $0x20, %r13
cmpq %rbx, %rax
ja 0x10833
leaq 0x38(%rsp), %r15
movl $0x1, -0x8(%r15)
leaq 0x48(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x10(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0xbb34
leaq 0x58(%rsp), %r14
leaq 0x68(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x7870(%rip), %rdx      # 0x182f6
movq %r14, %rdi
movq %rdx, %rsi
callq 0xbf70
movq 0x8(%rsp), %rbx
movq 0x68(%rbx), %rdi
callq 0xce42
addl $0xf, %eax
movl %eax, 0x78(%rsp)
movq $0x0, 0x80(%rsp)
subq $-0x80, %rbx
leaq 0x4(%rsp), %rsi
movq %rbx, %rdi
callq 0x13a48
movq %rax, %rbx
leaq 0x78(%rsp), %rbp
movl -0x48(%rbp), %eax
movl %eax, (%rbx)
leaq 0x8(%rbx), %rdi
movq %r15, %rsi
callq 0x3340
movq %rbx, %rdi
addq $0x28, %rdi
movq %r14, %rsi
callq 0x3340
movups (%rbp), %xmm0
movups %xmm0, 0x48(%rbx)
movq -0x20(%rbp), %rdi
cmpq %r13, %rdi
je 0x10b09
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x38(%rsp), %rdi
cmpq %r12, %rdi
je 0x10b20
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3280
leaq 0x18(%rsp), %rdi
callq 0xb860
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x13aac
xorl %ebp, %ebp
jmp 0x10b72
movq %rax, %rbx
movq 0x58(%rsp), %rdi
movb $0x1, %bpl
cmpq %r13, %rdi
je 0x10b72
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x10b72
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x10c70
movq 0x38(%rsp), %rdi
cmpq %r12, %rdi
je 0x10c70
movq 0x48(%rsp), %rsi
jmp 0x10c68
jmp 0x10c4c
movq %rax, %rbx
movq 0xf0(%rsp), %rdi
cmpq %r12, %rdi
je 0x10c7a
movq 0x100(%rsp), %rsi
jmp 0x10be0
movq %rax, %rbx
leaq 0x110(%rsp), %rdi
jmp 0x10c75
movq %rax, %rbx
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10c7a
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x10c7a
jmp 0x10c4c
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x10c70
movq 0xc0(%rsp), %rsi
jmp 0x10c68
movq %rax, %rbx
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x10c3e
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x10c3e
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x139f8
jmp 0x10c70
jmp 0x10c4c
movq %rax, %rbx
jmp 0x10c70
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x10c70
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3280
leaq 0x18(%rsp), %rdi
callq 0xb860
movq %rbx, %rdi
callq 0x3470