// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq (%rsi), %rbx
movl 0x8(%rdi), %eax
testl $0x120, %eax            # imm = 0x120
je 0x4007e
leaq 0x38a60(%rip), %rsi     # 0x78ad4
movq %rbx, %rdi
movl $0x4, %edx
jmp 0x400e1
movq %rdi, %r14
testb $0x8, %al
jne 0x400b8
movq %rsi, %r15
movq %r14, %rdi
callq 0x30e27
testl %eax, %eax
je 0x400f4
testb $0x1, 0x8(%r14)
jne 0x400f4
leaq -0x30(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x30b04
movl (%r15), %edx
movq %rbx, %rdi
movq %rax, %rsi
jmp 0x401d9
movq %r14, %rdi
callq 0x446ef
xorl %edx, %edx
cmpl $0x0, (%r14)
sete %dl
leaq 0x33bac(%rip), %rax     # 0x73c7c
leaq 0x33ba0(%rip), %rsi     # 0x73c77
cmoveq %rax, %rsi
orl $0x4, %edx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x360ae
movl 0x8(%r14), %eax
testb $0x1, %al
jne 0x40152
testb $0x40, %al
je 0x4006d
movl $0x1, 0x8(%r15)
movq (%r14), %rax
testb $0x1, 0x40(%rax)
jne 0x401ed
leaq 0x3382c(%rip), %rsi     # 0x7394c
movq %rbx, %rdi
movl $0x1, %edx
callq 0x360ae
testb $0x40, 0x8(%r14)
je 0x40146
movq (%r14), %rdi
leaq 0x1cb(%rip), %rsi       # 0x40309
movq %r15, %rdx
callq 0x52ab1
leaq 0x33806(%rip), %rsi     # 0x73953
jmp 0x40229
leaq -0x30(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x30b04
movq %rax, %r14
movslq (%r15), %r13
leaq 0x33b04(%rip), %rsi     # 0x73c72
movq %rbx, %rdi
movl $0x1, %edx
callq 0x360ae
testq %r13, %r13
jle 0x401ca
addq %r14, %r13
leaq 0x33295(%rip), %r15     # 0x7341f
leaq -0x2c(%rbp), %r12
movzbl (%r14), %eax
movsbl %al, %ecx
movl %ecx, -0x2c(%rbp)
cmpl $0x5c, %eax
je 0x401a2
cmpl $0x22, %eax
jne 0x401b2
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x360ae
incq %r14
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0x360ae
cmpq %r13, %r14
jb 0x4018e
leaq 0x33aa1(%rip), %rsi     # 0x73c72
movq %rbx, %rdi
movl $0x1, %edx
callq 0x360ae
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, 0x8(%r15)
leaq 0x3a0e8(%rip), %rsi     # 0x7a2e4
movq %rbx, %rdi
movl $0x1, %edx
callq 0x360ae
testb $0x40, 0x8(%r14)
je 0x40222
movq (%r14), %rdi
leaq 0x1c(%rip), %rsi        # 0x40236
movq %r15, %rdx
callq 0x52ab1
leaq 0x373c7(%rip), %rsi     # 0x775f0
movq %rbx, %rdi
movl $0x1, %edx
jmp 0x400e1