// File: /workspace/github_cpp_makefile_star2_O2/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, %r13
movq 0x15c16(%rip), %rdi     # 0x1cfc0
callq 0x3140
leaq 0xbfde(%rip), %rsi      # 0x13394
movq %rax, %rdi
callq 0x3290
movq 0x88(%r13), %rsi
shrq %rsi
movq %rax, %rdi
callq 0x31c0
leaq 0xbfc7(%rip), %rsi      # 0x1339e
movq %rax, %rdi
callq 0x3290
movq %rax, %rdi
callq 0x3140
movq 0x78(%r13), %r15
xorl %esi, %esi
movl 0x88(%r13), %eax
cltd
pushq $0x2
popq %rcx
idivl %ecx
cmpl %eax, %esi
jge 0x74a6
movl %esi, 0x4(%rsp)
movq %r15, %rdi
callq 0x31d0
movq %rax, %r15
movq %r13, %rdi
callq 0x94fc
movq 0x38(%r13), %rcx
movq %rcx, 0x8(%rsp)
movq 0x48(%r13), %rcx
movslq %eax, %r14
movq (%rcx,%r14,8), %rax
movq 0x50(%rax), %rbp
addq $0x8, %rbp
leaq 0x20(%r15), %rax
movq %rax, 0x10(%rsp)
movq 0x20(%r15), %r12
movq 0x40(%r15), %rbx
movq 0x58(%r13), %rdi
callq 0xabe4
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
leaq 0xbf5b(%rip), %rdx      # 0x133b9
movq %r12, %rcx
movq %rbx, %r8
movl %eax, %r9d
xorl %eax, %eax
callq 0xa106
movq 0x48(%r13), %rax
movq (%rax,%r14,8), %rbx
leaq 0x58(%rsp), %r14
movq %r14, %rdi
movq 0x10(%rsp), %rsi
callq 0x33a0
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe0a8
movq %r14, %rdi
callq 0x3120
movl 0x4(%rsp), %esi
incl %esi
jmp 0x73ed
movq 0x15b13(%rip), %rdi     # 0x1cfc0
callq 0x3140
leaq 0xbf2f(%rip), %rsi      # 0x133e8
movq %rax, %rdi
callq 0x3290
movq %rax, %rdi
callq 0x3140
leaq 0xbf3f(%rip), %rsi      # 0x1340f
leaq 0x18(%rsp), %rdi
leaq 0x3(%rsp), %rdx
callq 0x4bc2
movq %r13, %rdi
callq 0x94fc
movq 0x38(%r13), %r14
movq 0x48(%r13), %rcx
movslq %eax, %rbx
movq (%rcx,%rbx,8), %rax
movq 0x50(%rax), %r12
movq 0x18(%rsp), %r15
movq 0x58(%r13), %rdi
callq 0xabe4
addq $0x8, %r12
leaq 0xbf07(%rip), %rdx      # 0x1341a
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rcx
movl %eax, %r8d
xorl %eax, %eax
callq 0xa106
movq 0x48(%r13), %rax
movq (%rax,%rbx,8), %rbx
leaq 0x38(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x33a0
leaq 0x38(%rsp), %rsi
movq %rbx, %rdi
callq 0xe0a8
leaq 0x38(%rsp), %rdi
callq 0x3120
leaq 0x18(%rsp), %rdi
callq 0x3120
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x3120
jmp 0x7584
movq %rax, %rbx
jmp 0x7598
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
jmp 0x7593
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x3120
movq %rbx, %rdi
callq 0x3490