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

	while ((linelen = getline(&line, &linesize, fp)) > 0) {
		if (line[linelen - 1] == '\n')
			line[--linelen] = '\0';
		hash = djb2((unsigned char *)line, 5381UL);
		if (!parseline(line, fields))
			break;
		parsedtime = 0;
		if (strtotime(fields[FieldUnixTimestamp], &parsedtime))
			continue;

		/* mbox + mail header */
		printf("From MAILER-DAEMON %s\n", mtimebuf);
		/* can't convert: default to formatted time for time_t 0. */
		if (gmtime_r(&parsedtime, &tm) &&
		    strftime(timebuf, sizeof(timebuf),
		             "%a, %d %b %Y %H:%M:%S +0000", &tm))
			printf("Date: %s\n", timebuf);
		else
			printf("Date: Thu, 01 Jan 1970 00:00:00 +0000\n");

		printf("From: %s <sfeed@>\n", fields[FieldAuthor][0] ? fields[FieldAuthor] : "unknown");
		printf("To: %s <%s@%s>\n", user, user, host);
		if (feedname[0])
			printf("Subject: [%s] %s\n", feedname, fields[FieldTitle]);
		else
			printf("Subject: %s\n", fields[FieldTitle]);
		printf("Message-ID: <%s%s%lu@%s>\n",
		       fields[FieldUnixTimestamp],
		       fields[FieldUnixTimestamp][0] ? "." : "",
		       hash, feedname);
		printf("Content-Type: text/plain; charset=\"utf-8\"\n");
		printf("Content-Transfer-Encoding: binary\n");
		printf("X-Feedname: %s\n\n", feedname);

		printf("%s\n", fields[FieldLink]);
		if (fields[FieldEnclosure][0])
			printf("\nEnclosure:\n%s\n", fields[FieldEnclosure]);
		fputs("\n", stdout);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x2db1(%rip), %r15      # 0x4260
leaq 0x2db2(%rip), %rbp      # 0x4268
movq %r15, %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq 0x11d0
testq %rax, %rax
jle 0x16a1
movq 0x2d8c(%rip), %rdi      # 0x4260
cmpb $0xa, -0x1(%rdi,%rax)
jne 0x14e7
movb $0x0, -0x1(%rdi,%rax)
movq 0x2d79(%rip), %rdi      # 0x4260
movl $0x1505, %r13d          # imm = 0x1505
movq %rdi, %rax
movzbl (%rax), %ecx
testq %rcx, %rcx
je 0x1504
incq %rax
imulq $0x21, %r13, %r13
addq %rcx, %r13
jmp 0x14f0
leaq 0x10(%rsp), %rsi
callq 0x1b59
testq %rax, %rax
je 0x16a1
andq $0x0, 0x8(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x1bb5
testl %eax, %eax
jne 0x14b6
movq %r15, %r12
leaq 0xb50(%rip), %rdi       # 0x208a
leaq 0x2cff(%rip), %rsi      # 0x4240
xorl %eax, %eax
callq 0x10b0
leaq 0x8(%rsp), %rdi
leaq 0x70(%rsp), %r15
movq %r15, %rsi
callq 0x10e0
testq %rax, %rax
je 0x1590
leaq 0x50(%rsp), %rdi
pushq $0x20
popq %rsi
leaq 0xb33(%rip), %rdx       # 0x20a1
movq %r15, %rcx
callq 0x11a0
testq %rax, %rax
je 0x1590
leaq 0xb3b(%rip), %rdi       # 0x20bd
leaq 0x50(%rsp), %rsi
xorl %eax, %eax
callq 0x10b0
jmp 0x159c
leaq 0xbb7(%rip), %rdi       # 0x214e
callq 0x1050
movq 0x40(%rsp), %rsi
cmpb $0x0, (%rsi)
leaq 0xb2f(%rip), %rax       # 0x20da
cmoveq %rax, %rsi
leaq 0xb11(%rip), %rdi       # 0x20c7
xorl %eax, %eax
callq 0x10b0
movq 0x2b6c(%rip), %rdx      # 0x4130
leaq 0xb17(%rip), %rdi       # 0x20e2
movq %rdx, %rsi
leaq 0x2b6b(%rip), %rcx      # 0x4140
xorl %eax, %eax
callq 0x10b0
cmpb $0x0, (%rbx)
movq 0x18(%rsp), %rdx
movq %r12, %r15
je 0x15fc
leaq 0xb02(%rip), %rdi       # 0x20f2
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10b0
jmp 0x160d
leaq 0xb01(%rip), %rdi       # 0x2104
movq %rdx, %rsi
xorl %eax, %eax
callq 0x10b0
movq 0x10(%rsp), %rsi
cmpb $0x0, (%rsi)
leaq 0xb0f(%rip), %rdx       # 0x212b
leaq 0xb1a(%rip), %rax       # 0x213d
cmoveq %rax, %rdx
leaq 0xae3(%rip), %rdi       # 0x2111
movq %r13, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0x10b0
leaq 0xb32(%rip), %rdi       # 0x2174
callq 0x1050
leaq 0xb50(%rip), %rdi       # 0x219e
callq 0x1050
leaq 0xad3(%rip), %rdi       # 0x212d
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10b0
movq 0x20(%rsp), %rdi
callq 0x1050
movq 0x48(%rsp), %rsi
cmpb $0x0, (%rsi)
je 0x1686
leaq 0xabf(%rip), %rdi       # 0x213e
xorl %eax, %eax
callq 0x10b0
movq 0x294b(%rip), %rax      # 0x3fd8
movq (%rax), %rsi
leaq 0xaa5(%rip), %rdi       # 0x213c
callq 0x10f0
jmp 0x14b6
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop