// File: /workspace/github_c_makefile_star2_O0/haxlang[P]hax/haxHash.c
// Function: ArrayCreate
static Hax_HashEntry *
ArrayCreate(
    Hax_Interp *interp,
    Hax_HashTable *tablePtr,	/* Table in which to lookup entry. */
    char *key,			/* Key to use to find or create matching
				 * entry. */
    int *newPtr			/* Store info here telling whether a new
				 * entry was created. */)
{
    Interp *iPtr = (Interp *) interp;
    Hax_Memoryp *memoryp = iPtr->memoryp;
    Hax_HashEntry *hPtr;
    int *arrayPtr = (int *) key;
    int *iPtr1, *iPtr2;
    int index, count;

    for (index = 0, count = tablePtr->keyType, iPtr1 = arrayPtr;
	    count > 0; count--, iPtr1++) {
	index += *iPtr1;
    }
    index = RANDOM_INDEX(tablePtr, index);

    /*
     * Search all of the entries in the appropriate bucket.
     */

    for (hPtr = tablePtr->buckets[index]; hPtr != NULL;
	    hPtr = hPtr->nextPtr) {
	for (iPtr1 = arrayPtr, iPtr2 = hPtr->key.words,
		count = tablePtr->keyType; ; count--, iPtr1++, iPtr2++) {
	    if (count == 0) {
		*newPtr = 0;
		return hPtr;
	    }
	    if (*iPtr1 != *iPtr2) {
		break;
	    }
	}
    }

    /*
     * Entry not found.  Add a new one to the bucket.
     */

    *newPtr = 1;
    hPtr = (Hax_HashEntry *) ckalloc(memoryp, (unsigned) (sizeof(Hax_HashEntry)
	    + (tablePtr->keyType*sizeof(int)) - 4));
    hPtr->tablePtr = tablePtr;
    hPtr->bucketPtr = &(tablePtr->buckets[index]);
    hPtr->nextPtr = *hPtr->bucketPtr;
    hPtr->clientData = 0;
    for (iPtr1 = arrayPtr, iPtr2 = hPtr->key.words, count = tablePtr->keyType;
	    count > 0; count--, iPtr1++, iPtr2++) {
	*iPtr2 = *iPtr1;
    }
    *hPtr->bucketPtr = hPtr;
    tablePtr->numEntries++;

    /*
     * If the table has exceeded a decent size, rebuild it with many
     * more buckets.
     */

    if (tablePtr->numEntries >= tablePtr->rebuildSize) {
	RebuildTable(interp, tablePtr);
    }
    return hPtr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq 0x280(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movl $0x0, -0x5c(%rbp)
movq -0x18(%rbp), %rax
movl 0x3c(%rax), %eax
movl %eax, -0x60(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
cmpl $0x0, -0x60(%rbp)
jle 0x12789
movq -0x50(%rbp), %rax
movl (%rax), %eax
addl -0x5c(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x60(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x60(%rbp)
movq -0x50(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x50(%rbp)
jmp 0x12760
movslq -0x5c(%rbp), %rax
imulq $0x41c64e6d, %rax, %rax # imm = 0x41C64E6D
movq -0x18(%rbp), %rcx
movl 0x34(%rcx), %ecx
sarq %cl, %rax
movq -0x18(%rbp), %rcx
movslq 0x38(%rcx), %rcx
andq %rcx, %rax
movl %eax, -0x5c(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x1284c
movq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rax
movl 0x3c(%rax), %eax
movl %eax, -0x60(%rbp)
cmpl $0x0, -0x60(%rbp)
jne 0x12805
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1295f
movq -0x50(%rbp), %rax
movl (%rax), %eax
movq -0x58(%rbp), %rcx
cmpl (%rcx), %eax
je 0x12815
jmp 0x1283a
jmp 0x12817
movl -0x60(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x60(%rbp)
movq -0x50(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x50(%rbp)
movq -0x58(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x58(%rbp)
jmp 0x127e8
jmp 0x1283c
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x127bf
movq -0x28(%rbp), %rax
movl $0x1, (%rax)
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rax
movslq 0x3c(%rax), %rax
shlq $0x2, %rax
addq $0x28, %rax
subq $0x4, %rax
movl %eax, %eax
movl %eax, %esi
leaq 0xaba6(%rip), %rdx      # 0x1d41f
movl $0x312, %ecx            # imm = 0x312
callq 0x44c0
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
movslq -0x5c(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rcx
movq -0x40(%rbp), %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rax
movl 0x3c(%rax), %eax
movl %eax, -0x60(%rbp)
cmpl $0x0, -0x60(%rbp)
jle 0x1291e
movq -0x50(%rbp), %rax
movl (%rax), %ecx
movq -0x58(%rbp), %rax
movl %ecx, (%rax)
movl -0x60(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x60(%rbp)
movq -0x50(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x50(%rbp)
movq -0x58(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x58(%rbp)
jmp 0x128e9
movq -0x40(%rbp), %rcx
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movl 0x2c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x2c(%rax)
movq -0x18(%rbp), %rax
movl 0x2c(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x30(%rcx), %eax
jl 0x12957
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x12f00
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)