// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdx
leaq 0x3d32(%rip), %rdi      # 0x5260
leaq 0x3d33(%rip), %rsi      # 0x5268
callq 0x11d0
movq %rax, -0xc8(%rbp)
cmpq $0x0, %rax
jle 0x17a6
movq 0x3d0e(%rip), %rax      # 0x5260
movq -0xc8(%rbp), %rcx
subq $0x1, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0xa, %eax
jne 0x1587
movq 0x3cf3(%rip), %rax      # 0x5260
movq -0xc8(%rbp), %rcx
movq %rcx, %rdx
addq $-0x1, %rdx
movq %rdx, -0xc8(%rbp)
movb $0x0, -0x1(%rax,%rcx)
movq 0x3cd2(%rip), %rdi      # 0x5260
movl $0x1505, %esi           # imm = 0x1505
callq 0x17b0
movq %rax, -0xc0(%rbp)
movq 0x3cba(%rip), %rdi      # 0x5260
leaq -0x90(%rbp), %rsi
callq 0x2150
cmpq $0x0, %rax
jne 0x15bd
jmp 0x17a6
movq $0x0, -0xb8(%rbp)
movq -0x90(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x2230
cmpl $0x0, %eax
je 0x15e5
jmp 0x1523
leaq 0x1a9e(%rip), %rdi      # 0x308a
leaq 0x3c4d(%rip), %rsi      # 0x5240
movb $0x0, %al
callq 0x10b0
leaq -0xb8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x10e0
cmpq $0x0, %rax
je 0x1649
leaq -0xb0(%rbp), %rdi
movl $0x20, %esi
leaq 0x1a7e(%rip), %rdx      # 0x30a1
leaq -0x48(%rbp), %rcx
callq 0x11a0
cmpq $0x0, %rax
je 0x1649
leaq -0xb0(%rbp), %rsi
leaq 0x1a7d(%rip), %rdi      # 0x30bd
movb $0x0, %al
callq 0x10b0
jmp 0x1657
leaq 0x1a77(%rip), %rdi      # 0x30c7
movb $0x0, %al
callq 0x10b0
movq -0x60(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x1670
movq -0x60(%rbp), %rax
movq %rax, -0xd0(%rbp)
jmp 0x1680
leaq 0x1a8a(%rip), %rax      # 0x3101
movq %rax, -0xd0(%rbp)
jmp 0x1680
movq -0xd0(%rbp), %rsi
leaq 0x1a60(%rip), %rdi      # 0x30ee
movb $0x0, %al
callq 0x10b0
movq 0x3a94(%rip), %rsi      # 0x5130
movq 0x3a8d(%rip), %rdx      # 0x5130
leaq 0x1a5f(%rip), %rdi      # 0x3109
leaq 0x3a8f(%rip), %rcx      # 0x5140
movb $0x0, %al
callq 0x10b0
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0x16dc
movq -0x10(%rbp), %rsi
movq -0x88(%rbp), %rdx
leaq 0x1a46(%rip), %rdi      # 0x3119
movb $0x0, %al
callq 0x10b0
jmp 0x16f1
movq -0x88(%rbp), %rsi
leaq 0x1a41(%rip), %rdi      # 0x312b
movb $0x0, %al
callq 0x10b0
movq -0x90(%rbp), %rsi
movq -0x90(%rbp), %rax
movsbl (%rax), %ecx
leaq 0x1aa9(%rip), %rdx      # 0x31b2
leaq 0x1a42(%rip), %rax      # 0x3152
cmpl $0x0, %ecx
cmovneq %rax, %rdx
movq -0xc0(%rbp), %rcx
movq -0x10(%rbp), %r8
leaq 0x1a0f(%rip), %rdi      # 0x3138
movb $0x0, %al
callq 0x10b0
leaq 0x1a1d(%rip), %rdi      # 0x3154
movb $0x0, %al
callq 0x10b0
leaq 0x1a3a(%rip), %rdi      # 0x317f
movb $0x0, %al
callq 0x10b0
movq -0x10(%rbp), %rsi
leaq 0x1a4b(%rip), %rdi      # 0x31a2
movb $0x0, %al
callq 0x10b0
movq -0x80(%rbp), %rsi
leaq 0x1a56(%rip), %rdi      # 0x31bf
movb $0x0, %al
callq 0x10b0
movq -0x58(%rbp), %rax
cmpb $0x0, (%rax)
je 0x178b
movq -0x58(%rbp), %rsi
leaq 0x1a2f(%rip), %rdi      # 0x31b3
movb $0x0, %al
callq 0x10b0
movq 0x3846(%rip), %rax      # 0x4fd8
movq (%rax), %rsi
leaq 0x1a15(%rip), %rdi      # 0x31b1
callq 0x10f0
jmp 0x1523
addq $0xd0, %rsp
popq %rbp
retq
nop