// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
pushq %rax
movl %esi, %eax
negl %eax
jo 0x65d7
movq %rdi, %rbx
cmpl $0x7b2, %esi            # imm = 0x7B2
je 0x65d0
cmpl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
jne 0x65f6
xorl %eax, %eax
cmpb $0x0, 0x7c93(%rip)      # 0xe250
movabsq $0x7fffffffffffffff, %rsi # imm = 0x7FFFFFFFFFFFFFFF
cmoveq %rax, %rsi
jmp 0x696c
xorl %eax, %eax
jmp 0x66a1
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
incq %rax
xorl %esi, %esi
cmpb $0x0, 0x7c5b(%rip)      # 0xe248
cmovneq %rax, %rsi
jmp 0x696c
movl $0x7b2, %ecx            # imm = 0x7B2
xorl %eax, %eax
leaq 0x4838(%rip), %rdx      # 0xae3c
cmpl %esi, %ecx
jge 0x6611
testb $0x3, %cl
je 0x661c
xorl %edi, %edi
jmp 0x6650
decl %ecx
testb $0x3, %cl
je 0x6658
xorl %edi, %edi
jmp 0x668c
imull $0xc28f5c29, %ecx, %r8d # imm = 0xC28F5C29
addl $0x51eb850, %r8d        # imm = 0x51EB850
movl %r8d, %r9d
rorl $0x2, %r9d
movl $0x1, %edi
cmpl $0x28f5c28, %r9d        # imm = 0x28F5C28
ja 0x6650
rorl $0x4, %r8d
xorl %edi, %edi
cmpl $0xa3d70b, %r8d         # imm = 0xA3D70B
setb %dil
movl (%rdx,%rdi,4), %r8d
incl %ecx
jmp 0x6693
imull $0xc28f5c29, %ecx, %r8d # imm = 0xC28F5C29
addl $0x51eb850, %r8d        # imm = 0x51EB850
movl %r8d, %r9d
rorl $0x2, %r9d
movl $0x1, %edi
cmpl $0x28f5c28, %r9d        # imm = 0x28F5C28
ja 0x668c
rorl $0x4, %r8d
xorl %edi, %edi
cmpl $0xa3d70b, %r8d         # imm = 0xA3D70B
setb %dil
xorl %r8d, %r8d
subl (%rdx,%rdi,4), %r8d
movslq %r8d, %rdi
addq %rdi, %rax
cmpl %esi, %ecx
jne 0x6604
movl 0x30(%rbx), %edi
testq %rdi, %rdi
je 0x6777
testb $0x3, %sil
sete %dl
imull $0xc28f5c29, %esi, %r8d # imm = 0xC28F5C29
addl $0x51eb850, %r8d        # imm = 0x51EB850
movl %r8d, %ecx
rorl $0x2, %ecx
cmpl $0x28f5c29, %ecx        # imm = 0x28F5C29
setae %r9b
rorl $0x4, %r8d
cmpl $0xa3d70b, %r8d         # imm = 0xA3D70B
setb %r8b
orb %r9b, %r8b
andb %dl, %r8b
movzbl %r8b, %edx
shll $0x4, %edx
leaq (%rdx,%rdx,2), %rdx
xorl %r8d, %r8d
leaq 0x39e4(%rip), %r9       # 0xa0e0
leaq (%rdx,%r8,4), %r10
movslq (%r9,%r10), %r10
addq %r10, %rax
incq %r8
cmpq %r8, %rdi
jne 0x66fc
movl 0x38(%rbx), %r8d
movl %edi, %edx
xorl $0x1, %edx
movl %r8d, %r9d
xorl $0x1d, %r9d
orl %edx, %r9d
jne 0x677d
testb $0x3, %sil
jne 0x6760
movl $0x1d, %r8d
movl $0x1, %edi
cmpl $0x28f5c28, %ecx        # imm = 0x28F5C28
ja 0x677d
movslq %esi, %rcx
imulq $0x51eb851f, %rcx, %rcx # imm = 0x51EB851F
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x27, %rcx
addl %edx, %ecx
imull $0x190, %ecx, %ecx      # imm = 0x190
movl %esi, %edx
subl %ecx, %edx
je 0x677d
cmpl $0x2, 0x34(%rbx)
jne 0x6977
movl $0x1c, %r8d
movl $0x1, %edi
jmp 0x677d
movl 0x38(%rbx), %r8d
xorl %edi, %edi
movslq %r8d, %rcx
leaq (%rcx,%rax), %r14
decq %r14
movl 0x34(%rbx), %r9d
leal -0x1(%r9), %eax
cmpl $0x1, %eax
ja 0x68da
testq %r14, %r14
js 0x67d3
leaq 0x4(%r14), %rcx
movabsq $0x2492492492492493, %rdx # imm = 0x2492492492492493
movq %rcx, %rax
mulq %rdx
subq %rdx, %rcx
shrq %rcx
addq %rdx, %rcx
shrq $0x2, %rcx
leaq (,%rcx,8), %rax
subq %rax, %rcx
leaq (%r14,%rcx), %rax
addq $0x4, %rax
jmp 0x6819
movq %r14, %rcx
negq %rcx
movabsq $0x2492492492492493, %rdx # imm = 0x2492492492492493
movq %rcx, %rax
mulq %rdx
subq %rdx, %rcx
shrq %rcx
addq %rdx, %rcx
shrq $0x2, %rcx
leaq (,%rcx,8), %rax
subq %rax, %rcx
subq %r14, %rcx
cmpq $0x5, %rcx
movl $0xb, %edx
movl $0x4, %eax
cmovaeq %rdx, %rax
subq %rcx, %rax
decl %r8d
movslq 0x3c(%rbx), %rcx
cmpq %rcx, %rax
je 0x6866
xorl %edx, %edx
movl $0x6, %r10d
cmpl $0x1, %r9d
jne 0x684a
incq %r14
cmpq $0x6, %rax
leaq 0x1(%rax), %rax
cmovgeq %rdx, %rax
movl $0x1, %r11d
jmp 0x685e
decq %r14
testq %rax, %rax
leaq -0x1(%rax), %rax
cmovleq %r10, %rax
movl $0xffffffff, %r11d      # imm = 0xFFFFFFFF
addl %r11d, %r8d
cmpq %rcx, %rax
jne 0x682d
testl %r8d, %r8d
js 0x6875
testb $0x3, %sil
je 0x6880
xorl %eax, %eax
jmp 0x68ac
cmpb $0x1, 0x7984(%rip)      # 0xe200
je 0x68ce
jmp 0x68da
imull $0xc28f5c29, %esi, %ecx # imm = 0xC28F5C29
addl $0x51eb850, %ecx        # imm = 0x51EB850
movl %ecx, %edx
rorl $0x2, %edx
movl $0x1, %eax
cmpl $0x28f5c28, %edx        # imm = 0x28F5C28
ja 0x68ac
rorl $0x4, %ecx
xorl %eax, %eax
cmpl $0xa3d70b, %ecx         # imm = 0xA3D70B
setb %al
movl %edi, %ecx
leaq (%rax,%rax,2), %rax
shll $0x4, %eax
leaq 0x3824(%rip), %rdx      # 0xa0e0
addq %rax, %rdx
cmpl (%rdx,%rcx,4), %r8d
jl 0x68da
testb $0x1, 0x7934(%rip)      # 0xe200
je 0x68da
leaq 0x3f58(%rip), %rdi      # 0xa82d
callq 0x5a8d
movabsq $0x7fffffffffffffff, %rdi # imm = 0x7FFFFFFFFFFFFFFF
leaq 0x1(%rdi), %rax
xorl %ecx, %ecx
cmpb $0x0, 0x7957(%rip)      # 0xe248
cmovneq %rax, %rcx
movabsq $0x1845c8a0ce512957, %r8 # imm = 0x1845C8A0CE512957
movq %rcx, %rax
imulq %r8
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0xd, %rdx
addq %rax, %rdx
cmpq %rdx, %r14
jge 0x691d
movq %rcx, %rsi
jmp 0x696c
xorl %esi, %esi
cmpb $0x0, 0x792a(%rip)      # 0xe250
cmovneq %rdi, %rsi
movq %rsi, %rax
mulq %r8
shrq $0xd, %rdx
cmpq %rdx, %r14
jg 0x696c
imulq $0x15180, %r14, %rax    # imm = 0x15180
movq 0x40(%rbx), %rdx
cmpq %rax, %rsi
sete %dil
testq %rdx, %rdx
setg %r8b
testb %r8b, %dil
jne 0x696c
leaq (%rdx,%rax), %rdi
testq %rdx, %rdx
movq %rdi, %rsi
cmovsq %rcx, %rsi
cmpq %rax, %rcx
cmovneq %rdi, %rsi
movq %rsi, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x2730