// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: ExprProcessFuncArguments
static sxi32 ExprProcessFuncArguments(jx9_gen_state *pGen, jx9_expr_node *pOp, jx9_expr_node **apNode, sxi32 nToken)
{
	sxi32 iNest, iCur, iNode;
	sxi32 rc;
	/* Process function arguments from left to right */
	iCur = 0;
	for(;;){
		if( iCur >= nToken ){
			/* No more arguments to process */
			break;
		}
		iNode = iCur;
		iNest = 0;
		while( iCur < nToken ){
			if( apNode[iCur] ){
				if( (apNode[iCur]->pStart->nType & JX9_TK_COMMA) && apNode[iCur]->pLeft == 0 && iNest <= 0 ){
					break;
				}else if( apNode[iCur]->pStart->nType & (JX9_TK_LPAREN|JX9_TK_OSB|JX9_TK_OCB) ){
					iNest++;
				}else if( apNode[iCur]->pStart->nType & (JX9_TK_RPAREN|JX9_TK_CCB|JX9_TK_CSB) ){
					iNest--;
				}
			}
			iCur++;
		}
		if( iCur > iNode ){
			ExprMakeTree(&(*pGen), &apNode[iNode], iCur-iNode);
			if( apNode[iNode] ){
				/* Put a pointer to the root of the tree in the arguments set */
				SySetPut(&pOp->aNodeArgs, (const void *)&apNode[iNode]);
			}else{
				/* Empty function argument */
				rc = jx9GenCompileError(&(*pGen), E_ERROR, pOp->pStart->nLine, "Empty function argument");
				if( rc != SXERR_ABORT ){
					rc = SXERR_SYNTAX;
				}
				return rc;
			}
		}else{
			rc = jx9GenCompileError(&(*pGen), E_ERROR, pOp->pStart->nLine, "Missing function argument");
			if( rc != SXERR_ABORT ){
				rc = SXERR_SYNTAX;
			}
			return rc;
		}
		/* Jump trailing comma */
		if( iCur < nToken && apNode[iCur] && (apNode[iCur]->pStart->nType & JX9_TK_COMMA) ){
			iCur++;
			if( iCur >= nToken ){
				/* missing function argument */
				rc = jx9GenCompileError(&(*pGen), E_ERROR, pOp->pStart->nLine, "Missing function argument");
				if( rc != SXERR_ABORT ){
					rc = SXERR_SYNTAX;
				}
				return rc;
			}
		}
	}
	return SXRET_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, -0x38(%rbp)
testl %ecx, %ecx
jle 0x50589
movq %rdx, %r13
movq %rsi, -0x40(%rbp)
leaq 0x38(%rsi), %rax
movq %rax, -0x48(%rbp)
movl %ecx, %r15d
xorl %eax, %eax
movl %eax, %ebx
movl %ecx, -0x2c(%rbp)
movslq %eax, %r9
leal 0x1(%r9), %edx
cmpl %edx, %ecx
cmovgl %ecx, %edx
movb $0x1, %r12b
xorl %esi, %esi
movq (%r13,%r9,8), %r8
testq %r8, %r8
je 0x50513
movq 0x18(%r8), %rdi
movl 0x10(%rdi), %edi
btl $0x11, %edi
jae 0x504fb
cmpq $0x0, 0x8(%r8)
jne 0x504fb
testl %esi, %esi
jle 0x50523
testl $0xa40, %edi            # imm = 0xA40
je 0x50507
incl %esi
jmp 0x50513
andl $0x1480, %edi           # imm = 0x1480
cmpl $0x1, %edi
adcl $-0x1, %esi
incq %r9
incl %ebx
cmpq %r15, %r9
setl %r12b
jl 0x504d9
movl %edx, %ebx
movl %ebx, %edx
subl %eax, %edx
jle 0x5058d
cltq
leaq (,%rax,8), %r14
addq %r13, %r14
movq -0x38(%rbp), %rdi
movq %r14, %rsi
callq 0x4e1e9
cmpq $0x0, (%r14)
je 0x50596
movq -0x48(%rbp), %rdi
movq %r14, %rsi
callq 0x336fc
testb $0x1, %r12b
je 0x5057c
movslq %ebx, %rax
movq (%r13,%rax,8), %rax
testq %rax, %rax
movl -0x2c(%rbp), %ecx
je 0x5057f
movq 0x18(%rax), %rax
testb $0x2, 0x12(%rax)
je 0x5057f
incl %ebx
cmpl %ecx, %ebx
jl 0x5057f
jmp 0x5058d
movl -0x2c(%rbp), %ecx
movl %ebx, %eax
cmpl %ecx, %ebx
jl 0x504c8
xorl %eax, %eax
jmp 0x505c7
leaq 0x27ba6(%rip), %rcx     # 0x7813a
jmp 0x5059d
leaq 0x27b85(%rip), %rcx     # 0x78122
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rax
movl 0x14(%rax), %edx
movq -0x38(%rbp), %rdi
movl $0x1, %esi
xorl %eax, %eax
callq 0x49434
movl %eax, %ecx
xorl %eax, %eax
cmpl $-0xa, %ecx
sete %al
addl %eax, %eax
orl $-0xc, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq