// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: jx9Builtin_vfprintf
static int jx9Builtin_vfprintf(jx9_context *pCtx, int nArg, jx9_value **apArg)
{
	fprintf_data sFdata;
	const char *zFormat;
	jx9_hashmap *pMap;
	io_private *pDev;
	SySet sArg;
	int n, nLen;
	if( nArg < 3 || !jx9_value_is_resource(apArg[0]) || !jx9_value_is_string(apArg[1])  || !jx9_value_is_json_array(apArg[2]) ){
		/* Missing/Invalid arguments, return zero */
		jx9_context_throw_error(pCtx, JX9_CTX_WARNING, "Invalid arguments");
		jx9_result_int(pCtx, 0);
		return JX9_OK;
	}
	/* Extract our private data */
	pDev = (io_private *)jx9_value_to_resource(apArg[0]);
	/* Make sure we are dealing with a valid io_private instance */
	if( IO_PRIVATE_INVALID(pDev) ){
		/*Expecting an IO handle */
		jx9_context_throw_error(pCtx, JX9_CTX_WARNING, "Expecting an IO handle");
		jx9_result_int(pCtx, 0);
		return JX9_OK;
	}
	/* Point to the target IO stream device */
	if( pDev->pStream == 0  || pDev->pStream->xWrite == 0 ){
		jx9_context_throw_error_format(pCtx, JX9_CTX_WARNING, 
			"IO routine(%s) not implemented in the underlying stream(%s) device", 
			jx9_function_name(pCtx), pDev->pStream ? pDev->pStream->zName : "null_stream"
			);
		jx9_result_int(pCtx, 0);
		return JX9_OK;
	}
	/* Extract the string format */
	zFormat = jx9_value_to_string(apArg[1], &nLen);
	if( nLen < 1 ){
		/* Empty string, return zero */
		jx9_result_int(pCtx, 0);
		return JX9_OK;
	}
	/* Point to hashmap */
	pMap = (jx9_hashmap *)apArg[2]->x.pOther;
	/* Extract arguments from the hashmap */
	n = jx9HashmapValuesToSet(pMap, &sArg);
	/* Prepare our private data */
	sFdata.nCount = 0;
	sFdata.pIO = pDev;
	/* Format the string */
	jx9InputFormat(fprintfConsumer, pCtx, zFormat, nLen, n, (jx9_value **)SySetBasePtr(&sArg), (void *)&sFdata, TRUE);
	/* Return total number of bytes written*/
	jx9_result_int64(pCtx, sFdata.nCount);
	SySetRelease(&sArg);
	return JX9_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
cmpl $0x3, -0x14(%rbp)
jl 0xa91b1
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x576d0
cmpl $0x0, %eax
je 0xa91b1
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x57480
cmpl $0x0, %eax
je 0xa91b1
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x57610
cmpl $0x0, %eax
jne 0xa91dd
movq -0x10(%rbp), %rdi
movl $0x2, %esi
leaq 0x1cc32(%rip), %rdx     # 0xc5df3
callq 0x580b0
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x56fb0
movl $0x0, -0x4(%rbp)
jmp 0xa9374
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x56ec0
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0xa9201
movq -0x48(%rbp), %rax
cmpl $0xfeac14, 0x34(%rax)   # imm = 0xFEAC14
je 0xa922d
movq -0x10(%rbp), %rdi
movl $0x2, %esi
leaq 0x1c994(%rip), %rdx     # 0xc5ba5
callq 0x580b0
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x56fb0
movl $0x0, -0x4(%rbp)
jmp 0xa9374
movq -0x48(%rbp), %rax
cmpq $0x0, (%rax)
je 0xa9249
movq -0x48(%rbp), %rax
movq (%rax), %rax
cmpq $0x0, 0x40(%rax)
jne 0xa92ca
movq -0x10(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rdi
callq 0x584d0
movq %rax, -0x80(%rbp)
movq -0x48(%rbp), %rax
cmpq $0x0, (%rax)
je 0xa927e
movq -0x48(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq %rax, -0x90(%rbp)
jmp 0xa928e
leaq 0x1c992(%rip), %rax     # 0xc5c17
movq %rax, -0x90(%rbp)
jmp 0xa928e
movq -0x80(%rbp), %rcx
movq -0x88(%rbp), %rdi
movq -0x90(%rbp), %r8
movl $0x2, %esi
leaq 0x1c977(%rip), %rdx     # 0xc5c23
movb $0x0, %al
callq 0x79580
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x56fb0
movl $0x0, -0x4(%rbp)
jmp 0xa9374
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
leaq -0x78(%rbp), %rsi
callq 0x56e20
movq %rax, -0x38(%rbp)
cmpl $0x1, -0x78(%rbp)
jge 0xa92f9
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x56fb0
movl $0x0, -0x4(%rbp)
jmp 0xa9374
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x9b5a0
movl %eax, -0x74(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rsi
movq -0x38(%rbp), %rdx
movl -0x78(%rbp), %ecx
movl -0x74(%rbp), %r8d
movq -0x68(%rbp), %r9
leaq 0x221e(%rip), %rdi      # 0xab560
leaq -0x30(%rbp), %rax
movq %rax, (%rsp)
movl $0x1, 0x8(%rsp)
callq 0x99c50
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x57010
leaq -0x70(%rbp), %rdi
callq 0x66980
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq