// File: /workspace/github_c_makefile_star2_O1/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 0xbdfd
movl (%rbp), %eax
andl %r14d, %eax
je 0xbdfd
movq %rdx, %r12
movq %rsi, %r15
movl %r14d, 0x4(%rsp)
movq %rbx, 0x8(%rsp)
testq %rcx, %rcx
leaq 0xb352(%rip), %r14      # 0x16f33
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 0xbc18
leaq 0x20(%rsp), %r13
jmp 0xbc37
addl $0x5, %eax
leaq 0xa6c0(%rip), %rdx      # 0x162e2
movq 0x8(%rsp), %rdi
movq %rax, %rsi
movl $0x533, %ecx            # imm = 0x533
callq 0x44c0
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 0xbcab
movb $0x77, %cl
testb $0x20, %dl
jne 0xbcab
movb $0x75, %cl
testb $0x40, %dl
je 0xbcb0
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 0xbceb
movq %rax, 0xf8(%rsp)
movq (%r15), %rax
movq %rax, 0xf0(%rsp)
jmp 0xbd14
leaq 0xf0(%rsp), %rdi
movq $0x0, 0x8(%rdi)
movq %r12, (%rdi)
movb $0x0, 0x1b0(%rdi)
movq (%r15), %rsi
movq $-0x1, %rdx
callq 0x44e0
movq 0x18(%rsp), %rbp
movq 0x8(%rsp), %rbx
movq %r15, %rdi
xorl %esi, %esi
movq %r13, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x45b0
movl %eax, %r14d
leaq 0x20(%rsp), %rax
cmpq %rax, %r13
je 0xbd54
leaq 0xa59e(%rip), %rdx      # 0x162e2
movq %rbx, %rdi
movq %r13, %rsi
movl $0x559, %ecx            # imm = 0x559
callq 0x4280
testl %r14d, %r14d
je 0xbd6a
movq %r15, %rdi
callq 0x42d0
leaq 0xaa3b(%rip), %r13      # 0x167a3
jmp 0xbd6d
xorl %r13d, %r13d
movl 0x4(%rsp), %r14d
movq 0x8(%r15), %rax
testq %rax, %rax
je 0xbdb2
cmpq 0x1021e(%rip), %rax     # 0x1bfa0
je 0xbd8b
movq (%r15), %rdi
callq *%rax
jmp 0xbdaa
movq %r15, %rdi
callq 0x4540
movq (%r15), %rsi
leaq 0xa545(%rip), %rdx      # 0x162e2
movq %rax, %rdi
movl $0x55f, %ecx            # imm = 0x55F
callq 0x4280
movq $0x0, 0x8(%r15)
movq 0xf0(%rsp), %rax
cmpq %r12, %rax
je 0xbdcc
movq %rax, (%r15)
movq 0xf8(%rsp), %rax
jmp 0xbdf9
cmpq $0x0, 0xf8(%rsp)
je 0xbde5
leaq 0xa9e8(%rip), %rdi      # 0x167c6
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 0xbe19
leaq 0xa4d9(%rip), %rdx      # 0x162e2
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