// File: /workspace/github_cpp_makefile_star2_O1/devanshdalal[P]cloud-computing-concepts-part-2/MP2Node.cpp
// Function: MP2Node::updateKeyValue(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, ReplicaType)
bool MP2Node::updateKeyValue(string key, string value, ReplicaType replica)
{
	/*
	 * Implement this
	 */
	// Update key in local hash table and return true or false
	switch (replica)
	{
	case ReplicaType::PRIMARY:
	{
		return ht->update(key, value);
	}
	case ReplicaType::SECONDARY:
	{
		return secondary->update(key, value);
	}
	case ReplicaType::TERTIARY:
	{
		return tertiary->update(key, value);
	}
	default:
		break;
	}
	return false;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdx, %rbx
cmpl $0x2, %ecx
je 0x116b0
cmpl $0x1, %ecx
je 0x11630
testl %ecx, %ecx
jne 0x11734
movq 0x48(%rdi), %r14
leaq 0xb8(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
leaq 0xa8(%rsp), %rdi
movq %rax, %rsi
callq 0xbb34
leaq 0x58(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %rdi
callq 0xbb34
leaq 0xa8(%rsp), %rsi
leaq 0x48(%rsp), %rdx
movq %r14, %rdi
callq 0x14dac
movl %eax, %ebx
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x11623
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0xa8(%rsp), %rdi
jmp 0x11722
movq 0x50(%rdi), %r14
leaq 0x98(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
leaq 0x88(%rsp), %rdi
movq %rax, %rsi
callq 0xbb34
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0xbb34
leaq 0x88(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %r14, %rdi
callq 0x14dac
movl %eax, %ebx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x116a6
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x88(%rsp), %rdi
jmp 0x11722
movq 0x58(%rdi), %r14
leaq 0x78(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
leaq 0x68(%rsp), %rdi
movq %rax, %rsi
callq 0xbb34
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0xbb34
leaq 0x68(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
callq 0x14dac
movl %eax, %ebx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x1171d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3280
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x11736
movq (%r15), %rsi
incq %rsi
callq 0x3280
jmp 0x11736
xorl %ebx, %ebx
movl %ebx, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x1179e
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x1179e
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x117ab
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x117ab
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x117b5
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3280
jmp 0x117b5
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
jmp 0x117bd
movq %rax, %rbx
movq 0x68(%rsp), %rdi
jmp 0x117bd
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r15, %rdi
je 0x117cd
movq (%r15), %rsi
incq %rsi
callq 0x3280
movq %rbx, %rdi
callq 0x3470
nop