// File: /workspace/github_cpp_makefile_star2_O2/gpertea[P]gclib/htest.cpp
// Function: run_GHashMap(GResUsage&, GPVec<HStrData>&, char const*)
void run_GHashMap(GResUsage& swatch, GPVec<HStrData> & hstrs, const char* label) {
  int num_add=0, num_rm=0, num_clr=0;
  //GKHashSet<const char*> khset;
  //GHashSet<> khset;
  //GHash<int, cstr_hash, GHashKey_Eq<const char*>, uint32_t> khset;
  GHashMap<const char*, int> 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 $0x58, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x39(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
leaq 0x35b0(%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 0x90e7
movq %r15, %rdi
movl %ebp, %esi
callq 0x9cb8
movq (%rax), %rax
cmpl %r13d, (%rax)
jne 0x8f99
cmpl $0x2, %r13d
jne 0x8fa9
pushq $0x2
popq %r13
jmp 0x90e0
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 0x9060
cmpl $0x1, %eax
je 0x8ffd
testl %eax, %eax
jne 0x90e0
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 0xa38e
incl 0x14(%rsp)
jmp 0x90e0
cmpb $0x0, 0x925d(%rip)      # 0x12261
jne 0x90e0
movq %r15, %rdi
movl %ebp, %esi
callq 0x9cb8
movq (%rax), %rax
movq 0x28(%rax), %rsi
addq $0xc, %rsi
movq %rbx, %rdi
callq 0xa3da
testl %eax, %eax
jns 0x9057
cmpb $0x1, 0x9230(%rip)      # 0x12262
jne 0x9057
movq %r15, %rdi
movl %ebp, %esi
callq 0x9cb8
movq (%rax), %rax
movq 0x28(%rax), %rsi
addq $0xc, %rsi
leaq 0x3547(%rip), %rdi      # 0xc597
xorl %eax, %eax
callq 0x2662
incl 0xc(%rsp)
jmp 0x90e0
cmpb $0x1, 0x91fa(%rip)      # 0x12261
jne 0x90d1
cmpl %ebp, %r12d
jge 0x90d1
movq %r15, %rdi
movl %r12d, %esi
callq 0x9cb8
movq (%rax), %rax
cmpl $0x0, (%rax)
jne 0x90cb
movq %r15, %rdi
movl %r12d, %esi
callq 0x9cb8
movq (%rax), %rax
movq 0x28(%rax), %rsi
addq $0xc, %rsi
movq %rbx, %rdi
callq 0xa426
cmpl (%rax), %r12d
je 0x90cb
movq %r15, %rdi
movl %r12d, %esi
callq 0x9cb8
movq (%rax), %rax
movq 0x28(%rax), %rdx
addq $0xc, %rdx
leaq 0x3483(%rip), %rdi      # 0xc544
movq %r14, %rsi
xorl %eax, %eax
callq 0x25ca
addl $0x3, %r12d
jmp 0x9069
movq %rbx, %rdi
callq 0xb674
incl 0x10(%rsp)
xorl %r12d, %r12d
incl %ebp
jmp 0x8f6e
movq 0x18(%rsp), %rdi
callq 0x84a0
leaq 0x20(%rsp), %rdi
callq 0xb674
leaq 0x346c(%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 0xa470
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9138
jmp 0x9138
jmp 0x9138
jmp 0x9138
jmp 0x9138
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xa470
movq %rbx, %rdi
callq 0x2400