// File: /workspace/github_c_makefile_star2_O3/haxlang[P]hax/haxCkalloc.c
// Function: MemoryCmd
static int
MemoryCmd (
    ClientData  clientData,
    Hax_Interp *interp,
    int         argc,
    char      **argv)
{
    Interp *iPtr = (Interp *) interp;
    Memoryp *memCtx = (Memoryp *) iPtr->memoryp;

    if (argc < 2) {
	Hax_AppendResult(interp, "wrong # args:  should be \"",
		argv[0], " option [args..]\"", (char *) NULL);
	return HAX_ERROR;
    }

    if (strcmp(argv[1],"trace") == 0) {
        if (argc != 3)
            goto bad_suboption;
        memCtx->alloc_tracing = (strcmp(argv[2],"on") == 0);
        return HAX_OK;
    }
    if (strcmp(argv[1],"init") == 0) {
        if (argc != 3)
            goto bad_suboption;
        memCtx->init_malloced_bodies = (strcmp(argv[2],"on") == 0);
        return HAX_OK;
    }
    if (strcmp(argv[1],"validate") == 0) {
        if (argc != 3)
             goto bad_suboption;
        memCtx->validate_memory = (strcmp(argv[2],"on") == 0);
        return HAX_OK;
    }
    if (strcmp(argv[1],"trace_on_at_malloc") == 0) {
        if (argc != 3)
            goto argError;
        if (Hax_GetInt(interp, argv[2], &memCtx->trace_on_at_malloc) != HAX_OK)
                return HAX_ERROR;
         return HAX_OK;
    }
    if (strcmp(argv[1],"break_on_malloc") == 0) {
        if (argc != 3)
            goto argError;
        if (Hax_GetInt(interp, argv[2], &memCtx->break_on_malloc) != HAX_OK)
                return HAX_ERROR;
        return HAX_OK;
    }

    if (strcmp(argv[1],"info") == 0) {
        dump_memory_info(memCtx);
        return HAX_OK;
    }
    if (strcmp(argv[1],"active") == 0) {
        if (argc != 2) {
	    Hax_AppendResult(interp, "wrong # args:  should be \"",
		    argv[0], " active", (char *) NULL);
	    return HAX_ERROR;
	}
        if (Hax_DumpActiveMemory (iPtr->memoryp) != HAX_OK) {
	    Hax_AppendResult(interp, "error dumping active memory ",
		    (char *) NULL);
	    return HAX_ERROR;
	}
	return HAX_OK;
    }
    Hax_AppendResult(interp, "bad option \"", argv[1],
	    "\":  should be info, init, active, break_on_malloc, ",
	    "trace_on_at_malloc, trace, or validate", (char *) NULL);
    return HAX_ERROR;

argError:
    Hax_AppendResult(interp, "wrong # args:  should be \"", argv[0],
	    " ", argv[1], "count\"", (char *) NULL);
    return HAX_ERROR;

bad_suboption:
    Hax_AppendResult(interp, "wrong # args:  should be \"", argv[0],
	    " ", argv[1], " on|off\"", (char *) NULL);
    return HAX_ERROR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r12
movq %rsi, %r14
cmpl $0x1, %edx
jg 0x73c9
movq (%r12), %rdx
leaq 0xd310(%rip), %rsi      # 0x146c0
leaq 0xd324(%rip), %rcx      # 0x146db
movq %r14, %rdi
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x4510
jmp 0x7541
movl %edx, %ebp
movq 0x280(%r14), %rbx
movq 0x8(%r12), %r15
leaq 0xd04a(%rip), %rsi      # 0x14428
movq %r15, %rdi
callq 0x4320
testl %eax, %eax
je 0x749b
leaq 0xd2f8(%rip), %rsi      # 0x146ed
movq %r15, %rdi
callq 0x4320
testl %eax, %eax
je 0x74c3
leaq 0xd370(%rip), %rsi      # 0x1477c
movq %r15, %rdi
callq 0x4320
testl %eax, %eax
je 0x74eb
leaq 0xd2cf(%rip), %rsi      # 0x146f2
movq %r15, %rdi
callq 0x4320
testl %eax, %eax
je 0x7545
leaq 0xd2cb(%rip), %rsi      # 0x14705
movq %r15, %rdi
callq 0x4320
testl %eax, %eax
je 0x7555
leaq 0xe0fd(%rip), %rsi      # 0x1554e
movq %r15, %rdi
callq 0x4320
testl %eax, %eax
je 0x7598
leaq 0xd2ae(%rip), %rsi      # 0x14716
movq %r15, %rdi
callq 0x4320
testl %eax, %eax
je 0x75a2
leaq 0xd29e(%rip), %rsi      # 0x1471d
leaq 0xd2a4(%rip), %rcx      # 0x1472a
leaq 0xd2d1(%rip), %r8       # 0x1475e
movq %r14, %rdi
movq %r15, %rdx
xorl %r9d, %r9d
jmp 0x753a
cmpl $0x3, %ebp
jne 0x7513
movq 0x10(%r12), %rcx
xorl %eax, %eax
cmpb $0x6f, (%rcx)
jne 0x74bb
cmpb $0x6e, 0x1(%rcx)
jne 0x74bb
xorl %eax, %eax
cmpb $0x0, 0x2(%rcx)
sete %al
movl %eax, 0x40(%rbx)
jmp 0x75af
cmpl $0x3, %ebp
jne 0x7513
movq 0x10(%r12), %rcx
xorl %eax, %eax
cmpb $0x6f, (%rcx)
jne 0x74e3
cmpb $0x6e, 0x1(%rcx)
jne 0x74e3
xorl %eax, %eax
cmpb $0x0, 0x2(%rcx)
sete %al
movl %eax, 0x44(%rbx)
jmp 0x75af
cmpl $0x3, %ebp
jne 0x7513
movq 0x10(%r12), %rcx
xorl %eax, %eax
cmpb $0x6f, (%rcx)
jne 0x750b
cmpb $0x6e, 0x1(%rcx)
jne 0x750b
xorl %eax, %eax
cmpb $0x0, 0x2(%rcx)
sete %al
movl %eax, 0x48(%rbx)
jmp 0x75af
movq (%r12), %rdx
movq $0x0, (%rsp)
leaq 0xd19a(%rip), %rsi      # 0x146c0
leaq 0xe707(%rip), %rcx      # 0x15c34
leaq 0xd251(%rip), %r9       # 0x14785
movq %r14, %rdi
movq %r15, %r8
xorl %eax, %eax
callq 0x4510
movb $0x1, %al
jmp 0x75b1
cmpl $0x3, %ebp
jne 0x7575
movq 0x10(%r12), %rsi
addq $0x3c, %rbx
jmp 0x7563
cmpl $0x3, %ebp
jne 0x7575
movq 0x10(%r12), %rsi
addq $0x38, %rbx
movq %r14, %rdi
movq %rbx, %rdx
callq 0x41c0
testl %eax, %eax
setne %al
jmp 0x75b1
movq (%r12), %rdx
movq $0x0, (%rsp)
leaq 0xd138(%rip), %rsi      # 0x146c0
leaq 0xe6a5(%rip), %rcx      # 0x15c34
leaq 0xd6e0(%rip), %r9       # 0x14c76
jmp 0x7534
movq %rbx, %rdi
callq 0x71cb
jmp 0x75af
cmpl $0x2, %ebp
jne 0x75c1
movq %rbx, %rdi
callq 0x4180
xorl %eax, %eax
movzbl %al, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq (%r12), %rdx
leaq 0xd0f4(%rip), %rsi      # 0x146c0
leaq 0xd142(%rip), %rcx      # 0x14715
jmp 0x73b7