// File: /workspace/github_c_makefile_star2_O3/haxlang[P]hax/haxBasic.c
// Function: Hax_DeleteInterp
void
Hax_DeleteInterp(
    Hax_Interp *interp		/* Token for command interpreter (returned
				 * by a previous call to Hax_CreateInterp). */)
{
    Interp *iPtr = (Interp *) interp;
    Hax_Memoryp *memoryp = iPtr->memoryp;
    Hax_HashEntry *hPtr;
    Hax_HashSearch search;
    Command *cmdPtr;
    int i;

    /*
     * If the interpreter is in use, delay the deletion until later.
     */

    iPtr->flags |= DELETED;
    if (iPtr->numLevels != 0) {
	return;
    }

    /*
     * Free up any remaining resources associated with the
     * interpreter.
     */

    for (hPtr = Hax_FirstHashEntry(&iPtr->commandTable, &search);
	    hPtr != NULL; hPtr = Hax_NextHashEntry(&search)) {
	cmdPtr = (Command *) Hax_GetHashValue(hPtr);
	if (cmdPtr->deleteProc != NULL) {
	    (*cmdPtr->deleteProc)(interp, cmdPtr->clientData);
	}
	ckfree(memoryp, (char *) cmdPtr);
    }
    Hax_DeleteHashTable(interp, &iPtr->commandTable);
    HaxDeleteVars(iPtr, &iPtr->globalTable);
    if (iPtr->events != NULL) {
	int i;

	for (i = 0; i < iPtr->numEvents; i++) {
	    ckfree(memoryp, iPtr->events[i].command);
	}
	ckfree(memoryp, (char *) iPtr->events);
    }
    while (iPtr->revPtr != NULL) {
	HistoryRev *nextPtr = iPtr->revPtr->nextPtr;

	ckfree(memoryp, (char *) iPtr->revPtr);
	iPtr->revPtr = nextPtr;
    }
    if (iPtr->appendResult != NULL) {
	ckfree(memoryp, iPtr->appendResult);
    }
    for (i = 0; i < NUM_REGEXPS; i++) {
	if (iPtr->patterns[i] == NULL) {
	    break;
	}
	ckfree(memoryp, iPtr->patterns[i]);
	ckfree(memoryp, (char *) iPtr->regexps[i]);
    }
    while (iPtr->tracePtr != NULL) {
	Trace *nextPtr = iPtr->tracePtr->nextPtr;

	ckfree(memoryp, (char *) iPtr->tracePtr);
	iPtr->tracePtr = nextPtr;
    }

    if (iPtr->libraryPath != NULL) {
	ckfree(memoryp, iPtr->libraryPath);
    }

    ckfree(memoryp, (char *) iPtr);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x280(%rdi), %r14
orb $0x1, 0x1a0(%rdi)
cmpl $0x0, 0xb8(%rdi)
jne 0x6106
movq %rdi, %rbx
leaq 0x18(%rdi), %r15
movq %rsp, %rsi
movq %r15, %rdi
callq 0x43e0
testq %rax, %rax
je 0x5f7d
leaq 0xe2fc(%rip), %r12      # 0x14240
movq %rsp, %r13
movq 0x18(%rax), %rbp
movq 0x10(%rbp), %rax
testq %rax, %rax
je 0x5f5d
movq 0x8(%rbp), %rsi
movq %rbx, %rdi
callq *%rax
movq %r14, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movl $0xf4, %ecx
callq 0x4280
movq %r13, %rdi
callq 0x4390
testq %rax, %rax
jne 0x5f47
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4210
leaq 0x68(%rbx), %rsi
movq %rbx, %rdi
callq 0x4350
movq 0xe0(%rbx), %rsi
testq %rsi, %rsi
je 0x5fff
cmpl $0x0, 0xd8(%rbx)
jle 0x5feb
xorl %r12d, %r12d
leaq 0xe28d(%rip), %r15      # 0x14240
xorl %r13d, %r13d
movq 0xe0(%rbx), %rax
movq (%rax,%r12), %rsi
movq %r14, %rdi
movq %r15, %rdx
movl $0xfc, %ecx
callq 0x4280
incq %r13
movslq 0xd8(%rbx), %rax
addq $0x10, %r12
cmpq %rax, %r13
jl 0x5fb6
movq 0xe0(%rbx), %rsi
leaq 0xe24e(%rip), %rdx      # 0x14240
movq %r14, %rdi
movl $0xfe, %ecx
callq 0x4280
movq 0xf0(%rbx), %rsi
testq %rsi, %rsi
je 0x6035
leaq 0xe22e(%rip), %r15      # 0x14240
movq 0x18(%rsi), %r12
movq %r14, %rdi
movq %r15, %rdx
movl $0x103, %ecx            # imm = 0x103
callq 0x4280
movq %r12, 0xf0(%rbx)
movq %r12, %rsi
testq %r12, %r12
jne 0x6012
movq 0x118(%rbx), %rsi
testq %rsi, %rsi
je 0x6055
leaq 0xe1f8(%rip), %rdx      # 0x14240
movq %r14, %rdi
movl $0x107, %ecx            # imm = 0x107
callq 0x4280
movl $0x2d, %r12d
leaq 0xe1de(%rip), %r15      # 0x14240
movq -0x40(%rbx,%r12,8), %rsi
testq %rsi, %rsi
je 0x6099
movq %r14, %rdi
movq %r15, %rdx
movl $0x10d, %ecx            # imm = 0x10D
callq 0x4280
movq (%rbx,%r12,8), %rsi
movq %r14, %rdi
movq %r15, %rdx
movl $0x10e, %ecx            # imm = 0x10E
callq 0x4280
incq %r12
cmpq $0x32, %r12
jne 0x6062
movq 0x1a8(%rbx), %rsi
testq %rsi, %rsi
je 0x60cf
leaq 0xe194(%rip), %r15      # 0x14240
movq 0x18(%rsi), %r12
movq %r14, %rdi
movq %r15, %rdx
movl $0x113, %ecx            # imm = 0x113
callq 0x4280
movq %r12, 0x1a8(%rbx)
movq %r12, %rsi
testq %r12, %r12
jne 0x60ac
movq 0x288(%rbx), %rsi
testq %rsi, %rsi
je 0x60ef
leaq 0xe15e(%rip), %rdx      # 0x14240
movq %r14, %rdi
movl $0x118, %ecx            # imm = 0x118
callq 0x4280
leaq 0xe14a(%rip), %rdx      # 0x14240
movq %r14, %rdi
movq %rbx, %rsi
movl $0x11b, %ecx            # imm = 0x11B
callq 0x4280
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq