// File: /workspace/github_cpp_makefile_star2_O3/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 $0x138, %rsp            # imm = 0x138
movq %rsi, 0x10(%rsp)
movq %rdi, %rbx
movl 0x18465(%rip), %ecx     # 0x288ac
leal 0x1(%rcx), %eax
movl %eax, 0x1845c(%rip)     # 0x288ac
movq %rcx, 0xd8(%rsp)
movl %ecx, 0x1c(%rsp)
movq 0xfb6d(%rip), %r15      # 0x1ffd0
leaq 0x8836(%rip), %rsi      # 0x18ca0
movl $0x11, %edx
movq %r15, %rdi
callq 0x32d0
movq %rbx, 0x8(%rsp)
movq 0x60(%rbx), %rsi
addq $0x8, %rsi
leaq 0x38(%rsp), %r12
movq %r12, %rdi
callq 0xb42e
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %r15, %rdi
callq 0x32d0
leaq 0x7e0d(%rip), %rsi      # 0x182b6
movl $0x1, %edx
movq %rax, %rdi
callq 0x32d0
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x104d1
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x8(%rsp), %rbx
leaq 0x30(%rbx), %rsi
leaq 0x120(%rsp), %r15
movq %r15, %rdi
callq 0x13816
movq %r15, %rdi
callq 0xe87c
leaq 0x120(%rsp), %rdi
callq 0xb770
leaq 0x110(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x10(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x100(%rsp), %r15
movq %r15, %rdi
callq 0xba52
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x100fa
movq 0x100(%rsp), %rdi
cmpq %r12, %rdi
je 0x10558
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x28(%rsp), %rax
cmpq 0x20(%rsp), %rax
je 0x10786
xorl %ebp, %ebp
leaq 0xe0(%rsp), %r14
xorl %ebx, %ebx
movl $0xe, %edx
movq 0xfa50(%rip), %rdi      # 0x1ffd0
leaq 0x872b(%rip), %rsi      # 0x18cb2
callq 0x32d0
movq 0x20(%rsp), %rdi
addq %rbp, %rdi
callq 0x14a0c
leaq 0x38(%rsp), %rdi
movq %rax, %rsi
callq 0xb42e
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq 0xfa19(%rip), %rdi      # 0x1ffd0
callq 0x32d0
movq %rax, %r15
movl $0x5, %edx
movq %rax, %rdi
leaq 0x8742(%rip), %rsi      # 0x18d10
callq 0x32d0
movq 0x10(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %r15, %rdi
callq 0x32d0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7cff(%rip), %rsi      # 0x182f5
callq 0x32d0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x10617
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x8(%rsp), %rax
movq 0x60(%rax), %rsi
addq $0x8, %rsi
leaq 0xb2(%rsp), %rdi
callq 0xcd2c
leaq 0xb8(%rsp), %r15
leaq 0xc8(%rsp), %rax
movq %rax, 0xb8(%rsp)
movq 0x10(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0xba52
leaq 0x38(%rsp), %rdi
movq 0xd8(%rsp), %rsi
leaq 0xb2(%rsp), %rdx
movl $0x1, %ecx
movq %r15, %r8
callq 0x16654
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x106a7
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x8(%rsp), %rax
movq 0x60(%rax), %r13
movq 0x70(%rax), %r15
movq 0x20(%rsp), %rdi
addq %rbp, %rdi
callq 0x14a0c
movq %rax, %r12
movq %r14, %rdi
leaq 0x38(%rsp), %rsi
callq 0x16918
addq $0x8, %r13
movq %r15, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r14, %rcx
callq 0x6b44
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x1070b
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x10730
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x1074c
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x10768
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x28(%rsp), %rax
subq 0x20(%rsp), %rax
incq %rbx
sarq $0x5, %rax
addq $0x20, %rbp
cmpq %rbx, %rax
ja 0x10574
leaq 0x40(%rsp), %r15
movl $0x1, -0x8(%r15)
leaq 0x50(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x10(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0xba52
leaq 0x60(%rsp), %r14
leaq 0x70(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x7b2d(%rip), %rdx      # 0x182f6
movq %r14, %rdi
movq %rdx, %rsi
callq 0xbe94
movq 0x8(%rsp), %rbx
movq 0x68(%rbx), %rdi
callq 0xcd1e
addl $0xf, %eax
movl %eax, 0x80(%rsp)
movq $0x0, 0x88(%rsp)
subq $-0x80, %rbx
leaq 0x1c(%rsp), %rsi
movq %rbx, %rdi
callq 0x13778
movq %rax, %rbx
leaq 0x80(%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 0x10852
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x10869
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x3280
leaq 0x20(%rsp), %rdi
callq 0xb770
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x137de
jmp 0x109ab
movq %rax, %rbx
movq 0x60(%rsp), %rdi
cmpq %r13, %rdi
je 0x108b6
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x108b6
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x109ab
movq 0x50(%rsp), %rsi
jmp 0x109a3
jmp 0x10987
movq %rax, %rbx
movq 0x100(%rsp), %rdi
cmpq %r12, %rdi
je 0x109b5
movq 0x110(%rsp), %rsi
jmp 0x1091b
movq %rax, %rbx
leaq 0x120(%rsp), %rdi
jmp 0x109b0
movq %rax, %rbx
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x109b5
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x109b5
jmp 0x10987
movq %rax, %rbx
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x109ab
movq 0xc8(%rsp), %rsi
jmp 0x109a3
movq %rax, %rbx
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x10979
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x10979
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x13728
jmp 0x109ab
jmp 0x10987
movq %rax, %rbx
jmp 0x109ab
movq %rax, %rbx
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x109ab
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3280
leaq 0x20(%rsp), %rdi
callq 0xb770
movq %rbx, %rdi
callq 0x3470
nop