// File: /workspace/github_c_makefile_star2_O0/dxwc[P]sfeed/xml.c
// Function: xml_parse
void
xml_parse(XMLParser *x)
{
	size_t datalen, tagdatalen;
	int c, isend;

	while ((c = GETNEXT()) != EOF && c != '<')
		; /* skip until < */

	while (c != EOF) {
		if (c == '<') { /* parse tag */
			if ((c = GETNEXT()) == EOF)
				return;

			if (c == '!') { /* cdata and comments */
				for (tagdatalen = 0; (c = GETNEXT()) != EOF;) {
					/* NOTE: sizeof(x->data) must be atleast sizeof("[CDATA[") */
					if (tagdatalen <= sizeof("[CDATA[") - 1)
						x->data[tagdatalen++] = c;
					if (c == '>')
						break;
					else if (c == '-' && tagdatalen == sizeof("--") - 1 &&
							(x->data[0] == '-')) {
						xml_parsecomment(x);
						break;
					} else if (c == '[') {
						if (tagdatalen == sizeof("[CDATA[") - 1 &&
						    !strncmp(x->data, "[CDATA[", tagdatalen)) {
							xml_parsecdata(x);
							break;
						}
					}
				}
			} else {
				/* normal tag (open, short open, close), processing instruction. */
				x->tag[0] = c;
				x->taglen = 1;
				x->isshorttag = isend = 0;

				/* treat processing instruction as shorttag, don't strip "?" prefix. */
				if (c == '?') {
					x->isshorttag = 1;
				} else if (c == '/') {
					if ((c = GETNEXT()) == EOF)
						return;
					x->tag[0] = c;
					isend = 1;
				}

				while ((c = GETNEXT()) != EOF) {
					if (c == '/')
						x->isshorttag = 1; /* short tag */
					else if (c == '>' || isspace(c)) {
						x->tag[x->taglen] = '\0';
						if (isend) { /* end tag, starts with </ */
							if (x->xmltagend)
								x->xmltagend(x, x->tag, x->taglen, x->isshorttag);
							x->tag[0] = '\0';
							x->taglen = 0;
						} else {
							/* start tag */
							if (x->xmltagstart)
								x->xmltagstart(x, x->tag, x->taglen);
							if (isspace(c))
								xml_parseattrs(x);
							if (x->xmltagstartparsed)
								x->xmltagstartparsed(x, x->tag, x->taglen, x->isshorttag);
						}
						/* call tagend for shortform or processing instruction */
						if (x->isshorttag) {
							if (x->xmltagend)
								x->xmltagend(x, x->tag, x->taglen, x->isshorttag);
							x->tag[0] = '\0';
							x->taglen = 0;
						}
						break;
					} else if (x->taglen < sizeof(x->tag) - 1)
						x->tag[x->taglen++] = c; /* NOTE: tag name truncation */
				}
			}
		} else {
			/* parse tag data */
			datalen = 0;
			if (x->xmldatastart)
				x->xmldatastart(x);
			while ((c = GETNEXT()) != EOF) {
				if (c == '&') {
					if (datalen) {
						x->data[datalen] = '\0';
						if (x->xmldata)
							x->xmldata(x, x->data, datalen);
					}
					x->data[0] = c;
					datalen = 1;
					while ((c = GETNEXT()) != EOF) {
						if (c == '<')
							break;
						if (datalen < sizeof(x->data) - 1)
							x->data[datalen++] = c;
						else {
							/* entity too long for buffer, handle as normal data */
							x->data[datalen] = '\0';
							if (x->xmldata)
								x->xmldata(x, x->data, datalen);
							x->data[0] = c;
							datalen = 1;
							break;
						}
						if (c == ';') {
							x->data[datalen] = '\0';
							if (x->xmldataentity)
								x->xmldataentity(x, x->data, datalen);
							datalen = 0;
							break;
						}
					}
				} else if (c != '<') {
					if (datalen < sizeof(x->data) - 1) {
						x->data[datalen++] = c;
					} else {
						x->data[datalen] = '\0';
						if (x->xmldata)
							x->xmldata(x, x->data, datalen);
						x->data[0] = c;
						datalen = 1;
					}
				}
				if (c == '<') {
					x->data[datalen] = '\0';
					if (x->xmldata && datalen)
						x->xmldata(x, x->data, datalen);
					if (x->xmldataend)
						x->xmldataend(x);
					break;
				}
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
callq 0x2140
movl %eax, %ecx
movl %ecx, -0x1c(%rbp)
xorl %eax, %eax
cmpl $-0x1, %ecx
movb %al, -0x21(%rbp)
je 0x51fa
cmpl $0x3c, -0x1c(%rbp)
setne %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0x5203
jmp 0x5205
jmp 0x51dc
jmp 0x5207
cmpl $-0x1, -0x1c(%rbp)
je 0x57db
cmpl $0x3c, -0x1c(%rbp)
jne 0x556b
callq 0x2140
movl %eax, -0x1c(%rbp)
cmpl $-0x1, %eax
jne 0x522d
jmp 0x57db
cmpl $0x21, -0x1c(%rbp)
jne 0x52ee
movq $0x0, -0x18(%rbp)
callq 0x2140
movl %eax, -0x1c(%rbp)
cmpl $-0x1, %eax
je 0x52e9
cmpq $0x7, -0x18(%rbp)
ja 0x5276
movl -0x1c(%rbp), %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movq -0x18(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x18(%rbp)
movb %dl, 0x894(%rax,%rcx)
cmpl $0x3e, -0x1c(%rbp)
jne 0x527e
jmp 0x52e9
cmpl $0x2d, -0x1c(%rbp)
jne 0x52a6
cmpq $0x2, -0x18(%rbp)
jne 0x52a6
movq -0x8(%rbp), %rax
movsbl 0x894(%rax), %eax
cmpl $0x2d, %eax
jne 0x52a6
movq -0x8(%rbp), %rdi
callq 0x57f0
jmp 0x52e9
cmpl $0x5b, -0x1c(%rbp)
jne 0x52e0
cmpq $0x7, -0x18(%rbp)
jne 0x52de
movq -0x8(%rbp), %rdi
addq $0x894, %rdi            # imm = 0x894
movq -0x18(%rbp), %rdx
leaq 0x1fb7(%rip), %rsi      # 0x7280
callq 0x2060
cmpl $0x0, %eax
jne 0x52de
movq -0x8(%rbp), %rdi
callq 0x59f0
jmp 0x52e9
jmp 0x52e0
jmp 0x52e2
jmp 0x52e4
jmp 0x523f
jmp 0x5566
movl -0x1c(%rbp), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x88(%rax)
movq -0x8(%rbp), %rax
movq $0x1, 0x488(%rax)
movl $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rax
movl $0x0, 0x490(%rax)
cmpl $0x3f, -0x1c(%rbp)
jne 0x5337
movq -0x8(%rbp), %rax
movl $0x1, 0x490(%rax)
jmp 0x5367
cmpl $0x2f, -0x1c(%rbp)
jne 0x5365
callq 0x2140
movl %eax, -0x1c(%rbp)
cmpl $-0x1, %eax
jne 0x534f
jmp 0x57db
movl -0x1c(%rbp), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x88(%rax)
movl $0x1, -0x20(%rbp)
jmp 0x5367
jmp 0x5369
callq 0x2140
movl %eax, -0x1c(%rbp)
cmpl $-0x1, %eax
je 0x5564
cmpl $0x2f, -0x1c(%rbp)
jne 0x5393
movq -0x8(%rbp), %rax
movl $0x1, 0x490(%rax)
jmp 0x555f
cmpl $0x3e, -0x1c(%rbp)
je 0x53b7
callq 0x21f0
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x5521
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x488(%rcx), %rcx
movb $0x0, 0x88(%rax,%rcx)
cmpl $0x0, -0x20(%rbp)
je 0x542c
movq -0x8(%rbp), %rax
cmpq $0x0, 0x70(%rax)
je 0x540d
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x88, %rsi
movq -0x8(%rbp), %rcx
movq 0x488(%rcx), %rdx
movq -0x8(%rbp), %rcx
movl 0x490(%rcx), %ecx
callq *%rax
movq -0x8(%rbp), %rax
movb $0x0, 0x88(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x488(%rax)
jmp 0x54bf
movq -0x8(%rbp), %rax
cmpq $0x0, 0x78(%rax)
je 0x545b
movq -0x8(%rbp), %rax
movq 0x78(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x88, %rsi
movq -0x8(%rbp), %rcx
movq 0x488(%rcx), %rdx
callq *%rax
callq 0x21f0
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x547e
movq -0x8(%rbp), %rdi
callq 0x5bf0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x80(%rax)
je 0x54bd
movq -0x8(%rbp), %rax
movq 0x80(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x88, %rsi
movq -0x8(%rbp), %rcx
movq 0x488(%rcx), %rdx
movq -0x8(%rbp), %rcx
movl 0x490(%rcx), %ecx
callq *%rax
jmp 0x54bf
movq -0x8(%rbp), %rax
cmpl $0x0, 0x490(%rax)
je 0x551f
movq -0x8(%rbp), %rax
cmpq $0x0, 0x70(%rax)
je 0x5505
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x88, %rsi
movq -0x8(%rbp), %rcx
movq 0x488(%rcx), %rdx
movq -0x8(%rbp), %rcx
movl 0x490(%rcx), %ecx
callq *%rax
movq -0x8(%rbp), %rax
movb $0x0, 0x88(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x488(%rax)
jmp 0x5564
movq -0x8(%rbp), %rax
cmpq $0x3ff, 0x488(%rax) # imm = 0x3FF
jae 0x555b
movl -0x1c(%rbp), %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rsi
movq 0x488(%rsi), %rcx
movq %rcx, %rdi
addq $0x1, %rdi
movq %rdi, 0x488(%rsi)
movb %dl, 0x88(%rax,%rcx)
jmp 0x555d
jmp 0x555f
jmp 0x5369
jmp 0x5566
jmp 0x57d6
movq $0x0, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x68(%rax)
je 0x558c
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
movq -0x8(%rbp), %rdi
callq *%rax
jmp 0x558e
callq 0x2140
movl %eax, -0x1c(%rbp)
cmpl $-0x1, %eax
je 0x57d4
cmpl $0x26, -0x1c(%rbp)
jne 0x56eb
cmpq $0x0, -0x10(%rbp)
je 0x55ea
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movb $0x0, 0x894(%rax,%rcx)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x50(%rax)
je 0x55e8
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x894, %rsi            # imm = 0x894
movq -0x10(%rbp), %rdx
callq *%rax
jmp 0x55ea
movl -0x1c(%rbp), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x894(%rax)
movq $0x1, -0x10(%rbp)
callq 0x2140
movl %eax, -0x1c(%rbp)
cmpl $-0x1, %eax
je 0x56e6
cmpl $0x3c, -0x1c(%rbp)
jne 0x561d
jmp 0x56e6
cmpq $0x1fff, -0x10(%rbp)    # imm = 0x1FFF
jae 0x5648
movl -0x1c(%rbp), %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x10(%rbp)
movb %dl, 0x894(%rax,%rcx)
jmp 0x5699
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movb $0x0, 0x894(%rax,%rcx)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x50(%rax)
je 0x5680
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x894, %rsi            # imm = 0x894
movq -0x10(%rbp), %rdx
callq *%rax
movl -0x1c(%rbp), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x894(%rax)
movq $0x1, -0x10(%rbp)
jmp 0x56e6
cmpl $0x3b, -0x1c(%rbp)
jne 0x56e1
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movb $0x0, 0x894(%rax,%rcx)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x60(%rax)
je 0x56d7
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x894, %rsi            # imm = 0x894
movq -0x10(%rbp), %rdx
callq *%rax
movq $0x0, -0x10(%rbp)
jmp 0x56e6
jmp 0x5601
jmp 0x576f
cmpl $0x3c, -0x1c(%rbp)
je 0x576d
cmpq $0x1fff, -0x10(%rbp)    # imm = 0x1FFF
jae 0x571c
movl -0x1c(%rbp), %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x10(%rbp)
movb %dl, 0x894(%rax,%rcx)
jmp 0x576b
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movb $0x0, 0x894(%rax,%rcx)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x50(%rax)
je 0x5754
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x894, %rsi            # imm = 0x894
movq -0x10(%rbp), %rdx
callq *%rax
movl -0x1c(%rbp), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x894(%rax)
movq $0x1, -0x10(%rbp)
jmp 0x576d
jmp 0x576f
cmpl $0x3c, -0x1c(%rbp)
jne 0x57cf
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movb $0x0, 0x894(%rax,%rcx)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x50(%rax)
je 0x57b4
cmpq $0x0, -0x10(%rbp)
je 0x57b4
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x894, %rsi            # imm = 0x894
movq -0x10(%rbp), %rdx
callq *%rax
movq -0x8(%rbp), %rax
cmpq $0x0, 0x58(%rax)
je 0x57cd
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x8(%rbp), %rdi
callq *%rax
jmp 0x57d4
jmp 0x558e
jmp 0x57d6
jmp 0x5207
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)