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

    index = HashString(key) & tablePtr->mask;

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

    for (hPtr = tablePtr->buckets[index]; hPtr != NULL;
	    hPtr = hPtr->nextPtr) {
	for (p1 = key, p2 = hPtr->key.string; ; p1++, p2++) {
	    if (*p1 != *p2) {
		break;
	    }
	    if (*p1 == '\0') {
		*newPtr = 0;
		return hPtr;
	    }
	}
    }

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

    *newPtr = 1;
    hPtr = (Hax_HashEntry *) ckalloc(memoryp, (unsigned)
	    (sizeof(Hax_HashEntry) + strlen(key) - (sizeof(hPtr->key) -1)));
    hPtr->tablePtr = tablePtr;
    hPtr->bucketPtr = &(tablePtr->buckets[index]);
    hPtr->nextPtr = *hPtr->bucketPtr;
    hPtr->clientData = 0;
    strcpy(hPtr->key.string, 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 $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), %rdi
callq 0x12eb0
movq -0x18(%rbp), %rcx
andl 0x38(%rcx), %eax
movl %eax, -0x54(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movslq -0x54(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x12312
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movsbl (%rax), %eax
movq -0x50(%rbp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
je 0x122c4
jmp 0x12303
movq -0x48(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x122e7
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x123e8
jmp 0x122e9
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x122b0
jmp 0x12305
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x12295
movq -0x28(%rbp), %rax
movl $0x1, (%rax)
movq -0x38(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x20(%rbp), %rdi
callq 0x41b0
movq -0x60(%rbp), %rdi
addq $0x28, %rax
subq $0x7, %rax
movl %eax, %eax
movl %eax, %esi
leaq 0xb0db(%rip), %rdx      # 0x1d41f
movl $0x213, %ecx            # imm = 0x213
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 -0x54(%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 -0x40(%rbp), %rdi
addq $0x20, %rdi
movq -0x20(%rbp), %rsi
callq 0x40d0
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 0x123e0
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
nopw %cs:(%rax,%rax)