// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: jx9ProcessCsv
JX9_PRIVATE sxi32 jx9ProcessCsv(
	const char *zInput, /* Raw input */
	int nByte,  /* Input length */
	int delim,  /* Delimiter */
	int encl,   /* Enclosure */
	int escape,  /* Escape character */
	sxi32 (*xConsumer)(const char *, int, void *), /* User callback */
	void *pUserData /* Last argument to xConsumer() */
	)
{
	const char *zEnd = &zInput[nByte];
	const char *zIn = zInput;
	const char *zPtr;
	int isEnc;
	/* Start processing */
	for(;;){
		if( zIn >= zEnd ){
			/* No more input to process */
			break;
		}
		isEnc = 0;
		zPtr = zIn;
		/* Find the first delimiter */
		while( zIn < zEnd ){
			if( zIn[0] == delim && !isEnc){
				/* Delimiter found, break imediately */
				break;
			}else if( zIn[0] == encl ){
				/* Inside enclosure? */
				isEnc = !isEnc;
			}else if( zIn[0] == escape ){
				/* Escape sequence */
				zIn++;
			}
			/* Advance the cursor */
			zIn++;
		}
		if( zIn > zPtr ){
			int nByte = (int)(zIn-zPtr);
			sxi32 rc;
			/* Invoke the supllied callback */
			if( zPtr[0] == encl ){
				zPtr++;
				nByte-=2;
			}
			if( nByte > 0 ){
				rc = xConsumer(zPtr, nByte, pUserData);
				if( rc == SXERR_ABORT ){
					/* User callback request an operation abort */
					break;
				}
			}
		}
		/* Ignore trailing delimiter */
		while( zIn < zEnd && zIn[0] == delim ){
			zIn++;
		}
	}
	return SXRET_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl %r8d, -0x18(%rbp)
movq %r9, -0x20(%rbp)
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x28(%rbp), %rax
jb 0x9b677
jmp 0x9b789
movl $0x0, -0x3c(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x9b6ed
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl -0x10(%rbp), %eax
jne 0x9b6a4
cmpl $0x0, -0x3c(%rbp)
jne 0x9b6a4
jmp 0x9b6ed
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl -0x14(%rbp), %eax
jne 0x9b6c3
cmpl $0x0, -0x3c(%rbp)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x3c(%rbp)
jmp 0x9b6dd
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl -0x18(%rbp), %eax
jne 0x9b6db
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x9b6dd
jmp 0x9b6df
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x9b686
movq -0x30(%rbp), %rax
cmpq -0x38(%rbp), %rax
jbe 0x9b74c
movq -0x30(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl -0x14(%rbp), %eax
jne 0x9b726
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
movl -0x40(%rbp), %eax
subl $0x2, %eax
movl %eax, -0x40(%rbp)
cmpl $0x0, -0x40(%rbp)
jle 0x9b74a
movq -0x20(%rbp), %rax
movq -0x38(%rbp), %rdi
movl -0x40(%rbp), %esi
movq 0x10(%rbp), %rdx
callq *%rax
movl %eax, -0x44(%rbp)
cmpl $-0xa, -0x44(%rbp)
jne 0x9b748
jmp 0x9b789
jmp 0x9b74a
jmp 0x9b74c
jmp 0x9b74e
movq -0x30(%rbp), %rcx
xorl %eax, %eax
cmpq -0x28(%rbp), %rcx
movb %al, -0x45(%rbp)
jae 0x9b76d
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl -0x10(%rbp), %eax
sete %al
movb %al, -0x45(%rbp)
movb -0x45(%rbp), %al
testb $0x1, %al
jne 0x9b776
jmp 0x9b784
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x9b74e
jmp 0x9b668
xorl %eax, %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)