// File: /workspace/github_c_makefile_star2_O0/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
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movl -0x2c(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x8da04
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
andl $0xe, %eax
cmpl $0x0, %eax
je 0x8da04
movl -0x2c(%rbp), %eax
orl $0x8, %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rdi
callq 0x6fef0
movq -0x10(%rbp), %rax
cmpl $0x1, 0x28(%rax)
jae 0x8da23
movl $0x0, -0x4(%rbp)
jmp 0x8dbe4
movl $0x0, -0x48(%rbp)
movl -0x2c(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x8da82
movq -0x28(%rbp), %rax
cmpl $0x0, 0x18(%rax)
jle 0x8da82
movq -0x28(%rbp), %rdi
addq $0x20, %rdi
movq -0x28(%rbp), %rax
movl 0x18(%rax), %ecx
movq -0x28(%rbp), %rax
movq 0x10(%rax), %r8
movq -0x10(%rbp), %rax
movl 0x28(%rax), %r9d
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movl $0x400, %esi            # imm = 0x400
leaq 0x36e0a(%rip), %rdx     # 0xc487c
movq %rax, (%rsp)
movb $0x0, %al
callq 0x5d800
movl %eax, -0x48(%rbp)
jmp 0x8dad7
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x28(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rax
movl 0x28(%rax), %eax
cmpq $0x400, %rax            # imm = 0x400
jae 0x8dab6
movq -0x10(%rbp), %rax
movl 0x28(%rax), %eax
movq %rax, -0x68(%rbp)
jmp 0x8dac1
movl $0x400, %eax            # imm = 0x400
movq %rax, -0x68(%rbp)
jmp 0x8dac1
movq -0x58(%rbp), %rsi
movq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rax
movl %eax, %edx
callq 0x5d570
movl %eax, -0x48(%rbp)
movq -0x28(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x50(%rbp)
movq -0x38(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x76ca0
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x8dba4
movl -0x2c(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x8db1d
movl $0x0, -0x4(%rbp)
jmp 0x8dbe4
movl -0x2c(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x8dba2
movl -0x2c(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x8db3d
movq -0x28(%rbp), %rax
cmpl $0x1, 0x18(%rax)
jge 0x8db49
movl $0x0, -0x4(%rbp)
jmp 0x8dbe4
movq -0x28(%rbp), %rdi
addq $0x20, %rdi
movq -0x28(%rbp), %rax
movl 0x18(%rax), %ecx
movq -0x28(%rbp), %rax
movq 0x10(%rax), %r8
movq -0x10(%rbp), %rax
movl 0x28(%rax), %r9d
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movl $0x400, %esi            # imm = 0x400
leaq 0x36d00(%rip), %rdx     # 0xc487c
movq %rax, (%rsp)
movb $0x0, %al
callq 0x5d800
movl %eax, -0x48(%rbp)
movq -0x38(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x1, %ecx
movl %ecx, %edx
callq 0x76ca0
movq %rax, -0x40(%rbp)
jmp 0x8dbbc
movq -0x38(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x1, %ecx
movl %ecx, %edx
callq 0x76ca0
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x8dbdd
movq -0x18(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x6e750
movq -0x28(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)