// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: jx9Builtin_parse_ini_file
static int jx9Builtin_parse_ini_file(jx9_context *pCtx, int nArg, jx9_value **apArg)
{
	const jx9_io_stream *pStream;
	const char *zFile;
	SyBlob sContents;
	void *pHandle;
	int nLen;
	if( nArg < 1 || !jx9_value_is_string(apArg[0]) ){
		/* Missing/Invalid arguments, return FALSE */
		jx9_context_throw_error(pCtx, JX9_CTX_WARNING, "Expecting a file path");
		jx9_result_bool(pCtx, 0);
		return JX9_OK;
	}
	/* Extract the file path */
	zFile = jx9_value_to_string(apArg[0], &nLen);
	/* Point to the target IO stream device */
	pStream = jx9VmGetStreamDevice(pCtx->pVm, &zFile, nLen);
	if( pStream == 0 ){
		jx9_context_throw_error(pCtx, JX9_CTX_WARNING, "No such stream device, JX9 is returning FALSE");
		jx9_result_bool(pCtx, 0);
		return JX9_OK;
	}
	/* Try to open the file in read-only mode */
	pHandle = jx9StreamOpenHandle(pCtx->pVm, pStream, zFile, JX9_IO_OPEN_RDONLY, FALSE, 0, FALSE, 0);
	if( pHandle == 0 ){
		jx9_context_throw_error_format(pCtx, JX9_CTX_ERR, "IO error while opening '%s'", zFile);
		jx9_result_bool(pCtx, 0);
		return JX9_OK;
	}
	SyBlobInit(&sContents, &pCtx->pVm->sAllocator);
	/* Read the whole file */
	jx9StreamReadWholeFile(pHandle, pStream, &sContents);
	if( SyBlobLength(&sContents) < 1 ){
		/* Empty buffer, return FALSE */
		jx9_result_bool(pCtx, 0);
	}else{
		/* Process the raw INI buffer */
		jx9ParseIniString(pCtx, (const char *)SyBlobData(&sContents), SyBlobLength(&sContents), 
			nArg > 1 ? jx9_value_to_bool(apArg[1]) : 0);
	}
	/* Close the stream */
	jx9StreamCloseHandle(pStream, pHandle);
	/* Release the working buffer */
	SyBlobRelease(&sContents);
	return JX9_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
cmpl $0x1, -0x14(%rbp)
jl 0xa8fbd
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x57480
cmpl $0x0, %eax
jne 0xa8fe9
movq -0x10(%rbp), %rdi
movl $0x2, %esi
leaq 0x1cb15(%rip), %rdx     # 0xc5ae2
callq 0x580b0
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x57070
movl $0x0, -0x4(%rbp)
jmp 0xa9151
movq -0x20(%rbp), %rax
movq (%rax), %rdi
leaq -0x5c(%rbp), %rsi
callq 0x56e20
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rdi
movl -0x5c(%rbp), %edx
leaq -0x30(%rbp), %rsi
callq 0x8e570
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0xa9048
movq -0x10(%rbp), %rdi
movl $0x2, %esi
leaq 0x1cacc(%rip), %rdx     # 0xc5af8
callq 0x580b0
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x57070
movl $0x0, -0x4(%rbp)
jmp 0xa9151
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movl $0x1, %ecx
xorl %r8d, %r8d
xorl %eax, %eax
movl %eax, %r9d
movl $0x0, (%rsp)
movq $0x0, 0x8(%rsp)
callq 0x8e7e0
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
jne 0xa90b7
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rcx
movl $0x1, %esi
leaq 0x1ca8d(%rip), %rdx     # 0xc5b26
movb $0x0, %al
callq 0x79580
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x57070
movl $0x0, -0x4(%rbp)
jmp 0xa9151
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rsi
leaq -0x50(%rbp), %rdi
callq 0x58bb0
movq -0x58(%rbp), %rdi
movq -0x28(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x8e9f0
cmpl $0x1, -0x40(%rbp)
jae 0xa90ec
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x57070
jmp 0xa9134
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x68(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x60(%rbp)
cmpl $0x1, -0x14(%rbp)
jle 0xa911a
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x56cf0
movl %eax, -0x74(%rbp)
jmp 0xa9121
xorl %eax, %eax
movl %eax, -0x74(%rbp)
jmp 0xa9121
movl -0x60(%rbp), %edx
movq -0x68(%rbp), %rsi
movq -0x70(%rbp), %rdi
movl -0x74(%rbp), %ecx
callq 0x9c800
movq -0x28(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x8ea80
leaq -0x50(%rbp), %rdi
callq 0x58c00
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)