// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: VmThrowErrorAp
static sxi32 VmThrowErrorAp(
	jx9_vm *pVm,         /* Target VM */
	SyString *pFuncName, /* Function name. NULL otherwise */
	sxi32 iErr,          /* Severity level: [i.e: Error, Warning or Notice] */
	const char *zFormat, /* Format message */
	va_list ap           /* Variable list of arguments */
	)
{
	SyBlob *pWorker = &pVm->sWorker;
	SyString *pFile;
	char *zErr;
	sxi32 rc;
	if( !pVm->bErrReport ){
		/* Don't bother reporting errors */
		return SXRET_OK;
	}
	/* Reset the working buffer */
	SyBlobReset(pWorker);
	/* Peek the processed file if available */
	pFile = (SyString *)SySetPeek(&pVm->aFiles);
	if( pFile ){
		/* Append file name */
		SyBlobAppend(pWorker, pFile->zString, pFile->nByte);
		SyBlobAppend(pWorker, (const void *)" ", sizeof(char));
	}
	zErr = "Error: ";
	switch(iErr){
	case JX9_CTX_WARNING: zErr = "Warning: "; break;
	case JX9_CTX_NOTICE:  zErr = "Notice: ";  break;
	default:
		iErr = JX9_CTX_ERR;
		break;
	}
	SyBlobAppend(pWorker, zErr, SyStrlen(zErr));
	if( pFuncName ){
		/* Append function name first */
		SyBlobAppend(pWorker, pFuncName->zString, pFuncName->nByte);
		SyBlobAppend(pWorker, "(): ", sizeof("(): ")-1);
	}
	SyBlobFormatAp(pWorker, zFormat, ap);
	/* Consume the error message */
	rc = VmCallErrorHandler(&(*pVm), pWorker);
	return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x10(%rbp), %rax
addq $0x3a8, %rax            # imm = 0x3A8
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x4e8(%rax)
jne 0x787a2
movl $0x0, -0x4(%rbp)
jmp 0x788b7
movq -0x38(%rbp), %rdi
callq 0x65e00
movq -0x10(%rbp), %rdi
addq $0x3e8, %rdi            # imm = 0x3E8
callq 0x70f20
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x787f2
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rax
movq (%rax), %rsi
movq -0x40(%rbp), %rax
movl 0x8(%rax), %edx
callq 0x5d9d0
movq -0x38(%rbp), %rdi
leaq 0x4d812(%rip), %rsi     # 0xc5ffa
movl $0x1, %edx
callq 0x5d9d0
leaq 0x49e2d(%rip), %rax     # 0xc2626
movq %rax, -0x48(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x50(%rbp)
subl $0x2, %eax
je 0x78814
jmp 0x7880a
movl -0x50(%rbp), %eax
subl $0x3, %eax
je 0x78821
jmp 0x7882e
leaq 0x49e13(%rip), %rax     # 0xc262e
movq %rax, -0x48(%rbp)
jmp 0x78835
leaq 0x49e10(%rip), %rax     # 0xc2638
movq %rax, -0x48(%rbp)
jmp 0x78835
movl $0x1, -0x1c(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x48(%rbp), %rdi
callq 0x55d10
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rsi
movl %eax, %edx
callq 0x5d9d0
cmpq $0x0, -0x18(%rbp)
je 0x78890
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
movq -0x18(%rbp), %rax
movl 0x8(%rax), %edx
callq 0x5d9d0
movq -0x38(%rbp), %rdi
leaq 0x49dbb(%rip), %rsi     # 0xc2641
movl $0x4, %edx
callq 0x5d9d0
movq -0x38(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x56b10
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x76840
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq