// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
testl %esi, %esi
jle 0x65872
movq %rdx, %r15
movq (%rdx), %rdi
testb $0x1, 0x8(%rdi)
jne 0x658c0
movq (%rbx), %rsi
movq 0x60(%rbx), %rdi
addq $0x8, %rsi
leaq 0x13d7a(%rip), %rcx     # 0x795fe
movl $0x2, %edx
callq 0x4153c
movq 0x8(%rbx), %rbx
movq %rbx, %rdi
callq 0x309f2
movq $0x0, (%rbx)
movl $0xfffffe90, %eax       # imm = 0xFFFFFE90
andl 0x8(%rbx), %eax
orl $0x8, %eax
movl %eax, 0x8(%rbx)
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %esi, %r12d
leaq -0x3c(%rbp), %r14
movq %r14, %rsi
callq 0x30b04
leaq -0x38(%rbp), %rsi
movq %rax, (%rsi)
movq 0x60(%rbx), %r13
movl (%r14), %edx
movq %r13, %rdi
callq 0x53369
testq %rax, %rax
je 0x65983
movq %rax, %r14
movq -0x38(%rbp), %rax
movq %r13, %rdi
movq %rax, %r13
movq %r14, %rsi
movq %rax, %rdx
movl $0x1, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq $0x0
pushq $0x0
callq 0x534fd
addq $0x10, %rsp
testq %rax, %rax
je 0x65999
movq 0x60(%rbx), %rcx
xorps %xmm0, %xmm0
leaq -0x60(%rbp), %r13
movups %xmm0, 0x8(%r13)
movq %rcx, (%r13)
movl $0x0, 0x18(%r13)
movq %rax, -0x30(%rbp)
movq %rax, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x53771
movl 0x10(%r13), %r13d
testl %r13d, %r13d
je 0x659b7
movq -0x58(%rbp), %rsi
xorl %ecx, %ecx
cmpl $0x1, %r12d
je 0x65976
movq 0x8(%r15), %r15
movq %r15, %rdi
movq %rsi, %r12
callq 0x446ef
movq %r12, %rsi
movl (%r15), %ecx
movq %rbx, %rdi
movl %r13d, %edx
callq 0x5d477
jmp 0x659d8
movq (%rbx), %rsi
addq $0x8, %rsi
leaq 0x13c83(%rip), %rcx     # 0x79614
movq %r13, %rdi
jmp 0x65884
leaq 0x13ca2(%rip), %rdx     # 0x79642
movq %rbx, %rdi
movl $0x1, %esi
movq %r13, %rcx
xorl %eax, %eax
callq 0x45d26
jmp 0x6588e
movq 0x8(%rbx), %rbx
movq %rbx, %rdi
callq 0x309f2
movq $0x0, (%rbx)
movl $0xfffffe90, %eax       # imm = 0xFFFFFE90
andl 0x8(%rbx), %eax
orl $0x8, %eax
movl %eax, 0x8(%rbx)
movq 0x20(%r14), %rax
testq %rax, %rax
movq -0x30(%rbp), %rdi
je 0x659e7
callq *%rax
leaq -0x58(%rbp), %rbx
testb $0x6, 0x10(%rbx)
jne 0x65a04
cmpl $0x0, -0x4c(%rbp)
je 0x65a04
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x3503f
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movl $0x0, 0x10(%rbx)
jmp 0x658af