// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x1e0, %rsp            # imm = 0x1E0
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3540
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x3570
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x9175
jmp 0x9417
movq -0x20(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
movb $0x0, %al
callq 0x34e0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jge 0x91dc
movq -0x10(%rbp), %rax
movq %rax, -0x1b0(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x1a8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x31b0
movq -0x1b0(%rbp), %rdi
movq -0x1a8(%rbp), %rdx
movq %rax, %r8
leaq 0x3060(%rip), %rsi      # 0xc224
leaq 0x2020(%rip), %rcx      # 0xb1eb
xorl %eax, %eax
movl %eax, %r9d
movb $0x0, %al
callq 0x3510
jmp 0x9417
movl -0x2c(%rbp), %edi
leaq -0xc0(%rbp), %rsi
callq 0x35e0
cmpl $-0x1, %eax
jne 0x9247
movq -0x10(%rbp), %rax
movq %rax, -0x1c0(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x1b8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x31b0
movq -0x1c0(%rbp), %rdi
movq -0x1b8(%rbp), %rdx
movq %rax, %r8
leaq 0x3012(%rip), %rsi      # 0xc239
leaq 0x1fbd(%rip), %rcx      # 0xb1eb
xorl %eax, %eax
movl %eax, %r9d
movb $0x0, %al
callq 0x3510
movl -0x2c(%rbp), %edi
callq 0x3290
jmp 0x9417
movq -0x28(%rbp), %rdi
movq -0x90(%rbp), %rax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
leaq 0x2fee(%rip), %rdx      # 0xc24e
movl $0x4f, %ecx
callq 0x34c0
movq %rax, -0xc8(%rbp)
movl -0x2c(%rbp), %edi
movq -0xc8(%rbp), %rsi
movq -0x90(%rbp), %rax
movslq %eax, %rdx
callq 0x32f0
cmpq -0x90(%rbp), %rax
je 0x9306
movq -0x10(%rbp), %rax
movq %rax, -0x1d0(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x1c8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x31b0
movq -0x1d0(%rbp), %rdi
movq -0x1c8(%rbp), %rdx
movq %rax, %r8
leaq 0x2f92(%rip), %rsi      # 0xc25c
leaq 0x1f1a(%rip), %rcx      # 0xb1eb
xorl %eax, %eax
movl %eax, %r9d
movb $0x0, %al
callq 0x3510
movl -0x2c(%rbp), %edi
callq 0x3290
movq -0x28(%rbp), %rdi
movq -0xc8(%rbp), %rsi
leaq 0x2f57(%rip), %rdx      # 0xc24e
movl $0x54, %ecx
callq 0x31f0
jmp 0x9417
movl -0x2c(%rbp), %edi
callq 0x3290
cmpl $0x0, %eax
je 0x937e
movq -0x10(%rbp), %rax
movq %rax, -0x1e0(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x1d8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x31b0
movq -0x1e0(%rbp), %rdi
movq -0x1d8(%rbp), %rdx
movq %rax, %r8
leaq 0x2f2a(%rip), %rsi      # 0xc274
leaq 0x1e9a(%rip), %rcx      # 0xb1eb
xorl %eax, %eax
movl %eax, %r9d
movb $0x0, %al
callq 0x3510
movq -0x28(%rbp), %rdi
movq -0xc8(%rbp), %rsi
leaq 0x2edf(%rip), %rdx      # 0xc24e
movl $0x5a, %ecx
callq 0x31f0
jmp 0x9417
movq -0xc8(%rbp), %rax
movq -0x90(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0xc8(%rbp), %rdx
xorl %ecx, %ecx
leaq -0xd0(%rbp), %r8
callq 0x3590
movl %eax, -0x30(%rbp)
cmpl $0x2, -0x30(%rbp)
jne 0x93bd
movl $0x0, -0x30(%rbp)
cmpl $0x1, -0x30(%rbp)
jne 0x93f3
leaq -0x1a0(%rbp), %rdi
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
leaq 0x2ead(%rip), %rsi      # 0xc289
movb $0x0, %al
callq 0x35a0
movq -0x10(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x3400
movq -0x28(%rbp), %rdi
movq -0xc8(%rbp), %rsi
leaq 0x2e49(%rip), %rdx      # 0xc24e
movl $0x6d, %ecx
callq 0x31f0
movl -0x30(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x941e
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x1e0, %rsp            # imm = 0x1E0
popq %rbp
retq
nopw (%rax,%rax)