// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
cmpl $0x3, %esi
jl 0x63fa8
movq %rdx, %r14
movq (%rdx), %rax
testb $0x1, 0x9(%rax)
je 0x63fa8
movq 0x8(%r14), %rdi
testb $0x1, 0x8(%rdi)
je 0x63fa8
movq 0x10(%r14), %rcx
testb $0x40, 0x8(%rcx)
jne 0x63ff6
movq (%rbx), %rsi
movq 0x60(%rbx), %rdi
addq $0x8, %rsi
leaq 0x13960(%rip), %rcx     # 0x7791a
movl $0x2, %edx
callq 0x40afa
movq 0x8(%rbx), %rbx
movq %rbx, %rdi
callq 0x30465
movq $0x0, (%rbx)
movl $0xfffffe90, %eax       # imm = 0xFFFFFE90
andl 0x8(%rbx), %eax
orl $0x2, %eax
movl %eax, 0x8(%rbx)
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rax), %r13
testq %r13, %r13
je 0x640cf
cmpl $0xfeac14, 0x34(%r13)   # imm = 0xFEAC14
jne 0x640cf
movq (%r13), %rax
testq %rax, %rax
je 0x640e6
cmpq $0x0, 0x40(%rax)
je 0x640ef
leaq -0x2c(%rbp), %r15
movq %r15, %rsi
callq 0x30577
cmpl $0x0, (%r15)
jle 0x63fc4
movq %rax, %r12
movq 0x10(%r14), %rax
movq (%rax), %rdi
leaq -0x68(%rbp), %rsi
movq %rsi, %r14
callq 0x5b130
leaq -0x40(%rbp), %r15
movq $0x0, 0x8(%r15)
movq %r13, (%r15)
movl -0x2c(%rbp), %ecx
movq %r14, %r13
movq 0x8(%r14), %r14
leaq 0xd25(%rip), %rdi       # 0x64d95
movq %rbx, %rsi
movq %r12, %rdx
movl %eax, %r8d
movq %r14, %r9
pushq $0x1
pushq %r15
callq 0x5a243
addq $0x10, %rsp
movq 0x8(%r15), %r15
movq 0x8(%rbx), %rbx
movq %rbx, %rdi
callq 0x30465
movq %r15, (%rbx)
movl $0xfffffe90, %eax       # imm = 0xFFFFFE90
andl 0x8(%rbx), %eax
orl $0x2, %eax
movl %eax, 0x8(%rbx)
movq (%r13), %rdi
testq %rdi, %rdi
sete %al
testq %r14, %r14
sete %cl
orb %al, %cl
jne 0x63fe5
movq %r14, %rsi
callq 0x3490d
jmp 0x63fe5
movq (%rbx), %rsi
movq 0x60(%rbx), %rdi
addq $0x8, %rsi
leaq 0x135eb(%rip), %rcx     # 0x776cc
jmp 0x63fba
leaq 0x13651(%rip), %r8      # 0x7773e
jmp 0x640f2
movq (%rax), %r8
movq (%rbx), %rax
movq 0x8(%rax), %rcx
leaq 0x1364a(%rip), %rdx     # 0x7774a
movq %rbx, %rdi
movl $0x2, %esi
xorl %eax, %eax
callq 0x44ed3
jmp 0x63fc4