// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: ExprVerifyNodes
static sxi32 ExprVerifyNodes(jx9_gen_state *pGen, jx9_expr_node **apNode, sxi32 nNode)
{
	sxi32 iParen, iSquare, iBraces;
	sxi32 i, rc;

	if( nNode > 0 && apNode[0]->pOp && (apNode[0]->pOp->iOp == EXPR_OP_ADD || apNode[0]->pOp->iOp == EXPR_OP_SUB) ){
		/* Fix and mark as an unary not binary plus/minus operator */
		apNode[0]->pOp = jx9ExprExtractOperator(&apNode[0]->pStart->sData, 0);
		apNode[0]->pStart->pUserData = (void *)apNode[0]->pOp;
	}
	iParen = iSquare = iBraces = 0;
	for( i = 0 ; i < nNode ; ++i ){
		if( apNode[i]->pStart->nType & JX9_TK_LPAREN /*'('*/){
			if( i > 0 && ( apNode[i-1]->xCode == jx9CompileVariable || apNode[i-1]->xCode == jx9CompileLiteral ||
				(apNode[i - 1]->pStart->nType & (JX9_TK_ID|JX9_TK_KEYWORD|JX9_TK_SSTR|JX9_TK_DSTR|JX9_TK_RPAREN/*')'*/|JX9_TK_CSB/*]*/))) ){
					/* Ticket 1433-033: Take care to ignore alpha-stream [i.e: or, xor] operators followed by an opening parenthesis */
					if( (apNode[i - 1]->pStart->nType & JX9_TK_OP) == 0 ){
						/* We are dealing with a postfix [i.e: function call]  operator
						 * not a simple left parenthesis. Mark the node.
						 */
						apNode[i]->pStart->nType |= JX9_TK_OP;
						apNode[i]->pStart->pUserData = (void *)&sFCallOp; /* Function call operator */
						apNode[i]->pOp = &sFCallOp;
					}
			}
			iParen++;
		}else if( apNode[i]->pStart->nType & JX9_TK_RPAREN/*')*/){
			if( iParen <= 0 ){
				rc = jx9GenCompileError(&(*pGen), E_ERROR, apNode[i]->pStart->nLine, "Syntax error: Unexpected token ')'");
				if( rc != SXERR_ABORT ){
					rc = SXERR_SYNTAX;
				}
				return rc;
			}
			iParen--;
		}else if( apNode[i]->pStart->nType & JX9_TK_OSB /*'['*/ && apNode[i]->xCode == 0 ){
			iSquare++;
		}else if (apNode[i]->pStart->nType & JX9_TK_CSB /*']'*/){
			if( iSquare <= 0 ){
				rc = jx9GenCompileError(&(*pGen), E_ERROR, apNode[i]->pStart->nLine, "Syntax error: Unexpected token ']'");
				if( rc != SXERR_ABORT ){
					rc = SXERR_SYNTAX;
				}
				return rc;
			}
			iSquare--;
		}else if( apNode[i]->pStart->nType & JX9_TK_OCB /*'{'*/ && apNode[i]->xCode == 0 ){
			iBraces++;
		}else if (apNode[i]->pStart->nType & JX9_TK_CCB /*'}'*/){
			if( iBraces <= 0 ){
				rc = jx9GenCompileError(&(*pGen), E_ERROR, apNode[i]->pStart->nLine, "Syntax error: Unexpected token '}'");
				if( rc != SXERR_ABORT ){
					rc = SXERR_SYNTAX;
				}
				return rc;
			}
			iBraces--;
		}else if( apNode[i]->pStart->nType & JX9_TK_OP ){
			const jx9_expr_op *pOp = (const jx9_expr_op *)apNode[i]->pOp;
			if( i > 0 && (pOp->iOp == EXPR_OP_UMINUS || pOp->iOp == EXPR_OP_UPLUS)){
				if( apNode[i-1]->xCode == jx9CompileVariable || apNode[i-1]->xCode == jx9CompileLiteral ){
					sxi32 iExprOp = EXPR_OP_SUB; /* Binary minus */
					sxu32 n = 0;
					if( pOp->iOp == EXPR_OP_UPLUS ){
						iExprOp = EXPR_OP_ADD; /* Binary plus */
					}
					/*
					 * TICKET 1433-013: This is a fix around an obscure bug when the user uses
					 * a variable name which is an alpha-stream operator [i.e: $and, $xor, $eq..].
					 */
					while( n < SX_ARRAYSIZE(aOpTable) && aOpTable[n].iOp != iExprOp ){
						++n;
					}
					pOp = &aOpTable[n];
					/* Mark as binary '+' or '-', not an unary */
					apNode[i]->pOp = pOp;
					apNode[i]->pStart->pUserData = (void *)pOp;
				}
			}
		}
	}
	if( iParen != 0 || iSquare != 0 || iBraces != 0){
		rc = jx9GenCompileError(&(*pGen), E_ERROR, apNode[0]->pStart->nLine, "Syntax error, mismatched '(', '[' or '{'");
		if( rc != SXERR_ABORT ){
			rc = SXERR_SYNTAX;
		}
		return rc;
	}
	return SXRET_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jle 0x865a0
movq -0x18(%rbp), %rax
movq (%rax), %rax
cmpq $0x0, (%rax)
je 0x865a0
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
cmpl $0x10, 0x10(%rax)
je 0x86566
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
cmpl $0x11, 0x10(%rax)
jne 0x865a0
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x80810
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movq %rcx, 0x18(%rax)
movl $0x0, -0x28(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x86a01
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x18(%rax), %rax
movl 0x10(%rax), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
je 0x866cb
cmpl $0x0, -0x2c(%rbp)
jle 0x866bd
movq -0x18(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
leaq -0x149b(%rip), %rcx     # 0x85170
cmpq %rcx, 0x30(%rax)
je 0x86651
movq -0x18(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
leaq 0x1d97(%rip), %rcx      # 0x883c0
cmpq %rcx, 0x30(%rax)
je 0x86651
movq -0x18(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq 0x18(%rax), %rax
movl 0x10(%rax), %eax
andl $0x740c, %eax           # imm = 0x740C
cmpl $0x0, %eax
je 0x866bd
movq -0x18(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq 0x18(%rax), %rax
movl 0x10(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
jne 0x866bb
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x18(%rax), %rax
movl 0x10(%rax), %ecx
orl $0x20, %ecx
movl %ecx, 0x10(%rax)
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x18(%rax), %rax
leaq 0x6558f(%rip), %rcx     # 0xebc30
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
leaq 0x65578(%rip), %rcx     # 0xebc30
movq %rcx, (%rax)
jmp 0x866bd
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x869f1
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x18(%rax), %rax
movl 0x10(%rax), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x86741
cmpl $0x0, -0x20(%rbp)
jg 0x86733
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x18(%rax), %rax
movl 0x14(%rax), %edx
movl $0x1, %esi
leaq 0x3dd2d(%rip), %rcx     # 0xc443e
movb $0x0, %al
callq 0x7e990
movl %eax, -0x30(%rbp)
cmpl $-0xa, -0x30(%rbp)
je 0x86728
movl $0xfffffff4, -0x30(%rbp) # imm = 0xFFFFFFF4
movl -0x30(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x86a57
movl -0x20(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x869ef
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x18(%rax), %rax
movl 0x10(%rax), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x8677f
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq $0x0, 0x30(%rax)
jne 0x8677f
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x869ed
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x18(%rax), %rax
movl 0x10(%rax), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
je 0x867f5
cmpl $0x0, -0x24(%rbp)
jg 0x867e7
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x18(%rax), %rax
movl 0x14(%rax), %edx
movl $0x1, %esi
leaq 0x3dc9c(%rip), %rcx     # 0xc4461
movb $0x0, %al
callq 0x7e990
movl %eax, -0x30(%rbp)
cmpl $-0xa, -0x30(%rbp)
je 0x867dc
movl $0xfffffff4, -0x30(%rbp) # imm = 0xFFFFFFF4
movl -0x30(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x86a57
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x869eb
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x18(%rax), %rax
movl 0x10(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x86831
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
cmpq $0x0, 0x30(%rax)
jne 0x86831
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x869e9
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x18(%rax), %rax
movl 0x10(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x868a7
cmpl $0x0, -0x28(%rbp)
jg 0x86899
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x18(%rax), %rax
movl 0x14(%rax), %edx
movl $0x1, %esi
leaq 0x3dc0d(%rip), %rcx     # 0xc4484
movb $0x0, %al
callq 0x7e990
movl %eax, -0x30(%rbp)
cmpl $-0xa, -0x30(%rbp)
je 0x8688e
movl $0xfffffff4, -0x30(%rbp) # imm = 0xFFFFFFF4
movl -0x30(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x86a57
movl -0x28(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x869e7
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x18(%rax), %rax
movl 0x10(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x869e5
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
cmpl $0x0, -0x2c(%rbp)
jle 0x869e3
movq -0x38(%rbp), %rax
cmpl $0x7, 0x10(%rax)
je 0x868fb
movq -0x38(%rbp), %rax
cmpl $0x8, 0x10(%rax)
jne 0x869e3
movq -0x18(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
leaq -0x17a3(%rip), %rcx     # 0x85170
cmpq %rcx, 0x30(%rax)
je 0x8693b
movq -0x18(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
leaq 0x1a8f(%rip), %rcx      # 0x883c0
cmpq %rcx, 0x30(%rax)
jne 0x869e1
movl $0x11, -0x3c(%rbp)
movl $0x0, -0x40(%rbp)
movq -0x38(%rbp), %rax
cmpl $0x8, 0x10(%rax)
jne 0x8695a
movl $0x10, -0x3c(%rbp)
jmp 0x8695c
movl -0x40(%rbp), %eax
movl %eax, %ecx
xorl %eax, %eax
cmpq $0x32, %rcx
movb %al, -0x41(%rbp)
jae 0x8698b
movl -0x40(%rbp), %eax
movl %eax, %ecx
leaq 0x64b98(%rip), %rax     # 0xeb510
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
cmpl -0x3c(%rbp), %eax
setne %al
movb %al, -0x41(%rbp)
movb -0x41(%rbp), %al
testb $0x1, %al
jne 0x86994
jmp 0x8699f
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x8695c
movl -0x40(%rbp), %eax
movl %eax, %ecx
leaq 0x64b65(%rip), %rax     # 0xeb510
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rcx
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movq %rcx, (%rax)
movq -0x38(%rbp), %rcx
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movq 0x18(%rax), %rax
movq %rcx, 0x18(%rax)
jmp 0x869e3
jmp 0x869e5
jmp 0x869e7
jmp 0x869e9
jmp 0x869eb
jmp 0x869ed
jmp 0x869ef
jmp 0x869f1
jmp 0x869f3
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x865bc
cmpl $0x0, -0x20(%rbp)
jne 0x86a13
cmpl $0x0, -0x24(%rbp)
jne 0x86a13
cmpl $0x0, -0x28(%rbp)
je 0x86a50
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movl 0x14(%rax), %edx
movl $0x1, %esi
leaq 0x3da76(%rip), %rcx     # 0xc44a7
movb $0x0, %al
callq 0x7e990
movl %eax, -0x30(%rbp)
cmpl $-0xa, -0x30(%rbp)
je 0x86a48
movl $0xfffffff4, -0x30(%rbp) # imm = 0xFFFFFFF4
movl -0x30(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x86a57
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq