// File: gpertea[P]gclib/./GHash.hh
// Function: old::GHash<int>::Find(char const*, char**)
OBJ* GHash<OBJ>::Find(const char* ky, char** keyptr){
	int p,x,h,n;
	if(!ky){ GError("GHash::find: NULL key argument.\n"); }
	if (fCount==0) return NULL;
	h=GSTR_HASH(ky);
	GASSERT(0<=h);
	p=HASH1(h,fCapacity);
	GASSERT(0<=p && p<fCapacity);
	x=HASH2(h,fCapacity);
	GASSERT(1<=x && x<fCapacity);
	GASSERT(fCount<fCapacity);
	n=fCapacity;
#ifdef HASH_DBG_PRINT
	int iterations=0;
	int init_p=p;
	int init_x=x;
#endif
	while(n && hash[p].hash!=-1){
		if(hash[p].hash==h && strcmp(hash[p].key,ky)==0){
			if (keyptr!=NULL) *keyptr = hash[p].key;
#ifdef HASH_DBG_PRINT
			GMessage("Found \t%s\t%d,%d,%d\t%d\t%d\t%d\n",
					ky, h,init_p,init_x, iterations,  fCount, fCapacity);
#endif
			return (OBJ*)hash[p].data;
		}
		p=(p+x)%fCapacity;
		n--;
#ifdef HASH_DBG_PRINT
		++iterations;
#endif
	}
#ifdef HASH_DBG_PRINT
	GMessage("Nfound\t%s\t%d,%d,%d\t%d\t%d\t%d\n",
			ky, h,init_p,init_x, iterations,  fCount, fCapacity);
#endif
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x119a1
leaq 0x2ea4(%rip), %rdi      # 0x1483e
movb $0x0, %al
callq 0x2640
movq -0x38(%rbp), %rax
cmpl $0x0, 0x14(%rax)
jne 0x119b8
movq $0x0, -0x8(%rbp)
jmp 0x11b75
movq -0x18(%rbp), %rdi
callq 0x4a80
movl %eax, -0x2c(%rbp)
xorl %eax, %eax
cmpl -0x2c(%rbp), %eax
jg 0x119cd
jmp 0x119e5
leaq 0x2da1(%rip), %rdi      # 0x14775
leaq 0x2d8f(%rip), %rsi      # 0x1476a
movl $0x1c7, %edx            # imm = 0x1C7
callq 0x25e0
movq -0x38(%rbp), %rcx
imull $0xd, -0x2c(%rbp), %eax
xorl %edx, %edx
divl 0x10(%rcx)
movl %edx, -0x24(%rbp)
xorl %eax, %eax
cmpl -0x24(%rbp), %eax
jg 0x11a0a
movq -0x38(%rbp), %rcx
movl -0x24(%rbp), %eax
cmpl 0x10(%rcx), %eax
jge 0x11a0a
jmp 0x11a22
leaq 0x2d69(%rip), %rdi      # 0x1477a
leaq 0x2d52(%rip), %rsi      # 0x1476a
movl $0x1c9, %edx            # imm = 0x1C9
callq 0x25e0
movq -0x38(%rbp), %rcx
imull $0x11, -0x2c(%rbp), %eax
movl 0x10(%rcx), %ecx
subl $0x1, %ecx
xorl %edx, %edx
divl %ecx
orl $0x1, %edx
movl %edx, -0x28(%rbp)
movl $0x1, %eax
cmpl -0x28(%rbp), %eax
jg 0x11a52
movq -0x38(%rbp), %rcx
movl -0x28(%rbp), %eax
cmpl 0x10(%rcx), %eax
jge 0x11a52
jmp 0x11a6a
leaq 0x2d35(%rip), %rdi      # 0x1478e
leaq 0x2d0a(%rip), %rsi      # 0x1476a
movl $0x1cb, %edx            # imm = 0x1CB
callq 0x25e0
movq -0x38(%rbp), %rcx
movl 0x14(%rcx), %eax
cmpl 0x10(%rcx), %eax
jge 0x11a78
jmp 0x11a90
leaq 0x2cda(%rip), %rdi      # 0x14759
leaq 0x2ce4(%rip), %rsi      # 0x1476a
movl $0x1cc, %edx            # imm = 0x1CC
callq 0x25e0
movq -0x38(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x30(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x30(%rbp)
movb %al, -0x39(%rbp)
je 0x11ac2
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpl $-0x1, 0xc(%rax)
setne %al
movb %al, -0x39(%rbp)
movb -0x39(%rbp), %al
testb $0x1, %al
jne 0x11ace
jmp 0x11b6d
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
cmpl -0x2c(%rbp), %eax
jne 0x11b4e
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x2350
cmpl $0x0, %eax
jne 0x11b4e
cmpq $0x0, -0x20(%rbp)
je 0x11b31
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x11b75
movq -0x38(%rbp), %rcx
movl -0x24(%rbp), %eax
addl -0x28(%rbp), %eax
cltd
idivl 0x10(%rcx)
movl %edx, -0x24(%rbp)
movl -0x30(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x11a9a
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop