LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: jkingan[P]ladyheather/heathmsc.cpp
// Function: init_dsm(int)
void init_dsm(int year)
{
int month;

   // days to start of month (and days in month)
   dsm[0]  = 0;
   dsm[1]  = 0;         // Jan
   dsm[2]  = 0+31;      // Feb
   dsm[3]  = 0+31+28;   // March ...
   dsm[4]  = 0+31+28+31;
   dsm[5]  = 0+31+28+31+30;
   dsm[6]  = 0+31+28+31+30+31;
   dsm[7]  = 0+31+28+31+30+31+30;
   dsm[8]  = 0+31+28+31+30+31+30+31;
   dsm[9]  = 0+31+28+31+30+31+30+31+31;
   dsm[10] = 0+31+28+31+30+31+30+31+31+30;
   dsm[11] = 0+31+28+31+30+31+30+31+31+30+31;
   dsm[12] = 0+31+28+31+30+31+30+31+31+30+31+30;

   dim[2] = 28;

   if(leap_year(year)) {
      for(month=2; month<=12; month++) dsm[month] += 1;
      dim[2] += 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
leaq 0x23a1de(%rip), %rax    # 0x36cb20
movl $0x0, (%rax)
leaq 0x23a1d1(%rip), %rax    # 0x36cb20
movl $0x0, 0x4(%rax)
leaq 0x23a1c3(%rip), %rax    # 0x36cb20
movl $0x1f, 0x8(%rax)
leaq 0x23a1b5(%rip), %rax    # 0x36cb20
movl $0x3b, 0xc(%rax)
leaq 0x23a1a7(%rip), %rax    # 0x36cb20
movl $0x5a, 0x10(%rax)
leaq 0x23a199(%rip), %rax    # 0x36cb20
movl $0x78, 0x14(%rax)
leaq 0x23a18b(%rip), %rax    # 0x36cb20
movl $0x97, 0x18(%rax)
leaq 0x23a17d(%rip), %rax    # 0x36cb20
movl $0xb5, 0x1c(%rax)
leaq 0x23a16f(%rip), %rax    # 0x36cb20
movl $0xd4, 0x20(%rax)
leaq 0x23a161(%rip), %rax    # 0x36cb20
movl $0xf3, 0x24(%rax)
leaq 0x23a153(%rip), %rax    # 0x36cb20
movl $0x111, 0x28(%rax)      # imm = 0x111
leaq 0x23a145(%rip), %rax    # 0x36cb20
movl $0x130, 0x2c(%rax)      # imm = 0x130
leaq 0x23a137(%rip), %rax    # 0x36cb20
movl $0x14e, 0x30(%rax)      # imm = 0x14E
movl $0x1c, 0x96d0e(%rip)    # 0x1c9708
movl -0x4(%rbp), %edi
callq 0x1328d0
cmpl $0x0, %eax
je 0x132a49
movl $0x2, -0x8(%rbp)
cmpl $0xc, -0x8(%rbp)
jg 0x132a3a
movslq -0x8(%rbp), %rcx
leaq 0x23a101(%rip), %rax    # 0x36cb20
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
leaq 0x23a0f4(%rip), %rax    # 0x36cb20
movl %edx, (%rax,%rcx,4)
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x132a0e
movl 0x96cc8(%rip), %eax     # 0x1c9708
addl $0x1, %eax
movl %eax, 0x96cbf(%rip)     # 0x1c9708
addq $0x10, %rsp
popq %rbp
retq
nop
// File: jkingan[P]ladyheather/heathmsc.cpp
// Function: nth_dow_in(int, int, int, int)
int nth_dow_in(int nth, int dow, int month, int year)
{
int sundays;
int d;

   sundays = 0;
   month = fix_month(month);
   if(nth < 0) {  // nth day of week from end of month
      nth = 0 - nth;
      for(d=dim[month]; d>=1; d--) {
         if(day_of_week(d, month, year) == dow) {
            ++sundays;
            if(sundays == nth) return d;  // last sunday in month, etc
         }
      }
   }
   else { // nth day of week from start of month
      for(d=1; d<=dim[month]; d++) {
         if(day_of_week(d, month, year) == dow) {
            ++sundays;
            if(sundays == nth) return d;  // 2nd sunday in month, etc
         }
      }
   }
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x10(%rbp), %edi
callq 0x9c2e0
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x8(%rbp)
jge 0x132b6b
xorl %eax, %eax
subl -0x8(%rbp), %eax
movl %eax, -0x8(%rbp)
movslq -0x10(%rbp), %rcx
leaq 0x96be1(%rip), %rax     # 0x1c9700
movl (%rax,%rcx,4), %eax
movl %eax, -0x1c(%rbp)
cmpl $0x1, -0x1c(%rbp)
jl 0x132b69
movl -0x1c(%rbp), %edi
movl -0x10(%rbp), %esi
movl -0x14(%rbp), %edx
callq 0x132a50
movzbl %al, %eax
cmpl -0xc(%rbp), %eax
jne 0x132b5c
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x8(%rbp), %eax
jne 0x132b5a
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x132bcc
jmp 0x132b5c
jmp 0x132b5e
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x132b25
jmp 0x132bc5
movl $0x1, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movslq -0x10(%rbp), %rdx
leaq 0x96b80(%rip), %rcx     # 0x1c9700
cmpl (%rcx,%rdx,4), %eax
jg 0x132bc3
movl -0x1c(%rbp), %edi
movl -0x10(%rbp), %esi
movl -0x14(%rbp), %edx
callq 0x132a50
movzbl %al, %eax
cmpl -0xc(%rbp), %eax
jne 0x132bb6
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x8(%rbp), %eax
jne 0x132bb4
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x132bcc
jmp 0x132bb6
jmp 0x132bb8
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x132b72
jmp 0x132bc5
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heathmsc.cpp
// Function: sun_mean_anomaly(double)
double sun_mean_anomaly(double jd)
{
double T, T2, T3;

   // return mean anomaly of the sun in radians at time JD
   T = (jd - JD2000) / 36525.0;
   T2 = T * T;
   T3 = T * T2;

   return (357.52772 + 35999.05034*T - 0.0001603*T2 - (T3 / 300000.0)) * (PI/180.0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
movsd 0x5b792(%rip), %xmm1    # 0x18e388
subsd %xmm1, %xmm0
movsd 0x5b77e(%rip), %xmm1    # 0x18e380
divsd %xmm1, %xmm0
movsd %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
mulsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x10(%rbp), %xmm0
mulsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x10(%rbp), %xmm1
movsd 0x5b73a(%rip), %xmm0    # 0x18e370
mulsd %xmm0, %xmm1
movsd 0x5b736(%rip), %xmm0    # 0x18e378
addsd %xmm0, %xmm1
movsd -0x18(%rbp), %xmm0
movsd 0x5b715(%rip), %xmm2    # 0x18e368
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd -0x20(%rbp), %xmm1
movsd 0x5b6f8(%rip), %xmm2    # 0x18e360
divsd %xmm2, %xmm1
subsd %xmm1, %xmm0
movsd 0x3ea18(%rip), %xmm1    # 0x171690
mulsd %xmm1, %xmm0
popq %rbp
retq
nop
// File: 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
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
callq 0x148550
leaq 0x238751(%rip), %rax    # 0x36c728
movsd (%rax), %xmm0
movl $0x1, %edi
callq 0x13f470
leaq 0x238714(%rip), %rax    # 0x36c700
movl (%rax), %edi
callq 0x1482e0
leaq 0x238706(%rip), %rax    # 0x36c700
movl (%rax), %edi
callq 0x1472e0
leaq 0x2386f8(%rip), %rax    # 0x36c700
movl (%rax), %edi
callq 0x147b40
leaq 0x2386ea(%rip), %rax    # 0x36c700
movl (%rax), %edi
callq 0x147d60
leaq 0x2386dc(%rip), %rax    # 0x36c700
movl (%rax), %edi
callq 0x147f90
leaq 0x2386ce(%rip), %rax    # 0x36c700
movl (%rax), %edi
callq 0x147c60
callq 0x139020
callq 0x138490
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: 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 0x238a19(%rip), %rax    # 0x36ca74
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x13406c
movl $0x1, -0x4(%rbp)
jmp 0x1340e8
cmpl $0x0, 0x2a5bf5(%rip)    # 0x3d9c68
jne 0x13407e
movl $0x2, -0x4(%rbp)
jmp 0x1340e8
cmpl $0x0, 0x2a5be7(%rip)    # 0x3d9c6c
jne 0x134090
movl $0x3, -0x4(%rbp)
jmp 0x1340e8
cmpl $0x0, 0x2a5bd9(%rip)    # 0x3d9c70
jne 0x1340a2
movl $0x4, -0x4(%rbp)
jmp 0x1340e8
cmpl $0x0, 0x2a5bcb(%rip)    # 0x3d9c74
jne 0x1340b4
movl $0x5, -0x4(%rbp)
jmp 0x1340e8
leaq 0x238a4b(%rip), %rax    # 0x36cb06
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x1340cc
movl $0x6, -0x4(%rbp)
jmp 0x1340e8
leaq 0x2389a9(%rip), %rax    # 0x36ca7c
cmpl $0x0, (%rax)
jne 0x1340e1
movl $0x7, -0x4(%rbp)
jmp 0x1340e8
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: 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 $0x20, %rsp
movsd %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
xorl %edi, %edi
callq 0x11dd00
leaq 0x238774(%rip), %rax    # 0x36c884
cmpl $0x7e0, (%rax)          # imm = 0x7E0
jge 0x134159
movsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
leaq 0x23875b(%rip), %rax    # 0x36c884
movl (%rax), %edi
movl $0x1, %edx
movl %edx, %esi
callq 0x122140
movaps %xmm0, %xmm1
movsd -0x18(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd 0x5a3dd(%rip), %xmm1    # 0x18e528
subsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x1341ef
leaq 0x238724(%rip), %rax    # 0x36c884
cmpl $0x834, (%rax)          # imm = 0x834
jle 0x1341a6
movsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
leaq 0x23870b(%rip), %rax    # 0x36c884
movl (%rax), %edi
movl $0x1, %edx
movl %edx, %esi
callq 0x122140
movaps %xmm0, %xmm1
movsd -0x20(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd 0x5a38d(%rip), %xmm1    # 0x18e528
subsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x1341ef
jmp 0x1341a8
movsd -0x10(%rbp), %xmm0
leaq 0x2386d0(%rip), %rax    # 0x36c884
movl (%rax), %eax
subl $0x7e0, %eax            # imm = 0x7E0
movslq %eax, %rcx
leaq 0x956ab(%rip), %rax     # 0x1c9870
subsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
movsd 0x5a344(%rip), %xmm1    # 0x18e520
subsd %xmm1, %xmm0
movsd %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: 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
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
movsd 0x5a172(%rip), %xmm1    # 0x18e388
subsd %xmm1, %xmm0
movsd 0x5a33e(%rip), %xmm1    # 0x18e560
divsd %xmm1, %xmm0
movsd %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
movsd 0x5a318(%rip), %xmm1    # 0x18e550
mulsd %xmm1, %xmm0
movsd 0x5a314(%rip), %xmm1    # 0x18e558
addsd %xmm1, %xmm0
movsd 0x5a2f8(%rip), %xmm1    # 0x18e548
mulsd -0x10(%rbp), %xmm1
movsd -0x10(%rbp), %xmm2
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0x5a2bf(%rip), %xmm0    # 0x18e540
mulsd -0x10(%rbp), %xmm0
mulsd -0x10(%rbp), %xmm0
movsd -0x10(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd 0x5a298(%rip), %xmm1    # 0x18e538
mulsd -0x10(%rbp), %xmm1
mulsd -0x10(%rbp), %xmm1
mulsd -0x10(%rbp), %xmm1
movsd -0x10(%rbp), %xmm2
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0x5a255(%rip), %xmm0    # 0x18e530
mulsd -0x10(%rbp), %xmm0
mulsd -0x10(%rbp), %xmm0
mulsd -0x10(%rbp), %xmm0
mulsd -0x10(%rbp), %xmm0
movsd -0x10(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
popq %rbp
retq
nopl (%rax,%rax)
// File: jkingan[P]ladyheather/heathmsc.cpp
// Function: solar_year(double)
double solar_year(double jd)
{
double t;

   // more precise calculation of length of solar year
// return SOLAR_YEAR;
   t = (JD2000);
   t = jd - t;
   t /= 36525.0;
   t = 365.2421896698 - (6.15359E-6*t) - (7.29E-10*t*t) - (2.64E-10*t*t*t);
   if(t == 0.0) return SOLAR_YEAR;
   return t;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movsd %xmm0, -0x10(%rbp)
movsd 0x5a067(%rip), %xmm0    # 0x18e388
movsd %xmm0, -0x18(%rbp)
movsd -0x10(%rbp), %xmm0
subsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
movsd 0x5a03e(%rip), %xmm1    # 0x18e380
divsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
movsd 0x5a220(%rip), %xmm1    # 0x18e578
mulsd %xmm1, %xmm0
movsd 0x5a21c(%rip), %xmm1    # 0x18e580
addsd %xmm1, %xmm0
movsd 0x5a200(%rip), %xmm1    # 0x18e570
mulsd -0x18(%rbp), %xmm1
movsd -0x18(%rbp), %xmm2
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0x5a1c7(%rip), %xmm0    # 0x18e568
mulsd -0x18(%rbp), %xmm0
mulsd -0x18(%rbp), %xmm0
movsd -0x18(%rbp), %xmm2
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x1343f3
jp 0x1343f3
movsd 0x5a19c(%rip), %xmm0    # 0x18e588
movsd %xmm0, -0x8(%rbp)
jmp 0x1343fd
movsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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 $0x30, %rsp
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
movsd -0x8(%rbp), %xmm2
movq %xmm2, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm2
movsd 0x5a175(%rip), %xmm3    # 0x18e5c0
mulsd %xmm3, %xmm2
movsd 0x5a171(%rip), %xmm3    # 0x18e5c8
addsd %xmm3, %xmm2
mulsd %xmm2, %xmm1
movsd 0x5a151(%rip), %xmm2    # 0x18e5b8
addsd %xmm2, %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm1, %xmm0
movsd 0x5a122(%rip), %xmm1    # 0x18e5b0
addsd %xmm1, %xmm0
movsd %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
movsd 0x3ab74(%rip), %xmm1    # 0x16f018
divsd %xmm1, %xmm0
movsd 0x59f00(%rip), %xmm1    # 0x18e3b0
addsd %xmm0, %xmm1
movsd 0x3ab5c(%rip), %xmm0    # 0x16f018
divsd %xmm0, %xmm1
movsd 0x5a0e0(%rip), %xmm0    # 0x18e5a8
addsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x8(%rbp), %xmm0
movsd 0x5a0ba(%rip), %xmm1    # 0x18e598
mulsd %xmm1, %xmm0
movsd 0x5a0b6(%rip), %xmm1    # 0x18e5a0
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movsd 0x3d0c3(%rip), %xmm0    # 0x1715c8
mulsd -0x20(%rbp), %xmm0
movsd 0x3ab66(%rip), %xmm1    # 0x16f078
divsd %xmm1, %xmm0
callq 0x96f0
movsd -0x28(%rbp), %xmm1
movsd 0x5a068(%rip), %xmm2    # 0x18e590
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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 $0x20, %rsp
movsd %xmm0, -0x8(%rbp)
movl %edi, -0xc(%rbp)
leaq 0x236f91(%rip), %rax    # 0x36c1b8
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x135275
leaq 0x236f7d(%rip), %rax    # 0x36c1b8
movsd (%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x39f22(%rip), %xmm1    # 0x16f180
mulsd %xmm1, %xmm0
movsd 0x4d8c6(%rip), %xmm1    # 0x182b30
addsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
jmp 0x1352af
leaq 0x236f3c(%rip), %rax    # 0x36c1b8
movsd (%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0x39ee1(%rip), %xmm1    # 0x16f180
mulsd %xmm1, %xmm0
xorps %xmm1, %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd 0x39d81(%rip), %xmm0    # 0x16f038
mulsd -0x18(%rbp), %xmm0
movsd 0x4d86c(%rip), %xmm1    # 0x182b30
divsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x8(%rbp), %xmm0
movl -0xc(%rbp), %edi
callq 0x134fd0
subsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
xorps %xmm0, %xmm0
ucomisd -0x18(%rbp), %xmm0
jbe 0x135302
movsd 0x39d42(%rip), %xmm0    # 0x16f038
addsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
jmp 0x1352e4
jmp 0x135304
movsd -0x18(%rbp), %xmm0
movsd 0x39d27(%rip), %xmm1    # 0x16f038
ucomisd %xmm1, %xmm0
jb 0x13532f
movsd -0x18(%rbp), %xmm0
movsd 0x39d14(%rip), %xmm1    # 0x16f038
subsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
jmp 0x135304
movsd -0x18(%rbp), %xmm0
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: 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 $0x30, %rsp
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
movsd 0x58ede(%rip), %xmm1    # 0x18e388
subsd %xmm1, %xmm0
movsd 0x59222(%rip), %xmm1    # 0x18e6d8
mulsd %xmm1, %xmm0
movsd 0x5921e(%rip), %xmm1    # 0x18e6e0
addsd %xmm1, %xmm0
movsd 0x3c0fa(%rip), %xmm1    # 0x1715c8
mulsd %xmm1, %xmm0
movsd 0x39b9e(%rip), %xmm1    # 0x16f078
divsd %xmm1, %xmm0
movsd %xmm0, -0x10(%rbp)
movsd -0x8(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x10(%rbp), %xmm0
callq 0x9080
movsd %xmm0, -0x28(%rbp)
movsd 0x39c4c(%rip), %xmm0    # 0x16f150
mulsd -0x10(%rbp), %xmm0
callq 0x9080
movsd -0x28(%rbp), %xmm1
movaps %xmm0, %xmm3
movsd -0x20(%rbp), %xmm0
movsd 0x591ad(%rip), %xmm2    # 0x18e6d0
mulsd %xmm3, %xmm2
movsd 0x59199(%rip), %xmm3    # 0x18e6c8
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
movsd 0x39ac9(%rip), %xmm2    # 0x16f008
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
movsd 0x59167(%rip), %xmm1    # 0x18e6c0
subsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
movsd 0x59179(%rip), %xmm1    # 0x18e6e8
divsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd 0x59140(%rip), %xmm0    # 0x18e6c0
addsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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
subq $0x10, %rsp
leaq 0x144649(%rip), %rax    # 0x27a5f8
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x135fde
leaq 0x23676a(%rip), %rax    # 0x36c728
movsd (%rax), %xmm0
xorl %edi, %edi
callq 0x11dd00
leaq 0x236758(%rip), %rax    # 0x36c728
movsd (%rax), %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x1360b9
leaq 0x23670f(%rip), %rax    # 0x36c6f4
movl (%rax), %ecx
leaq 0x236896(%rip), %rax    # 0x36c884
movl %ecx, (%rax)
leaq 0x2366f9(%rip), %rax    # 0x36c6f0
movl (%rax), %ecx
leaq 0x23687c(%rip), %rax    # 0x36c87c
movl %ecx, (%rax)
leaq 0x2366e3(%rip), %rax    # 0x36c6ec
movl (%rax), %ecx
leaq 0x23686e(%rip), %rax    # 0x36c880
movl %ecx, (%rax)
leaq 0x2366cd(%rip), %rax    # 0x36c6e8
movl (%rax), %ecx
leaq 0x236864(%rip), %rax    # 0x36c888
movl %ecx, (%rax)
leaq 0x2366b7(%rip), %rax    # 0x36c6e4
movl (%rax), %ecx
leaq 0x236856(%rip), %rax    # 0x36c88c
movl %ecx, (%rax)
leaq 0x2366a1(%rip), %rax    # 0x36c6e0
movl (%rax), %ecx
leaq 0x236848(%rip), %rax    # 0x36c890
movl %ecx, (%rax)
leaq 0x2366a7(%rip), %rax    # 0x36c6f8
movsd (%rax), %xmm0
leaq 0x23683c(%rip), %rax    # 0x36c898
movsd %xmm0, (%rax)
leaq 0x23681d(%rip), %rax    # 0x36c884
movl (%rax), %edi
leaq 0x23680c(%rip), %rax    # 0x36c87c
movl (%rax), %esi
leaq 0x236807(%rip), %rax    # 0x36c880
movl (%rax), %edx
callq 0x122140
movsd %xmm0, -0x10(%rbp)
leaq 0x2367fc(%rip), %rax    # 0x36c888
movl (%rax), %edi
leaq 0x2367f7(%rip), %rax    # 0x36c88c
movl (%rax), %esi
leaq 0x2367f2(%rip), %rax    # 0x36c890
movl (%rax), %edx
xorps %xmm0, %xmm0
callq 0x122210
movaps %xmm0, %xmm1
movsd -0x10(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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 0x237051(%rip), %rax    # 0x36d12c
cmpl $0x0, (%rax)
je 0x136117
movl $0xfa, %edi
callq 0xb8b0
leaq 0x2373cf(%rip), %rax    # 0x36d4c0
cmpl $0x0, 0x157c0(%rax)
jle 0x136115
movl $0xa, %edi
movl $0x1, %esi
callq 0xb660
movl $0xa, %edi
xorl %esi, %esi
callq 0xb700
jmp 0x136117
popq %rbp
retq
nopl (%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
leaq 0x237001(%rip), %rax    # 0x36d12c
cmpl $0x0, (%rax)
je 0x13615d
leaq 0x237389(%rip), %rax    # 0x36d4c0
cmpl $0x0, 0x157c0(%rax)
jle 0x13615b
movl $0xa, %edi
xorl %esi, %esi
callq 0xb660
movl $0xa, %edi
movl $0x1, %esi
callq 0xb700
jmp 0x13615d
popq %rbp
retq
nop
// File: 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
subq $0x10, %rsp
leaq 0x235f01(%rip), %rax    # 0x36c710
movsd (%rax), %xmm0
xorl %edi, %edi
callq 0x11dd00
leaq 0x236067(%rip), %rax    # 0x36c888
cmpl $0x0, (%rax)
jne 0x13684b
leaq 0x23605f(%rip), %rax    # 0x36c88c
cmpl $0x0, (%rax)
jne 0x13684b
leaq 0x236057(%rip), %rax    # 0x36c890
cmpl $0x10, (%rax)
jne 0x13684b
leaq 0x235e87(%rip), %rax    # 0x36c6cc
movl $0x1, (%rax)
leaq 0x235e7a(%rip), %rax    # 0x36c6cc
cmpl $0x0, (%rax)
je 0x136900
leaq 0x235e66(%rip), %rax    # 0x36c6c8
cmpl $0x1, (%rax)
je 0x136900
leaq 0x43cb0(%rip), %rdi     # 0x17a522
leaq 0x4d794(%rip), %rsi     # 0x18400d
callq 0x9b20
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x1368f3
movq -0x8(%rbp), %rdx
leaq 0x264b6c(%rip), %rdi    # 0x39b400
movl $0x200, %esi            # imm = 0x200
callq 0x95e0
cmpq $0x0, %rax
je 0x1368ea
leaq 0x264b55(%rip), %rdi    # 0x39b400
callq 0x9480
leaq 0x235e19(%rip), %rax    # 0x36c6d0
movsd %xmm0, (%rax)
leaq 0x235e0e(%rip), %rax    # 0x36c6d0
movsd (%rax), %xmm0
movsd 0x3873a(%rip), %xmm1    # 0x16f008
divsd %xmm1, %xmm0
leaq 0x235df7(%rip), %rax    # 0x36c6d0
movsd %xmm0, (%rax)
leaq 0x235de4(%rip), %rax    # 0x36c6c8
movl $0x2, (%rax)
movq -0x8(%rbp), %rdi
callq 0x9380
leaq 0x235dd2(%rip), %rax    # 0x36c6cc
movl $0x0, (%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x136b83
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x136ccd
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x136b9c
movq $0x0, -0x8(%rbp)
jmp 0x136ccd
movl $0x0, -0x18(%rbp)
leaq 0x235f56(%rip), %rax    # 0x36cb00
movb $0x0, (%rax)
movl $0x0, -0x1c(%rbp)
cmpl $0x14, -0x1c(%rbp)
jge 0x136ca3
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x18(%rbp)
cmpl $0x2f, -0x18(%rbp)
jne 0x136bd3
jmp 0x136ca3
cmpl $0x2d, -0x18(%rbp)
jne 0x136bde
jmp 0x136ca3
cmpl $0x2b, -0x18(%rbp)
jne 0x136be9
jmp 0x136ca3
cmpl $0x0, -0x14(%rbp)
je 0x136c01
movl -0x18(%rbp), %edi
callq 0x9330
cmpl $0x0, %eax
je 0x136c01
jmp 0x136ca3
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
cmpl $0x20, -0x18(%rbp)
jne 0x136c15
jmp 0x136bb4
cmpl $0x9, -0x18(%rbp)
jne 0x136c1d
jmp 0x136bb4
movl -0x18(%rbp), %edi
callq 0x96e0
movb %al, %dl
movl -0x1c(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x1c(%rbp)
movslq %eax, %rcx
leaq 0x235ec4(%rip), %rax    # 0x36cb00
movb %dl, (%rax,%rcx)
movslq -0x1c(%rbp), %rcx
leaq 0x235eb6(%rip), %rax    # 0x36cb00
movb $0x0, (%rax,%rcx)
cmpl $0x5, -0x1c(%rbp)
jl 0x136c56
jmp 0x136ca3
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x136c6c
movq $0x0, -0x10(%rbp)
jmp 0x136ca3
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xd, %eax
jne 0x136c82
movq $0x0, -0x10(%rbp)
jmp 0x136ca3
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xa, %eax
jne 0x136c98
movq $0x0, -0x10(%rbp)
jmp 0x136ca3
jmp 0x136c9a
jmp 0x136c9c
jmp 0x136c9e
jmp 0x136bb4
leaq 0x235e56(%rip), %rax    # 0x36cb00
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x136cc5
leaq 0x235e47(%rip), %rdi    # 0x36cb00
leaq 0x235e4c(%rip), %rsi    # 0x36cb0c
callq 0x9350
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: jkingan[P]ladyheather/heathmsc.cpp
// Function: ships_bells()
int ships_bells()
{
int hh;
   
   // ships bells (simplified, no dog watch)

   hh = (g_hours % 4) * 2;
   if(g_minutes == 0) return hh;
   else if(g_minutes == 30) return hh+1;
   else return (-1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x23515d(%rip), %rax    # 0x36c888
movl (%rax), %eax
movl $0x4, %ecx
cltd
idivl %ecx
shll %edx
movl %edx, -0x8(%rbp)
leaq 0x23514b(%rip), %rax    # 0x36c88c
cmpl $0x0, (%rax)
jne 0x13774e
movl -0x8(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x13776c
leaq 0x235137(%rip), %rax    # 0x36c88c
cmpl $0x1e, (%rax)
jne 0x137765
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x13776c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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 $0x20, %rsp
movsd %xmm0, -0x8(%rbp)
movl 0x2a09e1(%rip), %eax    # 0x3d97f4
addl $0x1, %eax
movl %eax, 0x2a09d8(%rip)    # 0x3d97f4
movsd -0x8(%rbp), %xmm0
callq 0x139f10
movsd %xmm0, -0x10(%rbp)
movsd -0x8(%rbp), %xmm0
movsd -0x10(%rbp), %xmm1
callq 0x13a170
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
subsd -0x10(%rbp), %xmm0
movsd 0x3883f(%rip), %xmm1    # 0x171690
mulsd %xmm1, %xmm0
callq 0x96f0
movaps %xmm0, %xmm1
movsd 0x36203(%rip), %xmm0    # 0x16f068
subsd %xmm1, %xmm0
movsd 0x362df(%rip), %xmm1    # 0x16f150
divsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
cmpl $0x16e, -0x14(%rbp)     # imm = 0x16E
jge 0x138f23
movslq -0x14(%rbp), %rcx
leaq 0x90fa8(%rip), %rax     # 0x1c9e60
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
cmpl -0x8(%rbp), %eax
jne 0x138f16
movslq -0x14(%rbp), %rcx
leaq 0x90f8f(%rip), %rax     # 0x1c9e60
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x8(%rax)
je 0x138f0e
movl -0xc(%rbp), %ecx
movslq -0x14(%rbp), %rdx
leaq 0x90f74(%rip), %rax     # 0x1c9e60
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movl -0x10(%rbp), %ecx
movslq -0x14(%rbp), %rdx
leaq 0x90f5c(%rip), %rax     # 0x1c9e60
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x138f2a
jmp 0x138f18
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x138ea4
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
popq %rbp
retq
nop
// File: 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
movl $0x0, -0x4(%rbp)
cmpl $0x16e, -0x4(%rbp)      # imm = 0x16E
jge 0x138f98
movslq -0x4(%rbp), %rcx
leaq 0x90f11(%rip), %rax     # 0x1c9e60
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x8(%rax)
jne 0x138f8d
movslq -0x4(%rbp), %rcx
leaq 0x90ef9(%rip), %rax     # 0x1c9e60
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x4(%rax)
jne 0x138f8d
movslq -0x4(%rbp), %rcx
leaq 0x90ee1(%rip), %rax     # 0x1c9e60
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, (%rax)
jne 0x138f8d
jmp 0x138f98
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x138f3b
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: 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:
pushq %rbp
movq %rsp, %rbp
movl $0x0, -0x4(%rbp)
cmpl $0x16e, -0x4(%rbp)      # imm = 0x16E
jge 0x139009
movslq -0x4(%rbp), %rcx
leaq 0x90ea1(%rip), %rax     # 0x1c9e60
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x8(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x90e88(%rip), %rax     # 0x1c9e60
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x4(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x90e6f(%rip), %rax     # 0x1c9e60
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl $0x0, (%rax)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x138fab
leaq 0x13e9c0(%rip), %rax    # 0x2779d0
movl $0x0, (%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: 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
subq $0x10, %rsp
leaq 0x232bf9(%rip), %rax    # 0x36c728
movsd (%rax), %xmm0
xorl %edi, %edi
callq 0x11dd00
leaq 0x232d43(%rip), %rax    # 0x36c884
movl (%rax), %edi
leaq 0x232d32(%rip), %rax    # 0x36c87c
movl (%rax), %esi
leaq 0x232d2d(%rip), %rax    # 0x36c880
movl (%rax), %edx
callq 0x122140
movsd %xmm0, -0x10(%rbp)
movl $0x652, %edi            # imm = 0x652
movl $0x9, %esi
movl $0x12, %edx
callq 0x122140
movaps %xmm0, %xmm1
movsd -0x10(%rbp), %xmm0
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x139ae0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl $0x14, %ecx
cqto
idivq %rcx
movl %edx, %eax
movl %eax, 0x2a0af1(%rip)    # 0x3da69c
movq -0x8(%rbp), %rax
movl $0x14, %ecx
cqto
idivq %rcx
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl $0x12, %ecx
cqto
idivq %rcx
movl %edx, %eax
movl %eax, 0x2a0acd(%rip)    # 0x3da6a0
movq -0x8(%rbp), %rax
movl $0x12, %ecx
cqto
idivq %rcx
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl $0x14, %ecx
cqto
idivq %rcx
movl %edx, %eax
movl %eax, 0x2a0aa9(%rip)    # 0x3da6a4
movq -0x8(%rbp), %rax
movl $0x14, %ecx
cqto
idivq %rcx
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl $0x14, %ecx
cqto
idivq %rcx
movl %edx, %eax
movl %eax, 0x2a0a85(%rip)    # 0x3da6a8
movq -0x8(%rbp), %rax
movl $0x14, %ecx
cqto
idivq %rcx
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl $0x14, %ecx
cqto
idivq %rcx
addq $0xc, %rdx
movl %edx, %eax
movl %eax, 0x2a0a5d(%rip)    # 0x3da6ac
movq -0x8(%rbp), %rax
movl $0x14, %ecx
cqto
idivq %rcx
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl $0x14, %ecx
cqto
idivq %rcx
movl %edx, %eax
movl %eax, 0x2a0a39(%rip)    # 0x3da6b0
movq -0x8(%rbp), %rax
movl $0x14, %ecx
cqto
idivq %rcx
movq %rax, -0x8(%rbp)
addq $0x10, %rsp
popq %rbp
retq
nop
// File: 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
subq $0x20, %rsp
movsd %xmm0, -0x8(%rbp)
movl 0x29f371(%rip), %eax    # 0x3d97f4
addl $0x1, %eax
movl %eax, 0x29f368(%rip)    # 0x3d97f4
movsd -0x8(%rbp), %xmm0
callq 0x13a610
movsd %xmm0, -0x10(%rbp)
movsd 0x54325(%rip), %xmm0    # 0x18e7c8
addsd -0x8(%rbp), %xmm0
callq 0x13a610
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
subsd -0x10(%rbp), %xmm0
leaq 0x232565(%rip), %rax    # 0x36ca28
movsd %xmm0, (%rax)
leaq 0x23255a(%rip), %rax    # 0x36ca28
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x13a4f0
jp 0x13a4f0
leaq 0x232544(%rip), %rax    # 0x36ca28
movsd 0x542e4(%rip), %xmm0    # 0x18e7d0
movsd %xmm0, (%rax)
movsd -0x8(%rbp), %xmm0
subsd -0x10(%rbp), %xmm0
leaq 0x232527(%rip), %rax    # 0x36ca28
divsd (%rax), %xmm0
movsd 0x48623(%rip), %xmm1    # 0x182b30
mulsd %xmm1, %xmm0
leaq 0x232500(%rip), %rax    # 0x36ca18
movsd %xmm0, (%rax)
leaq 0x2324f5(%rip), %rax    # 0x36ca18
movsd (%rax), %xmm0
movsd 0x48601(%rip), %xmm1    # 0x182b30
callq 0x94d0
leaq 0x2324dd(%rip), %rax    # 0x36ca18
movsd %xmm0, (%rax)
movsd 0x37081(%rip), %xmm0    # 0x1715c8
leaq 0x2324ca(%rip), %rax    # 0x36ca18
mulsd (%rax), %xmm0
movsd 0x34b1e(%rip), %xmm1    # 0x16f078
divsd %xmm1, %xmm0
callq 0x96f0
movaps %xmm0, %xmm1
movsd 0x34afa(%rip), %xmm0    # 0x16f068
subsd %xmm1, %xmm0
movsd 0x34bd6(%rip), %xmm1    # 0x16f150
divsd %xmm1, %xmm0
leaq 0x23249b(%rip), %rax    # 0x36ca20
movsd %xmm0, (%rax)
leaq 0x232498(%rip), %rax    # 0x36ca28
movsd (%rax), %xmm0
leaq 0x23247d(%rip), %rax    # 0x36ca18
movsd (%rax), %xmm1
movsd 0x48589(%rip), %xmm2    # 0x182b30
divsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
leaq 0x232462(%rip), %rax    # 0x36ca18
movsd %xmm0, (%rax)
movsd 0x370c6(%rip), %xmm0    # 0x171688
addsd -0x10(%rbp), %xmm0
movsd 0x54209(%rip), %xmm1    # 0x18e7d8
subsd %xmm1, %xmm0
leaq 0x23244e(%rip), %rax    # 0x36ca28
divsd (%rax), %xmm0
callq 0x9660
cvttsd2si %xmm0, %rcx
addq $0x1, %rcx
leaq 0x232465(%rip), %rax    # 0x36ca58
movq %rcx, (%rax)
leaq 0x232423(%rip), %rax    # 0x36ca20
movsd (%rax), %xmm0
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: jkingan[P]ladyheather/heathmsc.cpp
// Function: kepler(double, double)
static double kepler(double m, double ecc)
{
int i;
double e, delta;
#define KEP_EPSILON 1E-12

    e = m = torad(m);
    i = 0;
    do {
        delta = e - ecc * sin(e) - m;
        e -= delta / (1.0 - ecc * cos(e));
        if(++i > 10) break;
    } while (abs(delta) > KEP_EPSILON);
    return e;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movsd %xmm0, -0x8(%rbp)
movsd %xmm1, -0x10(%rbp)
movsd 0x363c6(%rip), %xmm0    # 0x171690
mulsd -0x8(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
movsd %xmm0, -0x20(%rbp)
movl $0x0, -0x14(%rbp)
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x20(%rbp), %xmm0
callq 0x9080
movsd -0x48(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0x40(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
subsd -0x8(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x20(%rbp), %xmm0
callq 0x96f0
movsd -0x38(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0x30(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
movsd 0x33ce6(%rip), %xmm2    # 0x16f068
addsd %xmm2, %xmm0
divsd %xmm0, %xmm1
movsd -0x20(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
cmpl $0xa, %eax
jle 0x13b3a8
jmp 0x13b3f8
jmp 0x13b3aa
xorps %xmm0, %xmm0
ucomisd -0x28(%rbp), %xmm0
jbe 0x13b3d7
movsd -0x28(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x50(%rbp)
jmp 0x13b3e1
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd -0x50(%rbp), %xmm0
movsd 0x4780a(%rip), %xmm1    # 0x182bf8
ucomisd %xmm1, %xmm0
ja 0x13b2e0
movsd -0x20(%rbp), %xmm0
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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
subq $0x20, %rsp
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
movsd 0x476ce(%rip), %xmm1    # 0x182b58
divsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x18(%rbp), %xmm0
callq 0x13b410
movaps %xmm0, %xmm1
movsd -0x20(%rbp), %xmm0
movsd -0x18(%rbp), %xmm2
movaps 0x33dd5(%rip), %xmm3    # 0x16f290
pand %xmm3, %xmm2
cvttsd2si %xmm2, %eax
cvtsi2sd %eax, %xmm2
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0x4766a(%rip), %xmm0    # 0x182b58
mulsd %xmm1, %xmm0
movsd %xmm0, -0x10(%rbp)
xorps %xmm0, %xmm0
ucomisd -0x10(%rbp), %xmm0
jbe 0x13b513
movsd 0x4764f(%rip), %xmm0    # 0x182b58
addsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
addq $0x20, %rsp
popq %rbp
retq
nop
// File: 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
movsd %xmm0, -0x8(%rbp)
movsd %xmm1, -0x10(%rbp)
movsd -0x8(%rbp), %xmm0
divsd -0x10(%rbp), %xmm0
callq 0x92e0
movsd %xmm0, -0x18(%rbp)
xorps %xmm0, %xmm0
ucomisd -0x10(%rbp), %xmm0
jbe 0x13b562
movsd 0x36070(%rip), %xmm0    # 0x1715c8
addsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
xorps %xmm0, %xmm0
ucomisd -0x8(%rbp), %xmm0
jbe 0x13b598
movsd -0x10(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x13b598
movsd 0x36046(%rip), %xmm0    # 0x1715c8
addsd -0x18(%rbp), %xmm0
movsd 0x36039(%rip), %xmm1    # 0x1715c8
addsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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 $0x40, %rsp
movsd %xmm0, -0x8(%rbp)
movsd %xmm1, -0x10(%rbp)
movsd -0x8(%rbp), %xmm0
callq 0x96f0
movaps %xmm0, %xmm1
movsd 0x51ea1(%rip), %xmm0    # 0x18e978
mulsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x8(%rbp), %xmm0
callq 0x9080
movaps %xmm0, %xmm1
movsd 0x51e7b(%rip), %xmm0    # 0x18e970
mulsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x8(%rbp), %xmm0
callq 0x96f0
movaps %xmm0, %xmm1
movsd 0x51e55(%rip), %xmm0    # 0x18e968
mulsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x8(%rbp), %xmm0
callq 0x9080
movaps %xmm0, %xmm1
movsd 0x51e2f(%rip), %xmm0    # 0x18e960
mulsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x28(%rbp), %xmm2
movsd -0x30(%rbp), %xmm1
mulsd -0x30(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x38(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x13cb7a
jp 0x13cb7a
movsd 0x51e0d(%rip), %xmm0    # 0x18e980
movsd %xmm0, -0x38(%rbp)
jmp 0x13cbce
movsd -0x18(%rbp), %xmm0
movsd -0x18(%rbp), %xmm2
movsd -0x20(%rbp), %xmm1
mulsd -0x20(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
divsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x38(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x13cbbf
movsd -0x38(%rbp), %xmm0
callq 0x9280
movsd %xmm0, -0x38(%rbp)
jmp 0x13cbcc
movsd 0x51db9(%rip), %xmm0    # 0x18e980
movsd %xmm0, -0x38(%rbp)
jmp 0x13cbce
movsd -0x38(%rbp), %xmm0
movsd -0x10(%rbp), %xmm1
movsd 0x32450(%rip), %xmm2    # 0x16f030
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
addq $0x40, %rsp
popq %rbp
retq
nop
// File: 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
subq $0x20, %rsp
movsd %xmm0, -0x10(%rbp)
movl %edi, -0x14(%rbp)
movsd -0x10(%rbp), %xmm0
movl -0x14(%rbp), %edi
callq 0x13cd20
movsd %xmm0, -0x20(%rbp)
leaq 0x22f597(%rip), %rax    # 0x36c1b0
movsd (%rax), %xmm0
movsd 0x51d63(%rip), %xmm1    # 0x18e988
ucomisd %xmm1, %xmm0
jbe 0x13cc4f
movsd 0x51d5d(%rip), %xmm0    # 0x18e990
leaq 0x22f576(%rip), %rax    # 0x36c1b0
ucomisd (%rax), %xmm0
jbe 0x13cc4f
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x13cd0c
leaq 0x22f55a(%rip), %rax    # 0x36c1b0
movsd (%rax), %xmm0
movsd 0x51d36(%rip), %xmm1    # 0x18e998
ucomisd %xmm1, %xmm0
jbe 0x13cc77
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x13cd0c
movsd 0x464b1(%rip), %xmm0    # 0x183130
leaq 0x22f52a(%rip), %rax    # 0x36c1b0
ucomisd (%rax), %xmm0
jbe 0x13cc98
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x13cd0c
jmp 0x13cc9a
jmp 0x13cc9c
leaq 0x22fd0d(%rip), %rax    # 0x36c9b0
movsd (%rax), %xmm0
movsd %xmm0, -0x20(%rbp)
xorps %xmm0, %xmm0
leaq 0x22f4fa(%rip), %rax    # 0x36c1b0
ucomisd (%rax), %xmm0
jbe 0x13ccdb
movsd 0x323b4(%rip), %xmm0    # 0x16f078
addsd -0x20(%rbp), %xmm0
movsd 0x45e5f(%rip), %xmm1    # 0x182b30
callq 0x94d0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
movsd 0x32390(%rip), %xmm1    # 0x16f078
ucomisd %xmm1, %xmm0
jbe 0x13cd02
movsd 0x45e3a(%rip), %xmm0    # 0x182b30
subsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x13cd0c
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)