// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rcx, %rbx
movq %rsi, -0x48(%rbp)
movq %rdi, -0x50(%rbp)
movq 0x60(%rdi), %rax
movabsq $0x1000000000, %rcx     # imm = 0x1000000000
movq %rcx, -0x9c(%rbp)
andl $0x0, -0xa0(%rbp)
movslq %edx, %r14
andl $0x0, -0x94(%rbp)
movq %rax, -0xb0(%rbp)
andq $0x0, -0xa8(%rbp)
andq $0x0, -0x90(%rbp)
testl %r8d, %r8d
jle 0x4eb97
movq %r14, -0x58(%rbp)
movl %r8d, %r14d
addq %rbx, %r14
movabsq $-0x6fff5ffe00000000, %r13 # imm = 0x9000A00200000000
cmpq %r14, %rbx
jae 0x4eb80
movzbl (%rbx), %eax
cmpq $0x3f, %rax
ja 0x4ea53
btq %rax, %r13
jae 0x4ea53
incq %rbx
jmp 0x4ea36
movq %rbx, -0x30(%rbp)
cmpb $-0x40, %al
jae 0x4ea76
movsbq %al, %rbx
callq 0xc190
movq (%rax), %rax
testb $0x20, 0x1(%rax,%rbx,2)
movq -0x30(%rbp), %rbx
jne 0x4eb4e
cmpq %r14, %rbx
jae 0x4eaba
movsbq (%rbx), %r12
cmpq $-0x40, %r12
jb 0x4eaa1
incq %rbx
movq %rbx, %rax
cmpq %r14, %rax
jae 0x4eab5
movb (%rax), %cl
andb $-0x40, %cl
movq %rax, %rbx
incq %rax
negb %cl
jo 0x4ea8b
jmp 0x4ea76
callq 0xc190
movq (%rax), %rax
testb $0x8, (%rax,%r12,2)
je 0x4eaba
incq %rbx
jmp 0x4ea76
movq %rax, %rbx
jmp 0x4ea76
movq %rbx, %rax
movq -0x30(%rbp), %r12
subq %r12, %rax
jbe 0x4ea4e
movq %r12, -0x78(%rbp)
movl %eax, -0x70(%rbp)
movl %eax, %eax
movq %rax, -0x40(%rbp)
testl %eax, %eax
je 0x4eb00
movsbq (%r12), %r13
cmpq $-0x41, %r13
ja 0x4eb00
movq %rax, %r15
callq 0xc190
movq (%rax), %rax
testb $0x20, 0x1(%rax,%r13,2)
movq %r15, %rax
je 0x4eb00
incq %r12
decq %rax
jmp 0x4ead3
movq %r12, -0x78(%rbp)
movl %eax, -0x70(%rbp)
movq -0x30(%rbp), %rcx
movq -0x40(%rbp), %rdx
leaq (%rcx,%rdx), %r12
decq %r12
xorl %r15d, %r15d
movq %rax, -0x38(%rbp)
cmpq %r15, %rax
je 0x4eb57
movsbq (%r12), %r13
cmpq $-0x41, %r13
ja 0x4eb5b
callq 0xc190
movq (%rax), %rax
incq %r15
decq %r12
testb $0x20, 0x1(%rax,%r13,2)
movq -0x38(%rbp), %rax
jne 0x4eb1d
subl %r15d, %eax
incl %eax
jmp 0x4eb5e
movq -0x30(%rbp), %rbx
jmp 0x4ea4e
xorl %eax, %eax
jmp 0x4eb5e
subl %r15d, %eax
movl %eax, -0x70(%rbp)
leaq -0xb0(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x2be00
movabsq $-0x6fff5ffe00000000, %r13 # imm = 0x9000A00200000000
jmp 0x4ea4e
movl -0xa0(%rbp), %ebx
movq -0xa8(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x58(%rbp), %r14
jmp 0x4eba1
movq $0x0, -0x68(%rbp)
xorl %ebx, %ebx
movq -0x48(%rbp), %r15
addq %r15, %r14
leaq 0x18aa3(%rip), %rsi     # 0x67652
movq -0x50(%rbp), %rdi
xorl %edx, %edx
callq 0x29903
movl %ebx, -0x5c(%rbp)
movl %ebx, %eax
shlq $0x4, %rax
addq $0x10, %rax
movq %rax, -0x58(%rbp)
cmpq %r14, %r15
jae 0x4ee30
movl %r15d, %r8d
negl %r8d
leaq 0x1(%r15), %r13
movl %r15d, %esi
movq %r15, %rbx
xorl %edx, %edx
leaq (%r15,%rdx), %r12
cmpq %r14, %r12
jae 0x4ec0d
movzbl (%r12), %eax
testl %eax, %eax
je 0x4ec0d
cmpl $0x3c, %eax
je 0x4ec0d
incq %rdx
decl %r8d
incq %rbx
incq %r13
incl %esi
jmp 0x4ebe6
cmpq %r15, %r12
jbe 0x4ec3c
movq -0x50(%rbp), %rdi
movq %rsi, -0x30(%rbp)
movq %r15, %rsi
movq %r8, %r15
callq 0x29903
movq -0x30(%rbp), %rsi
movq %r15, %r8
jmp 0x4ec3c
incq %r12
decl %r8d
incq %rbx
incq %r13
incl %esi
cmpq %r14, %r12
jae 0x4ee30
movzbl (%r12), %eax
testl %eax, %eax
je 0x4ec2e
movq %r12, %r15
cmpl $0x3c, %eax
jne 0x4ebcb
movq %r13, %rax
cmpq %r14, %r13
jae 0x4ec6b
leaq 0x1(%rax), %r13
cmpb $0x3e, (%rax)
jne 0x4ec5a
leaq 0x1(%rax), %r15
cmpq %r14, %rax
cmovaeq %rax, %r15
cmpl $0x0, -0x5c(%rbp)
je 0x4ebcb
movq %r15, %rax
subq %rbx, %rax
movq %rax, -0x80(%rbp)
leal (%r15,%r8), %eax
movslq %eax, %r13
addq %r12, %r13
movq %r12, %rbx
movabsq $-0x6fff800000000000, %rcx # imm = 0x9000800000000000
movq %r15, -0x48(%rbp)
cmpq %r13, %rbx
jae 0x4ed08
movzbl (%rbx), %eax
cmpq $0x3f, %rax
ja 0x4ecb9
btq %rax, %rcx
jb 0x4ecfe
cmpb $-0x41, %al
movq %rbx, -0x40(%rbp)
ja 0x4ed0c
movsbq %al, %rax
movq %rax, -0x88(%rbp)
movq %r8, -0x38(%rbp)
movq %rsi, %rbx
callq 0xc190
movq %rbx, %rsi
movq -0x40(%rbp), %rbx
movq -0x38(%rbp), %r8
movq (%rax), %rax
movq -0x88(%rbp), %rcx
testb $0x20, 0x1(%rax,%rcx,2)
movabsq $-0x6fff800000000000, %rcx # imm = 0x9000800000000000
je 0x4ed0c
incq %rbx
incl %esi
decl %r8d
jmp 0x4eca5
movq %rbx, -0x40(%rbp)
movq %r14, %r15
cmpq %r13, %rbx
jae 0x4ed69
movsbq (%rbx), %r14
cmpq $-0x40, %r14
jb 0x4ed3d
incq %rbx
movq %rbx, %rax
movq %r15, %r14
cmpq %r13, %rax
jae 0x4ed64
movb (%rax), %cl
andb $-0x40, %cl
movq %rax, %rbx
incq %rax
negb %cl
jo 0x4ed27
jmp 0x4ed0c
movq %r8, -0x38(%rbp)
movq %rsi, -0x30(%rbp)
callq 0xc190
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %r8
movq (%rax), %rax
testb $0x8, (%rax,%r14,2)
je 0x4ed69
incq %rbx
movq %r15, %r14
jmp 0x4ed0c
movq %rax, %rbx
jmp 0x4ed0c
addl %ebx, %r8d
xorl %r13d, %r13d
movq %r8, -0x38(%rbp)
movq %rsi, -0x30(%rbp)
cmpl %r13d, %r8d
je 0x4ee24
movq -0x40(%rbp), %rax
movsbq (%rax,%r13), %r14
cmpq $-0x40, %r14
jae 0x4edb1
testb %r14b, %r14b
je 0x4edac
callq 0xc190
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %r8
movq (%rax), %rax
testb $0x20, 0x1(%rax,%r14,2)
je 0x4edb1
incq %r13
jmp 0x4ed77
addq %r13, -0x40(%rbp)
subq %r13, %r8
subl %ebx, %esi
addq %r13, %rsi
xorl %ecx, %ecx
movq %r15, %r14
movq -0x48(%rbp), %r15
movq -0x68(%rbp), %r13
movq %rsi, -0x30(%rbp)
movq %r8, -0x38(%rbp)
leaq 0x10(%rcx), %rbx
cmpq %rbx, -0x58(%rbp)
je 0x4ebcb
movl 0x8(%r13,%rcx), %eax
movl %esi, %edx
addl %eax, %edx
je 0x4edef
addl %esi, %eax
jmp 0x4ee08
movq (%r13,%rcx), %rdi
movq -0x40(%rbp), %rsi
movl %r8d, %edx
callq 0x32436
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %r8
movq %rbx, %rcx
testl %eax, %eax
jne 0x4edd2
movq -0x50(%rbp), %rdi
movq %r12, %rsi
movq -0x80(%rbp), %rdx
callq 0x29903
jmp 0x4ebcb
movq %r15, %r14
movq -0x48(%rbp), %r15
jmp 0x4ebcb
leaq -0xb0(%rbp), %rdi
callq 0x31feb
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq