// File: /workspace/github_c_makefile_star2_O0/lyda[P]tz/zic.c
// Function: rpytime
static zic_t
rpytime(rp, wantedy)
register const struct rule * const	rp;
register const int			wantedy;
{
	register int	y, m, i;
	register long	dayoff;			/* with a nod to Margaret O. */
	register zic_t	t;

	if (wantedy == INT_MIN)
		return min_time;
	if (wantedy == INT_MAX)
		return max_time;
	dayoff = 0;
	m = TM_JANUARY;
	y = EPOCH_YEAR;
	while (wantedy != y) {
		if (wantedy > y) {
			i = len_years[isleap(y)];
			++y;
		} else {
			--y;
			i = -len_years[isleap(y)];
		}
		dayoff = oadd(dayoff, eitol(i));
	}
	while (m != rp->r_month) {
		i = len_months[isleap(y)][m];
		dayoff = oadd(dayoff, eitol(i));
		++m;
	}
	i = rp->r_dayofmonth;
	if (m == TM_FEBRUARY && i == 29 && !isleap(y)) {
		if (rp->r_dycode == DC_DOWLEQ)
			--i;
		else {
			error(_("use of 2/29 in non leap-year"));
			exit(EXIT_FAILURE);
		}
	}
	--i;
	dayoff = oadd(dayoff, eitol(i));
	if (rp->r_dycode == DC_DOWGEQ || rp->r_dycode == DC_DOWLEQ) {
		register long	wday;

#define LDAYSPERWEEK	((long) DAYSPERWEEK)
		wday = eitol(EPOCH_WDAY);
		/*
		** Don't trust mod of negative numbers.
		*/
		if (dayoff >= 0)
			wday = (wday + dayoff) % LDAYSPERWEEK;
		else {
			wday -= ((-dayoff) % LDAYSPERWEEK);
			if (wday < 0)
				wday += LDAYSPERWEEK;
		}
		while (wday != eitol(rp->r_wday))
			if (rp->r_dycode == DC_DOWGEQ) {
				dayoff = oadd(dayoff, (long) 1);
				if (++wday >= LDAYSPERWEEK)
					wday = 0;
				++i;
			} else {
				dayoff = oadd(dayoff, (long) -1);
				if (--wday < 0)
					wday = LDAYSPERWEEK - 1;
				--i;
			}
		if (i < 0 || i >= len_months[isleap(y)][m]) {
			if (noise)
				warning(_("rule goes past start/end of month--\
will not work with pre-2004 versions of zic"));
		}
	}
	if (dayoff < min_time / SECSPERDAY)
		return min_time;
	if (dayoff > max_time / SECSPERDAY)
		return max_time;
	t = (zic_t) dayoff * SECSPERDAY;
	return tadd(t, rp->r_tod);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
cmpl $0x80000000, -0x14(%rbp) # imm = 0x80000000
jne 0x5f2b
movq 0xc306(%rip), %rax      # 0x12228
movq %rax, -0x8(%rbp)
jmp 0x63d2
cmpl $0x7fffffff, -0x14(%rbp) # imm = 0x7FFFFFFF
jne 0x5f44
movq 0xc2f5(%rip), %rax      # 0x12230
movq %rax, -0x8(%rbp)
jmp 0x63d2
movq $0x0, -0x28(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x7b2, -0x18(%rbp)     # imm = 0x7B2
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
je 0x6061
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
jle 0x5fd5
movl -0x18(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
xorl %eax, %eax
cmpl $0x0, %edx
movb %al, -0x39(%rbp)
jne 0x5fb2
movl -0x18(%rbp), %eax
movl $0x64, %ecx
cltd
idivl %ecx
movb $0x1, %al
cmpl $0x0, %edx
movb %al, -0x3a(%rbp)
jne 0x5fac
movl -0x18(%rbp), %eax
movl $0x190, %ecx            # imm = 0x190
cltd
idivl %ecx
cmpl $0x0, %edx
sete %al
movb %al, -0x3a(%rbp)
movb -0x3a(%rbp), %al
movb %al, -0x39(%rbp)
movb -0x39(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movslq %eax, %rcx
leaq 0x81cc(%rip), %rax      # 0xe190
movl (%rax,%rcx,4), %eax
movl %eax, -0x20(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x603c
movl -0x18(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
xorl %eax, %eax
cmpl $0x0, %edx
movb %al, -0x3b(%rbp)
jne 0x6022
movl -0x18(%rbp), %eax
movl $0x64, %ecx
cltd
idivl %ecx
movb $0x1, %al
cmpl $0x0, %edx
movb %al, -0x3c(%rbp)
jne 0x601c
movl -0x18(%rbp), %eax
movl $0x190, %ecx            # imm = 0x190
cltd
idivl %ecx
cmpl $0x0, %edx
sete %al
movb %al, -0x3c(%rbp)
movb -0x3c(%rbp), %al
movb %al, -0x3b(%rbp)
movb -0x3b(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movslq %eax, %rdx
xorl %eax, %eax
leaq 0x815a(%rip), %rcx      # 0xe190
subl (%rcx,%rdx,4), %eax
movl %eax, -0x20(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x48(%rbp)
movl -0x20(%rbp), %edi
callq 0x4660
movq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x4600
movq %rax, -0x28(%rbp)
jmp 0x5f5a
jmp 0x6063
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x30(%rcx), %eax
je 0x6108
movl -0x18(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
xorl %eax, %eax
cmpl $0x0, %edx
movb %al, -0x49(%rbp)
jne 0x60b7
movl -0x18(%rbp), %eax
movl $0x64, %ecx
cltd
idivl %ecx
movb $0x1, %al
cmpl $0x0, %edx
movb %al, -0x4a(%rbp)
jne 0x60b1
movl -0x18(%rbp), %eax
movl $0x190, %ecx            # imm = 0x190
cltd
idivl %ecx
cmpl $0x0, %edx
sete %al
movb %al, -0x4a(%rbp)
movb -0x4a(%rbp), %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movslq %eax, %rcx
leaq 0x8067(%rip), %rax      # 0xe130
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movslq -0x1c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x20(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x58(%rbp)
movl -0x20(%rbp), %edi
callq 0x4660
movq -0x58(%rbp), %rdi
movq %rax, %rsi
callq 0x4600
movq %rax, -0x28(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x6063
movq -0x10(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, -0x20(%rbp)
cmpl $0x1, -0x1c(%rbp)
jne 0x617b
cmpl $0x1d, -0x20(%rbp)
jne 0x617b
movl -0x18(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x614e
movl -0x18(%rbp), %eax
movl $0x64, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x617b
movl -0x18(%rbp), %eax
movl $0x190, %ecx            # imm = 0x190
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x617b
movq -0x10(%rbp), %rax
cmpl $0x2, 0x34(%rax)
jne 0x6163
movl -0x20(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x6179
leaq 0x874e(%rip), %rdi      # 0xe8b8
callq 0x4110
movl $0x1, %edi
callq 0x2270
jmp 0x617b
movl -0x20(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x20(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x60(%rbp)
movl -0x20(%rbp), %edi
callq 0x4660
movq -0x60(%rbp), %rdi
movq %rax, %rsi
callq 0x4600
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x1, 0x34(%rax)
je 0x61bc
movq -0x10(%rbp), %rax
cmpl $0x2, 0x34(%rax)
jne 0x6347
movl $0x4, %edi
callq 0x4660
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x28(%rbp)
jl 0x61e9
movq -0x38(%rbp), %rax
addq -0x28(%rbp), %rax
movl $0x7, %ecx
cqto
idivq %rcx
movq %rdx, -0x38(%rbp)
jmp 0x6219
xorl %eax, %eax
subq -0x28(%rbp), %rax
movl $0x7, %ecx
cqto
idivq %rcx
movq -0x38(%rbp), %rax
subq %rdx, %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jge 0x6217
movq -0x38(%rbp), %rax
addq $0x7, %rax
movq %rax, -0x38(%rbp)
jmp 0x6219
jmp 0x621b
movq -0x38(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movl 0x3c(%rax), %edi
callq 0x4660
movq %rax, %rcx
movq -0x68(%rbp), %rax
cmpq %rcx, %rax
je 0x62b8
movq -0x10(%rbp), %rax
cmpl $0x1, 0x34(%rax)
jne 0x627c
movq -0x28(%rbp), %rdi
movl $0x1, %esi
callq 0x4600
movq %rax, -0x28(%rbp)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
cmpq $0x7, %rax
jl 0x6271
movq $0x0, -0x38(%rbp)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x62b3
movq -0x28(%rbp), %rdi
movq $-0x1, %rsi
callq 0x4600
movq %rax, -0x28(%rbp)
movq -0x38(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jge 0x62aa
movq $0x6, -0x38(%rbp)
movl -0x20(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x621b
cmpl $0x0, -0x20(%rbp)
jl 0x632e
movl -0x20(%rbp), %eax
movl %eax, -0x70(%rbp)
movl -0x18(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
xorl %eax, %eax
cmpl $0x0, %edx
movb %al, -0x69(%rbp)
jne 0x6308
movl -0x18(%rbp), %eax
movl $0x64, %ecx
cltd
idivl %ecx
movb $0x1, %al
cmpl $0x0, %edx
movb %al, -0x71(%rbp)
jne 0x6302
movl -0x18(%rbp), %eax
movl $0x190, %ecx            # imm = 0x190
cltd
idivl %ecx
cmpl $0x0, %edx
sete %al
movb %al, -0x71(%rbp)
movb -0x71(%rbp), %al
movb %al, -0x69(%rbp)
movl -0x70(%rbp), %eax
movb -0x69(%rbp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
movslq %ecx, %rdx
leaq 0x7e12(%rip), %rcx      # 0xe130
imulq $0x30, %rdx, %rdx
addq %rdx, %rcx
movslq -0x1c(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jl 0x6345
cmpl $0x0, 0xbeab(%rip)      # 0x121e0
je 0x6343
leaq 0x8597(%rip), %rdi      # 0xe8d5
callq 0x4000
jmp 0x6345
jmp 0x6347
movq -0x28(%rbp), %rax
movq %rax, -0x80(%rbp)
movq 0xbed2(%rip), %rax      # 0x12228
movl $0x15180, %ecx          # imm = 0x15180
cqto
idivq %rcx
movq %rax, %rcx
movq -0x80(%rbp), %rax
cmpq %rcx, %rax
jge 0x6379
movq 0xbeb5(%rip), %rax      # 0x12228
movq %rax, -0x8(%rbp)
jmp 0x63d2
movq -0x28(%rbp), %rax
movq %rax, -0x88(%rbp)
movq 0xbea5(%rip), %rax      # 0x12230
movl $0x15180, %ecx          # imm = 0x15180
cqto
idivq %rcx
movq %rax, %rcx
movq -0x88(%rbp), %rax
cmpq %rcx, %rax
jle 0x63b1
movq 0xbe85(%rip), %rax      # 0x12230
movq %rax, -0x8(%rbp)
jmp 0x63d2
imulq $0x15180, -0x28(%rbp), %rax # imm = 0x15180
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0x6440
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
nop