// File: /workspace/github_c_makefile_star2_O0/haxlang[P]hax/haxUtil.c
// Function: Hax_SetResult
void
Hax_SetResult(
    Hax_Interp *interp,		/* Interpreter with which to associate the
				 * return value. */
    char *string,		/* Value to be returned.  If NULL,
				 * the result is set to an empty string. */
    Hax_FreeProc *freeProc	/* Gives information about the string:
				 * HAX_STATIC, HAX_VOLATILE, or the address
				 * of a Hax_FreeProc such as free. */)
{
    Interp *iPtr = (Interp *) interp;
    Hax_Memoryp *memoryp = iPtr->memoryp;
    int length;
    Hax_FreeProc *oldFreeProc = iPtr->freeProc;
    char *oldResult = iPtr->result;

    iPtr->freeProc = freeProc;
    if (string == NULL) {
	iPtr->resultSpace[0] = 0;
	iPtr->result = iPtr->resultSpace;
	iPtr->freeProc = 0;
    } else if (freeProc == HAX_VOLATILE) {
	length = strlen(string);
	if (length > HAX_RESULT_SIZE) {
	    iPtr->result = (char *) ckalloc(memoryp, (unsigned) length+1);
	    iPtr->freeProc = (Hax_FreeProc *) free;
	} else {
	    iPtr->result = iPtr->resultSpace;
	    iPtr->freeProc = 0;
	}
	strcpy(iPtr->result, string);
    } else {
	iPtr->result = string;
    }

    /*
     * If the old result was dynamically-allocated, free it up.  Do it
     * here, rather than at the beginning, in case the new result value
     * was part of the old result value.
     */

    if (oldFreeProc != 0) {
	if (oldFreeProc == (Hax_FreeProc *) free) {
	    ckfree(memoryp, oldResult);
	} else {
	    (*oldFreeProc)(oldResult);
	}
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x280(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
cmpq $0x0, -0x10(%rbp)
jne 0x17c33
movq -0x20(%rbp), %rax
movb $0x0, 0x1b0(%rax)
movq -0x20(%rbp), %rcx
addq $0x1b0, %rcx            # imm = 0x1B0
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x8(%rax)
jmp 0x17ccc
movq $-0x1, %rax
cmpq %rax, -0x18(%rbp)
jne 0x17cbf
movq -0x10(%rbp), %rdi
callq 0x41b0
movl %eax, -0x2c(%rbp)
cmpl $0xc7, -0x2c(%rbp)
jle 0x17c8f
movq -0x28(%rbp), %rdi
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x7bc0(%rip), %rdx      # 0x1f82a
movl $0x3c8, %ecx            # imm = 0x3C8
callq 0x44c0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq 0xb31f(%rip), %rcx      # 0x22fa8
movq %rcx, 0x8(%rax)
jmp 0x17cad
movq -0x20(%rbp), %rcx
addq $0x1b0, %rcx            # imm = 0x1B0
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x40d0
jmp 0x17cca
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
jmp 0x17ccc
cmpq $0x0, -0x38(%rbp)
je 0x17d07
movq 0xb2ce(%rip), %rax      # 0x22fa8
cmpq %rax, -0x38(%rbp)
jne 0x17cfb
movq -0x28(%rbp), %rdi
movq -0x40(%rbp), %rsi
leaq 0x7b3b(%rip), %rdx      # 0x1f82a
movl $0x3db, %ecx            # imm = 0x3DB
callq 0x4260
jmp 0x17d05
movq -0x38(%rbp), %rax
movq -0x40(%rbp), %rdi
callq *%rax
jmp 0x17d07
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)