// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: jx9CompileLangConstruct
JX9_PRIVATE sxi32 jx9CompileLangConstruct(jx9_gen_state *pGen,sxi32 iCompileFlag)
{
	SyString *pName;
	sxu32 nKeyID;
	sxi32 rc;
	/* Name of the language construct [i.e: print, die...]*/
	pName = &pGen->pIn->sData;
	nKeyID = (sxu32)SX_PTR_TO_INT(pGen->pIn->pUserData);
	pGen->pIn++; /* Jump the language construct keyword */
	if( nKeyID == JX9_TKWRD_PRINT ){
		SyToken *pTmp, *pNext = 0;
		/* Compile arguments one after one */
		pTmp = pGen->pEnd;
		jx9VmEmitInstr(pGen->pVm, JX9_OP_LOADC, 0, 1 /* Boolean true index */, 0, 0);
		while( SXRET_OK == jx9GetNextExpr(pGen->pIn, pTmp, &pNext) ){
			if( pGen->pIn < pNext ){
				pGen->pEnd = pNext;
				rc = jx9CompileExpr(&(*pGen), EXPR_FLAG_RDONLY_LOAD/* Do not create variable if inexistant */, 0);
				if( rc == SXERR_ABORT ){
					return SXERR_ABORT;
				}
				if( rc != SXERR_EMPTY ){
					/* Ticket 1433-008: Optimization #1: Consume input directly 
					 * without the overhead of a function call.
					 * This is a very powerful optimization that improve
					 * performance greatly.
					 */
					jx9VmEmitInstr(pGen->pVm,JX9_OP_CONSUME,1,0,0,0);
				}
			}
			/* Jump trailing commas */
			while( pNext < pTmp && (pNext->nType & JX9_TK_COMMA) ){
				pNext++;
			}
			pGen->pIn = pNext;
		}
		/* Restore token stream */
		pGen->pEnd = pTmp;	
	}else{
		sxi32 nArg = 0;
		sxu32 nIdx = 0;
		rc = jx9CompileExpr(&(*pGen), EXPR_FLAG_RDONLY_LOAD/* Do not create variable if inexistant */, 0);
		if( rc == SXERR_ABORT ){
			return SXERR_ABORT;
		}else if(rc != SXERR_EMPTY ){
			nArg = 1;
		}
		if( SXRET_OK != GenStateFindLiteral(&(*pGen), pName, &nIdx) ){
			jx9_value *pObj;
			/* Emit the call instruction */
			pObj = jx9VmReserveConstObj(pGen->pVm, &nIdx);
			if( pObj == 0 ){
				SXUNUSED(iCompileFlag); /* cc warning */
				return GenStateOutOfMem(pGen);
			}
			jx9MemObjInitFromString(pGen->pVm, pObj, pName);
			/* Install in the literal table */
			GenStateInstallLiteral(&(*pGen), pObj, nIdx);
		}
		/* Emit the call instruction */
		jx9VmEmitInstr(pGen->pVm, JX9_OP_LOADC, 0, nIdx, 0, 0);
		jx9VmEmitInstr(pGen->pVm, JX9_OP_CALL, nArg, 0, 0, 0);
	}
	/* Node successfully compiled */
	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 0x158(%rdi), %r15
movl 0x18(%r15), %eax
leaq 0x20(%r15), %rcx
movq %rcx, 0x158(%rdi)
cmpl $0x2, %eax
jne 0x44569
leaq -0x38(%rbp), %r14
andq $0x0, (%r14)
movq (%rbx), %rdi
movq 0x160(%rbx), %r15
pushq $0x4
popq %rsi
pushq $0x1
popq %rcx
xorl %edx, %edx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x3ee6f
movq 0x158(%rbx), %r12
pushq $0x2
popq %r13
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x42f48
testl %eax, %eax
jne 0x44603
movq -0x38(%rbp), %r12
cmpq %r12, 0x158(%rbx)
jae 0x44549
movq %r12, 0x160(%rbx)
movq %rbx, %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x4012f
cmpl $-0x3, %eax
je 0x44549
cmpl $-0xa, %eax
je 0x44617
movq (%rbx), %rdi
pushq $0x3e
popq %rsi
pushq $0x1
popq %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x3ee6f
cmpq %r15, %r12
jae 0x4455c
testb $0x2, 0x12(%r12)
je 0x4455c
addq $0x20, %r12
jmp 0x44549
movq %r12, -0x38(%rbp)
movq %r12, 0x158(%rbx)
jmp 0x444ee
andl $0x0, -0x2c(%rbp)
xorl %r14d, %r14d
pushq $0x2
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x4012f
cmpl $-0xa, %eax
je 0x44617
cmpl $-0x3, %eax
je 0x4458f
pushq $0x1
popq %r14
leaq -0x2c(%rbp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x44ea5
testl %eax, %eax
je 0x445d2
movq (%rbx), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x3ebdc
testq %rax, %rax
je 0x4460f
movq %rax, %r12
movq (%rbx), %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x3bbfe
movl -0x2c(%rbp), %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x44ed8
movq (%rbx), %rdi
movl -0x2c(%rbp), %ecx
xorl %r15d, %r15d
pushq $0x4
popq %rsi
xorl %edx, %edx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x3ee6f
movq (%rbx), %rdi
pushq $0x10
popq %rsi
movl %r14d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x3ee6f
jmp 0x4461b
movq %r15, 0x160(%rbx)
xorl %r15d, %r15d
jmp 0x4461b
movq %rbx, %rdi
callq 0x426d9
pushq $-0xa
popq %r15
movl %r15d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq