LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/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 0xae04c
pushq %rbp
movq %rsp, %rbp
movl %edx, %eax
imulq $0x348, %rax, %rax      # imm = 0x348
leaq 0x190f91(%rip), %rcx    # 0x23efb0
cvtss2sd 0x208(%rcx,%rax), %xmm0
cvtss2sd 0x20c(%rcx,%rax), %xmm1
leaq 0x28e1e8(%rip), %rdi    # 0x33c220
leaq 0x7853e(%rip), %rsi     # 0x12657d
movb $0x2, %al
callq 0x9060
popq %rbp
jmp 0xadf7e
leaq 0x28e1cd(%rip), %rax    # 0x33c220
movabsq $0x303030203a4e5250, %rcx # imm = 0x303030203A4E5250
movq %rcx, (%rax)
movb $0x0, 0x8(%rax)
jmp 0xadf7e
// File: /workspace/github_cpp_makefile_star2_O3/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 0x190f2d(%rip), %rsi    # 0x23efb0
cmpl $0x0, (%rsi,%rdx)
jle 0xae099
movss -0xc(%rsi,%rdx), %xmm1
ucomiss %xmm0, %xmm1
jbe 0xae099
movaps %xmm1, %xmm0
movl %ecx, %eax
incl %ecx
addq $0x348, %rdx            # imm = 0x348
cmpq $0xcd358, %rdx          # imm = 0xCD358
jne 0xae083
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0xc2328(%rip), %rax     # 0x170c6c
movl $0x0, (%rax)
leaq 0x18e3ed(%rip), %rcx    # 0x23cd3e
cmpb $0x0, (%rcx)
je 0xae95b
popq %rbx
popq %r14
popq %rbp
retq
movl %esi, %ebx
movl %edi, %r14d
movl %esi, (%rax)
leaq 0x1905d5(%rip), %rax    # 0x23ef3e
cmpb $0x0, (%rax)
je 0xae9b0
leaq 0x25ebbb(%rip), %rax    # 0x30d530
movsd (%rax), %xmm0
xorl %edi, %edi
callq 0xe823e
leaq 0x25ee31(%rip), %rax    # 0x30d7b8
movsd %xmm0, (%rax)
leaq 0x25ee36(%rip), %rax    # 0x30d7c8
movl $0x1, (%rax)
callq 0xf5054
leaq 0x25ecdc(%rip), %rax    # 0x30d680
cmpl $0x0, (%rax)
je 0xae9c7
callq 0xe8d21
jmp 0xae9d4
leaq 0x169f19(%rip), %rax    # 0x2188d0
movq (%rax), %rax
cmpq $0x400, %rax            # imm = 0x400
jne 0xae9ff
incl %r14d
jmp 0xae9d7
xorps %xmm0, %xmm0
movl $0x15, %edi
callq 0xe91e5
decl %r14d
leal 0x1(%r14), %edi
movl %ebx, %esi
callq 0xae0ad
leal 0x3(%r14), %edi
movl %ebx, %esi
callq 0xae2a9
addl $0x6, %r14d
movl %r14d, %edi
movl %ebx, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0xae52f
cmpq $0x400000, %rax         # imm = 0x400000
jne 0xae9d7
leaq 0x25e6de(%rip), %rax    # 0x30d0ec
cmpb $0x0, (%rax)
je 0xae9d7
leaq 0x25dd8e(%rip), %rax    # 0x30c7a8
movzbl (%rax), %eax
cmpl $0x43, %eax
je 0xae956
cmpl $0x4c, %eax
je 0xae956
jmp 0xae9d7
// File: /workspace/github_cpp_makefile_star2_O3/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 0x25c21e(%rip), %rax    # 0x30cfd0
movsd (%rax), %xmm1
xorl %ebx, %ebx
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0xb0e3b
jp 0xb0e3b
leaq 0x25c20d(%rip), %rax    # 0x30cfd8
movsd (%rax), %xmm1
ucomisd %xmm0, %xmm1
jne 0xb0e3b
jp 0xb0e3b
leaq 0x76113(%rip), %rcx     # 0x126ef1
xorl %edi, %edi
movl $0xf, %esi
movl $0xc, %edx
callq 0xe787
leaq 0x7610e(%rip), %rcx     # 0x126f04
movl $0x1, %edi
movl $0xf, %esi
movl $0xc, %edx
callq 0xe787
leaq 0x76106(%rip), %rcx     # 0x126f17
movl $0x2, %edi
movl $0xf, %esi
movl $0xc, %edx
callq 0xe787
leaq 0x167aa4(%rip), %rax    # 0x2188d0
xorl %ebx, %ebx
cmpq $0x400, (%rax)          # imm = 0x400
sete %bl
addl $0x3, %ebx
leaq 0x25c4da(%rip), %rax    # 0x30d31c
cmpl $0x0, (%rax)
js 0xb0e4e
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x760d5(%rip), %rcx     # 0x126f2a
movl %ebx, %edi
movl $0xf, %esi
movl $0xc, %edx
callq 0xe787
leal 0x1(%rbx), %edi
leaq 0x760cc(%rip), %rcx     # 0x126f3c
movl $0xf, %esi
movl $0xc, %edx
callq 0xe787
leal 0x2(%rbx), %edi
leaq 0x760c5(%rip), %rcx     # 0x126f4e
movl $0xf, %esi
movl $0xc, %edx
callq 0xe787
addl $0x3, %ebx
leaq 0x760be(%rip), %rcx     # 0x126f60
movl %ebx, %edi
movl $0xf, %esi
movl $0xc, %edx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xe787
// File: /workspace/github_cpp_makefile_star2_O3/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 0x55a83(%rip), %xmm2    # 0x109190
andpd %xmm1, %xmm2
xorl %eax, %eax
ucomisd 0x58115(%rip), %xmm2    # 0x10b830
ja 0xb3813
movsd 0x58107(%rip), %xmm2    # 0x10b830
addsd %xmm1, %xmm2
divsd 0x6b06b(%rip), %xmm2    # 0x11e7a0
addsd 0x55933(%rip), %xmm2    # 0x109070
cvttsd2si %xmm2, %ecx
ucomisd 0x6b167(%rip), %xmm0    # 0x11e8b0
jb 0xb377d
movsd 0x6b165(%rip), %xmm2    # 0x11e8b8
ucomisd %xmm0, %xmm2
jbe 0xb377d
movsd 0x6b10f(%rip), %xmm0    # 0x11e870
ucomisd %xmm1, %xmm0
movl $0x20, %eax
cmovbel %ecx, %eax
ucomisd 0x58293(%rip), %xmm1    # 0x10ba08
cmovbl %ecx, %eax
jmp 0xb3813
ucomisd 0x6b13b(%rip), %xmm0    # 0x11e8c0
jb 0xb3811
movsd 0x6b135(%rip), %xmm2    # 0x11e8c8
ucomisd %xmm0, %xmm2
jbe 0xb3811
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jb 0xb37b6
movl $0x1f, %eax
movsd 0x6b058(%rip), %xmm0    # 0x11e808
ucomisd %xmm1, %xmm0
ja 0xb3813
ucomisd 0x6b04a(%rip), %xmm1    # 0x11e808
jb 0xb37d3
movl $0x21, %eax
movsd 0x6b103(%rip), %xmm0    # 0x11e8d0
ucomisd %xmm1, %xmm0
ja 0xb3813
ucomisd 0x6b0f5(%rip), %xmm1    # 0x11e8d0
jb 0xb37f0
movl $0x23, %eax
movsd 0x6b0ee(%rip), %xmm0    # 0x11e8d8
ucomisd %xmm1, %xmm0
ja 0xb3813
movsd 0x6b0e8(%rip), %xmm0    # 0x11e8e0
ucomisd %xmm1, %xmm0
movl $0x25, %eax
cmovbel %ecx, %eax
ucomisd 0x6b0cc(%rip), %xmm1    # 0x11e8d8
jmp 0xb3775
movl %ecx, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x55648(%rip), %xmm1    # 0x109190
andpd %xmm0, %xmm1
movapd %xmm1, -0x20(%rbp)
movapd %xmm1, %xmm0
callq 0x9080
mulsd 0x6add6(%rip), %xmm0    # 0x11e938
addsd 0x55506(%rip), %xmm0    # 0x109070
movsd %xmm0, -0x8(%rbp)
movapd -0x20(%rbp), %xmm0
callq 0x9080
mulsd 0x6adbf(%rip), %xmm0    # 0x11e940
addsd 0x554e7(%rip), %xmm0    # 0x109070
movsd -0x8(%rbp), %xmm2
divsd %xmm0, %xmm2
movsd 0x6adae(%rip), %xmm1    # 0x11e948
movapd %xmm2, %xmm0
callq 0x96b0
movsd %xmm0, -0x8(%rbp)
movapd -0x20(%rbp), %xmm0
mulsd 0x57dd3(%rip), %xmm0    # 0x10b988
addsd 0x6ad93(%rip), %xmm0    # 0x11e950
callq 0x91b0
mulsd -0x8(%rbp), %xmm0
mulsd 0x6ad89(%rip), %xmm0    # 0x11e958
movapd %xmm0, -0x20(%rbp)
movsd -0x28(%rbp), %xmm0
callq 0x9710
movapd 0x555ca(%rip), %xmm1    # 0x1091b0
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 0x6ad4b(%rip), %xmm2    # 0x11e960
movsd %xmm2, 0x2c2913(%rip)   # 0x376530
movsd -0x28(%rbp), %xmm0
callq 0x9080
mulsd -0x20(%rbp), %xmm0
addsd 0x6ad2c(%rip), %xmm0    # 0x11e960
movsd %xmm0, 0x2c28fc(%rip)   # 0x376538
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0xb4230
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 0x54db4(%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 0x54d97(%rip), %xmm0    # 0x109010
leaq 0x2c2300(%rip), %rbx    # 0x376580
leaq 0x73031(%rip), %rsi     # 0x1272b8
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_O3/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 0x15f191(%rip), %rax    # 0x2188d0
cmpq $0x1, (%rax)
jne 0xb97d9
leaq 0x25423a(%rip), %rcx    # 0x30d98a
movb (%rcx), %al
cmpb $0xd, %al
jb 0xb975b
movb $0x0, (%rcx)
xorl %eax, %eax
leaq 0x253c92(%rip), %rcx    # 0x30d3f4
orl (%rcx), %edi
je 0xb97d9
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x254219(%rip), %rcx    # 0x30d98c
movzbl (%rcx), %edx
leaq 0x25420e(%rip), %rcx    # 0x30d98b
movzbl (%rcx), %ecx
movzbl %al, %eax
leaq 0xb0fb6(%rip), %rsi     # 0x16a740
movq (%rsi,%rax,8), %r8
leaq 0x2541f3(%rip), %rax    # 0x30d988
movzwl (%rax), %r9d
leaq 0x282a80(%rip), %rbx    # 0x33c220
leaq 0x6e836(%rip), %rsi     # 0x127fdd
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
leaq 0x15efdc(%rip), %rax    # 0x218794
movl (%rax), %edi
addl $0x3, %edi
leaq 0x15efd4(%rip), %rax    # 0x218798
movl (%rax), %esi
movl $0xf, %edx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xe787
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x15f0ef(%rip), %rax    # 0x2188d0
cmpq $0x1, (%rax)
jne 0xb9934
leaq 0x2541b4(%rip), %rcx    # 0x30d9a6
movb (%rcx), %al
cmpb $0xd, %al
jb 0xb97fd
movb $0x0, (%rcx)
xorl %eax, %eax
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0x25419d(%rip), %r14    # 0x30d9ac
movb (%r14), %sil
cmpb $0xd, %sil
jb 0xb981e
movb $0x0, (%r14)
xorl %esi, %esi
leaq 0x25414f(%rip), %rcx    # 0x30d974
testb $0x4, (%rcx)
je 0xb9925
leaq 0x282e0b(%rip), %rcx    # 0x33c640
cmpb $0x0, (%rcx)
jne 0xb98b0
leaq 0x254163(%rip), %rcx    # 0x30d9a4
movzbl (%rcx), %edx
leaq 0x25415a(%rip), %rcx    # 0x30d9a5
movzbl (%rcx), %ecx
leaq 0x254152(%rip), %rsi    # 0x30d9a7
movzbl (%rsi), %r8d
movzbl %al, %eax
leaq 0xb0edd(%rip), %rsi     # 0x16a740
movq (%rsi,%rax,8), %r9
leaq 0x25413a(%rip), %rax    # 0x30d9a8
movzwl (%rax), %eax
movl %eax, (%rsp)
leaq 0x2829a5(%rip), %rbx    # 0x33c220
leaq 0x6e776(%rip), %rsi     # 0x127ff8
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
leaq 0x15ef01(%rip), %rax    # 0x218794
movl (%rax), %edi
incl %edi
leaq 0x15eefa(%rip), %rax    # 0x218798
movl (%rax), %esi
movl $0xf, %edx
movq %rbx, %rcx
callq 0xe787
movb (%r14), %sil
leaq 0x2540f3(%rip), %rax    # 0x30d9aa
movzbl (%rax), %edx
leaq 0x2540ea(%rip), %rax    # 0x30d9ab
movzbl (%rax), %ecx
leaq 0x2540e2(%rip), %rax    # 0x30d9ad
movzbl (%rax), %r8d
movzbl %sil, %eax
leaq 0xb0e66(%rip), %rsi     # 0x16a740
movq (%rsi,%rax,8), %r9
leaq 0x2540c9(%rip), %rax    # 0x30d9ae
movzwl (%rax), %eax
movl %eax, (%rsp)
leaq 0x28292e(%rip), %rbx    # 0x33c220
leaq 0x6e71b(%rip), %rsi     # 0x128014
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
leaq 0x15ee8a(%rip), %rax    # 0x218794
movl (%rax), %edi
addl $0x2, %edi
leaq 0x15ee82(%rip), %rax    # 0x218798
movl (%rax), %esi
movl $0xf, %edx
movq %rbx, %rcx
callq 0xe787
xorl %edi, %edi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0xb9738
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0xb9738
leaq 0x254996(%rip), %rax    # 0x30e2e0
movl 0x157c0(%rax), %r8d
cmpl $0xa, %r8d
jl 0xb997a
leaq 0x254044(%rip), %rax    # 0x30d9a2
movzwl (%rax), %edx
movl 0x2b249d(%rip), %ecx    # 0x36be04
decl %r8d
leaq 0x2828af(%rip), %rdi    # 0x33c220
leaq 0x6e6c1(%rip), %rsi     # 0x128039
jmp 0xb99f8
testl %r8d, %r8d
je 0xb99a2
leaq 0x25401c(%rip), %rax    # 0x30d9a2
movzwl (%rax), %edx
movl 0x2b2475(%rip), %ecx    # 0x36be04
decl %r8d
leaq 0x282887(%rip), %rdi    # 0x33c220
leaq 0x6e6af(%rip), %rsi     # 0x12804f
jmp 0xb99f8
movl 0x157c4(%rax), %r8d
cmpl $0xa, %r8d
jl 0xb99d2
leaq 0x253fec(%rip), %rax    # 0x30d9a2
movzwl (%rax), %edx
movl 0x2b2445(%rip), %ecx    # 0x36be04
decl %r8d
leaq 0x282857(%rip), %rdi    # 0x33c220
leaq 0x6e696(%rip), %rsi     # 0x128066
jmp 0xb99f8
testl %r8d, %r8d
je 0xb9a26
leaq 0x253fc4(%rip), %rax    # 0x30d9a2
movzwl (%rax), %edx
movl 0x2b241d(%rip), %ecx    # 0x36be04
decl %r8d
leaq 0x28282f(%rip), %rdi    # 0x33c220
leaq 0x6e684(%rip), %rsi     # 0x12807c
xorl %eax, %eax
callq 0x9060
leaq 0x15ed8e(%rip), %rax    # 0x218794
movl (%rax), %edi
addl $0x4, %edi
leaq 0x15ed86(%rip), %rax    # 0x218798
movl (%rax), %esi
leaq 0x282805(%rip), %rcx    # 0x33c220
movl $0xf, %edx
popq %rbp
jmp 0xe787
cmpb $0x0, 0x158cd(%rax)
je 0xb9a52
movl $0x158cd, %edx          # imm = 0x158CD
addq 0x965a5(%rip), %rdx     # 0x14ffe0
leaq 0x2827de(%rip), %rdi    # 0x33c220
leaq 0x6e64a(%rip), %rsi     # 0x128093
xorl %eax, %eax
callq 0x9060
jmp 0xb99ff
leaq 0x2827c7(%rip), %rax    # 0x33c220
movabsq $0x6f6e203a4d4f4320, %rcx # imm = 0x6F6E203A4D4F4320
movq %rcx, (%rax)
movl $0x656e6f, 0x7(%rax)    # imm = 0x656E6F
jmp 0xb99ff
// File: /workspace/github_cpp_makefile_star2_O3/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 0x17c060(%rip), %rax    # 0x23cd3e
cmpb $0x0, (%rax)
setne %al
leaq 0x157b15(%rip), %rcx    # 0x218800
cmpl $0x4fa, (%rcx)          # imm = 0x4FA
setl %cl
testb %cl, %al
jne 0xc0d9a
leaq 0x157bcd(%rip), %rax    # 0x2188d0
cmpq $0x400, (%rax)          # imm = 0x400
je 0xc0d9a
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x157aab(%rip), %r15    # 0x2187d0
movl (%r15), %eax
testl %eax, %eax
js 0xc0d7a
xorl %ebx, %ebx
leaq 0x72e24(%rip), %r12     # 0x133b59
leaq 0x72e1b(%rip), %r13     # 0x133b57
leaq 0x157a59(%rip), %r14    # 0x21879c
leaq 0x157ab6(%rip), %rax    # 0x218800
cmpl $0x3e2, (%rax)          # imm = 0x3E2
movq %r12, %rcx
jl 0xc0d58
movq %r13, %rcx
cmpl $0x5, %ebx
movl (%r14), %esi
cmovaeq %r13, %rcx
movl %ebx, %edi
movl $0xf, %edx
callq 0xe787
leal 0x1(%rbx), %ecx
movl (%r15), %eax
cmpl %eax, %ebx
movl %ecx, %ebx
jl 0xc0d43
movl $0x0, 0x2ab018(%rip)    # 0x36bd9c
incl %eax
movl %eax, 0x2ab014(%rip)    # 0x36bda0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x276277(%rip), %rax    # 0x337020
cmpb $0x0, (%rax)
jne 0xc0dd0
leaq 0x157b1b(%rip), %r14    # 0x2188d0
movq (%r14), %rax
cmpq $0x1, %rax
sete %cl
leaq 0x15a20e(%rip), %rdx    # 0x21afd4
cmpl $0x53, (%rdx)
sete %dl
testb %dl, %cl
je 0xc0dd5
popq %rbx
popq %r14
popq %rbp
retq
movl %edi, %ebx
cmpq $0xffffff, %rax         # imm = 0xFFFFFF
jle 0xc0df9
cmpq $0xfffffff, %rax        # imm = 0xFFFFFFF
jg 0xc0e13
cmpq $0x1000000, %rax        # imm = 0x1000000
je 0xc0dd0
cmpq $0x8000000, %rax        # imm = 0x8000000
je 0xc0dd0
jmp 0xc0e2a
cmpq $0x40000, %rax          # imm = 0x40000
je 0xc0dd0
cmpq $0x80000, %rax          # imm = 0x80000
je 0xc0dd0
cmpq $0x400000, %rax         # imm = 0x400000
je 0xc0dd0
jmp 0xc0e2a
cmpq $0x10000000, %rax       # imm = 0x10000000
je 0xc0dd0
movabsq $0x1000000000, %rcx     # imm = 0x1000000000
cmpq %rcx, %rax
je 0xc0dd0
callq 0x65c0d
callq 0x7c896
cmpb $0x0, 0x2aafe3(%rip)    # 0x36be1e
jne 0xc0e42
callq 0x64443
callq 0x611cf
callq 0x6ab01
cmpq $0x40000, (%r14)        # imm = 0x40000
je 0xc0e5a
callq 0x6c169
callq 0x6d209
callq 0x69c96
movl %ebx, %edi
callq 0x667f2
callq 0x7135e
cmpq $0x1000, (%r14)         # imm = 0x1000
je 0xc0e7e
callq 0x7097b
popq %rbx
popq %r14
popq %rbp
jmp 0x6649d
// File: /workspace/github_cpp_makefile_star2_O3/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 0x1576ec(%rip), %rax    # 0x2188d0
movq (%rax), %rcx
cmpq $0x1, %rcx
sete %dl
leaq 0x159ddf(%rip), %rax    # 0x21afd4
movl (%rax), %eax
cmpl $0x50, %eax
sete %sil
testb %sil, %dl
jne 0xc122a
leaq 0x17d1b6(%rip), %rdx    # 0x23e3c0
movq (%rdx), %rdx
cmpq $0x1, %rcx
jne 0xc122b
testq %rdx, %rdx
jne 0xc122a
addl $-0x33, %eax
cmpl $0x1d, %eax
ja 0xc1230
movl $0x20004009, %ecx       # imm = 0x20004009
btl %eax, %ecx
jae 0xc1230
retq
testq %rdx, %rdx
jne 0xc122a
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl $0xa, %edi
callq 0xaf80
callq 0x6ec4e
movl $0xd, %edi
callq 0x590f7
movl $0x1, %ebx
movl %ebx, 0x2aabb5(%rip)    # 0x36be10
movl $0xa, %edi
callq 0x590f7
xorl %r14d, %r14d
movl %r14d, 0x2aaba1(%rip)   # 0x36be10
movl $0xfa, %edi
callq 0xafe8
movl $0xd, %edi
callq 0x590f7
movl %ebx, 0x2aab87(%rip)    # 0x36be10
movl $0xa, %edi
callq 0x590f7
movl %r14d, 0x2aab76(%rip)   # 0x36be10
movl $0xfa, %edi
callq 0xafe8
leaq 0x24d035(%rip), %rax    # 0x30e2e0
cmpl $0x1c200, 0x159d0(%rax) # imm = 0x1C200
jne 0xc12d9
movl $0x1f, %edi
callq 0x5e6be
leaq 0x15a090(%rip), %rax    # 0x21b358
cvttsd2si (%rax), %eax
movzbl %al, %edi
callq 0x590f7
callq 0x5e7c0
cmpl $0x0, 0x2afb1c(%rip)    # 0x370dfc
jne 0xc1315
leaq 0x5f68d(%rip), %rdi     # 0x120976
callq 0x6160d
xorl %edi, %edi
callq 0x590f7
callq 0x61688
leaq 0x5f2fc(%rip), %rdi     # 0x1205fd
callq 0x6160d
movl $0x1, %edi
callq 0x590f7
callq 0x61688
callq 0x5e73c
callq 0x5e73c
movl $0x3c, %edi
callq 0x5e6be
xorl %edi, %edi
callq 0x590f7
callq 0x5e73c
callq 0x585ef
movl $0xa, %edi
popq %rbx
popq %r14
popq %rbp
jmp 0x1ea0b
// File: /workspace/github_cpp_makefile_star2_O3/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 0x275ec7(%rip), %rdx    # 0x337250
xorl %eax, %eax
cmpb $0x1, (%rdx,%rcx)
jne 0xc13a9
cmpb $0x3a, 0x4(%rcx,%rdx)
jne 0xc13a9
cmpb $0x3a, 0x7(%rcx,%rdx)
jne 0xc13a9
xorl %eax, %eax
cmpb $0x3a, 0xa(%rcx,%rdx)
sete %al
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x1598f2(%rip), %rax    # 0x21ae04
movslq (%rax), %rax
imulq $-0x77777777, %rax, %rcx # imm = 0x88888889
shrq $0x20, %rcx
addl %eax, %ecx
movl %ecx, %eax
shrl $0x1f, %eax
sarl $0x5, %ecx
addl %eax, %ecx
cmpl $0x14, %ecx
movl $0x13, %esi
cmovgel %ecx, %esi
leal 0x1(%rsi), %edi
leaq 0x1599e7(%rip), %rcx    # 0x21af28
movl (%rcx), %eax
movsd 0x2b87dd(%rip), %xmm1   # 0x379d28
leaq 0x2b51de(%rip), %rdx    # 0x376730
cmpl %edi, %eax
jle 0xc1578
decl %eax
movslq 0x2b87d1(%rip), %rdi    # 0x379d30
subsd (%rdx,%rdi,8), %xmm1
leal 0x1(%rdi), %r8d
xorl %r9d, %r9d
cmpl %esi, %edi
cmovll %r8d, %r9d
movl %r9d, 0x2b87b8(%rip)    # 0x379d30
movslq 0x2b87b5(%rip), %rdi    # 0x379d34
leal 0x1(%rdi), %r8d
xorl %r9d, %r9d
cmpl %esi, %edi
cmovll %r8d, %r9d
addsd %xmm0, %xmm1
movsd %xmm1, 0x2b8790(%rip)   # 0x379d28
movsd %xmm0, (%rdx,%rdi,8)
movl %r9d, 0x2b8790(%rip)    # 0x379d34
addl $0x1, %eax
movl %eax, (%rcx)
je 0xc15b8
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd %xmm0, %xmm1
jmp 0xc15c3
leaq 0x159921(%rip), %rax    # 0x21aee0
movsd (%rax), %xmm1
movsd %xmm1, 0x2b876d(%rip)   # 0x379d38
movapd %xmm1, %xmm0
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x159933(%rip), %rax    # 0x21af24
xorl %r14d, %r14d
movl %r14d, (%rax)
movl %r14d, 0x2b5036(%rip)   # 0x376634
movl %r14d, 0x2b5033(%rip)   # 0x376638
leaq 0x2b5054(%rip), %rdi    # 0x376660
movl $0xa4, %edx
xorl %esi, %esi
callq 0x91a0
movq %r14, 0x2b50e9(%rip)    # 0x376708
movq %r14, 0x2b5102(%rip)    # 0x376728
movq %r14, 0x2b50f3(%rip)    # 0x376720
movq %r14, 0x2b50dc(%rip)    # 0x376710
movq %r14, 0x2b50dd(%rip)    # 0x376718
movq %r14, 0x2b4ffe(%rip)    # 0x376640
leaq 0x1598e7(%rip), %rax    # 0x21af30
movq %r14, (%rax)
leaq 0x17cd3d(%rip), %rax    # 0x23e390
movq (%rax), %rdi
testq %rdi, %rdi
je 0xc166f
leaq 0x6962a(%rip), %rsi     # 0x12ac8c
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_O3/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 0x27a1a1(%rip), %rax    # 0x33b81c
cmpl $0x0, (%rax)
jne 0xc1699
leal -0x15(%rdi), %eax
cmpl $-0x29, %eax
jb 0xc178d
leal 0x14(%rdi), %eax
leaq 0x2b4fca(%rip), %rcx    # 0x376660
incl (%rcx,%rax,4)
leaq 0x159884(%rip), %rax    # 0x21af24
movl (%rax), %ecx
cvtsi2sd %ecx, %xmm0
cvtsi2sd %edi, %xmm1
movsd 0x2b5076(%rip), %xmm2   # 0x376728
addsd %xmm0, %xmm2
movsd %xmm2, 0x2b506a(%rip)   # 0x376728
movsd 0x2b5042(%rip), %xmm2   # 0x376708
addsd %xmm1, %xmm2
movapd %xmm0, %xmm3
mulsd %xmm0, %xmm3
addsd 0x2b5046(%rip), %xmm3   # 0x376720
movsd %xmm3, 0x2b503e(%rip)   # 0x376720
movapd %xmm1, %xmm3
mulsd %xmm1, %xmm3
addsd 0x2b501e(%rip), %xmm3   # 0x376710
movsd %xmm2, 0x2b500e(%rip)   # 0x376708
movsd %xmm3, 0x2b500e(%rip)   # 0x376710
movapd %xmm0, %xmm3
mulsd %xmm1, %xmm3
addsd 0x2b5006(%rip), %xmm3   # 0x376718
movsd %xmm3, 0x2b4ffe(%rip)   # 0x376718
incl %ecx
movl %ecx, (%rax)
leaq 0x15719f(%rip), %rax    # 0x2188c4
cmpb $0x0, (%rax)
je 0xc178d
leaq 0x1597ef(%rip), %rax    # 0x21af20
cmpl $0x3, (%rax)
jl 0xc178d
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x1597f7(%rip), %rax    # 0x21af3c
movl (%rax), %edx
divsd %xmm0, %xmm2
movl 0x2b4f0b(%rip), %ecx    # 0x37665c
leaq 0x1597d0(%rip), %rax    # 0x21af28
movl (%rax), %r8d
movl 0x2b85d2(%rip), %r9d    # 0x379d34
movl 0x2b85c8(%rip), %eax    # 0x379d30
movsd 0x2b85c8(%rip), %xmm3   # 0x379d38
movl %eax, (%rsp)
leaq 0x27d4c6(%rip), %rdi    # 0x33ec40
leaq 0x69524(%rip), %rsi     # 0x12aca5
movb $0x4, %al
callq 0x9060
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x24c58b(%rip), %rax    # 0x30dd20
cmpb $0x0, (%rax)
je 0x8fd22
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl $0x1, 0xa8e8a(%rip)     # 0x16a638
xorl %ebx, %ebx
movl %ebx, 0x2b4e6a(%rip)    # 0x376620
movl %ebx, 0x2b4e58(%rip)    # 0x376614
movl $0x1, %edi
callq 0xc15e1
leaq 0x15962f(%rip), %rax    # 0x21adfc
movl (%rax), %edi
movl %edi, 0x2b4e4f(%rip)    # 0x376624
movl %ebx, 0x2b4e51(%rip)    # 0x37662c
movl 0x2b4e77(%rip), %eax    # 0x376658
testl %eax, %eax
js 0xc17ec
movl %eax, %ebx
cmpl $0x5, %eax
ja 0xc17f6
incl %ebx
movl %ebx, 0x2b4e64(%rip)    # 0x376658
jmp 0xc182d
leaq 0x1594d3(%rip), %rax    # 0x21acd0
cmpl $0x0, (%rax)
je 0xc182d
incl 0x2b8538(%rip)          # 0x379d40
callq 0x8fbce
movl 0x2ab3d9(%rip), %eax    # 0x36cbec
movl %eax, 0x2b4df7(%rip)    # 0x376610
movl $0x0, 0x2b4e39(%rip)    # 0x37665c
movl $0x5, 0x2ab3b7(%rip)    # 0x36cbe4
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x24c4e1(%rip), %rax    # 0x30dd20
cmpb $0x0, (%rax)
je 0xc186e
movl 0x2b4de2(%rip), %eax    # 0x37662c
leal 0x1(%rax), %ecx
movl %ecx, 0x2b4dd9(%rip)    # 0x37662c
cmpl $0x5, %eax
jl 0xc186c
movl $0x0, 0x2b4dca(%rip)    # 0x37662c
movl $0x3, 0x2ab378(%rip)    # 0x36cbe4
popq %rbp
retq
popq %rbp
jmp 0x8fd22
// File: /workspace/github_cpp_makefile_star2_O3/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 0x24c4a5(%rip), %rax    # 0x30dd20
cmpb $0x0, (%rax)
je 0x8fd22
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x159572(%rip), %r12    # 0x21ae08
movl (%r12), %eax
cmpl $0x78, %eax
jg 0xc18ac
movl $0x78, (%r12)
movl $0x78, %eax
movl 0x2ab339(%rip), %r14d   # 0x36cbec
movl 0x2b4d5a(%rip), %r15d   # 0x376614
addl %r14d, %r15d
movl 0x2b4d5d(%rip), %ebx    # 0x376620
testl %ebx, %ebx
cmovel %ebx, %r15d
movl %r15d, 0x2b4d44(%rip)   # 0x376614
incl %ebx
movl %ebx, 0x2b4d48(%rip)    # 0x376620
leaq 0x24bb79(%rip), %rcx    # 0x30d458
movl %ebx, (%rcx)
leaq 0x156fdc(%rip), %rcx    # 0x2188c4
cmpb $0x0, (%rcx)
je 0xc1923
callq 0xc13ab
leaq 0x159643(%rip), %rax    # 0x21af3c
movl (%rax), %r9d
leaq 0x27d72d(%rip), %rdi    # 0x33f030
leaq 0x693f8(%rip), %rsi     # 0x12ad02
movl %ebx, %edx
movl %r14d, %ecx
movl %r15d, %r8d
movb $0x1, %al
callq 0x9060
movl 0x2b4d01(%rip), %ebx    # 0x376620
movl (%r12), %eax
cmpl %eax, %ebx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jl 0xc1939
movl $0x9, 0x2ab2ab(%rip)    # 0x36cbe4
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x24c308(%rip), %rax    # 0x30dd20
cmpb $0x0, (%rax)
je 0x8fd22
cmpl $0x0, 0x2b4c00(%rip)    # 0x376628
je 0xc1a6a
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
incl 0x2b8312(%rip)          # 0x379d48
xorl %ebx, %ebx
movl %ebx, 0x2b4c1e(%rip)    # 0x37665c
leaq 0x1593b7(%rip), %rax    # 0x21adfc
movl (%rax), %edi
incl 0x2b82f3(%rip)          # 0x379d40
callq 0x8fbce
movl %ebx, 0x2b4c04(%rip)    # 0x37665c
movl %ebx, 0x2b4bce(%rip)    # 0x37662c
movl %ebx, 0x2b4bc4(%rip)    # 0x376628
addq $0x8, %rsp
popq %rbx
popq %rbp
movl $0x5, 0x2ab170(%rip)    # 0x36cbe4
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x24c2a4(%rip), %rax    # 0x30dd20
cmpb $0x0, (%rax)
je 0x8fd22
movl 0x2b4ba1(%rip), %eax    # 0x37662c
leal 0x1(%rax), %ecx
movl %ecx, 0x2b4b98(%rip)    # 0x37662c
cmpl $0x5, %eax
jl 0xc1abc
pushq %rbp
movq %rsp, %rbp
movl $0x0, 0x2b4b85(%rip)    # 0x37662c
movl $0x2, %edi
callq 0xc15e1
movl $0x6, 0x2ab129(%rip)    # 0x36cbe4
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x17b735(%rip), %rbx    # 0x23e360
movq (%rbx), %rcx
testq %rcx, %rcx
je 0xc2d03
leaq 0x17b80a(%rip), %rax    # 0x23e448
movl (%rax), %eax
cmpl $0xa, %eax
je 0xc2c53
cmpl $0x1e, %eax
je 0xc2c7a
cmpl $0x14, %eax
jne 0xc2cdb
leaq 0x6a14d(%rip), %rdi     # 0x12cda7
movl $0xe, %esi
movl $0x1, %edx
callq 0x9750
movq (%rbx), %rcx
leaq 0x6a143(%rip), %rdi     # 0x12cdb6
movl $0xa, %esi
jmp 0xc2cd1
leaq 0x6a140(%rip), %rdi     # 0x12cdc1
movl $0x19, %esi
movl $0x1, %edx
callq 0x9750
movq (%rbx), %rcx
leaq 0x6a141(%rip), %rdi     # 0x12cddb
movl $0x16, %esi
movl $0x1, %edx
callq 0x9750
movq (%rbx), %rcx
leaq 0x6a13f(%rip), %rdi     # 0x12cdf2
movl $0x13, %esi
movl $0x1, %edx
callq 0x9750
movq (%rbx), %rcx
leaq 0x6a13a(%rip), %rdi     # 0x12ce06
movl $0xe, %esi
movl $0x1, %edx
callq 0x9750
leaq 0x17b73e(%rip), %rax    # 0x23e420
cmpl $0x0, (%rax)
setne %al
movq (%rbx), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xc2d03
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x9420
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathmsc.cpp
// Function: write_log_comment(int)
void write_log_comment(int spaces)
{
   if(log_file == 0) return;
   if(log_comments == 0) return;

   if(log_fmt == HEATHER) {
      fprintf(log_file, "%s", log_text);
      while(spaces--) fprintf(log_file, "\n");
   }
   else if(log_fmt == KML) {
      if(filter_log_text()) {
         fprintf(log_file, "<!-- %s -->", log_text);
      }
      while(spaces--) fprintf(log_file, "\n");
   }
   else if(log_fmt == RINEX) {  // don't output anything until the RINEX header has been output
      if(rinex_header_written) {
         write_rinex_line(log_file, log_text, "COMMENT");
      }
   }
   else if(log_fmt == XML) {  // !!!! does this work when sending to a GPX viewer?
      if(filter_log_text()) {
         fprintf(log_file, "<!-- %s -->", log_text);
      }
      else {  // blank line
//       fprintf(log_file, "<!--  -->");
      }

      while(spaces--) {
         fprintf(log_file, "\n");
      }
   }

   if(debug_file) {
      if(log_text[1] == '!') fprintf(debug_file, "Event: %s\n", log_text);
      fflush(debug_file);
   }

   if(log_flush_mode && log_file) fflush(log_file);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x17ac70(%rip), %r14    # 0x23e360
movq (%r14), %rsi
testq %rsi, %rsi
je 0xc3857
leaq 0x17ad11(%rip), %rax    # 0x23e414
cmpb $0x0, (%rax)
je 0xc3857
movl %edi, %ebx
leaq 0x17ad33(%rip), %rax    # 0x23e448
movl (%rax), %eax
cmpl $0x1d, %eax
jg 0xc3768
testl %eax, %eax
je 0xc379f
cmpl $0xa, %eax
jne 0xc37f8
callq 0xc3f02
testl %eax, %eax
je 0xc374a
movq (%r14), %rdi
leaq 0x6a068(%rip), %rsi     # 0x12d7a4
leaq 0x17a21d(%rip), %rdx    # 0x23d960
xorl %eax, %eax
callq 0x9560
testl %ebx, %ebx
je 0xc37f8
movq (%r14), %rsi
movl $0xa, %edi
callq 0x9480
decl %ebx
jne 0xc3752
jmp 0xc37f8
cmpl $0x1e, %eax
je 0xc37c2
cmpl $0x12e, %eax            # imm = 0x12E
jne 0xc37f8
leaq 0x17ac6d(%rip), %rax    # 0x23e3ec
cmpl $0x0, (%rax)
je 0xc37f8
leaq 0x17a1d5(%rip), %rax    # 0x23d960
leaq 0x6a01e(%rip), %rdx     # 0x12d7b0
movq %rsi, %rdi
movq %rax, %rsi
callq 0xc3f69
jmp 0xc37f8
leaq 0x17a1ba(%rip), %rdi    # 0x23d960
callq 0x9400
testl %ebx, %ebx
je 0xc37f8
movq (%r14), %rsi
movl $0xa, %edi
callq 0x9480
decl %ebx
jne 0xc37af
jmp 0xc37f8
callq 0xc3f02
testl %eax, %eax
je 0xc37e3
movq (%r14), %rdi
leaq 0x69fcf(%rip), %rsi     # 0x12d7a4
leaq 0x17a184(%rip), %rdx    # 0x23d960
xorl %eax, %eax
callq 0x9560
testl %ebx, %ebx
je 0xc37f8
movq (%r14), %rsi
movl $0xa, %edi
callq 0x9480
decl %ebx
jne 0xc37e7
leaq 0x17ab91(%rip), %rbx    # 0x23e390
movq (%rbx), %rdi
testq %rdi, %rdi
je 0xc3831
leaq 0x17a152(%rip), %rax    # 0x23d960
cmpb $0x21, 0x1(%rax)
jne 0xc382c
leaq 0x69f9d(%rip), %rsi     # 0x12d7b8
leaq 0x17a13e(%rip), %rdx    # 0x23d960
xorl %eax, %eax
callq 0x9560
movq (%rbx), %rdi
callq 0x9420
leaq 0x17abe8(%rip), %rax    # 0x23e420
cmpl $0x0, (%rax)
setne %al
movq (%r14), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xc3857
popq %rbx
popq %r14
popq %rbp
jmp 0x9420
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathmsc.cpp
// Function: sync_log_file()
void sync_log_file()
{
   if(log_file == 0) return;

   if(log_fmt != HEATHER) {
      end_log_track();
      sync_file(log_file);
      start_log_track();
   }
   else {
      sync_file(log_file);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x17a49c(%rip), %rbx    # 0x23e360
movq (%rbx), %rdi
testq %rdi, %rdi
je 0xc3ef0
leaq 0x17a575(%rip), %rax    # 0x23e448
cmpl $0x0, (%rax)
je 0xc3ef7
callq 0xc2c1e
movq (%rbx), %rdi
callq 0xa7e2
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xc292f
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xa7e2
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathmsc.cpp
// Function: filter_log_text()
int filter_log_text()
{
char *s;

   // remove potentially corrupting chars from log_text lines
   // returns 0 if resulting line is blank, 1 otherwise

   s = strchr(log_text, '!');
   while(s) {
      *s = ' ';
      s = strchr(s+1, '!');
   }

   s = strchr(log_text, '#');
   while(s) {
      *s = ' ';
      s = strchr(s+1, '#');
   }

   if(log_text[0] == 0) return 0;  // empty line
   if((log_text[0] == ' ') && (log_text[1] == 0)) return 0;  // blank line
   return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x179a51(%rip), %rdi    # 0x23d960
movl $0x21, %esi
callq 0x9100
testq %rax, %rax
je 0xc3f29
movb $0x20, (%rax)
incq %rax
movq %rax, %rdi
jmp 0xc3f0f
leaq 0x179a30(%rip), %rbx    # 0x23d960
movq %rbx, %rdi
movl $0x23, %esi
callq 0x9100
testq %rax, %rax
je 0xc3f4d
movb $0x20, (%rax)
incq %rax
movq %rax, %rdi
jmp 0xc3f33
movb (%rbx), %cl
testb %cl, %cl
je 0xc3f60
xorb $0x20, %cl
xorl %eax, %eax
orb 0x1(%rbx), %cl
setne %al
jmp 0xc3f62
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathmsc.cpp
// Function: write_rinex_line(_IO_FILE*, char*, char*)
void write_rinex_line(FILE *file, char *s, char *type)
{
char buf[SLEN+1];

   // output a 60:20 character line to a RINEX file

   if(file == 0) return;
   if(s == 0) return;
   if(type == 0) return;

   sprintf(buf, "%-60.60s%-20.20s", s,type);
   buf[80] = 0;
   fprintf(file, "%s\n", buf);
}

// Assembly:
movq %rdx, %rcx
movq %rsi, %rdx
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %sil
orb %al, %sil
testq %rcx, %rcx
sete %al
orb %sil, %al
jne 0xc3fd7
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movq %rdi, %rbx
leaq 0x697f1(%rip), %rsi     # 0x12d793
leaq -0x110(%rbp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x9060
movb $0x0, 0x50(%r14)
leaq 0x61b18(%rip), %rsi     # 0x125ad7
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x9560
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r14
popq %rbp
retq