// File: /workspace/github_cpp_makefile_star2_O1/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 0xede89
movsd %xmm0, -0x10(%rbp)
incl %ebx
movl %ebx, %edi
callq 0xede89
movsd -0x10(%rbp), %xmm8
subsd %xmm8, %xmm0
movsd %xmm8, 0x28ce68(%rip)   # 0x37af08
movsd 0x1d850(%rip), %xmm4    # 0x10b8f8
movapd %xmm8, %xmm1
addsd %xmm4, %xmm1
movsd %xmm1, 0x28ce57(%rip)   # 0x37af10
movsd 0x3e457(%rip), %xmm2    # 0x12c518
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 0x1b01a(%rip), %xmm2    # 0x109108
ucomisd %xmm6, %xmm2
ja 0xee12b
movsd 0x3e424(%rip), %xmm5    # 0x12c520
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 0xee12b
movsd 0x3e3fd(%rip), %xmm4    # 0x12c528
addsd %xmm4, %xmm1
movsd %xmm1, 0x28cde1(%rip)   # 0x37af18
movsd 0x3e3f1(%rip), %xmm4    # 0x12c530
addsd %xmm0, %xmm4
movapd %xmm4, %xmm5
cmpltsd %xmm3, %xmm5
subsd %xmm4, %xmm3
andpd %xmm5, %xmm3
andnpd %xmm4, %xmm5
orpd %xmm3, %xmm5
movsd 0x3e3c4(%rip), %xmm3    # 0x12c528
ucomisd %xmm5, %xmm2
ja 0xee1a1
movsd 0x3e3c6(%rip), %xmm4    # 0x12c538
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 0xee1a1
movsd 0x1d757(%rip), %xmm3    # 0x10b8f8
addsd %xmm3, %xmm1
movsd %xmm1, 0x28cd73(%rip)   # 0x37af20
addsd 0x3e373(%rip), %xmm1    # 0x12c528
movsd %xmm1, 0x28cd6b(%rip)   # 0x37af28
addsd 0x1d733(%rip), %xmm1    # 0x10b8f8
movsd %xmm1, 0x28cd63(%rip)   # 0x37af30
movsd 0x3d963(%rip), %xmm1    # 0x12bb38
addsd %xmm1, %xmm8
movsd %xmm8, 0x28cd1d(%rip)   # 0x37af00
movsd 0x3d955(%rip), %xmm2    # 0x12bb40
addsd %xmm2, %xmm8
movsd %xmm8, 0x28ccff(%rip)   # 0x37aef8
addsd %xmm1, %xmm8
movsd %xmm8, 0x28cce9(%rip)   # 0x37aef0
addsd %xmm2, %xmm8
movsd %xmm8, 0x28ccd3(%rip)   # 0x37aee8
addsd %xmm1, %xmm8
movsd %xmm8, 0x28ccbd(%rip)   # 0x37aee0
addsd %xmm2, %xmm8
movsd %xmm8, 0x28cca7(%rip)   # 0x37aed8
addsd %xmm1, %xmm8
movsd %xmm8, 0x28cc91(%rip)   # 0x37aed0
xorpd %xmm1, %xmm1
movapd %xmm0, %xmm2
cmpltsd %xmm1, %xmm2
subsd %xmm0, %xmm1
andpd %xmm2, %xmm1
andnpd %xmm0, %xmm2
orpd %xmm1, %xmm2
movsd 0x3e2dc(%rip), %xmm0    # 0x12c540
ucomisd %xmm2, %xmm0
jbe 0xee27a
leaq 0x46970(%rip), %rax     # 0x134be1
leaq 0x46427(%rip), %rcx     # 0x13469f
jmp 0xee293
movq $0x0, 0x28cc43(%rip) # 0x37aec8
leaq 0x46417(%rip), %rax     # 0x1346a3
leaq 0x46438(%rip), %rcx     # 0x1346cb
addsd 0x3d8a4(%rip), %xmm8    # 0x12bb40
movsd %xmm8, 0x28cc23(%rip)   # 0x37aec8
movq %rcx, 0x7ee5c(%rip)     # 0x16d108
movq %rax, 0x7ee5d(%rip)     # 0x16d110
addsd 0x3d87c(%rip), %xmm8    # 0x12bb38
movsd %xmm8, 0x28cbfb(%rip)   # 0x37aec0
addq $0x8, %rsp
popq %rbx
popq %rbp
retq