// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: jx9Builtin_str_getcsv
static int jx9Builtin_str_getcsv(jx9_context *pCtx, int nArg, jx9_value **apArg)
{
	const char *zInput, *zPtr;
	jx9_value *pArray;
	int delim  = ',';   /* Delimiter */
	int encl   = '"' ;  /* Enclosure */
	int escape = '\\';  /* Escape character */
	int nLen;
	if( nArg < 1 || !jx9_value_is_string(apArg[0]) ){
		/* Missing/Invalid arguments, return NULL */
		jx9_result_null(pCtx);
		return JX9_OK;
	}
	/* Extract the raw input */
	zInput = jx9_value_to_string(apArg[0], &nLen);
	if( nArg > 1 ){
		int i;
		if( jx9_value_is_string(apArg[1]) ){
			/* Extract the delimiter */
			zPtr = jx9_value_to_string(apArg[1], &i);
			if( i > 0 ){
				delim = zPtr[0];
			}
		}
		if( nArg > 2 ){
			if( jx9_value_is_string(apArg[2]) ){
				/* Extract the enclosure */
				zPtr = jx9_value_to_string(apArg[2], &i);
				if( i > 0 ){
					encl = zPtr[0];
				}
			}
			if( nArg > 3 ){
				if( jx9_value_is_string(apArg[3]) ){
					/* Extract the escape character */
					zPtr = jx9_value_to_string(apArg[3], &i);
					if( i > 0 ){
						escape = zPtr[0];
					}
				}
			}
		}
	}
	/* Create our array */
	pArray = jx9_context_new_array(pCtx);
	if( pArray == 0 ){
		jx9_context_throw_error(pCtx, JX9_CTX_ERR, "JX9 is running out of memory");
		jx9_result_null(pCtx);
		return JX9_OK;
	}
	/* Parse the raw input */
	jx9ProcessCsv(zInput, nLen, delim, encl, escape, jx9CsvConsumer, pArray);
	/* Return the freshly created array */
	jx9_result_value(pCtx, pArray);
	return JX9_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
testl %esi, %esi
jle 0x4ad9d
movq %rdx, %r14
movq (%rdx), %rdi
testb $0x1, 0x8(%rdi)
je 0x4ad9d
movl %esi, %r15d
leaq -0x34(%rbp), %rsi
callq 0x297ed
movq %rax, -0x40(%rbp)
cmpl $0x1, %r15d
jne 0x4accb
pushq $0x5c
popq %r12
pushq $0x22
popq %r13
pushq $0x2c
popq %r15
jmp 0x4ad56
movq 0x8(%r14), %rdi
pushq $0x2c
popq %rax
movl %eax, -0x2c(%rbp)
testb $0x1, 0x8(%rdi)
je 0x4acf4
leaq -0x30(%rbp), %r12
movq %r12, %rsi
callq 0x297ed
cmpl $0x0, (%r12)
jle 0x4acf4
movsbl (%rax), %eax
movl %eax, -0x2c(%rbp)
pushq $0x5c
popq %r12
cmpl $0x3, %r15d
jb 0x4ad4e
movq 0x10(%r14), %rdi
pushq $0x22
popq %r13
testb $0x1, 0x8(%rdi)
je 0x4ad22
leaq -0x30(%rbp), %rsi
callq 0x297ed
leaq -0x30(%rbp), %rcx
cmpl $0x0, (%rcx)
jle 0x4ad22
movsbl (%rax), %r13d
cmpl $0x3, %r15d
je 0x4ad52
movq 0x18(%r14), %rdi
testb $0x1, 0x8(%rdi)
movl -0x2c(%rbp), %r15d
je 0x4ad56
leaq -0x30(%rbp), %r14
movq %r14, %rsi
callq 0x297ed
cmpl $0x0, (%r14)
jle 0x4ad56
movsbl (%rax), %r12d
jmp 0x4ad56
pushq $0x22
popq %r13
movl -0x2c(%rbp), %r15d
movq %rbx, %rdi
callq 0x2a2b0
testq %rax, %rax
je 0x4ad8b
movq %rax, %r14
movl -0x34(%rbp), %esi
movq -0x40(%rbp), %rdi
movl %r15d, %edx
movl %r13d, %ecx
movl %r12d, %r8d
movq %rax, %r9
callq 0x4e81f
movq %rbx, %rdi
movq %r14, %rsi
callq 0x299d3
jmp 0x4ada5
leaq 0x1b51e(%rip), %rdx     # 0x662b0
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2a0db
movq %rbx, %rdi
callq 0x298e8
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq