// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/unqlite/unqlite.c
// Function: jx9StripTagsFromString
JX9_PRIVATE sxi32 jx9StripTagsFromString(jx9_context *pCtx, const char *zIn, int nByte, const char *zTaglist, int nTaglen)
{
	const char *zEnd = &zIn[nByte];
	const char *zPtr, *zTag;
	SySet sSet;
	/* initialize the set of allowed tags */
	SySetInit(&sSet, &pCtx->pVm->sAllocator, sizeof(SyString));
	if( nTaglen > 0 ){
		/* Set of allowed tags */
		AddTag(&sSet, zTaglist, nTaglen);
	}
	/* Set the empty string */
	jx9_result_string(pCtx, "", 0);
	/* Start processing */
	for(;;){
		if(zIn >= zEnd){
			/* No more input to process */
			break;
		}
		zPtr = zIn;
		/* Find a tag */
		while( zIn < zEnd && zIn[0] != '<' && zIn[0] != 0 /* NUL byte */ ){
			zIn++;
		}
		if( zIn > zPtr ){
			/* Consume raw input */
			jx9_result_string(pCtx, zPtr, (int)(zIn-zPtr));
		}
		/* Ignore trailing null bytes */
		while( zIn < zEnd && zIn[0] == 0 ){
			zIn++;
		}
		if(zIn >= zEnd){
			/* No more input to process */
			break;
		}
		if( zIn[0] == '<' ){
			sxi32 rc;
			zTag = zIn++;
			/* Delimit the tag */
			while( zIn < zEnd && zIn[0] != '>' ){
				zIn++;
			}
			if( zIn < zEnd ){
				zIn++; /* Ignore the trailing closing tag */
			}
			/* Query the set */
			rc = FindTag(&sSet, zTag, (int)(zIn-zTag));
			if( rc == SXRET_OK ){
				/* Keep the tag */
				jx9_result_string(pCtx, zTag, (int)(zIn-zTag));
			}
		}
	}
	/* Cleanup */
	SySetRelease(&sSet);
	return SXRET_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rsi
leaq -0x68(%rbp), %rdi
movl $0x10, %edx
callq 0x5b470
cmpl $0x0, -0x24(%rbp)
jle 0x9b986
movq -0x20(%rbp), %rsi
movl -0x24(%rbp), %edx
leaq -0x68(%rbp), %rdi
callq 0x9bb30
movq -0x8(%rbp), %rdi
leaq 0x2a1ba(%rip), %rsi     # 0xc5b4b
xorl %edx, %edx
callq 0x57180
movq -0x10(%rbp), %rax
cmpq -0x30(%rbp), %rax
jb 0x9b9a7
jmp 0x9bb14
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rcx
xorl %eax, %eax
cmpq -0x30(%rbp), %rcx
movb %al, -0x6d(%rbp)
jae 0x9b9df
movq -0x10(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x3c, %ecx
movb %al, -0x6d(%rbp)
je 0x9b9df
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x6d(%rbp)
movb -0x6d(%rbp), %al
testb $0x1, %al
jne 0x9b9e8
jmp 0x9b9f6
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x9b9af
movq -0x10(%rbp), %rax
cmpq -0x38(%rbp), %rax
jbe 0x9ba1a
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x10(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rcx, %rax
movl %eax, %edx
callq 0x57180
jmp 0x9ba1c
movq -0x10(%rbp), %rcx
xorl %eax, %eax
cmpq -0x30(%rbp), %rcx
movb %al, -0x6e(%rbp)
jae 0x9ba3b
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
sete %al
movb %al, -0x6e(%rbp)
movb -0x6e(%rbp), %al
testb $0x1, %al
jne 0x9ba44
jmp 0x9ba52
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x9ba1c
movq -0x10(%rbp), %rax
cmpq -0x30(%rbp), %rax
jb 0x9ba61
jmp 0x9bb14
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3c, %eax
jne 0x9bb0f
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rcx
xorl %eax, %eax
cmpq -0x30(%rbp), %rcx
movb %al, -0x6f(%rbp)
jae 0x9baa3
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3e, %eax
setne %al
movb %al, -0x6f(%rbp)
movb -0x6f(%rbp), %al
testb $0x1, %al
jne 0x9baac
jmp 0x9baba
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x9ba84
movq -0x10(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x9bad0
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x40(%rbp), %rsi
movq -0x10(%rbp), %rax
movq -0x40(%rbp), %rcx
subq %rcx, %rax
movl %eax, %edx
leaq -0x68(%rbp), %rdi
callq 0x9bdf0
movl %eax, -0x6c(%rbp)
cmpl $0x0, -0x6c(%rbp)
jne 0x9bb0d
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x10(%rbp), %rax
movq -0x40(%rbp), %rcx
subq %rcx, %rax
movl %eax, %edx
callq 0x57180
jmp 0x9bb0f
jmp 0x9b998
leaq -0x68(%rbp), %rdi
callq 0x66980
xorl %eax, %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)