// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: MemObjBooleanValue
static sxi32 MemObjBooleanValue(jx9_value *pObj)
{
	sxi32 iFlags;	
	iFlags = pObj->iFlags;
	if (iFlags & MEMOBJ_REAL ){
#ifdef JX9_OMIT_FLOATING_POINT
		return pObj->x.rVal ? 1 : 0;
#else
		return pObj->x.rVal != 0.0 ? 1 : 0;
#endif
	}else if( iFlags & MEMOBJ_INT ){
		return pObj->x.iVal ? 1 : 0;
	}else if (iFlags & MEMOBJ_STRING) {
		SyString sString;
		SyStringInitFromBuf(&sString, SyBlobData(&pObj->sBlob), SyBlobLength(&pObj->sBlob));
		if( sString.nByte == 0 ){
			/* Empty string */
			return 0;
		}else if( (sString.nByte == sizeof("true") - 1 && SyStrnicmp(sString.zString, "true", sizeof("true")-1) == 0) ||
			(sString.nByte == sizeof("on") - 1 && SyStrnicmp(sString.zString, "on", sizeof("on")-1) == 0) ||
			(sString.nByte == sizeof("yes") - 1 && SyStrnicmp(sString.zString, "yes", sizeof("yes")-1) == 0) ){
				return 1;
		}else if( sString.nByte == sizeof("false") - 1 && SyStrnicmp(sString.zString, "false", sizeof("false")-1) == 0 ){
			return 0;
		}else{
			const char *zIn, *zEnd;
			zIn = sString.zString;
			zEnd = &zIn[sString.nByte];
			while( zIn < zEnd && zIn[0] == '0' ){
				zIn++;
			}
			return zIn >= zEnd ? 0 : 1;
		}
	}else if( iFlags & MEMOBJ_NULL ){
		return 0;
	}else if( iFlags & MEMOBJ_HASHMAP ){
		jx9_hashmap *pMap = (jx9_hashmap *)pObj->x.pOther;
		sxu32 n = pMap->nEntry;
		jx9HashmapUnref(pMap);
		return n > 0 ? TRUE : FALSE;
	}else if(iFlags & MEMOBJ_RES ){
		return pObj->x.pOther != 0;
	}
	/* NOT REACHED */
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x77efc
movq -0x10(%rbp), %rax
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
xorl %eax, %eax
movl $0x1, %ecx
ucomisd %xmm1, %xmm0
setp %sil
setne %dl
orb %sil, %dl
cmovnel %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x780ed
movl -0x14(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x77f24
movq -0x10(%rbp), %rax
movq (%rax), %rdx
xorl %eax, %eax
movl $0x1, %ecx
cmpq $0x0, %rdx
cmovnel %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x780ed
movl -0x14(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x78068
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl 0x28(%rax), %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
jne 0x77f5b
movl $0x0, -0x4(%rbp)
jmp 0x780ed
movl -0x20(%rbp), %eax
cmpq $0x4, %rax
jne 0x77f7e
movq -0x28(%rbp), %rdi
leaq 0x47cca(%rip), %rsi     # 0xbfc39
movl $0x4, %edx
callq 0x67830
cmpl $0x0, %eax
je 0x77fc4
movl -0x20(%rbp), %eax
cmpq $0x2, %rax
jne 0x77fa1
movq -0x28(%rbp), %rdi
leaq 0x4f269(%rip), %rsi     # 0xc71fb
movl $0x2, %edx
callq 0x67830
cmpl $0x0, %eax
je 0x77fc4
movl -0x20(%rbp), %eax
cmpq $0x3, %rax
jne 0x77fd0
movq -0x28(%rbp), %rdi
leaq 0x4aa8f(%rip), %rsi     # 0xc2a44
movl $0x3, %edx
callq 0x67830
cmpl $0x0, %eax
jne 0x77fd0
movl $0x1, -0x4(%rbp)
jmp 0x780ed
movl -0x20(%rbp), %eax
cmpq $0x5, %rax
jne 0x77fff
movq -0x28(%rbp), %rdi
leaq 0x47c5a(%rip), %rsi     # 0xbfc3e
movl $0x5, %edx
callq 0x67830
cmpl $0x0, %eax
jne 0x77fff
movl $0x0, -0x4(%rbp)
jmp 0x780ed
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movl -0x20(%rbp), %ecx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rcx
xorl %eax, %eax
cmpq -0x38(%rbp), %rcx
movb %al, -0x45(%rbp)
jae 0x78034
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
sete %al
movb %al, -0x45(%rbp)
movb -0x45(%rbp), %al
testb $0x1, %al
jne 0x7803d
jmp 0x7804b
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x78015
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rsi
movl $0x1, %eax
xorl %ecx, %ecx
cmpq %rsi, %rdx
cmovael %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x780ed
movl -0x14(%rbp), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x7807c
movl $0x0, -0x4(%rbp)
jmp 0x780ed
movl -0x14(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x780ba
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movl 0x2c(%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x40(%rbp), %rdi
callq 0x6eab0
movl -0x44(%rbp), %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmoval %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x780ed
movl -0x14(%rbp), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x780dc
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
jmp 0x780ed
jmp 0x780de
jmp 0x780e0
jmp 0x780e2
jmp 0x780e4
jmp 0x780e6
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)