// File: /workspace/github_c_makefile_star2_O3/haxlang[P]hax/haxCmdMZ.c
// Function: Hax_TraceCmd
int
Hax_TraceCmd(
    ClientData dummy,			/* Not used. */
    Hax_Interp *interp,			/* Current interpreter. */
    int argc,				/* Number of arguments. */
    char **argv				/* Argument strings. */)
{
    Interp *iPtr = (Interp *) interp;
    Hax_Memoryp *memoryp = iPtr->memoryp;
    char c;
    int length;

    if (argc < 2) {
	Hax_AppendResult(interp, "too few args: should be \"",
		argv[0], " option [arg arg ...]\"", (char *) NULL);
	return HAX_ERROR;
    }
    c = argv[1][1];
    length = strlen(argv[1]);
    if ((c == 'a') && (strncmp(argv[1], "variable", length) == 0)
	    && (length >= 2)) {
	char *p;
	int flags, length;
	TraceVarInfo *tvarPtr;

	if (argc != 5) {
	    Hax_AppendResult(interp, "wrong # args: should be \"",
		    argv[0], " variable name ops command\"", (char *) NULL);
	    return HAX_ERROR;
	}

	flags = 0;
	for (p = argv[3] ; *p != 0; p++) {
	    if (*p == 'r') {
		flags |= HAX_TRACE_READS;
	    } else if (*p == 'w') {
		flags |= HAX_TRACE_WRITES;
	    } else if (*p == 'u') {
		flags |= HAX_TRACE_UNSETS;
	    } else {
		goto badOps;
	    }
	}
	if (flags == 0) {
	    goto badOps;
	}

	length = strlen(argv[4]);
	tvarPtr = (TraceVarInfo *) ckalloc(memoryp, (unsigned)
		(sizeof(TraceVarInfo) - sizeof(tvarPtr->command) + length + 1));
	tvarPtr->flags = flags;
	tvarPtr->length = length;
	flags |= HAX_TRACE_UNSETS;
	strcpy(tvarPtr->command, argv[4]);
	if (Hax_TraceVar(interp, argv[2], flags, TraceVarProc,
		(ClientData) tvarPtr) != HAX_OK) {
	    ckfree(memoryp, (char *) tvarPtr);
	    return HAX_ERROR;
	}
    } else if ((c == 'd') && (strncmp(argv[1], "vdelete", length)
	    && (length >= 2)) == 0) {
	char *p;
	int flags, length;
	TraceVarInfo *tvarPtr;
	ClientData clientData;

	if (argc != 5) {
	    Hax_AppendResult(interp, "wrong # args: should be \"",
		    argv[0], " vdelete name ops command\"", (char *) NULL);
	    return HAX_ERROR;
	}

	flags = 0;
	for (p = argv[3] ; *p != 0; p++) {
	    if (*p == 'r') {
		flags |= HAX_TRACE_READS;
	    } else if (*p == 'w') {
		flags |= HAX_TRACE_WRITES;
	    } else if (*p == 'u') {
		flags |= HAX_TRACE_UNSETS;
	    } else {
		goto badOps;
	    }
	}
	if (flags == 0) {
	    goto badOps;
	}

	/*
	 * Search through all of our traces on this variable to
	 * see if there's one with the given command.  If so, then
	 * delete the first one that matches.
	 */

	length = strlen(argv[4]);
	clientData = 0;
	while ((clientData = Hax_VarTraceInfo(interp, argv[2], 0,
		TraceVarProc, clientData)) != 0) {
	    tvarPtr = (TraceVarInfo *) clientData;
	    if ((tvarPtr->length == length) && (tvarPtr->flags == flags)
		    && (strncmp(argv[4], tvarPtr->command, length) == 0)) {
		Hax_UntraceVar(interp, argv[2], flags | HAX_TRACE_UNSETS,
			TraceVarProc, clientData);
		ckfree(memoryp, (char *) tvarPtr);
		break;
	    }
	}
    } else if ((c == 'i') && (strncmp(argv[1], "vinfo", length) == 0)
	    && (length >= 2)) {
	ClientData clientData;
	char ops[4], *p;
	char *prefix = (char *) "{";

	if (argc != 3) {
	    Hax_AppendResult(interp, "wrong # args: should be \"",
		    argv[0], " vinfo name\"", (char *) NULL);
	    return HAX_ERROR;
	}
	clientData = 0;
	while ((clientData = Hax_VarTraceInfo(interp, argv[2], 0,
		TraceVarProc, clientData)) != 0) {
	    TraceVarInfo *tvarPtr = (TraceVarInfo *) clientData;
	    p = ops;
	    if (tvarPtr->flags & HAX_TRACE_READS) {
		*p = 'r';
		p++;
	    }
	    if (tvarPtr->flags & HAX_TRACE_WRITES) {
		*p = 'w';
		p++;
	    }
	    if (tvarPtr->flags & HAX_TRACE_UNSETS) {
		*p = 'u';
		p++;
	    }
	    *p = '\0';
	    Hax_AppendResult(interp, prefix, (char *) NULL);
	    Hax_AppendElement(interp, ops, 1);
	    Hax_AppendElement(interp, tvarPtr->command, 0);
	    Hax_AppendResult(interp, "}", (char *) NULL);
	    prefix = (char *) " {";
	}
    } else {
	Hax_AppendResult(interp, "bad option \"", argv[1],
		"\": should be variable, vdelete, or vinfo",
		(char *) NULL);
	return HAX_ERROR;
    }
    return HAX_OK;

    badOps:
    Hax_AppendResult(interp, "bad operations \"", argv[3],
	    "\": should be one or more of rwu", (char *) NULL);
    return HAX_ERROR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r14
movq %rsi, %rbx
cmpl $0x1, %edx
jg 0xb2c5
movq (%r14), %rdx
leaq 0xa1f2(%rip), %rsi      # 0x154a8
leaq 0xa205(%rip), %rcx      # 0x154c2
movq %rbx, %rdi
jmp 0xb50b
movl %edx, %ebp
movq 0x280(%rbx), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%r14), %r12
movzbl 0x1(%r12), %r13d
movq %r12, %rdi
callq 0x41d0
movq %rax, %r15
cmpl $0x69, %r13d
je 0xb3f1
cmpl $0x64, %r13d
je 0xb37e
cmpl $0x61, %r13d
jne 0xb4f7
movslq %r15d, %rdx
leaq 0xb097(%rip), %rsi      # 0x163a7
movq %r12, %rdi
callq 0x40c0
testl %eax, %eax
sete %al
cmpl $0x2, %r15d
setge %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xb4f7
cmpl $0x5, %ebp
jne 0xb559
movq 0x18(%r14), %rdx
xorl %ebp, %ebp
movq %rdx, %rax
movq 0x8(%rsp), %r13
movzbl (%rax), %ecx
cmpl $0x74, %ecx
jle 0xb363
cmpl $0x75, %ecx
je 0xb372
cmpl $0x77, %ecx
jne 0xb684
movl $0x20, %esi
jmp 0xb377
movl $0x10, %esi
cmpl $0x72, %ecx
je 0xb377
jmp 0xb608
movl $0x40, %esi
orl %esi, %ebp
incq %rax
jmp 0xb346
movslq %r15d, %rdx
leaq 0xa16d(%rip), %rsi      # 0x154f5
movq %r12, %rdi
callq 0x40c0
testl %eax, %eax
sete %al
cmpl $0x2, %r15d
setl %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0xb4f7
cmpl $0x5, %ebp
jne 0xb52d
movq 0x18(%r14), %rdx
xorl %ebp, %ebp
movq %rdx, %rax
movzbl (%rax), %ecx
cmpl $0x74, %ecx
jle 0xb3d6
cmpl $0x75, %ecx
je 0xb3e5
cmpl $0x77, %ecx
jne 0xb684
movl $0x20, %esi
jmp 0xb3ea
movl $0x10, %esi
cmpl $0x72, %ecx
je 0xb3ea
jmp 0xb56f
movl $0x40, %esi
orl %esi, %ebp
incq %rax
jmp 0xb3b9
movslq %r15d, %rdx
leaq 0xa152(%rip), %rsi      # 0x1554d
movq %r12, %rdi
callq 0x40c0
testl %eax, %eax
sete %al
cmpl $0x2, %r15d
setge %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xb4f7
cmpl $0x3, %ebp
jne 0xb543
movq 0x10(%r14), %rsi
leaq 0x2a5(%rip), %rcx       # 0xb6d3
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %edx, %edx
xorl %r8d, %r8d
callq 0x44e0
testq %rax, %rax
je 0xb51b
movq %rax, %r15
leaq 0xa0d7(%rip), %rsi      # 0x15528
leaq 0x4(%rsp), %r13
leaq 0xa0ca(%rip), %rbp      # 0x15527
movl (%r15), %ecx
movq %r13, %rax
testb $0x10, %cl
je 0xb475
movb $0x72, 0x4(%rsp)
movl (%r15), %ecx
leaq 0x5(%rsp), %rax
testb $0x20, %cl
je 0xb483
movb $0x77, (%rax)
incq %rax
movl (%r15), %ecx
testb $0x40, %cl
je 0xb48e
movb $0x75, (%rax)
incq %rax
movb $0x0, (%rax)
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0x4510
movq %rbx, %rdi
movq %r13, %rsi
movl $0x1, %edx
callq 0x4050
leaq 0x8(%r15), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x4050
movq %rbx, %rdi
leaq 0xa060(%rip), %rsi      # 0x15525
xorl %edx, %edx
xorl %eax, %eax
callq 0x4510
movq 0x10(%r14), %rsi
movq %rbx, %rdi
xorl %edx, %edx
leaq 0x1f5(%rip), %rcx       # 0xb6d3
movq %r15, %r8
callq 0x44e0
movq %rax, %r15
movq %rbp, %rsi
testq %rax, %rax
jne 0xb45d
jmp 0xb51b
leaq 0x921f(%rip), %rsi      # 0x1471d
leaq 0xa025(%rip), %rcx      # 0x1552a
movq %rbx, %rdi
movq %r12, %rdx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x4510
movl $0x1, %r12d
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r14), %rdx
leaq 0x9329(%rip), %rsi      # 0x14860
leaq 0x9fbf(%rip), %rcx      # 0x154fd
jmp 0xb2bd
movq (%r14), %rdx
leaq 0x9313(%rip), %rsi      # 0x14860
leaq 0x9fc4(%rip), %rcx      # 0x15518
jmp 0xb2bd
movq (%r14), %rdx
leaq 0x92fd(%rip), %rsi      # 0x14860
leaq 0x9f6f(%rip), %rcx      # 0x154d9
jmp 0xb2bd
testl %ecx, %ecx
jne 0xb684
testl %ebp, %ebp
je 0xb684
movq 0x20(%r14), %rdi
callq 0x41d0
movq %rax, %r15
movq 0x10(%r14), %rsi
leaq 0x13d(%rip), %rcx       # 0xb6d3
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %edx, %edx
xorl %r8d, %r8d
callq 0x44e0
testq %rax, %rax
je 0xb51b
movq %rax, %r13
movslq %r15d, %rax
movq %rax, 0x10(%rsp)
cmpl %r15d, 0x4(%r13)
jne 0xb5e0
cmpl %ebp, (%r13)
jne 0xb5e0
movq 0x20(%r14), %rdi
leaq 0x8(%r13), %rsi
movq 0x10(%rsp), %rdx
callq 0x40c0
testl %eax, %eax
je 0xb697
movq 0x10(%r14), %rsi
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %edx, %edx
leaq 0xe0(%rip), %rcx        # 0xb6d3
movq %r13, %r8
callq 0x44e0
movq %rax, %r13
testq %rax, %rax
jne 0xb5ba
jmp 0xb51b
testl %ecx, %ecx
jne 0xb684
testl %ebp, %ebp
je 0xb684
movq 0x20(%r14), %rdi
callq 0x41d0
movq %rax, %r12
leal 0x9(%rax), %esi
leaq 0x9ac8(%rip), %rdx      # 0x150ee
movq %r13, %rdi
movl $0x48f, %ecx            # imm = 0x48F
callq 0x44d0
movq %rax, %r15
movl %ebp, (%rax)
movl %r12d, 0x4(%rax)
orl $0x40, %ebp
leaq 0x8(%rax), %rdi
movq 0x20(%r14), %rsi
callq 0x40f0
movq 0x10(%r14), %rsi
leaq 0x7c(%rip), %rcx        # 0xb6d3
movq %rbx, %rdi
movl %ebp, %edx
movq %r15, %r8
callq 0x43a0
testl %eax, %eax
je 0xb6cb
leaq 0x9a7f(%rip), %rdx      # 0x150ee
movq %r13, %rdi
movq %r15, %rsi
movl $0x496, %ecx            # imm = 0x496
callq 0x4280
jmp 0xb515
leaq 0x9ec8(%rip), %rsi      # 0x15553
leaq 0x9ed2(%rip), %rcx      # 0x15564
jmp 0xb2bd
movq 0x10(%r14), %rsi
orl $0x40, %ebp
leaq 0x2e(%rip), %rcx        # 0xb6d3
movq %rbx, %rdi
movl %ebp, %edx
movq %r13, %r8
callq 0x4230
leaq 0x9a35(%rip), %rdx      # 0x150ee
movq 0x8(%rsp), %rdi
movq %r13, %rsi
movl $0x4c5, %ecx            # imm = 0x4C5
callq 0x4280
xorl %r12d, %r12d
jmp 0xb51b