// File: /workspace/github_c_makefile_star2_O2/haxlang[P]hax/haxUnixUtil.c
// Function: Hax_EvalFile
int
Hax_EvalFile(
    Hax_Interp *interp,		/* Interpreter in which to process file. */
    ClientData clientData,	/* Unix Client Data */
    char *fileName		/* Name of file to process.  Tilde-substitution
				 * will be performed on this name. */)
{
    Hax_Memoryp *memoryp;
    int fileId, result;
    struct stat statBuf;
    char *cmdBuffer, *end;

    memoryp = Hax_GetMemoryp (interp);

    fileName = Hax_TildeSubst(interp, clientData, fileName);
    if (fileName == NULL) {
	goto error;
    }
    fileId = open(fileName, O_RDONLY, 0);
    if (fileId < 0) {
	Hax_AppendResult(interp, "couldn't read file \"", fileName,
		"\": ", Hax_UnixError(interp), (char *) NULL);
	goto error;
    }
    if (fstat(fileId, &statBuf) == -1) {
	Hax_AppendResult(interp, "couldn't stat file \"", fileName,
		"\": ", Hax_UnixError(interp), (char *) NULL);
	close(fileId);
	goto error;
    }
    cmdBuffer = (char *) ckalloc(memoryp, (unsigned) statBuf.st_size+1);
    if (read(fileId, cmdBuffer, (int) statBuf.st_size) != statBuf.st_size) {
	Hax_AppendResult(interp, "error in reading file \"", fileName,
		"\": ", Hax_UnixError(interp), (char *) NULL);
	close(fileId);
	ckfree(memoryp, cmdBuffer);
	goto error;
    }
    if (close(fileId) != 0) {
	Hax_AppendResult(interp, "error closing file \"", fileName,
		"\": ", Hax_UnixError(interp), (char *) NULL);
	ckfree(memoryp, cmdBuffer);
	goto error;
    }
    cmdBuffer[statBuf.st_size] = 0;
    result = Hax_Eval(interp, fileName, cmdBuffer, 0, &end);
    if (result == HAX_RETURN) {
	result = HAX_OK;
    }
    if (result == HAX_ERROR) {
	char msg[200];

	/*
	 * Record information telling where the error occurred.
	 */

	sprintf(msg, "\n    (file \"%.150s\" line %d)", fileName,
		interp->errorLine);
	Hax_AddErrorInfo(interp, msg);
    }
    ckfree(memoryp, cmdBuffer);
    return result;

    error:
    return HAX_ERROR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r15
callq 0x3530
movq %rax, %r14
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x3560
pushq $0x1
popq %rbx
testq %rax, %rax
je 0x6dae
movq %rax, %r12
movq %rax, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x34d0
testl %eax, %eax
js 0x6ca6
movl %eax, %ebp
leaq 0x10(%rsp), %rsi
movl %eax, %edi
callq 0x35d0
cmpl $-0x1, %eax
je 0x6cd4
movq 0x40(%rsp), %r13
leal 0x1(%r13), %esi
leaq 0x26a2(%rip), %rdx      # 0x92da
pushq $0x4f
popq %rcx
movq %r14, %rdi
callq 0x34b0
movq %r14, (%rsp)
movq %rax, %r14
movslq %r13d, %rdx
movl %ebp, %edi
movq %rax, %rsi
callq 0x32e0
cmpq %r13, %rax
jne 0x6d09
movl %ebp, %edi
callq 0x3280
testl %eax, %eax
je 0x6d44
movq %r15, %rdi
callq 0x31b0
leaq 0x2682(%rip), %rsi      # 0x9300
leaq 0x1566(%rip), %rcx      # 0x81eb
movq %r15, %rdi
movq %r12, %rdx
movq %rax, %r8
xorl %r9d, %r9d
xorl %eax, %eax
callq 0x3500
leaq 0x263b(%rip), %rdx      # 0x92da
pushq $0x5a
jmp 0x6da1
movq %r15, %rdi
callq 0x31b0
leaq 0x25fb(%rip), %rsi      # 0x92b0
leaq 0x152f(%rip), %rcx      # 0x81eb
movq %r15, %rdi
movq %r12, %rdx
movq %rax, %r8
xorl %r9d, %r9d
xorl %eax, %eax
callq 0x3500
jmp 0x6dae
movq %r15, %rdi
callq 0x31b0
leaq 0x25e2(%rip), %rsi      # 0x92c5
leaq 0x1501(%rip), %rcx      # 0x81eb
movq %r15, %rdi
movq %r12, %rdx
movq %rax, %r8
xorl %r9d, %r9d
xorl %eax, %eax
callq 0x3500
movl %ebp, %edi
callq 0x3280
jmp 0x6dae
movq %r15, %rdi
callq 0x31b0
leaq 0x25d0(%rip), %rsi      # 0x92e8
leaq 0x14cc(%rip), %rcx      # 0x81eb
movq %r15, %rdi
movq %r12, %rdx
movq %rax, %r8
xorl %r9d, %r9d
xorl %eax, %eax
callq 0x3500
movl %ebp, %edi
callq 0x3280
leaq 0x259a(%rip), %rdx      # 0x92da
pushq $0x54
jmp 0x6da1
movb $0x0, (%r14,%r13)
xorl %ebp, %ebp
leaq 0x8(%rsp), %r8
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x3580
movl %eax, %ebx
cmpl $0x2, %eax
cmovel %ebp, %ebx
cmpl $0x1, %ebx
jne 0x6d98
movl 0x10(%r15), %ecx
leaq 0x259d(%rip), %rsi      # 0x9315
leaq 0xa0(%rsp), %rbp
movq %rbp, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x3590
movq %r15, %rdi
movq %rbp, %rsi
callq 0x33f0
leaq 0x253b(%rip), %rdx      # 0x92da
pushq $0x6d
popq %rcx
movq (%rsp), %rdi
movq %r14, %rsi
callq 0x31f0
movl %ebx, %eax
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq