// File: /workspace/github_c_makefile_star2_O3/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: jx9CompileUplink
static sxi32 jx9CompileUplink(jx9_gen_state *pGen)
{
	SyToken *pTmp, *pNext = 0;
	sxi32 nExpr;
	sxi32 rc;
	/* Jump the 'uplink' keyword */
	pGen->pIn++;
	if( pGen->pIn >= pGen->pEnd || (pGen->pIn->nType & JX9_TK_SEMI) ){
		/* Nothing to process */
		return SXRET_OK;
	}
	pTmp = pGen->pEnd;
	nExpr = 0;
	while( SXRET_OK == jx9GetNextExpr(pGen->pIn, pTmp, &pNext) ){
		if( pGen->pIn < pNext ){
			pGen->pEnd = pNext;
			if( (pGen->pIn->nType & JX9_TK_DOLLAR) == 0 ){
				rc = jx9GenCompileError(&(*pGen), E_ERROR, pGen->pIn->nLine, "uplink: Expected variable name");
				if( rc == SXERR_ABORT ){
					return SXERR_ABORT;
				}
			}else{
				pGen->pIn++;
				if( pGen->pIn >= pGen->pEnd ){
					/* Emit a warning */
					jx9GenCompileError(&(*pGen), E_WARNING, pGen->pIn[-1].nLine, "uplink: Empty variable name");
				}else{
					rc = jx9CompileExpr(&(*pGen), 0, 0);
					if( rc == SXERR_ABORT ){
						return SXERR_ABORT;
					}else if(rc != SXERR_EMPTY ){
						nExpr++;
					}
				}
			}
		}
		/* Next expression in the stream */
		pGen->pIn = pNext;
		/* Jump trailing commas */
		while( pGen->pIn < pTmp && (pGen->pIn->nType & JX9_TK_COMMA) ){
			pGen->pIn++;
		}
	}
	/* Restore token stream */
	pGen->pEnd = pTmp;
	if( nExpr > 0 ){
		/* Emit the uplink instruction */
		jx9VmEmitInstr(pGen->pVm, JX9_OP_UPLINK, nExpr, 0, 0, 0);
	}
	return SXRET_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq $0x0, -0x30(%rbp)
movq 0x158(%rdi), %rax
movq 0x160(%rdi), %r14
leaq 0x20(%rax), %rdi
movq %rdi, 0x158(%rbx)
xorl %r15d, %r15d
cmpq %r14, %rdi
jae 0x4bb9a
testb $0x4, 0x32(%rax)
jne 0x4bb9a
leaq -0x30(%rbp), %rdx
movq %r14, %rsi
callq 0x4ca44
testl %eax, %eax
je 0x4ba90
movq %r14, 0x160(%rbx)
jmp 0x4bb9a
leaq 0x2a222(%rip), %r15     # 0x75cb9
leaq -0x30(%rbp), %r13
movl $0x0, -0x34(%rbp)
movq 0x158(%rbx), %rax
movq -0x30(%rbp), %r12
cmpq %r12, %rax
jae 0x4bb37
movq %r12, 0x160(%rbx)
testb $0x10, 0x10(%rax)
jne 0x4bae2
movl 0x14(%rax), %edx
movq %rbx, %rdi
movl $0x1, %esi
movq %r15, %rcx
xorl %eax, %eax
callq 0x483d1
cmpl $-0xa, %eax
jne 0x4bb37
jmp 0x4bb94
leaq 0x20(%rax), %rcx
movq %rcx, 0x158(%rbx)
cmpq %r12, %rcx
jae 0x4bb1e
movq %r15, %r13
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x49789
cmpl $-0x3, %eax
je 0x4bb15
movl %eax, %r15d
cmpl $-0xa, %eax
je 0x4bb9a
incl -0x34(%rbp)
movq %r13, %r15
leaq -0x30(%rbp), %r13
jmp 0x4bb37
movl 0x14(%rax), %edx
movq %rbx, %rdi
movl $0x2, %esi
leaq 0x2a1a8(%rip), %rcx     # 0x75cd8
xorl %eax, %eax
callq 0x483d1
cmpq %r14, %r12
jae 0x4bb4a
testb $0x2, 0x12(%r12)
je 0x4bb4a
addq $0x20, %r12
jmp 0x4bb37
movq %r12, 0x158(%rbx)
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x4ca44
testl %eax, %eax
je 0x4baa2
movq %r14, 0x160(%rbx)
movl -0x34(%rbp), %edx
testl %edx, %edx
jle 0x4bb8f
movq (%rbx), %rdi
xorl %r15d, %r15d
movl $0x40, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x48365
jmp 0x4bb9a
xorl %r15d, %r15d
jmp 0x4bb9a
movl $0xfffffff6, %r15d      # imm = 0xFFFFFFF6
movl %r15d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq