// File: /workspace/github_c_makefile_star2_O0/lyda[P]tz/zdump.c
// Function: dumptime
static void
dumptime(timeptr)
register const struct tm *	timeptr;
{
	static const char	wday_name[][3] = {
		"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
	};
	static const char	mon_name[][3] = {
		"Jan", "Feb", "Mar", "Apr", "May", "Jun",
		"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
	};
	register const char *	wn;
	register const char *	mn;
	register int		lead;
	register int		trail;

	if (timeptr == NULL) {
		(void) printf("NULL");
		return;
	}
	/*
	** The packaged versions of localtime and gmtime never put out-of-range
	** values in tm_wday or tm_mon, but since this code might be compiled
	** with other (perhaps experimental) versions, paranoia is in order.
	*/
	if (timeptr->tm_wday < 0 || timeptr->tm_wday >=
		(int) (sizeof wday_name / sizeof wday_name[0]))
			wn = "???";
	else		wn = wday_name[timeptr->tm_wday];
	if (timeptr->tm_mon < 0 || timeptr->tm_mon >=
		(int) (sizeof mon_name / sizeof mon_name[0]))
			mn = "???";
	else		mn = mon_name[timeptr->tm_mon];
	(void) printf("%.3s %.3s%3d %.2d:%.2d:%.2d ",
		wn, mn,
		timeptr->tm_mday, timeptr->tm_hour,
		timeptr->tm_min, timeptr->tm_sec);
#define DIVISOR	10
	trail = timeptr->tm_year % DIVISOR + TM_YEAR_BASE % DIVISOR;
	lead = timeptr->tm_year / DIVISOR + TM_YEAR_BASE / DIVISOR +
		trail / DIVISOR;
	trail %= DIVISOR;
	if (trail < 0 && lead > 0) {
		trail += DIVISOR;
		--lead;
	} else if (lead < 0 && trail > 0) {
		trail -= DIVISOR;
		++lead;
	}
	if (lead == 0)
		(void) printf("%d", trail);
	else	(void) printf("%d%d", lead, ((trail < 0) ? -trail : trail));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x2226
leaq 0x4ee9(%rip), %rdi      # 0x7103
movb $0x0, %al
callq 0x10d0
jmp 0x23aa
movq -0x8(%rbp), %rax
cmpl $0x0, 0x18(%rax)
jl 0x223a
movq -0x8(%rbp), %rax
cmpl $0x7, 0x18(%rax)
jl 0x2247
leaq 0x4ec7(%rip), %rax      # 0x7108
movq %rax, -0x10(%rbp)
jmp 0x2261
movq -0x8(%rbp), %rax
movslq 0x18(%rax), %rcx
leaq 0x4f7a(%rip), %rax      # 0x71d0
imulq $0x3, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jl 0x2275
movq -0x8(%rbp), %rax
cmpl $0xc, 0x10(%rax)
jl 0x2282
leaq 0x4e8c(%rip), %rax      # 0x7108
movq %rax, -0x18(%rbp)
jmp 0x229c
movq -0x8(%rbp), %rax
movslq 0x10(%rax), %rcx
leaq 0x4f5f(%rip), %rax      # 0x71f0
imulq $0x3, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x8(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x8(%rbp), %rax
movl 0x8(%rax), %r8d
movq -0x8(%rbp), %rax
movl 0x4(%rax), %r9d
movq -0x8(%rbp), %rax
movl (%rax), %eax
leaq 0x4e44(%rip), %rdi      # 0x710c
movl %eax, (%rsp)
movb $0x0, %al
callq 0x10d0
movq -0x8(%rbp), %rax
movl 0x14(%rax), %eax
movl $0xa, %ecx
cltd
idivl %ecx
addl $0x0, %edx
movl %edx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movl 0x14(%rax), %eax
movl $0xa, %ecx
cltd
idivl %ecx
addl $0xbe, %eax
movl %eax, -0x24(%rbp)
movl -0x20(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x24(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x1c(%rbp)
movl -0x20(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
movl %edx, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
jge 0x2341
cmpl $0x0, -0x1c(%rbp)
jle 0x2341
movl -0x20(%rbp), %eax
addl $0xa, %eax
movl %eax, -0x20(%rbp)
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2361
cmpl $0x0, -0x1c(%rbp)
jge 0x235f
cmpl $0x0, -0x20(%rbp)
jle 0x235f
movl -0x20(%rbp), %eax
subl $0xa, %eax
movl %eax, -0x20(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2361
cmpl $0x0, -0x1c(%rbp)
jne 0x237a
movl -0x20(%rbp), %esi
leaq 0x4d8b(%rip), %rdi      # 0x70fc
movb $0x0, %al
callq 0x10d0
jmp 0x23aa
movl -0x1c(%rbp), %eax
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x20(%rbp)
jge 0x2390
xorl %eax, %eax
subl -0x20(%rbp), %eax
movl %eax, -0x2c(%rbp)
jmp 0x2396
movl -0x20(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x28(%rbp), %esi
movl -0x2c(%rbp), %edx
leaq 0x4d86(%rip), %rdi      # 0x7129
movb $0x0, %al
callq 0x10d0
addq $0x40, %rsp
popq %rbp
retq