// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
leaq 0x24375(%rip), %rax     # 0x33660
movl (%rax), %eax
movl $0x13, %ecx
cltd
idivl %ecx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
leaq 0x2435e(%rip), %rax     # 0x33660
movl (%rax), %eax
movl $0x64, %ecx
cltd
idivl %ecx
addl $0x1, %eax
movl %eax, -0x20(%rbp)
imull $0x3, -0x20(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
subl $0xc, %eax
movl %eax, -0x24(%rbp)
imull $0xb, -0x1c(%rbp), %eax
addl $0x14, %eax
movl %eax, -0x28(%rbp)
movl -0x20(%rbp), %eax
shll $0x3, %eax
addl $0x5, %eax
movl $0x19, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x28(%rbp), %eax
addl %ecx, %eax
subl $0x5, %eax
subl -0x24(%rbp), %eax
movl $0x1e, %ecx
cltd
idivl %ecx
movl %edx, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jge 0xf366
movl -0x14(%rbp), %eax
addl $0x1e, %eax
movl %eax, -0x14(%rbp)
cmpl $0x19, -0x14(%rbp)
jne 0xf372
cmpl $0xb, -0x1c(%rbp)
jg 0xf378
cmpl $0x18, -0x14(%rbp)
jne 0xf381
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movl $0x2c, %eax
subl -0x14(%rbp), %eax
movl %eax, -0x18(%rbp)
cmpl $0x15, -0x18(%rbp)
jge 0xf39b
movl -0x18(%rbp), %eax
addl $0x1e, %eax
movl %eax, -0x18(%rbp)
leaq 0x242be(%rip), %rax     # 0x33660
movslq (%rax), %rax
imulq $0x5, %rax, %rax
movl $0x4, %ecx
cqto
idivq %rcx
subl -0x24(%rbp), %eax
subl $0xa, %eax
addl -0x18(%rbp), %eax
movl $0x7, %ecx
cltd
idivl %ecx
movl $0x7, %eax
subl %edx, %eax
addl -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
leaq 0x23384(%rip), %rax     # 0x3275c
movl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0xf445
movq 0x1ec0f(%rip), %rax     # 0x2dff8
movq (%rax), %rax
movq %rax, -0x38(%rbp)
leaq 0x24269(%rip), %rax     # 0x33660
movl (%rax), %eax
movl %eax, -0x30(%rbp)
movl -0x18(%rbp), %edx
movl $0x4, %eax
movl $0x3, %ecx
cmpl $0x1f, %edx
cmovlel %ecx, %eax
movl %eax, -0x2c(%rbp)
cmpl $0x1f, -0x18(%rbp)
jg 0xf420
movl -0x18(%rbp), %eax
movl %eax, -0x3c(%rbp)
jmp 0xf429
movl -0x18(%rbp), %eax
subl $0x1f, %eax
movl %eax, -0x3c(%rbp)
movl -0x2c(%rbp), %ecx
movl -0x30(%rbp), %edx
movq -0x38(%rbp), %rdi
movl -0x3c(%rbp), %r8d
leaq 0x15b49(%rip), %rsi     # 0x24f87
movb $0x0, %al
callq 0x51b0
movl -0x18(%rbp), %edx
movl $0x4, %ecx
movl $0x3, %eax
cmpl $0x1f, %edx
cmovlel %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
cmpl $0x1f, -0x18(%rbp)
jg 0xf46c
movl -0x18(%rbp), %eax
movl %eax, -0x40(%rbp)
jmp 0xf475
movl -0x18(%rbp), %eax
subl $0x1f, %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x4(%rax)
leaq 0x241da(%rip), %rax     # 0x33660
movl (%rax), %ecx
movq -0x8(%rbp), %rax
movq %rax, %rdx
addq $0xc, %rdx
movq %rdx, -0x8(%rbp)
movl %ecx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
movl $0xc, %ecx
cqto
idivq %rcx
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)