// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: VmJsonEncode
static sxi32 VmJsonEncode(
	jx9_value *pIn,          /* Encode this value */
	json_private_data *pData /* Context data */
	){
		SyBlob *pOut = pData->pOut;
		int nByte;
		if( jx9_value_is_null(pIn) || jx9_value_is_resource(pIn)){
			/* null */
			SyBlobAppend(pOut, "null", sizeof("null")-1);
		}else if( jx9_value_is_bool(pIn) ){
			int iBool = jx9_value_to_bool(pIn);
			sxu32 iLen;
			/* true/false */
			iLen = iBool ? sizeof("true") : sizeof("false");
			SyBlobAppend(pOut, iBool ? "true" : "false", iLen-1);
		}else if(  jx9_value_is_numeric(pIn) && !jx9_value_is_string(pIn) ){
			const char *zNum;
			/* Get a string representation of the number */
			zNum = jx9_value_to_string(pIn, &nByte);
			SyBlobAppend(pOut,zNum,nByte);
		}else if( jx9_value_is_string(pIn) ){
				const char *zIn, *zEnd;
				int c;
				/* Encode the string */
				zIn = jx9_value_to_string(pIn, &nByte);
				zEnd = &zIn[nByte];
				/* Append the double quote */
				SyBlobAppend(pOut,"\"", sizeof(char));
				for(;;){
					if( zIn >= zEnd ){
						/* No more input to process */
						break;
					}
					c = zIn[0];
					/* Advance the stream cursor */
					zIn++;
					if( c == '"' || c == '\\' ){
						/* Unescape the character */
						SyBlobAppend(pOut,"\\", sizeof(char));
					}
					/* Append character verbatim */
					SyBlobAppend(pOut,(const char *)&c,sizeof(char));
				}
				/* Append the double quote */
				SyBlobAppend(pOut,"\"",sizeof(char));
		}else if( jx9_value_is_json_array(pIn) ){
			/* Encode the array/object */
			pData->isFirst = 1;
			if( jx9_value_is_json_object(pIn) ){
				/* Encode the object instance */
				pData->isFirst = 1;
				/* Append the curly braces */
				SyBlobAppend(pOut, "{",sizeof(char));
				/* Iterate throw object attribute */
				jx9_array_walk(pIn,VmJsonObjectEncode, pData);
				/* Append the closing curly braces  */
				SyBlobAppend(pOut, "}",sizeof(char));
			}else{
				/* Append the square bracket or curly braces */
				SyBlobAppend(pOut,"[",sizeof(char));
				/* Iterate throw array entries */
				jx9_array_walk(pIn, VmJsonArrayEncode, pData);
				/* Append the closing square bracket or curly braces */
				SyBlobAppend(pOut,"]",sizeof(char));
			}
		}else{
			/* Can't happen */
			SyBlobAppend(pOut,"null",sizeof("null")-1);
		}
		/* All done */
		return JX9_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x574d0
cmpl $0x0, %eax
jne 0x705f7
movq -0x8(%rbp), %rdi
callq 0x576d0
cmpl $0x0, %eax
je 0x70611
movq -0x18(%rbp), %rdi
leaq 0x549be(%rip), %rsi     # 0xc4fc0
movl $0x4, %edx
callq 0x5d9d0
jmp 0x7083b
movq -0x8(%rbp), %rdi
callq 0x57430
cmpl $0x0, %eax
je 0x7066e
movq -0x8(%rbp), %rdi
callq 0x56cf0
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %edx
movl $0x6, %eax
movl $0x5, %ecx
cmpl $0x0, %edx
cmovneq %rcx, %rax
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rdi
movl -0x20(%rbp), %ecx
leaq 0x4f5ee(%rip), %rsi     # 0xbfc3e
leaq 0x4f5e2(%rip), %rax     # 0xbfc39
cmpl $0x0, %ecx
cmovneq %rax, %rsi
movl -0x24(%rbp), %edx
subl $0x1, %edx
callq 0x5d9d0
jmp 0x70839
movq -0x8(%rbp), %rdi
callq 0x57520
cmpl $0x0, %eax
je 0x706b0
movq -0x8(%rbp), %rdi
callq 0x57480
cmpl $0x0, %eax
jne 0x706b0
movq -0x8(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
callq 0x56e20
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
movl -0x1c(%rbp), %edx
callq 0x5d9d0
jmp 0x70837
movq -0x8(%rbp), %rdi
callq 0x57480
cmpl $0x0, %eax
je 0x70768
movq -0x8(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
callq 0x56e20
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movslq -0x1c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x4f547(%rip), %rsi     # 0xbfc34
movl $0x1, %edx
callq 0x5d9d0
movq -0x38(%rbp), %rax
cmpq -0x40(%rbp), %rax
jb 0x70703
jmp 0x7074e
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
cmpl $0x22, -0x44(%rbp)
je 0x70725
cmpl $0x5c, -0x44(%rbp)
jne 0x7073a
movq -0x18(%rbp), %rdi
leaq 0x4ecc9(%rip), %rsi     # 0xbf3f9
movl $0x1, %edx
callq 0x5d9d0
movq -0x18(%rbp), %rdi
leaq -0x44(%rbp), %rsi
movl $0x1, %edx
callq 0x5d9d0
jmp 0x706f7
movq -0x18(%rbp), %rdi
leaq 0x4f4db(%rip), %rsi     # 0xbfc34
movl $0x1, %edx
callq 0x5d9d0
jmp 0x70835
movq -0x8(%rbp), %rdi
callq 0x57610
cmpl $0x0, %eax
je 0x7081e
movq -0x10(%rbp), %rax
movl $0x1, 0x8(%rax)
movq -0x8(%rbp), %rdi
callq 0x57660
cmpl $0x0, %eax
je 0x707de
movq -0x10(%rbp), %rax
movl $0x1, 0x8(%rax)
movq -0x18(%rbp), %rdi
leaq 0x56433(%rip), %rsi     # 0xc6bdc
movl $0x1, %edx
callq 0x5d9d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
leaq 0x8e(%rip), %rsi        # 0x70850
callq 0x57880
movq -0x18(%rbp), %rdi
leaq 0x532f7(%rip), %rsi     # 0xc3ac9
movl $0x1, %edx
callq 0x5d9d0
jmp 0x7081c
movq -0x18(%rbp), %rdi
leaq 0x4f0fb(%rip), %rsi     # 0xbf8e4
movl $0x1, %edx
callq 0x5d9d0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
leaq 0x17e(%rip), %rsi       # 0x70980
callq 0x57880
movq -0x18(%rbp), %rdi
leaq 0x4f0d9(%rip), %rsi     # 0xbf8eb
movl $0x1, %edx
callq 0x5d9d0
jmp 0x70833
movq -0x18(%rbp), %rdi
leaq 0x54797(%rip), %rsi     # 0xc4fc0
movl $0x4, %edx
callq 0x5d9d0
jmp 0x70835
jmp 0x70837
jmp 0x70839
jmp 0x7083b
xorl %eax, %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)