// File: /workspace/github_c_makefile_star2_O0/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
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x2c, -0x3c(%rbp)
movl $0x22, -0x40(%rbp)
movl $0x5c, -0x44(%rbp)
cmpl $0x1, -0x14(%rbp)
jl 0x952ef
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x57480
cmpl $0x0, %eax
jne 0x95304
movq -0x10(%rbp), %rdi
callq 0x57120
movl $0x0, -0x4(%rbp)
jmp 0x95453
movq -0x20(%rbp), %rax
movq (%rax), %rdi
leaq -0x48(%rbp), %rsi
callq 0x56e20
movq %rax, -0x28(%rbp)
cmpl $0x1, -0x14(%rbp)
jle 0x953df
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x57480
cmpl $0x0, %eax
je 0x9535b
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
leaq -0x4c(%rbp), %rsi
callq 0x56e20
movq %rax, -0x30(%rbp)
cmpl $0x0, -0x4c(%rbp)
jle 0x95359
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x3c(%rbp)
jmp 0x9535b
cmpl $0x2, -0x14(%rbp)
jle 0x953dd
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x57480
cmpl $0x0, %eax
je 0x9539a
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
leaq -0x4c(%rbp), %rsi
callq 0x56e20
movq %rax, -0x30(%rbp)
cmpl $0x0, -0x4c(%rbp)
jle 0x95398
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x40(%rbp)
jmp 0x9539a
cmpl $0x3, -0x14(%rbp)
jle 0x953db
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x57480
cmpl $0x0, %eax
je 0x953d9
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x4c(%rbp), %rsi
callq 0x56e20
movq %rax, -0x30(%rbp)
cmpl $0x0, -0x4c(%rbp)
jle 0x953d7
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x44(%rbp)
jmp 0x953d9
jmp 0x953db
jmp 0x953dd
jmp 0x953df
movq -0x10(%rbp), %rdi
callq 0x58570
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x9541a
movq -0x10(%rbp), %rdi
movl $0x1, %esi
leaq 0x2f3ae(%rip), %rdx     # 0xc47b1
callq 0x580b0
movq -0x10(%rbp), %rdi
callq 0x57120
movl $0x0, -0x4(%rbp)
jmp 0x95453
movq -0x28(%rbp), %rdi
movl -0x48(%rbp), %esi
movl -0x3c(%rbp), %edx
movl -0x40(%rbp), %ecx
movl -0x44(%rbp), %r8d
movq -0x38(%rbp), %rax
leaq 0x636a(%rip), %r9       # 0x9b7a0
movq %rax, (%rsp)
callq 0x9b630
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x572c0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)