// File: /workspace/github_c_makefile_star2_O3/haxlang[P]hax/haxCmdMZ.c
// Function: TraceVarProc
static char *
TraceVarProc(
    ClientData clientData,	/* Information about the variable trace. */
    Hax_Interp *interp,		/* Interpreter containing variable. */
    char *name1,		/* Name of variable or array. */
    char *name2,		/* Name of element within array;  NULL means
				 * scalar variable is being referenced. */
    int flags			/* OR-ed bits giving operation and other
				 * information. */)
{
    Interp *iPtr = (Interp *) interp;
    Hax_Memoryp *memoryp = iPtr->memoryp;
    TraceVarInfo *tvarPtr = (TraceVarInfo *) clientData;
    char *result;
    int code, cmdLength, flags1, flags2;
    Interp dummy;
#define STATIC_SIZE 199
    char staticSpace[STATIC_SIZE+1];
    char *cmdPtr, *p;

    result = NULL;
    if ((tvarPtr->flags & flags) && !(flags & HAX_INTERP_DESTROYED)) {

	/*
	 * Generate a command to execute by appending list elements
	 * for the two variable names and the operation.  The five
	 * extra characters are for three space, the opcode character,
	 * and the terminating null.
	 */

	if (name2 == NULL) {
	    name2 = (char *) "";
	}
	cmdLength = tvarPtr->length + Hax_ScanElement(name1, &flags1) +
		Hax_ScanElement(name2, &flags2) + 5;
	if (cmdLength < STATIC_SIZE) {
	    cmdPtr = staticSpace;
	} else {
	    cmdPtr = (char *) ckalloc(memoryp, (unsigned) cmdLength);
	}
	p = cmdPtr;
	strcpy(p, tvarPtr->command);
	p += tvarPtr->length;
	*p = ' ';
	p++;
	p += Hax_ConvertElement(name1, p, flags1);
	*p = ' ';
	p++;
	p += Hax_ConvertElement(name2, p, flags2);
	*p = ' ';
	if (flags & HAX_TRACE_READS) {
	    p[1] = 'r';
	} else if (flags & HAX_TRACE_WRITES) {
	    p[1] = 'w';
	} else if (flags & HAX_TRACE_UNSETS) {
	    p[1] = 'u';
	}
	p[2] = '\0';

	/*
	 * Execute the command.  Be careful to save and restore the
	 * result from the interpreter used for the command.
	 */

	dummy.memoryp = iPtr->memoryp;
	if (interp->freeProc == 0) {
	    dummy.freeProc = (Hax_FreeProc *) 0;
	    dummy.result = dummy.resultSpace;
	    dummy.resultSpace[0] = 0;
	    Hax_SetResult((Hax_Interp *) &dummy, interp->result, HAX_VOLATILE);
	} else {
	    dummy.freeProc = interp->freeProc;
	    dummy.result = interp->result;
	}
	code = Hax_Eval(interp, NULL, cmdPtr, 0, (char **) NULL);
	if (cmdPtr != staticSpace) {
	    ckfree(memoryp, cmdPtr);
	}
	if (code != HAX_OK) {
	    result = (char *) "access disallowed by trace command";
	    Hax_ResetResult(interp);		/* Must clear error state. */
	}
	Hax_FreeResult(interp);
	if (dummy.result == dummy.resultSpace) {
	    if (dummy.freeProc != HAX_STATIC) {
		Hax_Panic((char *) "Corrupted state of dummy Interpreter");
	    }
	    iPtr->result = iPtr->resultSpace;
	    strcpy(iPtr->resultSpace, dummy.resultSpace);
	    iPtr->freeProc = HAX_STATIC;
	} else {
	    interp->result = dummy.result;
	    interp->freeProc = dummy.freeProc;
	}
    }
    if (flags & HAX_TRACE_DESTROYED) {
	ckfree(memoryp, (char *) tvarPtr);
    }
    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3c8, %rsp            # imm = 0x3C8
movl %r8d, %r14d
movq %rdi, %rbp
movq 0x280(%rsi), %rbx
xorl %r13d, %r13d
btl $0x8, %r8d
jb 0xb941
movl (%rbp), %eax
andl %r14d, %eax
je 0xb941
movq %rdx, %r12
movq %rsi, %r15
movl %r14d, 0x4(%rsp)
movq %rbx, 0x8(%rsp)
testq %rcx, %rcx
leaq 0xa512(%rip), %r14      # 0x15c37
cmovneq %rcx, %r14
movl 0x4(%rbp), %ebx
leaq 0x14(%rsp), %rsi
movq %rdx, %rdi
callq 0x4110
movl %eax, %r13d
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x4110
addl %r13d, %eax
addl %ebx, %eax
cmpl $0xc2, %eax
jge 0xb75c
leaq 0x20(%rsp), %r13
jmp 0xb77b
addl $0x5, %eax
leaq 0x9988(%rip), %rdx      # 0x150ee
movq 0x8(%rsp), %rdi
movq %rax, %rsi
movl $0x533, %ecx            # imm = 0x533
callq 0x44d0
movq %rax, %r13
leaq 0x8(%rbp), %rsi
movq %r13, %rdi
callq 0x40f0
movq %rbp, 0x18(%rsp)
movslq 0x4(%rbp), %rax
leaq (%rax,%r13), %rbx
movb $0x20, %cl
leaq 0x1(%r13,%rax), %rsi
movb %cl, -0x1(%rsi)
movl 0x14(%rsp), %edx
movq %r12, %rdi
callq 0x4170
cltq
leaq (%rax,%rbx), %rbp
incq %rbp
leaq 0x2(%rax,%rbx), %r12
movb $0x20, %al
movb %al, -0x1(%r12)
movb $0x20, %bl
movl 0x10(%rsp), %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x4170
cltq
movb %bl, 0x1(%rax,%rbp)
movb $0x72, %cl
movl 0x4(%rsp), %edx
testb $0x10, %dl
jne 0xb7ef
movb $0x77, %cl
testb $0x20, %dl
jne 0xb7ef
movb $0x75, %cl
testb $0x40, %dl
je 0xb7f4
movb %cl, 0x1(%r12,%rax)
movb $0x0, 0x2(%r12,%rax)
movq 0x280(%r15), %rax
leaq 0x2a0(%rsp), %r12
movq %rax, 0xd0(%r12)
movq 0x8(%r15), %rax
testq %rax, %rax
je 0xb82f
movq %rax, 0xf8(%rsp)
movq (%r15), %rax
movq %rax, 0xf0(%rsp)
jmp 0xb858
leaq 0xf0(%rsp), %rdi
movq $0x0, 0x8(%rdi)
movq %r12, (%rdi)
movb $0x0, 0x1b0(%rdi)
movq (%r15), %rsi
movq $-0x1, %rdx
callq 0x44f0
movq 0x18(%rsp), %rbp
movq 0x8(%rsp), %rbx
movq %r15, %rdi
xorl %esi, %esi
movq %r13, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x45c0
movl %eax, %r14d
leaq 0x20(%rsp), %rax
cmpq %rax, %r13
je 0xb898
leaq 0x9866(%rip), %rdx      # 0x150ee
movq %rbx, %rdi
movq %r13, %rsi
movl $0x559, %ecx            # imm = 0x559
callq 0x4280
testl %r14d, %r14d
je 0xb8ae
movq %r15, %rdi
callq 0x42d0
leaq 0x9d03(%rip), %r13      # 0x155af
jmp 0xb8b1
xorl %r13d, %r13d
movl 0x4(%rsp), %r14d
movq 0x8(%r15), %rax
testq %rax, %rax
je 0xb8f6
cmpq 0xf6da(%rip), %rax      # 0x1afa0
je 0xb8cf
movq (%r15), %rdi
callq *%rax
jmp 0xb8ee
movq %r15, %rdi
callq 0x4550
movq (%r15), %rsi
leaq 0x980d(%rip), %rdx      # 0x150ee
movq %rax, %rdi
movl $0x55f, %ecx            # imm = 0x55F
callq 0x4280
movq $0x0, 0x8(%r15)
movq 0xf0(%rsp), %rax
cmpq %r12, %rax
je 0xb910
movq %rax, (%r15)
movq 0xf8(%rsp), %rax
jmp 0xb93d
cmpq $0x0, 0xf8(%rsp)
je 0xb929
leaq 0x9cb0(%rip), %rdi      # 0x155d2
xorl %eax, %eax
callq 0x4140
leaq 0x1b0(%r15), %rdi
movq %rdi, (%r15)
movq %r12, %rsi
callq 0x40f0
xorl %eax, %eax
movq %rax, 0x8(%r15)
testb %r14b, %r14b
jns 0xb95d
leaq 0x97a1(%rip), %rdx      # 0x150ee
movq %rbx, %rdi
movq %rbp, %rsi
movl $0x56d, %ecx            # imm = 0x56D
callq 0x4280
movq %r13, %rax
addq $0x3c8, %rsp            # imm = 0x3C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq