// File: /workspace/github_c_makefile_star2_O3/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 0x5db79
movq (%rdx), %rax
testb $0x40, 0x8(%rax)
je 0x5db79
movq (%rax), %r12
movq 0x20(%r12), %r13
testq %r13, %r13
je 0x5db79
movq %rbx, %rdi
callq 0x31231
testq %rax, %rax
je 0x5db79
movq %rax, %r14
movq (%r13), %rax
movl 0x38(%r13), %r15d
movq (%rax), %rax
cmpl %r15d, 0x218(%rax)
jbe 0x5dbab
imull 0x220(%rax), %r15d
addq 0x210(%rax), %r15
jmp 0x5dbae
movq 0x8(%rbx), %rbx
movq %rbx, %rdi
callq 0x30465
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 0x18b27(%rip), %rsi     # 0x766dc
movq %r14, %rdi
movq %r15, %rdx
callq 0x30ad3
leaq 0x16913(%rip), %rsi     # 0x744da
movq %r14, %rdi
movq %r15, %rdx
callq 0x30ad3
cmpl $0x1, 0x8(%r13)
movq (%r12), %rax
jne 0x5dc11
movq 0x10(%r13), %rcx
xorps %xmm0, %xmm0
movups %xmm0, -0x68(%rbp)
movups %xmm0, -0x48(%rbp)
movups %xmm0, -0x58(%rbp)
movq $0x0, -0x38(%rbp)
movq %rax, -0x60(%rbp)
movaps %xmm0, -0x50(%rbp)
movq %rax, -0x58(%rbp)
movq %rcx, -0x70(%rbp)
movl $0x2, -0x68(%rbp)
jmp 0x5dc43
xorps %xmm0, %xmm0
leaq -0x70(%rbp), %rdi
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x20(%rdi)
movq %rax, 0x10(%rdi)
movq %rax, 0x18(%rdi)
movl $0x1, 0x8(%rdi)
movq 0x18(%r13), %rsi
movl 0x20(%r13), %edx
callq 0x3edf3
testb $0x40, 0x8(%r14)
je 0x5dc58
movq (%r14), %rdi
leaq -0x70(%rbp), %rdx
xorl %esi, %esi
callq 0x3ef1d
leaq 0x181c2(%rip), %rsi     # 0x75e21
leaq -0x70(%rbp), %r15
movq %r14, %rdi
movq %r15, %rdx
callq 0x30ad3
movq %r15, %rdi
callq 0x30465
movq 0x48(%r13), %rax
movq %rax, 0x20(%r12)
movq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x3e19f
jmp 0x5db9a