LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: galileo_prn(int)
int galileo_prn(int prn)
{
   if(rcvr_type == UBX_RCVR) {
      if((prn >= 211) && (prn <= 246)) return prn-210;
   }
   else if(rcvr_type == VENUS_RCVR) {
      if((prn >= 301) && (prn <= 350)) return prn-300;
   }
   else if(0 && (rcvr_type == TSIP_RCVR)) {
      // 183, 192,193,200
      if((prn >= 97) && (prn <= 133)) return prn-96;
   }
   return 0;  // not yet supported
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x1386a6(%rip), %rax    # 0x2028d0
movq (%rax), %rcx
cmpq $0x80, %rcx
je 0xca251
xorl %eax, %eax
cmpq $0x4, %rcx
jne 0xca265
leal -0xd3(%rdi), %ecx
addl $0xffffff2e, %edi       # imm = 0xFFFFFF2E
xorl %eax, %eax
cmpl $0x24, %ecx
jmp 0xca262
leal -0x12d(%rdi), %ecx
addl $0xfffffed4, %edi       # imm = 0xFFFFFED4
xorl %eax, %eax
cmpl $0x32, %ecx
cmovbl %edi, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: beidou_prn(int)
int beidou_prn(int prn)
{
   // not supported in RINEX before v3.0
   if(1 && (rcvr_type == UBX_RCVR)) {
      if((prn >= 159) && (prn <= 163)) return prn-158;
      else if((prn >= 33) && (prn <= 64)) return 6+(prn-33);
   }
   else if(rcvr_type == VENUS_RCVR) {
      if((prn >= 201) && (prn <= 237)) return prn-200;
   }
   else if(0 && (rcvr_type == TSIP_RCVR)) {
      if((prn >= 201) && (prn <= 237)) return prn-200;
   }
   return 0;  // not yet supported
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x13864b(%rip), %rax    # 0x2028d0
movq (%rax), %rcx
cmpq $0x80, %rcx
je 0xca2ae
xorl %eax, %eax
cmpq $0x4, %rcx
jne 0xca2cf
leal -0x9f(%rdi), %eax
cmpl $0x4, %eax
ja 0xca2c1
addl $0xffffff62, %edi       # imm = 0xFFFFFF62
movl %edi, %eax
jmp 0xca2cf
leal -0xc9(%rdi), %ecx
addl $0xffffff38, %edi       # imm = 0xFFFFFF38
xorl %eax, %eax
cmpl $0x25, %ecx
jmp 0xca2cc
leal -0x21(%rdi), %ecx
addl $-0x1b, %edi
xorl %eax, %eax
cmpl $0x20, %ecx
cmovbl %edi, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: qzss_prn(int)
int qzss_prn(int prn)
{
   // returns the RINEX PRN id code if sat is a QZSS satellite
   if(rcvr_type == ESIP_RCVR) {
      if((prn >= 93) && (prn < 199)) return prn-92;
   }
   else if(rcvr_type == TSIP_RCVR) {
      // 183, 192, 193, 200
   }
   else if(rcvr_type == UBX_RCVR){
      if((prn >= 193) && (prn <= 197)) return prn-192;
   }
   else if(rcvr_type == VENUS_RCVR){
      if((prn >= 193) && (prn <= 199)) return prn-192;
   }

   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x1385e1(%rip), %rax    # 0x2028d0
movq (%rax), %rcx
cmpq $0x4, %rcx
je 0xca32d
cmpq $0x80, %rcx
je 0xca31a
xorl %eax, %eax
movl $0x80000000, %edx       # imm = 0x80000000
cmpq %rdx, %rcx
jne 0xca341
leal -0x5d(%rdi), %ecx
addl $-0x5c, %edi
xorl %eax, %eax
cmpl $0x6a, %ecx
jmp 0xca33e
leal -0xc1(%rdi), %ecx
addl $0xffffff40, %edi       # imm = 0xFFFFFF40
xorl %eax, %eax
cmpl $0x7, %ecx
jmp 0xca33e
leal -0xc1(%rdi), %ecx
addl $0xffffff40, %edi       # imm = 0xFFFFFF40
xorl %eax, %eax
cmpl $0x5, %ecx
cmovbl %edi, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: gnss_letter(int)
char gnss_letter(int prn)
{
char c;

   rinex_gnss(prn);
   if(rcvr_type == GPSD_RCVR)  c = ' ';
   else if(gnss_sat & GPS)     c = 'G';
   else if(gnss_sat & BEIDOU)  c = 'C';
   else if(gnss_sat & GALILEO) c = 'E';
   else if(gnss_sat & IRNSS)   c = 'I';
   else if(gnss_sat & QZSS)    c = 'J';
   else if(gnss_sat & IMES)    c = 'M';
   else if(gnss_sat & GLONASS) c = 'R';
   else if(gnss_sat & SBAS)    c = 'S';
   else                        c = ' ';

   return c;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0xca4da
leaq 0x1383d2(%rip), %rcx    # 0x2028d0
movb $0x20, %al
cmpq $0x200, (%rcx)          # imm = 0x200
je 0xca551
leaq 0x90770(%rip), %rax     # 0x15ac80
movl (%rax), %ecx
movb $0x47, %al
testb $0x1, %cl
jne 0xca551
movb $0x43, %al
testb $0x8, %cl
jne 0xca551
movb $0x45, %al
testb $0x4, %cl
jne 0xca551
movb $0x49, %al
testb $0x10, %cl
jne 0xca551
movb $0x4a, %al
btl $0xe, %ecx
jb 0xca551
movb $0x4d, %al
btl $0xd, %ecx
jb 0xca551
movb $0x52, %al
testb $0x2, %cl
jne 0xca551
testw %cx, %cx
pushq $0x20
popq %rcx
pushq $0x53
popq %rax
cmovnsl %ecx, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: gnss_id(int)
char *gnss_id(int prn)
{
char *s;

   rinex_gnss(prn);
   if(rcvr_type == GPSD_RCVR)  s = "PRN";
   else if(gnss_sat & GPS)     s = "GPS";
   else if(gnss_sat & BEIDOU)  s = "BEIDOU";
   else if(gnss_sat & GALILEO) s = "GALILEO";
   else if(gnss_sat & IRNSS)   s = "IRNSS";
   else if(gnss_sat & QZSS)    s = "QZSS";
   else if(gnss_sat & IMES)    s = "IMES";
   else if(gnss_sat & GLONASS) s = "GLONASS";
   else if(gnss_sat & SBAS)    s = "SBAS";
   else                        s = "PRN";

   return s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0xca4da
leaq 0x13836d(%rip), %rax    # 0x2028d0
cmpq $0x200, (%rax)          # imm = 0x200
jne 0xca575
leaq 0x52b1c(%rip), %rax     # 0x11d08f
jmp 0xca5f2
leaq 0x90704(%rip), %rax     # 0x15ac80
movl (%rax), %eax
testb $0x1, %al
jne 0xca5b5
testb $0x8, %al
jne 0xca5be
testb $0x4, %al
jne 0xca5c7
testb $0x10, %al
jne 0xca5d0
btl $0xe, %eax
jb 0xca5d9
btl $0xd, %eax
jb 0xca5e2
testb $0x2, %al
jne 0xca5eb
testw %ax, %ax
leaq 0x52ae7(%rip), %rcx     # 0x11d08f
leaq 0x440b9(%rip), %rax     # 0x10e668
cmovnsq %rcx, %rax
jmp 0xca5f2
leaq 0x53255(%rip), %rax     # 0x11d811
jmp 0xca5f2
leaq 0x52d77(%rip), %rax     # 0x11d33c
jmp 0xca5f2
leaq 0x52d75(%rip), %rax     # 0x11d343
jmp 0xca5f2
leaq 0x38a7f(%rip), %rax     # 0x103056
jmp 0xca5f2
leaq 0x52d6b(%rip), %rax     # 0x11d34b
jmp 0xca5f2
leaq 0x52d67(%rip), %rax     # 0x11d350
jmp 0xca5f2
leaq 0x52d63(%rip), %rax     # 0x11d355
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: good_raw(int)
int good_raw(int prn)
{
   // return the RINEX system id char if it's a satellite we support
   if(sat[prn].level_msg == 0) return 0;  // sat is not tracked
   if(sat[prn].tracking <= 0) return 0;

   if(rinex_prn(prn)) {
      if     (gps_sat(prn))     return gps_sat(prn);      // it's a GPS sat
      else if(sbas_sat(prn))    return sbas_sat(prn);     // it's a SBAS sat
      else if(glonass_sat(prn)) return glonass_sat(prn);  // 
      else if(galileo_sat(prn)) return galileo_sat(prn);  // 
      else if(beidou_sat(prn))  return beidou_sat(prn);   // 
   }

   return 0;  // it's not OK to output the sat's RAW measurements
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movslq %edi, %rax
imulq $0x348, %rax, %rcx      # imm = 0x348
leaq 0x15e9a4(%rip), %rax    # 0x228fb0
xorl %r14d, %r14d
cmpl $0x0, 0x1c(%rax,%rcx)
je 0xca65f
addq %rcx, %rax
cmpl $0x0, 0x218(%rax)
jle 0xca65f
movl %edi, %ebx
callq 0xca3aa
testl %eax, %eax
je 0xca65f
leal -0x21(%rbx), %eax
cmpl $-0x21, %eax
ja 0xca65b
movl %ebx, %edi
callq 0xca1bd
testl %eax, %eax
jne 0xca656
movl %ebx, %edi
callq 0xca20c
testl %eax, %eax
jne 0xca656
movl %ebx, %edi
callq 0xca267
testl %eax, %eax
je 0xca667
movl %eax, %r14d
jmp 0xca65f
pushq $0x47
popq %r14
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
movl %ebx, %edi
popq %rbx
popq %r14
popq %rbp
jmp 0xca2d1
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: add_obs_val(_IO_FILE*, char*, int*)
void add_obs_val(FILE *file, char *meas, int *obs_count)
{
int max_obs;

   // add the observation value to the output string

   if(file == 0) return;
   if(meas == 0) return;
   if(obs_count == 0) return;

   max_obs = 5;
   if(rinex_fmt >= 3.0) max_obs = 100;

   fprintf(file, "%s", meas);
   *obs_count = (*obs_count)+1;
   if(*obs_count >= max_obs) {
      fprintf(file, "\n");
      out[0] = 0;
      *obs_count = 0;
      obs_data_written = 1;
   }
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
testq %rdx, %rdx
sete %al
orb %cl, %al
jne 0xca6fd
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
leaq 0x15dedf(%rip), %rax    # 0x228580
movsd (%rax), %xmm0
ucomisd 0x2b3d3(%rip), %xmm0    # 0xf5a80
pushq $0x5
popq %rax
pushq $0x64
popq %r15
cmovbl %eax, %r15d
movq %rsi, %rdi
movq %r14, %rsi
callq 0x9400
movl (%rbx), %eax
incl %eax
movl %eax, (%rbx)
cmpl %r15d, %eax
jl 0xca6f3
pushq $0xa
popq %rdi
movq %r14, %rsi
callq 0x9480
leaq 0x25bb40(%rip), %rax    # 0x326220
movb $0x0, (%rax)
andl $0x0, (%rbx)
leaq 0x15dd07(%rip), %rax    # 0x2283f4
movl $0x1, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: add_obs_type(int*, int, int)
int add_obs_type(int *obs_type, int count, int obs)
{
int i;

   // add an observation ID to the observation type list

   if(obs_type == 0) return count;
   if(count >= MAX_OBS) return count;

   for(i=0; i<count; i++) {  // filter out duplicates
      if(obs_type[i] == obs) return count;
   }

   obs_type[count++] = obs;
   return obs;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edx, %eax
testq %rdi, %rdi
sete %cl
cmpl $0x1b, %esi
setge %dl
orb %cl, %dl
jne 0xca731
xorl %ecx, %ecx
testl %esi, %esi
movl $0x0, %edx
cmovgl %esi, %edx
cmpq %rcx, %rdx
je 0xca735
leaq 0x1(%rcx), %r8
cmpl %eax, (%rdi,%rcx,4)
movq %r8, %rcx
jne 0xca720
movl %esi, %eax
jmp 0xca73b
movslq %esi, %rcx
movl %eax, (%rdi,%rcx,4)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: rinex_cppr(int, double, double)
double rinex_cppr(int prn, double range, double carrier)
{
double cp_range;
int gnss;

  // convert carrier phase to pseudorange
  // (testing shows this actually makes things worse)
  if(use_rinex_cppr == 0) return range;
  if(have_phase == 0) return range;

  gnss = rinex_gnss(prn);
  if(gnss & GPS) ;           // sats in 1575.426 Mhz L1
  else if(gnss & SBAS) ;
  else if(gnss & GALILEO) ;
  else return range;

  cp_range = carrier * ((LIGHTSPEED*1000.0)/1575.42E6);
if(0 &&debug_file) fprintf(debug_file, "cppr(%d,%f): %f -> %f\n", prn,carrier, range,cp_range);
  return cp_range;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x15c867(%rip), %rax    # 0x22858c
cmpl $0x0, (%rax)
je 0xcbd5d
leaq 0x22b613(%rip), %rax    # 0x2f7344
cmpl $0x0, (%rax)
je 0xcbd5d
movsd %xmm1, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
callq 0xca4da
movsd -0x10(%rbp), %xmm0
testw $0x8005, %ax            # imm = 0x8005
je 0xcbd5d
movsd -0x8(%rbp), %xmm0
mulsd 0x49a03(%rip), %xmm0    # 0x115760
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %rbx
pushq %rax
movaps 0x490c4(%rip), %xmm0    # 0x116820
leaq 0x22a1dd(%rip), %rbx    # 0x2f7940
movaps %xmm0, (%rbx)
movaps 0x490c3(%rip), %xmm0    # 0x116830
movaps %xmm0, 0x10(%rbx)
movaps 0x490c8(%rip), %xmm0    # 0x116840
movaps %xmm0, 0x20(%rbx)
movl $0x14e, 0x30(%rbx)      # imm = 0x14E
movl $0x1c, 0x86f7b(%rip)    # 0x154708
callq 0xcd71e
testl %eax, %eax
je 0xcd7b1
pushq $0x2
popq %rax
cmpq $0xd, %rax
je 0xcd7a7
incl (%rbx,%rax,4)
incq %rax
jmp 0xcd799
movl $0x1d, 0x86f57(%rip)    # 0x154708
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, -0x2c(%rbp)
movl %esi, %r14d
movl %edi, %r15d
movl %edx, %edi
callq 0x68914
movl %eax, %r12d
testl %r15d, %r15d
js 0xcd88e
movl %r15d, -0x30(%rbp)
movslq %r12d, %rax
leaq 0x86eb3(%rip), %rcx     # 0x154700
movl (%rcx,%rax,4), %r15d
xorl %eax, %eax
testl %r15d, %r15d
cmovlel %eax, %r15d
negl %r15d
pushq $0x1
popq %r13
xorl %ebx, %ebx
leal (%r15,%r13), %eax
cmpl $0x1, %eax
je 0xcd8c8
movl %r13d, %edi
movl %r12d, %esi
movl -0x2c(%rbp), %edx
callq 0xcd7b8
movzbl %al, %eax
cmpl %r14d, %eax
jne 0xcd889
incl %ebx
cmpl -0x30(%rbp), %ebx
je 0xcd8cc
incl %r13d
jmp 0xcd863
negl %r15d
movslq %r12d, %rax
leaq 0x86e65(%rip), %rcx     # 0x154700
movl (%rcx,%rax,4), %r13d
xorl %ebx, %ebx
testl %r13d, %r13d
jle 0xcd8c8
movl %r13d, %edi
movl %r12d, %esi
movl -0x2c(%rbp), %edx
callq 0xcd7b8
movzbl %al, %eax
cmpl %r14d, %eax
jne 0xcd8c3
incl %ebx
cmpl %r15d, %ebx
je 0xcd8d1
decl %r13d
jmp 0xcd8a1
xorl %eax, %eax
jmp 0xcd8d4
movl %r13d, %eax
jmp 0xcd8d4
movl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
addsd 0x47e81(%rip), %xmm0    # 0x115770
divsd 0x47e81(%rip), %xmm0    # 0x115778
movapd %xmm0, %xmm1
mulsd %xmm0, %xmm1
movapd %xmm0, %xmm2
mulsd %xmm1, %xmm2
mulsd 0x47e71(%rip), %xmm0    # 0x115780
addsd 0x47e71(%rip), %xmm0    # 0x115788
mulsd 0x47e71(%rip), %xmm1    # 0x115790
addsd %xmm1, %xmm0
divsd 0x47e6d(%rip), %xmm2    # 0x115798
addsd %xmm2, %xmm0
mulsd 0x28051(%rip), %xmm0    # 0xf5988
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x4767f(%rip), %xmm5    # 0x115770
addsd %xmm0, %xmm5
divsd 0x477d3(%rip), %xmm5    # 0x1158d0
movsd 0x477d3(%rip), %xmm1    # 0x1158d8
mulsd %xmm5, %xmm1
addsd 0x477cf(%rip), %xmm1    # 0x1158e0
movapd %xmm5, %xmm2
mulsd %xmm5, %xmm2
movapd %xmm5, %xmm3
mulsd %xmm2, %xmm3
mulsd 0x477bf(%rip), %xmm2    # 0x1158e8
addsd %xmm1, %xmm2
movapd %xmm5, %xmm1
mulsd %xmm3, %xmm1
mulsd 0x477b3(%rip), %xmm3    # 0x1158f0
movapd %xmm5, %xmm4
mulsd %xmm1, %xmm4
mulsd 0x477ab(%rip), %xmm1    # 0x1158f8
addsd %xmm2, %xmm3
addsd %xmm3, %xmm1
movapd %xmm5, %xmm2
mulsd %xmm4, %xmm2
mulsd 0x4779b(%rip), %xmm4    # 0x115900
addsd %xmm1, %xmm4
movapd %xmm5, %xmm1
mulsd %xmm2, %xmm1
mulsd 0x4778f(%rip), %xmm2    # 0x115908
addsd %xmm4, %xmm2
movapd %xmm5, %xmm3
mulsd %xmm1, %xmm3
mulsd 0x47783(%rip), %xmm1    # 0x115910
movapd %xmm5, %xmm4
mulsd %xmm3, %xmm4
mulsd 0x4777b(%rip), %xmm3    # 0x115918
addsd %xmm2, %xmm1
mulsd %xmm4, %xmm5
mulsd 0x47773(%rip), %xmm4    # 0x115920
addsd %xmm1, %xmm3
addsd %xmm3, %xmm4
mulsd 0x4776b(%rip), %xmm5    # 0x115928
addsd %xmm4, %xmm5
divsd 0x24e47(%rip), %xmm5    # 0xf3010
testl %edi, %edi
je 0xce1e0
movsd %xmm5, -0x8(%rbp)
callq 0xcd939
movsd -0x8(%rbp), %xmm5
addsd %xmm0, %xmm5
mulsd 0x277a0(%rip), %xmm5    # 0xf5988
movapd %xmm5, %xmm0
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0xda874
leaq 0x228eeb(%rip), %rax    # 0x2f7548
movsd (%rax), %xmm0
callq 0xd57b4
leaq 0x228eb3(%rip), %rbx    # 0x2f7520
movl (%rbx), %edi
callq 0xda70e
movl (%rbx), %edi
callq 0xd9db3
movl (%rbx), %edi
callq 0xda27b
movl (%rbx), %edi
callq 0xda413
movl (%rbx), %edi
callq 0xda51d
movl (%rbx), %edi
callq 0xda376
callq 0xd19bb
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xd133e
// File: /workspace/github_cpp_makefile_star2_O2/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 0x2291e2(%rip), %rax    # 0x2f7894
cmpb $0x0, (%rax)
je 0xce6fd
cmpl $0x0, 0x296342(%rip)    # 0x364a00
je 0xce704
cmpl $0x0, 0x29633d(%rip)    # 0x364a04
je 0xce70b
cmpl $0x0, 0x296338(%rip)    # 0x364a08
je 0xce712
cmpl $0x0, 0x296333(%rip)    # 0x364a0c
je 0xce719
leaq 0x229246(%rip), %rax    # 0x2f7928
cmpb $0x0, (%rax)
je 0xce720
leaq 0x2291ae(%rip), %rax    # 0x2f789c
xorl %ecx, %ecx
cmpl $0x0, (%rax)
movl $0x7, %eax
cmovnel %ecx, %eax
jmp 0xce725
movl $0x1, %eax
jmp 0xce725
movl $0x2, %eax
jmp 0xce725
movl $0x3, %eax
jmp 0xce725
movl $0x4, %eax
jmp 0xce725
movl $0x5, %eax
jmp 0xce725
movl $0x6, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0xbfac2
leaq 0x228f62(%rip), %rax    # 0x2f76a4
movl (%rax), %edi
cmpl $0x7df, %edi            # imm = 0x7DF
jle 0xce754
cmpl $0x835, %edi            # imm = 0x835
jb 0xce768
pushq $0x1
popq %rdx
movl %edx, %esi
callq 0xc2f07
movsd 0x471d2(%rip), %xmm1    # 0x115938
jmp 0xce782
addl $0xfffff820, %edi       # imm = 0xFFFFF820
leaq 0x860eb(%rip), %rax     # 0x154860
movsd (%rax,%rdi,8), %xmm0
movsd 0x471ae(%rip), %xmm1    # 0x115930
movsd -0x8(%rbp), %xmm2
subsd %xmm0, %xmm2
addsd %xmm1, %xmm2
movapd %xmm2, %xmm0
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x46fcb(%rip), %xmm0    # 0x115770
divsd 0x47193(%rip), %xmm0    # 0x115940
movsd 0x47193(%rip), %xmm1    # 0x115948
mulsd %xmm0, %xmm1
addsd 0x4718f(%rip), %xmm1    # 0x115950
movsd 0x4718f(%rip), %xmm2    # 0x115958
mulsd %xmm0, %xmm2
mulsd %xmm0, %xmm2
addsd %xmm1, %xmm2
movsd 0x47183(%rip), %xmm1    # 0x115960
mulsd %xmm0, %xmm1
mulsd %xmm0, %xmm1
mulsd %xmm0, %xmm1
addsd %xmm2, %xmm1
movsd 0x47173(%rip), %xmm2    # 0x115968
mulsd %xmm0, %xmm2
mulsd %xmm0, %xmm2
mulsd %xmm0, %xmm2
mulsd %xmm0, %xmm2
addsd %xmm1, %xmm2
movsd 0x4715f(%rip), %xmm1    # 0x115970
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_O2/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 0x470f2(%rip), %xmm1    # 0x1159a0
mulsd %xmm0, %xmm1
addsd 0x470ee(%rip), %xmm1    # 0x1159a8
mulsd %xmm0, %xmm1
addsd 0x470ea(%rip), %xmm1    # 0x1159b0
mulsd %xmm0, %xmm1
movsd 0x470e6(%rip), %xmm2    # 0x1159b8
subsd %xmm1, %xmm2
movsd 0x2472a(%rip), %xmm1    # 0xf3008
divsd %xmm1, %xmm2
addsd 0x46fb6(%rip), %xmm2    # 0x1158a0
divsd %xmm1, %xmm2
addsd 0x470ca(%rip), %xmm2    # 0x1159c0
movsd %xmm2, -0x8(%rbp)
mulsd 0x470c5(%rip), %xmm0    # 0x1159c8
addsd 0x470c5(%rip), %xmm0    # 0x1159d0
mulsd 0x26f8d(%rip), %xmm0    # 0xf58a0
divsd 0x26f8d(%rip), %xmm0    # 0xf58a8
callq 0x9710
mulsd 0x470b0(%rip), %xmm0    # 0x1159d8
addsd -0x8(%rbp), %xmm0
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x4685f(%rip), %xmm2    # 0x115770
movl %edi, %ebx
movapd %xmm2, %xmm0
divsd 0x46859(%rip), %xmm0    # 0x115778
movsd 0x46b51(%rip), %xmm1    # 0x115a78
movsd %xmm2, -0x18(%rbp)
mulsd %xmm2, %xmm1
addsd 0x46b48(%rip), %xmm1    # 0x115a80
movapd %xmm0, %xmm2
mulsd %xmm0, %xmm2
divsd 0x46b40(%rip), %xmm0    # 0x115a88
addsd 0x46b40(%rip), %xmm0    # 0x115a90
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd 0x39250(%rip), %xmm1    # 0x1081b0
callq 0x94d0
movapd %xmm0, %xmm2
divsd 0x395b7(%rip), %xmm2    # 0x108528
testl %ebx, %ebx
je 0xcf020
movsd 0x46b17(%rip), %xmm0    # 0x115a98
movsd -0x18(%rbp), %xmm1
mulsd %xmm1, %xmm0
addsd 0x46a3e(%rip), %xmm0    # 0x1159d0
movsd 0x46b06(%rip), %xmm3    # 0x115aa0
mulsd %xmm1, %xmm3
addsd 0x46b02(%rip), %xmm3    # 0x115aa8
movsd %xmm3, -0x20(%rbp)
mulsd 0x46afd(%rip), %xmm1    # 0x115ab0
addsd 0x46afd(%rip), %xmm1    # 0x115ab8
movsd %xmm1, -0x18(%rbp)
movsd %xmm2, -0x28(%rbp)
callq 0x9080
movsd %xmm0, -0x10(%rbp)
movsd -0x20(%rbp), %xmm0
addsd %xmm0, %xmm0
callq 0x9080
mulsd 0x46adb(%rip), %xmm0    # 0x115ac0
movsd -0x10(%rbp), %xmm1
mulsd 0x46ad6(%rip), %xmm1    # 0x115ac8
addsd %xmm1, %xmm0
movsd %xmm0, -0x10(%rbp)
movsd -0x18(%rbp), %xmm0
callq 0x9710
mulsd -0x10(%rbp), %xmm0
addsd -0x28(%rbp), %xmm0
movsd 0x24029(%rip), %xmm1    # 0xf3040
callq 0x94d0
movapd %xmm0, %xmm2
xorpd %xmm1, %xmm1
movsd 0x24014(%rip), %xmm0    # 0xf3040
ucomisd %xmm2, %xmm1
jbe 0xcf038
addsd %xmm0, %xmm2
jmp 0xcf02c
movsd 0x39838(%rip), %xmm1    # 0x108878
ucomisd %xmm0, %xmm2
jb 0xcf04c
addsd %xmm1, %xmm2
jmp 0xcf040
movapd %xmm2, %xmm0
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x227f72(%rip), %rax    # 0x2f6fd8
movsd (%rax), %xmm1
movsd 0x46a5e(%rip), %xmm2    # 0x115ad0
mulsd %xmm1, %xmm2
xorpd %xmm3, %xmm3
cmpltsd %xmm1, %xmm3
movsd 0x39129(%rip), %xmm1    # 0x1081b0
andpd %xmm1, %xmm3
addsd %xmm2, %xmm3
mulsd 0x397e1(%rip), %xmm3    # 0x108878
divsd %xmm1, %xmm3
movapd %xmm3, -0x10(%rbp)
callq 0xceefc
xorpd %xmm2, %xmm2
addsd -0x10(%rbp), %xmm0
movsd 0x23f8a(%rip), %xmm1    # 0xf3040
ucomisd %xmm0, %xmm2
jbe 0xcf0c2
addsd %xmm1, %xmm0
jmp 0xcf0b6
movsd 0x397ae(%rip), %xmm2    # 0x108878
ucomisd %xmm1, %xmm0
jb 0xcf0d6
addsd %xmm2, %xmm0
jmp 0xcf0ca
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x4659e(%rip), %xmm1    # 0x115770
addsd %xmm0, %xmm1
mulsd 0x46912(%rip), %xmm1    # 0x115af0
addsd 0x46912(%rip), %xmm1    # 0x115af8
mulsd 0x266b2(%rip), %xmm1    # 0xf58a0
divsd 0x266b2(%rip), %xmm1    # 0xf58a8
movsd %xmm1, -0x8(%rbp)
movapd %xmm1, %xmm0
callq 0x9080
movsd %xmm0, -0x10(%rbp)
movsd -0x8(%rbp), %xmm0
addsd %xmm0, %xmm0
callq 0x9080
mulsd 0x468e1(%rip), %xmm0    # 0x115b00
movsd -0x10(%rbp), %xmm1
mulsd 0x468dc(%rip), %xmm1    # 0x115b08
addsd %xmm1, %xmm0
divsd 0x23de0(%rip), %xmm0    # 0xf3018
addsd -0x18(%rbp), %xmm0
addsd 0x4689b(%rip), %xmm0    # 0x115ae0
divsd 0x468c3(%rip), %xmm0    # 0x115b10
addsd 0x468c3(%rip), %xmm0    # 0x115b18
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x135a21(%rip), %rax    # 0x205418
cmpb $0x0, (%rax)
je 0xcfac3
leaq 0x227b0d(%rip), %rax    # 0x2f7514
movl (%rax), %edi
leaq 0x227c94(%rip), %rax    # 0x2f76a4
movl %edi, (%rax)
leaq 0x227af7(%rip), %rax    # 0x2f7510
movl (%rax), %esi
leaq 0x227c7a(%rip), %rax    # 0x2f769c
movl %esi, (%rax)
leaq 0x227ae1(%rip), %rax    # 0x2f750c
movl (%rax), %edx
leaq 0x227c6c(%rip), %rax    # 0x2f76a0
movl %edx, (%rax)
leaq 0x227acb(%rip), %rax    # 0x2f7508
movl (%rax), %ebx
leaq 0x227c62(%rip), %rax    # 0x2f76a8
movl %ebx, (%rax)
leaq 0x227ab5(%rip), %rax    # 0x2f7504
movl (%rax), %r14d
leaq 0x227c53(%rip), %rax    # 0x2f76ac
movl %r14d, (%rax)
leaq 0x227a9d(%rip), %rax    # 0x2f7500
movl (%rax), %r15d
leaq 0x227c43(%rip), %rax    # 0x2f76b0
movl %r15d, (%rax)
leaq 0x227aa1(%rip), %rax    # 0x2f7518
movsd (%rax), %xmm0
leaq 0x227c36(%rip), %rax    # 0x2f76b8
movsd %xmm0, (%rax)
callq 0xc2f07
cvtsi2sd %ebx, %xmm2
cvtsi2sd %r14d, %xmm3
movapd %xmm0, %xmm1
divsd 0x23568(%rip), %xmm3    # 0xf3008
addsd %xmm2, %xmm3
cvtsi2sd %r15d, %xmm0
divsd 0x2355f(%rip), %xmm0    # 0xf3010
addsd %xmm3, %xmm0
divsd 0x23583(%rip), %xmm0    # 0xf3040
addsd %xmm1, %xmm0
jmp 0xcfad9
leaq 0x227a7e(%rip), %rbx    # 0x2f7548
movsd (%rbx), %xmm0
xorl %edi, %edi
callq 0xbfac2
movsd (%rbx), %xmm0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %rbx
pushq %rax
leaq 0x22845b(%rip), %rax    # 0x2f7f4c
cmpl $0x0, (%rax)
je 0xcfb2c
movl $0xfa, %edi
callq 0xae83
leaq 0x2287d9(%rip), %rax    # 0x2f82e0
cmpl $0x0, 0x157c0(%rax)
jle 0xcfb2c
pushq $0xa
popq %rbx
pushq $0x1
popq %rsi
movl %ebx, %edi
callq 0xad58
movl %ebx, %edi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xada4
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x228412(%rip), %rax    # 0x2f7f4c
cmpl $0x0, (%rax)
je 0xcfb71
leaq 0x22879a(%rip), %rax    # 0x2f82e0
cmpl $0x0, 0x157c0(%rax)
jle 0xcfb71
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
pushq $0xa
popq %rbx
movl %ebx, %edi
xorl %esi, %esi
callq 0xad58
pushq $0x1
popq %rsi
movl %ebx, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xada4
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
leaq 0x22754b(%rip), %rax    # 0x2f7530
movsd (%rax), %xmm0
xorl %edi, %edi
callq 0xbfac2
leaq 0x2276b1(%rip), %rax    # 0x2f76a8
cmpl $0x0, (%rax)
jne 0xd0025
leaq 0x2276a9(%rip), %rax    # 0x2f76ac
cmpl $0x0, (%rax)
jne 0xd0025
leaq 0x2276a1(%rip), %rax    # 0x2f76b0
cmpl $0x10, (%rax)
jne 0xd0025
leaq 0x2274d1(%rip), %rax    # 0x2f74ec
movl $0x1, (%rax)
movb $0x1, %al
jmp 0xd0032
leaq 0x2274c0(%rip), %rax    # 0x2f74ec
cmpl $0x0, (%rax)
setne %al
testb %al, %al
je 0xd00af
leaq 0x2274ab(%rip), %r14    # 0x2f74e8
cmpl $0x1, (%r14)
je 0xd00af
leaq 0x2fbab(%rip), %rdi     # 0xffbf5
leaq 0x3ac84(%rip), %rsi     # 0x10acd5
callq 0x9a22
testq %rax, %rax
je 0xd00a5
movq %rax, %rbx
leaq 0x2561bb(%rip), %rdi    # 0x326220
movl $0x200, %esi            # imm = 0x200
movq %rax, %rdx
callq 0x9600
testq %rax, %rax
je 0xd009d
leaq 0x2561a2(%rip), %rdi    # 0x326220
callq 0x9470
divsd 0x22f8d(%rip), %xmm0    # 0xf3018
leaq 0x22745e(%rip), %rax    # 0x2f74f0
movsd %xmm0, (%rax)
movl $0x2, (%r14)
movq %rbx, %rdi
callq 0x9360
leaq 0x227440(%rip), %rax    # 0x2f74ec
andl $0x0, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: get_tz_value(char*)
char *get_tz_value(char *s)
{
int c;
u08 saw_colon;

   if(s == 0) return s;

// tz_sign = 1;
   time_zone_hours = 0;
   time_zone_minutes = 0;
   time_zone_seconds = 0;
   tz_adjust = 0.0;

   saw_colon = 0;
   while(1) { // get time zone hour offset value
      c = *s;
      if(c == 0) {
         s = 0;
         break;
      }
      if     (c == '+') tz_sign = (0+tz_sign); 
      else if(c == '-') tz_sign = (0-tz_sign);
      else if(c == ':') ++saw_colon;
      else if(isdigit(c)) {
         if     (saw_colon == 0) time_zone_hours = (time_zone_hours * 10) + (c-'0');
         else if(saw_colon == 1) time_zone_minutes = (time_zone_minutes * 10) + (c-'0');
         else if(saw_colon == 2) time_zone_seconds = (time_zone_seconds * 10) + (c-'0'); 
      }
      else break;
      ++s;
   }
   time_zone_hours %= 24;


   time_zone_hours *= tz_sign;
   time_zone_minutes %= 60;
   time_zone_minutes *= tz_sign;
   time_zone_seconds %= 60;
   time_zone_seconds *= tz_sign;
   tz_adjust = jtime(time_zone_hours,time_zone_minutes,time_zone_seconds, 0.0);

   return s;
}

// Assembly:
xorl %eax, %eax
testq %rdi, %rdi
je 0xd017d
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x2277b7(%rip), %r14    # 0x2f7888
andl $0x0, (%r14)
leaq 0x2277b0(%rip), %rbx    # 0x2f788c
andl $0x0, (%rbx)
leaq 0x2277aa(%rip), %r10    # 0x2f7890
andl $0x0, (%r10)
leaq 0x22778f(%rip), %r9     # 0x2f7880
andq $0x0, (%r9)
leaq 0x22779c(%rip), %rdx    # 0x2f7898
movl (%rdx), %r11d
xorl %esi, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
movzbl (%rdi), %r15d
cmpl $0x2b, %r15d
je 0xd015d
cmpl $0x2d, %r15d
je 0xd0152
cmpl $0x3a, %r15d
je 0xd015a
testl %r15d, %r15d
je 0xd0181
movsbl %r15b, %r15d
addl $-0x30, %r15d
cmpl $0x9, %r15d
ja 0xd0183
cmpb $0x2, %r8b
je 0xd016f
movzbl %r8b, %r12d
cmpl $0x1, %r12d
je 0xd0162
testl %r12d, %r12d
jne 0xd015d
imull $0xa, %eax, %eax
addl %r15d, %eax
movl %eax, (%r14)
xorl %r8d, %r8d
jmp 0xd015d
negl %r11d
movl %r11d, (%rdx)
jmp 0xd015d
incb %r8b
incq %rdi
jmp 0xd0106
imull $0xa, %esi, %esi
addl %r15d, %esi
movl %esi, (%rbx)
movb $0x1, %r8b
jmp 0xd015d
imull $0xa, %ecx, %ecx
addl %r15d, %ecx
movl %ecx, (%r10)
movb $0x2, %r8b
jmp 0xd015d
xorl %edi, %edi
jmp 0xd01f2
xorl %edi, %edi
movl $0x18, %r8d
cltd
idivl %r8d
movl %edx, %r8d
imull %r11d, %r8d
movl %r8d, (%r14)
movl $0x3c, %r14d
movl %esi, %eax
cltd
idivl %r14d
movl %edx, %esi
imull %r11d, %esi
movl %esi, (%rbx)
movl %ecx, %eax
cltd
idivl %r14d
imull %r11d, %edx
cvtsi2sd %r8d, %xmm0
cvtsi2sd %esi, %xmm1
movl %edx, (%r10)
divsd 0x22e3f(%rip), %xmm1    # 0xf3008
addsd %xmm0, %xmm1
cvtsi2sd %edx, %xmm0
divsd 0x22e37(%rip), %xmm0    # 0xf3010
addsd %xmm1, %xmm0
divsd 0x22e5b(%rip), %xmm0    # 0xf3040
movsd %xmm0, (%r9)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
movq %rdi, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0xd029c
movq %rdi, %r15
cmpb $0x0, (%rdi)
je 0xd029c
movl %esi, %r14d
leaq 0x2276fd(%rip), %r12    # 0x2f7920
movb $0x0, (%r12)
xorl %r13d, %r13d
movq %r15, %rbx
movb (%r15), %al
movslq %r13d, %r13
incq %r15
movzbl %al, %ecx
cmpb $0x2f, %al
ja 0xd024e
movabsq $0xa80000000000, %rdx   # imm = 0xA80000000000
btq %rcx, %rdx
jb 0xd02a0
movsbl %al, %edi
testl %r14d, %r14d
je 0xd025e
leal -0x30(%rdi), %edx
cmpl $0xa, %edx
jb 0xd02a6
cmpb $0x9, %al
je 0xd022b
cmpl $0x20, %ecx
je 0xd022b
callq 0x9700
movb %al, (%r12,%r13)
movb $0x0, 0x1(%r12,%r13)
cmpq $0x3, %r13
jg 0xd02a3
incq %rbx
movzbl (%r15), %eax
incq %r15
incq %r13
cmpl $0xd, %eax
ja 0xd0237
movl $0x2401, %ecx           # imm = 0x2401
btl %eax, %ecx
jae 0xd0237
xorl %ebx, %ebx
jmp 0xd02a6
xorl %ebx, %ebx
jmp 0xd02c0
decq %r15
movq %r15, %rbx
cmpb $0x0, (%r12)
jne 0xd02c0
leaq 0x22766c(%rip), %rdi    # 0x2f7920
leaq 0x227675(%rip), %rsi    # 0x2f7930
callq 0x9330
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_O2/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, %r15
leaq 0x2275b2(%rip), %rax    # 0x2f789c
cmpl $0x0, (%rax)
jne 0xd02f5
movl $0x1, (%rax)
leaq 0x22762c(%rip), %r14    # 0x2f7928
movb $0x0, (%r14)
movl $0x2401, %r12d          # imm = 0x2401
xorl %r13d, %r13d
movq %r15, %rbx
movb (%r15), %al
movslq %r13d, %r13
incq %r15
testb %al, %al
je 0xd035a
cmpb $0x9, %al
je 0xd0309
movzbl %al, %ecx
cmpl $0x20, %ecx
je 0xd0309
cmpl $0x2f, %ecx
je 0xd0362
movsbl %al, %edi
incq %rbx
callq 0x9700
movb %al, (%r14,%r13)
movb $0x0, 0x1(%r14,%r13)
cmpq $0x3, %r13
jg 0xd035f
movzbl (%r15), %eax
incq %r15
incq %r13
cmpl $0xd, %eax
ja 0xd0315
btl %eax, %r12d
jae 0xd0315
xorl %r15d, %r15d
jmp 0xd0362
movq %rbx, %r15
leaq 0x22753b(%rip), %rax    # 0x2f78a4
cmpb $0x0, (%rax)
jne 0xd03ca
leaq 0x255eab(%rip), %r14    # 0x326220
leaq 0x2275ac(%rip), %rsi    # 0x2f7928
movq %r14, %rdi
callq 0x9330
movq %r14, %rdi
callq 0x988f
xorl %eax, %eax
cmpl $0x545342, (%r14)       # imm = 0x545342
sete %al
incl %eax
leaq 0x2274fb(%rip), %rcx    # 0x2f789c
movl %eax, (%rcx)
leaq 0x227176(%rip), %rcx    # 0x2f7520
movl (%rcx), %edi
leaq 0x8447d(%rip), %rcx     # 0x154830
movq (%rcx,%rax,8), %rsi
callq 0xce1f2
callq 0xce4ef
leaq 0x2274d8(%rip), %rcx    # 0x2f78a0
movl %eax, (%rcx)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: time_sync_median(double)
double time_sync_median(double delta)
{
int i;
int k, m;

   // This routine calculates the median of a string of system clock vs 
   // receiver time samples.  It returns 0 if median is not available,
   // otherwise it returns the value of the median.  This value is used
   // to determine when the system clock has diverged enough from
   // the reseiver time to cause a system clock reset.

   if(clk_sort_count < 0) clk_sort_count = 0;

   if(clk_sort_count >= CLK_SORT-1) {  // we have enough samples, get the median value
      delta = clk_sort[clk_sort_count/2];
      delta += clk_sort[clk_sort_count/2-1];
      delta += clk_sort[clk_sort_count/2+1];
      delta /= 3.0;
      clk_sort_count = 0;
      return fabs(delta);
   }

   if(clk_sort_count == 0) {   // first entry
      clk_sort[clk_sort_count] = delta;
      ++clk_sort_count;
      goto show_sort;
   }

   if(delta >= clk_sort[clk_sort_count-1]) {  // insert at end of list
      clk_sort[clk_sort_count] = delta;
      ++clk_sort_count;
      goto show_sort;
   }

   for(i=0; i<=clk_sort_count; i++) {  // insert new value into sorted list
      for(k=0; k<clk_sort_count; k++) {  // see where this value lies in the list so far
         if(delta > clk_sort[k]) continue;  // it's greater than the current value

         for(m=clk_sort_count; m>k; m--) {  // move lower value entries down one position
            clk_sort[m] = clk_sort[m-1];
         }

         clk_sort[k] = delta;   // insert new value in the list
         ++clk_sort_count;
         goto show_sort;
      }
   }
   return 0.0;

   show_sort:
// sprintf(plot_title, "sort %d: ", clk_sort_count);  // rrrrr
// for(i=0; i<clk_sort_count; i++) {
//    sprintf(out, "%.1f ", clk_sort[i]);
//    strcat(plot_title, out);
// }

   return 0.0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x29341d(%rip), %eax    # 0x364a80
testl %eax, %eax
js 0xd16df
cmpl $0xa, %eax
jb 0xd16a2
shrl %eax
leaq 0x2933ab(%rip), %rcx    # 0x364a20
movsd (%rcx,%rax,8), %xmm0
movl %eax, %edx
decl %edx
addsd (%rcx,%rdx,8), %xmm0
addsd 0x8(%rcx,%rax,8), %xmm0
divsd 0x243ef(%rip), %xmm0    # 0xf5a80
andl $0x0, 0x2933e8(%rip)    # 0x364a80
andpd 0x21af0(%rip), %xmm0    # 0xf3190
jmp 0xd16f5
testq %rax, %rax
je 0xd16df
leal -0x1(%rax), %ecx
leaq 0x29336f(%rip), %rdx    # 0x364a20
ucomisd (%rdx,%rcx,8), %xmm0
jae 0xd16f7
leal 0x1(%rax), %ecx
xorl %edi, %edi
cmpl %ecx, %edi
je 0xd16f1
movq %rdx, %rsi
xorl %r8d, %r8d
cmpq %r8, %rax
je 0xd16db
ucomisd (%rsi), %xmm0
jbe 0xd1706
incq %r8
addq $0x8, %rsi
jmp 0xd16c7
incl %edi
jmp 0xd16bd
movsd %xmm0, 0x293339(%rip)   # 0x364a20
movl $0x1, 0x29338f(%rip)    # 0x364a80
xorpd %xmm0, %xmm0
popq %rbp
retq
movsd %xmm0, (%rdx,%rax,8)
incl %eax
movl %eax, 0x29337c(%rip)    # 0x364a80
jmp 0xd16f1
leaq 0x293313(%rip), %rdx    # 0x364a20
cmpq %r8, %rax
jle 0xd1722
movsd -0x8(%rdx,%rax,8), %xmm1
movsd %xmm1, (%rdx,%rax,8)
decq %rax
jmp 0xd170d
movsd %xmm0, (%rsi)
movl %ecx, 0x293354(%rip)    # 0x364a80
jmp 0xd16f1
// File: /workspace/github_cpp_makefile_star2_O2/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 0x292cea(%rip)          # 0x3645b4
callq 0xd2465
movaps %xmm0, %xmm1
movsd %xmm0, -0x8(%rbp)
movsd -0x10(%rbp), %xmm0
callq 0xd25ac
subsd -0x8(%rbp), %xmm0
mulsd 0x2409a(%rip), %xmm0    # 0xf5988
callq 0x9710
movsd 0x21775(%rip), %xmm1    # 0xf3070
subsd %xmm0, %xmm1
mulsd 0x21761(%rip), %xmm1    # 0xf3068
movapd %xmm1, %xmm0
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x8353c(%rip), %r8      # 0x154e58
xorl %ecx, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq $0x16e, %rcx            # imm = 0x16E
je 0xd194a
cmpl %edi, -0x8(%r8)
je 0xd193b
incq %rcx
addq $0x18, %r8
jmp 0xd1923
cmpl $0x0, (%r8)
je 0xd1948
movl %esi, (%r8)
movl %edx, -0x4(%r8)
movl %ecx, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x83501(%rip), %rcx     # 0x154e58
xorl %eax, %eax
cmpq $0x16e, %rax            # imm = 0x16E
je 0xd197b
cmpl $0x0, (%rcx)
jne 0xd1972
cmpl $0x0, -0x4(%rcx)
jne 0xd1972
cmpl $0x0, -0x8(%rcx)
je 0xd1980
incq %rax
addq $0x18, %rcx
jmp 0xd1959
movl $0x16e, %eax            # imm = 0x16E
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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:
movabsq $0x8, %rax
leaq 0x834bd(%rip), %rcx     # 0x154e50
cmpq $0x2258, %rax           # imm = 0x2258
je 0xd19ab
andl $0x0, (%rax,%rcx)
andq $0x0, -0x8(%rax,%rcx)
addq $0x18, %rax
jmp 0xd1993
pushq %rbp
movq %rsp, %rbp
leaq 0x130e3a(%rip), %rax    # 0x2027f0
andl $0x0, (%rax)
popq %rbp
retq