// File: /workspace/github_c_makefile_star2_O1/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 0x63b3
movq %rdi, %rbx
cmpl $0x7b2, %esi            # imm = 0x7B2
je 0x63aa
cmpl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
jne 0x63d2
xorl %eax, %eax
cmpb $0x0, 0x7eb9(%rip)      # 0xe250
movabsq $0x7fffffffffffffff, %rsi # imm = 0x7FFFFFFFFFFFFFFF
cmoveq %rax, %rsi
jmp 0x673d
xorl %eax, %eax
movl %esi, %edi
jmp 0x647d
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
incq %rax
xorl %esi, %esi
cmpb $0x0, 0x7e7f(%rip)      # 0xe248
cmovneq %rax, %rsi
jmp 0x673d
movl $0x7b2, %edi            # imm = 0x7B2
xorl %eax, %eax
leaq 0x49f0(%rip), %rcx      # 0xadd0
cmpl %esi, %edi
jge 0x63ee
testb $0x3, %dil
je 0x63fa
xorl %edx, %edx
jmp 0x642d
decl %edi
testb $0x3, %dil
je 0x6435
xorl %edx, %edx
jmp 0x6468
imull $0xc28f5c29, %edi, %r8d # imm = 0xC28F5C29
addl $0x51eb850, %r8d        # imm = 0x51EB850
movl %r8d, %r9d
rorl $0x2, %r9d
movl $0x1, %edx
cmpl $0x28f5c28, %r9d        # imm = 0x28F5C28
ja 0x642d
rorl $0x4, %r8d
xorl %edx, %edx
cmpl $0xa3d70b, %r8d         # imm = 0xA3D70B
setb %dl
movl (%rcx,%rdx,4), %r8d
incl %edi
jmp 0x646f
imull $0xc28f5c29, %edi, %r8d # imm = 0xC28F5C29
addl $0x51eb850, %r8d        # imm = 0x51EB850
movl %r8d, %r9d
rorl $0x2, %r9d
movl $0x1, %edx
cmpl $0x28f5c28, %r9d        # imm = 0x28F5C28
ja 0x6468
rorl $0x4, %r8d
xorl %edx, %edx
cmpl $0xa3d70b, %r8d         # imm = 0xA3D70B
setb %dl
xorl %r8d, %r8d
subl (%rcx,%rdx,4), %r8d
movslq %r8d, %rdx
addq %rdx, %rax
cmpl %esi, %edi
jne 0x63e0
movl 0x30(%rbx), %esi
testq %rsi, %rsi
je 0x64e3
testb $0x3, %dil
sete %cl
imull $0xc28f5c29, %edi, %edx # imm = 0xC28F5C29
addl $0x51eb850, %edx        # imm = 0x51EB850
movl %edx, %r8d
rorl $0x2, %r8d
cmpl $0x28f5c29, %r8d        # imm = 0x28F5C29
setae %r8b
rorl $0x4, %edx
cmpl $0xa3d70b, %edx         # imm = 0xA3D70B
setb %dl
orb %r8b, %dl
andb %cl, %dl
movzbl %dl, %ecx
shll $0x4, %ecx
leaq (%rcx,%rcx,2), %rcx
xorl %edx, %edx
leaq 0x3ba2(%rip), %r8       # 0xa070
leaq (%rcx,%rdx,4), %r9
movslq (%r8,%r9), %r9
addq %r9, %rax
incq %rdx
cmpq %rdx, %rsi
jne 0x64ce
jmp 0x64e5
xorl %esi, %esi
movl 0x38(%rbx), %r8d
movl %esi, %ecx
xorl $0x1, %ecx
movl %r8d, %edx
xorl $0x1d, %edx
orl %ecx, %edx
jne 0x654e
testb $0x3, %dil
jne 0x653e
imull $0xc28f5c29, %edi, %ecx # imm = 0xC28F5C29
addl $0x51eb850, %ecx        # imm = 0x51EB850
rorl $0x2, %ecx
movl $0x1d, %r8d
cmpl $0x28f5c28, %ecx        # imm = 0x28F5C28
ja 0x654e
movslq %edi, %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 %edi, %edx
subl %ecx, %edx
je 0x654e
movl $0x1c, %r8d
cmpl $0x2, 0x34(%rbx)
jne 0x6748
movslq %r8d, %rcx
leaq (%rcx,%rax), %r14
decq %r14
movl 0x34(%rbx), %r9d
leal -0x1(%r9), %eax
cmpl $0x1, %eax
ja 0x66ab
testq %r14, %r14
js 0x65a4
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 0x65ea
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 0x6637
xorl %edx, %edx
movl $0x6, %r10d
cmpl $0x1, %r9d
jne 0x661b
incq %r14
cmpq $0x6, %rax
leaq 0x1(%rax), %rax
cmovgeq %rdx, %rax
movl $0x1, %r11d
jmp 0x662f
decq %r14
testq %rax, %rax
leaq -0x1(%rax), %rax
cmovleq %r10, %rax
movl $0xffffffff, %r11d      # imm = 0xFFFFFFFF
addl %r11d, %r8d
cmpq %rcx, %rax
jne 0x65fe
testl %r8d, %r8d
js 0x6646
testb $0x3, %dil
je 0x6651
xorl %eax, %eax
jmp 0x667d
cmpb $0x1, 0x7bb3(%rip)      # 0xe200
je 0x669f
jmp 0x66ab
imull $0xc28f5c29, %edi, %ecx # imm = 0xC28F5C29
addl $0x51eb850, %ecx        # imm = 0x51EB850
movl %ecx, %edx
rorl $0x2, %edx
movl $0x1, %eax
cmpl $0x28f5c28, %edx        # imm = 0x28F5C28
ja 0x667d
rorl $0x4, %ecx
xorl %eax, %eax
cmpl $0xa3d70b, %ecx         # imm = 0xA3D70B
setb %al
movl %esi, %ecx
leaq (%rax,%rax,2), %rax
shll $0x4, %eax
leaq 0x39e3(%rip), %rdx      # 0xa070
addq %rax, %rdx
cmpl (%rdx,%rcx,4), %r8d
jl 0x66ab
testb $0x1, 0x7b63(%rip)      # 0xe200
je 0x66ab
leaq 0x4115(%rip), %rdi      # 0xa7bb
callq 0x5891
movabsq $0x7fffffffffffffff, %rdi # imm = 0x7FFFFFFFFFFFFFFF
leaq 0x1(%rdi), %rax
xorl %ecx, %ecx
cmpb $0x0, 0x7b86(%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 0x66ee
movq %rcx, %rsi
jmp 0x673d
xorl %esi, %esi
cmpb $0x0, 0x7b59(%rip)      # 0xe250
cmovneq %rdi, %rsi
movq %rsi, %rax
mulq %r8
shrq $0xd, %rdx
cmpq %rdx, %r14
jg 0x673d
imulq $0x15180, %r14, %rax    # imm = 0x15180
movq 0x40(%rbx), %rdx
cmpq %rax, %rsi
sete %dil
testq %rdx, %rdx
setg %r8b
testb %r8b, %dil
jne 0x673d
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