// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: jx9CompileAnnonFunc
JX9_PRIVATE sxi32 jx9CompileAnnonFunc(jx9_gen_state *pGen,sxi32 iCompileFlag)
{
	jx9_vm_func *pAnnonFunc; /* Annonymous function body */
	char zName[512];         /* Unique lambda name */
	static int iCnt = 1;     /* There is no worry about thread-safety here, because only
							  * one thread is allowed to compile the script.
						      */
	jx9_value *pObj;
	SyString sName;
	sxu32 nIdx;
	sxu32 nLen;
	sxi32 rc;

	pGen->pIn++; /* Jump the 'function' keyword */
	if( pGen->pIn->nType & (JX9_TK_ID|JX9_TK_KEYWORD) ){
		pGen->pIn++;
	}
	/* Reserve a constant for the lambda */
	pObj = jx9VmReserveConstObj(pGen->pVm, &nIdx);
	if( pObj == 0 ){
		GenStateOutOfMem(pGen);
		SXUNUSED(iCompileFlag); /* cc warning */
		return SXERR_ABORT;
	}
	/* Generate a unique name */
	nLen = SyBufferFormat(zName, sizeof(zName), "[lambda_%d]", iCnt++);
	/* Make sure the generated name is unique */
	while( SyHashGet(&pGen->pVm->hFunction, zName, nLen) != 0 && nLen < sizeof(zName) - 2 ){
		nLen = SyBufferFormat(zName, sizeof(zName), "[lambda_%d]", iCnt++);
	}
	SyStringInitFromBuf(&sName, zName, nLen);
	jx9MemObjInitFromString(pGen->pVm, pObj, &sName);
	/* Compile the lambda body */
	rc = GenStateCompileFunc(&(*pGen),&sName,0,&pAnnonFunc);
	if( rc == SXERR_ABORT ){
		return SXERR_ABORT;
	}
	/* Emit the load constant instruction */
	jx9VmEmitInstr(pGen->pVm, JX9_OP_LOADC, 0, nIdx, 0, 0);
	/* Node successfully compiled */
	return SXRET_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rdi, %rbx
movq 0x158(%rdi), %rax
leaq 0x20(%rax), %rcx
movq %rcx, 0x158(%rdi)
testb $0xc, 0x30(%rax)
je 0x4f547
addq $0x40, %rax
movq %rax, 0x158(%rbx)
movq (%rbx), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x49175
testq %rax, %rax
je 0x4f61f
movq %rax, -0x38(%rbp)
leaq 0x289df(%rip), %r12     # 0x77f46
leaq -0x250(%rbp), %r15
movl 0x473cc(%rip), %ecx     # 0x96940
leal 0x1(%rcx), %eax
movl %eax, 0x473c3(%rip)     # 0x96940
xorl %r14d, %r14d
movq %r15, %rdi
movl $0x200, %esi            # imm = 0x200
movq %r12, %rdx
xorl %eax, %eax
callq 0x350d9
movl %eax, %r13d
testl %eax, %eax
je 0x4f5be
movq (%rbx), %rdi
cmpl $0x0, 0x330(%rdi)
je 0x4f5be
addq $0x308, %rdi            # imm = 0x308
movq %r15, %rsi
movl %r13d, %edx
callq 0x4573a
testq %rax, %rax
setne %r14b
cmpl $0x1fd, %r13d           # imm = 0x1FD
ja 0x4f5cc
testb %r14b, %r14b
jne 0x4f56e
leaq -0x50(%rbp), %r12
movq %r15, (%r12)
movl %r13d, 0x8(%r12)
movq (%rbx), %rdi
movq -0x38(%rbp), %rsi
movq %r12, %rdx
callq 0x45a64
leaq -0x40(%rbp), %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4d1c7
movl $0xfffffff6, %r14d      # imm = 0xFFFFFFF6
cmpl $-0xa, %eax
je 0x4f640
movq (%rbx), %rdi
movl -0x2c(%rbp), %ecx
xorl %r14d, %r14d
movl $0x4, %esi
xorl %edx, %edx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x493c1
jmp 0x4f640
leaq 0x28128(%rip), %rcx     # 0x7774e
movq %rbx, %rdi
movl $0x1, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x49434
movl $0xfffffff6, %r14d      # imm = 0xFFFFFFF6
movl %r14d, %eax
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq