// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: jx9_hashmap_each
static int jx9_hashmap_each(jx9_context *pCtx, int nArg, jx9_value **apArg)
{
	jx9_hashmap_node *pCur;
	jx9_hashmap *pMap;
	jx9_value *pArray;
	jx9_value *pVal;
	jx9_value sKey;
	if( nArg < 1 ){
		/* Missing arguments, return FALSE */
		jx9_result_bool(pCtx, 0);
		return JX9_OK;
	}
	/* Make sure we are dealing with a valid hashmap */
	if( !jx9_value_is_json_array(apArg[0]) ){
		/* Invalid argument, return FALSE */
		jx9_result_bool(pCtx, 0);
		return JX9_OK;
	}
	/* Point to the internal representation that describe the input hashmap */
	pMap = (jx9_hashmap *)apArg[0]->x.pOther;
	if( pMap->pCur == 0 ){
		/* Cursor does not point to anything, return FALSE */
		jx9_result_bool(pCtx, 0);
		return JX9_OK;
	}
	pCur = pMap->pCur;
	/* Create a new array */
	pArray = jx9_context_new_array(pCtx);
	if( pArray == 0 ){
		jx9_result_bool(pCtx, 0);
		return JX9_OK;
	}
	pVal = HashmapExtractNodeValue(pCur);
	/* Insert the current value */
	jx9_array_add_strkey_elem(pArray, "1", pVal);
	jx9_array_add_strkey_elem(pArray, "value", pVal);
	/* Make the key */
	if( pCur->iType == HASHMAP_INT_NODE ){
		jx9MemObjInitFromInt(pMap->pVm, &sKey, pCur->xKey.iKey);
	}else{
		jx9MemObjInitFromString(pMap->pVm, &sKey, 0);
		jx9MemObjStringAppend(&sKey, (const char *)SyBlobData(&pCur->xKey.sKey), SyBlobLength(&pCur->xKey.sKey));
	}
	/* Insert the current key */
	jx9_array_add_elem(pArray, 0, &sKey);
	jx9_array_add_strkey_elem(pArray, "key", &sKey);
	jx9MemObjRelease(&sKey);
	/* Advance the cursor */
	pMap->pCur = pCur->pPrev; /* Reverse link */
	/* Return the current entry */
	jx9_result_value(pCtx, pArray);
	return JX9_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
testl %esi, %esi
jle 0x5f4c0
movq (%rdx), %rax
testb $0x40, 0x8(%rax)
je 0x5f4c0
movq (%rax), %r12
movq 0x20(%r12), %r13
testq %r13, %r13
je 0x5f4c0
movq %rbx, %rdi
callq 0x317eb
testq %rax, %rax
je 0x5f4c0
movq %rax, %r14
movq (%r13), %rax
movq (%rax), %rax
movl 0x38(%r13), %r15d
cmpl %r15d, 0x218(%rax)
jbe 0x5f4f2
imull 0x220(%rax), %r15d
addq 0x210(%rax), %r15
jmp 0x5f4f5
movq 0x8(%rbx), %rbx
movq %rbx, %rdi
callq 0x309f2
movq $0x0, (%rbx)
movl $0xfffffe90, %eax       # imm = 0xFFFFFE90
andl 0x8(%rbx), %eax
orl $0x8, %eax
movl %eax, 0x8(%rbx)
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r15d, %r15d
leaq 0x191d5(%rip), %rsi     # 0x786d1
movq %r14, %rdi
movq %r15, %rdx
callq 0x3106a
leaq 0x16fc4(%rip), %rsi     # 0x764d2
movq %r14, %rdi
movq %r15, %rdx
callq 0x3106a
cmpl $0x1, 0x8(%r13)
movq (%r12), %rax
jne 0x5f557
movq 0x10(%r13), %rcx
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
movaps %xmm0, -0x40(%rbp)
movaps %xmm0, -0x70(%rbp)
movaps %xmm0, -0x50(%rbp)
movq %rax, -0x60(%rbp)
movq %rax, -0x58(%rbp)
movl $0x0, -0x40(%rbp)
movq %rcx, -0x70(%rbp)
movl $0x2, -0x68(%rbp)
jmp 0x5f590
xorps %xmm0, %xmm0
leaq -0x70(%rbp), %rdi
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, (%rdi)
movaps %xmm0, 0x20(%rdi)
movq %rax, 0x10(%rdi)
movq %rax, 0x18(%rdi)
movl $0x0, 0x30(%rdi)
movl $0x1, 0x8(%rdi)
movq 0x18(%r13), %rsi
movl 0x20(%r13), %edx
callq 0x3f7f6
testb $0x40, 0x8(%r14)
je 0x5f5a5
movq (%r14), %rdi
leaq -0x70(%rbp), %rdx
xorl %esi, %esi
callq 0x3f924
leaq 0x1886a(%rip), %rsi     # 0x77e16
leaq -0x70(%rbp), %r15
movq %r14, %rdi
movq %r15, %rdx
callq 0x3106a
movq %r15, %rdi
callq 0x309f2
movq 0x48(%r13), %rax
movq %rax, 0x20(%r12)
movq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x3ebc8
jmp 0x5f4e1