// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: GenStateCompileChunk
static sxi32 GenStateCompileChunk(
	jx9_gen_state *pGen, /* Code generator state */
	sxi32 iFlags             /* Compile flags */
	)
{
	ProcLangConstruct xCons;
	sxi32 rc;
	rc = SXRET_OK; /* Prevent compiler warning */
	for(;;){
		if( pGen->pIn >= pGen->pEnd ){
			/* No more input to process */
			break;
		}
		xCons = 0;
		if( pGen->pIn->nType & JX9_TK_KEYWORD ){
			sxu32 nKeyword = (sxu32)SX_PTR_TO_INT(pGen->pIn->pUserData);
			/* Try to extract a language construct handler */
			xCons = GenStateGetStatementHandler(nKeyword);
			if( xCons == 0 && !jx9IsLangConstruct(nKeyword) ){
				rc = jx9GenCompileError(pGen, E_ERROR, pGen->pIn->nLine,
					"Syntax error: Unexpected keyword '%z'",
					&pGen->pIn->sData);
				if( rc == SXERR_ABORT ){
					break;
				}
				/* Synchronize with the first semi-colon and avoid compiling
				 * this erroneous statement.
				 */
				xCons = jx9ErrorRecover;
			}
		}
		if( xCons == 0 ){
			/* Assume an expression an try to compile it */
			rc = jx9CompileExpr(&(*pGen), 0, 0);
			if(  rc != SXERR_EMPTY ){
				/* Pop l-value */
				jx9VmEmitInstr(pGen->pVm, JX9_OP_POP, 1, 0, 0, 0);
			}
		}else{
			/* Go compile the sucker */
			rc = xCons(&(*pGen));
		}
		if( rc == SXERR_ABORT ){
			/* Request to abort compilation */
			break;
		}
		/* Ignore trailing semi-colons ';' */
		while( pGen->pIn < pGen->pEnd && (pGen->pIn->nType & JX9_TK_SEMI) ){
			pGen->pIn++;
		}
		if( iFlags & JX9_COMPILE_SINGLE_STMT ){
			/* Compile a single statement and return */
			break;
		}
		/* LOOP ONE */
		/* LOOP TWO */
		/* LOOP THREE */
		/* LOOP FOUR */
	}
	/* Return compilation status */
	return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq 0x158(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x160(%rcx), %rax
jb 0x7ed33
jmp 0x7ee92
movq $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x158(%rax), %rax
movl 0x10(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x7edce
movq -0x8(%rbp), %rax
movq 0x158(%rax), %rax
movq 0x18(%rax), %rax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %edi
callq 0x80ff0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x7edcc
movl -0x20(%rbp), %edi
callq 0x81060
cmpl $0x0, %eax
jne 0x7edcc
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x158(%rax), %rax
movl 0x14(%rax), %edx
movq -0x8(%rbp), %rax
movq 0x158(%rax), %r8
movl $0x1, %esi
leaq 0x44e30(%rip), %rcx     # 0xc3bdc
movb $0x0, %al
callq 0x7e990
movl %eax, -0x1c(%rbp)
cmpl $-0xa, -0x1c(%rbp)
jne 0x7edc1
jmp 0x7ee92
leaq 0x22d8(%rip), %rax      # 0x810a0
movq %rax, -0x18(%rbp)
jmp 0x7edce
cmpq $0x0, -0x18(%rbp)
jne 0x7ee0f
movq -0x8(%rbp), %rdi
xorl %esi, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x81110
movl %eax, -0x1c(%rbp)
cmpl $-0x3, -0x1c(%rbp)
je 0x7ee0d
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movl $0xb, %esi
movl $0x1, %edx
xorl %ecx, %ecx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %r8
callq 0x7e8f0
jmp 0x7ee1c
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rdi
callq *%rax
movl %eax, -0x1c(%rbp)
cmpl $-0xa, -0x1c(%rbp)
jne 0x7ee24
jmp 0x7ee92
jmp 0x7ee26
movq -0x8(%rbp), %rax
movq 0x158(%rax), %rcx
movq -0x8(%rbp), %rdx
xorl %eax, %eax
cmpq 0x160(%rdx), %rcx
movb %al, -0x21(%rbp)
jae 0x7ee5f
movq -0x8(%rbp), %rax
movq 0x158(%rax), %rax
movl 0x10(%rax), %eax
andl $0x40000, %eax          # imm = 0x40000
cmpl $0x0, %eax
setne %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0x7ee68
jmp 0x7ee80
movq -0x8(%rbp), %rax
movq 0x158(%rax), %rcx
addq $0x20, %rcx
movq %rcx, 0x158(%rax)
jmp 0x7ee26
movl -0xc(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x7ee8d
jmp 0x7ee92
jmp 0x7ed16
movl -0x1c(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)