// File: /workspace/github_c_makefile_star2_O2/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 0x5c98
movq %rdi, %rbx
leaq 0x18(%rdi), %r15
movq %rsp, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x43f0
leaq 0xd753(%rip), %r13      # 0x13240
testq %rax, %rax
je 0x5b25
movq 0x18(%rax), %rbp
movq 0x10(%rbp), %rax
testq %rax, %rax
je 0x5b08
movq 0x8(%rbp), %rsi
movq %rbx, %rdi
callq *%rax
movq %r14, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movl $0xf4, %ecx
callq 0x4280
movq %r12, %rdi
callq 0x43a0
jmp 0x5aed
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4210
leaq 0x68(%rbx), %rsi
movq %rbx, %rdi
callq 0x4360
cmpq $0x0, 0xe0(%rbx)
je 0x5b97
xorl %r12d, %r12d
leaq 0xd6f0(%rip), %r15      # 0x13240
xorl %r13d, %r13d
movslq 0xd8(%rbx), %rax
movq 0xe0(%rbx), %rsi
cmpq %rax, %r13
jge 0x5b83
movq (%rsi,%r12), %rsi
movq %r14, %rdi
movq %r15, %rdx
movl $0xfc, %ecx
callq 0x4280
incq %r13
addq $0x10, %r12
jmp 0x5b53
leaq 0xd6b6(%rip), %rdx      # 0x13240
movq %r14, %rdi
movl $0xfe, %ecx
callq 0x4280
movq 0xf0(%rbx), %rsi
leaq 0xd69b(%rip), %r15      # 0x13240
testq %rsi, %rsi
je 0x5bca
movq 0x18(%rsi), %r12
movq %r14, %rdi
movq %r15, %rdx
movl $0x103, %ecx            # imm = 0x103
callq 0x4280
movq %r12, 0xf0(%rbx)
movq %r12, %rsi
jmp 0x5ba5
movq 0x118(%rbx), %rsi
testq %rsi, %rsi
je 0x5bea
leaq 0xd663(%rip), %rdx      # 0x13240
movq %r14, %rdi
movl $0x107, %ecx            # imm = 0x107
callq 0x4280
pushq $0x2d
popq %r12
leaq 0xd64b(%rip), %r15      # 0x13240
cmpq $0x32, %r12
je 0x5c2e
movq -0x40(%rbx,%r12,8), %rsi
testq %rsi, %rsi
je 0x5c2e
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
jmp 0x5bf5
movq 0x1a8(%rbx), %rsi
leaq 0xd604(%rip), %r15      # 0x13240
testq %rsi, %rsi
je 0x5c61
movq 0x18(%rsi), %r12
movq %r14, %rdi
movq %r15, %rdx
movl $0x113, %ecx            # imm = 0x113
callq 0x4280
movq %r12, 0x1a8(%rbx)
movq %r12, %rsi
jmp 0x5c3c
movq 0x288(%rbx), %rsi
testq %rsi, %rsi
je 0x5c81
leaq 0xd5cc(%rip), %rdx      # 0x13240
movq %r14, %rdi
movl $0x118, %ecx            # imm = 0x118
callq 0x4280
leaq 0xd5b8(%rip), %rdx      # 0x13240
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