LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_nvs_date()
void parse_nvs_date()
{
u32 tow;
u08 dd,mm;
u16 yy;
u08 tz_hh,tz_mm;
double delta;

   // 0x46 packet
   log_packet_id("nvs_date");

   tow = tsip_dword();
   dd = tsip_byte();
   mm = tsip_byte();
   yy = tsip_word();
   tz_hh = tsip_byte();
   tz_mm = tsip_byte();

   delta = nvs_msecs - ((double)tow*1000.0);

//sprintf(debug_text2, "%04d/%02d/%02d  tz:%02d:%02d  tow:%d  msecs:%f  delta:%f", 
//yy,mm,dd, tz_hh,tz_mm, tow,nvs_msecs, delta);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7df0b(%rip), %rdi     # 0x125e90
callq 0x58e77
callq 0x589b0
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0xa7fa5
leaq 0x196fce(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0xa7fbb
leaq 0x196fb8(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x588f0
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0xa7fd6
leaq 0x196f9d(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0xa7fec
leaq 0x196f87(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_nvs_disable()
void parse_nvs_disable()
{
int i;
u08 sys;
int prn;
u08 flag;

   // 0x47 packet
   log_packet_id("nvs_disable");

   for(i=0; i<32+24; i++) {
      sys = tsip_byte();
      prn = tsip_byte();
      flag = tsip_byte();

      if(sys == 1) ;
      else if(sys == 2) prn += NVS_GLONASS_PRN;
      else continue;

      if(flag == 1) ;     // enabled
      else if(flag == 2); // disabled
      else continue;

      if((prn >= 1) && (prn <= MAX_PRN)) {
         flag -= 1;
         sat[prn].disabled = flag;
         if(prn <= 32) {  // gps sats
            if(flag) sats_enabled &= (~(1 << (prn-1)));
            else     sats_enabled |= (1 << (prn-1));
         }
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x7de96(%rip), %rdi     # 0x125e99
callq 0x58e77
movl $0x38, %r15d
leaq 0x2650cf(%rip), %r13    # 0x30d0e4
leaq 0x196f54(%rip), %r12    # 0x23ef70
callq 0x587d1
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0xa802f
orb $0x8, (%r12)
callq 0x587d1
movl %eax, %r14d
cmpl $0x100, %eax            # imm = 0x100
jb 0xa8043
orb $0x8, (%r12)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0xa8054
orb $0x8, (%r12)
movzbl %r14b, %ecx
cmpb $0x1, %bl
je 0xa8068
movzbl %bl, %edx
cmpl $0x2, %edx
jne 0xa80b4
addl $0x40, %ecx
decb %al
cmpb $0x2, %al
setb %dl
testl %ecx, %ecx
setg %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0xa80b4
movl %ecx, %edx
imulq $0x348, %rdx, %rdx      # imm = 0x348
leaq 0x196f22(%rip), %rsi    # 0x23efb0
movb %al, 0x1(%rsi,%rdx)
cmpl $0x20, %ecx
jg 0xa80b4
decb %cl
movl $0x1, %edx
shll %cl, %edx
testb %al, %al
je 0xa80ac
notl %edx
andl (%r13), %edx
jmp 0xa80b0
orl (%r13), %edx
movl %edx, (%r13)
decl %r15d
jne 0xa801c
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: parse_nvs_iono()
void parse_nvs_iono()
{
float a0,a1,a2,a3;
float b0,b1,b2,b3;
u08 reliability;

   log_packet_id("nvs_iono");

   // 0x4A packet - ionosphere data
   a0 = tsip_single();
   a1 = tsip_single();
   a2 = tsip_single();
   a3 = tsip_single();
   b0 = tsip_single();
   b1 = tsip_single();
   b2 = tsip_single();
   b3 = tsip_single();
   reliability = tsip_byte();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7ddce(%rip), %rdi     # 0x125ea5
callq 0x58e77
callq 0x58aae
callq 0x58aae
callq 0x58aae
callq 0x58aae
callq 0x58aae
callq 0x58aae
callq 0x58aae
callq 0x58aae
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0xa811a
leaq 0x196e59(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_nvs_gnss_timescale()
void parse_nvs_gnss_timescale()
{
double a0, a1;
int tow;
int wnt;
int ls;
int wnf;
int dn;
int lsf;
int this_dn;
int wraps;

   log_packet_id("nvs_timescale");

   // 0x4B packet - calculate pending leapsecond info
   a1 = tsip_double();
   a0 = tsip_double();
   tow = tsip_dword();

   wnt = tsip_word();
   ls = (int) (s16) tsip_word();
   wnf = tsip_word();  // gps week
   dn = tsip_word();
   lsf = (int) (s16) tsip_word();

   this_dn = tow / (24*60*60);
   wraps = gps_week / 1024;
///sprintf(debug_text, "gps_week:%d wraps:%d wnt:%d ls:%d wnf:%d dn:%d lsf:%d this_dn:%d", 
///gps_week, wraps, wnt, ls, wnf, dn, lsf, this_dn);
// wnf += (wraps * 1024);

   // we ignore the rest of this message

   minor_alarms &= (~MINOR_LEAP_PEND);
   leap_days = (-1);
   have_leap_days = 0;
   if(ls != lsf) {
      minor_alarms |= MINOR_LEAP_PEND;
      calc_leap_days(wnf+(gps_week/256)*256, dn, 555);
      have_leap_info = 22;
   }
   have_leap_info = 22;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x7dd81(%rip), %rdi     # 0x125eae
callq 0x58e77
callq 0x58b86
callq 0x58b86
callq 0x589b0
callq 0x588f0
callq 0x588f0
movl %eax, %r15d
callq 0x588f0
movl %eax, %r14d
callq 0x588f0
movl %eax, %ebx
callq 0x588f0
leaq 0x26506f(%rip), %rcx    # 0x30d1d8
movl (%rcx), %edx
movl %edx, %esi
andl $0xffffff7f, %esi       # imm = 0xFFFFFF7F
movl %esi, (%rcx)
leaq 0x265070(%rip), %rsi    # 0x30d1ec
movl $0xffffffff, (%rsi)     # imm = 0xFFFFFFFF
leaq 0x265067(%rip), %rsi    # 0x30d1f0
movl $0x0, (%rsi)
cmpw %ax, %r15w
je 0xa81cd
movzwl %r14w, %eax
orl $0x80, %edx
movl %edx, (%rcx)
leaq 0x265590(%rip), %rcx    # 0x30d738
movzbl 0x1(%rcx), %ecx
shll $0x8, %ecx
addl %eax, %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
movzwl %bx, %edi
callq 0x5ccdb
leaq 0x2650d1(%rip), %rax    # 0x30d298
movl $0x16, (%rax)
leaq 0x2650c4(%rip), %rax    # 0x30d298
movl $0x16, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_nvs_mode()
void parse_nvs_mode()
{
u08 mode;
double delay;
int avg_time;

   // 0x55 packet
   log_packet_id("nvs_mode");

   mode = tsip_byte();
   delay = tsip_double();
   avg_time = (int) tsip_word();

   if(mode == 0) {
      if(nvs_traim & 0x04) rcvr_mode = RCVR_MODE_3D;
      else                 rcvr_mode = RCVR_MODE_2D_3D;
   }
   else if(mode == 1) rcvr_mode = RCVR_MODE_HOLD;
   else if(mode == 2) rcvr_mode = RCVR_MODE_SURVEY;
   else               rcvr_mode = RCVR_MODE_UNKNOWN;

   if(mode == 2) {
      minor_alarms |= MINOR_SURVEY;
      do_survey = avg_time;
      survey_why = 33;
   }
   else {
      minor_alarms &= (~MINOR_SURVEY);
      if(precision_survey == 0) {
         do_survey = 0;
         survey_why = (-333);
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x7d9a4(%rip), %rdi     # 0x125ed0
callq 0x58e77
callq 0x587d1
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0xa8549
leaq 0x196a2a(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x58b86
callq 0x588f0
cmpb $0x2, %bl
je 0xa8576
movzbl %bl, %ecx
cmpl $0x1, %ecx
je 0xa8572
testl %ecx, %ecx
jne 0xa857a
leaq 0x172b61(%rip), %rcx    # 0x21b0cc
movb (%rcx), %cl
andb $0x4, %cl
jmp 0xa857c
movb $0x7, %cl
jmp 0xa857c
movb $0xb, %cl
jmp 0xa857c
movb $0x63, %cl
leaq 0x264b4d(%rip), %rdx    # 0x30d0d0
movb %cl, (%rdx)
leaq 0x264c4c(%rip), %rcx    # 0x30d1d8
movl (%rcx), %edx
cmpb $0x2, %bl
jne 0xa85a2
orl $0x20, %edx
movl %edx, (%rcx)
movzwl %ax, %ecx
movl $0x21, %eax
jmp 0xa85ba
andl $-0x21, %edx
movl %edx, (%rcx)
leaq 0x2658ea(%rip), %rax    # 0x30de98
cmpb $0x0, (%rax)
jne 0xa85cd
movl $0xfffffeb3, %eax       # imm = 0xFFFFFEB3
xorl %ecx, %ecx
leaq 0x2658b7(%rip), %rdx    # 0x30de78
movq %rcx, (%rdx)
leaq 0x2658bd(%rip), %rcx    # 0x30de88
movl %eax, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_nvs_dops()
void parse_nvs_dops()
{
int gps_count;
int glonass_count;

   // 0x60 packet
   log_packet_id("nvs_dops");

   gps_count = tsip_byte();
   glonass_count = tsip_byte();
   hdop = tsip_single();
   vdop = tsip_single();
   have_dops |= (HDOP | VDOP);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7d8fa(%rip), %rdi     # 0x125ed9
callq 0x58e77
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0xa85fa
leaq 0x196979(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0xa8610
leaq 0x196963(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x58aae
cvtss2sd %xmm0, %xmm0
leaq 0x17aed0(%rip), %rax    # 0x2234f0
movsd %xmm0, (%rax)
callq 0x58aae
cvtss2sd %xmm0, %xmm0
leaq 0x17aec4(%rip), %rax    # 0x2234f8
movsd %xmm0, (%rax)
leaq 0x17aea5(%rip), %rax    # 0x2234e4
orb $0x6, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_nvs_pvtdops()
void parse_nvs_pvtdops()
{
   // 0x61 packet
   log_packet_id("nvs_pvtdops");

   hdop = tsip_single();
   vdop = tsip_single();
   tdop = tsip_single();
   // we ignore the rest of this message
   have_dops |= (HDOP | VDOP | TDOP);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7d893(%rip), %rdi     # 0x125ee2
callq 0x58e77
callq 0x58aae
cvtss2sd %xmm0, %xmm0
leaq 0x17ae8c(%rip), %rax    # 0x2234f0
movsd %xmm0, (%rax)
callq 0x58aae
cvtss2sd %xmm0, %xmm0
leaq 0x17ae80(%rip), %rax    # 0x2234f8
movsd %xmm0, (%rax)
callq 0x58aae
cvtss2sd %xmm0, %xmm0
leaq 0x17ae7c(%rip), %rax    # 0x223508
movsd %xmm0, (%rax)
leaq 0x17ae4d(%rip), %rax    # 0x2234e4
orb $0x16, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_nvs_version()
void parse_nvs_version()
{
int i;

   // 0x70 packet
   log_packet_id("nvs_version");

   nvs_chans = tsip_byte();
   for(i=0; i<21; i++) {  // version string
      nvs_id[i] = tsip_byte();
      nvs_id[i+1] = 0;
   }
   nvs_sn = tsip_dword();

   for(i=0; i<21; i++) {  // version string
      nvs_id2[i] = tsip_byte();
      nvs_id2[i+1] = 0;
   }
   nvs_sn2 = tsip_dword();

   for(i=0; i<21; i++) {  // version string
      nvs_id3[i] = tsip_byte();
      nvs_id3[i+1] = 0;
   }
   nvs_sn3 = tsip_dword();

   saw_version |= 0x2000;
   have_info |= ALL_ID_INFO;

   // we ignore the rest of this message
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x7d841(%rip), %rdi     # 0x125eee
callq 0x58e77
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0xa86c8
leaq 0x1968ab(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
leaq 0x1728f2(%rip), %rcx    # 0x21afc4
movl %eax, (%rcx)
movl $0x1, %r14d
leaq 0x17285f(%rip), %r15    # 0x21af40
leaq 0x196888(%rip), %rbx    # 0x23ef70
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0xa86f7
orb $0x8, (%rbx)
movb %al, -0x1(%r15,%r14)
movb $0x0, (%r15,%r14)
incq %r14
cmpq $0x16, %r14
jne 0xa86e8
callq 0x589b0
leaq 0x17284a(%rip), %rcx    # 0x21af60
movl %eax, (%rcx)
movl $0x1, %r14d
leaq 0x17284b(%rip), %r15    # 0x21af70
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0xa8734
orb $0x8, (%rbx)
movb %al, -0x1(%r15,%r14)
movb $0x0, (%r15,%r14)
incq %r14
cmpq $0x16, %r14
jne 0xa8725
callq 0x589b0
leaq 0x17283d(%rip), %rcx    # 0x21af90
movl %eax, (%rcx)
movl $0x1, %r14d
leaq 0x17283e(%rip), %r15    # 0x21afa0
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0xa8771
orb $0x8, (%rbx)
movb %al, -0x1(%r15,%r14)
movb $0x0, (%r15,%r14)
incq %r14
cmpq $0x16, %r14
jne 0xa8762
callq 0x589b0
leaq 0x172830(%rip), %rcx    # 0x21afc0
movl %eax, (%rcx)
leaq 0x264c6f(%rip), %rax    # 0x30d408
orb $0x20, 0x1(%rax)
leaq 0x2651d0(%rip), %rax    # 0x30d974
orb $0xf, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_nvs_time()
void parse_nvs_time()
{
double msecs;
u08 scale;
int week;
int i;
double gen_dev;
double time_dev;

   // 0x72 packet
   log_packet_id("nvs_time");

   nvs_msecs = msecs = tsip_fp80(); //  - 67108864.0;  // qqqqqqqqqqqqqq - 67....
   week = (int) (s16) tsip_word();
   scale = tsip_byte();
   gen_dev = tsip_double();   // ref gen deviation
   time_dev = tsip_double();  // sawtooth
   i = (int) (s16) tsip_word();
   if(!user_set_utc_ofs) {
      utc_offset = i;
      check_utc_ofs(12);
   }

   tsip_byte();
   tsip_word();

   dac_voltage = (float) time_dev;
   have_sawtooth = 6666;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x7d739(%rip), %rdi     # 0x125efa
callq 0x58e77
callq 0x58c1e
movsd %xmm0, 0x2c433d(%rip)   # 0x36cb10
callq 0x588f0
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0xa87ee
leaq 0x196785(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x58b86
callq 0x58b86
movsd %xmm0, -0x8(%rbp)
callq 0x588f0
leaq 0x264f2b(%rip), %rcx    # 0x30d734
cmpl $0x0, (%rcx)
jne 0xa885c
movswl %ax, %ecx
leaq 0x264f10(%rip), %rdx    # 0x30d728
movl %ecx, (%rdx)
leaq 0x264afb(%rip), %rcx    # 0x30d31c
cmpl $0x0, (%rcx)
jne 0xa885c
leaq 0x264ce7(%rip), %rdx    # 0x30d514
cmpl $0x7e1, (%rdx)          # imm = 0x7E1
setge %dl
cmpw $0x12, %ax
setl %sil
cmpw $0x11, %ax
jl 0xa885c
andb %dl, %sil
jne 0xa885c
leaq 0x16fff4(%rip), %rax    # 0x218844
movl $0x7dc, (%rax)          # imm = 0x7DC
movl $0xc, (%rcx)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0xa8872
leaq 0x196701(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x588f0
xorps %xmm0, %xmm0
cvtsd2ss -0x8(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x264176(%rip), %rax    # 0x30ca00
movsd %xmm0, (%rax)
leaq 0x264b2f(%rip), %rax    # 0x30d3c4
movl $0x1a0a, (%rax)         # imm = 0x1A0A
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_nvs_survey()
void parse_nvs_survey()
{
u08 mode;
double delay;
int avg_time;

   // 0x73 packet
   log_packet_id("nvs_survey");

   mode = tsip_byte();
   delay = tsip_double();
   avg_time = (int) tsip_word();

   if(mode == 0) {
      if(nvs_traim & 0x04) rcvr_mode = RCVR_MODE_3D;
      else                 rcvr_mode = RCVR_MODE_2D_3D;
   }
   else if(mode == 1) rcvr_mode = RCVR_MODE_HOLD;
   else if(mode == 2) rcvr_mode = RCVR_MODE_SURVEY;
   else               rcvr_mode = RCVR_MODE_UNKNOWN;

   if(mode == 2) {
      minor_alarms |= MINOR_SURVEY;
      do_survey = avg_time;
      survey_why = 33;
   }
   else {
      minor_alarms &= (~MINOR_SURVEY);
      if(precision_survey == 0) {
         do_survey = 0;
         survey_why = (-334);
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x7d655(%rip), %rdi     # 0x125f03
callq 0x58e77
callq 0x587d1
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0xa88cb
leaq 0x1966a8(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x58b86
callq 0x588f0
cmpb $0x2, %bl
je 0xa88f8
movzbl %bl, %ecx
cmpl $0x1, %ecx
je 0xa88f4
testl %ecx, %ecx
jne 0xa88fc
leaq 0x1727df(%rip), %rcx    # 0x21b0cc
movb (%rcx), %cl
andb $0x4, %cl
jmp 0xa88fe
movb $0x7, %cl
jmp 0xa88fe
movb $0xb, %cl
jmp 0xa88fe
movb $0x63, %cl
leaq 0x2647cb(%rip), %rdx    # 0x30d0d0
movb %cl, (%rdx)
leaq 0x2648ca(%rip), %rcx    # 0x30d1d8
movl (%rcx), %edx
cmpb $0x2, %bl
jne 0xa8924
orl $0x20, %edx
movl %edx, (%rcx)
movzwl %ax, %ecx
movl $0x21, %eax
jmp 0xa893c
andl $-0x21, %edx
movl %edx, (%rcx)
leaq 0x265568(%rip), %rax    # 0x30de98
cmpb $0x0, (%rax)
jne 0xa894f
movl $0xfffffeb2, %eax       # imm = 0xFFFFFEB2
xorl %ecx, %ecx
leaq 0x265535(%rip), %rdx    # 0x30de78
movq %rcx, (%rdx)
leaq 0x26553b(%rip), %rcx    # 0x30de88
movl %eax, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_nvs_timescale()
void parse_nvs_timescale()
{
double scale_shift;
u08 flags;
int gps_flags;
int glo_flags;

   // !!!! qqqqq do we need anything from here?
   // 0x74 packet
   log_packet_id("nvs_timescale");

   scale_shift = tsip_fp80();
   tsip_fp80();
   tsip_fp80();
   tsip_fp80();
   tsip_fp80();
   flags = tsip_byte();

   gps_flags = glo_flags = TFLAGS_NULL;
   if(!have_gnss_mask) {
      gps_flags |= TFLAGS_INVALID;
      glo_flags |= TFLAGS_INVALID;
   }

   if(time_flags & TFLAGS_UTC) {  // UTC time
      if(gnss_mask & GPS) {
         if((flags & 0x04) == 0) gps_flags |= TFLAGS_INVALID;
      }
      if(gnss_mask & GLONASS) {
         if((flags & 0x08) == 0) glo_flags |= TFLAGS_INVALID;
      }
   }
   else { // GPS time
      if(gnss_mask & GPS) {
         if((flags & 0x01) == 0) gps_flags |= TFLAGS_INVALID;
      }
      if(gnss_mask & GLONASS) {
         if((flags & 0x02) == 0) glo_flags |= TFLAGS_INVALID;
      }
   }
   if((gnss_mask & GPS) && (gnss_mask & GLONASS)) {  // see if we have valid time from at least one system
      if(gps_flags == 0) glo_flags = TFLAGS_NULL;  // we have GPS time
      if(glo_flags == 0) gps_flags = TFLAGS_NULL;  // we have GLONASS time
   }


   time_flags &= (~TFLAGS_INVALID);
   time_flags |= (gps_flags | glo_flags);
//sprintf(plot_title, "shift:%.10f  flags:%02X  tflags:%04X  gnss:%04X  have_utc:%d", 
//scale_shift, flags, time_flags, gnss_mask, have_utc_ofs);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7d54d(%rip), %rdi     # 0x125eae
callq 0x58e77
callq 0x58c1e
callq 0x58c1e
callq 0x58c1e
callq 0x58c1e
callq 0x58c1e
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0xa8995
leaq 0x1965de(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
leaq 0xc82dc(%rip), %rcx     # 0x170c78
xorl %esi, %esi
cmpl $0x0, (%rcx)
sete %sil
shll $0x2, %esi
leaq 0x264af5(%rip), %rcx    # 0x30d4a4
movl (%rcx), %edx
xorl %r8d, %r8d
testb $0x1, %dl
leaq 0xc82b6(%rip), %rdi     # 0x170c74
movl (%rdi), %edi
setne %r8b
movl $0x2, %r9d
movl $0x8, %r10d
cmovel %r9d, %r10d
testb $0x1, %dil
movl $0x4, %r9d
movl %esi, %r11d
cmovnel %r9d, %r11d
leal (%r8,%r8,2), %r8d
incl %r8d
testl %eax, %r8d
cmovnel %esi, %r11d
testb $0x2, %dil
cmovel %esi, %r9d
testl %eax, %r10d
cmovnel %esi, %r9d
notl %edi
andl $0x3, %edi
testl %r11d, %r11d
movl %r9d, %eax
cmovel %r11d, %eax
xorl %esi, %esi
movl %edi, %r8d
orl %eax, %r8d
cmovnel %r11d, %esi
testl %edi, %edi
cmovnel %r9d, %eax
andl $-0x5, %edx
orl %eax, %edx
orl %esi, %edx
movl %edx, (%rcx)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: fix_nvs_week(int)
int fix_nvs_week(int week)
{
   // adjust week for rollover

   week += 1024;
   if(year > 2019) week += 1024;
   else if(year == 2019) {
      if(month > 4) week += 1024;
      else if((month == 4) && (day >= 6)) week += 1024;
   }

   return week;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x264aa3(%rip), %rax    # 0x30d4dc
movl (%rax), %ecx
cmpl $0x7e4, %ecx            # imm = 0x7E4
jl 0xa8a4d
addl $0x800, %edi            # imm = 0x800
movl %edi, %eax
jmp 0xa8a84
leal 0x400(%rdi), %eax
cmpl $0x7e3, %ecx            # imm = 0x7E3
jne 0xa8a84
leaq 0x264a76(%rip), %rcx    # 0x30d4d8
movl (%rcx), %ecx
cmpl $0x5, %ecx
jge 0xa8a43
leaq 0x264a64(%rip), %rdx    # 0x30d4d4
addl $0x800, %edi            # imm = 0x800
cmpl $0x6, (%rdx)
cmovll %eax, %edi
cmpl $0x4, %ecx
cmovnel %eax, %edi
jmp 0xa8a49
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zy_antd()
void parse_zy_antd()
{
   // cable delay
   log_packet_id("cable delay");

   if(get_msg_field()) {
      cable_delay = atof(msg_field) / 1.0E9;
      have_cable_delay = 62;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7b5d6(%rip), %rdi     # 0x124b98
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0xa95fc
leaq 0x292469(%rip), %rdi    # 0x33ba40
callq 0x9470
divsd 0x5fa44(%rip), %xmm0    # 0x109028
leaq 0x2647dd(%rip), %rax    # 0x30ddc8
movsd %xmm0, (%rax)
leaq 0x263cbe(%rip), %rax    # 0x30d2b4
movl $0x3e, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zy_alrm()
void parse_zy_alrm()
{
int val;
int survey;

   // alarms
   log_packet_id("alarms");

   if(get_msg_field()) {
      val = atohex(msg_field);
      survey = (minor_alarms & (~MINOR_SURVEY));
      minor_alarms = 0x0000;
      critical_alarms = 0x0000;

      if(val & 0x0100) minor_alarms |= MINOR_OSC_AGE;
      if(val & 0x0200) critical_alarms |= CRIT_OCXO;
      if(val & 0x0010) critical_alarms |= CRIT_FPGA;
      if(val & 0x0020) minor_alarms |= MINOR_EEPROM;
      if(val & 0x0040) critical_alarms |= CRIT_GPS;
      if(val & 0x0080) minor_alarms |= MINOR_OSC_AGE;
      if(val & 0x0001) minor_alarms |= MINOR_NO_TRACK;
      if(val & 0x0002) minor_alarms |= (MINOR_ANT_NO_PWR);
      if(val & 0x0004) minor_alarms |= MINOR_OSC_CTRL;   // !!!!! TFOM
      if(val & 0x0008) critical_alarms |= CRIT_RAM;
      minor_alarms |= survey;
      have_antenna = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7b79b(%rip), %rdi     # 0x124da4
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0xa96a0
leaq 0x29241e(%rip), %rdi    # 0x33ba40
callq 0x98c6
leaq 0x263baa(%rip), %rcx    # 0x30d1d8
movl (%rcx), %edx
xorl %edi, %edi
movl %edi, (%rcx)
leaq 0x263b95(%rip), %rsi    # 0x30d1d0
movl %edi, (%rsi)
btl $0x8, %eax
jae 0xa9649
movl $0x1, (%rcx)
btl $0x9, %eax
jae 0xa9655
movl $0x10, (%rsi)
testb $0x10, %al
je 0xa965c
orb $0x8, (%rsi)
testb $0x20, %al
je 0xa9664
orb $0x4, 0x1(%rcx)
testb $0x40, %al
je 0xa966b
orb $0x8, (%rsi)
testb %al, %al
jns 0xa9672
orb $0x1, (%rcx)
testb $0x1, %al
je 0xa9679
orb $0x8, (%rcx)
testb $0x2, %al
je 0xa9680
orb $0x6, (%rcx)
testb $0x4, %al
je 0xa9687
orb $0x10, (%rcx)
andl $-0x21, %edx
testb $0x8, %al
je 0xa9691
orb $0x2, (%rsi)
orl %edx, (%rcx)
leaq 0x263b92(%rip), %rax    # 0x30d22c
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zy_azel()
void parse_zy_azel()
{
int prn;
double az,el;

   // satellite positions
   log_packet_id("sat info");

   reset_sat_tracking();

   while(1) {
      if(get_msg_field()) prn = atoi(msg_field);
      else break;

      if(get_msg_field()) el = atof(msg_field);
      else break;

      if(get_msg_field()) az = atof(msg_field);
      else break;

      if((prn >= 1) && (prn <= 32)) { 
         set_sat_azel(prn, (float) az, (float) el);
         if(az && el && sat[prn].sig_level) {
            sat[prn].level_msg = 52;
            sat[prn].visible = 1;
            have_snr |= rinex_gnss(prn);
         }
         else sat[prn].visible = 0;

         if(az && el) sat[prn].tracking = prn;
         else         sat[prn].tracking = (-1);
         have_sat_azel = 2;
         level_type = "dBc";
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
leaq 0x7b535(%rip), %rdi     # 0x124bef
callq 0x58e77
movl $0x218, %eax            # imm = 0x218
leaq 0x1958e5(%rip), %r15    # 0x23efb0
xorl %ecx, %ecx
movl %ecx, (%r15,%rax)
movl %ecx, -0x1fc(%r15,%rax)
addq $0x348, %rax            # imm = 0x348
cmpq $0xcd358, %rax          # imm = 0xCD358
jne 0xa96cd
callq 0x811da
testl %eax, %eax
je 0xa981c
leaq 0x292345(%rip), %rbx    # 0x33ba40
movq %rbx, %rdi
callq 0x95e0
movl %eax, %r14d
callq 0x811da
testl %eax, %eax
je 0xa981c
movq %rbx, %rdi
callq 0x9470
movaps %xmm0, -0x40(%rbp)
callq 0x811da
testl %eax, %eax
je 0xa981c
leal -0x1(%r14), %eax
cmpl $0x1f, %eax
ja 0xa980f
movq %rbx, %rdi
callq 0x9470
movaps %xmm0, -0x50(%rbp)
cvtsd2ss %xmm0, %xmm0
xorps %xmm1, %xmm1
cvtsd2ss -0x40(%rbp), %xmm1
movl %r14d, %edi
callq 0x5ad98
xorps %xmm0, %xmm0
movapd -0x40(%rbp), %xmm2
cmpneqpd %xmm0, %xmm2
movapd -0x50(%rbp), %xmm1
cmpneqpd %xmm0, %xmm1
andpd %xmm2, %xmm1
movd %xmm1, %r13d
movl %r14d, %r12d
testb $0x1, %r13b
je 0xa97c2
imulq $0x348, %r12, %rax      # imm = 0x348
movss 0x20(%r15,%rax), %xmm0
ucomiss 0x63865(%rip), %xmm0    # 0x10cffc
jne 0xa979b
jnp 0xa97c2
addq %r15, %rax
movl $0x34, 0x1c(%rax)
movl $0x1, 0x21c(%rax)
movl %r14d, %edi
callq 0xdbb74
leaq 0x263b8e(%rip), %rcx    # 0x30d34c
orl %eax, (%rcx)
jmp 0xa97d5
imulq $0x348, %r12, %rax      # imm = 0x348
movl $0x0, 0x21c(%r15,%rax)
imulq $0x348, %r12, %rax      # imm = 0x348
testb $0x1, %r13b
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmovel %ecx, %r14d
movl %r14d, 0x218(%r15,%rax)
leaq 0x263a9c(%rip), %rax    # 0x30d294
movl $0x2, (%rax)
leaq 0x783f5(%rip), %rax     # 0x121bfa
leaq 0x1956ec(%rip), %rcx    # 0x23eef8
movq %rax, (%rcx)
callq 0x811da
testl %eax, %eax
jne 0xa96fb
addq $0x28, %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: parse_zy_sigq()
void parse_zy_sigq()
{
int prn;
double snr;
int mode;

   // signal quality
   log_packet_id("signal quality");

   while(1) {
      if(get_msg_field()) prn = atoi(msg_field);
      else break;

      if(get_msg_field()) snr = (atof(msg_field) * 2.500) + 25.0;
      else break;

      if(get_msg_field()) mode = atoi(msg_field);
      else break;

      if((prn >= 1) && (prn <= 32)) { 
         sat[prn].sig_level = (float) snr;
         record_sig_levels(prn);
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x7c741(%rip), %rdi     # 0x125f7d
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0xa98c5
leaq 0x2921ef(%rip), %rbx    # 0x33ba40
leaq 0x195758(%rip), %r15    # 0x23efb0
movq %rbx, %rdi
callq 0x95e0
movl %eax, %r14d
callq 0x811da
testl %eax, %eax
je 0xa98c5
movq %rbx, %rdi
callq 0x9470
mulsd 0x5f8b4(%rip), %xmm0    # 0x109130
addsd 0x74eb4(%rip), %xmm0    # 0x11e738
movsd %xmm0, -0x20(%rbp)
callq 0x811da
testl %eax, %eax
je 0xa98c5
leal -0x1(%r14), %eax
cmpl $0x1f, %eax
ja 0xa98bc
xorps %xmm0, %xmm0
cvtsd2ss -0x20(%rbp), %xmm0
movl %r14d, %eax
imulq $0x348, %rax, %rax      # imm = 0x348
movss %xmm0, 0x20(%r15,%rax)
movl %r14d, %edi
callq 0x5ced3
callq 0x811da
testl %eax, %eax
jne 0xa9858
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zy_dacv()
void parse_zy_dacv()
{
double val;

   // dac voltage
   log_packet_id("dac voltage");

   if(get_msg_field()) {
      val = atof(msg_field);
      dac_voltage = (DATA_SIZE) (((val - 32768.0) / 32768.0) * 100.0);
      have_dac = 62;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7c6b1(%rip), %rdi     # 0x125f8c
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0xa9925
leaq 0x292150(%rip), %rdi    # 0x33ba40
callq 0x9470
addsd 0x74da3(%rip), %xmm0    # 0x11e6a0
mulsd 0x7490b(%rip), %xmm0    # 0x11e210
mulsd 0x5f753(%rip), %xmm0    # 0x109060
leaq 0x2630ec(%rip), %rax    # 0x30ca00
movsd %xmm0, (%rax)
leaq 0x2639dd(%rip), %rax    # 0x30d2fc
movl $0x3e, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zy_drft()
void parse_zy_drft()
{
   // osc drift
   log_packet_id("osc drift");

   if(get_msg_field()) {
      zyfer_drift = (DATA_SIZE) (atof(msg_field)*1.0E9);
      have_zyfer_drift = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7c666(%rip), %rdi     # 0x125f98
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0xa996c
leaq 0x2920f9(%rip), %rdi    # 0x33ba40
callq 0x9470
mulsd 0x5f6d4(%rip), %xmm0    # 0x109028
leaq 0x293ced(%rip), %rax    # 0x33d648
movsd %xmm0, (%rax)
leaq 0x293cea(%rip), %rax    # 0x33d650
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zy_efer()
void parse_zy_efer()
{
double efer;

   // osc freq error
   log_packet_id("freq error");

   if(get_msg_field()) {
      efer = atof(msg_field);
      osc_offset = (DATA_SIZE) ((efer * 1.0E9)*1000.0);
      have_osc_offset = 66;
      have_rcvr_osc = 66;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7c64a(%rip), %rdi     # 0x125fc3
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0xa99c5
leaq 0x2920b2(%rip), %rdi    # 0x33ba40
callq 0x9470
mulsd 0x5f68d(%rip), %xmm0    # 0x109028
mulsd 0x5f695(%rip), %xmm0    # 0x109038
leaq 0x262e16(%rip), %rax    # 0x30c7c0
movsd %xmm0, (%rax)
leaq 0x26387f(%rip), %rax    # 0x30d234
movl $0x42, %ecx
movl %ecx, (%rax)
leaq 0x263885(%rip), %rax    # 0x30d248
movl %ecx, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zy_essd()
void parse_zy_essd()
{
   // estimator of tdev
   log_packet_id("tdev estimate");

   if(get_msg_field()) {
      zyfer_tdev = (DATA_SIZE) (atof(msg_field)*1.0E9);
      have_zyfer_tdev = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7c5d0(%rip), %rdi     # 0x125fa2
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0xa9a0c
leaq 0x292059(%rip), %rdi    # 0x33ba40
callq 0x9470
mulsd 0x5f634(%rip), %xmm0    # 0x109028
leaq 0x293c5d(%rip), %rax    # 0x33d658
movsd %xmm0, (%rax)
leaq 0x293c5a(%rip), %rax    # 0x33d660
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zy_essn()
void parse_zy_essn()
{
   // undocumented - incrementing counter
   log_packet_id("essn");

   if(get_msg_field()) {
      zyfer_essn = (DATA_SIZE) atof(msg_field);
      have_zyfer_essn = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7c597(%rip), %rdi     # 0x125fb0
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0xa9a4b
leaq 0x292012(%rip), %rdi    # 0x33ba40
callq 0x9470
leaq 0x293c2e(%rip), %rax    # 0x33d668
movsd %xmm0, (%rax)
leaq 0x293c2b(%rip), %rax    # 0x33d670
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zy_gdop()
void parse_zy_gdop()
{
   // undocumented GDOP command
   log_packet_id("gdop");

   if(get_msg_field()) {
      gdop = (DATA_SIZE) atof(msg_field);
      have_dops |= GDOP;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x63dc2(%rip), %rdi     # 0x10d846
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0xa9ab3
leaq 0x291fa7(%rip), %rdi    # 0x33ba40
callq 0x9470
leaq 0x179a5b(%rip), %rax    # 0x223500
movsd %xmm0, (%rax)
leaq 0x179a34(%rip), %rax    # 0x2234e4
orb $0x8, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zy_hefe()
void parse_zy_hefe()
{

   // undocumented (holdover estimated freq error?)
   log_packet_id("holdover freq error");

   if(get_msg_field()) {
      zyfer_hefe = atof(msg_field)*1.0E9;
      have_zyfer_hefe = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7c4fa(%rip), %rdi     # 0x125fba
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0xa9afa
leaq 0x291f6b(%rip), %rdi    # 0x33ba40
callq 0x9470
mulsd 0x5f546(%rip), %xmm0    # 0x109028
leaq 0x293b8f(%rip), %rax    # 0x33d678
movsd %xmm0, (%rax)
leaq 0x293b8c(%rip), %rax    # 0x33d680
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zy_hint()
void parse_zy_hint()
{
   // holdover integrity
   log_packet_id("holdover integrity");

   zy_hflag = 2;
   zy_pll_bad = zy_gps_bad = zy_fix_bad = zy_bias_bad = (2);

   if(get_msg_field()) zy_hflag = atoi(msg_field);

   if(get_msg_field()) zy_pll_bad = atoi(msg_field);  // holdover reason
   if(get_msg_field()) zy_gps_bad = atoi(msg_field);
   if(get_msg_field()) zy_fix_bad = atoi(msg_field);
   if(get_msg_field()) zy_bias_bad = atoi(msg_field);

   have_zyfer_hint = 1;
   have_gps_status = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x7c46c(%rip), %rdi     # 0x125ff1
callq 0x58e77
leaq 0x293b17(%rip), %r13    # 0x33d6a8
movl $0x2, %eax
movl %eax, (%r13)
leaq 0x293b17(%rip), %rbx    # 0x33d6b8
movl %eax, (%rbx)
leaq 0x293b0a(%rip), %r14    # 0x33d6b4
movl %eax, (%r14)
leaq 0x293afc(%rip), %r15    # 0x33d6b0
movl %eax, (%r15)
leaq 0x293aee(%rip), %r12    # 0x33d6ac
movl %eax, (%r12)
callq 0x811da
testl %eax, %eax
je 0xa9bdb
leaq 0x291e6e(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, (%r13)
callq 0x811da
testl %eax, %eax
je 0xa9bf4
leaq 0x291e55(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, (%r12)
callq 0x811da
testl %eax, %eax
je 0xa9c0c
leaq 0x291e3c(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, (%r15)
callq 0x811da
testl %eax, %eax
je 0xa9c24
leaq 0x291e24(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, (%r14)
callq 0x811da
testl %eax, %eax
je 0xa9c3b
leaq 0x291e0c(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, (%rbx)
leaq 0x293a62(%rip), %rax    # 0x33d6a4
movl $0x1, (%rax)
leaq 0x263661(%rip), %rax    # 0x30d2b0
movl $0x0, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zy_leap()
void parse_zy_leap()
{
int p, f;

   // utc and leapsecond info
   log_packet_id("leapsecond info");

   p = f = 0;
   if(get_msg_field()) p = atoi(msg_field);
   if(get_msg_field()) f = atoi(msg_field);

   if(p) {
      if(!user_set_utc_ofs) utc_offset = p;
      check_utc_ofs(33);
   }

   minor_alarms &= (~MINOR_LEAP_PEND);
   if(p != f) {  // leap pending
      minor_alarms |= MINOR_LEAP_PEND;
   }
   have_leap_info = 33;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x79a40(%rip), %rdi     # 0x1236b2
callq 0x58e77
callq 0x811da
xorl %ebx, %ebx
movl $0x0, %r14d
testl %eax, %eax
je 0xa9c97
leaq 0x291db1(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, %r14d
callq 0x811da
testl %eax, %eax
je 0xa9cae
leaq 0x291d99(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, %ebx
testl %r14d, %r14d
je 0xa9d16
leaq 0x263a7a(%rip), %rax    # 0x30d734
cmpl $0x0, (%rax)
jne 0xa9cc9
leaq 0x263a62(%rip), %rax    # 0x30d728
movl %r14d, (%rax)
leaq 0x26364c(%rip), %rax    # 0x30d31c
cmpl $0x0, (%rax)
jne 0xa9d16
leaq 0x263838(%rip), %rcx    # 0x30d514
cmpl $0x7e1, (%rcx)          # imm = 0x7E1
setge %cl
leaq 0x263a3c(%rip), %rdx    # 0x30d728
movl (%rdx), %edx
cmpl $0x12, %edx
setl %sil
andb %cl, %sil
cmpl $0x11, %edx
setl %cl
orb %sil, %cl
jne 0xa9d16
leaq 0x16eb3a(%rip), %rcx    # 0x218844
movl $0x7f1, (%rcx)          # imm = 0x7F1
movl $0x21, (%rax)
leaq 0x2634bb(%rip), %rax    # 0x30d1d8
movl $0xffffff7f, %ecx       # imm = 0xFFFFFF7F
andl (%rax), %ecx
xorl %edx, %edx
cmpl %ebx, %r14d
setne %dl
shll $0x7, %edx
orl %ecx, %edx
movl %edx, (%rax)
leaq 0x26355e(%rip), %rax    # 0x30d298
movl $0x21, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zy_mang()
void parse_zy_mang()
{
double el_val;

   // elevation mask
   log_packet_id("elevation mask");

   if(get_msg_field()) {
      el_val = atof(msg_field);
      if((el_val >= 0.0) && (el_val <= 90.0)) {
         el_mask = (float) el_val;
         have_el_mask = 1;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x6a4de(%rip), %rdi     # 0x11422e
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0xa9d9e
leaq 0x291cdb(%rip), %rdi    # 0x33ba40
callq 0x9470
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0xa9d9e
movsd 0x61b94(%rip), %xmm1    # 0x10b910
ucomisd %xmm0, %xmm1
jb 0xa9d9e
cvtsd2ss %xmm0, %xmm0
leaq 0x263327(%rip), %rax    # 0x30d0b4
movss %xmm0, (%rax)
leaq 0x263664(%rip), %rax    # 0x30d3fc
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zy_ntlc()
void parse_zy_ntlc()
{
u32 val;
   // not time locked (holdover) count
   log_packet_id("not time locked");

   if(get_msg_field()) {
      val = (u32) atoi(msg_field);
      if(val) holdover = val;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7c259(%rip), %rdi     # 0x126004
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0xa9dd2
leaq 0x291c80(%rip), %rdi    # 0x33ba40
callq 0x95e0
testl %eax, %eax
je 0xa9dd2
leaq 0x263688(%rip), %rcx    # 0x30d458
movl %eax, (%rcx)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zy_ofst()
void parse_zy_ofst()
{
   // PPS output delay
   log_packet_id("pps delay");

   if(get_msg_field()) {  // PPS output delay
      pps1_delay = atof(msg_field) / 1.0E9;
      have_pps_delay |= 0x01;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7ada3(%rip), %rdi     # 0x124b82
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0xa9e16
leaq 0x291c4c(%rip), %rdi    # 0x33ba40
callq 0x9470
divsd 0x5f227(%rip), %xmm0    # 0x109028
leaq 0x263fd0(%rip), %rax    # 0x30ddd8
movsd %xmm0, (%rax)
leaq 0x2634a5(%rip), %rax    # 0x30d2b8
orb $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zy_pavg()
void parse_zy_pavg()
{
double val;

   // position averaging
   log_packet_id("position averaging");

   val = 0.0;
   if(get_msg_field()) val = atof(msg_field);
   else return;

   if(get_msg_field()) val += atof(msg_field)/ 60.0;
   else return;

   if(get_msg_field()) {
      if(msg_field[0] == 'N') ;
      else if(msg_field[0] == 'S') val = 0.0 - val;
      else return;
      lat = val * PI / 180.0;
   }
   else return;

   val = 0.0;
   if(get_msg_field()) val = atof(msg_field);
   else return;

   if(get_msg_field()) val += atof(msg_field)/ 60.0;
   else return;

   if(get_msg_field()) {
      if(msg_field[0] == 'E') ;
      else if(msg_field[0] == 'W') val = 0.0 - val;
      else return;
      lon = val * PI / 180.0;
   }
   else return;

   if(get_msg_field()) {
      alt = atof(msg_field);
   }
   else return;

   if(get_msg_field()) {  // averaging count
      val = atoi(msg_field);
      survey_progress = (int) (val / 3600.0 * 100.0);
      have_progress = 8;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
leaq 0x7c1ec(%rip), %rdi     # 0x126014
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0xa9fc7
leaq 0x291bff(%rip), %rdi    # 0x33ba40
callq 0x9470
movsd %xmm0, -0x18(%rbp)
callq 0x811da
testl %eax, %eax
je 0xa9fc7
leaq 0x291be1(%rip), %rbx    # 0x33ba40
movq %rbx, %rdi
callq 0x9470
movsd %xmm0, -0x10(%rbp)
callq 0x811da
testl %eax, %eax
je 0xa9fc7
movsd -0x10(%rbp), %xmm1
divsd 0x5f182(%rip), %xmm1    # 0x109008
movsd -0x18(%rbp), %xmm0
addsd %xmm1, %xmm0
movzbl (%rbx), %eax
cmpl $0x4e, %eax
je 0xa9eac
cmpl $0x53, %eax
jne 0xa9fc7
movapd %xmm0, %xmm1
xorpd %xmm0, %xmm0
subsd %xmm1, %xmm0
mulsd 0x61964(%rip), %xmm0    # 0x10b818
divsd 0x61964(%rip), %xmm0    # 0x10b820
leaq 0x26310d(%rip), %rax    # 0x30cfd0
movsd %xmm0, (%rax)
callq 0x811da
testl %eax, %eax
je 0xa9fc7
leaq 0x291b65(%rip), %rdi    # 0x33ba40
callq 0x9470
movsd %xmm0, -0x18(%rbp)
callq 0x811da
testl %eax, %eax
je 0xa9fc7
leaq 0x291b47(%rip), %rbx    # 0x33ba40
movq %rbx, %rdi
callq 0x9470
movsd %xmm0, -0x10(%rbp)
callq 0x811da
testl %eax, %eax
je 0xa9fc7
movsd -0x10(%rbp), %xmm1
divsd 0x5f0e8(%rip), %xmm1    # 0x109008
movsd -0x18(%rbp), %xmm0
addsd %xmm1, %xmm0
movzbl (%rbx), %eax
cmpl $0x45, %eax
je 0xa9f46
cmpl $0x57, %eax
jne 0xa9fc7
movapd %xmm0, %xmm1
xorpd %xmm0, %xmm0
subsd %xmm1, %xmm0
mulsd 0x618ca(%rip), %xmm0    # 0x10b818
divsd 0x618ca(%rip), %xmm0    # 0x10b820
leaq 0x26307b(%rip), %rax    # 0x30cfd8
movsd %xmm0, (%rax)
callq 0x811da
testl %eax, %eax
je 0xa9fc7
leaq 0x291acf(%rip), %rdi    # 0x33ba40
callq 0x9470
leaq 0x263063(%rip), %rax    # 0x30cfe0
movsd %xmm0, (%rax)
callq 0x811da
testl %eax, %eax
je 0xa9fc7
leaq 0x291aaf(%rip), %rdi    # 0x33ba40
callq 0x95e0
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x5f06b(%rip), %xmm0    # 0x109010
mulsd 0x5f0b3(%rip), %xmm0    # 0x109060
cvttsd2si %xmm0, %eax
leaq 0x263ed4(%rip), %rcx    # 0x30de8c
movl %eax, (%rcx)
leaq 0x263ecf(%rip), %rax    # 0x30de90
movl $0x8, (%rax)
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zy_vers()
void parse_zy_vers()
{
   // version info
   log_packet_id("version info");

   if(get_msg_field()) {
      msg_field[32] = 0;
      strcpy(zy_app_vers, msg_field);
   }

   if(get_msg_field()) {
      msg_field[32] = 0;
      strcpy(zy_app_date, msg_field);
   }

   if(get_msg_field()) {
      msg_field[32] = 0;
      strcpy(zy_gps, msg_field);
   }

   if(get_msg_field()) {
      msg_field[32] = 0;
      strcpy(zy_app_prog, msg_field);
   }

   if(get_msg_field()) {
      msg_field[32] = 0;
      strcpy(zy_option, msg_field);
   }

   have_info |= VERSION_INFO;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7c04e(%rip), %rdi     # 0x126027
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0xa9ffe
leaq 0x291a52(%rip), %rsi    # 0x33ba40
movb $0x0, 0x20(%rsi)
leaq 0x293567(%rip), %rdi    # 0x33d560
callq 0x9340
callq 0x811da
testl %eax, %eax
je 0xaa01e
leaq 0x291a32(%rip), %rsi    # 0x33ba40
movb $0x0, 0x20(%rsi)
leaq 0x2935a7(%rip), %rdi    # 0x33d5c0
callq 0x9340
callq 0x811da
testl %eax, %eax
je 0xaa03e
leaq 0x291a12(%rip), %rsi    # 0x33ba40
movb $0x0, 0x20(%rsi)
leaq 0x2934f7(%rip), %rdi    # 0x33d530
callq 0x9340
callq 0x811da
testl %eax, %eax
je 0xaa05e
leaq 0x2919f2(%rip), %rsi    # 0x33ba40
movb $0x0, 0x20(%rsi)
leaq 0x293537(%rip), %rdi    # 0x33d590
callq 0x9340
callq 0x811da
testl %eax, %eax
je 0xaa07e
leaq 0x2919d2(%rip), %rsi    # 0x33ba40
movb $0x0, 0x20(%rsi)
leaq 0x293577(%rip), %rdi    # 0x33d5f0
callq 0x9340
leaq 0x2638ef(%rip), %rax    # 0x30d974
orb $0x4, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zy_mani()
void parse_zy_mani()
{
   // mfg info
   log_packet_id("mfg info");

   if(get_msg_field()) {
      msg_field[32] = 0;
      strcpy(zy_mfgid, msg_field);
   }

   have_info |= MFG_INFO;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7bf9f(%rip), %rdi     # 0x126034
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0xaa0ba
leaq 0x291996(%rip), %rsi    # 0x33ba40
movb $0x0, 0x20(%rsi)
leaq 0x29341b(%rip), %rdi    # 0x33d4d0
callq 0x9340
leaq 0x2638b3(%rip), %rax    # 0x30d974
orb $0x8, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zy_prid()
void parse_zy_prid()
{
   // product id
   log_packet_id("product id");

   if(get_msg_field()) {
      msg_field[32] = 0;
      strcpy(zy_id, msg_field);
   }

   if(get_msg_field()) {
      msg_field[32] = 0;
      strcpy(zy_prod, msg_field);
   }

   if(get_msg_field()) {
      msg_field[32] = 0;
      strcpy(zy_sn, msg_field);
   }

   have_info |= MANUF_PARAMS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7bf6c(%rip), %rdi     # 0x12603d
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0xaa0f6
leaq 0x29195a(%rip), %rsi    # 0x33ba40
movb $0x0, 0x20(%rsi)
leaq 0x2932bf(%rip), %rdi    # 0x33d3b0
callq 0x9340
callq 0x811da
testl %eax, %eax
je 0xaa116
leaq 0x29193a(%rip), %rsi    # 0x33ba40
movb $0x0, 0x20(%rsi)
leaq 0x2932cf(%rip), %rdi    # 0x33d3e0
callq 0x9340
callq 0x811da
testl %eax, %eax
je 0xaa136
leaq 0x29191a(%rip), %rsi    # 0x33ba40
movb $0x0, 0x20(%rsi)
leaq 0x2932df(%rip), %rdi    # 0x33d410
callq 0x9340
leaq 0x263837(%rip), %rax    # 0x30d974
orb $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zy_unid()
void parse_zy_unid()
{
   // unit id
   log_packet_id("unit id");

   if(get_msg_field()) {
      msg_field[32] = 0;
      strcpy(zy_pn, msg_field);
   }

   if(get_msg_field()) {
      msg_field[32] = 0;
      strcpy(zy_rev, msg_field);
   }

   if(get_msg_field()) {
      msg_field[32] = 0;
      strcpy(zy_date, msg_field);
   }

   if(get_msg_field()) {
      msg_field[32] = 0;
      strcpy(zy_sn, msg_field);
   }

   if(get_msg_field()) {
      msg_field[32] = 0;
      strcpy(zy_fw, msg_field);
   }

   have_info |= PRODN_PARAMS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7befb(%rip), %rdi     # 0x126048
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0xaa172
leaq 0x2918de(%rip), %rsi    # 0x33ba40
movb $0x0, 0x20(%rsi)
leaq 0x2932d3(%rip), %rdi    # 0x33d440
callq 0x9340
callq 0x811da
testl %eax, %eax
je 0xaa192
leaq 0x2918be(%rip), %rsi    # 0x33ba40
movb $0x0, 0x20(%rsi)
leaq 0x293313(%rip), %rdi    # 0x33d4a0
callq 0x9340
callq 0x811da
testl %eax, %eax
je 0xaa1b2
leaq 0x29189e(%rip), %rsi    # 0x33ba40
movb $0x0, 0x20(%rsi)
leaq 0x293353(%rip), %rdi    # 0x33d500
callq 0x9340
callq 0x811da
testl %eax, %eax
je 0xaa1d2
leaq 0x29187e(%rip), %rsi    # 0x33ba40
movb $0x0, 0x20(%rsi)
leaq 0x293243(%rip), %rdi    # 0x33d410
callq 0x9340
callq 0x811da
testl %eax, %eax
je 0xaa1f2
leaq 0x29185e(%rip), %rsi    # 0x33ba40
movb $0x0, 0x20(%rsi)
leaq 0x293283(%rip), %rdi    # 0x33d470
callq 0x9340
leaq 0x26377b(%rip), %rax    # 0x30d974
orb $0x2, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zy_pulp()
void parse_zy_pulp()
{
   // pps polarity
   log_packet_id("pps polarity");

   if(get_msg_field()) {
      if(msg_field[0] == '+') pps_polarity = 0;
      else if(msg_field[0] == '-') pps_polarity = 1;
      else return;
      have_pps_polarity = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7be47(%rip), %rdi     # 0x126050
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0xaa24a
leaq 0x291822(%rip), %rax    # 0x33ba40
movzbl (%rax), %eax
cmpl $0x2b, %eax
je 0xaa232
cmpl $0x2d, %eax
jne 0xaa24a
movl $0x1, %eax
jmp 0xaa234
xorl %eax, %eax
leaq 0x263add(%rip), %rcx    # 0x30dd18
movl %eax, (%rcx)
leaq 0x26309c(%rip), %rax    # 0x30d2e0
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zy_pulr()
void parse_zy_pulr()
{
int rate;

   // PPS pulse rate
   log_packet_id("pps rate");

   if(get_msg_field()) {
      rate = atoi(msg_field);
      if(rate == 1) pps_rate = RATE_1PPS;
      else if(rate == 2) pps_rate = RATE_PP2S;
      else return;
      have_pps_rate = 33;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7a8e0(%rip), %rdi     # 0x124b37
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0xaa297
leaq 0x2917d4(%rip), %rdi    # 0x33ba40
callq 0x95e0
cmpl $0x1, %eax
je 0xaa27f
cmpl $0x2, %eax
jne 0xaa297
movb $-0x7e, %al
jmp 0xaa281
movb $0x2, %al
leaq 0x263a9b(%rip), %rcx    # 0x30dd23
movb %al, (%rcx)
leaq 0x26303f(%rip), %rax    # 0x30d2d0
movl $0x21, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zy_pulw()
void parse_zy_pulw()
{
double width;

   // PPS pulse width
   log_packet_id("pps width");

   if(get_msg_field()) {
      width = atof(msg_field);
      zyfer_pps_width = width;
      if(width == (-2.0)) width = 20.0E-6;
      else if(width == (-1.0)) width = 10.0E-6;
      else width /= 1000.0;
      have_pps_duty = 0x01;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7a5d1(%rip), %rdi     # 0x124875
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0xaa2d6
leaq 0x291787(%rip), %rdi    # 0x33ba40
callq 0x9470
leaq 0x263a93(%rip), %rax    # 0x30dd58
movsd %xmm0, (%rax)
leaq 0x263a94(%rip), %rax    # 0x30dd64
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zy_rsah()
void parse_zy_rsah()
{
int prn;
int c;

   // sat health
   log_packet_id("sat health");

   if(get_msg_field()) {
      reset_sat_health();
      for(prn=1; prn<=32; prn++) {
         c = msg_field[prn-1];
         if(c == 0) break;
         if(c == '0') sat[prn].health_flag = 1;      // unhealthy
         else if(c == '1') sat[prn].health_flag = 2; // healthy
         else continue;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7bd7a(%rip), %rdi     # 0x12605d
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0xaa34f
xorl %eax, %eax
leaq 0x194cb6(%rip), %rcx    # 0x23efb0
movb $0x0, (%rcx,%rax)
addq $0x348, %rax            # imm = 0x348
cmpq $0xcd140, %rax          # imm = 0xCD140
jne 0xaa2fa
movl $0x348, %eax            # imm = 0x348
addq 0xa5c28(%rip), %rax     # 0x14ff40
xorl %ecx, %ecx
leaq 0x29171f(%rip), %rdx    # 0x33ba40
movzbl (%rdx,%rcx), %esi
cmpl $0x30, %esi
je 0xaa33a
cmpl $0x31, %esi
je 0xaa335
testl %esi, %esi
jne 0xaa340
jmp 0xaa34f
movb $0x2, %sil
jmp 0xaa33d
movb $0x1, %sil
movb %sil, (%rax)
addq $0x348, %rax            # imm = 0x348
incq %rcx
cmpq $0x20, %rcx
jne 0xaa321
popq %rbp
retq