// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: ProcessScript
static sxi32 ProcessScript(
	jx9 *pEngine,          /* Running JX9 engine */
	jx9_vm **ppVm,         /* OUT: A pointer to the virtual machine */
	SyString *pScript,     /* Raw JX9 script to compile */
	sxi32 iFlags,          /* Compile-time flags */
	const char *zFilePath  /* File path if script come from a file. NULL otherwise */
	)
{
	jx9_vm *pVm;
	int rc;
	/* Allocate a new virtual machine */
	pVm = (jx9_vm *)SyMemBackendPoolAlloc(&pEngine->sAllocator, sizeof(jx9_vm));
	if( pVm == 0 ){
		/* If the supplied memory subsystem is so sick that we are unable to allocate
		 * a tiny chunk of memory, there is no much we can do here. */
		if( ppVm ){
			*ppVm = 0;
		}
		return JX9_NOMEM;
	}
	if( iFlags < 0 ){
		/* Default compile-time flags */
		iFlags = 0;
	}
	/* Initialize the Virtual Machine */
	rc = jx9VmInit(pVm, &(*pEngine));
	if( rc != JX9_OK ){
		SyMemBackendPoolFree(&pEngine->sAllocator, pVm);
		if( ppVm ){
			*ppVm = 0;
		}
		return JX9_VM_ERR;
	}
	if( zFilePath ){
		/* Push processed file path */
		jx9VmPushFilePath(pVm, zFilePath, -1, TRUE, 0);
	}
	/* Reset the error message consumer */
	SyBlobReset(&pEngine->xConf.sErrConsumer);
	/* Compile the script */
	jx9CompileScript(pVm, &(*pScript), iFlags);
	if( pVm->sCodeGen.nErr > 0 || pVm == 0){
		sxu32 nErr = pVm->sCodeGen.nErr;
		/* Compilation error or null ppVm pointer, release this VM */
		SyMemBackendRelease(&pVm->sAllocator);
		SyMemBackendPoolFree(&pEngine->sAllocator, pVm);
		if( ppVm ){
			*ppVm = 0;
		}
		return nErr > 0 ? JX9_COMPILE_ERR : JX9_OK;
	}
	/* Prepare the virtual machine for bytecode execution */
	rc = jx9VmMakeReady(pVm);
	if( rc != JX9_OK ){
		goto Release;
	}
	/* Install local import path which is the current directory */
	jx9_vm_config(pVm, JX9_VM_CONFIG_IMPORT_PATH, "./");
#if defined(JX9_ENABLE_THREADS)
	if( sJx9MPGlobal.nThreadingLevel > JX9_THREAD_LEVEL_SINGLE ){
		 /* Associate a recursive mutex with this instance */
		 pVm->pMutex = SyMutexNew(sJx9MPGlobal.pMutexMethods, SXMUTEX_TYPE_RECURSIVE);
		 if( pVm->pMutex == 0 ){
			 goto Release;
		 }
	 }
#endif
	/* Script successfully compiled, link to the list of active virtual machines */
	MACRO_LD_PUSH(pEngine->pVms, pVm);
	pEngine->iVm++;
	/* Point to the freshly created VM */
	*ppVm = pVm;
	/* Ready to execute JX9 bytecode */
	return JX9_OK;
Release:
	SyMemBackendRelease(&pVm->sAllocator);
	SyMemBackendPoolFree(&pEngine->sAllocator, pVm);
	*ppVm = 0;
	return JX9_VM_ERR;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %r13
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r15
movl $0x6f0, %esi            # imm = 0x6F0
callq 0x2e481
testq %rax, %rax
je 0x478cd
movq %rax, %r14
movq %r13, -0x58(%rbp)
movq %r12, -0x38(%rbp)
movq %rbx, -0x30(%rbp)
xorl %r13d, %r13d
movl $0x6f0, %edx            # imm = 0x6F0
movq %rax, %rdi
xorl %esi, %esi
callq 0xc360
movq %r15, 0xc0(%r14)
movq %r14, %rdi
movq %r15, %rsi
callq 0x3622f
leaq 0xc8(%r14), %r12
movq $0x18, 0xe0(%r14)
movq %r14, 0xc8(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0xd0(%r14)
movq %r13, 0xe8(%r14)
movq %r12, %rdi
movl $0xff, %esi
callq 0x480bd
movq %r12, 0xf0(%r14)
leaq 0x208(%r14), %rdi
movl $0x40, %ebx
movq %rbx, 0x220(%r14)
movq %r14, 0x208(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x210(%r14)
movq %r13, 0x228(%r14)
movl $0xff, %esi
callq 0x480bd
xorps %xmm0, %xmm0
movups %xmm0, 0x390(%r14)
movq %r14, 0x388(%r14)
movl %r13d, 0x3a0(%r14)
movups %xmm0, 0x3b0(%r14)
movq %r14, 0x3a8(%r14)
movl %r13d, 0x3c0(%r14)
movups %xmm0, 0x3d0(%r14)
movq %r14, 0x3c8(%r14)
movl %r13d, 0x3e0(%r14)
leaq 0x230(%r14), %r12
movq %rbx, 0x248(%r14)
movq %r14, 0x230(%r14)
movups %xmm0, 0x238(%r14)
movq %r13, 0x250(%r14)
movq %r12, %rdi
movl $0xff, %esi
callq 0x480bd
leaq 0x2c8(%r14), %rdi
movq %r14, %rsi
callq 0x44d43
leaq 0x308(%r14), %rdi
movq %r14, %rsi
callq 0x44d43
leaq 0x288(%r14), %rdi
movq %r14, %rsi
callq 0x44d43
leaq 0x348(%r14), %rdi
movq %r14, %rsi
callq 0x44d43
movaps 0x2be96(%rip), %xmm0    # 0x73630
movups %xmm0, 0x270(%r14)
movq %r14, 0x260(%r14)
movq %r13, 0x268(%r14)
movq %r13, 0x280(%r14)
movl $0x10, %eax
movq %rax, 0x400(%r14)
movq %r14, 0x3e8(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x3f0(%r14)
movq %r13, 0x408(%r14)
movq %rax, 0x428(%r14)
movq %r14, 0x410(%r14)
movups %xmm0, 0x418(%r14)
movq %r13, 0x430(%r14)
movq %rax, 0x450(%r14)
movq %r14, 0x438(%r14)
movups %xmm0, 0x440(%r14)
movq %r13, 0x458(%r14)
movl %r13d, 0x474(%r14)
movl %r13d, 0x470(%r14)
movq $0x8, 0x478(%r14)
movq %r14, 0x460(%r14)
movq %r13, 0x468(%r14)
movq %r13, 0x480(%r14)
movups %xmm0, 0x530(%r14)
movups %xmm0, 0x520(%r14)
movups %xmm0, 0x540(%r14)
movups %xmm0, 0x550(%r14)
movq %r14, 0x530(%r14)
movq %r14, 0x538(%r14)
movl $0x20, %eax
movl %eax, 0x528(%r14)
movl %eax, 0x4f0(%r14)
movl $0x2, 0x518(%r14)
leaq 0x100(%r14), %rdi
callq 0x39afa
leaq 0x2b38d(%rip), %rsi     # 0x72c30
movq %r12, %rdi
callq 0x33094
testl %eax, %eax
je 0x478ec
movq %r14, %rdi
callq 0x2e588
movq %r15, %rdi
movq %r14, %rsi
callq 0x2e659
movl $0xffffffb9, %eax       # imm = 0xFFFFFFB9
movq -0x30(%rbp), %rbx
jmp 0x478d2
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %rbx, %rbx
je 0x478dd
xorl %r14d, %r14d
movq %r14, (%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x240(%r14), %eax
testl %eax, %eax
je 0x478af
movq 0x238(%r14), %rcx
testq %rcx, %rcx
je 0x478af
decl %eax
imull 0x248(%r14), %eax
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rcx,%rax)
movups %xmm0, (%rcx,%rax)
movups %xmm0, 0x30(%rcx,%rax)
movups %xmm0, 0x20(%rcx,%rax)
movq %r14, 0x10(%rcx,%rax)
movq %r14, 0x18(%rcx,%rax)
movl $0x20, 0x8(%rcx,%rax)
leaq 0x2b2f4(%rip), %rsi     # 0x72c30
movq %r12, %rdi
callq 0x33094
testl %eax, %eax
jne 0x478af
movl 0x240(%r14), %eax
testl %eax, %eax
je 0x478af
movq 0x238(%r14), %rcx
testq %rcx, %rcx
je 0x478af
decl %eax
imull 0x248(%r14), %eax
xorps %xmm0, %xmm0
movups %xmm0, 0xc(%rcx,%rax)
movups %xmm0, 0x2c(%rcx,%rax)
movups %xmm0, 0x1c(%rcx,%rax)
movl $0x0, 0x3c(%rcx,%rax)
movq %r14, 0x10(%rcx,%rax)
movups %xmm0, 0x20(%rcx,%rax)
movq %r14, 0x18(%rcx,%rax)
movq $0x1, (%rcx,%rax)
movl $0x8, 0x8(%rcx,%rax)
leaq 0x2b27b(%rip), %rsi     # 0x72c30
movq %r12, %rdi
callq 0x33094
testl %eax, %eax
jne 0x478af
movl 0x240(%r14), %eax
testl %eax, %eax
je 0x478af
movq 0x238(%r14), %rcx
testq %rcx, %rcx
je 0x478af
decl %eax
imull 0x248(%r14), %eax
xorps %xmm0, %xmm0
movups %xmm0, 0xc(%rcx,%rax)
movups %xmm0, 0x2c(%rcx,%rax)
movups %xmm0, 0x1c(%rcx,%rax)
movl $0x0, 0x3c(%rcx,%rax)
movq %r14, 0x10(%rcx,%rax)
movups %xmm0, 0x20(%rcx,%rax)
movq %r14, 0x18(%rcx,%rax)
movq $0x0, (%rcx,%rax)
movl $0x8, 0x8(%rcx,%rax)
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x44512
testl %eax, %eax
jne 0x478af
movups 0xc0(%r15), %xmm0
movaps %xmm0, -0x50(%rbp)
leaq 0x568(%r14), %rbx
leaq 0x570(%r14), %r12
xorl %r13d, %r13d
movl $0x168, %edx            # imm = 0x168
movq %r12, %rdi
xorl %esi, %esi
callq 0xc360
movq %r14, 0x568(%r14)
movaps -0x50(%rbp), %xmm0
movups %xmm0, 0x6b0(%r14)
movq %r12, %rdi
movq %r14, %rsi
callq 0x44d43
leaq 0x5f0(%r14), %rdi
movq %r14, %rsi
callq 0x44d43
leaq 0x638(%r14), %rcx
movq 0xf0(%r14), %rax
movl 0x10(%rax), %eax
movl %eax, 0x648(%r14)
movq %rbx, 0x638(%r14)
movl $0x10, 0x64c(%r14)
movq %r13, 0x640(%r14)
movb $0x0, 0x680(%r14)
movq 0x568(%r14), %rax
movaps 0x2bb65(%rip), %xmm0    # 0x73640
movups %xmm0, 0x660(%r14)
movq %rax, 0x650(%r14)
movq %r13, 0x658(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x670(%r14)
movq $0x8, 0x6a0(%r14)
movq %rax, 0x688(%r14)
movups %xmm0, 0x690(%r14)
movq %r13, 0x6a8(%r14)
movq %rcx, -0x50(%rbp)
movq %rcx, 0x630(%r14)
movl $0xea12cd72, 0x6e8(%r14) # imm = 0xEA12CD72
leaq 0x2ce79(%rip), %rax     # 0x749b3
leaq -0x68(%rbp), %rdx
movq %rax, (%rdx)
movl $0xc46, 0x8(%rdx)       # imm = 0xC46
movq %r14, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x48143
movq 0xc0(%r15), %r13
movq 0xc8(%r15), %r12
movq 0x630(%r14), %rdi
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x47b83
movq %rax, %rbx
callq 0x484ee
movq 0x8(%rbx), %rax
movq %rbx, %rdi
jmp 0x47b6d
movq %r13, 0x6b0(%r14)
movq %r12, 0x6b8(%r14)
movq -0x50(%rbp), %r12
movq %r12, 0x630(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x6c0(%r14)
movl $0x0, 0x6d0(%r14)
movq -0x58(%rbp), %rsi
testq %rsi, %rsi
je 0x47bd0
movq %r14, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x47ec3
movl $0x0, 0xe0(%r15)
movl 0xe8(%r15), %eax
testb $0x4, %al
movq -0x30(%rbp), %rbx
movq -0x38(%rbp), %rsi
je 0x47c0e
movq $0x0, 0xd8(%r15)
movl $0x0, 0xe4(%r15)
andl $-0x5, %eax
movl %eax, 0xe8(%r15)
movq %r14, %rdi
callq 0x48003
cmpl $0x0, 0x6d0(%r14)
je 0x47c3d
movq %r14, %rdi
callq 0x2e588
movq %r15, %rdi
movq %r14, %rsi
callq 0x2e659
movl $0xffffffba, %eax       # imm = 0xFFFFFFBA
jmp 0x478d2
cmpl $0xea12cd72, 0x6e8(%r14) # imm = 0xEA12CD72
jne 0x47cc5
leaq 0x6b0(%r14), %rax
movq %rax, -0x38(%rbp)
leaq 0x6c0(%r14), %r13
movl $0xba851227, 0x6e8(%r14) # imm = 0xBA851227
movq 0x630(%r14), %rdi
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x47c88
movq %rax, %rbx
callq 0x484ee
movq 0x8(%rbx), %rax
movq %rbx, %rdi
jmp 0x47c72
xorps %xmm0, %xmm0
movq -0x38(%rbp), %rax
movups %xmm0, (%rax)
movq %r12, 0x630(%r14)
movups %xmm0, (%r13)
movl $0x0, 0x10(%r13)
movq %r14, %rdi
movl $0x1, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x48365
testl %eax, %eax
movq -0x30(%rbp), %rbx
je 0x47ce2
movq %r14, %rdi
callq 0x2e588
movq %r15, %rdi
movq %r14, %rsi
callq 0x2e659
movl $0xffffffb9, %eax       # imm = 0xFFFFFFB9
jmp 0x478d7
xorps %xmm0, %xmm0
movups %xmm0, 0x4a0(%r14)
movups %xmm0, 0x490(%r14)
movups %xmm0, 0x4c0(%r14)
movq %r14, 0x4a0(%r14)
movups %xmm0, 0x4b0(%r14)
movq %r14, 0x4a8(%r14)
movl $0x20, 0x498(%r14)
movq 0xf0(%r14), %rax
movl 0x10(%rax), %esi
movq %r14, %rdi
callq 0x40a72
movq %rax, 0x258(%r14)
testq %rax, %rax
je 0x47cc5
movq %r14, %rax
addq $0x388, %rax            # imm = 0x388
leaq -0xbd58(%rip), %rcx     # 0x3bff4
movq %rcx, 0x4f8(%r14)
movq %rax, 0x500(%r14)
movl $0x8, %r13d
leaq 0x49ce9(%rip), %r12     # 0x91a50
movq -0x8(%r13,%r12), %rsi
movq (%r13,%r12), %rdx
movq %r14, %rdi
movq %r14, %rcx
callq 0x3d2cb
testl %eax, %eax
jne 0x47d90
leaq 0x10(%r13), %rcx
cmpq $0x1d8, %r13            # imm = 0x1D8
movq %rcx, %r13
jne 0x47d67
testl %eax, %eax
movq -0x30(%rbp), %rbx
jne 0x47cc5
xorl %r13d, %r13d
movq %r14, %rdi
callq 0x30d0a
testq %rax, %rax
je 0x47cc5
movq %rax, %r12
leaq 0x2b0e6(%rip), %rax     # 0x72ea0
movslq (%r13,%rax), %rdx
addq %rax, %rdx
movq %r14, %rdi
movl $0x6, %esi
movq %r12, %rcx
xorl %eax, %eax
callq 0x46833
testl %eax, %eax
jne 0x47cc5
movq %r14, %rdi
movq %r12, %rsi
callq 0x30e1a
addq $0x4, %r13
cmpq $0x24, %r13
jne 0x47d9f
movl 0x3f8(%r14), %eax
movl $0x8, %r8d
leaq 0x2e63b(%rip), %rcx     # 0x76440
testl %eax, %eax
je 0x47e28
movq 0x3f0(%r14), %rdx
testq %rdx, %rdx
je 0x47e28
decl %eax
imull 0x400(%r14), %eax
movq (%rdx,%rax), %rcx
movl 0x8(%rdx,%rax), %r8d
leaq 0x2e601(%rip), %rdx     # 0x76430
movq %r14, %rdi
movl $0x8, %esi
xorl %eax, %eax
callq 0x46833
movq %r14, %rdi
callq 0x4ef62
movq %r14, %rdi
callq 0x4f0d9
leaq 0x2cb5b(%rip), %rdx     # 0x749b0
movq %r14, %rdi
movl $0x2, %esi
xorl %eax, %eax
callq 0x46833
cmpl $0x2, 0x4d245(%rip)     # 0x950b0
movq -0x30(%rbp), %rbx
jb 0x47e90
movq 0x4d228(%rip), %rax     # 0x950a0
movl $0x2, %edi
callq *0x10(%rax)
movq %rax, 0xb8(%r14)
testq %rax, %rax
je 0x47cc5
movq 0xf8(%r15), %rax
testq %rax, %rax
je 0x47eaa
movq %rax, 0x6d8(%r14)
movq %r14, 0x6e0(%rax)
movq %r14, 0xf8(%r15)
incl 0x100(%r15)
xorl %eax, %eax
movq -0x30(%rbp), %rbx
jmp 0x478da