// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: VmExtractCallback
static int VmExtractCallback(jx9_value *pKey, jx9_value *pValue, void *pUserData)
{
	extract_aux_data *pAux = (extract_aux_data *)pUserData;
	int iFlags = pAux->iFlags;
	jx9_vm *pVm = pAux->pVm;
	jx9_value *pObj;
	SyString sVar;
	if( (iFlags & 0x10/* EXTR_PREFIX_INVALID */) && (pKey->iFlags & (MEMOBJ_INT|MEMOBJ_BOOL|MEMOBJ_REAL))){
		iFlags |= 0x08; /*EXTR_PREFIX_ALL*/
	}
	/* Perform a string cast */
	jx9MemObjToString(pKey);
	if( SyBlobLength(&pKey->sBlob) < 1 ){
		/* Unavailable variable name */
		return SXRET_OK;
	}
	sVar.nByte = 0; /* cc warning */
	if( (iFlags & 0x08/*EXTR_PREFIX_ALL*/ ) && pAux->Prefixlen > 0 ){
		sVar.nByte = (sxu32)SyBufferFormat(pAux->zWorker, sizeof(pAux->zWorker), "%.*s_%.*s", 
			pAux->Prefixlen, pAux->zPrefix, 
			SyBlobLength(&pKey->sBlob), SyBlobData(&pKey->sBlob)
			);
	}else{
		sVar.nByte = (sxu32) SyMemcpy(SyBlobData(&pKey->sBlob), pAux->zWorker, 
			SXMIN(SyBlobLength(&pKey->sBlob), sizeof(pAux->zWorker)));
	}
	sVar.zString = pAux->zWorker;
	/* Try to extract the variable */
	pObj = VmExtractMemObj(pVm, &sVar, TRUE, FALSE);
	if( pObj ){
		/* Collision */
		if( iFlags & 0x02 /* EXTR_SKIP */ ){
			return SXRET_OK;
		}
		if( iFlags & 0x04 /* EXTR_PREFIX_SAME */ ){
			if( (iFlags & 0x08/*EXTR_PREFIX_ALL*/) || pAux->Prefixlen < 1){
				/* Already prefixed */
				return SXRET_OK;
			}
			sVar.nByte = SyBufferFormat(
				pAux->zWorker, sizeof(pAux->zWorker),
				"%.*s_%.*s", 
				pAux->Prefixlen, pAux->zPrefix, 
				SyBlobLength(&pKey->sBlob), SyBlobData(&pKey->sBlob)
				);
			pObj = VmExtractMemObj(pVm, &sVar, TRUE, TRUE);
		}
	}else{
		/* Create the variable */
		pObj = VmExtractMemObj(pVm, &sVar, TRUE, TRUE);
	}
	if( pObj ){
		/* Overwrite the old value */
		jx9MemObjStore(pValue, pObj);
		/* Increment counter */
		pAux->iCount++;
	}
	return SXRET_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, -0x30(%rbp)
movq %rdi, %r12
movl 0x1c(%rdx), %r14d
testb $0x10, %r14b
je 0x46d25
movl %r14d, %eax
orl $0x8, %eax
testb $0xe, 0x8(%r12)
cmovnel %eax, %r14d
movq (%rbx), %r15
movq %r12, %rdi
callq 0x36bcf
movl 0x28(%r12), %r9d
testl %r9d, %r9d
je 0x46e14
testb $0x8, %r14b
je 0x46d71
movl 0x18(%rbx), %ecx
testl %ecx, %ecx
jle 0x46d71
leaq 0x20(%rbx), %rdi
movq 0x10(%rbx), %r8
movq 0x20(%r12), %rax
movq %rax, (%rsp)
leaq 0x1f618(%rip), %rdx     # 0x6637b
movl $0x400, %esi            # imm = 0x400
xorl %eax, %eax
callq 0x2d4b8
jmp 0x46d8b
movq 0x20(%r12), %rdi
leaq 0x20(%rbx), %rsi
movl $0x400, %edx            # imm = 0x400
cmpl %edx, %r9d
cmovbl %r9d, %edx
callq 0x2d3b0
leaq -0x40(%rbp), %rsi
movl %eax, 0x8(%rsi)
leaq 0x20(%rbx), %r13
movq %r13, (%rsi)
pushq $0x1
popq %rdx
movq %r15, %rdi
xorl %ecx, %ecx
callq 0x3ae21
testq %rax, %rax
je 0x46def
testb $0x2, %r14b
jne 0x46e14
testb $0x4, %r14b
je 0x46e05
testb $0x8, %r14b
jne 0x46e14
movl 0x18(%rbx), %ecx
testl %ecx, %ecx
jle 0x46e14
movq 0x10(%rbx), %r8
movl 0x28(%r12), %r9d
movq 0x20(%r12), %rax
movq %rax, (%rsp)
leaq 0x1f59e(%rip), %rdx     # 0x6637b
movq %r13, %rdi
movl $0x400, %esi            # imm = 0x400
xorl %eax, %eax
callq 0x2d4b8
movl %eax, -0x38(%rbp)
leaq -0x40(%rbp), %rsi
pushq $0x1
popq %rcx
movq %r15, %rdi
movl %ecx, %edx
callq 0x3ae21
testq %rax, %rax
je 0x46e14
movq -0x30(%rbp), %rdi
movq %rax, %rsi
callq 0x35ceb
incl 0x8(%rbx)
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq