// File: /workspace/github_c_makefile_star2_O3/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 0x5ce99
movq (%rdx), %rax
testb $0x40, 0x8(%rax)
je 0x5ce99
movq (%rax), %r13
movl 0x2c(%r13), %r15d
testl %r15d, %r15d
je 0x5ce99
movq 0x10(%r13), %rax
movq (%rax), %rcx
movl 0x38(%rax), %eax
movq (%rcx), %rcx
cmpl %eax, 0x218(%rcx)
jbe 0x5ce99
movq 0x210(%rcx), %rdx
testq %rdx, %rdx
je 0x5ce99
leaq 0x10(%r13), %r12
imull 0x220(%rcx), %eax
testb $0x4, 0x8(%rdx,%rax)
jne 0x5cecb
xorl %r14d, %r14d
leaq -0x38(%rbp), %rdx
xorl %edi, %edi
movq (%r12), %r12
movq (%r12), %rcx
movl 0x38(%r12), %eax
movq (%rcx), %rsi
cmpl %eax, 0x218(%rsi)
jbe 0x5ce50
movq 0x210(%rsi), %rcx
testq %rcx, %rcx
je 0x5ce50
imull 0x220(%rsi), %eax
movl 0x8(%rcx,%rax), %esi
testl $0x160, %esi            # imm = 0x160
jne 0x5ce50
testb $0x4, %sil
jne 0x5ce47
testb $0xa, %sil
je 0x5ce61
addq (%rcx,%rax), %rdi
jmp 0x5ce50
cvttsd2si (%rcx,%rax), %rax
addq %rax, %rdi
addq $0x48, %r12
incl %r14d
cmpl %r15d, %r14d
jb 0x5cdfe
jmp 0x5cf66
testb $0x1, %sil
je 0x5ce50
movl 0x28(%rcx,%rax), %esi
testl %esi, %esi
je 0x5ce50
movq $0x0, -0x38(%rbp)
movq %rdi, -0x30(%rbp)
movq 0x20(%rcx,%rax), %rdi
movq %rdx, %r15
callq 0x40206
movq %r15, %rdx
movq -0x30(%rbp), %rdi
addq -0x38(%rbp), %rdi
movl 0x2c(%r13), %r15d
jmp 0x5ce50
movq 0x8(%rbx), %rbx
movq %rbx, %rdi
callq 0x30465
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 -0x38(%rbp), %r14
movq (%r12), %r12
movq (%r12), %rcx
movl 0x38(%r12), %eax
movq (%rcx), %rdx
cmpl %eax, 0x218(%rdx)
jbe 0x5cf28
movq 0x210(%rdx), %rcx
testq %rcx, %rcx
je 0x5cf28
imull 0x220(%rdx), %eax
movl 0x8(%rcx,%rax), %edx
testl $0x160, %edx            # imm = 0x160
jne 0x5cf28
testb $0x4, %dl
jne 0x5cf23
testb $0xa, %dl
je 0x5cf33
xorps %xmm0, %xmm0
cvtsi2sdq (%rcx,%rax), %xmm0
addsd %xmm0, %xmm1
jmp 0x5cf28
addsd (%rcx,%rax), %xmm1
addq $0x48, %r12
decl %r15d
jne 0x5ced3
jmp 0x5cf7d
testb $0x1, %dl
je 0x5cf28
movl 0x28(%rcx,%rax), %esi
testl %esi, %esi
je 0x5cf28
movq $0x0, -0x38(%rbp)
movq 0x20(%rcx,%rax), %rdi
movq %r14, %rdx
movsd %xmm1, -0x30(%rbp)
callq 0x3e968
movsd -0x30(%rbp), %xmm1
addsd -0x38(%rbp), %xmm1
jmp 0x5cf28
movq 0x8(%rbx), %rbx
movq %rdi, %r14
movq %rbx, %rdi
callq 0x30465
movq %r14, (%rbx)
jmp 0x5ceac
movq 0x8(%rbx), %rbx
movq %rbx, %rdi
movsd %xmm1, -0x30(%rbp)
callq 0x30465
movsd -0x30(%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 0x43f5f
jmp 0x5ceba