// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: jx9CompileFunction
static sxi32 jx9CompileFunction(jx9_gen_state *pGen)
{
	SyString *pName;
	sxi32 iFlags;
	sxu32 nLine;
	sxi32 rc;

	nLine = pGen->pIn->nLine;
	pGen->pIn++; /* Jump the 'function' keyword */
	iFlags = 0;
	if( pGen->pIn >= pGen->pEnd || (pGen->pIn->nType & (JX9_TK_ID|JX9_TK_KEYWORD)) == 0 ){
		/* Invalid function name */
		rc = jx9GenCompileError(&(*pGen), E_ERROR, nLine, "Invalid function name");
		if( rc == SXERR_ABORT ){
			return SXERR_ABORT;
		}
		/* Sychronize with the next semi-colon or braces*/
		while( pGen->pIn < pGen->pEnd && (pGen->pIn->nType & (JX9_TK_SEMI|JX9_TK_OCB)) == 0 ){
			pGen->pIn++;
		}
		return SXRET_OK;
	}
	pName = &pGen->pIn->sData;
	nLine = pGen->pIn->nLine;
	/* Jump the function name */
	pGen->pIn++;
	if( pGen->pIn >= pGen->pEnd || (pGen->pIn->nType & JX9_TK_LPAREN) == 0 ){
		/* Syntax error */
		rc = jx9GenCompileError(pGen, E_ERROR, nLine, "Expected '(' after function name '%z'", pName);
		if( rc == SXERR_ABORT ){
			/* Error count limit reached, abort immediately */
			return SXERR_ABORT;
		}
		/* Sychronize with the next semi-colon or '{' */
		while( pGen->pIn < pGen->pEnd && (pGen->pIn->nType & (JX9_TK_SEMI|JX9_TK_OCB)) == 0 ){
			pGen->pIn++;
		}
		return SXRET_OK;
	}
	/* Compile function body */
	rc = GenStateCompileFunc(&(*pGen),pName,iFlags,0);
	return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rax
movl 0x14(%rax), %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rcx
addq $0x20, %rcx
movq %rcx, 0x158(%rax)
movl $0x0, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x160(%rcx), %rax
jae 0x8193c
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rax
movl 0x10(%rax), %eax
andl $0xc, %eax
cmpl $0x0, %eax
jne 0x819d3
movq -0x10(%rbp), %rdi
movl -0x20(%rbp), %edx
movl $0x1, %esi
leaq 0x42318(%rip), %rcx     # 0xc3c67
movb $0x0, %al
callq 0x7e990
movl %eax, -0x24(%rbp)
cmpl $-0xa, -0x24(%rbp)
jne 0x8196b
movl $0xfffffff6, -0x4(%rbp) # imm = 0xFFFFFFF6
jmp 0x81af2
jmp 0x8196d
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rcx
movq -0x10(%rbp), %rdx
xorl %eax, %eax
cmpq 0x160(%rdx), %rcx
movb %al, -0x25(%rbp)
jae 0x819a6
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rax
movl 0x10(%rax), %eax
andl $0x40040, %eax          # imm = 0x40040
cmpl $0x0, %eax
sete %al
movb %al, -0x25(%rbp)
movb -0x25(%rbp), %al
testb $0x1, %al
jne 0x819af
jmp 0x819c7
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rcx
addq $0x20, %rcx
movq %rcx, 0x158(%rax)
jmp 0x8196d
movl $0x0, -0x4(%rbp)
jmp 0x81af2
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rax
movl 0x14(%rax), %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rcx
addq $0x20, %rcx
movq %rcx, 0x158(%rax)
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x160(%rcx), %rax
jae 0x81a3d
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rax
movl 0x10(%rax), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
jne 0x81ad5
movq -0x10(%rbp), %rdi
movl -0x20(%rbp), %edx
movq -0x18(%rbp), %r8
movl $0x1, %esi
leaq 0x42229(%rip), %rcx     # 0xc3c7d
movb $0x0, %al
callq 0x7e990
movl %eax, -0x24(%rbp)
cmpl $-0xa, -0x24(%rbp)
jne 0x81a70
movl $0xfffffff6, -0x4(%rbp) # imm = 0xFFFFFFF6
jmp 0x81af2
jmp 0x81a72
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rcx
movq -0x10(%rbp), %rdx
xorl %eax, %eax
cmpq 0x160(%rdx), %rcx
movb %al, -0x26(%rbp)
jae 0x81aab
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rax
movl 0x10(%rax), %eax
andl $0x40040, %eax          # imm = 0x40040
cmpl $0x0, %eax
sete %al
movb %al, -0x26(%rbp)
movb -0x26(%rbp), %al
testb $0x1, %al
jne 0x81ab4
jmp 0x81acc
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rcx
addq $0x20, %rcx
movq %rcx, 0x158(%rax)
jmp 0x81a72
movl $0x0, -0x4(%rbp)
jmp 0x81af2
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x845d0
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)