// File: jkingan[P]ladyheather/heathmsc.cpp
// Function: easter(int)
void easter(int y)
{
int g, c, d, h, k, i, j;
int m;
double jd;

    // Oudin's algorithm for calculating easter
    g = y % 19;
    c = y / 100;
    d = c - c/4;
    h = (d - ((8*c+13)/25) + (19*g) + 15) % 30;
    k = h / 28;
    i = h - k*(1 - k*(29/(h+1))*(21-g)/11);
    j = (y + y/4 + i + 2 - d) % 7;
    d = 28 + i - j;

    if(d > 31) {
       d -= 31;
       m = 4;
    }
    else m = 3;

    set_holiday(EASTER, m, d);

    // calculate Ash Wednesday
    jd = jdate(y, m, d);
    gregorian(0, jd-46.0);
    set_holiday(ASH, g_month, g_day);

    gregorian(0, jd-47.0);
    set_holiday(MARDI_GRAS, g_month, g_day);

    // calculate Palm Sunday
    gregorian(0, jd-7.0);
    set_holiday(PALM_SUNDAY, g_month, g_day);

    // calculate Good Friday
    gregorian(0, jd-2.0);
    set_holiday(GOOD_FRIDAY, g_month, g_day);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %eax
movl $0x13, %ecx
cltd
idivl %ecx
movl %edx, -0x8(%rbp)
movl -0x4(%rbp), %eax
movl $0x64, %ecx
cltd
idivl %ecx
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0xc(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x44(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0xc(%rbp), %eax
shll $0x3, %eax
addl $0xd, %eax
movl $0x19, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x40(%rbp), %eax
subl %ecx, %eax
imull $0x13, -0x8(%rbp), %ecx
addl %ecx, %eax
addl $0xf, %eax
movl $0x1e, %ecx
cltd
idivl %ecx
movl %edx, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl $0x1c, %ecx
cltd
idivl %ecx
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x18(%rbp), %ecx
movl -0x18(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x14(%rbp), %esi
addl $0x1, %esi
movl $0x1d, %eax
cltd
idivl %esi
movl %eax, %edx
movl -0x3c(%rbp), %eax
imull %edx, %eax
movl $0x15, %edx
subl -0x8(%rbp), %edx
imull %edx, %eax
movl $0xb, %esi
cltd
idivl %esi
movl %eax, %esi
movl -0x38(%rbp), %eax
movl $0x1, %edx
subl %esi, %edx
imull %edx, %ecx
subl %ecx, %eax
movl %eax, -0x1c(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x4(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x34(%rbp), %eax
addl %ecx, %eax
addl -0x1c(%rbp), %eax
addl $0x2, %eax
subl -0x10(%rbp), %eax
movl $0x7, %ecx
cltd
idivl %ecx
movl %edx, -0x20(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1c, %eax
subl -0x20(%rbp), %eax
movl %eax, -0x10(%rbp)
cmpl $0x1f, -0x10(%rbp)
jle 0x14700e
movl -0x10(%rbp), %eax
subl $0x1f, %eax
movl %eax, -0x10(%rbp)
movl $0x4, -0x24(%rbp)
jmp 0x147015
movl $0x3, -0x24(%rbp)
movl -0x24(%rbp), %esi
movl -0x10(%rbp), %edx
movl $0x6f, %edi
callq 0x138e90
movl -0x4(%rbp), %edi
movl -0x24(%rbp), %esi
movl -0x10(%rbp), %edx
callq 0x122140
movsd %xmm0, -0x30(%rbp)
movsd -0x30(%rbp), %xmm0
movsd 0x47fb3(%rip), %xmm1    # 0x18eff8
subsd %xmm1, %xmm0
xorl %edi, %edi
callq 0x11dd00
leaq 0x225825(%rip), %rax    # 0x36c87c
movl (%rax), %esi
leaq 0x225820(%rip), %rax    # 0x36c880
movl (%rax), %edx
movl $0x6c, %edi
callq 0x138e90
movsd -0x30(%rbp), %xmm0
movsd 0x47f77(%rip), %xmm1    # 0x18eff0
subsd %xmm1, %xmm0
xorl %edi, %edi
callq 0x11dd00
leaq 0x2257f1(%rip), %rax    # 0x36c87c
movl (%rax), %esi
leaq 0x2257ec(%rip), %rax    # 0x36c880
movl (%rax), %edx
movl $0x76, %edi
callq 0x138e90
movsd -0x30(%rbp), %xmm0
movsd 0x2a5db(%rip), %xmm1    # 0x171688
subsd %xmm1, %xmm0
xorl %edi, %edi
callq 0x11dd00
leaq 0x2257bd(%rip), %rax    # 0x36c87c
movl (%rax), %esi
leaq 0x2257b8(%rip), %rax    # 0x36c880
movl (%rax), %edx
movl $0x6d, %edi
callq 0x138e90
movsd -0x30(%rbp), %xmm0
movsd 0x2806f(%rip), %xmm1    # 0x16f150
subsd %xmm1, %xmm0
xorl %edi, %edi
callq 0x11dd00
leaq 0x225789(%rip), %rax    # 0x36c87c
movl (%rax), %esi
leaq 0x225784(%rip), %rax    # 0x36c880
movl (%rax), %edx
movl $0x6e, %edi
callq 0x138e90
addq $0x50, %rsp
popq %rbp
retq
nop