// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: jx9_hashmap_sum
static int jx9_hashmap_sum(jx9_context *pCtx, int nArg, jx9_value **apArg)
{
	jx9_hashmap *pMap;
	jx9_value *pObj;
	if( nArg < 1 ){
		/* Missing arguments, return 0 */
		jx9_result_int(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 0 */
		jx9_result_int(pCtx, 0);
		return JX9_OK;
	}
	pMap = (jx9_hashmap *)apArg[0]->x.pOther;
	if( pMap->nEntry < 1 ){
		/* Nothing to compute, return 0 */
		jx9_result_int(pCtx, 0);
		return JX9_OK;
	}
	/* If the first element is of type float, then perform floating
	 * point computaion.Otherwise switch to int64 computaion.
	 */
	pObj = HashmapExtractNodeValue(pMap->pFirst);
	if( pObj == 0 ){
		jx9_result_int(pCtx, 0);
		return JX9_OK;
	}
	if( pObj->iFlags & MEMOBJ_REAL ){
		DoubleSum(pCtx, pMap);
	}else{
		Int64Sum(pCtx, pMap);
	}
	return JX9_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
testl %esi, %esi
jle 0x5e75e
movq (%rdx), %rax
testb $0x40, 0x8(%rax)
je 0x5e75e
movq (%rax), %r12
movl 0x2c(%r12), %r13d
testl %r13d, %r13d
je 0x5e75e
movq 0x10(%r12), %rax
movq (%rax), %rcx
movq (%rcx), %rcx
movl 0x38(%rax), %eax
cmpl %eax, 0x218(%rcx)
jbe 0x5e6b6
imull 0x220(%rcx), %eax
addq 0x210(%rcx), %rax
jmp 0x5e6b8
xorl %eax, %eax
testq %rax, %rax
je 0x5e75e
leaq 0x10(%r12), %r15
testb $0x4, 0x8(%rax)
jne 0x5e790
xorl %r14d, %r14d
xorl %r13d, %r13d
movq (%r15), %r15
movq (%r15), %rax
movq (%rax), %rcx
movl 0x38(%r15), %eax
cmpl %eax, 0x218(%rcx)
jbe 0x5e6fb
imull 0x220(%rcx), %eax
addq 0x210(%rcx), %rax
jmp 0x5e6fd
xorl %eax, %eax
testq %rax, %rax
je 0x5e724
movl 0x8(%rax), %ecx
testl $0x160, %ecx            # imm = 0x160
jne 0x5e724
testb $0x4, %cl
jne 0x5e71c
testb $0xa, %cl
je 0x5e737
addq (%rax), %r13
jmp 0x5e724
cvttsd2si (%rax), %rax
addq %rax, %r13
addq $0x48, %r15
incl %r14d
cmpl 0x2c(%r12), %r14d
jb 0x5e6d6
jmp 0x5e827
testb $0x1, %cl
je 0x5e724
movl 0x28(%rax), %esi
testl %esi, %esi
je 0x5e724
movq $0x0, -0x30(%rbp)
movq 0x20(%rax), %rdi
leaq -0x30(%rbp), %rdx
callq 0x40c31
addq -0x30(%rbp), %r13
jmp 0x5e724
movq 0x8(%rbx), %rbx
movq %rbx, %rdi
callq 0x309f2
movq $0x0, (%rbx)
movl $0xfffffe90, %eax       # imm = 0xFFFFFE90
andl 0x8(%rbx), %eax
orl $0x2, %eax
movl %eax, 0x8(%rbx)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorpd %xmm1, %xmm1
leaq -0x30(%rbp), %r14
movq (%r15), %r15
movq (%r15), %rax
movq (%rax), %rcx
movl 0x38(%r15), %eax
cmpl %eax, 0x218(%rcx)
jbe 0x5e7bd
imull 0x220(%rcx), %eax
addq 0x210(%rcx), %rax
jmp 0x5e7bf
xorl %eax, %eax
testq %rax, %rax
je 0x5e7eb
movl 0x8(%rax), %ecx
testl $0x160, %ecx            # imm = 0x160
jne 0x5e7eb
testb $0x4, %cl
jne 0x5e7e7
testb $0xa, %cl
je 0x5e7f6
xorps %xmm0, %xmm0
cvtsi2sdq (%rax), %xmm0
addsd %xmm0, %xmm1
jmp 0x5e7eb
addsd (%rax), %xmm1
addq $0x48, %r15
decl %r13d
jne 0x5e798
jmp 0x5e83b
testb $0x1, %cl
je 0x5e7eb
movl 0x28(%rax), %esi
testl %esi, %esi
je 0x5e7eb
movq $0x0, -0x30(%rbp)
movq 0x20(%rax), %rdi
movq %r14, %rdx
movsd %xmm1, -0x38(%rbp)
callq 0x3f365
movsd -0x38(%rbp), %xmm1
addsd -0x30(%rbp), %xmm1
jmp 0x5e7eb
movq 0x8(%rbx), %rbx
movq %rbx, %rdi
callq 0x309f2
movq %r13, (%rbx)
jmp 0x5e771
movq 0x8(%rbx), %rbx
movq %rbx, %rdi
movsd %xmm1, -0x38(%rbp)
callq 0x309f2
movsd -0x38(%rbp), %xmm0
movsd %xmm0, (%rbx)
movl $0xfffffe90, %eax       # imm = 0xFFFFFE90
andl 0x8(%rbx), %eax
orl $0x4, %eax
movl %eax, 0x8(%rbx)
movq %rbx, %rdi
callq 0x44d9d
jmp 0x5e77f