// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: jx9ExprExtractOperator
JX9_PRIVATE const jx9_expr_op *  jx9ExprExtractOperator(SyString *pStr, SyToken *pLast)
{
	sxu32 n = 0;
	sxi32 rc;
	/* Do a linear lookup on the operators table */
	for(;;){
		if( n >= SX_ARRAYSIZE(aOpTable) ){
			break;
		}
		rc = SyStringCmp(pStr, &aOpTable[n].sOp, SyMemcmp);		
		if( rc == 0 ){
			if( aOpTable[n].sOp.nByte != sizeof(char) || (aOpTable[n].iOp != EXPR_OP_UMINUS && aOpTable[n].iOp != EXPR_OP_UPLUS) || pLast == 0 ){
				if( aOpTable[n].iOp == EXPR_OP_SUBSCRIPT && (pLast == 0 || (pLast->nType & (JX9_TK_ID|JX9_TK_CSB/*]*/|JX9_TK_RPAREN/*)*/)) == 0) ){
					/* JSON Array not subscripting, return NULL  */
					return 0;
				}
				/* There is no ambiguity here, simply return the first operator seen */
				return &aOpTable[n];
			}
			/* Handle ambiguity */
			if( pLast->nType & (JX9_TK_LPAREN/*'('*/|JX9_TK_OCB/*'{'*/|JX9_TK_OSB/*'['*/|JX9_TK_COLON/*:*/|JX9_TK_COMMA/*, '*/) ){
				/* Unary opertors have prcedence here over binary operators */
				return &aOpTable[n];
			}
			if( pLast->nType & JX9_TK_OP ){
				const jx9_expr_op *pOp = (const jx9_expr_op *)pLast->pUserData;
				/* Ticket 1433-31: Handle the '++', '--' operators case */
				if( pOp->iOp != EXPR_OP_INCR && pOp->iOp != EXPR_OP_DECR ){
					/* Unary opertors have prcedence here over binary operators */
					return &aOpTable[n];
				}
			
			}
		}
		++n; /* Next operator in the table */
	}
	/* No such operator */
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpq $0x32, %rax
jb 0x80835
jmp 0x809f4
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
leaq 0x6acc8(%rip), %rcx     # 0xeb510
shlq $0x5, %rdx
addq %rdx, %rcx
cmpl 0x8(%rcx), %eax
jne 0x80891
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x6aca9(%rip), %rax     # 0xeb510
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rsi
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x6ac93(%rip), %rax     # 0xeb510
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x8(%rax), %edx
callq 0x5d3c0
movl %eax, -0x2c(%rbp)
jmp 0x808b1
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
leaq 0x6ac6c(%rip), %rcx     # 0xeb510
shlq $0x5, %rdx
addq %rdx, %rcx
subl 0x8(%rcx), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
jne 0x809e6
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x6ac43(%rip), %rax     # 0xeb510
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpq $0x1, %rax
jne 0x80916
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x6ac27(%rip), %rax     # 0xeb510
shlq $0x5, %rcx
addq %rcx, %rax
cmpl $0x7, 0x10(%rax)
je 0x8090f
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x6ac0e(%rip), %rax     # 0xeb510
shlq $0x5, %rcx
addq %rcx, %rax
cmpl $0x8, 0x10(%rax)
jne 0x80916
cmpq $0x0, -0x18(%rbp)
jne 0x80970
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x6abee(%rip), %rax     # 0xeb510
shlq $0x5, %rcx
addq %rcx, %rax
cmpl $0x2, 0x10(%rax)
jne 0x80954
cmpq $0x0, -0x18(%rbp)
je 0x80947
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x1408, %eax           # imm = 0x1408
cmpl $0x0, %eax
jne 0x80954
movq $0x0, -0x8(%rbp)
jmp 0x809fc
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x6abb0(%rip), %rax     # 0xeb510
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
jmp 0x809fc
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x120a40, %eax         # imm = 0x120A40
cmpl $0x0, %eax
je 0x8099a
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x6ab83(%rip), %rax     # 0xeb510
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
jmp 0x809fc
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x809e4
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x4, 0x10(%rax)
je 0x809e2
movq -0x28(%rbp), %rax
cmpl $0x5, 0x10(%rax)
je 0x809e2
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x6ab3b(%rip), %rax     # 0xeb510
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
jmp 0x809fc
jmp 0x809e4
jmp 0x809e6
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x80827
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)