// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/htest.cpp
// Function: run_Khashl(GResUsage&, GPVec<HStrData>&, char const*)
void run_Khashl(GResUsage& swatch, GPVec<HStrData> & hstrs, const char* label) {
  int num_add=0, num_rm=0, num_clr=0;
  klib::KHashMapCached<const char*, int, cstr_hash, cstr_eq > khmap;
  GMessage("----------------- %s ----------------\n", label);
  swatch.start();
  int cl_i=0;
  int prevcmd=2;
  for (int i=0;i<hstrs.Count();i++) {
	  if (hstrs[i]->cmd==prevcmd) {
		  if (prevcmd==2) continue;
	  } else prevcmd=hstrs[i]->cmd;
	  switch (hstrs[i]->cmd) {
		case 0:if (cl_i==0) cl_i=i;
			khmap[hstrs[i]->str.chars()]=i; num_add++; break;
		case 1:if (qryMode) break;
			khmap.del(khmap.get(hstrs[i]->str.chars())); num_rm++; break;
		case 2:
			if (qryMode) {
				//run some query tests here
				for(int j=cl_i;j<i;j+=3) {
					if (hstrs[j]->cmd) continue;
					int v=khmap[hstrs[j]->str.chars()];
					if (v!=j)
						GError("Error at <%s>, invalid value for key %s!\n",label, hstrs[j]->str.chars() );
				}
			}
			cl_i=0;
			khmap.clear(); num_clr++; break;
	  }
  }
  swatch.stop();
  khmap.clear();
  GMessage("  (%d inserts, %d deletions, %d clears)\n", num_add, num_rm, num_clr);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r15
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
andq $0x0, 0x30(%rsp)
leaq 0x3806(%rip), %rdi      # 0xc4e1
movq %rdx, 0x40(%rsp)
movq %rdx, %rsi
xorl %eax, %eax
callq 0x2662
movq %rbx, %rdi
callq 0x8414
movq %rbx, 0x38(%rsp)
pushq $0x2
popq %r14
leaq 0x20(%rsp), %rbx
leaq 0x18(%rsp), %rbp
movl $0x0, 0xc(%rsp)
movl $0x0, 0x10(%rsp)
xorl %r13d, %r13d
xorl %r12d, %r12d
movl $0x0, 0x14(%rsp)
cmpl 0x10(%r15), %r12d
jge 0x8e97
movq %r15, %rdi
movl %r12d, %esi
callq 0x9cb8
movq (%rax), %rax
cmpl %r14d, (%rax)
jne 0x8d4f
cmpl $0x2, %r14d
jne 0x8d60
pushq $0x2
popq %r14
jmp 0x8e8f
movq %r15, %rdi
movl %r12d, %esi
callq 0x9cb8
movq (%rax), %rax
movl (%rax), %r14d
movq %r15, %rdi
movl %r12d, %esi
callq 0x9cb8
movq (%rax), %rax
movl (%rax), %eax
cmpl $0x2, %eax
je 0x8e05
cmpl $0x1, %eax
je 0x8dbf
testl %eax, %eax
jne 0x8e8f
testl %r13d, %r13d
cmovel %r12d, %r13d
movq %r15, %rdi
movl %r12d, %esi
callq 0x9cb8
movq (%rax), %rax
movq 0x28(%rax), %rax
addq $0xc, %rax
movq %rax, 0x18(%rsp)
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xa204
movl %r12d, (%rax)
incl 0x14(%rsp)
jmp 0x8e8f
cmpb $0x0, 0x949b(%rip)      # 0x12261
jne 0x8e8f
movq %r15, %rdi
movl %r12d, %esi
callq 0x9cb8
movq (%rax), %rax
movq 0x28(%rax), %rax
addq $0xc, %rax
movq %rax, 0x18(%rsp)
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xa30a
movq %rbx, %rdi
movl %eax, %esi
callq 0xa252
incl 0xc(%rsp)
jmp 0x8e8f
cmpb $0x1, 0x9455(%rip)      # 0x12261
jne 0x8e80
cmpl %r12d, %r13d
jge 0x8e80
movq %r15, %rdi
movl %r13d, %esi
callq 0x9cb8
movq (%rax), %rax
cmpl $0x0, (%rax)
jne 0x8e7a
movq %r15, %rdi
movl %r13d, %esi
callq 0x9cb8
movq (%rax), %rax
movq 0x28(%rax), %rax
addq $0xc, %rax
movq %rax, 0x18(%rsp)
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xa204
cmpl (%rax), %r13d
je 0x8e7a
movq %r15, %rdi
movl %r13d, %esi
callq 0x9cb8
movq (%rax), %rax
movq 0x28(%rax), %rdx
addq $0xc, %rdx
leaq 0x36d6(%rip), %rdi      # 0xc544
movq 0x40(%rsp), %rsi
xorl %eax, %eax
callq 0x25ca
addl $0x3, %r13d
jmp 0x8e0e
movq %rbx, %rdi
callq 0xa346
incl 0x10(%rsp)
xorl %r13d, %r13d
incl %r12d
jmp 0x8d23
movq 0x38(%rsp), %rdi
callq 0x84a0
leaq 0x20(%rsp), %rdi
callq 0xa346
leaq 0x36bc(%rip), %rdi      # 0xc56e
movl 0x14(%rsp), %esi
movl 0xc(%rsp), %edx
movl 0x10(%rsp), %ecx
xorl %eax, %eax
callq 0x2662
leaq 0x20(%rsp), %rdi
callq 0xa376
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8eec
jmp 0x8eec
jmp 0x8eec
jmp 0x8eec
jmp 0x8eec
jmp 0x8eec
jmp 0x8eec
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xa376
movq %rbx, %rdi
callq 0x2400