// File: /workspace/github_c_makefile_star2_O1/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, %rbx
movq %rsi, %r12
movq %rdi, %r15
movl $0x6f0, %esi            # imm = 0x6F0
callq 0x2e951
testq %rax, %rax
je 0x48931
movq %rax, %r14
movq %r13, -0x58(%rbp)
movq %rbx, -0x38(%rbp)
movq %r12, -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 0x36946
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 0x49141
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 0x49141
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 0x49141
leaq 0x2c8(%r14), %rdi
movq %r14, %rsi
callq 0x45b96
leaq 0x308(%r14), %rdi
movq %r14, %rsi
callq 0x45b96
leaq 0x288(%r14), %rdi
movq %r14, %rsi
callq 0x45b96
leaq 0x348(%r14), %rdi
movq %r14, %rsi
callq 0x45b96
movaps 0x2cddb(%rip), %xmm0    # 0x755d0
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, 0x550(%r14)
movups %xmm0, 0x520(%r14)
movups %xmm0, 0x540(%r14)
movq %r14, 0x530(%r14)
movq %r14, 0x538(%r14)
movl %r13d, 0x550(%r14)
movl $0x20, %eax
movl %eax, 0x528(%r14)
movl %eax, 0x4f0(%r14)
movl $0x2, 0x518(%r14)
leaq 0x100(%r14), %rdi
callq 0x3a3ee
leaq 0x2c31b(%rip), %rsi     # 0x74c20
movq %r12, %rdi
callq 0x336fc
testl %eax, %eax
jne 0x4893e
movl 0x240(%r14), %r13d
testl %r13d, %r13d
je 0x4893b
decl %r13d
imull 0x248(%r14), %r13d
addq 0x238(%r14), %r13
jmp 0x4893e
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x48a74
xorl %r13d, %r13d
testq %r13, %r13
je 0x48a58
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r13)
movups %xmm0, 0x30(%r13)
movups %xmm0, (%r13)
movups %xmm0, 0x20(%r13)
movq %r14, 0x10(%r13)
movq %r14, 0x18(%r13)
movl $0x0, 0x30(%r13)
movl $0x20, 0x8(%r13)
leaq 0x2c2a3(%rip), %rsi     # 0x74c20
movq %r12, %rdi
callq 0x336fc
testl %eax, %eax
je 0x4898d
xorl %eax, %eax
jmp 0x489a9
movl 0x240(%r14), %eax
testl %eax, %eax
je 0x48989
decl %eax
imull 0x248(%r14), %eax
addq 0x238(%r14), %rax
testq %rax, %rax
je 0x48a58
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, (%rax)
movups %xmm0, 0x20(%rax)
movq %r14, 0x10(%rax)
movq %r14, 0x18(%rax)
movl $0x0, 0x30(%rax)
movq $0x1, (%rax)
movl $0x8, 0x8(%rax)
leaq 0x2c238(%rip), %rsi     # 0x74c20
movq %r12, %rdi
callq 0x336fc
testl %eax, %eax
je 0x489f8
xorl %eax, %eax
jmp 0x48a14
movl 0x240(%r14), %eax
testl %eax, %eax
je 0x489f4
decl %eax
imull 0x248(%r14), %eax
addq 0x238(%r14), %rax
testq %rax, %rax
je 0x48a58
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, (%rax)
movups %xmm0, 0x20(%rax)
movq %r14, 0x10(%rax)
movq %r14, 0x18(%rax)
movl $0x0, 0x30(%rax)
movq $0x0, (%rax)
movl $0x8, 0x8(%rax)
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x45353
testl %eax, %eax
je 0x48a8f
movq %r14, %rdi
callq 0x2ea67
movq %r15, %rdi
movq %r14, %rsi
callq 0x2eb38
movl $0xffffffb9, %eax       # imm = 0xFFFFFFB9
movq -0x30(%rbp), %r12
testq %r12, %r12
je 0x48a80
xorl %r14d, %r14d
movq %r14, (%r12)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movups 0xc0(%r15), %xmm0
movaps %xmm0, -0x50(%rbp)
leaq 0x568(%r14), %r12
xorl %r13d, %r13d
movl $0x170, %edx            # imm = 0x170
movq %r12, %rdi
xorl %esi, %esi
callq 0xc360
movq %r14, 0x568(%r14)
movaps -0x50(%rbp), %xmm0
movups %xmm0, 0x6b0(%r14)
leaq 0x570(%r14), %rdi
movq %r14, %rsi
callq 0x45b96
leaq 0x5f0(%r14), %rdi
movq %r14, %rsi
callq 0x45b96
leaq 0x638(%r14), %rcx
movq 0xf0(%r14), %rax
movl 0x10(%rax), %eax
movl %eax, 0x648(%r14)
movq %r12, 0x638(%r14)
movl $0x10, 0x64c(%r14)
movq %r13, 0x640(%r14)
movb $0x0, 0x680(%r14)
movq 0x568(%r14), %rax
movaps 0x2cab4(%rip), %xmm0    # 0x755e0
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 0x2de20(%rip), %rax     # 0x769ab
leaq -0x68(%rbp), %rdx
movq %rax, (%rdx)
movl $0xc46, 0x8(%rdx)       # imm = 0xC46
movq %r14, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x491c7
movq 0xc0(%r15), %r12
movq 0xc8(%r15), %r13
movq 0x630(%r14), %rdi
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x48bd4
movq %rax, %rbx
callq 0x4955d
movq 0x8(%rbx), %rax
movq %rbx, %rdi
jmp 0x48bbe
movq %r12, 0x6b0(%r14)
movq %r13, 0x6b8(%r14)
movq -0x50(%rbp), %r13
movq %r13, 0x630(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x6c0(%r14)
movl $0x0, 0x6d0(%r14)
movq -0x58(%rbp), %rsi
testq %rsi, %rsi
je 0x48c21
movq %r14, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x48f38
movl $0x0, 0xe0(%r15)
movl 0xe8(%r15), %eax
testb $0x4, %al
movq -0x30(%rbp), %r12
movq -0x38(%rbp), %rsi
je 0x48c5f
movq $0x0, 0xd8(%r15)
movl $0x0, 0xe4(%r15)
andl $-0x5, %eax
movl %eax, 0xe8(%r15)
movq %r14, %rdi
callq 0x49077
cmpl $0x0, 0x6d0(%r14)
je 0x48c8e
movq %r14, %rdi
callq 0x2ea67
movq %r15, %rdi
movq %r14, %rsi
callq 0x2eb38
movl $0xffffffba, %eax       # imm = 0xFFFFFFBA
jmp 0x48a74
cmpl $0xea12cd72, 0x6e8(%r14) # imm = 0xEA12CD72
jne 0x48d07
movl $0xba851227, 0x6e8(%r14) # imm = 0xBA851227
movq 0x630(%r14), %rdi
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x48cc7
movq %rax, %rbx
callq 0x4955d
movq 0x8(%rbx), %rax
movq %rbx, %rdi
jmp 0x48cb1
xorps %xmm0, %xmm0
movups %xmm0, 0x6b0(%r14)
movq %r13, 0x630(%r14)
movups %xmm0, 0x6c0(%r14)
movl $0x0, 0x6d0(%r14)
movq %r14, %rdi
movl $0x1, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x493c1
testl %eax, %eax
je 0x48d24
movq %r14, %rdi
callq 0x2ea67
movq %r15, %rdi
movq %r14, %rsi
callq 0x2eb38
movl $0xffffffb9, %eax       # imm = 0xFFFFFFB9
jmp 0x48a79
xorps %xmm0, %xmm0
movups %xmm0, 0x4a0(%r14)
movups %xmm0, 0x4c0(%r14)
movups %xmm0, 0x490(%r14)
movq %r14, 0x4a0(%r14)
movups %xmm0, 0x4b0(%r14)
movq %r14, 0x4a8(%r14)
movl $0x0, 0x4c0(%r14)
movl $0x20, 0x498(%r14)
movq 0xf0(%r14), %rax
movl 0x10(%rax), %esi
movq %r14, %rdi
callq 0x414b8
movq %rax, 0x258(%r14)
testq %rax, %rax
je 0x48d07
movq %r14, %rax
addq $0x388, %rax            # imm = 0x388
leaq -0xc41e(%rip), %rcx     # 0x3c97f
movq %rcx, 0x4f8(%r14)
movq %rax, 0x500(%r14)
movl $0x8, %r13d
leaq 0x4ac98(%rip), %r12     # 0x93a50
movq -0x8(%r13,%r12), %rsi
movq (%r13,%r12), %rdx
movq %r14, %rdi
movq %r14, %rcx
callq 0x3dc37
testl %eax, %eax
jne 0x48de1
leaq 0x10(%r13), %rcx
cmpq $0x1d8, %r13            # imm = 0x1D8
movq %rcx, %r13
jne 0x48db8
testl %eax, %eax
movq -0x30(%rbp), %r12
jne 0x48d07
xorl %r13d, %r13d
leaq 0x2c099(%rip), %rbx     # 0x74e90
movq %r14, %rdi
callq 0x312af
testq %rax, %rax
je 0x48e39
movq %rax, %r12
movslq (%r13,%rbx), %rdx
addq %rbx, %rdx
movq %r14, %rdi
movl $0x6, %esi
movq %rax, %rcx
xorl %eax, %eax
callq 0x47850
xorl %ecx, %ecx
testl %eax, %eax
jne 0x48e40
movq %r14, %rdi
movq %r12, %rsi
callq 0x313be
movb $0x1, %cl
movl -0x38(%rbp), %eax
jmp 0x48e40
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
testb %cl, %cl
je 0x48e6f
addq $0x4, %r13
movl %eax, -0x38(%rbp)
cmpq $0x24, %r13
jne 0x48df7
movl 0x3f8(%r14), %eax
testl %eax, %eax
je 0x48e7d
decl %eax
imull 0x400(%r14), %eax
addq 0x3f0(%r14), %rax
jmp 0x48e7f
testl %eax, %eax
movq -0x30(%rbp), %r12
jne 0x48d07
jmp 0x48ebb
xorl %eax, %eax
movq -0x30(%rbp), %r12
testq %rax, %rax
je 0x48e8d
movq (%rax), %rcx
jmp 0x48e94
leaq 0x2f5a1(%rip), %rcx     # 0x78435
testq %rax, %rax
je 0x48e9f
movl 0x8(%rax), %r8d
jmp 0x48ea5
movl $0x8, %r8d
leaq 0x2f579(%rip), %rdx     # 0x78425
movq %r14, %rdi
movl $0x8, %esi
xorl %eax, %eax
callq 0x47850
movq %r14, %rdi
callq 0x505d6
movq %r14, %rdi
callq 0x50798
leaq 0x2dad6(%rip), %rdx     # 0x769a8
movq %r14, %rdi
movl $0x2, %esi
xorl %eax, %eax
callq 0x47850
cmpl $0x2, 0x4e1c8(%rip)     # 0x970b0
jb 0x48f09
movq 0x4e1af(%rip), %rax     # 0x970a0
movl $0x2, %edi
callq *0x10(%rax)
movq %rax, 0xb8(%r14)
testq %rax, %rax
je 0x48d07
movq 0xf8(%r15), %rax
testq %rax, %rax
je 0x48f23
movq %rax, 0x6d8(%r14)
movq %r14, 0x6e0(%rax)
movq %r14, 0xf8(%r15)
incl 0x100(%r15)
xorl %eax, %eax
jmp 0x48a7c