// File: /workspace/github_cpp_makefile_star2_O3/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 0x187c6(%rip), %r14     # 0x1ffc8
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 0xfb59(%rip), %rsi      # 0x1738c
movl $0x9, %edx
movq %rax, %rdi
callq 0x3310
movq 0x88(%rbx), %rsi
shrq %rsi
movq %r15, %rdi
callq 0x31b0
movq %rax, %r15
leaq 0xfb3a(%rip), %rsi      # 0x17396
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 0x7976
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 0x78b2
movq 0x38(%rbx), %r14
addq $0x8, %rbp
movq 0x20(%r13), %r15
movq 0x40(%r13), %rax
movq %rax, 0x30(%rsp)
callq 0xc87e
movq %r14, %rdi
movq %rbp, %rsi
leaq 0xfab6(%rip), %rdx      # 0x173b1
movq %r15, %rcx
movq 0x30(%rsp), %r8
movl %eax, %r9d
xorl %eax, %eax
callq 0xbbb8
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 0x5a4e
movq %r14, %rdi
movq %r12, %rsi
callq 0x10468
movq 0x58(%rsp), %rdi
cmpq %r15, %rdi
movl 0xc(%rsp), %ebp
je 0x795d
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 0x78a3
movq 0x1864b(%rip), %r14     # 0x1ffc8
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 0xfa32(%rip), %rsi      # 0x173e0
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 0xfa15(%rip), %rsi      # 0x17407
leaq 0xfa18(%rip), %rdx      # 0x17411
leaq 0x10(%rsp), %rdi
callq 0xb5ee
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 0x7a03
movq 0x38(%rbx), %r12
movq 0x10(%rsp), %r15
callq 0xc87e
addq $0x8, %r14
leaq 0xf9d3(%rip), %rdx      # 0x17412
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rcx
movl %eax, %r8d
xorl %eax, %eax
callq 0xbbb8
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 0x5a4e
leaq 0x38(%rsp), %rsi
movq %rbx, %rdi
callq 0x10468
movq 0x38(%rsp), %rdi
cmpq %r14, %rdi
je 0x7a9e
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x32c0
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x7ab5
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 0x7ae8
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x32c0
jmp 0x7ae8
movq %rax, %rbx
jmp 0x7b13
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x7b13
movq 0x20(%rsp), %rsi
jmp 0x7b0b
movq %rax, %rbx
movq 0x58(%rsp), %rdi
cmpq %r15, %rdi
je 0x7b13
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x32c0
movq %rbx, %rdi
callq 0x34b0
nop