// File: /workspace/github_c_makefile_star2_O1/mmayer[P]pcal/src/readfile.c
// Function: find_easter
int find_easter (date_str *pdate)   /* pointer into date array */
{
#define METONIC 19   /* length of metonic cycle */

   /* Easter is defined as the Sunday after the full moon on or after March
      21.  You could express that as "1st Sun after 1st full_moon ooa 21st day
      in March" instead of using this routine, but depending on your timezone
      your full moon might not fall on the same day as the "official" one.
   */

   date_str *sv_pdate = pdate;
   register int epact, fm;
   int golden, century, nleap;
   
   golden = curr_year % METONIC + 1;
   century = curr_year / 100 + 1;
   nleap = 3 * century / 4 - 12;
   
   /* correct for moon's orbit */
   epact = (11 * golden + 20 + (8 * century + 5) / 25 - 5 - nleap) % 30;
   if (epact < 0) epact += 30;
   if ((epact == 25 && golden > 11) || epact == 24) ++epact;
   
   /* find full moon on or after 3/21 */
   fm = 44 - epact;
   if (fm < 21) fm += 30;
   
   /* find date of following Sunday */
   fm += 7 - ((int)(5L * curr_year / 4) - nleap - 10 + fm) % 7;
   
   /* add Easter to date array (adjust if in April) */
   ADD_DATE(fm <= 31 ? MAR : APR, fm <= 31 ? fm : fm - 31, curr_year);
   
   /* return number of dates added (always 1 in this routine) */
   return pdate - sv_pdate;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x2108e(%rip), %r14     # 0x2d5e0
movslq (%r14), %rdx
imulq $0x6bca1af3, %rdx, %rax # imm = 0x6BCA1AF3
movq %rax, %rcx
shrq $0x3f, %rcx
shrq $0x20, %rax
sarl $0x3, %eax
addl %ecx, %eax
leal (%rax,%rax,8), %ecx
leal (%rax,%rcx,2), %eax
movl %edx, %esi
subl %eax, %esi
imulq $0x51eb851f, %rdx, %rdi # imm = 0x51EB851F
movq %rdi, %rax
shrq $0x3f, %rax
shrq $0x20, %rdi
sarl $0x5, %edi
addl %eax, %edi
leal (%rdi,%rdi,2), %ecx
addl $0x3, %ecx
leal (%rdi,%rdi,2), %eax
addl $0x6, %eax
testl %ecx, %ecx
cmovnsl %ecx, %eax
sarl $0x2, %eax
movl $0xc, %ecx
subl %eax, %ecx
leal (%rsi,%rsi,4), %r8d
leal (%rsi,%r8,2), %r8d
leal 0xd(,%rdi,8), %edi
movslq %edi, %rdi
imulq $0x51eb851f, %rdi, %rdi # imm = 0x51EB851F
movq %rdi, %r9
shrq $0x3f, %r9
shrq $0x20, %rdi
sarl $0x3, %edi
addl %r8d, %r9d
addl %edi, %r9d
leal (%r9,%rcx), %edi
leal (%rcx,%r9), %r8d
addl $0x1a, %r8d
movslq %r8d, %r8
imulq $-0x77777777, %r8, %r8  # imm = 0x88888889
shrq $0x20, %r8
addl %edi, %r8d
addl $0x1a, %r8d
movl %r8d, %r9d
shrl $0x1f, %r9d
sarl $0x4, %r8d
addl %r9d, %r8d
movl %r8d, %r9d
shll $0x5, %r9d
addl %r8d, %r8d
subl %r9d, %r8d
leal (%r8,%rdi), %r9d
addl $0x1a, %r9d
testl %r9d, %r9d
leal 0x38(%r8,%rdi), %edi
cmovnsl %r9d, %edi
cmpl $0x19, %edi
sete %r8b
cmpl $0xb, %esi
setge %sil
andb %r8b, %sil
cmpl $0x18, %edi
sete %r8b
orb %sil, %r8b
movzbl %r8b, %esi
addl %edi, %esi
cmpl $0x18, %esi
movl $0x4a, %edi
movl $0x2c, %r8d
cmovael %edi, %r8d
subl %esi, %r8d
leaq (%rdx,%rdx,4), %rsi
leaq (%rdx,%rdx,4), %rdi
addq $0x3, %rdi
testq %rsi, %rsi
cmovnsq %rsi, %rdi
shrq $0x2, %rdi
negl %eax
addl %edi, %eax
addl $0xc, %eax
addl %edi, %ecx
addl $-0xa, %ecx
addl %r8d, %eax
addl $-0xa, %eax
cltq
imulq $-0x6db6db6d, %rax, %rsi # imm = 0x92492493
shrq $0x20, %rsi
addl %esi, %eax
movl %eax, %esi
shrl $0x1f, %esi
sarl $0x2, %eax
addl %esi, %eax
leal (,%rax,8), %r15d
subl %eax, %r15d
subl %ecx, %r15d
leal 0x7(%r15), %ebp
leaq 0x20026(%rip), %rax     # 0x2c6dc
testb $0x2, (%rax)
jne 0xc6e9
leal -0x18(%r15), %eax
xorl %ecx, %ecx
cmpl $0x19, %r15d
setge %cl
cmovll %ebp, %eax
addl $0x3, %ecx
movl %ecx, (%rbx)
movl %eax, 0x4(%rbx)
movl (%r14), %eax
movl %eax, 0x8(%rbx)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x1b900(%rip), %rax     # 0x27ff0
movq (%rax), %rdi
leal -0x18(%r15), %r8d
xorl %ecx, %ecx
cmpl $0x19, %r15d
setge %cl
cmovll %ebp, %r8d
addl $0x3, %ecx
leaq 0x12729(%rip), %rsi     # 0x1ee37
xorl %eax, %eax
callq 0x5210
jmp 0xc6bb