// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: jx9Builtin_fstat
static int jx9Builtin_fstat(jx9_context *pCtx, int nArg, jx9_value **apArg)
{
	jx9_value *pArray, *pValue;
	const jx9_io_stream *pStream;
	io_private *pDev;
	if( nArg < 1 || !jx9_value_is_resource(apArg[0]) ){
		/* Missing/Invalid arguments, return FALSE */
		jx9_context_throw_error(pCtx, JX9_CTX_WARNING, "Expecting an IO handle");
		jx9_result_bool(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_bool(pCtx, 0);
		return JX9_OK;
	}
	/* Point to the target IO stream device */
	pStream = pDev->pStream;
	if( pStream == 0  || pStream->xStat == 0){
		jx9_context_throw_error_format(pCtx, JX9_CTX_WARNING, 
			"IO routine(%s) not implemented in the underlying stream(%s) device, JX9 is returning FALSE", 
			jx9_function_name(pCtx), pStream ? pStream->zName : "null_stream"
			);
		jx9_result_bool(pCtx, 0);
		return JX9_OK;
	}
	/* Create the array and the working value */
	pArray = jx9_context_new_array(pCtx);
	pValue = jx9_context_new_scalar(pCtx);
	if( pArray == 0 || pValue == 0 ){
		jx9_context_throw_error(pCtx, JX9_CTX_ERR, "JX9 is running out of memory");
		jx9_result_bool(pCtx, 0);
		return JX9_OK;
	}
	/* Perform the requested operation */
	pStream->xStat(pDev->pHandle, pArray, pValue);
	/* Return the freshly created array */
	jx9_result_value(pCtx, pArray);
	/* Don't worry about freeing memory here, everything will be
	 * released automatically as soon we return from this function.
	 */
	return JX9_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
cmpl $0x1, -0x14(%rbp)
jl 0xa80aa
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x576d0
cmpl $0x0, %eax
jne 0xa80d6
movq -0x10(%rbp), %rdi
movl $0x2, %esi
leaq 0x1daeb(%rip), %rdx     # 0xc5ba5
callq 0x580b0
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x57070
movl $0x0, -0x4(%rbp)
jmp 0xa822b
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x56ec0
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0xa80fa
movq -0x40(%rbp), %rax
cmpl $0xfeac14, 0x34(%rax)   # imm = 0xFEAC14
je 0xa8126
movq -0x10(%rbp), %rdi
movl $0x2, %esi
leaq 0x1da9b(%rip), %rdx     # 0xc5ba5
callq 0x580b0
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x57070
movl $0x0, -0x4(%rbp)
jmp 0xa822b
movq -0x40(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0xa8143
movq -0x38(%rbp), %rax
cmpq $0x0, 0x78(%rax)
jne 0xa81ac
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
callq 0x584d0
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0xa816c
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x58(%rbp)
jmp 0xa8179
leaq 0x1daa4(%rip), %rax     # 0xc5c17
movq %rax, -0x58(%rbp)
jmp 0xa8179
movq -0x48(%rbp), %rcx
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %r8
movl $0x2, %esi
leaq 0x1da2b(%rip), %rdx     # 0xc5bbc
movb $0x0, %al
callq 0x79580
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x57070
movl $0x0, -0x4(%rbp)
jmp 0xa822b
movq -0x10(%rbp), %rdi
callq 0x58570
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x58510
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0xa81d4
cmpq $0x0, -0x30(%rbp)
jne 0xa81fd
movq -0x10(%rbp), %rdi
movl $0x1, %esi
leaq 0x1c5cd(%rip), %rdx     # 0xc47b1
callq 0x580b0
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x57070
movl $0x0, -0x4(%rbp)
jmp 0xa822b
movq -0x38(%rbp), %rax
movq 0x78(%rax), %rax
movq -0x40(%rbp), %rcx
movq 0x8(%rcx), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq *%rax
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x572c0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)