// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: jx9_compile_file
JX9_PRIVATE int jx9_compile_file(jx9 *pEngine, const char *zFilePath, jx9_vm **ppOutVm)
{
	const jx9_vfs *pVfs;
	int rc;
	if( ppOutVm ){
		*ppOutVm = 0;
	}
	rc = JX9_OK; /* cc warning */
	if( JX9_ENGINE_MISUSE(pEngine) || SX_EMPTY_STR(zFilePath) ){
		return JX9_CORRUPT;
	}
#if defined(JX9_ENABLE_THREADS)
	 /* Acquire engine mutex */
	 SyMutexEnter(sJx9MPGlobal.pMutexMethods, pEngine->pMutex); /* NO-OP if sJx9MPGlobal.nThreadingLevel != JX9_THREAD_LEVEL_MULTI */
	 if( sJx9MPGlobal.nThreadingLevel > JX9_THREAD_LEVEL_SINGLE && 
		 JX9_THRD_ENGINE_RELEASE(pEngine) ){
			 return JX9_ABORT; /* Another thread have released this instance */
	 }
#endif
	 /*
	  * Check if the underlying vfs implement the memory map
	  * [i.e: mmap() under UNIX/MapViewOfFile() under windows] function.
	  */
	 pVfs = pEngine->pVfs;
	 if( pVfs == 0 || pVfs->xMmap == 0 ){
		 /* Memory map routine not implemented */
		 rc = JX9_IO_ERR;
	 }else{
		 void *pMapView = 0; /* cc warning */
		 jx9_int64 nSize = 0; /* cc warning */
		 SyString sScript;
		 /* Try to get a memory view of the whole file */
		 rc = pVfs->xMmap(zFilePath, &pMapView, &nSize);
		 if( rc != JX9_OK ){
			 /* Assume an IO error */
			 rc = JX9_IO_ERR;
		 }else{
			 /* Compile the file */
			 SyStringInitFromBuf(&sScript, pMapView, nSize);
			 rc = ProcessScript(&(*pEngine), ppOutVm, &sScript,0,zFilePath);
			 /* Release the memory view of the whole file */
			 if( pVfs->xUnmap ){
				 pVfs->xUnmap(pMapView, nSize);
			 }
		 }
	 }
#if defined(JX9_ENABLE_THREADS)
	 /* Leave engine mutex */
	 SyMutexLeave(sJx9MPGlobal.pMutexMethods, pEngine->pMutex); /* NO-OP if sJx9MPGlobal.nThreadingLevel != JX9_THREAD_LEVEL_MULTI */
#endif
	/* Compilation result */
	return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x55326
movq -0x20(%rbp), %rax
movq $0x0, (%rax)
movl $0x0, -0x2c(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x55357
movq -0x10(%rbp), %rax
cmpl $0xf874bcd7, 0x118(%rax) # imm = 0xF874BCD7
jne 0x55357
cmpq $0x0, -0x18(%rbp)
je 0x55357
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x55363
movl $0xffffffe8, -0x4(%rbp) # imm = 0xFFFFFFE8
jmp 0x55495
movq -0x10(%rbp), %rax
cmpq $0x0, 0xf0(%rax)
je 0x55389
movq 0x9a120(%rip), %rax     # 0xef498
movq 0x20(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0xf0(%rcx), %rdi
callq *%rax
cmpl $0x1, 0x9a118(%rip)     # 0xef4a8
jbe 0x553ae
movq -0x10(%rbp), %rax
cmpl $0xf874bcd7, 0x118(%rax) # imm = 0xF874BCD7
je 0x553ae
movl $0xfffffff6, -0x4(%rbp) # imm = 0xFFFFFFF6
jmp 0x55495
movq -0x10(%rbp), %rax
movq 0xb8(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x553d2
movq -0x28(%rbp), %rax
cmpq $0x0, 0x108(%rax)
jne 0x553de
movl $0xfffffffe, -0x2c(%rbp) # imm = 0xFFFFFFFE
jmp 0x55469
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x28(%rbp), %rax
movq 0x108(%rax), %rax
movq -0x18(%rbp), %rdi
leaq -0x38(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq *%rax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x55419
movl $0xfffffffe, -0x2c(%rbp) # imm = 0xFFFFFFFE
jmp 0x55467
movq -0x38(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rax
movl %eax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %r8
leaq -0x50(%rbp), %rdx
xorl %ecx, %ecx
callq 0x7da20
movl %eax, -0x2c(%rbp)
movq -0x28(%rbp), %rax
cmpq $0x0, 0x110(%rax)
je 0x55465
movq -0x28(%rbp), %rax
movq 0x110(%rax), %rax
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq *%rax
jmp 0x55467
jmp 0x55469
movq -0x10(%rbp), %rax
cmpq $0x0, 0xf0(%rax)
je 0x5548f
movq 0x9a01a(%rip), %rax     # 0xef498
movq 0x30(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0xf0(%rcx), %rdi
callq *%rax
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nop