// File: /workspace/github_c_makefile_star2_O0/haxlang[P]hax/haxHash.c
// Function: OneWordCreate
static Hax_HashEntry *
OneWordCreate(
    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 index;

    index = RANDOM_INDEX(tablePtr, key);

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

    for (hPtr = tablePtr->buckets[index]; hPtr != NULL;
	    hPtr = hPtr->nextPtr) {
	if (hPtr->key.oneWordValue == key) {
	    *newPtr = 0;
	    return hPtr;
	}
    }

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

    *newPtr = 1;
    hPtr = (Hax_HashEntry *) ckalloc(memoryp, sizeof(Hax_HashEntry));
    hPtr->tablePtr = tablePtr;
    hPtr->bucketPtr = &(tablePtr->buckets[index]);
    hPtr->nextPtr = *hPtr->bucketPtr;
    hPtr->clientData = 0;
    hPtr->key.oneWordValue = key;
    *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 $0x50, %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
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, -0x44(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movslq -0x44(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x12520
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rax
cmpq -0x20(%rbp), %rax
jne 0x12511
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x125d9
jmp 0x12513
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x124e5
movq -0x28(%rbp), %rax
movl $0x1, (%rax)
movq -0x38(%rbp), %rdi
movl $0x28, %esi
leaq 0xaee5(%rip), %rdx      # 0x1d41f
movl $0x286, %ecx            # imm = 0x286
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 -0x44(%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 -0x20(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x20(%rax)
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 0x125d1
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x12f00
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)