// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: jx9MemObjAdd
JX9_PRIVATE sxi32 jx9MemObjAdd(jx9_value *pObj1, jx9_value *pObj2, int bAddStore)
{
	if( ((pObj1->iFlags|pObj2->iFlags) & MEMOBJ_HASHMAP) == 0 ){
			/* Arithemtic operation */
			jx9MemObjToNumeric(pObj1);
			jx9MemObjToNumeric(pObj2);
			if( (pObj1->iFlags|pObj2->iFlags) & MEMOBJ_REAL ){
				/* Floating point arithmetic */
				jx9_real a, b;
				if( (pObj1->iFlags & MEMOBJ_REAL) == 0 ){
					jx9MemObjToReal(pObj1);
				}
				if( (pObj2->iFlags & MEMOBJ_REAL) == 0 ){
					jx9MemObjToReal(pObj2);
				}
				a = pObj1->x.rVal;
				b = pObj2->x.rVal;
				pObj1->x.rVal = a+b;
				MemObjSetType(pObj1, MEMOBJ_REAL);
				/* Try to get an integer representation also */
				MemObjTryIntger(&(*pObj1));
			}else{
				/* Integer arithmetic */
				sxi64 a, b;
				a = pObj1->x.iVal;
				b = pObj2->x.iVal;
				pObj1->x.iVal = a+b;
				MemObjSetType(pObj1, MEMOBJ_INT);
			}
	}else{
		if( (pObj1->iFlags|pObj2->iFlags) & MEMOBJ_HASHMAP ){
			jx9_hashmap *pMap;
			sxi32 rc;
			if( bAddStore ){
				/* Do not duplicate the hashmap, use the left one since its an add&store operation.
				 */
				if( (pObj1->iFlags & MEMOBJ_HASHMAP) == 0 ){				
					/* Force a hashmap cast */
					rc = jx9MemObjToHashmap(pObj1);
					if( rc != SXRET_OK ){
						jx9VmThrowError(pObj1->pVm, 0, JX9_CTX_ERR, "JX9 is running out of memory while creating array");
						return rc;
					}
				}
				/* Point to the structure that describe the hashmap */
				pMap = (jx9_hashmap *)pObj1->x.pOther;
			}else{
				/* Create a new hashmap */
				pMap = jx9NewHashmap(pObj1->pVm, 0, 0);
				if( pMap == 0){
					jx9VmThrowError(pObj1->pVm, 0, JX9_CTX_ERR, "JX9 is running out of memory while creating array");
					return SXERR_MEM;
				}
			}
			if( !bAddStore ){
				if(pObj1->iFlags & MEMOBJ_HASHMAP ){
					/* Perform a hashmap duplication */
					jx9HashmapDup((jx9_hashmap *)pObj1->x.pOther, pMap);
				}else{
					if((pObj1->iFlags & MEMOBJ_NULL) == 0 ){
						/* Simple insertion */
						jx9HashmapInsert(pMap, 0, pObj1);
					}
				}
			}
			/* Perform the union */
			if(pObj2->iFlags & MEMOBJ_HASHMAP ){
				jx9HashmapUnion(pMap, (jx9_hashmap *)pObj2->x.pOther);
			}else{
				if((pObj2->iFlags & MEMOBJ_NULL) == 0 ){
					/* Simple insertion */
					jx9HashmapInsert(pMap, 0, pObj2);
				}
			}
			/* Reflect the change */
			if( pObj1->iFlags & MEMOBJ_STRING ){
				SyBlobRelease(&pObj1->sBlob);
			}
			pObj1->x.pOther = pMap;
			MemObjSetType(pObj1, MEMOBJ_HASHMAP);
		}
	}
	return SXRET_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x18(%rbp), %rcx
orl 0x8(%rcx), %eax
andl $0x40, %eax
cmpl $0x0, %eax
jne 0x77154
movq -0x10(%rbp), %rdi
callq 0x76a30
movq -0x18(%rbp), %rdi
callq 0x76a30
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x18(%rbp), %rcx
orl 0x8(%rcx), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x77113
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x770ad
movq -0x10(%rbp), %rdi
callq 0x769d0
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x770c5
movq -0x18(%rbp), %rdi
callq 0x769d0
movq -0x10(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
movq -0x18(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x28(%rbp), %xmm0
addsd -0x30(%rbp), %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, (%rax)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
andl $0xfffffe90, %ecx       # imm = 0xFFFFFE90
orl $0x4, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rdi
callq 0x789a0
jmp 0x7714f
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rcx
addq -0x40(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
andl $0xfffffe90, %ecx       # imm = 0xFFFFFE90
orl $0x2, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
jmp 0x772e4
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x18(%rbp), %rcx
orl 0x8(%rcx), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x772e2
cmpl $0x0, -0x1c(%rbp)
je 0x771cc
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
jne 0x771bf
movq -0x10(%rbp), %rdi
callq 0x76b80
movl %eax, -0x4c(%rbp)
cmpl $0x0, -0x4c(%rbp)
je 0x771bd
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
leaq 0x4b89b(%rip), %rcx     # 0xc2a48
callq 0x72ba0
movl -0x4c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x772eb
jmp 0x771bf
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x77216
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x6fa20
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x77214
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
leaq 0x4b845(%rip), %rcx     # 0xc2a48
callq 0x72ba0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x772eb
jmp 0x77216
cmpl $0x0, -0x1c(%rbp)
jne 0x77261
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x7723d
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x48(%rbp), %rsi
callq 0x78a10
jmp 0x7725f
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
jne 0x7725d
movq -0x48(%rbp), %rdi
movq -0x10(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x6faf0
jmp 0x7725f
jmp 0x77261
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x77282
movq -0x48(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0x78b10
jmp 0x772a4
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
jne 0x772a2
movq -0x48(%rbp), %rdi
movq -0x18(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x6faf0
jmp 0x772a4
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x772c0
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
callq 0x58c00
movq -0x48(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
andl $0xfffffe90, %ecx       # imm = 0xFFFFFE90
orl $0x40, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
jmp 0x772e4
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)