// File: /workspace/github_cpp_makefile_star2_O3/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
shll $0x2, %ecx
leal (%rcx,%rcx,2), %eax
leal (%rcx,%rcx,2), %ebx
addl $0xc, %ebx
movswl %bx, %ecx
imull $0xffffd795, %ecx, %ecx # imm = 0xFFFFD795
shrl $0x10, %ecx
addl %ecx, %eax
addl $0xc, %eax
movzwl %ax, %eax
movswl %ax, %ecx
shrl $0xf, %eax
sarl $0x4, %ecx
addl %eax, %ecx
leal (%rcx,%rcx,8), %eax
leal (%rcx,%rax,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, %r8 # imm = 0xAE147AE1
movq %r8, %rsi
shrq $0x20, %rsi
movl %esi, %r10d
sarl $0x7, %r10d
shrq $0x3f, %r8
addl %r8d, %r10d
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
movswl %bx, %r11d
cvtsi2sd %r11d, %xmm1
mulsd 0x1d2cd(%rip), %xmm0    # 0x10b968
mulsd 0x3df25(%rip), %xmm1    # 0x12c5c8
leal -0x2(%rdx,%r10), %edx
addsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsi2sd %edi, %xmm0
mulsd 0x3df15(%rip), %xmm0    # 0x12c5d0
addsd 0x3df15(%rip), %xmm0    # 0x12c5d8
divsd 0x3df15(%rip), %xmm0    # 0x12c5e0
cvtsi2sd %edx, %xmm2
addsd %xmm1, %xmm0
addsd %xmm0, %xmm2
movapd %xmm2, -0x20(%rbp)
cvttsd2si %xmm2, %r10d
leal -0x1e(%r10), %edx
xorl %r11d, %r11d
cmpl $0x1f, %r10d
setge %r11b
cmovll %r10d, %edx
sarl $0x2, %r9d
sarl $0x5, %esi
addl %r8d, %esi
addl %r9d, %esi
sarl $0x7, %eax
addl %ecx, %eax
addl %esi, %eax
leal (%rdi,%r11,2), %ecx
movl %r11d, %esi
addl $0x9, %esi
addl %eax, %ecx
leal (%rdx,%rcx), %eax
addl $0x4, %eax
addl %edx, %ecx
cltq
imulq $-0x6db6db6d, %rax, %rax # imm = 0x92492493
shrq $0x20, %rax
addl %ecx, %eax
addl $0x4, %eax
movl %eax, %r8d
shrl $0x1f, %r8d
sarl $0x2, %eax
addl %r8d, %eax
leal (,%rax,8), %r8d
subl %r8d, %eax
leal (%rax,%rcx), %r14d
addl $0x4, %r14d
callq 0xd485e
cmpb $0x5, %r14b
ja 0xee786
movapd -0x20(%rbp), %xmm2
cvttpd2dq %xmm2, %xmm1
cvtdq2pd %xmm1, %xmm1
subsd %xmm1, %xmm2
movzbl %r14b, %eax
leaq 0x3ca4b(%rip), %rcx     # 0x12b1c0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
addsd 0x1a8ea(%rip), %xmm0    # 0x109070
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
ucomisd 0x3de59(%rip), %xmm2    # 0x12c5f0
jb 0xee786
cmpw $0x7, %bx
jge 0xee77e
jmp 0xee786
ucomisd 0x3de3f(%rip), %xmm2    # 0x12c5e8
jb 0xee786
cmpw $0x7, %bx
jl 0xee786
addsd 0x1d217(%rip), %xmm0    # 0x10b9d0
jmp 0xee786