// File: /workspace/github_c_makefile_star2_O2/haxlang[P]hax/haxBasic.c
// Function: Hax_CreateInterp
Hax_Interp *
Hax_CreateInterp(
    Hax_Memoryp *memoryp)
{
    Interp *iPtr;
    Command *cmdPtr;
    CmdInfo *cmdInfoPtr;
    int i;

    if (memoryp == NULL)
	return NULL;

    iPtr = (Interp *) ckalloc(memoryp, sizeof(Interp));
    iPtr->memoryp = memoryp;
    iPtr->result = iPtr->resultSpace;
    iPtr->freeProc = 0;
    iPtr->errorLine = 0;
    Hax_InitHashTable(&iPtr->commandTable, HAX_STRING_KEYS);
    Hax_InitHashTable(&iPtr->globalTable, HAX_STRING_KEYS);
    iPtr->numLevels = 0;
    iPtr->framePtr = NULL;
    iPtr->varFramePtr = NULL;
    iPtr->activeTracePtr = NULL;
    iPtr->numEvents = 0;
    iPtr->events = NULL;
    iPtr->curEvent = 0;
    iPtr->curEventNum = 0;
    iPtr->revPtr = NULL;
    iPtr->historyFirst = NULL;
    iPtr->revDisables = 1;
    iPtr->evalFirst = iPtr->evalLast = NULL;
    iPtr->appendResult = NULL;
    iPtr->appendAvl = 0;
    iPtr->appendUsed = 0;
    for (i = 0; i < NUM_REGEXPS; i++) {
	iPtr->patterns[i] = NULL;
	iPtr->patLengths[i] = -1;
	iPtr->regexps[i] = NULL;
    }
    iPtr->cmdCount = 0;
    iPtr->noEval = 0;
    iPtr->scriptFile = NULL;
    iPtr->flags = 0;
    iPtr->tracePtr = NULL;
    iPtr->resultSpace[0] = 0;
    iPtr->internalErrno = 0;
    iPtr->haxRegexpError = NULL;
    iPtr->regparse = NULL;
    iPtr->regnpar = 0;
    iPtr->regdummy = 0;
    iPtr->regcode = NULL;
    iPtr->regsize = 0;
    iPtr->reginput = NULL;
    iPtr->regbol = NULL;
    iPtr->regstartp = NULL;
    iPtr->regendp = NULL;

#ifdef HAX_LIBRARY
    iPtr->libraryPath = (char *) ckalloc(memoryp, strlen(HAX_LIBRARY) + 1);
    strcpy(iPtr->libraryPath, HAX_LIBRARY);
#else
    iPtr->libraryPath = NULL;
#endif

    /*
     * Create the built-in commands.  Do it here, rather than calling
     * Hax_CreateCommand, because it's faster (there's no need to
     * check for a pre-existing command by the same name).
     */

    for (cmdInfoPtr = builtInCmds; cmdInfoPtr->name != NULL; cmdInfoPtr++) {
	int newPtr;
	Hax_HashEntry *hPtr;

	hPtr = Hax_CreateHashEntry((Hax_Interp *) iPtr, &iPtr->commandTable,
		(char *) cmdInfoPtr->name, &newPtr);
	if (newPtr) {
	    cmdPtr = (Command *) ckalloc(memoryp, sizeof(Command));
	    cmdPtr->proc = cmdInfoPtr->proc;
	    cmdPtr->clientData = (ClientData) NULL;
	    cmdPtr->deleteProc = NULL;
	    Hax_SetHashValue(hPtr, cmdPtr);
	}
    }

    return (Hax_Interp *) iPtr;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x5a93
movq %rdi, %rbx
leaq 0xd936(%rip), %rdx      # 0x13240
pushq $0x76
popq %rcx
movl $0x2d8, %esi            # imm = 0x2D8
callq 0x44e0
movq %rax, %r14
movq %rbx, 0x280(%rax)
addq $0x1b0, %rax            # imm = 0x1B0
movq %rax, (%r14)
andq $0x0, 0x8(%r14)
andl $0x0, 0x10(%r14)
leaq 0x18(%r14), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x45b0
leaq 0x68(%r14), %rdi
xorl %esi, %esi
callq 0x45b0
andl $0x0, 0xb8(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0xc0(%r14)
movups %xmm0, 0xcc(%r14)
movups %xmm0, 0xe0(%r14)
movups %xmm0, 0xf0(%r14)
movl $0x1, 0x100(%r14)
movups %xmm0, 0x108(%r14)
movups %xmm0, 0x118(%r14)
pushq $0x2d
popq %rax
cmpq $0x32, %rax
je 0x59b5
andq $0x0, -0x40(%r14,%rax,8)
orl $-0x1, 0x9c(%r14,%rax,4)
andq $0x0, (%r14,%rax,8)
incq %rax
jmp 0x5996
andq $0x0, 0x1a8(%r14)
movb $0x0, 0x1b0(%r14)
andl $0x0, 0x278(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x190(%r14)
andl $0x0, 0x1a0(%r14)
movups %xmm0, 0x290(%r14)
andq $0x0, 0x29d(%r14)
movups %xmm0, 0x2a8(%r14)
movups %xmm0, 0x2b8(%r14)
movups %xmm0, 0x2c8(%r14)
leaq 0xd831(%rip), %rdx      # 0x13240
pushq $0x13
popq %rsi
movq %rbx, %rdi
movl $0xa4, %ecx
callq 0x44e0
movq %rax, 0x288(%r14)
movups 0xd81e(%rip), %xmm0     # 0x1324b
movups %xmm0, (%rax)
movl $0x786168, 0xf(%rax)    # imm = 0x786168
leaq 0x150fa(%rip), %rbp     # 0x1ab38
leaq 0x4(%rsp), %r13
movq -0x8(%rbp), %rdx
testq %rdx, %rdx
je 0x5a96
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rcx
callq *0x60(%r14)
cmpl $0x0, 0x4(%rsp)
je 0x5a8d
movq %rax, %r12
movq %rbx, %rdi
pushq $0x18
popq %rsi
leaq 0xd7d0(%rip), %rdx      # 0x13240
movl $0xb7, %ecx
callq 0x44e0
movq (%rbp), %rcx
movq %rcx, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq %rax, 0x18(%r12)
addq $0x10, %rbp
jmp 0x5a43
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq