// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: VmExecIncludedFile
static sxi32 VmExecIncludedFile(
	 jx9_context *pCtx, /* Call Context */
	 SyString *pPath,   /* Script path or URL*/
	 int IncludeOnce    /* TRUE if called from import() or require_once() */
	 )
{
	sxi32 rc;
#ifndef JX9_DISABLE_BUILTIN_FUNC
	const jx9_io_stream *pStream;
	SyBlob sContents;
	void *pHandle;
	jx9_vm *pVm;
	int isNew;
	/* Initialize fields */
	pVm = pCtx->pVm;
	SyBlobInit(&sContents, &pVm->sAllocator);
	isNew = 0;
	/* Extract the associated stream */
	pStream = jx9VmGetStreamDevice(pVm, &pPath->zString, pPath->nByte);
	/*
	 * Open the file or the URL [i.e: http://jx9.symisc.net/example/hello.jx9.txt"] 
	 * in a read-only mode.
	 */
	pHandle = jx9StreamOpenHandle(pVm, pStream,pPath->zString, JX9_IO_OPEN_RDONLY, TRUE, 0, TRUE, &isNew);
	if( pHandle == 0 ){
		return SXERR_IO;
	}
	rc = SXRET_OK; /* Stupid cc warning */
	if( IncludeOnce && !isNew ){
		/* Already included */
		rc = SXERR_EXISTS;
	}else{
		/* Read the whole file contents */
		rc = jx9StreamReadWholeFile(pHandle, pStream, &sContents);
		if( rc == SXRET_OK ){
			SyString sScript;
			/* Compile and execute the script */
			SyStringInitFromBuf(&sScript, SyBlobData(&sContents), SyBlobLength(&sContents));
			VmEvalChunk(pCtx->pVm, &(*pCtx), &sScript, 0, TRUE);
		}
	}
	/* Pop from the set of included file */
	(void)SySetPop(&pVm->aFiles);
	/* Close the handle */
	jx9StreamCloseHandle(pStream, pHandle);
	/* Release the working buffer */
	SyBlobRelease(&sContents);
#else
	pCtx = 0; /* cc warning */
	pPath = 0;
	IncludeOnce = 0;
	rc = SXERR_IO;
#endif /* JX9_DISABLE_BUILTIN_FUNC */
	return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x58bb0
movl $0x0, -0x5c(%rbp)
movq -0x58(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x18(%rbp), %rax
movl 0x8(%rax), %edx
callq 0x8e570
movq %rax, -0x28(%rbp)
movq -0x58(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
movl $0x1, %r8d
xorl %eax, %eax
movl %eax, %r9d
leaq -0x5c(%rbp), %rax
movl %r8d, %ecx
movl $0x1, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x8e7e0
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0x8e4c7
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x8e556
movl $0x0, -0x20(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x8e4e3
cmpl $0x0, -0x5c(%rbp)
jne 0x8e4e3
movl $0xfffffff5, -0x20(%rbp) # imm = 0xFFFFFFF5
jmp 0x8e52a
movq -0x50(%rbp), %rdi
movq -0x28(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0x8e9f0
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
jne 0x8e528
movq -0x40(%rbp), %rax
movq %rax, -0x70(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rdi
movq -0x10(%rbp), %rsi
leaq -0x70(%rbp), %rdx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x7e5b0
jmp 0x8e52a
movq -0x58(%rbp), %rdi
addq $0x3e8, %rdi            # imm = 0x3E8
callq 0x70e40
movq -0x28(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x8ea80
leaq -0x48(%rbp), %rdi
callq 0x58c00
movl -0x20(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)