// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: jx9CompileLiteral
JX9_PRIVATE sxi32 jx9CompileLiteral(jx9_gen_state *pGen,sxi32 iCompileFlag)
{
	SyToken *pToken = pGen->pIn;
	jx9_value *pObj;
	SyString *pStr;	
	sxu32 nIdx;
	/* Extract token value */
	pStr = &pToken->sData;
	/* Deal with the reserved literals [i.e: null, false, true, ...] first */
	if( pStr->nByte == sizeof("NULL") - 1 ){
		if( SyStrnicmp(pStr->zString, "null", sizeof("NULL")-1) == 0 ){
			/* NULL constant are always indexed at 0 */
			jx9VmEmitInstr(pGen->pVm, JX9_OP_LOADC, 0, 0, 0, 0);
			return SXRET_OK;
		}else if( SyStrnicmp(pStr->zString, "true", sizeof("TRUE")-1) == 0 ){
			/* TRUE constant are always indexed at 1 */
			jx9VmEmitInstr(pGen->pVm, JX9_OP_LOADC, 0, 1, 0, 0);
			return SXRET_OK;
		}
	}else if (pStr->nByte == sizeof("FALSE") - 1 &&
		SyStrnicmp(pStr->zString, "false", sizeof("FALSE")-1) == 0 ){
			/* FALSE constant are always indexed at 2 */
			jx9VmEmitInstr(pGen->pVm, JX9_OP_LOADC, 0, 2, 0, 0);
			return SXRET_OK;
	}else if(pStr->nByte == sizeof("__LINE__") - 1 &&
		SyMemcmp(pStr->zString, "__LINE__", sizeof("__LINE__")-1) == 0 ){
			/* TICKET 1433-004: __LINE__ constant must be resolved at compile time, not run time */
			pObj = jx9VmReserveConstObj(pGen->pVm, &nIdx);
			if( pObj == 0 ){
				SXUNUSED(iCompileFlag); /* cc warning */
				return GenStateOutOfMem(pGen);
			}
			jx9MemObjInitFromInt(pGen->pVm, pObj, pToken->nLine);
			/* Emit the load constant instruction */
			jx9VmEmitInstr(pGen->pVm, JX9_OP_LOADC, 0, nIdx, 0, 0);
			return SXRET_OK;
	}else if( pStr->nByte == sizeof("__FUNCTION__") - 1 &&
		SyMemcmp(pStr->zString, "__FUNCTION__", sizeof("__FUNCTION__")-1) == 0 ){
			GenBlock *pBlock = pGen->pCurrent;
			/* TICKET 1433-004: __FUNCTION__/__METHOD__ constants must be resolved at compile time, not run time */
			while( pBlock && (pBlock->iFlags & GEN_BLOCK_FUNC) == 0 ){
				/* Point to the upper block */
				pBlock = pBlock->pParent;
			}
			if( pBlock == 0 ){
				/* Called in the global scope, load NULL */
				jx9VmEmitInstr(pGen->pVm, JX9_OP_LOADC, 0, 0, 0, 0);
			}else{
				/* Extract the target function/method */
				jx9_vm_func *pFunc = (jx9_vm_func *)pBlock->pUserData;
				pObj = jx9VmReserveConstObj(pGen->pVm, &nIdx);
				if( pObj == 0 ){
					return GenStateOutOfMem(pGen);
				}
				jx9MemObjInitFromString(pGen->pVm, pObj, &pFunc->sName);
				/* Emit the load constant instruction */
				jx9VmEmitInstr(pGen->pVm, JX9_OP_LOADC, 0, nIdx, 0, 0);
			}
			return SXRET_OK;
	}
	/* Query literal table */
	if( SXRET_OK != GenStateFindLiteral(&(*pGen), &pToken->sData, &nIdx) ){
		jx9_value *pObj;
		/* Unknown literal, install it in the literal table */
		pObj = jx9VmReserveConstObj(pGen->pVm, &nIdx);
		if( pObj == 0 ){
			return GenStateOutOfMem(pGen);
		}
		jx9MemObjInitFromString(pGen->pVm, pObj, &pToken->sData);
		GenStateInstallLiteral(&(*pGen), pObj, nIdx);
	}
	/* Emit the load constant instruction */
	jx9VmEmitInstr(pGen->pVm,JX9_OP_LOADC,1,nIdx, 0, 0);
	/* Node successfully compiled */
	return SXRET_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movl 0x8(%rax), %eax
cmpq $0x4, %rax
jne 0x8848d
movq -0x30(%rbp), %rax
movq (%rax), %rdi
leaq 0x3cbbb(%rip), %rsi     # 0xc4fc0
movl $0x4, %edx
callq 0x67830
cmpl $0x0, %eax
jne 0x8843d
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0x4, %esi
xorl %ecx, %ecx
xorl %eax, %eax
movl %eax, %r9d
movl %ecx, %edx
movq %r9, %r8
callq 0x7e8f0
movl $0x0, -0x4(%rbp)
jmp 0x88732
movq -0x30(%rbp), %rax
movq (%rax), %rdi
leaq 0x377ee(%rip), %rsi     # 0xbfc39
movl $0x4, %edx
callq 0x67830
cmpl $0x0, %eax
jne 0x88486
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
movl $0x0, -0x4(%rbp)
jmp 0x88732
jmp 0x88488
jmp 0x886a4
movq -0x30(%rbp), %rax
movl 0x8(%rax), %eax
cmpq $0x5, %rax
jne 0x884e3
movq -0x30(%rbp), %rax
movq (%rax), %rdi
leaq 0x37796(%rip), %rsi     # 0xbfc3e
movl $0x5, %edx
callq 0x67830
cmpl $0x0, %eax
jne 0x884e3
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0x4, %esi
xorl %edx, %edx
movl $0x2, %ecx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %r8
callq 0x7e8f0
movl $0x0, -0x4(%rbp)
jmp 0x88732
movq -0x30(%rbp), %rax
movl 0x8(%rax), %eax
cmpq $0x8, %rax
jne 0x88587
movq -0x30(%rbp), %rax
movq (%rax), %rdi
leaq 0x3be67(%rip), %rsi     # 0xc4369
movl $0x8, %edx
callq 0x5d3c0
cmpl $0x0, %eax
jne 0x88587
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq -0x34(%rbp), %rsi
callq 0x7e3d0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x88544
movl $0x0, -0x14(%rbp)
movq -0x10(%rbp), %rdi
callq 0x84570
movl %eax, -0x4(%rbp)
jmp 0x88732
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rsi
movq -0x20(%rbp), %rax
movl 0x14(%rax), %eax
movl %eax, %edx
callq 0x79990
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl -0x34(%rbp), %ecx
movl $0x4, %esi
xorl %edx, %edx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %r8
callq 0x7e8f0
movl $0x0, -0x4(%rbp)
jmp 0x88732
movq -0x30(%rbp), %rax
movl 0x8(%rax), %eax
cmpq $0xc, %rax
jne 0x8869e
movq -0x30(%rbp), %rax
movq (%rax), %rdi
leaq 0x3bdcc(%rip), %rsi     # 0xc4372
movl $0xc, %edx
callq 0x5d3c0
cmpl $0x0, %eax
jne 0x8869e
movq -0x10(%rbp), %rax
movq 0xc8(%rax), %rax
movq %rax, -0x40(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x40(%rbp)
movb %al, -0x51(%rbp)
je 0x885e7
movq -0x40(%rbp), %rax
movl 0x14(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
sete %al
movb %al, -0x51(%rbp)
movb -0x51(%rbp), %al
testb $0x1, %al
jne 0x885f0
jmp 0x885fe
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x885c8
cmpq $0x0, -0x40(%rbp)
jne 0x88624
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0x4, %esi
xorl %ecx, %ecx
xorl %eax, %eax
movl %eax, %r9d
movl %ecx, %edx
movq %r9, %r8
callq 0x7e8f0
jmp 0x88692
movq -0x40(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq -0x34(%rbp), %rsi
callq 0x7e3d0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x8865c
movq -0x10(%rbp), %rdi
callq 0x84570
movl %eax, -0x4(%rbp)
jmp 0x88732
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq $0x50, %rdx
callq 0x78c60
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl -0x34(%rbp), %ecx
movl $0x4, %esi
xorl %edx, %edx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %r8
callq 0x7e8f0
movl $0x0, -0x4(%rbp)
jmp 0x88732
jmp 0x886a0
jmp 0x886a2
jmp 0x886a4
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x34(%rbp), %rdx
callq 0x89c00
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x8870a
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq -0x34(%rbp), %rsi
callq 0x7e3d0
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0x886e6
movq -0x10(%rbp), %rdi
callq 0x84570
movl %eax, -0x4(%rbp)
jmp 0x88732
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x50(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x78c60
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
movl -0x34(%rbp), %edx
callq 0x89c70
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl -0x34(%rbp), %ecx
movl $0x4, %esi
movl $0x1, %edx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %r8
callq 0x7e8f0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)