// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/htest.cpp
// Function: run_GxxHashMap(GResUsage&, GPVec<HStrData>&, char const*)
void run_GxxHashMap(GResUsage& swatch, GPVec<HStrData> & hstrs, const char* label) {
  int num_add=0, num_rm=0, num_clr=0;
  //GHash<int> khset;
  GHashMap<const char*, int, GHashKey_xxHash32<const char*>,
          GHashKey_Eq<const char*>, uint32_t > khset;
  GMessage("----------------- %s ----------------\n", label);
  int cl_i=0;
  swatch.start();
  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;
			khset.Add(hstrs[i]->str.chars(), i); num_add++; break;
		case 1:if (qryMode) break;
			if (khset.Remove(hstrs[i]->str.chars())<0)
				if (checkRM) GMessage("Warning: key %s could not be removed!\n", hstrs[i]->str.chars());
			num_rm++;
			break;
		case 2:
			if (qryMode) {
				//run some query tests here
				//with strings from hstrs[cl_i .. i-1] range
				for(int j=cl_i;j<i;j+=3) {
					if (hstrs[j]->cmd) continue;
					int* v=khset[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;
			khset.Clear(); num_clr++; break;
	  }
  }
  swatch.stop();
  khset.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 %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x2d(%rsp)
movaps %xmm0, 0x20(%rsp)
leaq 0x3369(%rip), %rdi      # 0xc4e1
movq %rdx, %rsi
xorl %eax, %eax
callq 0x2662
movq %rbx, 0x18(%rsp)
movq %rbx, %rdi
callq 0x8414
pushq $0x2
popq %r13
leaq 0x20(%rsp), %rbx
movl $0x0, 0xc(%rsp)
movl $0x0, 0x10(%rsp)
xorl %r12d, %r12d
xorl %ebp, %ebp
movl $0x0, 0x14(%rsp)
cmpl 0x10(%r15), %ebp
jge 0x932e
movq %r15, %rdi
movl %ebp, %esi
callq 0x9cb8
movq (%rax), %rax
cmpl %r13d, (%rax)
jne 0x91e0
cmpl $0x2, %r13d
jne 0x91f0
pushq $0x2
popq %r13
jmp 0x9327
movq %r15, %rdi
movl %ebp, %esi
callq 0x9cb8
movq (%rax), %rax
movl (%rax), %r13d
movq %r15, %rdi
movl %ebp, %esi
callq 0x9cb8
movq (%rax), %rax
movl (%rax), %eax
cmpl $0x2, %eax
je 0x92a7
cmpl $0x1, %eax
je 0x9244
testl %eax, %eax
jne 0x9327
testl %r12d, %r12d
cmovel %ebp, %r12d
movq %r15, %rdi
movl %ebp, %esi
callq 0x9cb8
movq (%rax), %rax
movq 0x28(%rax), %rsi
addq $0xc, %rsi
movq %rbx, %rdi
movl %ebp, %edx
callq 0xa48a
incl 0x14(%rsp)
jmp 0x9327
cmpb $0x0, 0x9016(%rip)      # 0x12261
jne 0x9327
movq %r15, %rdi
movl %ebp, %esi
callq 0x9cb8
movq (%rax), %rax
movq 0x28(%rax), %rsi
addq $0xc, %rsi
movq %rbx, %rdi
callq 0xa4d8
testl %eax, %eax
jns 0x929e
cmpb $0x1, 0x8fe9(%rip)      # 0x12262
jne 0x929e
movq %r15, %rdi
movl %ebp, %esi
callq 0x9cb8
movq (%rax), %rax
movq 0x28(%rax), %rsi
addq $0xc, %rsi
leaq 0x3300(%rip), %rdi      # 0xc597
xorl %eax, %eax
callq 0x2662
incl 0xc(%rsp)
jmp 0x9327
cmpb $0x1, 0x8fb3(%rip)      # 0x12261
jne 0x9318
cmpl %ebp, %r12d
jge 0x9318
movq %r15, %rdi
movl %r12d, %esi
callq 0x9cb8
movq (%rax), %rax
cmpl $0x0, (%rax)
jne 0x9312
movq %r15, %rdi
movl %r12d, %esi
callq 0x9cb8
movq (%rax), %rax
movq 0x28(%rax), %rsi
addq $0xc, %rsi
movq %rbx, %rdi
callq 0xa51c
cmpl (%rax), %r12d
je 0x9312
movq %r15, %rdi
movl %r12d, %esi
callq 0x9cb8
movq (%rax), %rax
movq 0x28(%rax), %rdx
addq $0xc, %rdx
leaq 0x323c(%rip), %rdi      # 0xc544
movq %r14, %rsi
xorl %eax, %eax
callq 0x25ca
addl $0x3, %r12d
jmp 0x92b0
movq %rbx, %rdi
callq 0xbc98
incl 0x10(%rsp)
xorl %r12d, %r12d
incl %ebp
jmp 0x91b5
movq 0x18(%rsp), %rdi
callq 0x84a0
leaq 0x20(%rsp), %rdi
callq 0xbc98
leaq 0x3225(%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 0xa564
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x937f
jmp 0x937f
jmp 0x937f
jmp 0x937f
jmp 0x937f
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xa564
movq %rbx, %rdi
callq 0x2400