// File: /workspace/github_cpp_makefile_star2_O1/tonymuu[P]distributed-kv-store/Application.cpp
// Function: Application::deleteTest()
void Application::deleteTest() {
	int number;
	/**
	 * Test 1: Delete half the KV pairs
	 */
	cout<<endl<<"Deleting "<<testKVPairs.size()/2 <<" valid keys.... ... .. . ."<<endl;
	map<string, string>::iterator it = testKVPairs.begin();
	for ( int i = 0; i < (int)testKVPairs.size()/2; i++ ) {
		it++;

		// Step 1.a. Find a node that is alive
		number = findARandomNodeThatIsAlive();

		// Step 1.b. Issue a delete operation
		log->LOG(&mp2[number]->getMemberNode()->addr, "DELETE OPERATION KEY: %s VALUE: %s at time: %d", it->first.c_str(), it->second.c_str(), par->getcurrtime());
		mp2[number]->clientDelete(it->first);
	}

	/**
	 * Test 2: Delete a non-existent key
	 */
	cout<<endl<<"Deleting an invalid key.... ... .. . ."<<endl;
	string invalidKey = "invalidKey";
	// Step 2.a. Find a node that is alive
	number = findARandomNodeThatIsAlive();

	// Step 2.b. Issue a delete operation
	log->LOG(&mp2[number]->getMemberNode()->addr, "DELETE OPERATION KEY: %s at time: %d", invalidKey.c_str(), par->getcurrtime());
	mp2[number]->clientDelete(invalidKey);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, %rbx
movq 0x197b0(%rip), %r14     # 0x20fc8
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31c0
movq %rax, %r15
leaq 0x10b43(%rip), %rsi     # 0x1838c
movl $0x9, %edx
movq %rax, %rdi
callq 0x3310
movq 0x88(%rbx), %rsi
shrq %rsi
movq %r15, %rdi
callq 0x31b0
movq %rax, %r15
leaq 0x10b24(%rip), %rsi     # 0x18396
movl $0x1a, %edx
movq %rax, %rdi
callq 0x3310
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
movq %r15, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31c0
cmpl $0x2, 0x88(%rbx)
jl 0x798c
movq 0x78(%rbx), %r13
xorl %ebp, %ebp
movl %ebp, 0xc(%rsp)
movq %r13, %rdi
callq 0x31d0
movq %rax, %r13
callq 0x30a0
movq 0x48(%rbx), %rcx
movq 0x58(%rbx), %rdi
cltd
idivl 0x18(%rdi)
movslq %edx, %r12
movq (%rcx,%r12,8), %rax
movq 0x50(%rax), %rbp
cmpb $0x0, 0x10(%rbp)
jne 0x78c8
movq 0x38(%rbx), %r14
addq $0x8, %rbp
movq 0x20(%r13), %r15
movq 0x40(%r13), %rax
movq %rax, 0x30(%rsp)
callq 0xc962
movq %r14, %rdi
movq %rbp, %rsi
leaq 0x10aa0(%rip), %rdx     # 0x183b1
movq %r15, %rcx
movq 0x30(%rsp), %r8
movl %eax, %r9d
xorl %eax, %eax
callq 0xbc4c
movq 0x48(%rbx), %rax
movq (%rax,%r12,8), %r14
leaq 0x68(%rsp), %r15
movq %r15, 0x58(%rsp)
movq 0x20(%r13), %rsi
movq 0x28(%r13), %rdx
addq %rsi, %rdx
leaq 0x58(%rsp), %r12
movq %r12, %rdi
callq 0x5a48
movq %r14, %rdi
movq %r12, %rsi
callq 0x1076c
movq 0x58(%rsp), %rdi
cmpq %r15, %rdi
movl 0xc(%rsp), %ebp
je 0x7973
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x32c0
incl %ebp
movl 0x88(%rbx), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
cmpl %ecx, %ebp
jl 0x78b9
movq 0x19635(%rip), %r14     # 0x20fc8
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31c0
movq %rax, %r14
leaq 0x10a1c(%rip), %rsi     # 0x183e0
movl $0x26, %edx
movq %rax, %rdi
callq 0x3310
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31c0
leaq 0x20(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x109ff(%rip), %rsi     # 0x18407
leaq 0x10a02(%rip), %rdx     # 0x18411
leaq 0x10(%rsp), %rdi
callq 0xb686
callq 0x30a0
movq 0x48(%rbx), %rcx
movq 0x58(%rbx), %rdi
cltd
idivl 0x18(%rdi)
movslq %edx, %rbp
movq (%rcx,%rbp,8), %rax
movq 0x50(%rax), %r14
cmpb $0x0, 0x10(%r14)
jne 0x7a19
movq 0x38(%rbx), %r12
movq 0x10(%rsp), %r15
callq 0xc962
addq $0x8, %r14
leaq 0x109bd(%rip), %rdx     # 0x18412
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rcx
movl %eax, %r8d
xorl %eax, %eax
callq 0xbc4c
movq 0x48(%rbx), %rax
movq (%rax,%rbp,8), %rbx
leaq 0x48(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
leaq 0x38(%rsp), %rdi
callq 0x5a48
leaq 0x38(%rsp), %rsi
movq %rbx, %rdi
callq 0x1076c
movq 0x38(%rsp), %rdi
cmpq %r14, %rdi
je 0x7ab4
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x32c0
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x7acb
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x32c0
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x38(%rsp), %rdi
cmpq %r14, %rdi
je 0x7afe
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x32c0
jmp 0x7afe
movq %rax, %rbx
jmp 0x7b29
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x7b29
movq 0x20(%rsp), %rsi
jmp 0x7b21
movq %rax, %rbx
movq 0x58(%rsp), %rdi
cmpq %r15, %rdi
je 0x7b29
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x32c0
movq %rbx, %rdi
callq 0x34b0
nop