// File: /workspace/github_c_makefile_star2_O2/dxwc[P]sfeed/sfeed_atom.c
// Function: printfeed
static void
printfeed(FILE *fp, const char *feedname)
{
	char *fields[FieldLast];
	struct tm *tm;
	time_t parsedtime;
	ssize_t linelen;

	while ((linelen = getline(&line, &linesize, fp)) > 0) {
		if (line[linelen - 1] == '\n')
			line[--linelen] = '\0';
		if (!parseline(line, fields))
			break;

		parsedtime = 0;
		if (strtotime(fields[FieldUnixTimestamp], &parsedtime))
			continue;
		if (!(tm = localtime(&parsedtime)))
			err(1, "localtime");

		fputs("<entry>\n\t<title>", stdout);
		if (feedname[0]) {
			fputs("[", stdout);
			xmlencode(feedname, stdout);
			fputs("] ", stdout);
		}
		xmlencode(fields[FieldTitle], stdout);
		fputs("</title>\n", stdout);
		if (fields[FieldLink][0]) {
			fputs("\t<link rel=\"alternate\" href=\"", stdout);
			xmlencode(fields[FieldLink], stdout);
			fputs("\" />\n", stdout);
		}
		if (fields[FieldEnclosure][0]) {
			fputs("\t<link rel=\"enclosure\" href=\"", stdout);
			xmlencode(fields[FieldEnclosure], stdout);
			fputs("\" />\n", stdout);
		}
		fprintf(stdout, "\t<published>%04d-%02d-%02dT%02d:%02d:%02dZ</published>\n",
		        tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
		        tm->tm_hour, tm->tm_min, tm->tm_sec);
		if (fields[FieldAuthor][0]) {
			fputs("\t<author><name>", stdout);
			xmlencode(fields[FieldAuthor], stdout);
			fputs("</name></author>\n", stdout);
		}
		if (fields[FieldContent][0]) {
			if (!strcmp(fields[FieldContentType], "html")) {
				fputs("\t<content type=\"html\">", stdout);
			} else {
				/* NOTE: an RSS/Atom viewer may or may not format
				   whitespace such as newlines.
				   Workaround: type="html" and <![CDATA[<pre></pre>]]> */
				fputs("\t<content type=\"text\">", stdout);
			}
			printcontent(fields[FieldContent]);
			fputs("</content>\n", stdout);
		}
		fputs("</entry>\n", stdout);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %r15
leaq 0x2d2f(%rip), %r12      # 0x4100
leaq 0x2d30(%rip), %rbx      # 0x4108
movq 0x2bf9(%rip), %r13      # 0x3fd8
leaq 0xdb3(%rip), %rbp       # 0x2199
movq %rsi, 0x8(%rsp)
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x11a0
testq %rax, %rax
jle 0x16b3
movq 0x2cf7(%rip), %rdi      # 0x4100
cmpb $0xa, -0x1(%rdi,%rax)
jne 0x141c
movb $0x0, -0x1(%rdi,%rax)
movq 0x2ce4(%rip), %rdi      # 0x4100
leaq 0x10(%rsp), %rsi
callq 0x1b79
testq %rax, %rax
je 0x16b3
andq $0x0, (%rsp)
movq 0x10(%rsp), %rdi
movq %rsp, %rsi
callq 0x1bd5
testl %eax, %eax
jne 0x13eb
movq %r12, %rbx
movq %r15, %r12
movq %rsp, %rdi
callq 0x1040
testq %rax, %rax
je 0x16c2
movq %rax, %r14
movq (%r13), %rsi
leaq 0xc25(%rip), %rdi       # 0x208f
callq 0x10c0
movq 0x8(%rsp), %r15
cmpb $0x0, (%r15)
je 0x14a6
movq (%r13), %rsi
leaq 0xc1b(%rip), %rdi       # 0x20a0
callq 0x10c0
movq (%r13), %rsi
movq %r15, %rdi
callq 0x1c31
movq (%r13), %rsi
leaq 0xc01(%rip), %rdi       # 0x20a2
callq 0x10c0
movq 0x18(%rsp), %rdi
movq (%r13), %rsi
callq 0x1c31
movq (%r13), %rsi
leaq 0xbe6(%rip), %rdi       # 0x20a5
callq 0x10c0
movq 0x20(%rsp), %rax
cmpb $0x0, (%rax)
je 0x14fc
movq (%r13), %rsi
leaq 0xbd6(%rip), %rdi       # 0x20af
callq 0x10c0
movq 0x20(%rsp), %rdi
movq (%r13), %rsi
callq 0x1c31
movq (%r13), %rsi
leaq 0xbd6(%rip), %rdi       # 0x20cd
callq 0x10c0
movq 0x48(%rsp), %rax
cmpb $0x0, (%rax)
movq %r12, %r15
je 0x1537
movq (%r13), %rsi
leaq 0xbbf(%rip), %rdi       # 0x20d3
callq 0x10c0
movq 0x48(%rsp), %rdi
movq (%r13), %rsi
callq 0x1c31
movq (%r13), %rsi
leaq 0xb9b(%rip), %rdi       # 0x20cd
callq 0x10c0
movq (%r13), %rdi
movl 0x14(%r14), %edx
movl $0x76c, %eax            # imm = 0x76C
addl %eax, %edx
movl 0x10(%r14), %ecx
incl %ecx
movl 0xc(%r14), %r8d
movl 0x8(%r14), %r9d
movl (%r14), %r10d
movl 0x4(%r14), %r11d
leaq 0xb8f(%rip), %rsi       # 0x20f1
xorl %eax, %eax
pushq %r10
pushq %r11
callq 0x1130
popq %rcx
popq %rdx
movq 0x40(%rsp), %rax
cmpb $0x0, (%rax)
movq %rbx, %r12
je 0x15aa
movq (%r13), %rsi
leaq 0xba2(%rip), %rdi       # 0x2129
callq 0x10c0
movq 0x40(%rsp), %rdi
movq (%r13), %rsi
callq 0x1c31
movq (%r13), %rsi
leaq 0xb94(%rip), %rdi       # 0x2139
callq 0x10c0
movq 0x28(%rsp), %rax
cmpb $0x0, (%rax)
leaq 0x2b4f(%rip), %rbx      # 0x4108
je 0x169e
movq 0x30(%rsp), %rdi
leaq 0xb80(%rip), %rsi       # 0x214b
callq 0x1100
testl %eax, %eax
movq (%r13), %rsi
leaq 0xb8a(%rip), %rdi       # 0x2167
leaq 0xb6c(%rip), %rax       # 0x2150
cmoveq %rax, %rdi
callq 0x10c0
movq 0x28(%rsp), %r14
movzbl (%r14), %eax
cmpl $0x22, %eax
je 0x1668
cmpl $0x26, %eax
je 0x165b
cmpl $0x27, %eax
je 0x161d
cmpl $0x3c, %eax
je 0x1633
cmpl $0x3e, %eax
je 0x162a
cmpl $0x5c, %eax
je 0x1640
testl %eax, %eax
je 0x168e
movsbl %al, %edi
jmp 0x1681
movq (%r13), %rsi
leaq 0xb76(%rip), %rdi       # 0x219e
jmp 0x1673
movq (%r13), %rsi
movq %rbp, %rdi
jmp 0x1673
movq (%r13), %rsi
leaq 0xb56(%rip), %rdi       # 0x2194
jmp 0x1673
movzbl 0x1(%r14), %eax
incq %r14
cmpl $0x5c, %eax
je 0x167e
cmpl $0x74, %eax
je 0x167a
cmpl $0x6e, %eax
jne 0x1686
pushq $0xa
jmp 0x1680
movq (%r13), %rsi
leaq 0xb3e(%rip), %rdi       # 0x21a4
jmp 0x1673
movq (%r13), %rsi
leaq 0xb37(%rip), %rdi       # 0x21aa
callq 0x10c0
jmp 0x1686
pushq $0x9
jmp 0x1680
pushq $0x5c
popq %rdi
callq 0x1030
incq %r14
jmp 0x15f2
movq (%r13), %rsi
leaq 0xae5(%rip), %rdi       # 0x217e
callq 0x10c0
movq (%r13), %rsi
leaq 0xae1(%rip), %rdi       # 0x218a
callq 0x10c0
jmp 0x13eb
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9bc(%rip), %rsi       # 0x2085
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x1170
nop