// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movslq %edi, %rcx
imulq $0x6bca1af3, %rcx, %rax # imm = 0x6BCA1AF3
movq %rax, %rdx
shrq $0x3f, %rdx
shrq $0x20, %rax
sarl $0x3, %eax
addl %edx, %eax
leal (%rax,%rax,8), %edx
leal (%rax,%rdx,2), %eax
movl %ecx, %r8d
subl %eax, %r8d
imulq $0x51eb851f, %rcx, %rax # imm = 0x51EB851F
movq %rax, %rdx
shrq $0x3f, %rdx
shrq $0x20, %rax
sarl $0x5, %eax
addl %edx, %eax
imulq $-0x51eb851f, %rcx, %rsi # imm = 0xAE147AE1
movq %rsi, %rdx
shrq $0x3f, %rdx
shrq $0x20, %rsi
sarl $0x7, %esi
addl %edx, %esi
addl %eax, %esi
leal 0xd(,%rax,8), %eax
cltq
imulq $-0x51eb851f, %rax, %rdx # imm = 0xAE147AE1
movq %rdx, %rax
shrq $0x3f, %rax
shrq $0x20, %rdx
sarl $0x3, %edx
addl %eax, %edx
leal (%r8,%r8,8), %eax
leal (%r8,%rax,2), %eax
addl %esi, %eax
leal (%rax,%rdx), %r9d
addl $0xf, %r9d
addl %edx, %eax
movslq %r9d, %rdx
imulq $-0x77777777, %rdx, %rdx # imm = 0x88888889
shrq $0x20, %rdx
addl %eax, %edx
addl $0xf, %edx
movl %edx, %r9d
shrl $0x1f, %r9d
sarl $0x4, %edx
addl %r9d, %edx
movl %edx, %r9d
shll $0x5, %r9d
addl %edx, %edx
subl %r9d, %edx
leal (%rdx,%rax), %r9d
addl $0xf, %r9d
movslq %r9d, %r9
imulq $-0x6db6db6d, %r9, %r10 # imm = 0x92492493
shrq $0x20, %r10
addl %r9d, %r10d
movl %r10d, %r11d
shrl $0x1f, %r11d
sarl $0x4, %r10d
addl %r11d, %r10d
leal (%rdx,%rax), %r11d
addl $0x10, %r11d
movl $0x1d, %eax
xorl %edx, %edx
idivl %r11d
movl $0x15, %edx
subl %r8d, %edx
imull %r10d, %edx
imull %eax, %edx
movslq %edx, %rax
imulq $-0x2e8ba2e9, %rax, %rax # imm = 0xD1745D17
movq %rax, %rdx
shrq $0x3f, %rdx
shrq $0x20, %rax
sarl %eax
addl %edx, %eax
notl %eax
imull %r10d, %eax
addl %r9d, %eax
leal 0x3(%rcx), %edx
testl %ecx, %ecx
cmovnsl %edi, %edx
sarl $0x2, %edx
addl %edi, %edx
subl %esi, %edx
addl %edx, %eax
addl $0x2, %eax
movl %edx, %ecx
addl $0x2, %ecx
cltq
imulq $-0x6db6db6d, %rax, %rdx # imm = 0x92492493
shrq $0x20, %rdx
addl %edx, %eax
movl %eax, %edx
shrl $0x1f, %edx
sarl $0x2, %eax
addl %edx, %eax
leal (,%rax,8), %edx
subl %eax, %edx
subl %ecx, %edx
leal 0x1c(%rdx), %eax
addl $-0x3, %edx
xorl %esi, %esi
cmpl $0x20, %eax
cmovll %eax, %edx
setge %sil
addl $0x3, %esi
movl $0x8, %eax
leaq 0x7d117(%rip), %rbx     # 0x16ae50
cmpl $0x6f, -0x8(%rax,%rbx)
je 0xedd4e
addq $0x18, %rax
cmpq $0x2258, %rax           # imm = 0x2258
jne 0xedd39
jmp 0xedd5b
cmpl $0x0, (%rax,%rbx)
je 0xedd5b
movl %esi, (%rax,%rbx)
movl %edx, -0x4(%rax,%rbx)
callq 0xd4110
movapd %xmm0, %xmm1
movsd 0x3e76c(%rip), %xmm0    # 0x12c4d8
movsd %xmm1, -0x20(%rbp)
addsd %xmm1, %xmm0
xorl %edi, %edi
callq 0xd0c46
leaq 0x21f919(%rip), %r14    # 0x30d69c
movl (%r14), %eax
leaq 0x21f913(%rip), %r15    # 0x30d6a0
movl (%r15), %ecx
movl $0x8, %edx
cmpl $0x6c, -0x8(%rdx,%rbx)
je 0xeddab
addq $0x18, %rdx
cmpq $0x2258, %rdx           # imm = 0x2258
jne 0xedd95
jmp 0xeddb8
cmpl $0x0, (%rdx,%rbx)
je 0xeddb8
movl %eax, (%rdx,%rbx)
movl %ecx, -0x4(%rdx,%rbx)
movsd 0x3e720(%rip), %xmm0    # 0x12c4e0
addsd -0x20(%rbp), %xmm0
xorl %edi, %edi
callq 0xd0c46
movl (%r14), %eax
movl (%r15), %ecx
movl $0x8, %edx
cmpl $0x76, -0x8(%rdx,%rbx)
je 0xedded
addq $0x18, %rdx
cmpq $0x2258, %rdx           # imm = 0x2258
jne 0xeddd7
jmp 0xeddfa
cmpl $0x0, (%rdx,%rbx)
je 0xeddfa
movl %eax, (%rdx,%rbx)
movl %ecx, -0x4(%rdx,%rbx)
movsd 0x3da3e(%rip), %xmm0    # 0x12b840
addsd -0x20(%rbp), %xmm0
xorl %edi, %edi
callq 0xd0c46
movl (%r14), %eax
movl (%r15), %ecx
movl $0x8, %edx
cmpl $0x6d, -0x8(%rdx,%rbx)
je 0xede2f
addq $0x18, %rdx
cmpq $0x2258, %rdx           # imm = 0x2258
jne 0xede19
jmp 0xede3c
cmpl $0x0, (%rdx,%rbx)
je 0xede3c
movl %eax, (%rdx,%rbx)
movl %ecx, -0x4(%rdx,%rbx)
movsd -0x20(%rbp), %xmm0
addsd 0x1dbd7(%rip), %xmm0    # 0x10ba20
xorl %edi, %edi
callq 0xd0c46
movl (%r14), %eax
movl (%r15), %ecx
movl $0x8, %edx
cmpl $0x6e, -0x8(%rdx,%rbx)
je 0xede71
addq $0x18, %rdx
cmpq $0x2258, %rdx           # imm = 0x2258
jne 0xede5b
jmp 0xede7e
cmpl $0x0, (%rdx,%rbx)
je 0xede7e
movl %eax, (%rdx,%rbx)
movl %ecx, -0x4(%rdx,%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq