// File: /workspace/github_c_makefile_star2_O3/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 0x2da1(%rip), %rdi      # 0x4260
leaq 0x2da2(%rip), %rsi      # 0x4268
movq %r14, %rdx
callq 0x11d0
testq %rax, %rax
jle 0x16e9
leaq 0x2d82(%rip), %rbp      # 0x4260
leaq 0x2d83(%rip), %r12      # 0x4268
movq 0x2d74(%rip), %rdi      # 0x4260
cmpb $0xa, -0x1(%rdi,%rax)
jne 0x14ff
movb $0x0, -0x1(%rdi,%rax)
movq 0x2d61(%rip), %rdi      # 0x4260
movb (%rdi), %cl
testb %cl, %cl
je 0x152b
leaq 0x1(%rdi), %rax
movl $0x1505, %r15d          # imm = 0x1505
movq %r15, %rdx
shlq $0x5, %rdx
addq %r15, %rdx
movzbl %cl, %r15d
addq %rdx, %r15
movb (%rax), %cl
incq %rax
testb %cl, %cl
jne 0x150f
jmp 0x1531
movl $0x1505, %r15d          # imm = 0x1505
leaq 0x10(%rsp), %rsi
callq 0x1bc1
testq %rax, %rax
je 0x16e9
movq $0x0, 0x8(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x1ce3
testl %eax, %eax
jne 0x16d2
movq %rbp, %r13
leaq 0xb1c(%rip), %rdi       # 0x208a
leaq 0x2ccb(%rip), %rsi      # 0x4240
xorl %eax, %eax
callq 0x10b0
leaq 0x8(%rsp), %rdi
leaq 0x70(%rsp), %rbp
movq %rbp, %rsi
callq 0x10e0
testq %rax, %rax
je 0x15c6
movl $0x20, %esi
leaq 0x50(%rsp), %rdi
leaq 0xafd(%rip), %rdx       # 0x20a1
movq %rbp, %rcx
callq 0x11a0
testq %rax, %rax
je 0x15c6
leaq 0xb05(%rip), %rdi       # 0x20bd
leaq 0x50(%rsp), %rsi
xorl %eax, %eax
callq 0x10b0
jmp 0x15d2
leaq 0xb81(%rip), %rdi       # 0x214e
callq 0x1050
movq 0x40(%rsp), %rsi
cmpb $0x0, (%rsi)
leaq 0xaf9(%rip), %rax       # 0x20da
cmoveq %rax, %rsi
leaq 0xadb(%rip), %rdi       # 0x20c7
xorl %eax, %eax
callq 0x10b0
movq 0x2b36(%rip), %rdx      # 0x4130
leaq 0xae1(%rip), %rdi       # 0x20e2
movq %rdx, %rsi
leaq 0x2b35(%rip), %rcx      # 0x4140
xorl %eax, %eax
callq 0x10b0
cmpb $0x0, (%rbx)
movq 0x18(%rsp), %rdx
movq %r13, %rbp
je 0x1632
leaq 0xacc(%rip), %rdi       # 0x20f2
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10b0
jmp 0x1643
leaq 0xacb(%rip), %rdi       # 0x2104
movq %rdx, %rsi
xorl %eax, %eax
callq 0x10b0
movq 0x10(%rsp), %rsi
cmpb $0x0, (%rsi)
leaq 0xad9(%rip), %rdx       # 0x212b
leaq 0xae4(%rip), %rax       # 0x213d
cmoveq %rax, %rdx
leaq 0xaad(%rip), %rdi       # 0x2111
movq %r15, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0x10b0
leaq 0xafc(%rip), %rdi       # 0x2174
callq 0x1050
leaq 0xb1a(%rip), %rdi       # 0x219e
callq 0x1050
leaq 0xa9d(%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 0x16bc
leaq 0xa89(%rip), %rdi       # 0x213e
xorl %eax, %eax
callq 0x10b0
movq 0x2915(%rip), %rax      # 0x3fd8
movq (%rax), %rsi
leaq 0xa6f(%rip), %rdi       # 0x213c
callq 0x10f0
movq %rbp, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x11d0
testq %rax, %rax
jg 0x14e5
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop