// File: /workspace/github_c_makefile_star2_O0/haxlang[P]hax/haxEnv.c
// Function: EnvTraceProc
static char *
EnvTraceProc(
    ClientData clientData,	/* Unix Client Data */
    Hax_Interp *interp,		/* Interpreter whose "env" variable is
				 * being modified. */
    char *name1,		/* Better be "env". */
    char *name2,		/* Name of variable being modified, or
				 * NULL if whole array is being deleted. */
    int flags			/* Indicates what's happening. */)
{
    UnixClientData *unixClientData = (UnixClientData *) clientData;
    Hax_Memoryp *memoryp;
    char *value;

    memoryp = Hax_GetMemoryp(interp);

    /*
     * First see if the whole "env" variable is being deleted.  If
     * so, just forget about this interpreter.
     */

    if (name2 == NULL) {
	if ((flags & (HAX_TRACE_UNSETS|HAX_TRACE_DESTROYED))
		!= (HAX_TRACE_UNSETS|HAX_TRACE_DESTROYED)) {
	    Hax_Panic((char *) "EnvTraceProc called with confusing arguments");
	}
	if (flags & HAX_INTERP_DESTROYED) {
	    return NULL;
	}
	ckfree(memoryp, unixClientData->haxEnviron);
	unixClientData->environSize = 0;
	unixClientData->haxEnviron = NULL;
	if (unixClientData->destroyProc) {
	    (*unixClientData->destroyProc)(interp, unixClientData);
	}
	return NULL;
    }

    /*
     * If a value is being set, call setenv to do all of the work.
     */

    if (flags & HAX_TRACE_WRITES) {
	value = Hax_GetVar2(interp, (char *) "env", name2, HAX_GLOBAL_ONLY);
	Hax_SetEnv(interp, (ClientData) unixClientData, name2, value, 1);
	if (unixClientData->writeProc) {
	    (*unixClientData->writeProc)(interp, unixClientData, name2, value);
	}
    }

    if (flags & HAX_TRACE_UNSETS) {
	Hax_UnsetEnv(interp, (ClientData) unixClientData, name2);
	if (unixClientData->unsetProc) {
	    (*unixClientData->unsetProc)(interp, unixClientData, name2);
	}
    }
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3540
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x3a67
movl -0x2c(%rbp), %eax
andl $0xc0, %eax
cmpl $0xc0, %eax
je 0x39e9
leaq 0x76ad(%rip), %rdi      # 0xb08f
movb $0x0, %al
callq 0x3130
movl -0x2c(%rbp), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x3a03
movq $0x0, -0x8(%rbp)
jmp 0x3b18
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x68(%rax), %rsi
leaq 0x762e(%rip), %rdx      # 0xb044
movl $0x1bb, %ecx            # imm = 0x1BB
callq 0x31f0
movq -0x38(%rbp), %rax
movl $0x0, 0x60(%rax)
movq -0x38(%rbp), %rax
movq $0x0, 0x68(%rax)
movq -0x38(%rbp), %rax
cmpq $0x0, 0x80(%rax)
je 0x3a5a
movq -0x38(%rbp), %rax
movq 0x80(%rax), %rax
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq *%rax
movq $0x0, -0x8(%rbp)
jmp 0x3b18
movl -0x2c(%rbp), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x3ad1
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0x759e(%rip), %rsi      # 0xb01f
movl $0x1, %ecx
callq 0x3470
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x48(%rbp), %rcx
movl $0x1, %r8d
callq 0x3620
movq -0x38(%rbp), %rax
cmpq $0x0, 0x70(%rax)
je 0x3acf
movq -0x38(%rbp), %rax
movq 0x70(%rax), %rax
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x48(%rbp), %rcx
callq *%rax
jmp 0x3ad1
movl -0x2c(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x3b10
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x33b0
movq -0x38(%rbp), %rax
cmpq $0x0, 0x78(%rax)
je 0x3b0e
movq -0x38(%rbp), %rax
movq 0x78(%rax), %rax
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq *%rax
jmp 0x3b10
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)