// File: /workspace/github_c_makefile_star2_O0/haxlang[P]hax/haxVar.c
// Function: CallTraces
static char *
CallTraces(
    Interp *iPtr,			/* Interpreter containing variable. */
    Var *arrayPtr,			/* Pointer to array variable that
					 * contains the variable, or NULL if
					 * the variable isn't an element of an
					 * array. */
    Hax_HashEntry *hPtr,		/* Hash table entry corresponding to
					 * variable whose traces are to be
					 * invoked. */
    char *part1, char *part2,		/* Variable's two-part name. */
    int flags				/* Flags to pass to trace procedures:
					 * indicates what's happening to
					 * variable, plus other stuff like
					 * HAX_GLOBAL_ONLY and
					 * HAX_INTERP_DESTROYED. */)
{
    Var *varPtr;
    VarTrace *tracePtr;
    ActiveVarTrace active;
    char *result;
    int savedArrayFlags = 0;		/* (Initialization not needed except
					 * to prevent compiler warning) */

    /*
     * If there are already similar trace procedures active for the
     * variable, don't call them again.
     */

    varPtr = (Var *) Hax_GetHashValue(hPtr);
    if (varPtr->flags & VAR_TRACE_ACTIVE) {
	return NULL;
    }
    varPtr->flags |= VAR_TRACE_ACTIVE;

    /*
     * Invoke traces on the array containing the variable, if relevant.
     */

    result = NULL;
    active.nextPtr = iPtr->activeTracePtr;
    iPtr->activeTracePtr = &active;
    if (arrayPtr != NULL) {
	savedArrayFlags = arrayPtr->flags;
	arrayPtr->flags |= VAR_ELEMENT_ACTIVE;
	for (tracePtr = arrayPtr->tracePtr;  tracePtr != NULL;
		tracePtr = active.nextTracePtr) {
	    active.nextTracePtr = tracePtr->nextPtr;
	    if (!(tracePtr->flags & flags)) {
		continue;
	    }
	    result = (*tracePtr->traceProc)(tracePtr->clientData,
		    (Hax_Interp *) iPtr, part1, part2, flags);
	    if (result != NULL) {
		if (flags & HAX_TRACE_UNSETS) {
		    result = NULL;
		} else {
		    goto done;
		}
	    }
	}
    }

    /*
     * Invoke traces on the variable itself.
     */

    if (flags & HAX_TRACE_UNSETS) {
	flags |= HAX_TRACE_DESTROYED;
    }
    for (tracePtr = varPtr->tracePtr; tracePtr != NULL;
	    tracePtr = active.nextTracePtr) {
	active.nextTracePtr = tracePtr->nextPtr;
	if (!(tracePtr->flags & flags)) {
	    continue;
	}
	result = (*tracePtr->traceProc)(tracePtr->clientData,
		(Hax_Interp *) iPtr, part1, part2, flags);
	if (result != NULL) {
	    if (flags & HAX_TRACE_UNSETS) {
		result = NULL;
	    } else {
		goto done;
	    }
	}
    }

    /*
     * Restore the variable's flags, remove the record of our active
     * traces, and then return.  Remember that the variable could have
     * been re-allocated during the traces, but its hash entry won't
     * change.
     */

    done:
    if (arrayPtr != NULL) {
	arrayPtr->flags = savedArrayFlags;
    }
    varPtr = (Var *) Hax_GetHashValue(hPtr);
    varPtr->flags &= ~VAR_TRACE_ACTIVE;
    iPtr->activeTracePtr = active.nextPtr;
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movl %r9d, -0x34(%rbp)
movl $0x0, -0x64(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movl 0x20(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x199ef
movq $0x0, -0x8(%rbp)
jmp 0x19ba4
movq -0x40(%rbp), %rax
movl 0x20(%rax), %ecx
orl $0x20, %ecx
movl %ecx, 0x20(%rax)
movq $0x0, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq 0xd0(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rax
leaq -0x58(%rbp), %rcx
movq %rcx, 0xd0(%rax)
cmpq $0x0, -0x18(%rbp)
je 0x19aca
movq -0x18(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x64(%rbp)
movq -0x18(%rbp), %rax
movl 0x20(%rax), %ecx
orl $0x10, %ecx
movl %ecx, 0x20(%rax)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0x19ac8
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movl 0x10(%rax), %eax
andl -0x34(%rbp), %eax
cmpl $0x0, %eax
jne 0x19a74
jmp 0x19abe
movq -0x48(%rbp), %rax
movq (%rax), %rax
movq -0x48(%rbp), %rcx
movq 0x8(%rcx), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
movl -0x34(%rbp), %r8d
callq *%rax
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
je 0x19abc
movl -0x34(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x19ab5
movq $0x0, -0x60(%rbp)
jmp 0x19aba
jmp 0x19b63
jmp 0x19abc
jmp 0x19abe
movq -0x50(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x19a50
jmp 0x19aca
movl -0x34(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x19ae0
movl -0x34(%rbp), %eax
orl $0x80, %eax
movl %eax, -0x34(%rbp)
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0x19b61
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movl 0x10(%rax), %eax
andl -0x34(%rbp), %eax
cmpl $0x0, %eax
jne 0x19b10
jmp 0x19b57
movq -0x48(%rbp), %rax
movq (%rax), %rax
movq -0x48(%rbp), %rcx
movq 0x8(%rcx), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
movl -0x34(%rbp), %r8d
callq *%rax
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
je 0x19b55
movl -0x34(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x19b51
movq $0x0, -0x60(%rbp)
jmp 0x19b53
jmp 0x19b63
jmp 0x19b55
jmp 0x19b57
movq -0x50(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x19aec
jmp 0x19b63
cmpq $0x0, -0x18(%rbp)
je 0x19b74
movl -0x64(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movl 0x20(%rax), %ecx
andl $-0x21, %ecx
movl %ecx, 0x20(%rax)
movq -0x58(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0xd0(%rax)
movq -0x60(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nop