// File: /workspace/github_c_makefile_star2_O3/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 0x4dfdd
addq $0x40, %rax
movq %rax, 0x158(%rbx)
movq (%rbx), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x480f1
testq %rax, %rax
je 0x4e09d
movq %rax, %r14
movl 0x46945(%rip), %ecx     # 0x94940
leal 0x1(%rcx), %eax
movl %eax, 0x4693c(%rip)     # 0x94940
leaq 0x27f46(%rip), %rdx     # 0x75f51
leaq -0x250(%rbp), %rdi
movl $0x200, %esi            # imm = 0x200
xorl %eax, %eax
callq 0x349a5
movl %eax, %r12d
movq (%rbx), %rdi
testl %eax, %eax
je 0x4e0c3
cmpl $0x0, 0x330(%rdi)
je 0x4e0c3
leaq -0x250(%rbp), %r13
leaq 0x27f0a(%rip), %r15     # 0x75f51
addq $0x308, %rdi            # imm = 0x308
movq %r13, %rsi
movl %r12d, %edx
callq 0x448fa
cmpl $0x1fd, %r12d           # imm = 0x1FD
ja 0x4e0c0
testq %rax, %rax
je 0x4e0c0
movl 0x468d3(%rip), %ecx     # 0x94940
leal 0x1(%rcx), %eax
movl %eax, 0x468ca(%rip)     # 0x94940
movq %r13, %rdi
movl $0x200, %esi            # imm = 0x200
movq %r15, %rdx
xorl %eax, %eax
callq 0x349a5
movl %eax, %r12d
movq (%rbx), %rdi
testl %eax, %eax
je 0x4e0c3
cmpl $0x0, 0x330(%rdi)
jne 0x4e047
jmp 0x4e0c3
leaq 0x276b5(%rip), %rcx     # 0x75759
movq %rbx, %rdi
movl $0x1, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x483d1
movl $0xfffffff6, %r14d      # imm = 0xFFFFFFF6
jmp 0x4e115
movq (%rbx), %rdi
leaq -0x48(%rbp), %r15
leaq -0x250(%rbp), %rax
movq %rax, (%r15)
movl %r12d, 0x8(%r15)
movq %r14, %rsi
movq %r15, %rdx
callq 0x44c17
leaq -0x38(%rbp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4c066
movl $0xfffffff6, %r14d      # imm = 0xFFFFFFF6
cmpl $-0xa, %eax
je 0x4e115
movq (%rbx), %rdi
movl -0x2c(%rbp), %ecx
xorl %r14d, %r14d
movl $0x4, %esi
xorl %edx, %edx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x48365
movl %r14d, %eax
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq