// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: jx9CompileExpr
static sxi32 jx9CompileExpr(
	jx9_gen_state *pGen, /* Code generator state */
	sxi32 iFlags,        /* Control flags */
	sxi32 (*xTreeValidator)(jx9_gen_state *, jx9_expr_node *) /* Node validator callback.NULL otherwise */
	)
{
	jx9_expr_node *pRoot;
	SySet sExprNode;
	SyToken *pEnd;
	sxi32 nExpr;
	sxi32 iNest;
	sxi32 rc;
	/* Initialize worker variables */
	nExpr = 0;
	pRoot = 0;
	SySetInit(&sExprNode, &pGen->pVm->sAllocator, sizeof(jx9_expr_node *));
	SySetAlloc(&sExprNode, 0x10);
	rc = SXRET_OK;
	/* Delimit the expression */
	pEnd = pGen->pIn;
	iNest = 0;
	while( pEnd < pGen->pEnd ){
		if( pEnd->nType & JX9_TK_OCB /* '{' */ ){
			/* Ticket 1433-30: Annonymous/Closure functions body */
			iNest++;
		}else if(pEnd->nType & JX9_TK_CCB /* '}' */ ){
			iNest--;
		}else if( pEnd->nType & JX9_TK_SEMI /* ';' */ ){
			if( iNest <= 0 ){
				break;
			}
		}
		pEnd++;
	}
	if( iFlags & EXPR_FLAG_COMMA_STATEMENT ){
		SyToken *pEnd2 = pGen->pIn;
		iNest = 0;
		/* Stop at the first comma */
		while( pEnd2 < pEnd ){
			if( pEnd2->nType & (JX9_TK_OCB/*'{'*/|JX9_TK_OSB/*'['*/|JX9_TK_LPAREN/*'('*/) ){
				iNest++;
			}else if(pEnd2->nType & (JX9_TK_CCB/*'}'*/|JX9_TK_CSB/*']'*/|JX9_TK_RPAREN/*')'*/)){
				iNest--;
			}else if( pEnd2->nType & JX9_TK_COMMA /*','*/ ){
				if( iNest <= 0 ){
					break;
				}
			}
			pEnd2++;
		}
		if( pEnd2 <pEnd ){
			pEnd = pEnd2;
		}
	}
	if( pEnd > pGen->pIn ){
		SyToken *pTmp = pGen->pEnd;
		/* Swap delimiter */
		pGen->pEnd = pEnd;
		/* Try to get an expression tree */
		rc = jx9ExprMakeTree(&(*pGen), &sExprNode, &pRoot);
		if( rc == SXRET_OK && pRoot ){
			rc = SXRET_OK;
			if( xTreeValidator ){
				/* Call the upper layer validator callback */
				rc = xTreeValidator(&(*pGen), pRoot);
			}
			if( rc != SXERR_ABORT ){
				/* Generate code for the given tree */
				rc = GenStateEmitExprCode(&(*pGen), pRoot, iFlags);
			}
			nExpr = 1;
		}
		/* Release the whole tree */
		jx9ExprFreeTree(&(*pGen), &sExprNode);
		/* Synchronize token stream */
		pGen->pEnd = pTmp;
		pGen->pIn  = pEnd;
		if( rc == SXERR_ABORT ){
			SySetRelease(&sExprNode);
			return SXERR_ABORT;
		}
	}
	SySetRelease(&sExprNode);
	return nExpr > 0 ? SXRET_OK : SXERR_EMPTY;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, %r15
movl %esi, %r14d
movq %rdi, %rbx
movq (%rdi), %rdi
movabsq $0x800000000, %rax      # imm = 0x800000000
movq %rax, -0x5c(%rbp)
xorl %eax, %eax
movl %eax, -0x60(%rbp)
movl %eax, -0x54(%rbp)
movq %rdi, -0x70(%rbp)
movq %rax, -0x68(%rbp)
movq %rax, -0x50(%rbp)
movl $0x80, %esi
callq 0x343ed
movq %rax, -0x68(%rbp)
testq %rax, %rax
je 0x4a802
movl $0x10, -0x5c(%rbp)
movq 0x158(%rbx), %rax
movq 0x160(%rbx), %rsi
movq %rax, %r12
cmpq %rsi, %rax
jae 0x4a846
xorl %ecx, %ecx
movq %rax, %r12
movl 0x10(%r12), %edx
testb $0x40, %dl
jne 0x4a837
testb %dl, %dl
js 0x4a83b
btl $0x12, %edx
jae 0x4a83d
testl %ecx, %ecx
jg 0x4a83d
jmp 0x4a846
incl %ecx
jmp 0x4a83d
decl %ecx
addq $0x20, %r12
cmpq %rsi, %r12
jb 0x4a81d
xorl %r13d, %r13d
cmpq %rax, %r12
jbe 0x4b07f
movq %r15, -0x40(%rbp)
movl %r14d, -0x2c(%rbp)
movq %rsi, -0x88(%rbp)
movq %r12, 0x160(%rbx)
xorl %eax, %eax
leaq -0x70(%rbp), %rcx
movl %eax, 0x10(%rcx)
movq $0x0, -0x38(%rbp)
movl %eax, 0x1c(%rcx)
leaq -0x78(%rbp), %rax
movq $0x0, (%rax)
movq %rbx, -0x48(%rbp)
movq (%rbx), %rdi
movl $0x68, %esi
callq 0x2e951
testq %rax, %rax
je 0x4a99d
movq %rax, %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%rax)
movups %xmm0, 0x40(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
xorl %edx, %edx
movq %rdx, 0x60(%rax)
movq (%rbx), %rax
movabsq $0x800000000, %rcx      # imm = 0x800000000
movq %rcx, 0x4c(%r15)
movl %edx, 0x48(%r15)
movl %edx, 0x54(%r15)
movq %rax, 0x38(%r15)
movq %rdx, 0x40(%r15)
movq $0x0, -0x38(%rbp)
movq %rdx, 0x58(%r15)
movq 0x158(%rbx), %r14
movq %r14, 0x18(%r15)
movl 0x10(%r14), %eax
testb $0x20, %al
jne 0x4a9a8
testb $0x10, %al
jne 0x4a9b5
testb $0x40, %al
jne 0x4a9eb
btl $0xb, %eax
jb 0x4aa4c
testb $0x4, %al
jne 0x4aab6
testb $0x8, %al
jne 0x4ab7d
testl $0x121680, %eax         # imm = 0x121680
jne 0x4a9af
leaq 0x58ff(%rip), %rcx      # 0x5023f
testb $0x3, %al
jne 0x4a972
btl $0xd, %eax
leaq 0x4f55(%rip), %rcx      # 0x4f8a4
jb 0x4a972
btl $0xe, %eax
leaq 0x5573(%rip), %rcx      # 0x4fecf
jb 0x4a972
btl $0x10, %eax
leaq 0x59f8(%rip), %rcx      # 0x50361
movl $0x0, %eax
cmovaeq %rax, %rcx
movq %rcx, 0x30(%r15)
testq %rcx, %rcx
jne 0x4a9af
movl 0x14(%r14), %edx
movq %rbx, %rdi
movl $0x1, %esi
leaq 0x2d428(%rip), %rcx     # 0x77db6
movq %r14, %r8
xorl %eax, %eax
callq 0x49434
jmp 0x4ab32
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
jmp 0x4ab4e
movq 0x18(%r14), %rax
movq %rax, (%r15)
addq $0x20, %r14
jmp 0x4a9d1
leaq 0x20(%r14), %rax
cmpq 0x160(%rbx), %rax
jae 0x4aa34
addq $0x40, %r14
leaq 0x2f3b(%rip), %rax      # 0x4d908
movq %rax, 0x30(%r15)
movq %r14, %rax
movq %rax, 0x20(%r15)
movq %r15, -0x78(%rbp)
movq %rax, 0x158(%rbx)
xorl %r13d, %r13d
jmp 0x4ab4e
leaq 0x20(%r14), %rax
movq 0x160(%rbx), %rcx
cmpq %rcx, %rax
jae 0x4aa22
movl $0x1, %edx
movl 0x10(%rax), %esi
testb $0x40, %sil
jne 0x4aa17
testb %sil, %sil
jns 0x4aa19
cmpl $0x2, %edx
jl 0x4aa22
decl %edx
jmp 0x4aa19
incl %edx
addq $0x20, %rax
cmpq %rcx, %rax
jb 0x4aa00
cmpq %rcx, %rax
jae 0x4aaa1
addq $0x20, %rax
leaq 0x452a(%rip), %rcx      # 0x4ef5c
jmp 0x4aa98
movl 0x14(%r14), %edx
movq %rbx, %rdi
movl $0x1, %esi
leaq 0x2cf41(%rip), %rcx     # 0x77988
jmp 0x4ab2b
leaq 0x20(%r14), %rax
movq 0x160(%rbx), %rcx
cmpq %rcx, %rax
jae 0x4aa84
movl $0x1, %edx
movl 0x10(%rax), %esi
btl $0xb, %esi
jb 0x4aa79
btl $0xc, %esi
jae 0x4aa7b
cmpl $0x2, %edx
jl 0x4aa84
decl %edx
jmp 0x4aa7b
incl %edx
addq $0x20, %rax
cmpq %rcx, %rax
jb 0x4aa61
cmpq %rcx, %rax
jae 0x4ab18
addq $0x20, %rax
leaq 0x46af(%rip), %rcx      # 0x4f147
movq %rcx, 0x30(%r15)
jmp 0x4a9d4
movl 0x14(%r14), %edx
movq %rbx, %rdi
movl $0x1, %esi
leaq 0x2d2ab(%rip), %rcx     # 0x77d5f
jmp 0x4ab2b
movl 0x18(%r14), %eax
leal -0xd(%rax), %ecx
cmpl $0x4, %ecx
jae 0x4ab8d
leaq 0x20(%r14), %rcx
movq 0x160(%rbx), %rax
cmpq %rax, %rcx
jae 0x4ac08
cmpq %rax, %r14
jae 0x4ab0c
movl $0x1, %ecx
movl 0x10(%r14), %edx
testl $0xa40, %edx            # imm = 0xA40
je 0x4aaf4
incl %ecx
jmp 0x4ab03
testl $0x1480, %edx           # imm = 0x1480
je 0x4ab03
cmpl $0x2, %ecx
jl 0x4ab0c
decl %ecx
addq $0x20, %r14
cmpq %rax, %r14
jb 0x4aae4
leaq 0x4b42(%rip), %rax      # 0x4f655
jmp 0x4ac13
movl 0x14(%r14), %edx
movq %rbx, %rdi
movl $0x1, %esi
leaq 0x2d25c(%rip), %rcx     # 0x77d87
xorl %eax, %eax
callq 0x49434
xorl %r13d, %r13d
cmpl $-0xa, %eax
sete %r13b
addl %r13d, %r13d
orl $-0xc, %r13d
movq (%rbx), %rdi
movq %r15, %rsi
callq 0x2eb38
testl %r13d, %r13d
jne 0x4afb1
leaq -0x70(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x336fc
movq 0x158(%rbx), %rax
cmpq 0x160(%rbx), %rax
jb 0x4a88b
jmp 0x4ad1d
addq $0x20, %r14
leaq 0x46b5(%rip), %rax      # 0x4f23d
jmp 0x4a9cd
cmpl $0x2, %eax
je 0x4aac6
cmpl $0x6, %eax
jne 0x4ac08
leaq 0x20(%r14), %rax
movq 0x160(%rbx), %rcx
cmpq %rcx, %rax
jae 0x4ac29
movl 0x14(%r14), %edx
testb $0xc, 0x30(%r14)
leaq 0x40(%r14), %rdi
cmoveq %rax, %rdi
cmpq %rcx, %rdi
jae 0x4abc7
testb $0x2, 0x11(%rdi)
jne 0x4ac41
movq %rdi, %r14
movq %rbx, %rdi
movl $0x1, %esi
leaq 0x2d2ba(%rip), %rcx     # 0x77e93
xorl %eax, %eax
callq 0x49434
xorl %r13d, %r13d
cmpl $-0xa, %eax
sete %r13b
addl %r13d, %r13d
orl $-0xc, %r13d
testl %r13d, %r13d
je 0x4ac38
movq (%rbx), %rdi
movq %r15, %rsi
callq 0x2eb38
xorl %ecx, %ecx
movq %r14, %rax
jmp 0x4ac1c
addq $0x20, %r14
leaq 0x462a(%rip), %rax      # 0x4f23d
movq %rax, 0x30(%r15)
movb $0x1, %cl
movq %r14, %rax
testb %cl, %cl
jne 0x4a9d4
jmp 0x4ab4e
leaq 0x460d(%rip), %rcx      # 0x4f23d
movq %rcx, 0x30(%r15)
movb $0x1, %cl
jmp 0x4ac1c
leaq 0x48ce(%rip), %rax      # 0x4f50d
jmp 0x4ac13
addq $0x20, %rdi
cmpq %rcx, %rdi
jae 0x4ac72
movl $0x1, %eax
movl 0x10(%rdi), %esi
btl $0x9, %esi
jb 0x4ac67
btl $0xa, %esi
jae 0x4ac69
cmpl $0x2, %eax
jl 0x4ac72
decl %eax
jmp 0x4ac69
incl %eax
addq $0x20, %rdi
cmpq %rcx, %rdi
jb 0x4ac4f
cmpq %rcx, %rdi
jae 0x4acbf
leaq 0x20(%rdi), %rax
cmpq %rcx, %rax
jae 0x4acbf
testb $0x40, 0x30(%rdi)
jne 0x4acd6
movq %rbx, %rdi
movl $0x1, %esi
leaq 0x2d273(%rip), %rcx     # 0x77f08
movq %rax, -0x80(%rbp)
xorl %eax, %eax
callq 0x49434
movl %eax, %r13d
cmpl $-0xa, %eax
movq -0x80(%rbp), %rcx
cmoveq %r14, %rcx
movl $0x0, %eax
cmovnel %eax, %r13d
movq %rcx, %r14
jmp 0x4abf1
movq %rdi, %r14
movq %rbx, %rdi
movl $0x1, %esi
leaq 0x2d206(%rip), %rcx     # 0x77ed7
jmp 0x4abd9
addq $0x40, %rdi
cmpq %rcx, %rdi
jae 0x4ad04
movl $0x1, %eax
movl 0x10(%rdi), %edx
testb $0x40, %dl
jne 0x4acf9
testb %dl, %dl
jns 0x4acfb
cmpl $0x2, %eax
jl 0x4ad04
decl %eax
jmp 0x4acfb
incl %eax
addq $0x20, %rdi
cmpq %rcx, %rdi
jb 0x4ace4
xorl %eax, %eax
cmpq %rcx, %rdi
setb %al
shll $0x5, %eax
addq %rax, %rdi
movq %rdi, %r14
xorl %r13d, %r13d
jmp 0x4abf1
movl -0x60(%rbp), %r15d
testq %r15, %r15
je 0x4af2b
movq -0x68(%rbp), %r14
testl %r15d, %r15d
jle 0x4af38
movq (%r14), %r13
movq (%r13), %rax
testq %rax, %rax
je 0x4ad6b
movl 0x10(%rax), %eax
andl $-0x2, %eax
cmpl $0x10, %eax
jne 0x4ad6b
movq 0x18(%r13), %rdi
xorl %esi, %esi
callq 0x4a2b1
movq %rax, (%r13)
movq (%r14), %rax
movq (%rax), %rcx
movq 0x18(%rax), %rax
movq %rcx, 0x18(%rax)
xorl %eax, %eax
leaq 0x48cbc(%rip), %rcx     # 0x93a30
xorl %r9d, %r9d
xorl %r13d, %r13d
xorl %r10d, %r10d
movq (%r14,%rax,8), %rdx
movq 0x18(%rdx), %rdi
movl 0x10(%rdi), %r8d
btl $0x9, %r8d
jb 0x4ae7d
btl $0xa, %r8d
jb 0x4aee1
btl $0xb, %r8d
jae 0x4adb1
cmpq $0x0, 0x30(%rdx)
je 0x4aef5
btl $0xc, %r8d
jb 0x4aeeb
testb $0x40, %r8b
je 0x4adcd
cmpq $0x0, 0x30(%rdx)
je 0x4af04
testb %r8b, %r8b
js 0x4aefa
testq %rax, %rax
je 0x4af07
andl $0x20, %r8d
je 0x4af07
movq (%rdx), %rsi
movl 0x10(%rsi), %edi
leal -0x7(%rdi), %esi
cmpl $0x1, %esi
ja 0x4af07
movq -0x8(%r14,%rax,8), %rsi
movq 0x30(%rsi), %rsi
leaq 0x2afd(%rip), %r8       # 0x4d908
cmpq %r8, %rsi
setne %r8b
leaq 0x4424(%rip), %r11      # 0x4f23d
cmpq %r11, %rsi
setne %sil
testb %sil, %r8b
jne 0x4af07
xorl %r8d, %r8d
cmpl $0x8, %edi
sete %r8b
xorl $0x11, %r8d
leaq 0x484e2(%rip), %rbx     # 0x93320
xorl %edi, %edi
cmpl %r8d, (%rbx)
je 0x4ae57
incq %rdi
addq $0x20, %rbx
cmpq $0x32, %rdi
jne 0x4ae40
movl $0x32, %edi
shlq $0x5, %rdi
leaq 0x484ae(%rip), %rsi     # 0x93310
addq %rsi, %rdi
movq %rdi, (%rdx)
movq (%r14,%rax,8), %rdx
movq 0x18(%rdx), %rdx
movq %rdi, 0x18(%rdx)
movq -0x48(%rbp), %rbx
jmp 0x4af07
testq %rax, %rax
je 0x4aedc
movq -0x8(%r14,%rax,8), %rdx
movq 0x30(%rdx), %rbx
leaq 0x2a76(%rip), %rsi      # 0x4d908
cmpq %rsi, %rbx
sete %sil
leaq 0x439d(%rip), %r11      # 0x4f23d
cmpq %r11, %rbx
sete %bl
orb %sil, %bl
movq -0x48(%rbp), %rbx
jne 0x4aebf
movq 0x18(%rdx), %rsi
movzwl 0x10(%rsi), %esi
testl $0x740c, %esi           # imm = 0x740C
je 0x4aedc
movq 0x18(%rdx), %rdx
testb $0x20, 0x10(%rdx)
jne 0x4aedc
orl $0x20, %r8d
movl %r8d, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq (%r14,%rax,8), %rdx
movq %rcx, (%rdx)
incl %r10d
jmp 0x4af07
testl %r10d, %r10d
jle 0x4af3d
decl %r10d
jmp 0x4af07
testl %r13d, %r13d
jle 0x4af46
decl %r13d
jmp 0x4af07
incl %r13d
jmp 0x4af07
testl %r9d, %r9d
jle 0x4af4f
decl %r9d
jmp 0x4af07
incl %r9d
incq %rax
cmpq %r15, %rax
jne 0x4ad7d
orl %r13d, %r10d
orl %r9d, %r10d
je 0x4af38
movq (%r14), %rax
movq 0x18(%rax), %rdi
leaq 0x2d092(%rip), %rcx     # 0x77fbb
jmp 0x4af56
movq $0x0, -0x38(%rbp)
xorl %r13d, %r13d
jmp 0x4afb1
xorl %r13d, %r13d
jmp 0x4af79
leaq 0x2d00e(%rip), %rcx     # 0x77f52
jmp 0x4af56
leaq 0x2d028(%rip), %rcx     # 0x77f75
jmp 0x4af56
leaq 0x2d042(%rip), %rcx     # 0x77f98
movl 0x14(%rdi), %edx
movq %rbx, %rdi
movl $0x1, %esi
xorl %eax, %eax
callq 0x49434
xorl %r13d, %r13d
cmpl $-0xa, %eax
sete %r13b
addl %r13d, %r13d
orl $-0xc, %r13d
testl %r13d, %r13d
je 0x4af88
movq $0x0, -0x38(%rbp)
jmp 0x4afb1
movq %rbx, %rdi
movq %r14, %rsi
movl %r15d, %edx
callq 0x4e1e9
xorl %r13d, %r13d
testl %eax, %eax
je 0x4afaa
movq $0x0, -0x38(%rbp)
movl %eax, %r13d
jmp 0x4afb1
movq (%r14), %rax
movq %rax, -0x38(%rbp)
movl -0x2c(%rbp), %r14d
movq -0x40(%rbp), %rax
movl $0x0, -0x2c(%rbp)
testl %r13d, %r13d
jne 0x4b000
cmpq $0x0, -0x38(%rbp)
je 0x4b000
testq %rax, %rax
je 0x4afe7
movq %rbx, %rdi
movq -0x38(%rbp), %rsi
callq *%rax
cmpl $-0xa, %eax
jne 0x4afe7
movl $0xfffffff6, %r13d      # imm = 0xFFFFFFF6
jmp 0x4aff9
movq %rbx, %rdi
movq -0x38(%rbp), %rsi
movl %r14d, %edx
callq 0x4dcb5
movl %eax, %r13d
movl $0x1, -0x2c(%rbp)
movq -0x68(%rbp), %r14
movl -0x60(%rbp), %r15d
testq %r15, %r15
je 0x4b029
xorl %ebx, %ebx
movq (%r14,%rbx,8), %rsi
testq %rsi, %rsi
je 0x4b021
movq -0x48(%rbp), %rdi
callq 0x503fc
incq %rbx
cmpq %rbx, %r15
jne 0x4b00f
movq -0x48(%rbp), %rax
movq -0x88(%rbp), %rcx
movq %rcx, 0x160(%rax)
movq %r12, 0x158(%rax)
cmpl $-0xa, %r13d
movl -0x2c(%rbp), %r13d
jne 0x4b07f
movq -0x70(%rbp), %rdi
testq %rdi, %rdi
sete %al
testq %r14, %r14
sete %cl
orb %al, %cl
jne 0x4b068
movq %r14, %rsi
callq 0x3503f
movq $0x0, -0x68(%rbp)
xorl %eax, %eax
movl %eax, -0x60(%rbp)
movl %eax, -0x54(%rbp)
movl $0xfffffff6, %eax       # imm = 0xFFFFFFF6
jmp 0x4b0b4
movq -0x70(%rbp), %rdi
testq %rdi, %rdi
je 0x4b096
movq -0x68(%rbp), %rsi
testq %rsi, %rsi
je 0x4b096
callq 0x3503f
movq $0x0, -0x68(%rbp)
xorl %eax, %eax
movl %eax, -0x60(%rbp)
movl %eax, -0x54(%rbp)
xorl %eax, %eax
testl %r13d, %r13d
setg %al
leal (%rax,%rax,2), %eax
addl $-0x3, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq