LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: lars_data(char*)
int lars_data(char *buf)
{
int i;

   // returns true if data in buf looks like it comes from a Lars GPSDO

   i = 0;
   if(strstr(buf, "LARS")) i = 1;
   if(strstr(buf, "HELP+INFO")) i = 2;
   if(strstr(buf, "NO PPS")) i = 3;
   if(strstr(buf, "WARMUP")) i = 10;
   if(strstr(buf, "NOLOCK")) i = 11;
   if(strstr(buf, "LOCKED"))i = 12;
   if((i >= 10) && !strchr(buf, '\t')) return 0;
   return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x794fd(%rip), %rsi     # 0x1262a1
callq 0x9090
xorl %r14d, %r14d
testq %rax, %rax
setne %r14b
leaq 0x794ec(%rip), %rsi     # 0x1262a6
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
movl $0x2, %r15d
cmovel %r14d, %r15d
leaq 0x794da(%rip), %rsi     # 0x1262b0
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
movl $0x3, %r14d
cmovel %r15d, %r14d
leaq 0x78856(%rip), %rsi     # 0x125648
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
movl $0xa, %r15d
cmovel %r14d, %r15d
leaq 0x794a9(%rip), %rsi     # 0x1262b7
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
movl $0xb, %r12d
cmovel %r15d, %r12d
leaq 0x7becb(%rip), %rsi     # 0x128cf5
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
movl $0xc, %r14d
cmovel %r12d, %r14d
cmpl $0xa, %r14d
jb 0xace5a
movq %rbx, %rdi
movl $0x9, %esi
callq 0x9100
testq %rax, %rax
jne 0xace5a
xorl %r14d, %r14d
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: hp_time(char*)
double hp_time(char *s)
{
unsigned i, j;

   // convert an HP formatted time string to a normal number by removing
   // embedded commas.  Returns the time as a double.

   j = 0;
   for(i=0; i<strlen(s); i++) {  // remove commas
      if(s[i] != ',') {
         s[j++] = s[i];
      }
   }
   s[j] = 0;

   return atof(s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
cmpb $0x0, (%rdi)
je 0xad797
movl $0x1, %r15d
xorl %r12d, %r12d
movb (%rbx,%r12), %al
cmpb $0x2c, %al
je 0xad781
movl %r14d, %ecx
incl %r14d
movb %al, (%rbx,%rcx)
movl %r15d, %r12d
movq %rbx, %rdi
callq 0x9120
incl %r15d
cmpq %r12, %rax
ja 0xad770
movl %r14d, %r14d
movb $0x0, (%rbx,%r14)
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x9470
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: ticc_phase(char*, int, double, double)
double ticc_phase(char *id, int ticc_mode, double val, double last_val)
{
   // convert TICC/counter readings to phase values

   if((ticc_mode == 'T') || (ticc_mode == 'D') || (ticc_mode == 'L')) { // TICC is in a timestamp mode
      if((TS_WRAP_INTERVAL != 0.0) && (timestamp_wrap == 0.0)) {   // limit time stamps to TS_WRAP_INTERVAL (100.0) seconds
         val = fmod(val, TS_WRAP_INTERVAL);
         last_val = fmod(last_val, TS_WRAP_INTERVAL);
      }

      val -= last_val;     // convert consecutive time stamps to time interval
      if(val <= 0.0) {     // time stamps wrapped, adjust the interval
         if(timestamp_wrap == 0.0) val += TS_WRAP_INTERVAL;  // !!!!! what if still negative? 
         else                      val += timestamp_wrap; //       ... looping could take forever on a bogus value
      }
   }
   else if(ticc_mode == 'P') {  // time interval between samples on same channel
   }
   else if(ticc_mode == 'H') {  // phase
   }
   else if(ticc_mode == 'I') {  // time interval between two channels
      val -= last_val;
   }
   else if(ticc_mode == 'F') {  // frequency counter
      if(nominal_cha_freq <= 0.0) nominal_cha_freq = NOMINAL_FREQ;
      val = ((val - nominal_cha_freq) / nominal_cha_freq) * pps_adev_period;
   }

   return val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
movapd %xmm0, %xmm2
leal -0x44(%rsi), %eax
cmpl $0x8, %eax
ja 0xad80b
leaq 0x723a0(%rip), %rcx     # 0x11fb68
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x25f190(%rip), %rax    # 0x30c968
xorpd %xmm0, %xmm0
ucomisd (%rax), %xmm0
jb 0xad7ef
movabsq $0x416312d000000000, %rcx # imm = 0x416312D000000000
movq %rcx, (%rax)
movsd (%rax), %xmm0
subsd %xmm0, %xmm2
divsd %xmm0, %xmm2
leaq 0x18f4fe(%rip), %rax    # 0x23cd00
mulsd (%rax), %xmm2
jmp 0xad897
cmpl $0x54, %esi
jne 0xad897
leaq 0x25f1dd(%rip), %rbx    # 0x30c9f8
movsd (%rbx), %xmm0
xorpd %xmm3, %xmm3
ucomisd %xmm3, %xmm0
jne 0xad869
jp 0xad869
movsd 0x5b82d(%rip), %xmm3    # 0x109060
movapd %xmm2, %xmm0
movsd %xmm1, -0x18(%rbp)
movapd %xmm3, %xmm1
callq 0x94d0
movsd %xmm0, -0x10(%rbp)
movsd -0x18(%rbp), %xmm0
movsd 0x5b809(%rip), %xmm1    # 0x109060
callq 0x94d0
xorpd %xmm3, %xmm3
movsd -0x10(%rbp), %xmm2
movapd %xmm0, %xmm1
subsd %xmm1, %xmm2
ucomisd %xmm2, %xmm3
jb 0xad897
movsd (%rbx), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xad893
jp 0xad893
addsd 0x5b7d5(%rip), %xmm2    # 0x109060
jmp 0xad897
subsd %xmm1, %xmm2
jmp 0xad897
addsd %xmm0, %xmm2
movapd %xmm2, %xmm0
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: send_track_port()
void send_track_port()
{
int i, j;

   // send message "out" to the TRACK_PORT

   j = strlen(out);
   for(i=0; i<j; i++) {
      sendout(TRACK_PORT, (u08) out[i], ADD_CHAR);
   }
   sendout(TRACK_PORT, 0x0D, ADD_CHAR);
   sendout(TRACK_PORT, 0x0A, ADD_CHAR);
   sendout(TRACK_PORT, 0, FLUSH_COM);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x28e545(%rip), %rbx    # 0x33c220
movq %rbx, %rdi
callq 0x9120
movq %rax, %r14
testl %r14d, %r14d
jle 0xadd0e
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
xorl %r15d, %r15d
movzbl (%rbx,%r15), %esi
movl $0x12, %edi
xorl %edx, %edx
callq 0xbcc0
incq %r15
cmpq %r15, %r14
jne 0xadcf5
movl $0x12, %edi
movl $0xd, %esi
xorl %edx, %edx
callq 0xbcc0
movl $0x12, %edi
movl $0xa, %esi
xorl %edx, %edx
callq 0xbcc0
movl $0x12, %edi
xorl %esi, %esi
movl $0x2, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xbcc0
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: send_prn_azel(int)
void send_prn_azel(int prn)
{
   // send sat az/el out the TRACK_PORT if it is enabled

   if((prn >= 1) && (prn <= MAX_PRN)) {
      sprintf(out, "PRN %3d: %9.3f %9.3f", prn, sat[prn].azimuth, sat[prn].elevation);
   }
   else {  // invalid satellite
      strcpy(out, "PRN: 000");
   }
   send_track_port();
}

// Assembly:
movl %edi, %edx
leal -0x1(%rdx), %eax
cmpl $0x3e6, %eax            # imm = 0x3E6
ja 0xadd98
pushq %rbp
movq %rsp, %rbp
movl %edx, %eax
imulq $0x348, %rax, %rax      # imm = 0x348
leaq 0x191245(%rip), %rcx    # 0x23efb0
cvtss2sd 0x208(%rcx,%rax), %xmm0
cvtss2sd 0x20c(%rcx,%rax), %xmm1
leaq 0x28e49c(%rip), %rdi    # 0x33c220
leaq 0x78712(%rip), %rsi     # 0x12649d
movb $0x2, %al
callq 0x9060
popq %rbp
jmp 0xadcca
leaq 0x28e481(%rip), %rax    # 0x33c220
movabsq $0x303030203a4e5250, %rcx # imm = 0x303030203A4E5250
movq %rcx, (%rax)
movb $0x0, 0x8(%rax)
jmp 0xadcca
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: highest_sat()
int highest_sat()
{
float el;
int prn;
int i;

   // return the PRN of the highest elevation satellite

   prn = 0;
   el = 0.0;
   for(i=1; i<=MAX_PRN; i++) { 
      if(sat[i].tracking > 0) {
         if(sat[i].elevation > el) {
            el = sat[i].elevation;
            prn = i;
         }
      }
   }
   return prn;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorps %xmm0, %xmm0
xorl %eax, %eax
movl $0x1, %ecx
movl $0x560, %edx            # imm = 0x560
leaq 0x1911e1(%rip), %rsi    # 0x23efb0
cmpl $0x0, (%rsi,%rdx)
jle 0xadde5
movss -0xc(%rsi,%rdx), %xmm1
ucomiss %xmm0, %xmm1
jbe 0xadde5
movaps %xmm1, %xmm0
movl %ecx, %eax
incl %ecx
addq $0x348, %rdx            # imm = 0x348
cmpq $0xcd358, %rdx          # imm = 0xCD358
jne 0xaddcf
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: show_sun_moon(int, int)
void show_sun_moon(int row, int col)
{
   sun_moon_shown = 0;
   if(all_adevs) return;

//sprintf(plot_title, "zoom: %c   params:%d", zoom_screen, osc_params);
   sun_moon_shown = col;
   if(luxor) {
      sun_el = sun_posn(jd_utc, 0);
      have_sun_el = 1;
      log_sun_posn();

      if(do_moonrise) calc_moonrise();
      else            calc_sunrise(0.0, 21);
      --row;
   }
   else if(rcvr_type == NO_RCVR) ++row;
   else if(1 && (rcvr_type == RFTG_RCVR) && osc_params) {
      if(zoom_screen == 'C') return;
      if(zoom_screen == 'L') return;
   }
// else if(SCREEN_HEIGHT >= SHORT_SCREEN) ; // ++row;
// if(rcvr_type == TSIP_RCVR) col += 42;  // gggg

   show_sun_azel(row+1, col);
   if(text_mode || (SCREEN_HEIGHT >= MEDIUM_HEIGHT)) {
      show_moon_azel(row+4-1, col);
      show_sun_rise_set(row+3+3, col);
   }
   else if(1 || luxor || (SCREEN_HEIGHT >= SHORT_SCREEN) || (rcvr_type == NO_RCVR)) {
      show_moon_azel(row+3, col);
      show_sun_rise_set(row+3+3, col);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0xc25dc(%rip), %rax     # 0x170c6c
movl $0x0, (%rax)
leaq 0x18e6a1(%rip), %rcx    # 0x23cd3e
cmpb $0x0, (%rcx)
je 0xae6a7
popq %rbx
popq %r14
popq %rbp
retq
movl %esi, %ebx
movl %edi, %r14d
movl %esi, (%rax)
leaq 0x190889(%rip), %rax    # 0x23ef3e
cmpb $0x0, (%rax)
je 0xae6fc
leaq 0x25ee6f(%rip), %rax    # 0x30d530
movsd (%rax), %xmm0
xorl %edi, %edi
callq 0xe77bd
leaq 0x25f0e5(%rip), %rax    # 0x30d7b8
movsd %xmm0, (%rax)
leaq 0x25f0ea(%rip), %rax    # 0x30d7c8
movl $0x1, (%rax)
callq 0xf49ab
leaq 0x25ef90(%rip), %rax    # 0x30d680
cmpl $0x0, (%rax)
je 0xae713
callq 0xe82a0
jmp 0xae720
leaq 0x16a1cd(%rip), %rax    # 0x2188d0
movq (%rax), %rax
cmpq $0x400, %rax            # imm = 0x400
jne 0xae74b
incl %r14d
jmp 0xae723
xorps %xmm0, %xmm0
movl $0x15, %edi
callq 0xe8764
decl %r14d
leal 0x1(%r14), %edi
movl %ebx, %esi
callq 0xaddf9
leal 0x3(%r14), %edi
movl %ebx, %esi
callq 0xadff5
addl $0x6, %r14d
movl %r14d, %edi
movl %ebx, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0xae27b
cmpq $0x400000, %rax         # imm = 0x400000
jne 0xae723
leaq 0x25e992(%rip), %rax    # 0x30d0ec
cmpb $0x0, (%rax)
je 0xae723
leaq 0x25e042(%rip), %rax    # 0x30c7a8
movzbl (%rax), %eax
cmpl $0x43, %eax
je 0xae6a2
cmpl $0x4c, %eax
je 0xae6a2
jmp 0xae723
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: warn_info_needed()
void warn_info_needed()
{
int i;

   // warn the user we need location and/or UTC offset

   i = 0;
   if((lat != 0.0) || (lon != 0.0)) ;
   else {
      vidstr(VAL_ROW+i,VAL_COL, RED, "No location set.  ");
      ++i;
      vidstr(VAL_ROW+i,VAL_COL, RED, "Use the SL command");
      ++i;
      vidstr(VAL_ROW+i,VAL_COL, RED, "to set it.        ");
      ++i;
      if(rcvr_type == NO_RCVR) ++i;
   }

   if(have_utc_ofs < 0) {    // using estimated value
      vidstr(VAL_ROW+i,VAL_COL, RED, "UTC leapsecond   ");
      ++i;
      vidstr(VAL_ROW+i,VAL_COL, RED, "offset guessed.  ");
      ++i;
      vidstr(VAL_ROW+i,VAL_COL, RED, "Use the /uo=#    ");
      ++i;
      vidstr(VAL_ROW+i,VAL_COL, RED, "command to set it");
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x25c524(%rip), %rax    # 0x30cfd0
movsd (%rax), %xmm1
xorl %ebx, %ebx
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0xb0b35
jp 0xb0b35
leaq 0x25c513(%rip), %rax    # 0x30cfd8
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jne 0xb0b35
jp 0xb0b35
leaq 0x76339(%rip), %rcx     # 0x126e11
xorl %edi, %edi
movl $0xf, %esi
movl $0xc, %edx
callq 0xe7d0
leaq 0x76334(%rip), %rcx     # 0x126e24
movl $0x1, %edi
movl $0xf, %esi
movl $0xc, %edx
callq 0xe7d0
leaq 0x7632c(%rip), %rcx     # 0x126e37
movl $0x2, %edi
movl $0xf, %esi
movl $0xc, %edx
callq 0xe7d0
leaq 0x167daa(%rip), %rax    # 0x2188d0
xorl %ebx, %ebx
cmpq $0x400, (%rax)          # imm = 0x400
sete %bl
addl $0x3, %ebx
leaq 0x25c7e0(%rip), %rax    # 0x30d31c
cmpl $0x0, (%rax)
js 0xb0b48
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x762fb(%rip), %rcx     # 0x126e4a
movl %ebx, %edi
movl $0xf, %esi
movl $0xc, %edx
callq 0xe7d0
leal 0x1(%rbx), %edi
leaq 0x762f2(%rip), %rcx     # 0x126e5c
movl $0xf, %esi
movl $0xc, %edx
callq 0xe7d0
leal 0x2(%rbx), %edi
leaq 0x762eb(%rip), %rcx     # 0x126e6e
movl $0xf, %esi
movl $0xc, %edx
callq 0xe7d0
addl $0x3, %ebx
leaq 0x762e4(%rip), %rcx     # 0x126e80
movl %ebx, %edi
movl $0xf, %esi
movl $0xc, %edx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xe7d0
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: utm_lon_zone(double, double)
int utm_lon_zone(double dLat, double dLon)
{
int zone;

   // longitude must be between -180.00 .. 179.9
   if((dLon < -180.0) || (dLon > 180.0)) return (0); // implies failure: 0 is an invalid utm zone

   zone = (int)((180.0 + dLon) / 6.0 + 1.0);

   if((dLat >= 56.0) && (dLat < 64.0)) { // sw Norge (ie, zone 32V)
     if((dLon >= 3.0) && (dLon < 12.0)) zone = 32;
   }
   else if((dLat >= 72.0 && dLat < 84.0)) {  // special zones for Svalbard
     if     ((dLon >= 0.0)  && (dLon < 9.0))  zone = 31;
     else if((dLon >= 9.0)  && (dLon < 21.0)) zone = 33;
     else if((dLon >= 21.0) && (dLon < 33.0)) zone = 35;
     else if((dLon >= 33.0) && (dLon < 42.0)) zone = 37;
   }

   return zone;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movapd 0x55e08(%rip), %xmm2    # 0x109180
andpd %xmm1, %xmm2
xorl %eax, %eax
ucomisd 0x5849a(%rip), %xmm2    # 0x10b820
ja 0xb347e
movsd 0x5848c(%rip), %xmm2    # 0x10b820
addsd %xmm1, %xmm2
divsd 0x6b350(%rip), %xmm2    # 0x11e6f0
addsd 0x55cc8(%rip), %xmm2    # 0x109070
cvttsd2si %xmm2, %ecx
ucomisd 0x6b44c(%rip), %xmm0    # 0x11e800
jb 0xb33e8
movsd 0x6b44a(%rip), %xmm2    # 0x11e808
ucomisd %xmm0, %xmm2
jbe 0xb33e8
movsd 0x6b3f4(%rip), %xmm0    # 0x11e7c0
ucomisd %xmm1, %xmm0
movl $0x20, %eax
cmovbel %ecx, %eax
ucomisd 0x58628(%rip), %xmm1    # 0x10ba08
cmovbl %ecx, %eax
jmp 0xb347e
ucomisd 0x6b420(%rip), %xmm0    # 0x11e810
jb 0xb347c
movsd 0x6b41a(%rip), %xmm2    # 0x11e818
ucomisd %xmm0, %xmm2
jbe 0xb347c
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jb 0xb3421
movl $0x1f, %eax
movsd 0x6b33d(%rip), %xmm0    # 0x11e758
ucomisd %xmm1, %xmm0
ja 0xb347e
ucomisd 0x6b32f(%rip), %xmm1    # 0x11e758
jb 0xb343e
movl $0x21, %eax
movsd 0x6b3e8(%rip), %xmm0    # 0x11e820
ucomisd %xmm1, %xmm0
ja 0xb347e
ucomisd 0x6b3da(%rip), %xmm1    # 0x11e820
jb 0xb345b
movl $0x23, %eax
movsd 0x6b3d3(%rip), %xmm0    # 0x11e828
ucomisd %xmm1, %xmm0
ja 0xb347e
movsd 0x6b3cd(%rip), %xmm0    # 0x11e830
ucomisd %xmm1, %xmm0
movl $0x25, %eax
cmovbel %ecx, %eax
ucomisd 0x6b3b1(%rip), %xmm1    # 0x11e828
jmp 0xb33e0
movl %ecx, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: lla_to_ups(double, double)
void lla_to_ups(double lat, double lon)
{
double c0;
double tz;
double R;
double dlat;

   // convert lat/lon to Universal Polar Stereographic coords

   dlat = lat;

   lat = fabs(lat);  // !!!!!!! is this correct?

   c0 = (1.0-WGS84_E) / (1.0+WGS84_E);
   c0 = pow(c0, WGS84_E/2.0);
   c0 *= ((2.0*WGS84_A) / sqrt(1.0-eccSquared));

   tz = (1.0 + WGS84_E*sin(lat)) / (1.0 - WGS84_E*sin(lat));
   tz = pow(tz, WGS84_E/2.0);
   tz *= tan(PI/4.0 - lat/2.0);

   R = 0.994 * c0 * tz;

   if(dlat >= 0.0) UTMNorthing = 2000000.0 - R*cos(lon);
   else            UTMNorthing = 2000000.0 + R*cos(lon);

   UTMEasting = 2000000.0 + R*sin(lon);
//sprintf(plot_title, "c0:%f tz:%f R:%f N:%f E:%f", c0,tz,R, UTMNorthing,UTMEasting);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movsd %xmm1, -0x28(%rbp)
movapd %xmm0, -0x40(%rbp)
movapd 0x559b9(%rip), %xmm1    # 0x109180
andpd %xmm0, %xmm1
movapd %xmm1, -0x20(%rbp)
movapd %xmm1, %xmm0
callq 0x9080
mulsd 0x6b0a7(%rip), %xmm0    # 0x11e888
addsd 0x55887(%rip), %xmm0    # 0x109070
movsd %xmm0, -0x8(%rbp)
movapd -0x20(%rbp), %xmm0
callq 0x9080
mulsd 0x6b090(%rip), %xmm0    # 0x11e890
addsd 0x55868(%rip), %xmm0    # 0x109070
movsd -0x8(%rbp), %xmm2
divsd %xmm0, %xmm2
movsd 0x6b07f(%rip), %xmm1    # 0x11e898
movapd %xmm2, %xmm0
callq 0x96b0
movsd %xmm0, -0x8(%rbp)
movapd -0x20(%rbp), %xmm0
mulsd 0x5814c(%rip), %xmm0    # 0x10b980
addsd 0x6b064(%rip), %xmm0    # 0x11e8a0
callq 0x91b0
mulsd -0x8(%rbp), %xmm0
mulsd 0x6b05a(%rip), %xmm0    # 0x11e8a8
movapd %xmm0, -0x20(%rbp)
movsd -0x28(%rbp), %xmm0
callq 0x9710
movapd 0x5593b(%rip), %xmm1    # 0x1091a0
movapd -0x20(%rbp), %xmm4
xorpd %xmm4, %xmm1
xorpd %xmm2, %xmm2
cmpnlesd -0x40(%rbp), %xmm2
movapd %xmm2, %xmm3
andpd %xmm4, %xmm3
andnpd %xmm1, %xmm2
orpd %xmm3, %xmm2
mulsd %xmm0, %xmm2
addsd 0x6b01c(%rip), %xmm2    # 0x11e8b0
movsd %xmm2, 0x2c2c94(%rip)   # 0x376530
movsd -0x28(%rbp), %xmm0
callq 0x9080
mulsd -0x20(%rbp), %xmm0
addsd 0x6affd(%rip), %xmm0    # 0x11e8b0
movsd %xmm0, 0x2c2c7d(%rip)   # 0x376538
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: dms_fmt(double)
char *dms_fmt(double x)
{
int deg, min;
double sec;
static char s[128+1];
char sign;

   if(x < 0.0) {
      x = 0.0-x;
      sign = '-';
   }
   else sign = '+';

   deg = (int) x;
   min = (int) (60.0 * ((double) x - (double) deg));
   sec = ((x - (double) deg) - ((double) min / 60.0)) * 3600.0;
   sprintf(s, "%c%2dd %02dm %9.6fs", sign, deg, min, sec);
   return &s[0];
}

// Assembly:
xorpd %xmm1, %xmm1
xorl %eax, %eax
ucomisd %xmm0, %xmm1
seta %cl
jbe 0xb3dd0
subsd %xmm0, %xmm1
movapd %xmm1, %xmm0
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movb %cl, %al
leal 0x2b(%rax,%rax), %edx
cvttsd2si %xmm0, %ecx
cvttpd2dq %xmm0, %xmm1
cvtdq2pd %xmm1, %xmm1
subsd %xmm1, %xmm0
movsd 0x55214(%rip), %xmm1    # 0x109008
movapd %xmm0, %xmm2
mulsd %xmm1, %xmm2
cvttsd2si %xmm2, %r8d
cvttpd2dq %xmm2, %xmm2
cvtdq2pd %xmm2, %xmm2
divsd %xmm1, %xmm2
subsd %xmm2, %xmm0
mulsd 0x551f7(%rip), %xmm0    # 0x109010
leaq 0x2c2760(%rip), %rbx    # 0x376580
leaq 0x733c6(%rip), %rsi     # 0x1271ed
movq %rbx, %rdi
movb $0x1, %al
callq 0x9060
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: show_build_info(int)
void show_build_info(int force)
{
   if(rcvr_type != TSIP_RCVR) return;

   if(build_month > 12) build_month = 0;
   if(build_ok || force) {
      sprintf(out, "Mfg: %02d:00  %02d %s %04d", 
         build_hour, build_day, months[build_month], build_year);
      vidstr(VER_ROW+3, VER_COL, WHITE, out);
   }
}

// Assembly:
leaq 0x15f873(%rip), %rax    # 0x2188d0
cmpq $0x1, (%rax)
jne 0xb90f4
leaq 0x25491c(%rip), %rax    # 0x30d98a
cmpb $0xd, (%rax)
jb 0xb9076
movb $0x0, (%rax)
leaq 0x254377(%rip), %rcx    # 0x30d3f4
orl (%rcx), %edi
je 0xb90f4
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x2548fe(%rip), %rcx    # 0x30d98c
movzbl (%rcx), %edx
leaq 0x2548f3(%rip), %rcx    # 0x30d98b
movzbl (%rcx), %ecx
movzbl (%rax), %eax
leaq 0xb169b(%rip), %rsi     # 0x16a740
movq (%rsi,%rax,8), %r8
leaq 0x2548d8(%rip), %rax    # 0x30d988
movzwl (%rax), %r9d
leaq 0x283165(%rip), %rbx    # 0x33c220
leaq 0x6ee50(%rip), %rsi     # 0x127f12
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
leaq 0x15f6c1(%rip), %rax    # 0x218794
movl (%rax), %edi
addl $0x3, %edi
leaq 0x15f6b9(%rip), %rax    # 0x218798
movl (%rax), %esi
movl $0xf, %edx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xe7d0
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: show_unit_info()
void show_unit_info()
{
   if(rcvr_type != TSIP_RCVR) return;
   if(ap_month > 12) ap_month = 0;
   if(core_month > 12) core_month = 0;

   if(have_info & VERSION_INFO) {
      if(unit_name[0] == 0) {
         sprintf(out, "App: %2d.%-2d  %02d %s %02d", 
            ap_major, ap_minor,  ap_day, months[ap_month], ap_year);   //!!! docs say 1900
         vidstr(VER_ROW+1, VER_COL, WHITE, out);
      }

      sprintf(out, "GPS: %2d.%-2d  %02d %s %02d", 
         core_major, core_minor,  core_day, months[core_month], core_year);  //!!! docs say 1900
      vidstr(VER_ROW+2, VER_COL, WHITE, out);
   }

   show_build_info(0);
}

// Assembly:
leaq 0x15f7d4(%rip), %rax    # 0x2188d0
cmpq $0x1, (%rax)
jne 0xb9244
leaq 0x254899(%rip), %rax    # 0x30d9a6
cmpb $0xd, (%rax)
jb 0xb9115
movb $0x0, (%rax)
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0x254885(%rip), %r14    # 0x30d9ac
cmpb $0xd, (%r14)
jb 0xb9131
movb $0x0, (%r14)
leaq 0x25483c(%rip), %rcx    # 0x30d974
testb $0x4, (%rcx)
je 0xb9235
leaq 0x2834f8(%rip), %rcx    # 0x33c640
cmpb $0x0, (%rcx)
jne 0xb91c0
leaq 0x254850(%rip), %rcx    # 0x30d9a4
movzbl (%rcx), %edx
leaq 0x254847(%rip), %rcx    # 0x30d9a5
movzbl (%rcx), %ecx
leaq 0x25483f(%rip), %rsi    # 0x30d9a7
movzbl (%rsi), %r8d
movzbl (%rax), %eax
leaq 0xb15ca(%rip), %rsi     # 0x16a740
movq (%rsi,%rax,8), %r9
leaq 0x254827(%rip), %rax    # 0x30d9a8
movzwl (%rax), %eax
movl %eax, (%rsp)
leaq 0x283092(%rip), %rbx    # 0x33c220
leaq 0x6ed98(%rip), %rsi     # 0x127f2d
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
leaq 0x15f5ee(%rip), %rax    # 0x218794
movl (%rax), %edi
incl %edi
leaq 0x15f5e7(%rip), %rax    # 0x218798
movl (%rax), %esi
movl $0xf, %edx
movq %rbx, %rcx
callq 0xe7d0
leaq 0x2547e3(%rip), %rax    # 0x30d9aa
movzbl (%rax), %edx
leaq 0x2547da(%rip), %rax    # 0x30d9ab
movzbl (%rax), %ecx
leaq 0x2547d2(%rip), %rax    # 0x30d9ad
movzbl (%rax), %r8d
movzbl (%r14), %eax
leaq 0xb1556(%rip), %rsi     # 0x16a740
movq (%rsi,%rax,8), %r9
leaq 0x2547b9(%rip), %rax    # 0x30d9ae
movzwl (%rax), %eax
movl %eax, (%rsp)
leaq 0x28301e(%rip), %rbx    # 0x33c220
leaq 0x6ed40(%rip), %rsi     # 0x127f49
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
leaq 0x15f57a(%rip), %rax    # 0x218794
movl (%rax), %edi
addl $0x2, %edi
leaq 0x15f572(%rip), %rax    # 0x218798
movl (%rax), %esi
movl $0xf, %edx
movq %rbx, %rcx
callq 0xe7d0
xorl %edi, %edi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0xb9056
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: show_ebolt_info()
void show_ebolt_info()
{
   show_build_info(1);

#ifdef WINDOWS
   if(com[RCVR_PORT].com_port >= 10)      sprintf(out, "Ser: %2u.%-8lu COM:%d",  hw_code, (unsigned long) ebolt_serno, com[RCVR_PORT].com_port);
   else if (com[RCVR_PORT].com_port)      sprintf(out, "Ser: %2u.%-8lu  COM:%d", hw_code, (unsigned long) ebolt_serno, com[RCVR_PORT].com_port);
#else   // __linux__  __MACH__  __FreeBSD__
   if(com[RCVR_PORT].com_port >= 10)      sprintf(out, "Ser: %2u.%-8lu TTY:%d",  hw_code, (unsigned long) ebolt_serno, com[RCVR_PORT].com_port-1);
   else if (com[RCVR_PORT].com_port)      sprintf(out, "Ser: %2u.%-8lu  TTY:%d", hw_code, (unsigned long) ebolt_serno, com[RCVR_PORT].com_port-1);
#endif
   else if(com[RCVR_PORT].usb_port >= 10) sprintf(out, "Ser: %2u.%-8lu USB:%d",  hw_code, (unsigned long) ebolt_serno, com[RCVR_PORT].usb_port-1);
   else if(com[RCVR_PORT].usb_port)       sprintf(out, "Ser: %2u.%-8lu  USB:%d", hw_code, (unsigned long) ebolt_serno, com[RCVR_PORT].usb_port-1);
#ifdef TCP_IP 
   else if(com[RCVR_PORT].IP_addr[0]) {
      sprintf(out," IP: %-17.17ss", com[RCVR_PORT].IP_addr); // TCP 
   }
#endif
   else {
      sprintf(out," COM: none");
   }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0x1, %edi
callq 0xb9056
leaq 0x255086(%rip), %rax    # 0x30e2e0
movl 0x157c0(%rax), %r8d
cmpl $0xa, %r8d
jl 0xb928a
leaq 0x254734(%rip), %rax    # 0x30d9a2
movzwl (%rax), %edx
movl 0x2b2b8d(%rip), %ecx    # 0x36be04
decl %r8d
leaq 0x282f9f(%rip), %rdi    # 0x33c220
leaq 0x6ece6(%rip), %rsi     # 0x127f6e
jmp 0xb9308
testl %r8d, %r8d
je 0xb92b2
leaq 0x25470c(%rip), %rax    # 0x30d9a2
movzwl (%rax), %edx
movl 0x2b2b65(%rip), %ecx    # 0x36be04
decl %r8d
leaq 0x282f77(%rip), %rdi    # 0x33c220
leaq 0x6ecd4(%rip), %rsi     # 0x127f84
jmp 0xb9308
movl 0x157c4(%rax), %r8d
cmpl $0xa, %r8d
jl 0xb92e2
leaq 0x2546dc(%rip), %rax    # 0x30d9a2
movzwl (%rax), %edx
movl 0x2b2b35(%rip), %ecx    # 0x36be04
decl %r8d
leaq 0x282f47(%rip), %rdi    # 0x33c220
leaq 0x6ecbb(%rip), %rsi     # 0x127f9b
jmp 0xb9308
testl %r8d, %r8d
je 0xb9336
leaq 0x2546b4(%rip), %rax    # 0x30d9a2
movzwl (%rax), %edx
movl 0x2b2b0d(%rip), %ecx    # 0x36be04
decl %r8d
leaq 0x282f1f(%rip), %rdi    # 0x33c220
leaq 0x6eca9(%rip), %rsi     # 0x127fb1
xorl %eax, %eax
callq 0x9060
leaq 0x15f47e(%rip), %rax    # 0x218794
movl (%rax), %edi
addl $0x4, %edi
leaq 0x15f476(%rip), %rax    # 0x218798
movl (%rax), %esi
leaq 0x282ef5(%rip), %rcx    # 0x33c220
movl $0xf, %edx
popq %rbp
jmp 0xe7d0
cmpb $0x0, 0x158cd(%rax)
je 0xb9362
movl $0x158cd, %edx          # imm = 0x158CD
addq 0x96c95(%rip), %rdx     # 0x14ffe0
leaq 0x282ece(%rip), %rdi    # 0x33c220
leaq 0x6ec6f(%rip), %rsi     # 0x127fc8
xorl %eax, %eax
callq 0x9060
jmp 0xb930f
leaq 0x282eb7(%rip), %rax    # 0x33c220
movabsq $0x6f6e203a4d4f4320, %rcx # imm = 0x6F6E203A4D4F4320
movq %rcx, (%rax)
movl $0x656e6f, 0x7(%rax)    # imm = 0x656E6F
jmp 0xb930f
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: erase_info_col()
void erase_info_col()
{
int i;
int row;

   // erase the INFO_COL column from the top of the screen to the "VIEW:" line

   row = queue_row;
   if(all_adevs && (SCREEN_WIDTH < WIDE_WIDTH)) return;
   if(rcvr_type == NO_RCVR) return;

   for(i=0; i<=queue_row; i++) {  // erase old info
      if((i < 5) && (SCREEN_WIDTH < MEDIUM_WIDTH)) {  // don't overwrite possible sat prn values  pretty printing
         vidstr(i,INFO_COL, WHITE, "            ");
      }
      else {
         vidstr(i,INFO_COL, WHITE, "              ");
      }
   }

   info_row = 0;
   info_avail = queue_row+1;
}

// Assembly:
leaq 0x17c63e(%rip), %rax    # 0x23cd3e
cmpb $0x0, (%rax)
setne %al
leaq 0x1580f3(%rip), %rcx    # 0x218800
cmpl $0x4fa, (%rcx)          # imm = 0x4FA
setl %cl
testb %cl, %al
jne 0xc07bc
leaq 0x1581ab(%rip), %rax    # 0x2188d0
cmpq $0x400, (%rax)          # imm = 0x400
je 0xc07bc
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x158089(%rip), %r15    # 0x2187d0
movl (%r15), %eax
testl %eax, %eax
js 0xc079c
xorl %ebx, %ebx
leaq 0x73312(%rip), %r12     # 0x133a69
leaq 0x73309(%rip), %r13     # 0x133a67
leaq 0x158037(%rip), %r14    # 0x21879c
leaq 0x158094(%rip), %rax    # 0x218800
cmpl $0x3e2, (%rax)          # imm = 0x3E2
movq %r12, %rcx
jl 0xc077a
movq %r13, %rcx
cmpl $0x5, %ebx
movl (%r14), %esi
cmovaeq %r13, %rcx
movl %ebx, %edi
movl $0xf, %edx
callq 0xe7d0
leal 0x1(%rbx), %ecx
movl (%r15), %eax
cmpl %eax, %ebx
movl %ecx, %ebx
jl 0xc0765
movl $0x0, 0x2ab5f6(%rip)    # 0x36bd9c
incl %eax
movl %eax, 0x2ab5f2(%rip)    # 0x36bda0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: request_rcvr_info(int)
void request_rcvr_info(int why)
{
   // NEW_RCVR
   if(no_poll) return;
//wwwww if(SV6_FAMILY) return;  // prevent rcvr buffer overlow ttttt wwwww
if((rcvr_type == TSIP_RCVR) && (tsip_type == STARLOC_TYPE)) return;  // prevent rcvr buffer overlow ttttt wwwww
if(rcvr_type == BRANDY_RCVR) return;  // prevent receiver buffer overflow and time skips
if(rcvr_type == LPFRS_RCVR) return;   // speed up polling loop
if(rcvr_type == PRS_RCVR) return;     // speed up polling loop
if(rcvr_type == SA35_RCVR) return;    // speed up polling loop
if(rcvr_type == SRO_RCVR) return;     // speed up polling loop
if(rcvr_type == RFTG_RCVR) return;    // prevent receiver buffer overflow and time skips
if(rcvr_type == THERMO_RCVR) return;

   request_version();
   request_luxor_ver();        // no SV6
   if(luxor_time_set == 0) {   // no SV6
      set_luxor_time();
   }

   request_utc_info();

   request_pps_info();         // no SV6
   if(rcvr_type != BRANDY_RCVR) {  // request_pps_info does the same thing
      request_pps_mode();      
   }
   request_timing_mode();      // no SV6

   request_filter_config();
   request_rcvr_config(why);
   request_survey_params();    // no SV6

   if(rcvr_type != STAR_RCVR) {  // request_rcvr_config() did this
      request_all_dis_params();  // no SV6
   }

   request_sat_list();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x276855(%rip), %rax    # 0x337020
cmpb $0x0, (%rax)
jne 0xc07f2
leaq 0x1580f9(%rip), %r14    # 0x2188d0
movq (%r14), %rax
cmpq $0x1, %rax
sete %cl
leaq 0x15a7ec(%rip), %rdx    # 0x21afd4
cmpl $0x53, (%rdx)
sete %dl
testb %dl, %cl
je 0xc07f7
popq %rbx
popq %r14
popq %rbp
retq
movl %edi, %ebx
cmpq $0xffffff, %rax         # imm = 0xFFFFFF
jle 0xc081b
cmpq $0xfffffff, %rax        # imm = 0xFFFFFFF
jg 0xc0835
cmpq $0x1000000, %rax        # imm = 0x1000000
je 0xc07f2
cmpq $0x8000000, %rax        # imm = 0x8000000
je 0xc07f2
jmp 0xc084c
cmpq $0x40000, %rax          # imm = 0x40000
je 0xc07f2
cmpq $0x80000, %rax          # imm = 0x80000
je 0xc07f2
cmpq $0x400000, %rax         # imm = 0x400000
je 0xc07f2
jmp 0xc084c
cmpq $0x10000000, %rax       # imm = 0x10000000
je 0xc07f2
movabsq $0x1000000000, %rcx     # imm = 0x1000000000
cmpq %rcx, %rax
je 0xc07f2
callq 0x659e2
callq 0x7ca83
cmpb $0x0, 0x2ab5c1(%rip)    # 0x36be1e
jne 0xc0864
callq 0x64349
callq 0x61223
callq 0x6a9e7
cmpq $0x40000, (%r14)        # imm = 0x40000
je 0xc087c
callq 0x6c01e
callq 0x6d32a
callq 0x69afd
movl %ebx, %edi
callq 0x66617
callq 0x712d5
cmpq $0x1000, (%r14)         # imm = 0x1000
je 0xc08a0
callq 0x708b3
popq %rbx
popq %r14
popq %rbp
jmp 0x6627a
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: wakey_wakey()
void wakey_wakey()
{
if(PALISADE) return;
if(SV6_FAMILY) return;  //ttttt
if(sim_file) return;

   if(NO_SCPI_BREAK && (rcvr_type == SCPI_RCVR)) ; 
   else SendBreak(RCVR_PORT);

   enable_gpsd();  // gggg

   scpi_init(0);

//send_byte('#');  // for TAPR_TICC   aaaacccc

   send_byte(0x0D);        // for SCPI wakeup
   eom_flag = EOM;
   send_byte(0x0A);
   eom_flag = ADD_CHAR;
   Sleep(250);

   send_byte(0x0D);
   eom_flag = EOM;
   send_byte(0x0A);
   eom_flag = ADD_CHAR;
   Sleep(250);
////sendout(RCVR_PORT, 0, FLUSH_COM);
// drain_com_data();


// send_tsip_start(0x8E);  // init TSIP receiver to send packets
// send_byte(0xA5);
// send_byte(0x00);
// send_byte(0x55);
// send_byte(0x00);
// send_byte(0x00);
// send_tsip_end();

   if(com[RCVR_PORT].baud_rate == 115200) {  // wake up NVS_RCVR
      send_nvs_start(0x1F);   // 0x72 time message every second
      send_byte((u08) nav_rate);
      send_nvs_end();
   }

if(tsip_packets == 0) {
   send_moto_start("Bb");     // request Motorola sat visibility data
   send_byte(0);
   send_moto_end();

   send_moto_start("Wb");
   send_byte(1);              // for Jupiter-T: 0=MOTOROLA mode,  1=Jupiter-T mode
   send_moto_end();
}

   send_tsip_end();
   send_tsip_end();
   send_tsip_start(0x3C);     // request sat info
   send_byte(0x00);
   send_tsip_end();
////sendout(RCVR_PORT, 0, FLUSH_COM);

   drain_com_data();          // drain serial port data buffer

   reset_com_timer(RCVR_PORT);
}

// Assembly:
leaq 0x157cca(%rip), %rax    # 0x2188d0
movq (%rax), %rcx
cmpq $0x1, %rcx
sete %dl
leaq 0x15a3bd(%rip), %rax    # 0x21afd4
movl (%rax), %eax
cmpl $0x50, %eax
sete %sil
testb %sil, %dl
jne 0xc0c4c
leaq 0x17d794(%rip), %rdx    # 0x23e3c0
movq (%rdx), %rdx
cmpq $0x1, %rcx
jne 0xc0c4d
testq %rdx, %rdx
jne 0xc0c4c
addl $-0x33, %eax
cmpl $0x1d, %eax
ja 0xc0c52
movl $0x20004009, %ecx       # imm = 0x20004009
btl %eax, %ecx
jae 0xc0c52
retq
testq %rdx, %rdx
jne 0xc0c4c
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl $0xa, %edi
callq 0xaf8f
callq 0x6ecd0
movl $0xd, %edi
callq 0x591af
movl $0x1, %ebx
movl %ebx, 0x2ab193(%rip)    # 0x36be10
movl $0xa, %edi
callq 0x591af
xorl %r14d, %r14d
movl %r14d, 0x2ab17f(%rip)   # 0x36be10
movl $0xfa, %edi
callq 0xaff7
movl $0xd, %edi
callq 0x591af
movl %ebx, 0x2ab165(%rip)    # 0x36be10
movl $0xa, %edi
callq 0x591af
movl %r14d, 0x2ab154(%rip)   # 0x36be10
movl $0xfa, %edi
callq 0xaff7
leaq 0x24d613(%rip), %rax    # 0x30e2e0
cmpl $0x1c200, 0x159d0(%rax) # imm = 0x1C200
jne 0xc0cfb
movl $0x1f, %edi
callq 0x5e740
leaq 0x15a66e(%rip), %rax    # 0x21b358
cvttsd2si (%rax), %eax
movzbl %al, %edi
callq 0x591af
callq 0x5e844
cmpl $0x0, 0x2b00fa(%rip)    # 0x370dfc
jne 0xc0d37
leaq 0x5fb8b(%rip), %rdi     # 0x120896
callq 0x61694
xorl %edi, %edi
callq 0x591af
callq 0x6170f
leaq 0x5f7fa(%rip), %rdi     # 0x12051d
callq 0x61694
movl $0x1, %edi
callq 0x591af
callq 0x6170f
callq 0x5e7c0
callq 0x5e7c0
movl $0x3c, %edi
callq 0x5e740
xorl %edi, %edi
callq 0x591af
callq 0x5e7c0
callq 0x585ff
movl $0xa, %edi
popq %rbx
popq %r14
popq %rbp
jmp 0x1ea2c
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: ts_data(int)
int ts_data(int k)
{
   if(tsip_buf[k+0] != 0x01) return 0;
   if(tsip_buf[k+4] != ':') return 0;
   if(tsip_buf[k+7] != ':') return 0;
   if(tsip_buf[k+10] != ':') return 0;
   return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movslq %edi, %rcx
leaq 0x2764a5(%rip), %rdx    # 0x337250
xorl %eax, %eax
cmpb $0x1, (%rdx,%rcx)
jne 0xc0dcb
cmpb $0x3a, 0x4(%rcx,%rdx)
jne 0xc0dcb
cmpb $0x3a, 0x7(%rcx,%rdx)
jne 0xc0dcb
xorl %eax, %eax
cmpb $0x3a, 0xa(%rcx,%rdx)
sete %al
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: x72_xxx_dds(double)
double x72_xxx_dds(double dds)
{
int depth;

   // add the current DDS setting to the dds value averaging queue
#define MIN_DEPTH 20  // was *10

   depth = (x72_tc_val / PID_RATE) + 1;
   if(depth < MIN_DEPTH) depth = MIN_DEPTH;

//if(x72_dds_count > x72_tc_val) {  // queue is full, remove oldest entry
//if(x72_dds_count > 120) {  // queue is full, remove oldest entry
//if(x72_dds_count > (x72_tc_val-2)) {  // queue is full, remove oldest entry
   if(x72_dds_count > depth) {  // queue is full, remove oldest entry
      --x72_dds_count;
      x72_dds_sum -= x72_dds_list[x72_dds_out];
      ++x72_dds_out;
      if(x72_dds_out >= depth) x72_dds_out = 0;
   }

   ++x72_dds_count;    // put new entry into the queue
   x72_dds_sum += dds;
   x72_dds_list[x72_dds_in] = dds;
   ++x72_dds_in;
   if(x72_dds_in >= depth) x72_dds_in = 0;

   if(x72_dds_count) dds = x72_dds_sum / (double) x72_dds_count;
   else dds = last_x72_dds;
   filtered_dds = dds;

   return dds;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x159ed0(%rip), %rax    # 0x21ae04
movslq (%rax), %rax
imulq $-0x77777777, %rax, %rdx # imm = 0x88888889
shrq $0x20, %rdx
addl %eax, %edx
movl %edx, %eax
shrl $0x1f, %eax
sarl $0x5, %edx
addl %eax, %edx
cmpl $0x14, %edx
movl $0x13, %ecx
cmovgel %edx, %ecx
leal 0x1(%rcx), %esi
leaq 0x159fc5(%rip), %rax    # 0x21af28
movl (%rax), %edx
cmpl %esi, %edx
jle 0xc0fa0
decl %edx
movslq 0x2b8dbe(%rip), %rsi    # 0x379d30
leaq 0x2b57b7(%rip), %rdi    # 0x376730
movsd 0x2b8da7(%rip), %xmm1   # 0x379d28
subsd (%rdi,%rsi,8), %xmm1
movl %edx, (%rax)
movsd %xmm1, 0x2b8d98(%rip)   # 0x379d28
leal 0x1(%rsi), %edx
xorl %edi, %edi
cmpl %ecx, %esi
cmovll %edx, %edi
movl %edi, 0x2b8d90(%rip)    # 0x379d30
movl (%rax), %edx
movslq 0x2b8d8b(%rip), %rsi    # 0x379d34
leal 0x1(%rsi), %edi
xorl %r8d, %r8d
cmpl %ecx, %esi
cmovll %edi, %r8d
movsd 0x2b8d6b(%rip), %xmm1   # 0x379d28
addsd %xmm0, %xmm1
movsd %xmm1, 0x2b8d5f(%rip)   # 0x379d28
leaq 0x2b5760(%rip), %rcx    # 0x376730
movsd %xmm0, (%rcx,%rsi,8)
movl %r8d, 0x2b8d58(%rip)    # 0x379d34
addl $0x1, %edx
movl %edx, (%rax)
je 0xc0ff0
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
divsd %xmm0, %xmm1
jmp 0xc0ffb
leaq 0x159ee9(%rip), %rax    # 0x21aee0
movsd (%rax), %xmm1
movsd %xmm1, 0x2b8d35(%rip)   # 0x379d38
movapd %xmm1, %xmm0
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: new_x72_interval(int)
void new_x72_interval(int why)
{
unsigned i;

   // start accumulating a new pps interval

   x72_pps_interval = 0;
   x72_dis_sum = 0;
   x72_sum_sum = 0;

   for(i=0; i<X72_PPS_BINS; i++) {
      x72_pps_list[i] = 0;
   }

   x72_sum_y = 0.0;
   x72_sum_x = 0.0; 
   x72_sum_xx = 0.0; 
   x72_sum_yy = 0.0; 
   x72_sum_xy = 0.0; 

   x72_pps_avg = 0.0;
   x72_pps_trend = 0.0;
if(debug_file) fprintf(debug_file, "Clear pps list!  why:%d\n", why);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
leaq 0x159efb(%rip), %rax    # 0x21af24
xorl %r14d, %r14d
movl %r14d, (%rax)
movl %r14d, 0x2b55fe(%rip)   # 0x376634
movl %r14d, 0x2b55fb(%rip)   # 0x376638
leaq 0x2b561c(%rip), %rdi    # 0x376660
movl $0xa4, %edx
xorl %esi, %esi
callq 0x91a0
movq %r14, 0x2b56b1(%rip)    # 0x376708
movq %r14, 0x2b56ca(%rip)    # 0x376728
movq %r14, 0x2b56bb(%rip)    # 0x376720
movq %r14, 0x2b56a4(%rip)    # 0x376710
movq %r14, 0x2b56a5(%rip)    # 0x376718
movq %r14, 0x2b55c6(%rip)    # 0x376640
leaq 0x159eaf(%rip), %rax    # 0x21af30
movq %r14, (%rax)
leaq 0x17d305(%rip), %rax    # 0x23e390
movq (%rax), %rdi
testq %rdi, %rdi
je 0xc10a7
leaq 0x69b27(%rip), %rsi     # 0x12abc1
movl %ebx, %edx
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x9560
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: x72_update_pps_list(int)
void x72_update_pps_list(int val)
{
double x;
double y;

   // add a new point to the pps list
   if(dac_dac == 0) {
      if(val < (-X72_PPS_SPREAD)) return;
      if(val > X72_PPS_SPREAD) return;
      ++x72_pps_list[val+X72_PPS_SPREAD];
   }

   x = (double) x72_pps_interval;
   y = (double) val;

   x72_sum_x  += x;      // update trend line data
   x72_sum_y  += y;
   x72_sum_xx += (x * x);
   x72_sum_yy += (y * y);
   x72_sum_xy += (x * y);

   ++x72_pps_interval;   // how many points we have so far for this interval

if(show_debug_info && (last_x72_dmode > 2)) sprintf(debug_text3, "add pps %g: %g  ival:%d  tavg:%g  pid_time:%d   dds_count:%d  in:%d  out:%d  filtered_dds:%g", x, y, x72_ival, x72_sum_y/x, pid_time, x72_dds_count, x72_dds_in, x72_dds_out, filtered_dds);
}

// Assembly:
leaq 0x27a769(%rip), %rax    # 0x33b81c
cmpl $0x0, (%rax)
jne 0xc10d1
leal -0x15(%rdi), %eax
cmpl $-0x29, %eax
jb 0xc11c5
leal 0x14(%rdi), %eax
leaq 0x2b5592(%rip), %rcx    # 0x376660
incl (%rcx,%rax,4)
leaq 0x159e4c(%rip), %rax    # 0x21af24
movl (%rax), %ecx
cvtsi2sd %ecx, %xmm0
cvtsi2sd %edi, %xmm1
movsd 0x2b563e(%rip), %xmm2   # 0x376728
addsd %xmm0, %xmm2
movsd %xmm2, 0x2b5632(%rip)   # 0x376728
movsd 0x2b560a(%rip), %xmm2   # 0x376708
addsd %xmm1, %xmm2
movapd %xmm0, %xmm3
mulsd %xmm0, %xmm3
addsd 0x2b560e(%rip), %xmm3   # 0x376720
movsd %xmm3, 0x2b5606(%rip)   # 0x376720
movapd %xmm1, %xmm3
mulsd %xmm1, %xmm3
addsd 0x2b55e6(%rip), %xmm3   # 0x376710
movsd %xmm2, 0x2b55d6(%rip)   # 0x376708
movsd %xmm3, 0x2b55d6(%rip)   # 0x376710
movapd %xmm0, %xmm3
mulsd %xmm1, %xmm3
addsd 0x2b55ce(%rip), %xmm3   # 0x376718
movsd %xmm3, 0x2b55c6(%rip)   # 0x376718
incl %ecx
movl %ecx, (%rax)
leaq 0x157767(%rip), %rax    # 0x2188c4
cmpb $0x0, (%rax)
je 0xc11c5
leaq 0x159db7(%rip), %rax    # 0x21af20
cmpl $0x3, (%rax)
jl 0xc11c5
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x159dbf(%rip), %rax    # 0x21af3c
movl (%rax), %edx
divsd %xmm0, %xmm2
movl 0x2b54d3(%rip), %ecx    # 0x37665c
leaq 0x159d98(%rip), %rax    # 0x21af28
movl (%rax), %r8d
movl 0x2b8b9a(%rip), %r9d    # 0x379d34
movl 0x2b8b90(%rip), %eax    # 0x379d30
movsd 0x2b8b90(%rip), %xmm3   # 0x379d38
movl %eax, (%rsp)
leaq 0x27da8e(%rip), %rdi    # 0x33ec40
leaq 0x69a21(%rip), %rsi     # 0x12abda
movb $0x4, %al
callq 0x9060
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: x72_init_state0()
void x72_init_state0()
{
   // startup the discipline algorithm

   if(pps_enabled == 0) {  // should never happen
      x72_start_discipline();
      return;
   }

   x72_startup_flag = 1;
   x72_holdover_points = 0;
   x72_idif_sum = 0;
   new_x72_interval(1);
   x72_initial_pps = x72_pps;
   x72_jamsync_ticks = 0;
   if(x72_start_timer < 0) x72_start_timer = 0;

   if(x72_start_timer < 6) {  // wait for 6 seconds to make sure we have TICs
      ++x72_start_timer;
      return;
   }

   if(have_x72_pps) {  // we have a PPS value, now jamsync the PPS out to PPS in
      update_x72_tic(x72_pps, 1);
      x72_idif = x72_pps_diff;
      init_x72_pid();
//x72_user_state = X72_STATE_START1;
x72_user_state = X72_STATE_JAM2;   // we no longer do the holdover stuff
   }
}

// Assembly:
leaq 0x24cb53(%rip), %rax    # 0x30dd20
cmpb $0x0, (%rax)
je 0x8fcc8
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl $0x1, 0xa9452(%rip)     # 0x16a638
xorl %ebx, %ebx
movl %ebx, 0x2b5432(%rip)    # 0x376620
movl %ebx, 0x2b5420(%rip)    # 0x376614
movl $0x1, %edi
callq 0xc1019
leaq 0x159bf7(%rip), %rax    # 0x21adfc
movl (%rax), %edi
movl %edi, 0x2b5417(%rip)    # 0x376624
movl %ebx, 0x2b5419(%rip)    # 0x37662c
cmpl %ebx, 0x2b543f(%rip)    # 0x376658
jns 0xc1225
movl $0x0, 0x2b5433(%rip)    # 0x376658
movl 0x2b542d(%rip), %eax    # 0x376658
cmpl $0x5, %eax
jg 0xc123a
incl %eax
movl %eax, 0x2b5420(%rip)    # 0x376658
jmp 0xc1271
leaq 0x159a8f(%rip), %rax    # 0x21acd0
cmpl $0x0, (%rax)
je 0xc1271
incl 0x2b8af4(%rip)          # 0x379d40
callq 0x8fb74
movl $0x0, 0x2b5401(%rip)    # 0x37665c
movl 0x2ab98b(%rip), %eax    # 0x36cbec
movl %eax, 0x2b53a9(%rip)    # 0x376610
movl $0x5, 0x2ab973(%rip)    # 0x36cbe4
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: x72_init_state1()
void x72_init_state1()
{
   // wait for initial 1PPS jamsync to complete
   if(pps_enabled == 0) {  // should never happen
      x72_start_discipline();
      return;
   }

   if(++x72_jamsync_ticks >= 6) {
      x72_jamsync_ticks = 0;
      x72_user_state = X72_STATE_HOLDOVER; // do holdover analysis
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x24ca9d(%rip), %rax    # 0x30dd20
cmpb $0x0, (%rax)
je 0xc12b2
movl 0x2b539e(%rip), %eax    # 0x37662c
leal 0x1(%rax), %ecx
movl %ecx, 0x2b5395(%rip)    # 0x37662c
cmpl $0x5, %eax
jl 0xc12b0
movl $0x0, 0x2b5386(%rip)    # 0x37662c
movl $0x3, 0x2ab934(%rip)    # 0x36cbe4
popq %rbp
retq
popq %rbp
jmp 0x8fcc8
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: x72_holdover_state()
void x72_holdover_state()
{
   // collect a few minutes of data to see how the frequency is drifting
   if(pps_enabled == 0) {  // should never happen
      x72_start_discipline();
      return;
   }
   if(x72_holdover_val <= X72_HOLDOVER_SIZE) x72_holdover_val = X72_HOLDOVER_SIZE;


   x72_idif_sum += x72_pps_diff;
   if(x72_holdover_points == 0) x72_idif_sum = 0;
   ++x72_holdover_points;
   holdover = x72_holdover_points;
if(show_debug_info) sprintf(debug_text6, "holdover state: points:%d  idif:%d  sum:%d  mcv:%g  ival:%d", x72_holdover_points, x72_pps_diff, x72_idif_sum, x72_pps_stats(0), x72_ival);

   if(x72_holdover_points >= x72_holdover_val) {  // now go calculate the drift slope and adjust the DDS
      x72_user_state = X72_STATE_SLOPECALC;
   }
}

// Assembly:
leaq 0x24ca61(%rip), %rax    # 0x30dd20
cmpb $0x0, (%rax)
je 0x8fcc8
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x159b2e(%rip), %r12    # 0x21ae08
cmpl $0x78, (%r12)
jg 0xc12e9
movl $0x78, (%r12)
movl 0x2ab8fd(%rip), %ebx    # 0x36cbec
movl 0x2b531e(%rip), %r14d   # 0x376614
addl %ebx, %r14d
movl 0x2b5320(%rip), %r15d   # 0x376620
testl %r15d, %r15d
cmovel %r15d, %r14d
movl %r14d, 0x2b5306(%rip)   # 0x376614
incl %r15d
movl %r15d, 0x2b5308(%rip)   # 0x376620
leaq 0x24c139(%rip), %rax    # 0x30d458
movl %r15d, (%rax)
leaq 0x15759b(%rip), %rax    # 0x2188c4
cmpb $0x0, (%rax)
je 0xc135a
callq 0xc0dcd
leaq 0x159c02(%rip), %rax    # 0x21af3c
movl (%rax), %r9d
leaq 0x27dcec(%rip), %rdi    # 0x33f030
leaq 0x698ec(%rip), %rsi     # 0x12ac37
movl %r15d, %edx
movl %ebx, %ecx
movl %r14d, %r8d
movb $0x1, %al
callq 0x9060
movl 0x2b52c0(%rip), %eax    # 0x376620
cmpl (%r12), %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jl 0xc1378
movl $0x9, 0x2ab86c(%rip)    # 0x36cbe4
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: x72_jam1_state()
void x72_jam1_state()
{
static int count = 0;

   // adjust the TIC offset register to align the 1PPS in and 1PPS out

   if(pps_enabled == 0) {  // should never happen
      x72_start_discipline();
      return;
   }

//sprintf(debug_text3, "jamsync pass:%d  flag:%d  pulses:%d", x72_jamsync_pass, x72_jamsync_flag, x72_jamsync_ticks);
   if(x72_jamsync_flag) {
      if(1 || (x72_jamsync_pass == 2)) {
          ++count;
         init_x72_pid();
         update_x72_tic(x72_pps, 2);
         x72_jamsync_ticks = 0;      // we just changed the TIC register to move the PPS output
         x72_jamsync_flag = 0;       // now wait for the change to take effect
      }
   }

   x72_user_state = X72_STATE_JAM2;
}

// Assembly:
leaq 0x24c8c9(%rip), %rax    # 0x30dd20
cmpb $0x0, (%rax)
je 0x8fcc8
cmpl $0x0, 0x2b51c1(%rip)    # 0x376628
je 0xc14a9
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
incl 0x2b88d3(%rip)          # 0x379d48
xorl %ebx, %ebx
movl %ebx, 0x2b51df(%rip)    # 0x37665c
leaq 0x159978(%rip), %rax    # 0x21adfc
movl (%rax), %edi
incl 0x2b88b4(%rip)          # 0x379d40
callq 0x8fb74
movl %ebx, 0x2b51c5(%rip)    # 0x37665c
movl %ebx, 0x2b518f(%rip)    # 0x37662c
movl %ebx, 0x2b5185(%rip)    # 0x376628
addq $0x8, %rsp
popq %rbx
popq %rbp
movl $0x5, 0x2ab731(%rip)    # 0x36cbe4
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: x72_jam2_state()
void x72_jam2_state()
{
   // wait for change in TIC register to complete

   if(pps_enabled == 0) {  // should never happen
      x72_start_discipline();
      return;
   }

   if(++x72_jamsync_ticks >= 6) {  // allow 6 seconds for a TIC change to take effect
      x72_jamsync_ticks = 0;
      new_x72_interval(2);
      x72_user_state = X72_STATE_DISCIPLINE;  // start the disciplining
   }
}

// Assembly:
leaq 0x24c865(%rip), %rax    # 0x30dd20
cmpb $0x0, (%rax)
je 0x8fcc8
movl 0x2b5162(%rip), %eax    # 0x37662c
leal 0x1(%rax), %ecx
movl %ecx, 0x2b5159(%rip)    # 0x37662c
cmpl $0x5, %eax
jl 0xc14fb
pushq %rbp
movq %rsp, %rbp
movl $0x0, 0x2b5146(%rip)    # 0x37662c
movl $0x2, %edi
callq 0xc1019
movl $0x6, 0x2ab6ea(%rip)    # 0x36cbe4
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: end_log_track()
void end_log_track()
{
   if(log_file == 0) return;

   if((log_fmt == GPX) || (log_fmt == XML)) {
      fprintf(log_file, "    </trkseg>\n");
      fprintf(log_file, "  </trk>\n\n");
   }
   else if(log_fmt == KML) {
      fprintf(log_file, "          </coordinates>\n");
      fprintf(log_file, "        </LineString>\n");
      fprintf(log_file, "      </Placemark>\n");
      fprintf(log_file, "    </Folder>\n");
   }
   if(log_flush_mode && log_file) fflush(log_file);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x17bd13(%rip), %rbx    # 0x23e360
movq (%rbx), %rcx
testq %rcx, %rcx
je 0xc2725
leaq 0x17bde8(%rip), %rax    # 0x23e448
movl (%rax), %eax
cmpl $0xa, %eax
je 0xc2675
cmpl $0x1e, %eax
je 0xc269c
cmpl $0x14, %eax
jne 0xc26fd
leaq 0x6a63b(%rip), %rdi     # 0x12ccb7
movl $0xe, %esi
movl $0x1, %edx
callq 0x9750
movq (%rbx), %rcx
leaq 0x6a631(%rip), %rdi     # 0x12ccc6
movl $0xa, %esi
jmp 0xc26f3
leaq 0x6a62e(%rip), %rdi     # 0x12ccd1
movl $0x19, %esi
movl $0x1, %edx
callq 0x9750
movq (%rbx), %rcx
leaq 0x6a62f(%rip), %rdi     # 0x12cceb
movl $0x16, %esi
movl $0x1, %edx
callq 0x9750
movq (%rbx), %rcx
leaq 0x6a62d(%rip), %rdi     # 0x12cd02
movl $0x13, %esi
movl $0x1, %edx
callq 0x9750
movq (%rbx), %rcx
leaq 0x6a628(%rip), %rdi     # 0x12cd16
movl $0xe, %esi
movl $0x1, %edx
callq 0x9750
leaq 0x17bd1c(%rip), %rax    # 0x23e420
cmpl $0x0, (%rax)
setne %al
movq (%rbx), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xc2725
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x9420
addq $0x8, %rsp
popq %rbx
popq %rbp
retq