// File: /workspace/github_c_makefile_star2_O1/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 0x61c2
movq %rdi, %rbx
leaq 0x18(%rdi), %r15
movq %rsp, %rsi
movq %r15, %rdi
callq 0x43d0
testq %rax, %rax
je 0x603b
leaq 0xf23e(%rip), %r12      # 0x15240
movq %rsp, %r13
movq 0x18(%rax), %rbp
movq 0x10(%rbp), %rax
testq %rax, %rax
je 0x601b
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 0x4380
testq %rax, %rax
jne 0x6005
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4210
leaq 0x68(%rbx), %rsi
movq %rbx, %rdi
callq 0x4340
cmpq $0x0, 0xe0(%rbx)
je 0x60bb
cmpl $0x0, 0xd8(%rbx)
jle 0x60a0
xorl %r12d, %r12d
leaq 0xf1d1(%rip), %r15      # 0x15240
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 0x6072
movq 0xe0(%rbx), %rsi
leaq 0xf192(%rip), %rdx      # 0x15240
movq %r14, %rdi
movl $0xfe, %ecx
callq 0x4280
movq 0xf0(%rbx), %rsi
testq %rsi, %rsi
je 0x60f1
leaq 0xf172(%rip), %r15      # 0x15240
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 0x60ce
movq 0x118(%rbx), %rsi
testq %rsi, %rsi
je 0x6111
leaq 0xf13c(%rip), %rdx      # 0x15240
movq %r14, %rdi
movl $0x107, %ecx            # imm = 0x107
callq 0x4280
movl $0x2d, %r12d
leaq 0xf122(%rip), %r15      # 0x15240
movq -0x40(%rbx,%r12,8), %rsi
testq %rsi, %rsi
je 0x6155
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 0x611e
movq 0x1a8(%rbx), %rsi
testq %rsi, %rsi
je 0x618b
leaq 0xf0d8(%rip), %r15      # 0x15240
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 0x6168
movq 0x288(%rbx), %rsi
testq %rsi, %rsi
je 0x61ab
leaq 0xf0a2(%rip), %rdx      # 0x15240
movq %r14, %rdi
movl $0x118, %ecx            # imm = 0x118
callq 0x4280
leaq 0xf08e(%rip), %rdx      # 0x15240
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