// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: init_hebrew(int)
void init_hebrew(int year)
{
double t;
double rosh;

   rosh = rosh_jd(year);        // our reference is Rosh Hashahna 
                                // once you know Rosh Hashahna,  all is revealed

   t = rosh_jd(year+1) - rosh;  // number of days in the Jewish year

   jtimes[9] = rosh;
   jtimes[10] = jtimes[9]+30.0; // che
   if((DABS(t-355.0) < 0.1) || (DABS(t-385.0) < 0.1)) {  // shalim years
      rosh += 1.0;  // kis - the month of Cheshvan has an extra day in shalim years
      jtimes[11] = jtimes[10]+30.0;
   }
   else jtimes[11] = jtimes[10]+29.0;

   if((DABS(t-353.0) < 0.1) || (DABS(t-383.0) < 0.1)) {  // hasser years
      jtimes[12] = jtimes[11]+29.0; // tev - Kislev has one less day in hasser years
   }
   else jtimes[12] = jtimes[11]+30.0;
   jtimes[13] = jtimes[12]+29.0;    // shv
   jtimes[14] = jtimes[13]+30.0;    // end of shv
   jtimes[8]  = jtimes[9]-29.0;     // elu
   jtimes[7]  = jtimes[8]-30.0;     // av
   jtimes[6]  = jtimes[7]-29.0;     // tam
   jtimes[5]  = jtimes[6]-30.0;     // siv
   jtimes[4]  = jtimes[5]-29.0;     // iyr
   jtimes[3]  = jtimes[4]-30.0;     // nis
   jtimes[2]  = jtimes[3]-29.0;     // adr
   if(DABS(t) < 370.0) {            // previous year not a leap year
      jtimes[1]  = jtimes[2]-30.0;  // Adar I in leap years
      jmonths[1] = "Ad1";
      jmonths[2] = "Ad2";
   }
   else {                           // previous year was a leap year, this one is not
      jtimes[1] = 0.0F;             // no Adar I
      jtimes[1]  = jtimes[2]-30.0;     
      jmonths[1] = "Shv";
      jmonths[2] = "Adr";
   }
   jtimes[0] = jtimes[1]-29.0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
callq 0xd9c6f
movsd %xmm0, -0x10(%rbp)
incl %ebx
movl %ebx, %edi
callq 0xd9c6f
movsd -0x10(%rbp), %xmm8
subsd %xmm8, %xmm0
movsd %xmm8, 0x28b126(%rip)   # 0x364f08
movsd 0x1bb8e(%rip), %xmm4    # 0xf5978
movapd %xmm8, %xmm1
addsd %xmm4, %xmm1
movsd %xmm1, 0x28b115(%rip)   # 0x364f10
movsd 0x3c725(%rip), %xmm2    # 0x116528
addsd %xmm0, %xmm2
xorpd %xmm3, %xmm3
xorpd %xmm5, %xmm5
subsd %xmm2, %xmm5
movapd %xmm2, %xmm6
cmpltsd %xmm3, %xmm6
andpd %xmm6, %xmm5
andnpd %xmm2, %xmm6
orpd %xmm5, %xmm6
movsd 0x192d8(%rip), %xmm2    # 0xf3108
ucomisd %xmm6, %xmm2
ja 0xd9e6d
movsd 0x3c6f2(%rip), %xmm5    # 0x116530
addsd %xmm0, %xmm5
xorpd %xmm6, %xmm6
subsd %xmm5, %xmm6
movapd %xmm5, %xmm7
cmpltsd %xmm3, %xmm7
andpd %xmm7, %xmm6
andnpd %xmm5, %xmm7
orpd %xmm6, %xmm7
ucomisd %xmm7, %xmm2
ja 0xd9e6d
movsd 0x3c6cb(%rip), %xmm4    # 0x116538
addsd %xmm4, %xmm1
movsd %xmm1, 0x28b09f(%rip)   # 0x364f18
movsd 0x3c6bf(%rip), %xmm4    # 0x116540
addsd %xmm0, %xmm4
movapd %xmm4, %xmm5
cmpltsd %xmm3, %xmm5
subsd %xmm4, %xmm3
andpd %xmm5, %xmm3
andnpd %xmm4, %xmm5
orpd %xmm3, %xmm5
movsd 0x3c692(%rip), %xmm3    # 0x116538
ucomisd %xmm5, %xmm2
ja 0xd9ee3
movsd 0x3c694(%rip), %xmm4    # 0x116548
addsd %xmm0, %xmm4
xorpd %xmm5, %xmm5
movapd %xmm4, %xmm6
cmpltsd %xmm5, %xmm6
subsd %xmm4, %xmm5
andpd %xmm6, %xmm5
andnpd %xmm4, %xmm6
orpd %xmm5, %xmm6
ucomisd %xmm6, %xmm2
ja 0xd9ee3
movsd 0x1ba95(%rip), %xmm3    # 0xf5978
addsd %xmm3, %xmm1
movsd %xmm1, 0x28b031(%rip)   # 0x364f20
addsd 0x3c641(%rip), %xmm1    # 0x116538
movsd %xmm1, 0x28b029(%rip)   # 0x364f28
addsd 0x1ba71(%rip), %xmm1    # 0xf5978
movsd %xmm1, 0x28b021(%rip)   # 0x364f30
movsd 0x3bc29(%rip), %xmm1    # 0x115b40
addsd %xmm1, %xmm8
movsd %xmm8, 0x28afdb(%rip)   # 0x364f00
movsd 0x3bc1b(%rip), %xmm2    # 0x115b48
addsd %xmm2, %xmm8
movsd %xmm8, 0x28afbd(%rip)   # 0x364ef8
addsd %xmm1, %xmm8
movsd %xmm8, 0x28afa7(%rip)   # 0x364ef0
addsd %xmm2, %xmm8
movsd %xmm8, 0x28af91(%rip)   # 0x364ee8
addsd %xmm1, %xmm8
movsd %xmm8, 0x28af7b(%rip)   # 0x364ee0
addsd %xmm2, %xmm8
movsd %xmm8, 0x28af65(%rip)   # 0x364ed8
xorpd %xmm3, %xmm3
movapd %xmm0, %xmm4
cmpltsd %xmm3, %xmm4
subsd %xmm0, %xmm3
andpd %xmm4, %xmm3
andnpd %xmm0, %xmm4
orpd %xmm3, %xmm4
movsd 0x3c5b8(%rip), %xmm0    # 0x116550
ucomisd %xmm4, %xmm0
leaq 0x4470c(%rip), %rax     # 0x11e6af
leaq 0x44731(%rip), %rcx     # 0x11e6db
cmovaq %rax, %rcx
leaq 0x44c3c(%rip), %rax     # 0x11ebf1
leaq 0x446f7(%rip), %rdx     # 0x11e6b3
cmovaq %rax, %rdx
addsd %xmm1, %xmm8
movsd %xmm8, 0x28af02(%rip)   # 0x364ed0
addsd %xmm2, %xmm8
movsd %xmm8, 0x28aeec(%rip)   # 0x364ec8
movq %rcx, 0x7d125(%rip)     # 0x157108
movq %rdx, 0x7d126(%rip)     # 0x157110
addsd %xmm1, %xmm8
movsd %xmm8, 0x28aec8(%rip)   # 0x364ec0
addq $0x8, %rsp
popq %rbx
popq %rbp
retq