// File: 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
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
movl %esi, -0x74(%rbp)
callq 0x10f00
movl -0x74(%rbp), %eax
movq -0x18(%rbp), %rsi
leaq 0x5ea9(%rip), %rdi      # 0x144d1
callq 0x26f0
jmp 0xe62f
movl $0x0, -0x58(%rbp)
movq -0x8(%rbp), %rdi
callq 0xcf80
jmp 0xe641
movl $0x2, -0x5c(%rbp)
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
movl %eax, -0x7c(%rbp)
movq -0x10(%rbp), %rdi
callq 0x10250
movl %eax, -0x78(%rbp)
jmp 0xe663
movl -0x7c(%rbp), %eax
movl -0x78(%rbp), %ecx
cmpl %ecx, %eax
jge 0xe996
movq -0x10(%rbp), %rdi
movl -0x60(%rbp), %esi
callq 0x10270
movq %rax, -0x88(%rbp)
jmp 0xe686
movq -0x88(%rbp), %rax
movq (%rax), %rax
movl (%rax), %eax
cmpl -0x5c(%rbp), %eax
jne 0xe6be
cmpl $0x2, -0x5c(%rbp)
jne 0xe6bc
jmp 0xe988
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x11090
jmp 0xe9d7
jmp 0xe6e2
movq -0x10(%rbp), %rdi
movl -0x60(%rbp), %esi
callq 0x10270
movq %rax, -0x90(%rbp)
jmp 0xe6d3
movq -0x90(%rbp), %rax
movq (%rax), %rax
movl (%rax), %eax
movl %eax, -0x5c(%rbp)
movq -0x10(%rbp), %rdi
movl -0x60(%rbp), %esi
callq 0x10270
movq %rax, -0x98(%rbp)
jmp 0xe6f7
movq -0x98(%rbp), %rax
movq (%rax), %rax
movl (%rax), %eax
movl %eax, -0x9c(%rbp)
testl %eax, %eax
je 0xe730
jmp 0xe70f
movl -0x9c(%rbp), %eax
subl $0x1, %eax
je 0xe790
jmp 0xe71c
movl -0x9c(%rbp), %eax
subl $0x2, %eax
je 0xe855
jmp 0xe986
cmpl $0x0, -0x58(%rbp)
jne 0xe73c
movl -0x60(%rbp), %eax
movl %eax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
movl -0x60(%rbp), %esi
callq 0x10270
movq %rax, -0xa8(%rbp)
jmp 0xe751
movq -0xa8(%rbp), %rax
movq (%rax), %rdi
addq $0x8, %rdi
callq 0xb610
movq %rax, -0xb0(%rbp)
jmp 0xe76d
movq -0xb0(%rbp), %rsi
movl -0x60(%rbp), %edx
leaq -0x48(%rbp), %rdi
callq 0x10f40
jmp 0xe782
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xe986
testb $0x1, 0xbad2(%rip)      # 0x1a269
je 0xe79e
jmp 0xe986
movq -0x10(%rbp), %rdi
movl -0x60(%rbp), %esi
callq 0x10270
movq %rax, -0xb8(%rbp)
jmp 0xe7b3
movq -0xb8(%rbp), %rax
movq (%rax), %rdi
addq $0x8, %rdi
callq 0xb610
movq %rax, -0xc0(%rbp)
jmp 0xe7cf
movq -0xc0(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x10fb0
movl %eax, -0xc4(%rbp)
jmp 0xe7e7
movl -0xc4(%rbp), %eax
cmpl $0x0, %eax
jge 0xe847
testb $0x1, 0xba71(%rip)      # 0x1a26a
je 0xe845
movq -0x10(%rbp), %rdi
movl -0x60(%rbp), %esi
callq 0x10270
movq %rax, -0xd0(%rbp)
jmp 0xe810
movq -0xd0(%rbp), %rax
movq (%rax), %rdi
addq $0x8, %rdi
callq 0xb610
movq %rax, -0xd8(%rbp)
jmp 0xe82c
movq -0xd8(%rbp), %rsi
leaq 0x5d4d(%rip), %rdi      # 0x14587
xorl %eax, %eax
callq 0x26f0
jmp 0xe843
jmp 0xe845
jmp 0xe847
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xe986
testb $0x1, 0xba0d(%rip)      # 0x1a269
je 0xe96b
movl -0x58(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
cmpl -0x60(%rbp), %eax
jge 0xe969
movq -0x10(%rbp), %rdi
movl -0x64(%rbp), %esi
callq 0x10270
movq %rax, -0xe0(%rbp)
jmp 0xe889
movq -0xe0(%rbp), %rax
movq (%rax), %rax
cmpl $0x0, (%rax)
je 0xe89d
jmp 0xe95b
movq -0x10(%rbp), %rdi
movl -0x64(%rbp), %esi
callq 0x10270
movq %rax, -0xe8(%rbp)
jmp 0xe8b2
movq -0xe8(%rbp), %rax
movq (%rax), %rdi
addq $0x8, %rdi
callq 0xb610
movq %rax, -0xf0(%rbp)
jmp 0xe8ce
movq -0xf0(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x11010
movq %rax, -0xf8(%rbp)
jmp 0xe8e7
movq -0xf8(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movl (%rax), %eax
cmpl -0x64(%rbp), %eax
je 0xe959
movq -0x18(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x10(%rbp), %rdi
movl -0x64(%rbp), %esi
callq 0x10270
movq %rax, -0x100(%rbp)
jmp 0xe91d
movq -0x100(%rbp), %rax
movq (%rax), %rdi
addq $0x8, %rdi
callq 0xb610
movq %rax, -0x110(%rbp)
jmp 0xe939
movq -0x110(%rbp), %rdx
movq -0x108(%rbp), %rsi
leaq 0x5be6(%rip), %rdi      # 0x14534
xorl %eax, %eax
callq 0x2640
jmp 0xe957
jmp 0xe959
jmp 0xe95b
movl -0x64(%rbp), %eax
addl $0x3, %eax
movl %eax, -0x64(%rbp)
jmp 0xe868
jmp 0xe96b
movl $0x0, -0x58(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x11070
jmp 0xe97d
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xe988
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0xe64f
movq -0x8(%rbp), %rdi
callq 0xd060
jmp 0xe9a1
leaq -0x48(%rbp), %rdi
callq 0x11070
jmp 0xe9ac
movl -0x1c(%rbp), %esi
movl -0x20(%rbp), %edx
movl -0x24(%rbp), %ecx
leaq 0x5ba2(%rip), %rdi      # 0x1455e
xorl %eax, %eax
callq 0x26f0
jmp 0xe9c5
leaq -0x48(%rbp), %rdi
callq 0x11090
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x2400