// File: /workspace/github_c_makefile_star2_O0/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
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rax
movq 0x18(%rax), %rax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rcx
addq $0x20, %rcx
movq %rcx, 0x158(%rax)
cmpl $0x2, -0x24(%rbp)
jne 0x88c6f
movq $0x0, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x160(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0x4, %esi
xorl %edx, %edx
movl $0x1, %ecx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %r8
callq 0x7e8f0
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rdi
movq -0x30(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0x85700
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x88c5b
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rax
cmpq -0x38(%rbp), %rax
jae 0x88c0a
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x160(%rax)
movq -0x10(%rbp), %rdi
movl $0x2, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x81110
movl %eax, -0x28(%rbp)
cmpl $-0xa, -0x28(%rbp)
jne 0x88be2
movl $0xfffffff6, -0x4(%rbp) # imm = 0xFFFFFFF6
jmp 0x88d63
cmpl $-0x3, -0x28(%rbp)
je 0x88c08
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0x3e, %esi
movl $0x1, %edx
xorl %ecx, %ecx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %r8
callq 0x7e8f0
jmp 0x88c0a
jmp 0x88c0c
movq -0x38(%rbp), %rcx
xorl %eax, %eax
cmpq -0x30(%rbp), %rcx
movb %al, -0x49(%rbp)
jae 0x88c30
movq -0x38(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x20000, %eax          # imm = 0x20000
cmpl $0x0, %eax
setne %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
testb $0x1, %al
jne 0x88c39
jmp 0x88c47
movq -0x38(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x38(%rbp)
jmp 0x88c0c
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x158(%rax)
jmp 0x88b77
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x160(%rax)
jmp 0x88d5c
movl $0x0, -0x3c(%rbp)
movl $0x0, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movl $0x2, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x81110
movl %eax, -0x28(%rbp)
cmpl $-0xa, -0x28(%rbp)
jne 0x88ca4
movl $0xfffffff6, -0x4(%rbp) # imm = 0xFFFFFFF6
jmp 0x88d63
cmpl $-0x3, -0x28(%rbp)
je 0x88cb1
movl $0x1, -0x3c(%rbp)
jmp 0x88cb3
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x89c00
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x88d20
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq -0x40(%rbp), %rsi
callq 0x7e3d0
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x88cfc
movl $0x0, -0x14(%rbp)
movq -0x10(%rbp), %rdi
callq 0x84570
movl %eax, -0x4(%rbp)
jmp 0x88d63
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x48(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x78c60
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
movl -0x40(%rbp), %edx
callq 0x89c70
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl -0x40(%rbp), %ecx
movl $0x4, %esi
xorl %edx, %edx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %r8
callq 0x7e8f0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl -0x3c(%rbp), %edx
movl $0x10, %esi
xorl %ecx, %ecx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %r8
callq 0x7e8f0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)