// File: gpertea[P]gclib/htest.cpp
// Function: run_GHash(GResUsage&, GPVec<HStrData>&, char const*)
void run_GHash(GResUsage& swatch, GPVec<HStrData> & hstrs, const char* label) {
	old::GHash<int> ghash; // @suppress("Type cannot be resolved")
	int num_add=0, num_rm=0, num_clr=0;
	GMessage("----------------- %s ----------------\n", label);
	ghash.Clear();
	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;
					ghash.fAdd(hstrs[i]->str.chars(), new int(i));
					num_add++;
					break;
				case 1:
					if (qryMode) break;
					ghash.Remove(hstrs[i]->str.chars());
					num_rm++;
					break;
				case 2:
					//run tests here
					if (qryMode) {
						//run some query tests here
						for(int j=cl_i;j<i;j+=3) {
							if (hstrs[j]->cmd) continue;
							int* v=ghash[hstrs[j]->str.chars()];
							if (v==NULL)
								GError("Error at <%s>, key %s not found (count:%d, cl_i=%d, i=%d)!\n",label, hstrs[j]->str.chars(),
										ghash.Count(), cl_i, i );
							if (*v!=j)
								GError("Error at <%s>, invalid value for key %s!\n",label, hstrs[j]->str.chars() );
						}
					}
					cl_i=0;
					ghash.Clear();
					num_clr++;
					break;
			  }
	}
	swatch.stop();
	ghash.Clear();
	GMessage("  (%d inserts, %d deletions, %d clears)\n", num_add, num_rm, num_clr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0x48(%rbp), %rdi
movl $0x1, %esi
callq 0x10060
movl $0x0, -0x4c(%rbp)
movl $0x0, -0x50(%rbp)
movl $0x0, -0x54(%rbp)
movq -0x18(%rbp), %rsi
leaq 0x6b0c(%rip), %rdi      # 0x144d1
xorl %eax, %eax
callq 0x26f0
jmp 0xd9ce
leaq -0x48(%rbp), %rdi
callq 0x10120
jmp 0xd9d9
movq -0x8(%rbp), %rdi
callq 0xcf80
jmp 0xd9e4
movl $0x0, -0x68(%rbp)
movl $0x2, -0x6c(%rbp)
movl $0x0, -0x70(%rbp)
movl -0x70(%rbp), %eax
movl %eax, -0x88(%rbp)
movq -0x10(%rbp), %rdi
callq 0x10250
movl %eax, -0x84(%rbp)
jmp 0xda13
movl -0x88(%rbp), %eax
movl -0x84(%rbp), %ecx
cmpl %ecx, %eax
jge 0xdd88
movq -0x10(%rbp), %rdi
movl -0x70(%rbp), %esi
callq 0x10270
movq %rax, -0x90(%rbp)
jmp 0xda3c
movq -0x90(%rbp), %rax
movq (%rax), %rax
movl (%rax), %eax
cmpl -0x6c(%rbp), %eax
jne 0xda74
cmpl $0x2, -0x6c(%rbp)
jne 0xda72
jmp 0xdd7a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x10990
jmp 0xddc9
jmp 0xda98
movq -0x10(%rbp), %rdi
movl -0x70(%rbp), %esi
callq 0x10270
movq %rax, -0x98(%rbp)
jmp 0xda89
movq -0x98(%rbp), %rax
movq (%rax), %rax
movl (%rax), %eax
movl %eax, -0x6c(%rbp)
movq -0x10(%rbp), %rdi
movl -0x70(%rbp), %esi
callq 0x10270
movq %rax, -0xa0(%rbp)
jmp 0xdaad
movq -0xa0(%rbp), %rax
movq (%rax), %rax
movl (%rax), %eax
movl %eax, -0xa4(%rbp)
testl %eax, %eax
je 0xdaea
jmp 0xdac5
movl -0xa4(%rbp), %eax
subl $0x1, %eax
je 0xdb66
jmp 0xdad6
movl -0xa4(%rbp), %eax
subl $0x2, %eax
je 0xdbc5
jmp 0xdd78
cmpl $0x0, -0x68(%rbp)
jne 0xdaf6
movl -0x70(%rbp), %eax
movl %eax, -0x68(%rbp)
movq -0x10(%rbp), %rdi
movl -0x70(%rbp), %esi
callq 0x10270
movq %rax, -0xb0(%rbp)
jmp 0xdb0b
movq -0xb0(%rbp), %rax
movq (%rax), %rdi
addq $0x8, %rdi
callq 0xb610
movq %rax, -0xb8(%rbp)
jmp 0xdb27
movl $0x4, %edi
callq 0x2260
movq %rax, -0xc0(%rbp)
jmp 0xdb3a
movq -0xc0(%rbp), %rdx
movq -0xb8(%rbp), %rsi
movl -0x70(%rbp), %eax
movl %eax, (%rdx)
leaq -0x48(%rbp), %rdi
callq 0x102d0
jmp 0xdb58
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0xdd78
testb $0x1, 0xc6fc(%rip)      # 0x1a269
je 0xdb74
jmp 0xdd78
movq -0x10(%rbp), %rdi
movl -0x70(%rbp), %esi
callq 0x10270
movq %rax, -0xc8(%rbp)
jmp 0xdb89
movq -0xc8(%rbp), %rax
movq (%rax), %rdi
addq $0x8, %rdi
callq 0xb610
movq %rax, -0xd0(%rbp)
jmp 0xdba5
movq -0xd0(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x10650
jmp 0xdbb7
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0xdd78
testb $0x1, 0xc69d(%rip)      # 0x1a269
je 0xdd5d
movl -0x68(%rbp), %eax
movl %eax, -0x74(%rbp)
movl -0x74(%rbp), %eax
cmpl -0x70(%rbp), %eax
jge 0xdd5b
movq -0x10(%rbp), %rdi
movl -0x74(%rbp), %esi
callq 0x10270
movq %rax, -0xd8(%rbp)
jmp 0xdbf9
movq -0xd8(%rbp), %rax
movq (%rax), %rax
cmpl $0x0, (%rax)
je 0xdc0d
jmp 0xdd4d
movq -0x10(%rbp), %rdi
movl -0x74(%rbp), %esi
callq 0x10270
movq %rax, -0xe0(%rbp)
jmp 0xdc22
movq -0xe0(%rbp), %rax
movq (%rax), %rdi
addq $0x8, %rdi
callq 0xb610
movq %rax, -0xe8(%rbp)
jmp 0xdc3e
movq -0xe8(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x10940
movq %rax, -0xf0(%rbp)
jmp 0xdc57
movq -0xf0(%rbp), %rax
movq %rax, -0x80(%rbp)
cmpq $0x0, -0x80(%rbp)
jne 0xdce4
movq -0x18(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x10(%rbp), %rdi
movl -0x74(%rbp), %esi
callq 0x10270
movq %rax, -0xf8(%rbp)
jmp 0xdc89
movq -0xf8(%rbp), %rax
movq (%rax), %rdi
addq $0x8, %rdi
callq 0xb610
movq %rax, -0x108(%rbp)
jmp 0xdca5
leaq -0x48(%rbp), %rdi
callq 0x10970
movl %eax, -0x10c(%rbp)
jmp 0xdcb6
movl -0x10c(%rbp), %ecx
movq -0x108(%rbp), %rdx
movq -0x100(%rbp), %rsi
movl -0x68(%rbp), %r8d
movl -0x70(%rbp), %r9d
leaq 0x681f(%rip), %rdi      # 0x144f8
xorl %eax, %eax
callq 0x2640
jmp 0xdce2
jmp 0xdce4
movq -0x80(%rbp), %rax
movl (%rax), %eax
cmpl -0x74(%rbp), %eax
je 0xdd4b
movq -0x18(%rbp), %rax
movq %rax, -0x120(%rbp)
movq -0x10(%rbp), %rdi
movl -0x74(%rbp), %esi
callq 0x10270
movq %rax, -0x118(%rbp)
jmp 0xdd0f
movq -0x118(%rbp), %rax
movq (%rax), %rdi
addq $0x8, %rdi
callq 0xb610
movq %rax, -0x128(%rbp)
jmp 0xdd2b
movq -0x128(%rbp), %rdx
movq -0x120(%rbp), %rsi
leaq 0x67f4(%rip), %rdi      # 0x14534
xorl %eax, %eax
callq 0x2640
jmp 0xdd49
jmp 0xdd4b
jmp 0xdd4d
movl -0x74(%rbp), %eax
addl $0x3, %eax
movl %eax, -0x74(%rbp)
jmp 0xdbd8
jmp 0xdd5d
movl $0x0, -0x68(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x10120
jmp 0xdd6f
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0xdd7a
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0xd9f9
movq -0x8(%rbp), %rdi
callq 0xd060
jmp 0xdd93
leaq -0x48(%rbp), %rdi
callq 0x10120
jmp 0xdd9e
movl -0x4c(%rbp), %esi
movl -0x50(%rbp), %edx
movl -0x54(%rbp), %ecx
leaq 0x67b0(%rip), %rdi      # 0x1455e
xorl %eax, %eax
callq 0x26f0
jmp 0xddb7
leaq -0x48(%rbp), %rdi
callq 0x10990
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x2400
nopw %cs:(%rax,%rax)