// File: /workspace/github_c_makefile_star2_O1/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 0x2d91(%rip), %rdi      # 0x4260
leaq 0x2d92(%rip), %rsi      # 0x4268
movq %r14, %rdx
callq 0x11e0
testq %rax, %rax
jle 0x16fb
leaq 0x2d72(%rip), %rbp      # 0x4260
leaq 0x2d73(%rip), %r12      # 0x4268
movq 0x2d64(%rip), %rcx      # 0x4260
cmpb $0xa, -0x1(%rcx,%rax)
jne 0x1508
movb $0x0, -0x1(%rcx,%rax)
movq 0x2d51(%rip), %rdi      # 0x4260
movb (%rdi), %cl
testb %cl, %cl
je 0x153b
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 0x151f
jmp 0x1541
movl $0x1505, %r15d          # imm = 0x1505
leaq 0x10(%rsp), %rsi
callq 0x1c2b
testq %rax, %rax
je 0x16fb
movq $0x0, 0x8(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x1cb0
testl %eax, %eax
jne 0x16e4
movq %rbp, %r13
leaq 0xb0c(%rip), %rdi       # 0x208a
leaq 0x2cbb(%rip), %rsi      # 0x4240
xorl %eax, %eax
callq 0x10c0
leaq 0x8(%rsp), %rdi
leaq 0x70(%rsp), %rbp
movq %rbp, %rsi
callq 0x10f0
testq %rax, %rax
je 0x15d6
movl $0x20, %esi
leaq 0x50(%rsp), %rdi
leaq 0xaed(%rip), %rdx       # 0x20a1
movq %rbp, %rcx
callq 0x11b0
testq %rax, %rax
je 0x15d6
leaq 0xaf5(%rip), %rdi       # 0x20bd
leaq 0x50(%rsp), %rsi
xorl %eax, %eax
callq 0x10c0
jmp 0x15e2
leaq 0xb71(%rip), %rdi       # 0x214e
callq 0x1060
movq 0x40(%rsp), %rsi
cmpb $0x0, (%rsi)
leaq 0xae9(%rip), %rax       # 0x20da
cmoveq %rax, %rsi
leaq 0xacb(%rip), %rdi       # 0x20c7
xorl %eax, %eax
callq 0x10c0
movq 0x2b26(%rip), %rdx      # 0x4130
leaq 0xad1(%rip), %rdi       # 0x20e2
movq %rdx, %rsi
leaq 0x2b25(%rip), %rcx      # 0x4140
xorl %eax, %eax
callq 0x10c0
cmpb $0x0, (%rbx)
movq %r13, %rbp
je 0x1642
movq 0x18(%rsp), %rdx
leaq 0xabc(%rip), %rdi       # 0x20f2
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10c0
jmp 0x1655
movq 0x18(%rsp), %rsi
leaq 0xab6(%rip), %rdi       # 0x2104
xorl %eax, %eax
callq 0x10c0
movq 0x10(%rsp), %rsi
cmpb $0x0, (%rsi)
leaq 0xac7(%rip), %rdx       # 0x212b
leaq 0xad2(%rip), %rax       # 0x213d
cmoveq %rax, %rdx
leaq 0xa9b(%rip), %rdi       # 0x2111
movq %r15, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0x10c0
leaq 0xaea(%rip), %rdi       # 0x2174
callq 0x1060
leaq 0xb08(%rip), %rdi       # 0x219e
callq 0x1060
leaq 0xa8b(%rip), %rdi       # 0x212d
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10c0
movq 0x20(%rsp), %rdi
callq 0x1060
movq 0x48(%rsp), %rsi
cmpb $0x0, (%rsi)
je 0x16ce
leaq 0xa77(%rip), %rdi       # 0x213e
xorl %eax, %eax
callq 0x10c0
movq 0x2903(%rip), %rax      # 0x3fd8
movq (%rax), %rsi
leaq 0xa5d(%rip), %rdi       # 0x213c
callq 0x1100
movq %rbp, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x11e0
testq %rax, %rax
jg 0x14f5
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)