// File: /workspace/github_c_makefile_star2_O0/lyda[P]tz/zic.c
// Function: inleap
static void
inleap(fields, nfields)
register char ** const	fields;
const int		nfields;
{
	register const char *		cp;
	register const struct lookup *	lp;
	register int			i, j;
	int				year, month, day;
	long				dayoff, tod;
	zic_t				t;

	if (nfields != LEAP_FIELDS) {
		error(_("wrong number of fields on Leap line"));
		return;
	}
	dayoff = 0;
	cp = fields[LP_YEAR];
	if (sscanf(cp, scheck(cp, "%d"), &year) != 1) {
		/*
		** Leapin' Lizards!
		*/
		error(_("invalid leaping year"));
		return;
	}
	if (!leapseen || leapmaxyear < year)
		leapmaxyear = year;
	if (!leapseen || leapminyear > year)
		leapminyear = year;
	leapseen = TRUE;
	j = EPOCH_YEAR;
	while (j != year) {
		if (year > j) {
			i = len_years[isleap(j)];
			++j;
		} else {
			--j;
			i = -len_years[isleap(j)];
		}
		dayoff = oadd(dayoff, eitol(i));
	}
	if ((lp = byword(fields[LP_MONTH], mon_names)) == NULL) {
		error(_("invalid month name"));
		return;
	}
	month = lp->l_value;
	j = TM_JANUARY;
	while (j != month) {
		i = len_months[isleap(year)][j];
		dayoff = oadd(dayoff, eitol(i));
		++j;
	}
	cp = fields[LP_DAY];
	if (sscanf(cp, scheck(cp, "%d"), &day) != 1 ||
		day <= 0 || day > len_months[isleap(year)][month]) {
			error(_("invalid day of month"));
			return;
	}
	dayoff = oadd(dayoff, eitol(day - 1));
	if (dayoff < 0 && !TYPE_SIGNED(zic_t)) {
		error(_("time before zero"));
		return;
	}
	if (dayoff < min_time / SECSPERDAY) {
		error(_("time too small"));
		return;
	}
	if (dayoff > max_time / SECSPERDAY) {
		error(_("time too large"));
		return;
	}
	t = (zic_t) dayoff * SECSPERDAY;
	tod = gethms(fields[LP_TIME], _("invalid time of day"), FALSE);
	cp = fields[LP_CORR];
	{
		register int	positive;
		int		count;

		if (strcmp(cp, "") == 0) { /* infile() turns "-" into "" */
			positive = FALSE;
			count = 1;
		} else if (strcmp(cp, "--") == 0) {
			positive = FALSE;
			count = 2;
		} else if (strcmp(cp, "+") == 0) {
			positive = TRUE;
			count = 1;
		} else if (strcmp(cp, "++") == 0) {
			positive = TRUE;
			count = 2;
		} else {
			error(_("illegal CORRECTION field on Leap line"));
			return;
		}
		if ((lp = byword(fields[LP_ROLL], leap_types)) == NULL) {
			error(_(
				"illegal Rolling/Stationary field on Leap line"
				));
			return;
		}
		leapadd(tadd(t, tod), positive, lp->l_value, count);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpl $0x7, -0xc(%rbp)
je 0x4fb9
leaq 0x9ae4(%rip), %rdi      # 0xea93
callq 0x4110
jmp 0x5514
movq $0x0, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x9c38(%rip), %rsi      # 0xec18
callq 0xcd40
movq -0x60(%rbp), %rdi
movq %rax, %rsi
leaq -0x2c(%rbp), %rdx
movb $0x0, %al
callq 0x21d0
cmpl $0x1, %eax
je 0x500d
leaq 0x9ab4(%rip), %rdi      # 0xeab7
callq 0x4110
jmp 0x5514
cmpl $0x0, 0xd384(%rip)      # 0x12398
je 0x5021
movl 0xd380(%rip), %eax      # 0x1239c
cmpl -0x2c(%rbp), %eax
jge 0x502a
movl -0x2c(%rbp), %eax
movl %eax, 0xd372(%rip)      # 0x1239c
cmpl $0x0, 0xd367(%rip)      # 0x12398
je 0x503e
movl 0xd367(%rip), %eax      # 0x123a0
cmpl -0x2c(%rbp), %eax
jle 0x5047
movl -0x2c(%rbp), %eax
movl %eax, 0xd359(%rip)      # 0x123a0
movl $0x1, 0xd347(%rip)      # 0x12398
movl $0x7b2, -0x28(%rbp)     # imm = 0x7B2
movl -0x28(%rbp), %eax
cmpl -0x2c(%rbp), %eax
je 0x515f
movl -0x2c(%rbp), %eax
cmpl -0x28(%rbp), %eax
jle 0x50d3
movl -0x28(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
xorl %eax, %eax
cmpl $0x0, %edx
movb %al, -0x61(%rbp)
jne 0x50b0
movl -0x28(%rbp), %eax
movl $0x64, %ecx
cltd
idivl %ecx
movb $0x1, %al
cmpl $0x0, %edx
movb %al, -0x62(%rbp)
jne 0x50aa
movl -0x28(%rbp), %eax
movl $0x190, %ecx            # imm = 0x190
cltd
idivl %ecx
cmpl $0x0, %edx
sete %al
movb %al, -0x62(%rbp)
movb -0x62(%rbp), %al
movb %al, -0x61(%rbp)
movb -0x61(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movslq %eax, %rcx
leaq 0x90ce(%rip), %rax      # 0xe190
movl (%rax,%rcx,4), %eax
movl %eax, -0x24(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x513a
movl -0x28(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
xorl %eax, %eax
cmpl $0x0, %edx
movb %al, -0x63(%rbp)
jne 0x5120
movl -0x28(%rbp), %eax
movl $0x64, %ecx
cltd
idivl %ecx
movb $0x1, %al
cmpl $0x0, %edx
movb %al, -0x64(%rbp)
jne 0x511a
movl -0x28(%rbp), %eax
movl $0x190, %ecx            # imm = 0x190
cltd
idivl %ecx
cmpl $0x0, %edx
sete %al
movb %al, -0x64(%rbp)
movb -0x64(%rbp), %al
movb %al, -0x63(%rbp)
movb -0x63(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movslq %eax, %rdx
xorl %eax, %eax
leaq 0x905c(%rip), %rcx      # 0xe190
subl (%rcx,%rdx,4), %eax
movl %eax, -0x24(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x70(%rbp)
movl -0x24(%rbp), %edi
callq 0x4660
movq -0x70(%rbp), %rdi
movq %rax, %rsi
callq 0x4600
movq %rax, -0x40(%rbp)
jmp 0x5058
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0xc9f2(%rip), %rsi      # 0x11b60
callq 0x4960
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x518e
leaq 0x95be(%rip), %rdi      # 0xe742
callq 0x4110
jmp 0x5514
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x30(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x30(%rbp), %eax
je 0x5240
movl -0x2c(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
xorl %eax, %eax
cmpl $0x0, %edx
movb %al, -0x71(%rbp)
jne 0x51ef
movl -0x2c(%rbp), %eax
movl $0x64, %ecx
cltd
idivl %ecx
movb $0x1, %al
cmpl $0x0, %edx
movb %al, -0x72(%rbp)
jne 0x51e9
movl -0x2c(%rbp), %eax
movl $0x190, %ecx            # imm = 0x190
cltd
idivl %ecx
cmpl $0x0, %edx
sete %al
movb %al, -0x72(%rbp)
movb -0x72(%rbp), %al
movb %al, -0x71(%rbp)
movb -0x71(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movslq %eax, %rcx
leaq 0x8f2f(%rip), %rax      # 0xe130
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movslq -0x28(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x24(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x80(%rbp)
movl -0x24(%rbp), %edi
callq 0x4660
movq -0x80(%rbp), %rdi
movq %rax, %rsi
callq 0x4600
movq %rax, -0x40(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x519f
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x99b6(%rip), %rsi      # 0xec18
callq 0xcd40
movq -0x88(%rbp), %rdi
movq %rax, %rsi
leaq -0x34(%rbp), %rdx
movb $0x0, %al
callq 0x21d0
cmpl $0x1, %eax
jne 0x5317
cmpl $0x0, -0x34(%rbp)
jle 0x5317
movl -0x34(%rbp), %eax
movl %eax, -0x90(%rbp)
movl -0x2c(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
xorl %eax, %eax
cmpl $0x0, %edx
movb %al, -0x89(%rbp)
jne 0x52eb
movl -0x2c(%rbp), %eax
movl $0x64, %ecx
cltd
idivl %ecx
movb $0x1, %al
cmpl $0x0, %edx
movb %al, -0x91(%rbp)
jne 0x52df
movl -0x2c(%rbp), %eax
movl $0x190, %ecx            # imm = 0x190
cltd
idivl %ecx
cmpl $0x0, %edx
sete %al
movb %al, -0x91(%rbp)
movb -0x91(%rbp), %al
movb %al, -0x89(%rbp)
movl -0x90(%rbp), %eax
movb -0x89(%rbp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
movslq %ecx, %rdx
leaq 0x8e29(%rip), %rcx      # 0xe130
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
movslq -0x30(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jle 0x5328
leaq 0x94ae(%rip), %rdi      # 0xe7cc
callq 0x4110
jmp 0x5514
movq -0x40(%rbp), %rax
movq %rax, -0xa0(%rbp)
movl -0x34(%rbp), %edi
subl $0x1, %edi
callq 0x4660
movq -0xa0(%rbp), %rdi
movq %rax, %rsi
callq 0x4600
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jge 0x5371
movb $0x1, %al
testb $0x1, %al
jne 0x5371
jmp 0x5360
leaq 0x9765(%rip), %rdi      # 0xeacc
callq 0x4110
jmp 0x5514
movq -0x40(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq 0xcea5(%rip), %rax      # 0x12228
movl $0x15180, %ecx          # imm = 0x15180
cqto
idivq %rcx
movq %rax, %rcx
movq -0xa8(%rbp), %rax
cmpq %rcx, %rax
jge 0x53ad
leaq 0x973a(%rip), %rdi      # 0xeadd
callq 0x4110
jmp 0x5514
movq -0x40(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq 0xce71(%rip), %rax      # 0x12230
movl $0x15180, %ecx          # imm = 0x15180
cqto
idivq %rcx
movq %rax, %rcx
movq -0xb0(%rbp), %rax
cmpq %rcx, %rax
jle 0x53e9
leaq 0x970d(%rip), %rdi      # 0xeaec
callq 0x4110
jmp 0x5514
imulq $0x15180, -0x40(%rbp), %rax # imm = 0x15180
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
leaq 0x9351(%rip), %rsi      # 0xe755
xorl %edx, %edx
callq 0x4370
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x8fa6(%rip), %rsi      # 0xe3cc
callq 0x2160
cmpl $0x0, %eax
jne 0x5443
movl $0x0, -0x54(%rbp)
movl $0x1, -0x58(%rbp)
jmp 0x54c6
movq -0x18(%rbp), %rdi
leaq 0x96ad(%rip), %rsi      # 0xeafb
callq 0x2160
cmpl $0x0, %eax
jne 0x5468
movl $0x0, -0x54(%rbp)
movl $0x2, -0x58(%rbp)
jmp 0x54c4
movq -0x18(%rbp), %rdi
leaq 0x968c(%rip), %rsi      # 0xeaff
callq 0x2160
cmpl $0x0, %eax
jne 0x548d
movl $0x1, -0x54(%rbp)
movl $0x1, -0x58(%rbp)
jmp 0x54c2
movq -0x18(%rbp), %rdi
leaq 0x9666(%rip), %rsi      # 0xeafe
callq 0x2160
cmpl $0x0, %eax
jne 0x54b2
movl $0x1, -0x54(%rbp)
movl $0x2, -0x58(%rbp)
jmp 0x54c0
leaq 0x9648(%rip), %rdi      # 0xeb01
callq 0x4110
jmp 0x5514
jmp 0x54c2
jmp 0x54c4
jmp 0x54c6
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
leaq 0xc8cb(%rip), %rsi      # 0x11da0
callq 0x4960
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x54f2
leaq 0x963c(%rip), %rdi      # 0xeb27
callq 0x4110
jmp 0x5514
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x6440
movq %rax, %rdi
movl -0x54(%rbp), %esi
movq -0x20(%rbp), %rax
movl 0x8(%rax), %edx
movl -0x58(%rbp), %ecx
callq 0x6630
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax)