LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: obliquity(double, int)
double obliquity(double JD, int nutate)
{
double t, p, w, EpsMeanDeg;

   // Code derived from code by Jay Tanner
   // Algorithm by JPL?

   // -----------------------------------------------------------
   // Compute the (t) value in Julian decamillennia corresponding
   // to the JD argument and reckoned from J2000.
   t = (JD - JD2000) / 3652500.0;

   // --------------------------------------
   // Compute mean obliquity in arc seconds.
   w  = 84381.448;  p  = t;
   w -=  4680.93*p; p *= t;
   w -=     1.55*p; p *= t;
   w +=  1999.25*p; p *= t;
   w -=    51.38*p; p *= t;
   w -=   249.67*p; p *= t;
   w -=    39.05*p; p *= t;
   w +=     7.12*p; p *= t;
   w +=    27.87*p; p *= t;
   w +=     5.79*p; p *= t;
   w +=     2.45*p;

   // ----------------------------------
   // Compute mean ecliptic obliquity in
   // degrees from arc seconds value.
   EpsMeanDeg = w / 3600.0;
   if(nutate) EpsMeanDeg += nutation(JD);   // adjust for nutation
   EpsMeanDeg *= (PI/180.0);     // convert to radians

   return EpsMeanDeg;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movsd 0x4afe9(%rip), %xmm5    # 0x12b750
addsd %xmm0, %xmm5
divsd 0x4b13d(%rip), %xmm5    # 0x12b8b0
movsd 0x4b13d(%rip), %xmm1    # 0x12b8b8
mulsd %xmm5, %xmm1
addsd 0x4b139(%rip), %xmm1    # 0x12b8c0
movapd %xmm5, %xmm2
mulsd %xmm5, %xmm2
movapd %xmm5, %xmm3
mulsd %xmm2, %xmm3
mulsd 0x4b129(%rip), %xmm2    # 0x12b8c8
addsd %xmm1, %xmm2
movapd %xmm5, %xmm1
mulsd %xmm3, %xmm1
mulsd 0x4b11d(%rip), %xmm3    # 0x12b8d0
movapd %xmm5, %xmm4
mulsd %xmm1, %xmm4
mulsd 0x4b115(%rip), %xmm1    # 0x12b8d8
addsd %xmm2, %xmm3
addsd %xmm3, %xmm1
movapd %xmm5, %xmm2
mulsd %xmm4, %xmm2
mulsd 0x4b105(%rip), %xmm4    # 0x12b8e0
addsd %xmm1, %xmm4
movapd %xmm5, %xmm1
mulsd %xmm2, %xmm1
mulsd 0x4b0f9(%rip), %xmm2    # 0x12b8e8
addsd %xmm4, %xmm2
movapd %xmm5, %xmm3
mulsd %xmm1, %xmm3
mulsd 0x4b0ed(%rip), %xmm1    # 0x12b8f0
movapd %xmm5, %xmm4
mulsd %xmm3, %xmm4
mulsd 0x4b0e5(%rip), %xmm3    # 0x12b8f8
addsd %xmm2, %xmm1
mulsd %xmm4, %xmm5
mulsd 0x4b0dd(%rip), %xmm4    # 0x12b900
addsd %xmm1, %xmm3
addsd %xmm3, %xmm4
mulsd 0x4b0d5(%rip), %xmm5    # 0x12b908
addsd %xmm4, %xmm5
divsd 0x287d1(%rip), %xmm5    # 0x109010
testl %edi, %edi
je 0xe0856
movsd %xmm5, -0x8(%rbp)
callq 0xdffaf
movsd -0x8(%rbp), %xmm5
addsd %xmm0, %xmm5
mulsd 0x2b0aa(%rip), %xmm5    # 0x10b908
movapd %xmm5, %xmm0
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: setup_calendars(int)
void setup_calendars(int why)
{
  #ifdef GEN_CHINA_DATA
     void load_china_data();
     void load_hk_data();
     load_china_data();              // process data from projectpluto.com "chinese.dat"
     load_hk_data();                 // process data from Hong Kong Observatory files
  #endif

   calc_seasons();                   // calc jdates of the equinoxes
   calc_moons(jd_local, 1);          // moon phases for the current month

   init_chinese(this_year);          // setup chinese calendar
   init_hebrew(this_year);           // setup Hebrew calendar (oy, vey! it be complicated)
   init_islamic(this_year);          // setup (appoximate) Islamic calendar
   init_persian(this_year);          // setup Persian/Afghan/Kurdish calendars
   init_indian(this_year);           // setup Indian civil calendar
   init_druid(this_year);            // setup pseudo-Druid calendar

   calc_greetings();                 // calculate seasonal holidays and insert into table
   show_greetings();                 // display any current greeting
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
callq 0xeee38
leaq 0x22c8e2(%rip), %rax    # 0x30d548
movsd (%rax), %xmm0
callq 0xe932d
leaq 0x22c8aa(%rip), %rbx    # 0x30d520
movl (%rbx), %edi
callq 0xeec59
movl (%rbx), %edi
callq 0xee071
movl (%rbx), %edi
callq 0xee5bc
movl (%rbx), %edi
callq 0xee834
movl (%rbx), %edi
callq 0xee9c2
movl (%rbx), %edi
callq 0xee6b5
callq 0xe455f
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xe3e17
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: dst_disabled()
int dst_disabled()
{
   if(time_zone_set == 0)   return 1;
   if(dst_start_day == 0)   return 2;
   if(dst_start_month == 0) return 3;
   if(dst_end_day == 0)     return 4;
   if(dst_end_month == 0)   return 5;
   if(dst_string[0] == 0)   return 6;
   if(dst_area == 0)        return 7;

   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x22cbd9(%rip), %rax    # 0x30d894
cmpb $0x0, (%rax)
je 0xe0d06
cmpl $0x0, 0x299d39(%rip)    # 0x37aa00
je 0xe0d0d
cmpl $0x0, 0x299d34(%rip)    # 0x37aa04
je 0xe0d14
cmpl $0x0, 0x299d2f(%rip)    # 0x37aa08
je 0xe0d1b
cmpl $0x0, 0x299d2a(%rip)    # 0x37aa0c
je 0xe0d22
leaq 0x22cc3d(%rip), %rax    # 0x30d928
cmpb $0x0, (%rax)
je 0xe0d29
leaq 0x22cba5(%rip), %rax    # 0x30d89c
xorl %ecx, %ecx
cmpl $0x0, (%rax)
movl $0x7, %eax
cmovnel %ecx, %eax
jmp 0xe0d2e
movl $0x1, %eax
jmp 0xe0d2e
movl $0x2, %eax
jmp 0xe0d2e
movl $0x3, %eax
jmp 0xe0d2e
movl $0x4, %eax
jmp 0xe0d2e
movl $0x5, %eax
jmp 0xe0d2e
movl $0x6, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: time_since_perihelion(double)
double time_since_perihelion(double jd)
{
#define JD_DELTA_EOT 3.5884  // 3.52719  // typical offset time of perihelion from 1 Jan in days

   // return days (fractional) since perihelion (based upon local time)
   // returns estimated value if year not between 2016 and 2100
   gregorian(0, jd);
   if(g_year < 2016) return jd - jdate(g_year, 1, 1) - JD_DELTA_EOT;
   else if(g_year > 2100) return jd - jdate(g_year, 1, 1) - JD_DELTA_EOT;

   jd = jd - perihelion_jd[g_year-2016];
// jd -= 1.363;  // fudge factor to get alignment with NREL SPA code
jd -= 1.60;
   return jd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
xorl %edi, %edi
movsd %xmm0, -0x8(%rbp)
callq 0xd0c46
leaq 0x22c959(%rip), %rax    # 0x30d6a4
movslq (%rax), %rcx
cmpq $0x7df, %rcx            # imm = 0x7DF
jle 0xe0d63
cmpl $0x835, %ecx            # imm = 0x835
jl 0xe0df7
leaq -0x1(%rcx), %rax
movabsq $-0x5c28f5c28f5c28f5, %rsi # imm = 0xA3D70A3D70A3D70B
imulq %rsi
leaq (%rdx,%rcx), %rax
decq %rax
movq %rax, %rdx
shrq $0x3f, %rdx
sarq $0x6, %rax
addq %rdx, %rax
imulq $-0x64, %rax, %rdx
addq %rdx, %rcx
decq %rcx
imulq $0x23ab1, %rax, %rax    # imm = 0x23AB1
leaq 0x3(%rax), %rdi
testq %rax, %rax
cmovnsq %rax, %rdi
sarq $0x2, %rdi
imulq $0x8ead, %rcx, %rcx     # imm = 0x8EAD
movq %rcx, %rax
imulq %rsi
addq %rcx, %rdx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x6, %rdx
addq %rax, %rdx
cvtsi2sd %rdi, %xmm1
addsd 0x4a934(%rip), %xmm1    # 0x12b708
cvtsi2sd %rdx, %xmm2
addsd %xmm1, %xmm2
addsd 0x4ab33(%rip), %xmm2    # 0x12b918
addsd 0x28283(%rip), %xmm2    # 0x109070
movsd 0x4ab2b(%rip), %xmm1    # 0x12b920
jmp 0xe0e11
addl $0xfffff820, %ecx       # imm = 0xFFFFF820
leaq 0x89a5c(%rip), %rax     # 0x16a860
movsd (%rax,%rcx,8), %xmm2
movsd 0x4aaff(%rip), %xmm1    # 0x12b910
movsd -0x8(%rbp), %xmm0
subsd %xmm2, %xmm0
addsd %xmm1, %xmm0
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: orbit_eccentricity(double)
double orbit_eccentricity(double jd)
{
double t;
double ecc;

   t = (jd - JD2000)/365250.0;
   ecc = 0.0167086342 - 0.0004203654*t - 0.0000126734*t*t + 0.0000001444*t*t*t
         -0.0000000002*t*t*t*t + 0.0000000003*t*t*t*t*t;
   return ecc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
addsd 0x4a920(%rip), %xmm0    # 0x12b750
divsd 0x4aaf0(%rip), %xmm0    # 0x12b928
movsd 0x4aaf0(%rip), %xmm1    # 0x12b930
mulsd %xmm0, %xmm1
addsd 0x4aaec(%rip), %xmm1    # 0x12b938
movsd 0x4aaec(%rip), %xmm2    # 0x12b940
mulsd %xmm0, %xmm2
mulsd %xmm0, %xmm2
addsd %xmm1, %xmm2
movsd 0x4aae0(%rip), %xmm1    # 0x12b948
mulsd %xmm0, %xmm1
mulsd %xmm0, %xmm1
mulsd %xmm0, %xmm1
addsd %xmm2, %xmm1
movsd 0x4aad0(%rip), %xmm2    # 0x12b950
mulsd %xmm0, %xmm2
mulsd %xmm0, %xmm2
mulsd %xmm0, %xmm2
mulsd %xmm0, %xmm2
addsd %xmm1, %xmm2
movsd 0x4aabc(%rip), %xmm1    # 0x12b958
mulsd %xmm0, %xmm1
mulsd %xmm0, %xmm1
mulsd %xmm0, %xmm1
mulsd %xmm0, %xmm1
mulsd %xmm1, %xmm0
addsd %xmm2, %xmm0
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: calcObliquityCorrection(double)
double calcObliquityCorrection(double t)
{
  double seconds = 21.448 - t*(46.8150 + t*(0.00059 - t*(0.001813)));
  double e0 = 23.0 + (26.0 + (seconds/60.0))/60.0;

  double omega = 125.04 - 1934.136 * t;
  return e0 + 0.00256 * cos(omega*PI/180.0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movsd 0x4aa4f(%rip), %xmm1    # 0x12b988
mulsd %xmm0, %xmm1
addsd 0x4aa4b(%rip), %xmm1    # 0x12b990
mulsd %xmm0, %xmm1
addsd 0x4aa47(%rip), %xmm1    # 0x12b998
mulsd %xmm0, %xmm1
movsd 0x4aa43(%rip), %xmm2    # 0x12b9a0
subsd %xmm1, %xmm2
movsd 0x2809f(%rip), %xmm1    # 0x109008
divsd %xmm1, %xmm2
addsd 0x4a90b(%rip), %xmm2    # 0x12b880
divsd %xmm1, %xmm2
addsd 0x4aa27(%rip), %xmm2    # 0x12b9a8
movsd %xmm2, -0x8(%rbp)
mulsd 0x4aa22(%rip), %xmm0    # 0x12b9b0
addsd 0x4aa22(%rip), %xmm0    # 0x12b9b8
mulsd 0x2a87a(%rip), %xmm0    # 0x10b818
divsd 0x2a87a(%rip), %xmm0    # 0x10b820
callq 0x9710
mulsd 0x4aa0d(%rip), %xmm0    # 0x12b9c0
addsd -0x8(%rbp), %xmm0
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: gmst(double, int)
double gmst(double jd, int apparent)
{
double st;
double d;    // oh, my
double omega;
double epsilon;
double l;
double delta;
double eqeq;
double jc;

   // calculate Greenwich mean or apparent sidereal time

   d = jd - JD2000; 

   // from NREL SPA code
   jc = d / 36525.0;  // julian century
   st = (280.46061837 + 360.98564736629 * (jd - JD2000) +
         jc*jc*(0.000387933 - jc/38710000.0));
   st = fmod(st, 360.0);
   st /= 15.0;

   if(apparent) { // calculate nutation for apparent sidereal time
      omega = 125.04 - (0.052954 * d);
      l = 280.47 + (0.98565 * d); 
      epsilon = 23.4393 - (0.0000004 * d); 
      delta = (-0.000319*sin(omega)) - (0.000024*sin(l+l));
      eqeq = delta * cos(epsilon);
      st += eqeq;
      st = fmod(st, 24.0);
   }

   while(st < 0.0)   st += 24.0;
   while(st >= 24.0) st -= 24.0;
   return st;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x28, %rsp
movapd %xmm0, %xmm2
addsd 0x49fc0(%rip), %xmm2    # 0x12b750
movl %edi, %ebx
movapd %xmm2, %xmm0
divsd 0x49fba(%rip), %xmm0    # 0x12b758
movsd 0x4a2c2(%rip), %xmm1    # 0x12ba68
movsd %xmm2, -0x18(%rbp)
mulsd %xmm2, %xmm1
addsd 0x4a2b9(%rip), %xmm1    # 0x12ba70
movapd %xmm0, %xmm2
mulsd %xmm0, %xmm2
divsd 0x4a2b1(%rip), %xmm0    # 0x12ba78
addsd 0x4a2b1(%rip), %xmm0    # 0x12ba80
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd 0x3c8b1(%rip), %xmm1    # 0x11e090
callq 0x94d0
movapd %xmm0, %xmm2
divsd 0x3cca8(%rip), %xmm2    # 0x11e498
testl %ebx, %ebx
je 0xe189f
movsd 0x4a288(%rip), %xmm0    # 0x12ba88
movsd -0x18(%rbp), %xmm1
mulsd %xmm1, %xmm0
addsd 0x4a1a7(%rip), %xmm0    # 0x12b9b8
movsd 0x4a277(%rip), %xmm3    # 0x12ba90
mulsd %xmm1, %xmm3
addsd 0x4a273(%rip), %xmm3    # 0x12ba98
movsd %xmm3, -0x20(%rbp)
mulsd 0x4a26e(%rip), %xmm1    # 0x12baa0
addsd 0x4a26e(%rip), %xmm1    # 0x12baa8
movsd %xmm1, -0x18(%rbp)
movsd %xmm2, -0x28(%rbp)
callq 0x9080
movsd %xmm0, -0x10(%rbp)
movsd -0x20(%rbp), %xmm0
addsd %xmm0, %xmm0
callq 0x9080
mulsd 0x4a24c(%rip), %xmm0    # 0x12bab0
movsd -0x10(%rbp), %xmm1
mulsd 0x4a247(%rip), %xmm1    # 0x12bab8
addsd %xmm1, %xmm0
movsd %xmm0, -0x10(%rbp)
movsd -0x18(%rbp), %xmm0
callq 0x9710
mulsd -0x10(%rbp), %xmm0
addsd -0x28(%rbp), %xmm0
movsd 0x277aa(%rip), %xmm1    # 0x109040
callq 0x94d0
movapd %xmm0, %xmm2
xorpd %xmm0, %xmm0
ucomisd %xmm2, %xmm0
jbe 0xe18bb
movsd 0x2778f(%rip), %xmm1    # 0x109040
addsd %xmm1, %xmm2
ucomisd %xmm2, %xmm0
ja 0xe18b1
ucomisd 0x2777d(%rip), %xmm2    # 0x109040
jb 0xe18df
movsd 0x3cf83(%rip), %xmm0    # 0x11e850
movsd 0x2776b(%rip), %xmm1    # 0x109040
addsd %xmm0, %xmm2
ucomisd %xmm1, %xmm2
jae 0xe18d5
movapd %xmm2, %xmm0
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: lmst(double, int)
double lmst(double jd, int apparent)
{
double st;

   // calculate Greenwich mean or apparent local time

   if(lon > 0.0) st = 360.0 - lon*RAD_TO_DEG;  // st = lon west of Greenwich
   else          st = 0.0 - lon*RAD_TO_DEG;
   st = st * 24.0 / 360.0;   // st is the hour offset based upon longitude

   st = gmst(jd, apparent) - st;

   while(st < 0.0)   st += 24.0;
   while(st >= 24.0) st -= 24.0;
   return st;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x22b6df(%rip), %rax    # 0x30cfd8
movsd (%rax), %xmm1
movsd 0x4a1bb(%rip), %xmm2    # 0x12bac0
mulsd %xmm1, %xmm2
xorpd %xmm3, %xmm3
cmpltsd %xmm1, %xmm3
movsd 0x3c776(%rip), %xmm1    # 0x11e090
andpd %xmm1, %xmm3
addsd %xmm2, %xmm3
mulsd 0x3cf26(%rip), %xmm3    # 0x11e850
divsd %xmm1, %xmm3
movapd %xmm3, -0x10(%rbp)
callq 0xe177b
xorpd %xmm2, %xmm2
addsd -0x10(%rbp), %xmm0
ucomisd %xmm0, %xmm2
jbe 0xe1959
movsd 0x276f1(%rip), %xmm1    # 0x109040
addsd %xmm1, %xmm0
ucomisd %xmm0, %xmm2
ja 0xe194f
ucomisd 0x276df(%rip), %xmm0    # 0x109040
jb 0xe197d
movsd 0x3cee5(%rip), %xmm1    # 0x11e850
movsd 0x276cd(%rip), %xmm2    # 0x109040
addsd %xmm1, %xmm0
ucomisd %xmm2, %xmm0
jae 0xe1973
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: tcb_time(double)
double tcb_time(double jd_tt)
{
double g;
double jd;

   g = (357.53 + (0.9856003 * (jd_tt - JD2000))) * PI/180.0; // radians
   jd = jd_tt + (((0.001658 * sin(g)) + (0.000014 * sin(2.0*g))) / (24.0*60.0*60.0)); // jd is TDB

   jd -= 2443144.5003725;         // convert TDB to TCB
   jd /= (1.0 - 1.550519768e-8);
   jd += 2443144.5003725;
   return jd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movsd %xmm0, -0x18(%rbp)
movsd 0x49cd7(%rip), %xmm1    # 0x12b750
addsd %xmm0, %xmm1
mulsd 0x4a05b(%rip), %xmm1    # 0x12bae0
addsd 0x4a05b(%rip), %xmm1    # 0x12bae8
mulsd 0x29d83(%rip), %xmm1    # 0x10b818
divsd 0x29d83(%rip), %xmm1    # 0x10b820
movsd %xmm1, -0x8(%rbp)
movapd %xmm1, %xmm0
callq 0x9080
movsd %xmm0, -0x10(%rbp)
movsd -0x8(%rbp), %xmm0
addsd %xmm0, %xmm0
callq 0x9080
mulsd 0x4a02a(%rip), %xmm0    # 0x12baf0
movsd -0x10(%rbp), %xmm1
mulsd 0x4a025(%rip), %xmm1    # 0x12baf8
addsd %xmm1, %xmm0
divsd 0x27539(%rip), %xmm0    # 0x109018
addsd -0x18(%rbp), %xmm0
addsd 0x49fe4(%rip), %xmm0    # 0x12bad0
divsd 0x4a00c(%rip), %xmm0    # 0x12bb00
addsd 0x4a00c(%rip), %xmm0    # 0x12bb08
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: get_alarm_time()
double get_alarm_time()
{

   // Get the time to trigger an alarm into the g_ variables and also return
   // it as a jdate double.
   //
   // This time can either be the local time or the displayed time (if it is
   // one of the astronomical time scales) depending upon the setting of the
   // alarm_type option.

   if(alarm_type == 0) {  // alarm/dump/exit on local time
      gregorian(0, jd_local);
      return jd_local;
   }
   else {  // alarm/dump/exit on displayed (possibly astronomical time)
      g_year    = pri_year;   
      g_month   = pri_month;
      g_day     = pri_day;
      g_hours   = pri_hours;
      g_minutes = pri_minutes;
      g_seconds = pri_seconds;
      g_frac    = pri_frac;

      return jdate(g_year,g_month,g_day) + jtime(g_hours,g_minutes,g_seconds,0.0);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x138fd6(%rip), %rax    # 0x21b418
cmpb $0x0, (%rax)
je 0xe2511
leaq 0x22b0c2(%rip), %rax    # 0x30d514
movl (%rax), %edi
leaq 0x22b249(%rip), %rax    # 0x30d6a4
movl %edi, (%rax)
leaq 0x22b0ac(%rip), %rax    # 0x30d510
movl (%rax), %esi
leaq 0x22b22f(%rip), %rax    # 0x30d69c
movl %esi, (%rax)
leaq 0x22b096(%rip), %rax    # 0x30d50c
movl (%rax), %edx
leaq 0x22b221(%rip), %rax    # 0x30d6a0
movl %edx, (%rax)
leaq 0x22b080(%rip), %rax    # 0x30d508
movl (%rax), %ebx
leaq 0x22b217(%rip), %rax    # 0x30d6a8
movl %ebx, (%rax)
leaq 0x22b06a(%rip), %rax    # 0x30d504
movl (%rax), %r14d
leaq 0x22b208(%rip), %rax    # 0x30d6ac
movl %r14d, (%rax)
leaq 0x22b052(%rip), %rax    # 0x30d500
movl (%rax), %r15d
leaq 0x22b1f8(%rip), %rax    # 0x30d6b0
movl %r15d, (%rax)
leaq 0x22b056(%rip), %rax    # 0x30d518
movsd (%rax), %xmm0
leaq 0x22b1eb(%rip), %rax    # 0x30d6b8
movsd %xmm0, (%rax)
callq 0xd4110
cvtsi2sd %ebx, %xmm2
cvtsi2sd %r14d, %xmm3
movapd %xmm0, %xmm1
divsd 0x26b1d(%rip), %xmm3    # 0x109008
addsd %xmm2, %xmm3
xorps %xmm0, %xmm0
cvtsi2sd %r15d, %xmm0
divsd 0x26b11(%rip), %xmm0    # 0x109010
addsd %xmm3, %xmm0
divsd 0x26b35(%rip), %xmm0    # 0x109040
addsd %xmm1, %xmm0
jmp 0xe2527
leaq 0x22b030(%rip), %rbx    # 0x30d548
movsd (%rbx), %xmm0
xorl %edi, %edi
callq 0xd0c46
movsd (%rbx), %xmm0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: reset_alarm()
void reset_alarm()
{
   // reset the alarm, turn off modem control signals if enabled
   if(modem_alarms) {  // turn off modem control signal that indicates alarm
      Sleep(250);  // allow minimum modem control signal width
      // !!!!!! manipulate modem control signals here
      if(com[ALARM_PORT].com_port > 0) { // COM port in use
         SetDtrLine(ALARM_PORT, 1);  // drive +12V
         SetRtsLine(ALARM_PORT, 0);  // drive -12V
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x22ba0f(%rip), %rax    # 0x30df4c
cmpl $0x0, (%rax)
je 0xe2578
movl $0xfa, %edi
callq 0xaff7
leaq 0x22bd8d(%rip), %rax    # 0x30e2e0
cmpl $0x0, 0x157c0(%rax)
jle 0xe2578
movl $0xa, %edi
movl $0x1, %esi
callq 0xaeba
movl $0xa, %edi
xorl %esi, %esi
popq %rbp
jmp 0xaf06
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: enable_alarm()
void enable_alarm()
{
   if(modem_alarms) {
      // !!!!!! manipulate modem control signals here
      if(com[ALARM_PORT].com_port > 0) { // COM port in use
         SetDtrLine(ALARM_PORT, 0);  // drive -12V
         SetRtsLine(ALARM_PORT, 1);  // drive +12V
      }
   }
}

// Assembly:
leaq 0x22b9cb(%rip), %rax    # 0x30df4c
cmpl $0x0, (%rax)
je 0xe25b6
leaq 0x22bd53(%rip), %rax    # 0x30e2e0
cmpl $0x0, 0x157c0(%rax)
jle 0xe25b6
pushq %rbp
movq %rsp, %rbp
movl $0xa, %edi
xorl %esi, %esi
callq 0xaeba
movl $0xa, %edi
movl $0x1, %esi
popq %rbp
jmp 0xaf06
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: get_delta_t()
void get_delta_t()
{
FILE *file;

   // periodically try to get delta_t from a file
   gregorian(0, jd_utc);
   if((g_hours == DELTAT_HOUR) && (g_minutes == DELTAT_MINUTE) && (g_seconds == DELTAT_SECOND)) {
      need_delta_t = 1;
   }

   if(need_delta_t && (user_set_delta_t != 1)) { // time to get delta_t from a file
      if(0) {
         file = topen(lock_name, "r");     // check for lock file
         if(file) {        // deltat.dat is being updated
            fclose(file);
            return;
         }
      }

      file = topen(DELTAT_FILE, "r");
      if(file) {
         if(fgets(out, sizeof(out)-1, file) != NULL) {
            user_delta_t = atof(out);
            user_delta_t /= (24.0*60.0*60.0);  // convert seconds to days
            user_set_delta_t = 2;
         }
         fclose(file);
      }
      need_delta_t = 0;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x22ab09(%rip), %rax    # 0x30d530
movsd (%rax), %xmm0
xorl %edi, %edi
callq 0xd0c46
leaq 0x22ac6f(%rip), %rax    # 0x30d6a8
cmpl $0x0, (%rax)
jne 0xe2a63
leaq 0x22ac67(%rip), %rax    # 0x30d6ac
cmpl $0x0, (%rax)
jne 0xe2a63
leaq 0x22ac5f(%rip), %rax    # 0x30d6b0
cmpl $0x10, (%rax)
jne 0xe2a63
leaq 0x22aa8f(%rip), %rax    # 0x30d4ec
movl $0x1, (%rax)
leaq 0x22aa82(%rip), %r14    # 0x30d4ec
cmpl $0x0, (%r14)
je 0xe2ae6
leaq 0x22aa71(%rip), %r15    # 0x30d4e8
cmpl $0x1, (%r15)
je 0xe2ae6
leaq 0x3305d(%rip), %rdi     # 0x115ae1
leaq 0x3e222(%rip), %rsi     # 0x120cad
callq 0x9a4d
testq %rax, %rax
je 0xe2adf
movq %rax, %rbx
leaq 0x259781(%rip), %rdi    # 0x33c220
movl $0x200, %esi            # imm = 0x200
movq %rax, %rdx
callq 0x9600
testq %rax, %rax
je 0xe2ad7
leaq 0x259768(%rip), %rdi    # 0x33c220
callq 0x9470
divsd 0x26553(%rip), %xmm0    # 0x109018
leaq 0x22aa24(%rip), %rax    # 0x30d4f0
movsd %xmm0, (%rax)
movl $0x2, (%r15)
movq %rbx, %rdi
callq 0x9370
movl $0x0, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: get_std_zone(char*, int)
char *get_std_zone(char *s, int digit_stop)
{
int c;
int j;

   if(s == 0) return s;
   if(*s == 0) return 0;

   c = 0;
   std_string[0] = 0;
   j = 0;
   while(j < 20) {
      c = *s;
      if(c == '/') break;
      if(c == '-') break;
      if(c == '+') break;
      if(digit_stop && isdigit(c)) break;

      ++s;
      if(c == ' ') continue;
      if(c == '\t') continue;

      std_string[j++] = toupper(c);
      std_string[j] = 0;

      if(j >= TZ_NAME_LEN) break;
      else if(*s == 0)    { s=0; break; }
      else if(*s == 0x0D) { s=0; break; }
      else if(*s == 0x0A) { s=0; break; }
   }

   if(std_string[0] == 0) strcpy(std_string, tz_string);
   return s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0xe2d20
movq %rdi, %rbx
cmpb $0x0, (%rdi)
je 0xe2d20
movl %esi, %r14d
leaq 0x22ac6e(%rip), %r15    # 0x30d920
movb $0x0, (%r15)
xorl %r12d, %r12d
movabsq $0xa80000000000, %r13   # imm = 0xA80000000000
incq %rbx
movzbl -0x1(%rbx), %eax
cmpq $0x2f, %rax
ja 0xe2cd6
btq %rax, %r13
jb 0xe2d24
movsbl %al, %edi
testl %r14d, %r14d
je 0xe2ce6
leal -0x30(%rdi), %ecx
cmpl $0xa, %ecx
jb 0xe2d24
cmpb $0x20, %al
je 0xe2cc3
movzbl %al, %eax
cmpl $0x9, %eax
je 0xe2cc3
callq 0x9700
movb %al, (%r15,%r12)
movb $0x0, 0x1(%r15,%r12)
cmpq $0x4, %r12
je 0xe2d27
incq %r12
movzbl (%rbx), %eax
cmpl $0xd, %eax
movl $0x2401, %ecx           # imm = 0x2401
ja 0xe2cc3
btl %eax, %ecx
jae 0xe2cc3
xorl %ebx, %ebx
jmp 0xe2d27
xorl %ebx, %ebx
jmp 0xe2d40
decq %rbx
cmpb $0x0, (%r15)
jne 0xe2d40
leaq 0x22abec(%rip), %rdi    # 0x30d920
leaq 0x22abf5(%rip), %rsi    # 0x30d930
callq 0x9340
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: get_dst_zone(char*)
char *get_dst_zone(char *s)
{
int c;
int j;

   if(dst_area == 0) dst_area = USA;
   dst_string[0] = 0;
   j = 0;
   while(j < 20) {
      c = *s;
      if(c == 0) { s=0; break; }
      ++s;

      if(c == '/') break;
      if(c == ' ') continue;
      if(c == '\t') continue;

      dst_string[j++] = toupper(c);
      dst_string[j] = 0;

      if     (j >= TZ_NAME_LEN) break;
      else if(*s == 0)    { s=0; break; }
      else if(*s == 0x0D) { s=0; break; }
      else if(*s == 0x0A) { s=0; break; }
   }

   if(1 && (user_set_dst == 0)) {  // user has not set the DST area
      strcpy(out, dst_string);
      strupr(out);
      if(strcmp(out, "BST") == 0) {  // UK/euro time
         dst_area = 2;  // set the DST area to Euro-land
      }
      else {  // assume USA
         dst_area = 1;
      }
      calc_dst_times(this_year, dst_list[dst_area]);
      dst_ofs = dst_offset();
   }

   return s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x22ab32(%rip), %r15    # 0x30d89c
cmpl $0x0, (%r15)
jne 0xe2d77
movl $0x1, (%r15)
leaq 0x22abaa(%rip), %r14    # 0x30d928
movb $0x0, (%r14)
movl $0x2401, %r12d          # imm = 0x2401
xorl %r13d, %r13d
movb (%rbx), %al
testb %al, %al
je 0xe2dd9
incq %rbx
cmpb $0x9, %al
je 0xe2da0
movzbl %al, %ecx
cmpl $0x20, %ecx
jne 0xe2dab
movb (%rbx), %al
incq %rbx
testb %al, %al
jne 0xe2d94
jmp 0xe2dd9
cmpl $0x2f, %ecx
je 0xe2ddb
movsbl %al, %edi
callq 0x9700
movb %al, (%r14,%r13)
movb $0x0, 0x1(%r14,%r13)
cmpq $0x4, %r13
je 0xe2ddb
incq %r13
movzbl (%rbx), %eax
cmpl $0xd, %eax
ja 0xe2d8b
btl %eax, %r12d
jae 0xe2d8b
xorl %ebx, %ebx
leaq 0x22aac2(%rip), %rax    # 0x30d8a4
cmpb $0x0, (%rax)
jne 0xe2e3d
leaq 0x259432(%rip), %r14    # 0x33c220
leaq 0x22ab33(%rip), %rsi    # 0x30d928
movq %r14, %rdi
callq 0x9340
movq %r14, %rdi
callq 0x9899
xorl %eax, %eax
cmpl $0x545342, (%r14)       # imm = 0x545342
sete %al
incl %eax
movl %eax, (%r15)
leaq 0x22a703(%rip), %rcx    # 0x30d520
movl (%rcx), %edi
leaq 0x87a0a(%rip), %rcx     # 0x16a830
movq (%rcx,%rax,8), %rsi
callq 0xe0868
callq 0xe0af6
leaq 0x22aa65(%rip), %rcx    # 0x30d8a0
movl %eax, (%rcx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: moon_phase(double)
double moon_phase(double jd)
{
double ls;
double lm;
double p;

   //
   //  Calculates the phase of the moon at the given julian date.
   //  returns the moon phase as a real number (0-1)
   //
   ++sp_count;

   ls = sun_position(jd);       // geocentric (?) longitude of sun
   lm = moon_position(jd, ls);  // geocentric (?) longitude of moon

   p = (1.0 - cos((lm-ls)*DEG_TO_RAD))/2.0;
   return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movsd %xmm0, -0x10(%rbp)
incl 0x29613f(%rip)          # 0x37a5b4
callq 0xe5812
movaps %xmm0, %xmm1
movsd %xmm0, -0x8(%rbp)
movsd -0x10(%rbp), %xmm0
callq 0xe59de
subsd -0x8(%rbp), %xmm0
mulsd 0x2746f(%rip), %xmm0    # 0x10b908
callq 0x9710
movsd 0x24bca(%rip), %xmm1    # 0x109070
subsd %xmm0, %xmm1
mulsd 0x24bb6(%rip), %xmm1    # 0x109068
movapd %xmm1, %xmm0
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: set_holiday(int, int, int)
int set_holiday(int index, int m, int d)
{
int i;

   // search the holiday table for the specially calculated event
   // and set the month and day that it happens on in this year
//printf("set holiday: %d %d %d\n", index, m, d);
   for(i=0; i<MAX_HOLIDAYS; i++) {
      if(holiday[i].nth == index) {
         if(holiday[i].month) {  // do not enable a message that has been disabled
            holiday[i].month = m;
            holiday[i].day = d;
         }
         return i;
      }
   }
   return (-1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x86991(%rip), %rcx     # 0x16ae58
xorl %eax, %eax
cmpl %edi, -0x8(%rcx)
je 0xe44e4
incq %rax
addq $0x18, %rcx
cmpq $0x16e, %rax            # imm = 0x16E
jne 0xe44c9
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xe44ee
cmpl $0x0, (%rcx)
je 0xe44ee
movl %esi, (%rcx)
movl %edx, -0x4(%rcx)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: calendar_count()
int calendar_count()
{
int start;

   // see how many dates are in the greetings list
   start = 0;
   while(start < MAX_HOLIDAYS) {
      if((holiday[start].month == 0) && (holiday[start].day == 0) && (holiday[start].nth == 0)) break;
      ++start;
   }
   return start;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8695d(%rip), %rcx     # 0x16ae58
xorl %eax, %eax
cmpl $0x0, (%rcx)
jne 0xe450e
cmpl $0x0, -0x4(%rcx)
jne 0xe450e
cmpl $0x0, -0x8(%rcx)
je 0xe4522
incq %rax
addq $0x18, %rcx
cmpq $0x16e, %rax            # imm = 0x16E
jne 0xe44fd
movl $0x16e, %eax            # imm = 0x16E
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: clear_calendar()
void clear_calendar()
{
int start;

   // clear the greetings list
   start = 0;
   while(start < MAX_HOLIDAYS) {
      holiday[start].month = 0;
      holiday[start].day = 0;
      holiday[start].nth = 0;
      ++start;
   }
   calendar_entries = 0;
}

// Assembly:
movl $0x8, %eax
leaq 0x86920(%rip), %rcx     # 0x16ae50
movl $0x0, (%rax,%rcx)
movq $0x0, -0x8(%rax,%rcx)
addq $0x18, %rax
cmpq $0x2258, %rax           # imm = 0x2258
jne 0xe4530
pushq %rbp
movq %rsp, %rbp
leaq 0x134299(%rip), %rax    # 0x2187f0
movl $0x0, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: get_mayan_date()
void get_mayan_date()
{
long mayan;

   gregorian(0, jd_local);
   mayan = (long) (jdate(g_year,g_month,g_day)-jdate(1618,9,18));
   mayan = adjust_mayan(mayan);

   kin = (int) (mayan % 20L);  mayan /= 20L;
   uinal = (int) (mayan % 18L);  mayan /= 18L;
   tun = (int) (mayan % 20L);  mayan /= 20L;
   katun = (int) (mayan % 20L);  mayan /= 20L;
   baktun = (int) ((mayan % 20L)+12L);  mayan /= 20L;  // Baktun 12 started in 1618, 13 started in 2012
   pictun = (int) (mayan % 20L);  mayan /= 20L;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x228100(%rip), %rax    # 0x30d548
movsd (%rax), %xmm0
xorl %ebx, %ebx
xorl %edi, %edi
callq 0xd0c46
leaq 0x228248(%rip), %rax    # 0x30d6a4
movl (%rax), %edi
leaq 0x228237(%rip), %rax    # 0x30d69c
movl (%rax), %esi
leaq 0x228232(%rip), %rax    # 0x30d6a0
movl (%rax), %edx
callq 0xd4110
addsd 0x46703(%rip), %xmm0    # 0x12bb80
cvttsd2si %xmm0, %rcx
leaq 0x135faf(%rip), %rax    # 0x21b438
movq (%rax), %rax
movq %rcx, %rsi
subq %rax, %rsi
leaq 0x8ea5b(%rsi), %rdx
testq %rdx, %rdx
cmovgq %rdx, %rbx
addq %rbx, %rax
addq $-0x8ea5b, %rax         # imm = 0xFFF715A5
xorl %edi, %edi
subq %rcx, %rax
setne %dil
subq %rdi, %rax
movabsq $-0x45962422c53ec283, %r8 # imm = 0xBA69DBDD3AC13D7D
mulq %r8
shrq $0x15, %rdx
addq %rdi, %rdx
imulq $0x2bf200, %rdx, %rax   # imm = 0x2BF200
leaq (%rsi,%rax), %rcx
addq $0x8ea5b, %rcx          # imm = 0x8EA5B
movabsq $-0x3333333333333333, %rdx # imm = 0xCCCCCCCCCCCCCCCD
movq %rcx, %rax
mulq %rdx
movq %rdx, %rsi
shrq $0x4, %rsi
leal (,%rsi,4), %eax
leal (%rax,%rax,4), %eax
movq %rcx, %rdi
movl %ecx, %r9d
subl %eax, %r9d
movabsq $0xe38e38e38e38e39, %rdx # imm = 0xE38E38E38E38E39
movq %rsi, %rax
mulq %rdx
movl %r9d, 0x295f20(%rip)    # 0x37b43c
addl %edx, %edx
leal (%rdx,%rdx,8), %eax
subl %eax, %esi
movl %esi, 0x295f17(%rip)    # 0x37b440
movabsq $0x2d82d82d82d82d83, %rdx # imm = 0x2D82D82D82D82D83
movq %rcx, %rax
mulq %rdx
movq %rdx, %rsi
shrq $0x6, %rsi
movabsq $0xccccccccccccccd, %r9 # imm = 0xCCCCCCCCCCCCCCD
movq %rsi, %rax
mulq %r9
shll $0x2, %edx
leal (%rdx,%rdx,4), %eax
subl %eax, %esi
movl %esi, 0x295ee6(%rip)    # 0x37b444
shrq $0x5, %rdi
movabsq $0x91a2b3c4d5e6f81, %rdx # imm = 0x91A2B3C4D5E6F81
movq %rdi, %rax
mulq %rdx
movq %rdx, %rsi
shrq $0x3, %rsi
movq %rsi, %rax
mulq %r9
shll $0x2, %edx
leal (%rdx,%rdx,4), %eax
subl %eax, %esi
movabsq $0x3a4114b5225c6337, %rdx # imm = 0x3A4114B5225C6337
movq %rcx, %rax
mulq %rdx
movq %rdx, %rdi
shrq $0xf, %rdi
movq %rdi, %rax
mulq %r9
movl %esi, 0x295e9e(%rip)    # 0x37b448
shll $0x2, %edx
leal (%rdx,%rdx,4), %eax
subl %eax, %edi
addl $0xc, %edi
movl %edi, 0x295e91(%rip)    # 0x37b44c
movq %rcx, %rax
mulq %r8
movq %rdx, %rcx
shrq $0x15, %rcx
movq %rcx, %rax
mulq %r9
shll $0x2, %edx
leal (%rdx,%rdx,4), %eax
subl %eax, %ecx
movl %ecx, 0x295e74(%rip)    # 0x37b450
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: sun_position(double)
double sun_position(double jd)
{
double n,x,e,l,dl,v;
int i;
double ecc;

//  ecc = 0.016718;
    ecc = orbit_eccentricity(jd);
    jd -= 2444238.5;

    n = (360.0/SOLAR_YEAR) * jd;
    i = (int) (n / 360.0);
    n = n - 360.0 * (double) i;
    x = n - 3.762863;
    if(x < 0.0) x += 360.0;
    x *= DEG_TO_RAD;
    e = x;

    i = 0;
    do {  // solve Keppler's equation
        dl = e - (ecc*sin(e)) - x;
        e  = e - (dl / (1.0 - (ecc*cos(e))));
        if(++i > 10) break;
    } while (fabs(dl) >= SMALL_FLOAT);

    v = (360.0 / PI) * atan(1.01686011182*tan(e/2));
    l = v + 282.596403;
    i = (int) (l / 360.0);
    l = l - 360.0 * (double) i;
    return l;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x38, %rsp
movsd 0x45f2d(%rip), %xmm2    # 0x12b750
addsd %xmm0, %xmm2
divsd 0x460f9(%rip), %xmm2    # 0x12b928
movsd 0x460f9(%rip), %xmm1    # 0x12b930
mulsd %xmm2, %xmm1
addsd 0x460f5(%rip), %xmm1    # 0x12b938
movsd 0x460f5(%rip), %xmm3    # 0x12b940
mulsd %xmm2, %xmm3
mulsd %xmm2, %xmm3
addsd %xmm1, %xmm3
movsd 0x460e9(%rip), %xmm4    # 0x12b948
mulsd %xmm2, %xmm4
mulsd %xmm2, %xmm4
mulsd %xmm2, %xmm4
addsd %xmm3, %xmm4
movsd 0x460d9(%rip), %xmm1    # 0x12b950
mulsd %xmm2, %xmm1
mulsd %xmm2, %xmm1
mulsd %xmm2, %xmm1
mulsd %xmm2, %xmm1
addsd %xmm4, %xmm1
movsd 0x460c5(%rip), %xmm4    # 0x12b958
mulsd %xmm2, %xmm4
mulsd %xmm2, %xmm4
mulsd %xmm2, %xmm4
mulsd %xmm2, %xmm4
addsd 0x462dd(%rip), %xmm0    # 0x12bb88
mulsd %xmm2, %xmm4
mulsd 0x46149(%rip), %xmm0    # 0x12ba00
movsd 0x387d1(%rip), %xmm2    # 0x11e090
movapd %xmm0, %xmm3
divsd %xmm2, %xmm3
cvttpd2dq %xmm3, %xmm3
cvtdq2pd %xmm3, %xmm3
mulsd 0x46111(%rip), %xmm3    # 0x12b9e8
addsd %xmm0, %xmm3
addsd 0x462ad(%rip), %xmm3    # 0x12bb90
addsd %xmm3, %xmm2
xorpd %xmm0, %xmm0
movapd %xmm3, %xmm5
cmpltsd %xmm0, %xmm5
andpd %xmm5, %xmm2
andnpd %xmm3, %xmm5
orpd %xmm2, %xmm5
mulsd 0x26000(%rip), %xmm5    # 0x10b908
addsd %xmm1, %xmm4
xorpd 0x2388c(%rip), %xmm4    # 0x1091a0
movapd %xmm4, -0x20(%rbp)
movl $0xb, %ebx
movapd %xmm5, -0x30(%rbp)
movapd %xmm5, %xmm0
movsd %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
callq 0x9080
mulsd -0x20(%rbp), %xmm0
addsd -0x10(%rbp), %xmm0
subsd -0x30(%rbp), %xmm0
movapd %xmm0, -0x40(%rbp)
movsd -0x10(%rbp), %xmm0
callq 0x9710
movapd -0x40(%rbp), %xmm2
mulsd -0x20(%rbp), %xmm0
addsd 0x2370a(%rip), %xmm0    # 0x109070
movapd %xmm2, %xmm1
divsd %xmm0, %xmm1
movsd -0x10(%rbp), %xmm0
subsd %xmm1, %xmm0
decl %ebx
je 0xe598d
andpd 0x237fd(%rip), %xmm2    # 0x109180
ucomisd 0x387c5(%rip), %xmm2    # 0x11e150
jae 0xe5927
mulsd 0x236d3(%rip), %xmm0    # 0x109068
callq 0x91b0
mulsd 0x461f6(%rip), %xmm0    # 0x12bb98
callq 0x92d0
mulsd 0x46069(%rip), %xmm0    # 0x12ba18
addsd 0x461e9(%rip), %xmm0    # 0x12bba0
movapd %xmm0, %xmm1
divsd 0x386cd(%rip), %xmm1    # 0x11e090
cvttpd2dq %xmm1, %xmm1
cvtdq2pd %xmm1, %xmm1
mulsd 0x46015(%rip), %xmm1    # 0x12b9e8
addsd %xmm1, %xmm0
addq $0x38, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: moon_position(double, double)
double moon_position(double jd, double ls)
{
double ms,l,mm,n,ev,sms,ae,ec;
int i;

    jd -= 2444238.5;

    /* ls = sun_position(jd) */
    ms = 0.985647332099*jd - 3.762863;
    if(ms < 0) ms += 360.0;
    l = 13.176396*jd + 64.975464;
    i = (int) (l / 360.0);
    l = l - (360.0*(double) i);
    if(l < 0) l += 360.0;
    mm = l - 0.1114041*jd - 349.383063;
    i = (int) (mm / 360.0);
    mm -= 360.0 * (double) i;
    n = 151.950429 - 0.0529539*jd;
    i = (int) (n / 360.0);
    n -= 360.0 * (double) i;
    ev = 1.2739 * sin((2*(l-ls)-mm)*DEG_TO_RAD);
    sms = sin(ms*DEG_TO_RAD);
    ae = 0.1858 * sms;
    mm += ev - ae - 0.37*sms;
    ec = 6.2886 * sin(mm*DEG_TO_RAD);
    l += ev + ec - ae + 0.214*sin(2.0*mm*DEG_TO_RAD);
    l= 0.6583 * sin(2*(l-ls)*DEG_TO_RAD)+l;

    return l;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movsd %xmm1, -0x28(%rbp)
addsd 0x46195(%rip), %xmm0    # 0x12bb88
movsd 0x461ad(%rip), %xmm4    # 0x12bba8
mulsd %xmm0, %xmm4
addsd 0x46189(%rip), %xmm4    # 0x12bb90
movsd 0x38681(%rip), %xmm6    # 0x11e090
movapd %xmm4, %xmm2
addsd %xmm6, %xmm2
xorpd %xmm3, %xmm3
movapd %xmm4, %xmm5
cmpltsd %xmm3, %xmm5
andpd %xmm5, %xmm2
andnpd %xmm4, %xmm5
movapd %xmm5, %xmm7
movsd 0x46178(%rip), %xmm5    # 0x12bbb0
mulsd %xmm0, %xmm5
addsd 0x46174(%rip), %xmm5    # 0x12bbb8
movapd %xmm5, %xmm4
divsd %xmm6, %xmm4
cvttpd2dq %xmm4, %xmm4
orpd %xmm2, %xmm7
movapd %xmm7, -0x20(%rbp)
cvtdq2pd %xmm4, %xmm2
movsd 0x45f83(%rip), %xmm4    # 0x12b9e8
mulsd %xmm4, %xmm2
addsd %xmm5, %xmm2
movapd %xmm2, %xmm5
addsd %xmm6, %xmm5
movapd %xmm2, %xmm7
cmpltsd %xmm3, %xmm7
andpd %xmm7, %xmm5
andnpd %xmm2, %xmm7
orpd %xmm5, %xmm7
mulsd 0x4612e(%rip), %xmm0    # 0x12bbc0
addsd %xmm7, %xmm0
movapd %xmm7, -0x40(%rbp)
addsd 0x46125(%rip), %xmm0    # 0x12bbc8
movapd %xmm0, %xmm2
movapd %xmm0, %xmm3
divsd %xmm6, %xmm2
cvttpd2dq %xmm2, %xmm0
cvtdq2pd %xmm0, %xmm0
mulsd %xmm4, %xmm0
addsd %xmm0, %xmm3
movsd %xmm3, -0x10(%rbp)
movapd %xmm7, %xmm0
subsd %xmm1, %xmm0
addsd %xmm0, %xmm0
subsd %xmm3, %xmm0
mulsd 0x25e2c(%rip), %xmm0    # 0x10b908
callq 0x9080
mulsd 0x460e7(%rip), %xmm0    # 0x12bbd0
movsd %xmm0, -0x8(%rbp)
movapd -0x20(%rbp), %xmm0
mulsd 0x25e0d(%rip), %xmm0    # 0x10b908
callq 0x9080
movsd 0x460d0(%rip), %xmm2    # 0x12bbd8
mulsd %xmm0, %xmm2
movsd %xmm2, -0x20(%rbp)
movsd -0x8(%rbp), %xmm1
subsd %xmm2, %xmm1
mulsd 0x460be(%rip), %xmm0    # 0x12bbe0
addsd %xmm1, %xmm0
addsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x10(%rbp)
mulsd 0x25dd0(%rip), %xmm0    # 0x10b908
callq 0x9080
mulsd 0x460a3(%rip), %xmm0    # 0x12bbe8
addsd -0x8(%rbp), %xmm0
subsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x10(%rbp), %xmm0
addsd %xmm0, %xmm0
mulsd 0x25da3(%rip), %xmm0    # 0x10b908
callq 0x9080
mulsd 0x4607e(%rip), %xmm0    # 0x12bbf0
addsd -0x8(%rbp), %xmm0
addsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
subsd -0x28(%rbp), %xmm0
addsd %xmm0, %xmm0
mulsd 0x25d76(%rip), %xmm0    # 0x10b908
callq 0x9080
mulsd 0x46059(%rip), %xmm0    # 0x12bbf8
addsd -0x8(%rbp), %xmm0
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: xmoon_info(double)
double xmoon_info(double jd)
{
double jd_new, jd_next;

   ++sp_count;

   jd_new = new_moon(jd);
   jd_next = new_moon(jd+31.0);
   MoonSynod = (jd_next-jd_new);
   if(MoonSynod == 0.0) MoonSynod = synmonth;

   MoonAge = ((jd - jd_new) / MoonSynod) * 360.0; // in degrees
   MoonAge = fmod(MoonAge, 360.0);
   MoonPhase = (1.0 - cos(MoonAge*PI/180.0)) / 2.0;

   MoonAge = MoonSynod * (MoonAge / 360.0);  // in days

   lunation = (long) floor(((jd_new + 7.0) - lunatbase) / MoonSynod) + 1;
//sprintf(debug_text, "jd:%f  jd_new:%f  next:%f  synod:%f  age:%f  lunat:%d  phase:%f", 
//jd,jd_new, jd_next, MoonSynod, MoonAge, lunation, MoonPhase);
   return MoonPhase;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movsd %xmm0, -0x18(%rbp)
incl 0x2949f4(%rip)          # 0x37a5b4
callq 0xe5ccc
movsd %xmm0, -0x20(%rbp)
movsd 0x4602e(%rip), %xmm0    # 0x12bc00
addsd -0x18(%rbp), %xmm0
callq 0xe5ccc
movsd -0x20(%rbp), %xmm3
subsd %xmm3, %xmm0
xorpd %xmm1, %xmm1
cmpeqsd %xmm0, %xmm1
movsd 0x46012(%rip), %xmm2    # 0x12bc08
andpd %xmm1, %xmm2
andnpd %xmm0, %xmm1
orpd %xmm1, %xmm2
leaq 0x227c3f(%rip), %rbx    # 0x30d848
movlpd %xmm2, (%rbx)
movsd -0x18(%rbp), %xmm0
subsd %xmm3, %xmm0
divsd %xmm2, %xmm0
movsd 0x3846e(%rip), %xmm1    # 0x11e090
mulsd %xmm1, %xmm0
callq 0x94d0
leaq 0x227c06(%rip), %r14    # 0x30d838
movsd %xmm0, (%r14)
mulsd 0x25bd9(%rip), %xmm0    # 0x10b818
divsd 0x25bd9(%rip), %xmm0    # 0x10b820
callq 0x9710
movsd 0x2341c(%rip), %xmm1    # 0x109070
subsd %xmm0, %xmm1
mulsd 0x23408(%rip), %xmm1    # 0x109068
movsd %xmm1, -0x18(%rbp)
leaq 0x227bd4(%rip), %rax    # 0x30d840
movsd %xmm1, (%rax)
movsd (%rbx), %xmm0
movsd (%r14), %xmm1
divsd 0x3840f(%rip), %xmm1    # 0x11e090
mulsd %xmm0, %xmm1
movsd -0x20(%rbp), %xmm2
addsd 0x25c6e(%rip), %xmm2    # 0x10b900
movsd %xmm1, (%r14)
addsd 0x45f71(%rip), %xmm2    # 0x12bc10
divsd %xmm0, %xmm2
movapd %xmm2, %xmm0
callq 0x9680
cvttsd2si %xmm0, %rax
incq %rax
leaq 0x227bbd(%rip), %rcx    # 0x30d878
movq %rax, (%rcx)
movsd -0x18(%rbp), %xmm0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: FNrange(double)
double FNrange(double x)
{
double a, b;

    b = x / (PI+PI);
    a = (PI+PI) * (b - FNipart(b));
    if(a < 0) a = (PI+PI) + a;
    return a;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movsd 0x37a8e(%rip), %xmm1    # 0x11e0d8
divsd %xmm1, %xmm0
xorpd %xmm2, %xmm2
xorl %eax, %eax
ucomisd %xmm2, %xmm0
setae %al
movapd 0x22b1d(%rip), %xmm3    # 0x109180
andpd %xmm0, %xmm3
cvttpd2dq %xmm3, %xmm3
cvtdq2pd %xmm3, %xmm3
leaq 0x2681a(%rip), %rcx     # 0x10ce90
mulsd (%rcx,%rax,8), %xmm3
addsd %xmm0, %xmm3
mulsd %xmm1, %xmm3
addsd %xmm3, %xmm1
movapd %xmm3, %xmm0
cmpltsd %xmm2, %xmm0
andpd %xmm0, %xmm1
andnpd %xmm3, %xmm0
orpd %xmm1, %xmm0
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: FNatn2(double, double)
double FNatn2(double y, double x)
{
double a;

    a = atan(y/x);
    if(x < 0.0) a = a + PI;
    if((y < 0.0) && (x > 0.0)) a = a + PI + PI;
    return a;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movapd %xmm1, -0x10(%rbp)
movapd %xmm0, -0x20(%rbp)
divsd %xmm1, %xmm0
callq 0x92d0
movsd 0x25157(%rip), %xmm2    # 0x10b818
xorpd %xmm3, %xmm3
xorpd %xmm4, %xmm4
movapd -0x10(%rbp), %xmm5
cmpltsd %xmm5, %xmm4
cmpltsd %xmm3, %xmm5
movapd %xmm5, %xmm1
andnpd %xmm0, %xmm1
addsd %xmm2, %xmm0
andpd %xmm5, %xmm0
orpd %xmm1, %xmm0
movapd %xmm0, %xmm1
addsd %xmm2, %xmm1
addsd %xmm2, %xmm1
andpd %xmm4, %xmm1
andnpd %xmm0, %xmm4
orpd %xmm4, %xmm1
movapd -0x20(%rbp), %xmm2
cmpltsd %xmm3, %xmm2
andpd %xmm2, %xmm1
andnpd %xmm0, %xmm2
orpd %xmm2, %xmm1
movapd %xmm1, %xmm0
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: earth_radius(double, double)
double earth_radius(double lat, double alt)
{
double r1,r2,r3,r4;
double r;

   // return earth radius in km at latitude, alt (in meters)

   r1 = (EQU_RADIUS*EQU_RADIUS) * cos(lat);
   r2 = (POLE_RADIUS*POLE_RADIUS) * sin(lat);
   r3 = EQU_RADIUS * cos(lat);
   r4 = POLE_RADIUS * sin(lat);

   r = (r3*r3) + (r4*r4);
   if(r == 0.0) r = dEarthMeanRadius;
   else {
      r = ((r1*r1) + (r2*r2)) / r;
      if(r > 0.0) r = sqrt(r);
      else r = dEarthMeanRadius;
   }

   return r + (alt / 1000.0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movsd %xmm1, -0x28(%rbp)
movsd %xmm0, -0x8(%rbp)
callq 0x9710
movsd %xmm0, -0x18(%rbp)
movsd -0x8(%rbp), %xmm0
callq 0x9080
movsd %xmm0, -0x10(%rbp)
movsd -0x8(%rbp), %xmm0
callq 0x9710
mulsd 0x4472c(%rip), %xmm0    # 0x12bdc8
movsd %xmm0, -0x20(%rbp)
movsd -0x8(%rbp), %xmm0
callq 0x9080
movsd -0x20(%rbp), %xmm4
mulsd 0x44718(%rip), %xmm0    # 0x12bdd0
mulsd %xmm0, %xmm0
mulsd %xmm4, %xmm4
addsd %xmm0, %xmm4
movsd 0x4470c(%rip), %xmm0    # 0x12bdd8
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm4
jne 0xe76d8
jnp 0xe7724
movsd -0x10(%rbp), %xmm3
mulsd 0x446fb(%rip), %xmm3    # 0x12bde0
movsd -0x18(%rbp), %xmm2
mulsd 0x446f6(%rip), %xmm2    # 0x12bde8
mulsd %xmm3, %xmm3
mulsd %xmm2, %xmm2
addsd %xmm3, %xmm2
divsd %xmm4, %xmm2
ucomisd %xmm1, %xmm2
jbe 0xe7724
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm2
jb 0xe771b
xorps %xmm0, %xmm0
sqrtsd %xmm2, %xmm0
jmp 0xe7724
movapd %xmm2, %xmm0
callq 0x9270
movsd -0x28(%rbp), %xmm1
divsd 0x21907(%rip), %xmm1    # 0x109038
addsd %xmm0, %xmm1
movapd %xmm1, %xmm0
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: sun_peak(double, int)
double sun_peak(double jd, int do_moon)
{
double peak;
#define PEAK_THRESH1 (5.0*PI/180.0)  // prevents search instability near the equator
#define PEAK_THRESH2 (80.0*PI/180.0) // longitude/azimuth gets ambiguous near the poles 

   // used to find the "peak" solar position.  Near the equator and poles this is
   // the actual solar elevation angle.  Otherwise it is where the sun crosses
   // crosses 180.0 degrees azimuth (northern hemisphere) or 0 degrees (southern)

   peak = sun_posn(jd, do_moon);

   // looking for peak in sun elevation
   if(0 && do_moon) return peak;
   else if((lat > (0.0-PEAK_THRESH1)) && (lat < PEAK_THRESH1)) return peak;
   else if(lat > PEAK_THRESH2) return peak;
   else if(lat < (0.0-PEAK_THRESH2)) return peak;
// else return peak;  // always use sun elevation

   // look for sun azimuth nearest 180.0 (or 0.0 below the equator)
   peak = sun_az;
   if(lat < 0.0) peak = fmod(peak+180.0, 360.0);
   if(peak > 180.0) return 360.0-peak;
   else return peak;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0xe77bd
leaq 0x225881(%rip), %rax    # 0x30cfd0
movsd (%rax), %xmm1
movapd 0x21a25(%rip), %xmm2    # 0x109180
andpd %xmm1, %xmm2
movsd 0x44689(%rip), %xmm3    # 0x12bdf0
ucomisd %xmm2, %xmm3
ja 0xe77bb
ucomisd 0x44683(%rip), %xmm2    # 0x12bdf8
ja 0xe77bb
leaq 0x226052(%rip), %rax    # 0x30d7d0
movsd (%rax), %xmm0
xorpd %xmm2, %xmm2
ucomisd %xmm1, %xmm2
jbe 0xe77a1
addsd 0x2408c(%rip), %xmm0    # 0x10b820
movsd 0x368f4(%rip), %xmm1    # 0x11e090
callq 0x94d0
ucomisd 0x24077(%rip), %xmm0    # 0x10b820
jbe 0xe77bb
movsd 0x368dd(%rip), %xmm1    # 0x11e090
subsd %xmm0, %xmm1
movapd %xmm1, %xmm0
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: interp_solar_noon(double, double, int)
double interp_solar_noon(double start, double end, int do_moon)
{
double start_el, mid_el, end_el;
double mid;
double pct, delta;

// return (start+end) / 2.0;

   if((lat > (0.0-PEAK_THRESH1)) && (lat < PEAK_THRESH1)) return (start+end)/2.0;
   else if(lat > PEAK_THRESH2) return (start+end)/2.0; 
   else if(lat < (0.0-PEAK_THRESH2)) return (start+end)/2.0; 

   start_el = sun_peak(start, do_moon);
   end_el = 360.0 - sun_peak(end, do_moon);
   delta = end_el - start_el;
   if(delta == 0.0) return (start+end) / 2.0;

   pct = (180.0 - start_el) / delta;
   mid = start + (end-start) * pct;


if(0 && debug_file) {
   mid_el = sun_peak(mid, do_moon);
   fprintf(debug_file, "\ninterp noon: start:%f mid:%f end:%f\n", start,mid,end);
   fprintf(debug_file, "start_el:%f mid_el:%f end_el:%f  pct:%f\n", start_el,mid_el,end_el, pct);
   gregorian(0, mid+time_zone());
   fprintf(debug_file, "noon (utc): %02d:%02d:%02d %f  %04d/%02d/%02d  tz:%f\n\n", g_hours,g_minutes,g_seconds,g_frac, g_year,g_month,g_day, time_zone());
}
   return mid;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
leaq 0x2250b2(%rip), %rax    # 0x30cfd0
movsd (%rax), %xmm3
movapd 0x21256(%rip), %xmm4    # 0x109180
andpd %xmm3, %xmm4
movsd 0x43eba(%rip), %xmm2    # 0x12bdf0
ucomisd %xmm4, %xmm2
ja 0xe7f54
ucomisd 0x43eb4(%rip), %xmm3    # 0x12bdf8
ja 0xe7f54
movsd 0x3685a(%rip), %xmm2    # 0x11e7a8
ucomisd %xmm3, %xmm2
jbe 0xe7f67
addsd %xmm1, %xmm0
mulsd 0x21108(%rip), %xmm0    # 0x109068
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
movl %edi, %ebx
movsd %xmm0, -0x18(%rbp)
movsd %xmm1, -0x10(%rbp)
callq 0xe773f
movsd %xmm0, -0x20(%rbp)
movsd -0x10(%rbp), %xmm0
movl %ebx, %edi
callq 0xe773f
movsd -0x20(%rbp), %xmm3
movsd 0x360fa(%rip), %xmm1    # 0x11e090
subsd %xmm0, %xmm1
subsd %xmm3, %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0xe7fb6
jp 0xe7fb6
movsd -0x18(%rbp), %xmm0
addsd -0x10(%rbp), %xmm0
jmp 0xe7f58
movsd 0x23862(%rip), %xmm2    # 0x10b820
subsd %xmm3, %xmm2
divsd %xmm1, %xmm2
movsd -0x18(%rbp), %xmm1
movsd -0x10(%rbp), %xmm0
subsd %xmm1, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
jmp 0xe7f60