// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: rosh_jd(int)
double rosh_jd(int y)
{
int g;
double r;
double jd;
int i, j;
int day, month;

   // return Julian date of Rosh Hashanha
   g = (y % 19) + 1;
   j = (12 * g) % 19;
   i = (y/100) - (y/400) - 2;
   r = (double) (int) (y%4);
   r = (765433.0/492480.0*(double) j) + (r/4.0) - ((313.0 * ((double) y) + 89081.0)/98496.0);
   r += (double) i;
// r = 6.057778996 + (1.554241797*(double) j) + 0.25*r - 0.003177794*(double)y,

   day = (int) r;
   r -= (double) day;
   month = 9;
   if(day > 30) { day-=30; ++month; }

   i = day_of_week(day, month, y);
   jd = jdate(y, month, day);

   // apply the postponements
   if((i == 0) || (i == 3) || (i == 5)) {
      jd += 1.0;
   }
   else if(i == 1) {
      if((r >= 23269.0/25920.0) && (j > 6)) jd += 1.0;
   }
   else if(i == 2) {
      if((r >= 1367.0/2160.0) && (j > 6)) jd += 2.0;
   }
   return jd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movslq %edi, %rdi
imulq $0x6bca1af3, %rdi, %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 %edi, %ecx
subl %eax, %ecx
leal (%rcx,%rcx,2), %eax
leal 0xc(,%rax,4), %eax
movslq %eax, %rbx
imulq $0x6bca1af3, %rbx, %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
subl %eax, %ebx
imulq $0x51eb851f, %rdi, %rcx # imm = 0x51EB851F
movq %rcx, %rax
shrq $0x20, %rax
movl %eax, %edx
sarl $0x5, %edx
shrq $0x3f, %rcx
addl %ecx, %edx
imulq $-0x51eb851f, %rdi, %r10 # imm = 0xAE147AE1
movq %r10, %r8
shrq $0x20, %r8
movl %r8d, %esi
sarl $0x7, %esi
shrq $0x3f, %r10
addl %r10d, %esi
leal 0x3(%rdi), %r9d
testl %edi, %edi
cmovnsl %edi, %r9d
movl %r9d, %r11d
andl $-0x4, %r11d
movl %edi, %r14d
subl %r11d, %r14d
cvtsi2sd %r14d, %xmm0
cvtsi2sd %ebx, %xmm1
mulsd 0x1da20(%rip), %xmm0    # 0x10b960
addl %esi, %edx
addl $-0x2, %edx
mulsd 0x3e59b(%rip), %xmm1    # 0x12c4e8
addsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsi2sd %edi, %xmm0
mulsd 0x3e590(%rip), %xmm0    # 0x12c4f0
addsd 0x3e590(%rip), %xmm0    # 0x12c4f8
divsd 0x3e590(%rip), %xmm0    # 0x12c500
addsd %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %edx, %xmm1
addsd %xmm0, %xmm1
movapd %xmm1, -0x20(%rbp)
cvttsd2si %xmm1, %esi
leal -0x1e(%rsi), %edx
xorl %r11d, %r11d
cmpl $0x1f, %esi
setge %r11b
cmovll %esi, %edx
leal 0x9(%r11), %esi
sarl $0x2, %r9d
sarl $0x5, %r8d
addl %r10d, %r8d
sarl $0x7, %eax
addl %ecx, %eax
leaq 0x3d50d(%rip), %rcx     # 0x12b4c0
movzbl 0x8(%rcx,%r11), %ecx
addl %edi, %r9d
addl %r8d, %r9d
addl %eax, %r9d
addl %edx, %r9d
addl %ecx, %r9d
movslq %r9d, %rax
imulq $-0x6db6db6d, %rax, %r14 # imm = 0x92492493
shrq $0x20, %r14
addl %eax, %r14d
movl %r14d, %ecx
shrl $0x1f, %ecx
sarl $0x2, %r14d
addl %ecx, %r14d
leal (,%r14,8), %ecx
subl %ecx, %r14d
addl %eax, %r14d
callq 0xd4110
cmpb $0x5, %r14b
ja 0xee02c
movapd -0x20(%rbp), %xmm2
cvttpd2dq %xmm2, %xmm1
cvtdq2pd %xmm1, %xmm1
subsd %xmm1, %xmm2
movzbl %r14b, %eax
leaq 0x3d0d5(%rip), %rcx     # 0x12b0f0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
addsd 0x1b044(%rip), %xmm0    # 0x109070
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
ucomisd 0x3e4d3(%rip), %xmm2    # 0x12c510
setae %al
cmpl $0x7, %ebx
setge %cl
andb %al, %cl
cmpb $0x1, %cl
je 0xee024
jmp 0xee02c
ucomisd 0x3e4b1(%rip), %xmm2    # 0x12c508
setae %al
cmpl $0x7, %ebx
setge %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xee02c
addsd 0x1d961(%rip), %xmm0    # 0x10b9d0
jmp 0xee02c