// File: /workspace/github_c_makefile_star2_O2/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 $0x38, %rsp
movq %rcx, %r13
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r15
movl $0x6f0, %esi            # imm = 0x6F0
callq 0x279f7
testq %rax, %rax
je 0x3e4ce
movq %rax, %r14
movq %rbx, -0x38(%rbp)
movq %rax, %rdi
movl $0x6f0, %esi            # imm = 0x6F0
callq 0x27aea
movq %r15, 0xc0(%r14)
movq %r14, %rdi
movq %r15, %rsi
callq 0x2eaa1
leaq 0xc8(%r14), %rbx
movq $0x18, 0xe0(%r14)
movq %r14, 0xc8(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0xd0(%r14)
andq $0x0, 0xe8(%r14)
movq %rbx, %rdi
movl $0xff, %esi
callq 0x3eba8
movq %rbx, 0xf0(%r14)
leaq 0x208(%r14), %rdi
pushq $0x40
popq %rbx
movq %rbx, 0x220(%r14)
movq %r14, 0x208(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x210(%r14)
andq $0x0, 0x228(%r14)
movl $0xff, %esi
callq 0x3eba8
xorps %xmm0, %xmm0
movups %xmm0, 0x390(%r14)
movq %r14, 0x388(%r14)
andl $0x0, 0x3a0(%r14)
movups %xmm0, 0x3b0(%r14)
movq %r14, 0x3a8(%r14)
andl $0x0, 0x3c0(%r14)
movups %xmm0, 0x3d0(%r14)
movq %r14, 0x3c8(%r14)
andl $0x0, 0x3e0(%r14)
leaq 0x230(%r14), %rdi
movq %rbx, 0x248(%r14)
movq %r14, 0x230(%r14)
movups %xmm0, 0x238(%r14)
andq $0x0, 0x250(%r14)
movl $0xff, %esi
callq 0x3eba8
leaq 0x2c8(%r14), %rdi
movq %r14, %rsi
callq 0x3bcf0
leaq 0x308(%r14), %rdi
movq %r14, %rsi
callq 0x3bcf0
leaq 0x288(%r14), %rdi
movq %r14, %rsi
callq 0x3bcf0
leaq 0x348(%r14), %rdi
movq %r14, %rsi
callq 0x3bcf0
movaps 0x252a3(%rip), %xmm0    # 0x63610
movups %xmm0, 0x270(%r14)
movq %r14, 0x260(%r14)
andq $0x0, 0x268(%r14)
andq $0x0, 0x280(%r14)
pushq $0x10
popq %rax
movq %rax, 0x400(%r14)
movq %r14, 0x3e8(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x3f0(%r14)
andq $0x0, 0x408(%r14)
movq %rax, 0x428(%r14)
movq %r14, 0x410(%r14)
movups %xmm0, 0x418(%r14)
andq $0x0, 0x430(%r14)
movq %rax, 0x450(%r14)
movq %r14, 0x438(%r14)
movups %xmm0, 0x440(%r14)
andq $0x0, 0x458(%r14)
andl $0x0, 0x474(%r14)
andl $0x0, 0x470(%r14)
movq $0x8, 0x478(%r14)
movq %r14, 0x460(%r14)
andq $0x0, 0x468(%r14)
andq $0x0, 0x480(%r14)
leaq 0x520(%r14), %rsi
movq %r14, %rdi
callq 0x35772
movl $0x20, 0x4f0(%r14)
movl $0x2, 0x518(%r14)
leaq 0x100(%r14), %rdi
callq 0x320f6
movq %r14, %rdi
xorl %esi, %esi
callq 0x3ebdc
testq %rax, %rax
je 0x3e4b2
movq %r14, %rdi
movq %rax, %rsi
callq 0x35772
movq %r14, %rdi
xorl %esi, %esi
callq 0x3ebdc
testq %rax, %rax
je 0x3e4b2
pushq $0x1
popq %rdx
movq %r14, %rdi
movq %rax, %rsi
callq 0x3ec2e
movq %r14, %rdi
xorl %esi, %esi
callq 0x3ebdc
testq %rax, %rax
je 0x3e4b2
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x3ec2e
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3b5b5
testl %eax, %eax
je 0x3e4eb
movq %r14, %rdi
callq 0x27b23
movq %r15, %rdi
movq %r14, %rsi
callq 0x27bf8
pushq $-0x47
popq %rax
movq -0x38(%rbp), %rbx
jmp 0x3e4d1
pushq $-0x1
popq %rax
testq %rbx, %rbx
je 0x3e4dc
xorl %r14d, %r14d
movq %r14, (%rbx)
addq $0x38, %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), %rdi
movq %rdi, -0x30(%rbp)
movl $0x170, %esi            # imm = 0x170
callq 0x27aea
movq %r14, 0x568(%r14)
movaps -0x50(%rbp), %xmm0
movups %xmm0, 0x6b0(%r14)
leaq 0x570(%r14), %rdi
movq %r14, %rsi
callq 0x3bcf0
leaq 0x5f0(%r14), %rdi
movq %r14, %rsi
callq 0x3bcf0
leaq 0x638(%r14), %rbx
movq 0xf0(%r14), %rax
movl 0x10(%rax), %ecx
pushq $0x10
popq %rdx
movq -0x30(%rbp), %rdi
movq %rbx, %rsi
xorl %r8d, %r8d
callq 0x3ee1f
movq %rbx, 0x630(%r14)
movl $0xea12cd72, 0x6e8(%r14) # imm = 0xEA12CD72
leaq 0x2641a(%rip), %rax     # 0x64993
leaq -0x60(%rbp), %rdx
movq %rax, (%rdx)
movl $0xc46, 0x8(%rdx)       # imm = 0xC46
movq %r14, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x3ec7d
movq 0xc0(%r15), %rsi
movq 0xc8(%r15), %rdx
movq %r14, %rdi
callq 0x3edbb
testq %r13, %r13
je 0x3e5c2
pushq $-0x1
popq %rdx
pushq $0x1
popq %rcx
movq %r14, %rdi
movq %r13, %rsi
xorl %r8d, %r8d
callq 0x3e9f3
leaq 0xd0(%r15), %rdi
callq 0x31b1e
movq %r14, %rdi
movq %r12, %rsi
callq 0x3eaff
cmpl $0x0, 0x6d0(%r14)
movq -0x38(%rbp), %rbx
je 0x3e601
movq %r14, %rdi
callq 0x27b23
movq %r15, %rdi
movq %r14, %rsi
callq 0x27bf8
pushq $-0x46
jmp 0x3e4d0
cmpl $0xea12cd72, 0x6e8(%r14) # imm = 0xEA12CD72
jne 0x3e63e
movl $0xba851227, 0x6e8(%r14) # imm = 0xBA851227
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3edbb
pushq $0x1
popq %rsi
movq %r14, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x3ee6f
testl %eax, %eax
je 0x3e660
movq %r14, %rdi
callq 0x27b23
movq %r15, %rdi
movq %r14, %rsi
callq 0x27bf8
pushq $-0x47
popq %rax
xorl %r14d, %r14d
movq -0x38(%rbp), %rbx
jmp 0x3e4d9
leaq 0x490(%r14), %rsi
movq %r14, %rdi
callq 0x35772
movq 0xf0(%r14), %rax
movl 0x10(%rax), %esi
movq %r14, %rdi
callq 0x3832f
movq %rax, 0x258(%r14)
testq %rax, %rax
je 0x3e63e
movq %r14, %rax
addq $0x388, %rax            # imm = 0x388
leaq -0xa57f(%rip), %rcx     # 0x3411e
movq %rcx, 0x4f8(%r14)
movq %rax, 0x500(%r14)
pushq $0x8
popq %rcx
leaq 0x463ab(%rip), %rbx     # 0x84a60
leaq 0x10(%rcx), %r12
cmpq $0x1f8, %r12            # imm = 0x1F8
je 0x3e6e2
movq -0x8(%rcx,%rbx), %rsi
movq (%rcx,%rbx), %rdx
movq %r14, %rdi
movq %r14, %rcx
callq 0x34fcf
movq %r12, %rcx
testl %eax, %eax
je 0x3e6b5
jmp 0x3e63e
leaq 0x24797(%rip), %rbx     # 0x62e80
xorl %r12d, %r12d
cmpq $0x24, %r12
je 0x3e736
movq %r14, %rdi
callq 0x29e4a
testq %rax, %rax
je 0x3e63e
movq %rax, %r13
movslq (%r12,%rbx), %rdx
addq %rbx, %rdx
movq %r14, %rdi
pushq $0x6
popq %rsi
movq %rax, %rcx
xorl %eax, %eax
callq 0x3d4f8
testl %eax, %eax
jne 0x3e63e
movq %r14, %rdi
movq %r13, %rsi
callq 0x29f5c
addq $0x4, %r12
jmp 0x3e6ec
movl 0x3f8(%r14), %eax
pushq $0x8
popq %r8
leaq 0x27cd8(%rip), %rcx     # 0x66420
testl %eax, %eax
je 0x3e76b
movq 0x3f0(%r14), %rdx
testq %rdx, %rdx
je 0x3e76b
decl %eax
imull 0x400(%r14), %eax
movq (%rdx,%rax), %rcx
movl 0x8(%rdx,%rax), %r8d
leaq 0x27c9e(%rip), %rdx     # 0x66410
xorl %ebx, %ebx
pushq $0x8
popq %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x3d4f8
cmpq $0x7a, %rbx
je 0x3e8a4
movq %rbx, -0x50(%rbp)
cmpl $0xdead2bad, 0x6e8(%r14) # imm = 0xDEAD2BAD
jne 0x3e7a5
movq -0x50(%rbp), %rbx
incq %rbx
jmp 0x3e781
movq -0x50(%rbp), %rax
shlq $0x4, %rax
leaq 0x4648c(%rip), %rcx     # 0x84c40
movq (%rax,%rcx), %r12
movq 0x8(%rax,%rcx), %rax
movq %rax, -0x40(%rbp)
movq %r12, %rdi
callq 0x28e24
movl %eax, %r13d
leaq (%r12,%r13), %rax
movq %rax, -0x30(%rbp)
testl %r13d, %r13d
je 0x3e7fb
movsbq (%r12), %rbx
cmpq $-0x41, %rbx
ja 0x3e7ff
callq 0xc190
movq (%rax), %rax
testb $0x20, 0x1(%rax,%rbx,2)
je 0x3e7ff
incq %r12
decq %r13
jmp 0x3e7d4
movq -0x30(%rbp), %r12
movq %r12, -0x30(%rbp)
movq %r12, -0x60(%rbp)
movl %r13d, -0x58(%rbp)
movq %r13, %r12
subq $0x1, %r13
jb 0x3e79c
movq -0x30(%rbp), %rax
movsbq -0x1(%rax,%r12), %rbx
cmpq $-0x41, %rbx
ja 0x3e833
callq 0xc190
movq (%rax), %rax
testb $0x20, 0x1(%rax,%rbx,2)
jne 0x3e80b
movl %r12d, -0x58(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x3e79c
movq 0xb8(%r14), %rdi
testq %rdi, %rdi
je 0x3e858
movq 0x4986b(%rip), %rax     # 0x880c0
callq *0x20(%rax)
cmpl $0x2, 0x49871(%rip)     # 0x880d0
jb 0x3e872
cmpl $0xdead2bad, 0x6e8(%r14) # imm = 0xDEAD2BAD
je 0x3e79c
movq %r14, %rdi
leaq -0x60(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %r14, %rcx
callq 0x292bb
movq 0xb8(%r14), %rdi
testq %rdi, %rdi
je 0x3e79c
movq 0x49824(%rip), %rax     # 0x880c0
callq *0x30(%rax)
jmp 0x3e79c
pushq $0x8
popq %rbx
leaq 0x46bb2(%rip), %r12     # 0x85460
cmpq $0x768, %rbx            # imm = 0x768
je 0x3e8d0
movq -0x8(%rbx,%r12), %rsi
movq (%rbx,%r12), %rdx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x34fcf
addq $0x10, %rbx
jmp 0x3e8ae
pushq $0x8
popq %rbx
leaq 0x476a6(%rip), %r12     # 0x85f80
cmpq $0x1d8, %rbx            # imm = 0x1D8
je 0x3e8fc
movq -0x8(%rbx,%r12), %rsi
movq (%rbx,%r12), %rdx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x34fcf
addq $0x10, %rbx
jmp 0x3e8da
pushq $0x8
popq %rbx
leaq 0x4784a(%rip), %r12     # 0x86150
cmpq $0x3b8, %rbx            # imm = 0x3B8
je 0x3e934
movq -0x8(%rbx,%r12), %rsi
movq (%rbx,%r12), %rdx
movq 0xc0(%r14), %rax
movq 0xb8(%rax), %rcx
movq %r14, %rdi
callq 0x34fcf
addq $0x10, %rbx
jmp 0x3e906
pushq $0x8
popq %rbx
leaq 0x47bc2(%rip), %r12     # 0x86500
cmpq $0x1f8, %rbx            # imm = 0x1F8
je 0x3e961
movq -0x8(%rbx,%r12), %rsi
movq (%rbx,%r12), %rdx
movq %r14, %rdi
movq %r14, %rcx
callq 0x34fcf
addq $0x10, %rbx
jmp 0x3e93e
leaq 0x46a78(%rip), %rdx     # 0x853e0
pushq $0xb
popq %rbx
movq %r14, %rdi
movl %ebx, %esi
xorl %eax, %eax
callq 0x3d4f8
leaq 0x47d72(%rip), %rdx     # 0x866f0
movq %r14, %rdi
movl %ebx, %esi
xorl %eax, %eax
callq 0x3d4f8
leaq 0x25fff(%rip), %rdx     # 0x64990
pushq $0x2
popq %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x3d4f8
cmpl $0x2, 0x4972b(%rip)     # 0x880d0
jb 0x3e9c4
movq 0x49712(%rip), %rax     # 0x880c0
pushq $0x2
popq %rdi
callq *0x10(%rax)
movq %rax, 0xb8(%r14)
testq %rax, %rax
je 0x3e63e
movq 0xf8(%r15), %rax
testq %rax, %rax
je 0x3e9de
movq %rax, 0x6d8(%r14)
movq %r14, 0x6e0(%rax)
movq %r14, 0xf8(%r15)
incl 0x100(%r15)
xorl %eax, %eax
jmp 0x3e657