// File: 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
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
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 -0x58(%rbp), %rdi
xorl %esi, %esi
movl %esi, -0x84(%rbp)
callq 0x10d10
movl -0x84(%rbp), %eax
movq -0x18(%rbp), %rsi
leaq 0x62c3(%rip), %rdi      # 0x144d1
callq 0x26f0
jmp 0xe215
movl $0x0, -0x68(%rbp)
movq -0x8(%rbp), %rdi
callq 0xcf80
jmp 0xe227
movl $0x2, -0x6c(%rbp)
movl $0x0, -0x70(%rbp)
movl -0x70(%rbp), %eax
movl %eax, -0x8c(%rbp)
movq -0x10(%rbp), %rdi
callq 0x10250
movl %eax, -0x88(%rbp)
jmp 0xe24f
movl -0x8c(%rbp), %eax
movl -0x88(%rbp), %ecx
cmpl %ecx, %eax
jge 0xe588
movq -0x10(%rbp), %rdi
movl -0x70(%rbp), %esi
callq 0x10270
movq %rax, -0x98(%rbp)
jmp 0xe278
movq -0x98(%rbp), %rax
movq (%rax), %rax
movl (%rax), %eax
cmpl -0x6c(%rbp), %eax
jne 0xe2b0
cmpl $0x2, -0x6c(%rbp)
jne 0xe2ae
jmp 0xe57a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x10ec0
jmp 0xe5c9
jmp 0xe2d4
movq -0x10(%rbp), %rdi
movl -0x70(%rbp), %esi
callq 0x10270
movq %rax, -0xa0(%rbp)
jmp 0xe2c5
movq -0xa0(%rbp), %rax
movq (%rax), %rax
movl (%rax), %eax
movl %eax, -0x6c(%rbp)
movq -0x10(%rbp), %rdi
movl -0x70(%rbp), %esi
callq 0x10270
movq %rax, -0xa8(%rbp)
jmp 0xe2e9
movq -0xa8(%rbp), %rax
movq (%rax), %rax
movl (%rax), %eax
movl %eax, -0xac(%rbp)
testl %eax, %eax
je 0xe322
jmp 0xe301
movl -0xac(%rbp), %eax
subl $0x1, %eax
je 0xe382
jmp 0xe30e
movl -0xac(%rbp), %eax
subl $0x2, %eax
je 0xe447
jmp 0xe578
cmpl $0x0, -0x68(%rbp)
jne 0xe32e
movl -0x70(%rbp), %eax
movl %eax, -0x68(%rbp)
movq -0x10(%rbp), %rdi
movl -0x70(%rbp), %esi
callq 0x10270
movq %rax, -0xb8(%rbp)
jmp 0xe343
movq -0xb8(%rbp), %rax
movq (%rax), %rdi
addq $0x8, %rdi
callq 0xb610
movq %rax, -0xc0(%rbp)
jmp 0xe35f
movq -0xc0(%rbp), %rsi
movl -0x70(%rbp), %edx
leaq -0x58(%rbp), %rdi
callq 0x10d50
jmp 0xe374
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xe578
testb $0x1, 0xbee0(%rip)      # 0x1a269
je 0xe390
jmp 0xe578
movq -0x10(%rbp), %rdi
movl -0x70(%rbp), %esi
callq 0x10270
movq %rax, -0xc8(%rbp)
jmp 0xe3a5
movq -0xc8(%rbp), %rax
movq (%rax), %rdi
addq $0x8, %rdi
callq 0xb610
movq %rax, -0xd0(%rbp)
jmp 0xe3c1
movq -0xd0(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0x10dc0
movl %eax, -0xd4(%rbp)
jmp 0xe3d9
movl -0xd4(%rbp), %eax
cmpl $0x0, %eax
jge 0xe439
testb $0x1, 0xbe7f(%rip)      # 0x1a26a
je 0xe437
movq -0x10(%rbp), %rdi
movl -0x70(%rbp), %esi
callq 0x10270
movq %rax, -0xe0(%rbp)
jmp 0xe402
movq -0xe0(%rbp), %rax
movq (%rax), %rdi
addq $0x8, %rdi
callq 0xb610
movq %rax, -0xe8(%rbp)
jmp 0xe41e
movq -0xe8(%rbp), %rsi
leaq 0x615b(%rip), %rdi      # 0x14587
xorl %eax, %eax
callq 0x26f0
jmp 0xe435
jmp 0xe437
jmp 0xe439
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xe578
testb $0x1, 0xbe1b(%rip)      # 0x1a269
je 0xe55d
movl -0x68(%rbp), %eax
movl %eax, -0x74(%rbp)
movl -0x74(%rbp), %eax
cmpl -0x70(%rbp), %eax
jge 0xe55b
movq -0x10(%rbp), %rdi
movl -0x74(%rbp), %esi
callq 0x10270
movq %rax, -0xf0(%rbp)
jmp 0xe47b
movq -0xf0(%rbp), %rax
movq (%rax), %rax
cmpl $0x0, (%rax)
je 0xe48f
jmp 0xe54d
movq -0x10(%rbp), %rdi
movl -0x74(%rbp), %esi
callq 0x10270
movq %rax, -0xf8(%rbp)
jmp 0xe4a4
movq -0xf8(%rbp), %rax
movq (%rax), %rdi
addq $0x8, %rdi
callq 0xb610
movq %rax, -0x100(%rbp)
jmp 0xe4c0
movq -0x100(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0x10e30
movq %rax, -0x108(%rbp)
jmp 0xe4d9
movq -0x108(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movl (%rax), %eax
cmpl -0x74(%rbp), %eax
je 0xe54b
movq -0x18(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x10(%rbp), %rdi
movl -0x74(%rbp), %esi
callq 0x10270
movq %rax, -0x110(%rbp)
jmp 0xe50f
movq -0x110(%rbp), %rax
movq (%rax), %rdi
addq $0x8, %rdi
callq 0xb610
movq %rax, -0x120(%rbp)
jmp 0xe52b
movq -0x120(%rbp), %rdx
movq -0x118(%rbp), %rsi
leaq 0x5ff4(%rip), %rdi      # 0x14534
xorl %eax, %eax
callq 0x2640
jmp 0xe549
jmp 0xe54b
jmp 0xe54d
movl -0x74(%rbp), %eax
addl $0x3, %eax
movl %eax, -0x74(%rbp)
jmp 0xe45a
jmp 0xe55d
movl $0x0, -0x68(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x10ea0
jmp 0xe56f
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xe57a
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0xe235
movq -0x8(%rbp), %rdi
callq 0xd060
jmp 0xe593
leaq -0x58(%rbp), %rdi
callq 0x10ea0
jmp 0xe59e
movl -0x1c(%rbp), %esi
movl -0x20(%rbp), %edx
movl -0x24(%rbp), %ecx
leaq 0x5fb0(%rip), %rdi      # 0x1455e
xorl %eax, %eax
callq 0x26f0
jmp 0xe5b7
leaq -0x58(%rbp), %rdi
callq 0x10ec0
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x2400
nopw %cs:(%rax,%rax)