// File: /workspace/github_c_makefile_star2_O0/haxlang[P]hax/haxVar.c
// Function: Hax_UntraceVar2
void
Hax_UntraceVar2(
    Hax_Interp *interp,		/* Interpreter containing traced variable. */
    char *part1,		/* Name of variable or array. */
    char *part2,		/* Name of element within array;  NULL means
				 * trace applies to scalar variable or array
				 * as-a-whole. */
    int flags,			/* OR-ed collection of bits describing
				 * current trace, including any of
				 * HAX_TRACE_READS, HAX_TRACE_WRITES,
				 * HAX_TRACE_UNSETS, and HAX_GLOBAL_ONLY. */
    Hax_VarTraceProc *proc,	/* Procedure assocated with trace. */
    ClientData clientData	/* Arbitrary argument to pass to proc. */)
{
    VarTrace *tracePtr;
    VarTrace *prevPtr;
    Var *varPtr;
    Interp *iPtr = (Interp *) interp;
    Hax_Memoryp *memoryp = iPtr->memoryp;
    Hax_HashEntry *hPtr;
    ActiveVarTrace *activePtr;

    /*
     * First, lookup the variable.
     */

    if ((flags & HAX_GLOBAL_ONLY) || (iPtr->varFramePtr == NULL)) {
	hPtr = Hax_FindHashEntry(&iPtr->globalTable, part1);
    } else {
	hPtr = Hax_FindHashEntry(&iPtr->varFramePtr->varTable, part1);
    }
    if (hPtr == NULL) {
	return;
    }
    varPtr = (Var *) Hax_GetHashValue(hPtr);
    if (varPtr->flags & VAR_UPVAR) {
	hPtr = varPtr->value.upvarPtr;
	varPtr = (Var *) Hax_GetHashValue(hPtr);
    }
    if (part2 != NULL) {
	if (!(varPtr->flags & VAR_ARRAY)) {
	    return;
	}
	hPtr = Hax_FindHashEntry(varPtr->value.tablePtr, part2);
	if (hPtr == NULL) {
	    return;
	}
	varPtr = (Var *) Hax_GetHashValue(hPtr);
    }

    flags &= (HAX_TRACE_READS | HAX_TRACE_WRITES | HAX_TRACE_UNSETS);
    for (tracePtr = varPtr->tracePtr, prevPtr = NULL; ;
	    prevPtr = tracePtr, tracePtr = tracePtr->nextPtr) {
	if (tracePtr == NULL) {
	    return;
	}
	if ((tracePtr->traceProc == proc) && (tracePtr->flags == flags)
		&& (tracePtr->clientData == clientData)) {
	    break;
	}
    }

    /*
     * The code below makes it possible to delete traces while traces
     * are active:  it makes sure that the deleted trace won't be
     * processed by CallTraces.
     */

    for (activePtr = iPtr->activeTracePtr; activePtr != NULL;
	    activePtr = activePtr->nextPtr) {
	if (activePtr->nextTracePtr == tracePtr) {
	    activePtr->nextTracePtr = tracePtr->nextPtr;
	}
    }
    if (prevPtr == NULL) {
	varPtr->tracePtr = tracePtr->nextPtr;
    } else {
	prevPtr->nextPtr = tracePtr->nextPtr;
    }
    ckfree(memoryp, (char *) tracePtr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq 0x280(%rax), %rax
movq %rax, -0x58(%rbp)
movl -0x1c(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x1aecf
movq -0x50(%rbp), %rax
cmpq $0x0, 0xc8(%rax)
jne 0x1aeee
movq -0x50(%rbp), %rax
movq 0xa8(%rax), %rax
movq -0x50(%rbp), %rdi
addq $0x68, %rdi
movq -0x10(%rbp), %rsi
callq *%rax
movq %rax, -0x60(%rbp)
jmp 0x1af12
movq -0x50(%rbp), %rax
movq 0xc8(%rax), %rax
movq 0x40(%rax), %rax
movq -0x50(%rbp), %rcx
movq 0xc8(%rcx), %rdi
movq -0x10(%rbp), %rsi
callq *%rax
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
jne 0x1af1e
jmp 0x1b091
movq -0x60(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movl 0x20(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x1af51
movq -0x48(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x1afa2
movq -0x48(%rbp), %rax
movl 0x20(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x1af6c
jmp 0x1b091
movq -0x48(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x40(%rax), %rax
movq -0x48(%rbp), %rcx
movq 0x28(%rcx), %rdi
movq -0x18(%rbp), %rsi
callq *%rax
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
jne 0x1af96
jmp 0x1b091
movq -0x60(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x48(%rbp)
movl -0x1c(%rbp), %eax
andl $0x70, %eax
movl %eax, -0x1c(%rbp)
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x1afcb
jmp 0x1b091
movq -0x38(%rbp), %rax
movq (%rax), %rax
cmpq -0x28(%rbp), %rax
jne 0x1aff4
movq -0x38(%rbp), %rax
movl 0x10(%rax), %eax
cmpl -0x1c(%rbp), %eax
jne 0x1aff4
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
cmpq -0x30(%rbp), %rax
jne 0x1aff4
jmp 0x1b00c
jmp 0x1aff6
movq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0x1afbf
movq -0x50(%rbp), %rax
movq 0xd0(%rax), %rax
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x68(%rbp)
je 0x1b04f
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rax
cmpq -0x38(%rbp), %rax
jne 0x1b040
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x68(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x1b042
movq -0x68(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x68(%rbp)
jmp 0x1b01b
cmpq $0x0, -0x40(%rbp)
jne 0x1b068
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x1b078
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x58(%rbp), %rdi
movq -0x38(%rbp), %rsi
leaq 0x4828(%rip), %rdx      # 0x1f8af
movl $0x43c, %ecx            # imm = 0x43C
callq 0x4260
addq $0x70, %rsp
popq %rbp
retq
nopw (%rax,%rax)