// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: VmEvalChunk
static sxi32 VmEvalChunk(
	jx9_vm *pVm,        /* Underlying Virtual Machine */
	jx9_context *pCtx,  /* Call Context */
	SyString *pChunk,   /* JX9 chunk to evaluate */ 
	int iFlags,         /* Compile flag */
	int bTrueReturn     /* TRUE to return execution result */
	)
{
	SySet *pByteCode, aByteCode;
	ProcConsumer xErr = 0;
	void *pErrData = 0;
	/* Initialize bytecode container */
	SySetInit(&aByteCode, &pVm->sAllocator, sizeof(VmInstr));
	SySetAlloc(&aByteCode, 0x20);
	/* Reset the code generator */
	if( bTrueReturn ){
		/* Included file, log compile-time errors */
		xErr = pVm->pEngine->xConf.xErr;
		pErrData = pVm->pEngine->xConf.pErrData;
	}
	jx9ResetCodeGenerator(pVm, xErr, pErrData);
	/* Swap bytecode container */
	pByteCode = pVm->pByteContainer;
	pVm->pByteContainer = &aByteCode;
	/* Compile the chunk */
	jx9CompileScript(pVm, pChunk, iFlags);
	if( pVm->sCodeGen.nErr > 0 ){
		/* Compilation error, return false */
		if( pCtx ){
			jx9_result_bool(pCtx, 0);
		}
	}else{
		jx9_value sResult; /* Return value */
		if( SXRET_OK != jx9VmEmitInstr(pVm, JX9_OP_DONE, 0, 0, 0, 0) ){
			/* Out of memory */
			if( pCtx ){
				jx9_result_bool(pCtx, 0);
			}
			goto Cleanup;
		}
		if( bTrueReturn ){
			/* Assume a boolean true return value */
			jx9MemObjInitFromBool(pVm, &sResult, 1);
		}else{
			/* Assume a null return value */
			jx9MemObjInit(pVm, &sResult);
		}
		/* Execute the compiled chunk */
		VmLocalExec(pVm, &aByteCode, &sResult);
		if( pCtx ){
			/* Set the execution result */
			jx9_result_value(pCtx, &sResult);
		}
		jx9MemObjRelease(&sResult);
	}
Cleanup:
	/* Cleanup the mess left behind */
	pVm->pByteContainer = pByteCode;
	SySetRelease(&aByteCode);
	return SXRET_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %ecx, %r15d
movq %rdx, %r12
movabsq $0x1800000000, %rax     # imm = 0x1800000000
leaq -0x98(%rbp), %r13
movq %rax, 0x14(%r13)
andl $0x0, 0x10(%r13)
movq %rdi, %rbx
andl $0x0, 0x1c(%r13)
movq %rdi, (%r13)
andq $0x0, 0x8(%r13)
movq %rsi, %r14
andq $0x0, 0x20(%r13)
pushq $0x20
popq %rsi
movq %r13, %rdi
callq 0x3eba8
testl %r15d, %r15d
je 0x3ecee
movq 0xc0(%rbx), %rax
movq 0xc0(%rax), %rsi
movq 0xc8(%rax), %rdx
jmp 0x3ecf2
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rdi
callq 0x3edbb
movq 0xf0(%rbx), %rax
movq %rax, -0x30(%rbp)
movq %r13, 0xf0(%rbx)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3eaff
cmpl $0x0, 0x6d0(%rbx)
jne 0x3ed39
pushq $0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x3ee6f
testl %eax, %eax
je 0x3ed4a
testq %r14, %r14
je 0x3ed95
movq %r14, %rdi
xorl %esi, %esi
callq 0x298b2
jmp 0x3ed95
leaq -0x70(%rbp), %rsi
testl %r15d, %r15d
je 0x3ed60
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x3ec2e
jmp 0x3ed68
movq %rbx, %rdi
callq 0x35772
leaq -0x98(%rbp), %rsi
leaq -0x70(%rbp), %rdx
movq %rbx, %rdi
callq 0x3b55c
testq %r14, %r14
je 0x3ed8c
leaq -0x70(%rbp), %rsi
movq %r14, %rdi
callq 0x299d3
leaq -0x70(%rbp), %rdi
callq 0x296af
movq -0x30(%rbp), %rax
movq %rax, 0xf0(%rbx)
leaq -0x98(%rbp), %rdi
callq 0x31feb
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq