LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_gpacc()
void parse_gpacc()
{
int prn;
int acc;
char c[2];

   if(get_msg_field()) {
      for(prn=1; prn<=32; prn++) {
         c[0] = msg_field[prn-1];
         c[1] = 0;
         if(c[0] == 0) break;

         if(c[0] == 'X') acc = (-1);
         else            acc = atohex(c);
         sat[prn].sv_accuracy = ura_to_dist(prn, acc);

         if(have_accu == 0) need_redraw = 2344;
         have_accu = 1;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
callq 0x811da
testl %eax, %eax
je 0x82e46
movl $0x544, %r14d           # imm = 0x544
addq 0xcd16d(%rip), %r14     # 0x14ff40
xorl %r15d, %r15d
leaq 0x2b8c63(%rip), %r12    # 0x33ba40
leaq 0x28a5dc(%rip), %r13    # 0x30d3c0
leaq -0x2a(%rbp), %rbx
movzbl (%r12,%r15), %eax
movb %al, -0x2a(%rbp)
movb $0x0, -0x29(%rbp)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
cmpl $0x58, %eax
je 0x82e0c
testl %eax, %eax
je 0x82e46
movq %rbx, %rdi
callq 0x98c6
movl %eax, %esi
leal 0x1(%r15), %edi
callq 0x82d30
movss %xmm0, (%r14)
cmpl $0x0, (%r13)
jne 0x82e2e
leaq 0x195a1c(%rip), %rax    # 0x218844
movl $0x928, (%rax)          # imm = 0x928
movl $0x1, (%r13)
incq %r15
addq $0x348, %r14            # imm = 0x348
cmpq $0x20, %r15
jne 0x82de8
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_gpanc()
void parse_gpanc()
{
int i;
char c;

   get_msg_field();  // eat the almanac time string

   if(get_msg_field()) {
      reset_sat_health();
      for(i=0; i<32; i++) {
         c = msg_field[i];
         if(c == 0) break;
         else if(c == '0') sat[i+1].health_flag = 0;  // no sat
         else if(c == '1') sat[i+1].health_flag = 1;  // unhealthy
         else if(c == '2') sat[i+1].health_flag = 2;  // good
      }
   }
   else return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0x811da
callq 0x811da
testl %eax, %eax
je 0x82ece
xorl %eax, %eax
leaq 0x1bc140(%rip), %rcx    # 0x23efb0
movb $0x0, (%rcx,%rax)
addq $0x348, %rax            # imm = 0x348
cmpq $0xcd140, %rax          # imm = 0xCD140
jne 0x82e70
movl $0x348, %eax            # imm = 0x348
addq 0xcd0b2(%rip), %rax     # 0x14ff40
xorl %ecx, %ecx
leaq 0x2b8ba9(%rip), %rdx    # 0x33ba40
movzbl (%rdx,%rcx), %esi
xorl %edi, %edi
cmpl $0x30, %esi
jle 0x82eb1
cmpl $0x32, %esi
je 0x82eb9
cmpl $0x31, %esi
jne 0x82ebf
movb $0x1, %dil
jmp 0x82ebc
je 0x82ebc
testl %esi, %esi
jne 0x82ebf
jmp 0x82ece
movb $0x2, %dil
movb %dil, (%rax)
incq %rcx
addq $0x348, %rax            # imm = 0x348
cmpq $0x20, %rcx
jne 0x82e97
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_gpgpt()
void parse_gpgpt()
{
int val;
int i;

   if(get_msg_field()) {  // gps time valid
      val = atoi(msg_field);
      if(val) time_flags &= (~TFLAGS_INVALID);
      else    time_flags |= (TFLAGS_INVALID);
   }

   if(get_msg_field()) {  // gps week
      gps_week = atoi(msg_field);
      faked_tow = 0;
      have_week = 1;
   }

   if(get_msg_field()) {  // GPS TOW
      pri_tow = atoi(msg_field);
      tow = pri_tow;  
      this_tow = tow;
      survey_tow = tow;

      if(have_tow == 0) need_redraw = 3029;
      have_tow = 55;
   }

   if(get_msg_field()) {  // leap second count
      i = atoi(msg_field);
      time_flags |= TFLAGS_NO_UTC_OFS;
      if(i) {
         time_flags &= (~TFLAGS_NO_UTC_OFS);
         if(!user_set_utc_ofs) utc_offset = i;
         check_utc_ofs(334);
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0x811da
testl %eax, %eax
je 0x82f01
leaq 0x2b8b5c(%rip), %rdi    # 0x33ba40
callq 0x95e0
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
leaq 0x28a5ad(%rip), %rax    # 0x30d4a4
movl (%rax), %edx
andl $-0x5, %edx
leal (%rdx,%rcx,4), %ecx
movl %ecx, (%rax)
callq 0x811da
testl %eax, %eax
je 0x82f3a
leaq 0x2b8b2f(%rip), %rdi    # 0x33ba40
callq 0x95e0
leaq 0x28a81b(%rip), %rcx    # 0x30d738
movw %ax, (%rcx)
leaq 0x28a821(%rip), %rax    # 0x30d748
movl $0x0, (%rax)
leaq 0x28a3f8(%rip), %rax    # 0x30d32c
movl $0x1, (%rax)
callq 0x811da
testl %eax, %eax
je 0x82f95
leaq 0x2b8af6(%rip), %rdi    # 0x33ba40
callq 0x95e0
leaq 0x28a7ee(%rip), %rcx    # 0x30d744
movl %eax, (%rcx)
leaq 0x28a7dd(%rip), %rcx    # 0x30d73c
movl %eax, (%rcx)
leaq 0x28a7d8(%rip), %rcx    # 0x30d740
movl %eax, (%rcx)
movl %eax, %eax
leaq 0x28a7dd(%rip), %rcx    # 0x30d750
movq %rax, (%rcx)
leaq 0x28a3ab(%rip), %rax    # 0x30d328
cmpl $0x0, (%rax)
jne 0x82f8f
leaq 0x1958bb(%rip), %rcx    # 0x218844
movl $0xbd5, (%rcx)          # imm = 0xBD5
movl $0x37, (%rax)
callq 0x811da
testl %eax, %eax
je 0x83029
leaq 0x2b8a97(%rip), %rdi    # 0x33ba40
callq 0x95e0
leaq 0x28a4ef(%rip), %rcx    # 0x30d4a4
movl (%rcx), %edx
movl %edx, %esi
orl $0x8, %esi
movl %esi, (%rcx)
testl %eax, %eax
je 0x83029
andl $-0x9, %edx
movl %edx, (%rcx)
leaq 0x28a766(%rip), %rcx    # 0x30d734
cmpl $0x0, (%rcx)
jne 0x82fdc
leaq 0x28a74e(%rip), %rcx    # 0x30d728
movl %eax, (%rcx)
leaq 0x28a339(%rip), %rax    # 0x30d31c
cmpl $0x0, (%rax)
jne 0x83029
leaq 0x28a525(%rip), %rcx    # 0x30d514
cmpl $0x7e1, (%rcx)          # imm = 0x7E1
setge %cl
leaq 0x28a729(%rip), %rdx    # 0x30d728
movl (%rdx), %edx
cmpl $0x12, %edx
setl %sil
andb %cl, %sil
cmpl $0x11, %edx
setl %cl
orb %sil, %cl
jne 0x83029
leaq 0x195827(%rip), %rcx    # 0x218844
movl $0x91e, (%rcx)          # imm = 0x91E
movl $0x14e, (%rax)          # imm = 0x14E
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_gpmge()
void parse_gpmge()
{
int i;
int prn;

   // get prohibited SBAS sats bitmask (answer from gpmgq query)

   for(i=0; i<32; i++) {
      prn = i+120;
      sat[prn].disabled = 0;
   }

   if(get_msg_field()) {  // gps week
      excluded_sbas = (u32) atohex(msg_field);
      for(i=0; i<32; i++) {
         prn = i+120;
         if(excluded_sbas & (1 << i)) sat[prn].disabled = 1;
      }
   }
   else return;
}

// Assembly:
xorl %eax, %eax
leaq 0x1bbf7c(%rip), %rcx    # 0x23efb0
movb $0x0, 0x189c1(%rcx,%rax)
addq $0x348, %rax            # imm = 0x348
cmpq $0x6900, %rax           # imm = 0x6900
jne 0x83034
pushq %rbp
movq %rsp, %rbp
callq 0x811da
testl %eax, %eax
je 0x83092
leaq 0x2b89e2(%rip), %rdi    # 0x33ba40
callq 0x98c6
leaq 0x28a07e(%rip), %rcx    # 0x30d0e8
movl %eax, (%rcx)
movl $0x189c1, %ecx          # imm = 0x189C1
addq 0xccec8(%rip), %rcx     # 0x14ff40
xorl %edx, %edx
btl %edx, %eax
jae 0x83082
movb $0x1, (%rcx)
incq %rdx
addq $0x348, %rcx            # imm = 0x348
cmpq $0x20, %rdx
jne 0x8307a
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_gprrm()
void parse_gprrm()
{
int traim_offset;

   // traim status

   traim_alarm = traim_status = traim_deleted = traim_offset = 0;

   if(get_msg_field()) {
      traim_alarm = atoi(msg_field);
   }

   if(get_msg_field()) {
      traim_status = atoi(msg_field);
   }

   if(get_msg_field()) {
      traim_deleted = atoi(msg_field);
   }

   get_msg_field();  // reserved
   get_msg_field();  // reserved
   get_msg_field();  // reserved
   get_msg_field();  // reserved

   if(get_msg_field()) {
      traim_offset = atoi(msg_field);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x2ba1ef(%rip), %rbx    # 0x33d2a8
xorl %eax, %eax
movl %eax, (%rbx)
leaq 0x198004(%rip), %r14    # 0x21b0c8
movl %eax, (%r14)
leaq 0x2ba1de(%rip), %r15    # 0x33d2ac
movl %eax, (%r15)
callq 0x811da
testl %eax, %eax
je 0x830e9
leaq 0x2b895f(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, (%r15)
callq 0x811da
testl %eax, %eax
je 0x83101
leaq 0x2b8947(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, (%r14)
callq 0x811da
testl %eax, %eax
je 0x83118
leaq 0x2b892f(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, (%rbx)
callq 0x811da
callq 0x811da
callq 0x811da
callq 0x811da
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x811da
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_gprsd()
void parse_gprsd()
{
int furuno_traim;
int pps_mode;

   // pps/traim config

   if(get_msg_field()) {
      traim_mode = atoi(msg_field);
      have_traim = 1;
   }

   if(get_msg_field()) {
      furuno_traim = atoi(msg_field);
   }

   if(get_msg_field()) {
      pps_mode = atoi(msg_field);
      if(pps_mode) pps_enabled = 1;
      else         pps_enabled = 0;
      have_pps_enable = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0x811da
testl %eax, %eax
je 0x8316a
leaq 0x2b88f1(%rip), %rdi    # 0x33ba40
callq 0x95e0
leaq 0x197f65(%rip), %rcx    # 0x21b0c0
movl %eax, (%rcx)
leaq 0x28a264(%rip), %rax    # 0x30d3c8
movl $0x1, (%rax)
callq 0x811da
callq 0x811da
testl %eax, %eax
je 0x8319d
leaq 0x2b88c1(%rip), %rdi    # 0x33ba40
callq 0x95e0
testl %eax, %eax
leaq 0x28ab93(%rip), %rax    # 0x30dd20
setne (%rax)
leaq 0x28a145(%rip), %rax    # 0x30d2dc
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_gptmd()
void parse_gptmd()
{
   minor_alarms &= (~MINOR_SURVEY);
   survey_secs = 0;
   survey_length = 0;

   if(get_msg_field()) {   // samples remaining
      if(msg_field[0]) {
         survey_secs = atoi(msg_field);
         if(survey_secs) minor_alarms |= MINOR_SURVEY;
         survey_length = survey_secs;
      }
   }
   else return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x289e0e(%rip), %rbx    # 0x30d1d8
andb $-0x21, (%rbx)
leaq 0x28aac0(%rip), %r15    # 0x30de94
xorl %eax, %eax
movl %eax, (%r15)
leaq 0x28aa90(%rip), %r14    # 0x30de70
movl %eax, (%r14)
callq 0x811da
testl %eax, %eax
je 0x83411
leaq 0x2b864d(%rip), %rax    # 0x33ba40
cmpb $0x0, (%rax)
je 0x83411
leaq 0x2b8641(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, (%r15)
testl %eax, %eax
je 0x8340e
orb $0x20, (%rbx)
movl %eax, (%r14)
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_gptst()
void parse_gptst()
{
int status;
double id;
int t1,t2;

   // test results
   t1 = t2 = status = 0;
   id = 0;

   if(get_msg_field()) {
      status = atoi(msg_field);
      if(status == 0) need_redraw = 8527;
   }

   if(get_msg_field()) {
      id = atof(msg_field);
      furuno_pgm = (int) (id / 100.0);
      furuno_ver = (int) fmod(id, 100.0);
      have_info |= ALL_ID_INFO;
   }

   if(get_msg_field()) {
      t1 = atoi(msg_field);
   }

   if(get_msg_field()) {
      t2 = atoi(msg_field);

      critical_alarms = 0;
      have_critical_alarms = 1;
      have_antenna = 1;

      if(t2 & 0x01) {  // ROM error
         critical_alarms |= CRIT_ROM;
      }

      if(t2 & 0x02) {  // RAM error
         critical_alarms |= CRIT_RAM;
      }

      if(t2 & 0x04) {  // antenna error
         minor_alarms |= MINOR_ANT_NO_PWR;
      }
      else {
         minor_alarms &= (~MINOR_ANT_NO_PWR);
      }

      if(t2 & 0x08) {  // backup param error
         critical_alarms |= CRIT_RTC;
      }
   }

   if(status == 0) {
      send_furuno_cmd("GPtrq,1");  // finish self test
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
callq 0x811da
movb $0x1, %bl
testl %eax, %eax
je 0x8372d
leaq 0x2b832d(%rip), %rdi    # 0x33ba40
callq 0x95e0
testl %eax, %eax
je 0x83720
xorl %ebx, %ebx
jmp 0x8372d
leaq 0x19511d(%rip), %rax    # 0x218844
movl $0x214f, (%rax)         # imm = 0x214F
callq 0x811da
testl %eax, %eax
je 0x8377b
leaq 0x2b8303(%rip), %rdi    # 0x33ba40
callq 0x9470
movsd 0x85916(%rip), %xmm1    # 0x109060
movapd %xmm0, %xmm2
divsd %xmm1, %xmm2
cvttsd2si %xmm2, %eax
leaq 0x2b9b37(%rip), %rcx    # 0x33d294
movl %eax, (%rcx)
callq 0x94d0
cvttsd2si %xmm0, %eax
leaq 0x2b9b29(%rip), %rcx    # 0x33d298
movl %eax, (%rcx)
leaq 0x28a1fc(%rip), %rax    # 0x30d974
orb $0xf, (%rax)
callq 0x811da
callq 0x811da
testl %eax, %eax
je 0x837ec
leaq 0x2b82b0(%rip), %rdi    # 0x33ba40
callq 0x95e0
leaq 0x289a34(%rip), %rcx    # 0x30d1d0
movl $0x0, (%rcx)
leaq 0x289aff(%rip), %rdx    # 0x30d2a8
movl $0x1, %esi
movl %esi, (%rdx)
leaq 0x289a75(%rip), %rdx    # 0x30d22c
movl %esi, (%rdx)
testb $0x1, %al
je 0x837c3
movl $0x1, (%rcx)
testb $0x2, %al
je 0x837ca
orb $0x2, (%rcx)
movl %eax, %edx
shll $0x1d, %edx
sarl $0x1f, %edx
leaq 0x2899ff(%rip), %rsi    # 0x30d1d8
movl (%rsi), %edi
andl $-0x7, %edi
andl $0x6, %edx
orl %edi, %edx
movl %edx, (%rsi)
testb $0x8, %al
je 0x837ec
orb $0x10, (%rcx)
testb %bl, %bl
je 0x83802
leaq 0x9f5ac(%rip), %rdi     # 0x122da3
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5f070
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_gpwav()
void parse_gpwav()
{
int geo_sat;
int i;
int prn;
int el;
int az;
int snr;

   // SBAS sat info - from GPint,wav00
   for(i=120; i<140; i++) {
      sat[i].level_msg = (0);
   }

   if(get_msg_field()) {
      geo_sat = atoi(msg_field);
   }
   else return;

   for(i=0; i<geo_sat; i++) {
      if(get_msg_field()) {
         prn = atoi(msg_field);
      }
      else break;

      if(get_msg_field()) {
         el = atoi(msg_field);
      }
      else break;

      if(get_msg_field()) {
         az = atoi(msg_field);
      } 
      else break;

      if(get_msg_field()) {
         snr = atoi(msg_field);
      }
      else break;

      if((prn >= 1) && (prn <= MAX_PRN)) {
         sat[prn].level_msg = 111;
         set_sat_azel(prn, (float) az, (float) el);
         sat[prn].sig_level = (float) snr;
         have_snr |= rinex_gnss(prn);
         if(snr > 0) sat[prn].tracking = prn;
         else        sat[prn].tracking = (-1);
         have_sat_azel = 2;

         record_sig_levels(prn);
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %eax, %eax
leaq 0x1bb768(%rip), %r14    # 0x23efb0
movl $0x0, 0x189dc(%r14,%rax)
addq $0x348, %rax            # imm = 0x348
cmpq $0x41a0, %rax           # imm = 0x41A0
jne 0x83848
callq 0x811da
testl %eax, %eax
je 0x83989
leaq 0x2b81ca(%rip), %rdi    # 0x33ba40
callq 0x95e0
testl %eax, %eax
jle 0x83989
movl %eax, %ebx
callq 0x811da
testl %eax, %eax
je 0x83989
leaq 0x2b81a7(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, %r15d
callq 0x811da
testl %eax, %eax
je 0x83989
leaq 0x2b818b(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, %r12d
callq 0x811da
testl %eax, %eax
je 0x83989
leaq 0x2b816f(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, %r13d
callq 0x811da
testl %eax, %eax
je 0x83989
leal -0x1(%r15), %eax
cmpl $0x3e6, %eax            # imm = 0x3E6
ja 0x83981
leaq 0x2b8144(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, -0x2c(%rbp)
movl %r15d, %eax
imulq $0x348, %rax, %rax      # imm = 0x348
xorps %xmm0, %xmm0
cvtsi2ss %r13d, %xmm0
movq %rax, %r13
movl $0x6f, 0x1c(%r14,%rax)
xorps %xmm1, %xmm1
cvtsi2ss %r12d, %xmm1
movl %r15d, %edi
callq 0x5ad98
movl -0x2c(%rbp), %r12d
xorps %xmm0, %xmm0
cvtsi2ss %r12d, %xmm0
movss %xmm0, 0x20(%r14,%r13)
movl %r15d, %edi
callq 0xdbb74
leaq 0x2899f8(%rip), %rcx    # 0x30d34c
orl %eax, (%rcx)
testl %r12d, %r12d
movl %r15d, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmovlel %ecx, %eax
movl %eax, 0x218(%r14,%r13)
leaq 0x289921(%rip), %rax    # 0x30d294
movl $0x2, (%rax)
movl %r15d, %edi
callq 0x5ced3
decl %ebx
jne 0x83885
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: get_fixed_field(int)
int get_fixed_field(int width)
{
char c;
int i;

   // get a fixed with field from a message

   msg_field[0] = 0;
   if(width <= 0) return 0;
   if(nmea_msg[msg_col] == 0) return 0;  // at end-of-message

   i = 0;
   while(width--) {   // get next field from the nmea message
      c = nmea_msg[msg_col];
      if(c == 0) {  // reached end-of-message
         break;
      }

      if(i < ((int)sizeof(msg_field)-2)) {
         msg_field[i++] = c;
         msg_field[i] = 0;
         ++msg_col;
      }
   }

   return msg_field[0];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x2b7bb2(%rip), %rcx    # 0x33ba40
movb $0x0, (%rcx)
xorl %eax, %eax
testl %edi, %edi
jle 0x83ee5
leaq 0x2b7da6(%rip), %rdx    # 0x33bc44
movslq (%rdx), %r8
leaq 0x2b7988(%rip), %rsi    # 0x33b830
cmpb $0x0, (%rsi,%r8)
je 0x83ee5
movl (%rdx), %eax
xorl %r8d, %r8d
movslq %eax, %r9
movb (%rsi,%r9), %r9b
testb %r9b, %r9b
je 0x83ee2
cmpl $0x1fe, %r8d            # imm = 0x1FE
jg 0x83ede
movslq %r8d, %r10
leaq 0x1(%r10), %r8
movb %r9b, (%rcx,%r10)
movb $0x0, 0x1(%rcx,%r10)
incl %eax
movl %eax, (%rdx)
decl %edi
jne 0x83eb4
movsbl (%rcx), %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_crn()
void parse_crn()
{
int i;
int system;
int prn;
int frame[MAX_PRN+1][10];

   // GPS navigation subframe

   system = (-1);
   prn = 0;

   if(get_msg_field()) {
      system = atoi(msg_field);
      if(system != 1) return;  // system 1 is GPS
   }

   if(get_msg_field()) {
      prn = atoi(msg_field);
      if(prn <= 0) return;
      if(prn >= MAX_PRN) return;
   }

   for(i=0; i<10; i++) {
      if(get_fixed_field(6)) {
         if(msg_field[0] == '-') frame[prn][i] = 0;
         else frame[prn][i] = atohex(msg_field);
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
callq 0x811da
testl %eax, %eax
je 0x8448f
leaq 0x2b75bb(%rip), %rdi    # 0x33ba40
callq 0x95e0
cmpl $0x1, %eax
jne 0x844dd
callq 0x811da
testl %eax, %eax
je 0x844b0
leaq 0x2b75a1(%rip), %rdi    # 0x33ba40
callq 0x95e0
addl $0xfffffc19, %eax       # imm = 0xFFFFFC19
cmpl $0xfffffc1a, %eax       # imm = 0xFFFFFC1A
jb 0x844dd
movl $0xa, %r14d
leaq 0x2b7583(%rip), %rbx    # 0x33ba40
movl $0x6, %edi
callq 0x83e83
testl %eax, %eax
je 0x844d8
cmpb $0x2d, (%rbx)
je 0x844d8
movq %rbx, %rdi
callq 0x98c6
decl %r14d
jne 0x844bd
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_z12_rid()
void parse_z12_rid()
{
   // Z12 receiver ID
   log_packet_id("z12_rid");

   if(get_msg_field()) {  // type
      msg_field[32] = 0;
      strcpy(z12_type, msg_field);
   }

   if(get_msg_field()) {  // channel options
      msg_field[32] = 0;
      strcpy(z12_chan_opt, msg_field);
   }

   if(get_msg_field()) {  // nav version
      msg_field[32] = 0;
      strcpy(z12_nav_ver, msg_field);
   }

   if(get_msg_field()) {  // rsvd
      msg_field[32] = 0;
      strcpy(z12_rsvd, msg_field);
   }

   if(get_msg_field()) {  // chan version
      msg_field[32] = 0;
      strcpy(z12_chan_ver, msg_field);
   }

   if(jd_obs) {  // prevents writing RINEX file until raw readings are available
      if(rinex_file) {
         if(have_utc_ofs) {  // dont start writing until utc info available
            have_info |= ALL_ID_INFO;
         }
      }
      else if(log_file && (log_fmt == RINEX)) {  // writing .obs file
         if(have_utc_ofs) {  // dont start writing until utc info available
            have_info |= ALL_ID_INFO;
         }
      }
      else {
         have_info |= ALL_ID_INFO;
      }
   }

   if(ZDA_TIME == 0) get_norcvr_message();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x9cf86(%rip), %rdi     # 0x1230c8
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0x86167
leaq 0x2b58e9(%rip), %rsi    # 0x33ba40
movb $0x0, 0x20(%rsi)
leaq 0x2b7a2e(%rip), %rdi    # 0x33db90
callq 0x9340
callq 0x811da
testl %eax, %eax
je 0x86187
leaq 0x2b58c9(%rip), %rsi    # 0x33ba40
movb $0x0, 0x20(%rsi)
leaq 0x2b7a3e(%rip), %rdi    # 0x33dbc0
callq 0x9340
callq 0x811da
testl %eax, %eax
je 0x861a7
leaq 0x2b58a9(%rip), %rsi    # 0x33ba40
movb $0x0, 0x20(%rsi)
leaq 0x2b7a4e(%rip), %rdi    # 0x33dbf0
callq 0x9340
callq 0x811da
testl %eax, %eax
je 0x861c7
leaq 0x2b5889(%rip), %rsi    # 0x33ba40
movb $0x0, 0x20(%rsi)
leaq 0x2b7a5e(%rip), %rdi    # 0x33dc20
callq 0x9340
callq 0x811da
testl %eax, %eax
je 0x861e7
leaq 0x2b5869(%rip), %rsi    # 0x33ba40
movb $0x0, 0x20(%rsi)
leaq 0x2b7a6e(%rip), %rdi    # 0x33dc50
callq 0x9340
leaq 0x287382(%rip), %rax    # 0x30d570
movsd (%rax), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x861fe
jnp 0x8623d
leaq 0x1b8163(%rip), %rax    # 0x23e368
cmpq $0x0, (%rax)
jne 0x86227
leaq 0x1b814e(%rip), %rax    # 0x23e360
cmpq $0x0, (%rax)
je 0x86233
leaq 0x1b8229(%rip), %rax    # 0x23e448
cmpl $0x12e, (%rax)          # imm = 0x12E
jne 0x86233
leaq 0x2870ee(%rip), %rax    # 0x30d31c
cmpl $0x0, (%rax)
je 0x8623d
leaq 0x28773a(%rip), %rax    # 0x30d974
orb $0xf, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_z12_pps()
void parse_z12_pps()
{
double period;
double ofs;

   // PPS output control
   log_packet_id("z12_pps");

   if(get_msg_field()) {  // period (0.5 .. 59.5 secs)
      period = atof(msg_field);
      if     (period == 1.0) pps_rate = RATE_1PPS;
      else if(period == 2.0) pps_rate = RATE_PP2S;
      else                   pps_rate = RATE_USER;

      if(period == 0.0) pps_enabled = 0;
      else              pps_enabled = 1;

      have_pps_rate = 12;
   }

   if(get_msg_field()) {  // offset (in msecs)
      ofs = atof(msg_field);
      pps1_delay = ofs;
      have_pps_delay |= 0x01;
   }

   get_msg_field();  // PPS enabled on port A
   get_msg_field();  // PPS enabled on port B 
   get_msg_field();  // PPS enabled on port C 
   get_msg_field();  // PPS enabled on port D 

   have_z12_pps = 12;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x9ce59(%rip), %rdi     # 0x1230f8
callq 0x58e77
callq 0x811da
testl %eax, %eax
je 0x86310
leaq 0x2b578c(%rip), %rdi    # 0x33ba40
callq 0x9470
xorl %eax, %eax
ucomisd 0x8570d(%rip), %xmm0    # 0x10b9d0
movl $0x82, %ecx
cmovnel %eax, %ecx
cmovpl %eax, %ecx
ucomisd 0x82d9a(%rip), %xmm0    # 0x109070
movl $0x2, %eax
cmovnel %ecx, %eax
cmovpl %ecx, %eax
leaq 0x287a3b(%rip), %rcx    # 0x30dd23
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movb %al, (%rcx)
setp %al
setne %cl
orb %al, %cl
leaq 0x287a1f(%rip), %rax    # 0x30dd20
movb %cl, (%rax)
leaq 0x286fc6(%rip), %rax    # 0x30d2d0
movl $0xc, (%rax)
callq 0x811da
testl %eax, %eax
je 0x8633a
leaq 0x2b5720(%rip), %rdi    # 0x33ba40
callq 0x9470
leaq 0x287aac(%rip), %rax    # 0x30ddd8
movsd %xmm0, (%rax)
leaq 0x286f81(%rip), %rax    # 0x30d2b8
orb $0x1, (%rax)
callq 0x811da
callq 0x811da
callq 0x811da
callq 0x811da
leaq 0x286f7f(%rip), %rax    # 0x30d2d4
movl $0xc, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_pashr()
void parse_pashr()
{
   if(get_msg_field() == 0) return;
if(debug_file) fprintf(debug_file, "Parsing Z12: %s\n", msg_field);

   if     (strstr(msg_field, "PBN")) parse_z12_pbn();  // binary messages
   else if(strstr(msg_field, "ALM")) parse_z12_alm();
   else if(strstr(msg_field, "EPB")) parse_z12_epb();
   else if(strstr(msg_field, "MPC")) parse_z12_mpc();
   else if(strstr(msg_field, "RPC")) parse_z12_rpc();
   else if(strstr(msg_field, "SNV")) parse_z12_snv();

   else if(strstr(msg_field, "RID")) parse_z12_rid();
   else if(strstr(msg_field, "POS")) parse_z12_pos();
   else if(strstr(msg_field, "EXT")) parse_z12_ext();
   else if(strstr(msg_field, "PPS")) parse_z12_pps();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0x811da
testl %eax, %eax
je 0x86502
leaq 0x1b7fed(%rip), %rax    # 0x23e390
movq (%rax), %rdi
testq %rdi, %rdi
je 0x863c0
leaq 0x9cd56(%rip), %rsi     # 0x123108
leaq 0x2b5687(%rip), %rdx    # 0x33ba40
xorl %eax, %eax
callq 0x9560
leaq 0x2b5679(%rip), %rdi    # 0x33ba40
leaq 0x9cd4b(%rip), %rsi     # 0x123119
callq 0x9090
testq %rax, %rax
je 0x863de
popq %rbp
jmp 0x85e07
leaq 0x2b565b(%rip), %rdi    # 0x33ba40
leaq 0x9cd31(%rip), %rsi     # 0x12311d
callq 0x9090
testq %rax, %rax
je 0x863ff
leaq 0x9ccd3(%rip), %rdi     # 0x1230d0
jmp 0x8641e
leaq 0x2b563a(%rip), %rdi    # 0x33ba40
leaq 0x9cd14(%rip), %rsi     # 0x123121
callq 0x9090
testq %rax, %rax
je 0x86424
leaq 0x9ccc2(%rip), %rdi     # 0x1230e0
popq %rbp
jmp 0x58e77
leaq 0x2b5615(%rip), %rdi    # 0x33ba40
leaq 0x9ccf3(%rip), %rsi     # 0x123125
callq 0x9090
testq %rax, %rax
je 0x86442
popq %rbp
jmp 0x856b9
leaq 0x2b55f7(%rip), %rdi    # 0x33ba40
leaq 0x9ccd9(%rip), %rsi     # 0x123129
callq 0x9090
testq %rax, %rax
je 0x86463
leaq 0x9cc87(%rip), %rdi     # 0x1230e8
jmp 0x8641e
leaq 0x2b55d6(%rip), %rdi    # 0x33ba40
leaq 0x9ccbc(%rip), %rsi     # 0x12312d
callq 0x9090
testq %rax, %rax
je 0x86484
leaq 0x9cc56(%rip), %rdi     # 0x1230d8
jmp 0x8641e
leaq 0x2b55b5(%rip), %rdi    # 0x33ba40
leaq 0x9a36a(%rip), %rsi     # 0x1207fc
callq 0x9090
testq %rax, %rax
je 0x864a2
popq %rbp
jmp 0x86137
leaq 0x2b5597(%rip), %rdi    # 0x33ba40
leaq 0x9fc3f(%rip), %rsi     # 0x1260ef
callq 0x9090
testq %rax, %rax
je 0x864c6
leaq 0x9cc2f(%rip), %rdi     # 0x1230f0
jmp 0x8641e
leaq 0x2b5573(%rip), %rdi    # 0x33ba40
leaq 0x9b252(%rip), %rsi     # 0x121726
callq 0x9090
testq %rax, %rax
je 0x864e4
popq %rbp
jmp 0x8635d
leaq 0x2b5555(%rip), %rdi    # 0x33ba40
leaq 0x9fdc1(%rip), %rsi     # 0x1262b3
callq 0x9090
testq %rax, %rax
je 0x86502
popq %rbp
jmp 0x86294
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_ss_config()
void parse_ss_config()
{
int ss_config;
int ss_antenna;

   log_packet_id("Receiver config");

   ss_config = tsip_byte() & 0x0F;

   nav_rate = (DATA_SIZE) (tsip_byte() & 0x03);
   if     (nav_rate == 0) nav_rate = 1;
   else if(nav_rate == 1) nav_rate = 2;
   else if(nav_rate == 2) nav_rate = 5;
   else                   nav_rate = 1;  // unknown rate

   ss_antenna = tsip_byte() & 0x03;  // antenna type (0=auto  1=active  2=passive)

   tsip_byte();  // rsvd
   tsip_word();  // max speed
   tsip_byte();  // max acceleration (bits 0..5)
   tsip_byte();  // statistical threshold
   tsip_byte();  // dead reconning threshold

   tsip_byte();  // rsvd
   tsip_byte();  // rsvd
   tsip_byte();  // rsvd
   tsip_byte();  // rsvd
   tsip_byte();  // rsvd
   tsip_byte();  // rsvd
   tsip_byte();  // rsvd
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x9bf1d(%rip), %rdi     # 0x123277
callq 0x58e77
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87375
leaq 0x1b7bfe(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x8738b
leaq 0x1b7be8(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
leaq 0x193fc6(%rip), %rcx    # 0x21b358
andl $0x3, %eax
leaq 0xa3a2c(%rip), %rdx     # 0x12adc8
movsd (%rdx,%rax,8), %xmm0
movsd %xmm0, (%rcx)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x873bb
leaq 0x1b7bb8(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x873d1
leaq 0x1b7ba2(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x588f0
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x873ec
leaq 0x1b7b87(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87402
leaq 0x1b7b71(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87418
leaq 0x1b7b5b(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x8742e
leaq 0x1b7b45(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87444
leaq 0x1b7b2f(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x8745a
leaq 0x1b7b19(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87470
leaq 0x1b7b03(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87486
leaq 0x1b7aed(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x8749c
leaq 0x1b7ad7(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x874b2
leaq 0x1b7ac1(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: get_ss_string(char*, int)
void get_ss_string(char *s, int len)
{
int i;

   for(i=0; i<len; i++) {
      if(s) {
         s[i] = tsip_byte();
         s[i+1] = 0;
      }
      else tsip_byte();
   }
}

// Assembly:
testl %esi, %esi
jle 0x876e4
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl %esi, %r14d
xorl %r15d, %r15d
leaq 0x1b78ca(%rip), %r12    # 0x23ef70
callq 0x587d1
testq %rbx, %rbx
je 0x876c8
cmpl $0x100, %eax            # imm = 0x100
jb 0x876bc
orb $0x8, (%r12)
movb %al, (%rbx,%r15)
movb $0x0, 0x1(%rbx,%r15)
jmp 0x876d4
cmpl $0x100, %eax            # imm = 0x100
jb 0x876d4
orb $0x8, (%r12)
incq %r15
cmpq %r15, %r14
jne 0x876a6
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_ss_id()
void parse_ss_id()
{
   log_packet_id("Version info");

   get_ss_string(ss_sw_pn, 14);
   get_ss_string(ss_model, 14);
   get_ss_string(ss_model_cksum, 4);
   get_ss_string(ss_boot_pn, 14);
   get_ss_string(ss_rsvd, 22);
   get_ss_string(ss_psn, 13);
   get_ss_string(ss_rsvd2, 4);
   ss_boot_cksum = tsip_word();
   ss_op_cksum = tsip_word();
   ss_type = tsip_byte();

   have_info |= ALL_ID_INFO;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x9bba0(%rip), %rdi     # 0x123296
callq 0x58e77
movl $0x1, %r14d
leaq 0x2b5a08(%rip), %r15    # 0x33d110
leaq 0x1b7861(%rip), %rbx    # 0x23ef70
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x8771e
orb $0x8, (%rbx)
movb %al, -0x1(%r15,%r14)
movb $0x0, (%r15,%r14)
incq %r14
cmpq $0xf, %r14
jne 0x8770f
movl $0x1, %r14d
leaq 0x2b5a02(%rip), %r15    # 0x33d140
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x8774d
orb $0x8, (%rbx)
movb %al, -0x1(%r15,%r14)
movb $0x0, (%r15,%r14)
incq %r14
cmpq $0xf, %r14
jne 0x8773e
xorl %r14d, %r14d
leaq 0x2b5a06(%rip), %r15    # 0x33d170
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87779
orb $0x8, (%rbx)
movb %al, (%r14,%r15)
movb $0x0, 0x1(%r14,%r15)
incq %r14
cmpq $0x4, %r14
jne 0x8776a
movl $0x1, %r14d
leaq 0x2b5a07(%rip), %r15    # 0x33d1a0
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x877a8
orb $0x8, (%rbx)
movb %al, -0x1(%r15,%r14)
movb $0x0, (%r15,%r14)
incq %r14
cmpq $0xf, %r14
jne 0x87799
movl $0x1, %r14d
leaq 0x2b5a08(%rip), %r15    # 0x33d1d0
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x877d7
orb $0x8, (%rbx)
movb %al, -0x1(%r15,%r14)
movb $0x0, (%r15,%r14)
incq %r14
cmpq $0x17, %r14
jne 0x877c8
movl $0x1, %r14d
leaq 0x2b5a09(%rip), %r15    # 0x33d200
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87806
orb $0x8, (%rbx)
movb %al, -0x1(%r15,%r14)
movb $0x0, (%r15,%r14)
incq %r14
cmpq $0xe, %r14
jne 0x877f7
xorl %r14d, %r14d
leaq 0x2b5a0d(%rip), %r15    # 0x33d230
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87832
orb $0x8, (%rbx)
movb %al, (%r14,%r15)
movb $0x0, 0x1(%r14,%r15)
incq %r14
cmpq $0x4, %r14
jne 0x87823
callq 0x588f0
movzwl %ax, %eax
leaq 0x2b5a00(%rip), %rcx    # 0x33d254
movl %eax, (%rcx)
callq 0x588f0
movzwl %ax, %eax
leaq 0x2b59f3(%rip), %rcx    # 0x33d258
movl %eax, (%rcx)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87876
orb $0x8, (%rbx)
movzbl %al, %eax
leaq 0x2b59dc(%rip), %rcx    # 0x33d25c
movl %eax, (%rcx)
leaq 0x2860eb(%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_ss_health()
void parse_ss_health()
{
int prn;
int i;

   log_packet_id("Satellie health");

   reset_sat_health();
   for(prn=1; prn<=32; prn+=4) {
      i = tsip_byte();
      if(i & 0x03) sat[prn+0].health_flag = 1;
      if(i & 0x0C) sat[prn+1].health_flag = 1;
      if(i & 0x30) sat[prn+2].health_flag = 1;
      if(i & 0xC0) sat[prn+3].health_flag = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x9b7ab(%rip), %rdi     # 0x1232b3
callq 0x58e77
xorl %eax, %eax
leaq 0x1b749a(%rip), %rcx    # 0x23efb0
movb $0x0, (%rcx,%rax)
addq $0x348, %rax            # imm = 0x348
cmpq $0xcd140, %rax          # imm = 0xCD140
jne 0x87b16
movl $0xd20, %ebx            # imm = 0xD20
addq 0xc840c(%rip), %rbx     # 0x14ff40
movq $-0x3, %r14
leaq 0x1b742e(%rip), %r15    # 0x23ef70
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87b52
orb $0x8, (%r15)
testb $0x3, %al
je 0x87b5d
movb $0x1, -0x9d8(%rbx)
testb $0xc, %al
je 0x87b68
movb $0x1, -0x690(%rbx)
testb $0x30, %al
je 0x87b73
movb $0x1, -0x348(%rbx)
testb $-0x40, %al
je 0x87b7a
movb $0x1, (%rbx)
addq $0x4, %r14
addq $0xd20, %rbx            # imm = 0xD20
cmpq $0x1d, %r14
jb 0x87b42
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_ss_utc()
void parse_ss_utc()
{
int wn_lsf;
int dn;
int valid;

   log_packet_id("UTC and ionosphere data");

   tsip_byte();
   tsip_byte();
   tsip_byte();
   tsip_byte();
   tsip_byte();
   tsip_byte();
   tsip_byte();
   tsip_byte();
   tsip_byte();
   tsip_dword();
   tsip_dword();
   tsip_byte();
   tsip_byte();
   tsip_byte();

   wn_lsf = tsip_byte();   // !!!! we need a 16 bit value here
   dn = tsip_byte();
   tsip_byte();
   valid = tsip_byte();

   tsip_dword();  // reserved
   tsip_dword();
   tsip_dword();
   tsip_dword();

   if(0 && valid) {
      calc_leap_days(wn_lsf, dn, 765);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x9b526(%rip), %rdi     # 0x1232d5
callq 0x58e77
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87dca
leaq 0x1b71a9(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87de0
leaq 0x1b7193(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87df6
leaq 0x1b717d(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87e0c
leaq 0x1b7167(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87e22
leaq 0x1b7151(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87e38
leaq 0x1b713b(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87e4e
leaq 0x1b7125(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87e64
leaq 0x1b710f(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87e7a
leaq 0x1b70f9(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x589b0
callq 0x589b0
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87e9a
leaq 0x1b70d9(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87eb0
leaq 0x1b70c3(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87ec6
leaq 0x1b70ad(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87edc
leaq 0x1b7097(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87ef2
leaq 0x1b7081(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87f08
leaq 0x1b706b(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87f1e
leaq 0x1b7055(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x589b0
callq 0x589b0
callq 0x589b0
popq %rbp
jmp 0x589b0
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_rftg_21()
void parse_rftg_21()
{
   log_packet_id("Packet 0x21 (unknown)");

   tsip_byte();  // 0x00
   tsip_byte();  // 01=OK 02=when not tracking
   tsip_byte();  // 0x74  0x16 when normal
   tsip_byte();  // 0x00
   tsip_byte();  // 40=antenna open
   tsip_byte();  // 0x15=ok 0x06=ok 0x01=ok 00=no signal
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x9ace1(%rip), %rdi     # 0x1233f4
callq 0x58e77
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x8872e
leaq 0x1b6845(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x88744
leaq 0x1b682f(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x8875a
leaq 0x1b6819(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x88770
leaq 0x1b6803(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x88786
leaq 0x1b67ed(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x8879c
leaq 0x1b67d7(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_rftg_phase()
void parse_rftg_phase()
{
   log_packet_id("Packet 0x22 (phase)");

   rftg_phase_err = (double) tsip_single();     // phase err ns
   rftg_phase_ref = (double) tsip_single();     // ref ns
   rftg_avg_phase = (double) tsip_single();     // avg phase?
   rftg_delta_ape_10m = (double) tsip_single(); // 10 min delta ape

   pps_offset = (OFS_SIZE) (double) rftg_avg_phase * 1.0E9;  // average phase
   have_pps_offset = 1;
//sprintf(debug_text, "phase: %g %g %g %g", v1,v2,v3,v4);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x9ac5f(%rip), %rdi     # 0x12340a
callq 0x58e77
callq 0x58aae
cvtss2sd %xmm0, %xmm0
leaq 0x285228(%rip), %rax    # 0x30d9e8
movsd %xmm0, (%rax)
callq 0x58aae
cvtss2sd %xmm0, %xmm0
leaq 0x28521c(%rip), %rax    # 0x30d9f0
movsd %xmm0, (%rax)
callq 0x58aae
cvtss2sd %xmm0, %xmm0
leaq 0x285210(%rip), %rbx    # 0x30d9f8
movsd %xmm0, (%rbx)
callq 0x58aae
cvtss2sd %xmm0, %xmm0
leaq 0x285214(%rip), %rax    # 0x30da10
movsd %xmm0, (%rax)
movsd (%rbx), %xmm0
mulsd 0x8081c(%rip), %xmm0    # 0x109028
leaq 0x283fa5(%rip), %rax    # 0x30c7b8
movsd %xmm0, (%rax)
leaq 0x284a1a(%rip), %rax    # 0x30d238
movl $0x1, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_rftg_correction()
void parse_rftg_correction()
{
unsigned v2, v4;

   log_packet_id("Packet 0x24 (time/freq corrections)");

   rftg_time_corr = (double) tsip_single();             // time correction
   v2 = (unsigned) tsip_dword();   // age counter

   rftg_freq_corr = (double) tsip_single();             // freq correction
   v4 = (unsigned) tsip_dword();   // age counter

// sprintf(plot_title, "rftg24: %g %d %g %g", rftg_time_corr,v2,rftg_freq_corr,v4);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x9a9bb(%rip), %rdi     # 0x12343b
callq 0x58e77
callq 0x58aae
cvtss2sd %xmm0, %xmm0
leaq 0x284fb3(%rip), %rax    # 0x30da48
movsd %xmm0, (%rax)
callq 0x589b0
callq 0x58aae
cvtss2sd %xmm0, %xmm0
leaq 0x284fa2(%rip), %rax    # 0x30da50
movsd %xmm0, (%rax)
popq %rbp
jmp 0x589b0
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_rftg_sigs()
void parse_rftg_sigs()
{
int i;
int num_vis;
int num_tracked;
int prn;
float az;
int tracked;
int snr;
int chan;

   // satellite status
   log_packet_id("Packet 0x25 (satellite signals)");

   reset_sat_tracking();
   level_type = "SNR";

   num_vis = tsip_byte();
   num_tracked = tsip_byte();

   for(i=0; i<6; i++) {
      prn = tsip_byte();
      tracked = tsip_byte(); // 08=tracked   0=not tracked
      snr = tsip_byte();
      chan = tsip_byte();    // channel status: A2=tracked and used  01=not tracked
      if((prn >= 1) && (prn <= 32)) {
         az = (float) (prn*10);   // fake the az/el so sat sig levels show in the sat map
         set_sat_azel(prn, az, 20.0F);

         sat[prn].sig_level = (float) snr;
         sat[prn].level_msg = 0x25;
         have_snr |= rinex_gnss(prn);
         if(tracked & 0x08) {
            sat[prn].tracking = prn;
         }
         record_sig_levels(prn);
      }
   }

   tsip_byte();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x9a992(%rip), %rdi     # 0x12345f
callq 0x58e77
movl $0x218, %eax            # imm = 0x218
leaq 0x1b64d2(%rip), %rdx    # 0x23efb0
xorl %ecx, %ecx
movl %ecx, (%rdx,%rax)
movl %ecx, -0x1fc(%rdx,%rax)
addq $0x348, %rax            # imm = 0x348
cmpq $0xcd358, %rax          # imm = 0xCD358
jne 0x88ae0
leaq 0x95471(%rip), %rax     # 0x11df70
leaq 0x1b63f2(%rip), %rcx    # 0x23eef8
movq %rax, (%rcx)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x88b1f
leaq 0x1b6454(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x88b35
leaq 0x1b643e(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
movl $0x6, %r13d
leaq 0x1b642e(%rip), %r12    # 0x23ef70
callq 0x587d1
movl %eax, %r14d
cmpl $0x100, %eax            # imm = 0x100
jb 0x88b56
orb $0x8, (%r12)
callq 0x587d1
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0x88b69
orb $0x8, (%r12)
callq 0x587d1
movl %eax, %r15d
cmpl $0x100, %eax            # imm = 0x100
jb 0x88b7d
orb $0x8, (%r12)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x88b8e
orb $0x8, (%r12)
leal -0x1(%r14), %eax
cmpb $0x1f, %al
ja 0x88c1c
movzbl %r14b, %r12d
leal (%r12,%r12), %eax
leal (%rax,%rax,4), %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movl %r12d, %edi
movss 0x95de9(%rip), %xmm1    # 0x11e9a0
callq 0x5ad98
movzbl %r15b, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movzbl %r14b, %eax
imulq $0x348, %rax, %r14      # imm = 0x348
leaq 0x1b63d7(%rip), %rax    # 0x23efb0
movss %xmm0, 0x20(%rax,%r14)
movl $0x25, 0x1c(%rax,%r14)
movl %r12d, %edi
callq 0xdbb74
leaq 0x284754(%rip), %rcx    # 0x30d34c
orl %eax, (%rcx)
testb $0x8, %bl
je 0x88c0d
addq 0xc733a(%rip), %r14     # 0x14ff40
movl %r12d, 0x218(%r14)
movl %r12d, %edi
callq 0x5ced3
leaq 0x1b6354(%rip), %r12    # 0x23ef70
decl %r13d
jne 0x88b42
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x88c36
orb $0x8, (%r12)
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_rftg_posn()
void parse_rftg_posn()
{
int i;
double v1,v2,v3;

   // rcvr posn
   log_packet_id("Packet 0x26 (position)");

   for(i=0; i<5; i++) {  // 5 sets of values RCVR, AVG. NVM0, NVM1, NVM2
       v1 = (double) (s32) tsip_dword();
       v2 = (double) (s32) tsip_dword();
       v3 = (double) (s32) tsip_dword();
       if(i == 0) {
          lat = (v1 / 3600000.0) * PI / 180.0;
          lon = (v2 / 3600000.0) * PI / 180.0;
          alt = (v3 / 100.0);
          have_rftg_lla = 1;
       }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x9a825(%rip), %rdi     # 0x12347f
callq 0x58e77
movl $0x5, %r15d
leaq 0x284374(%rip), %r12    # 0x30cfe0
leaq 0x284e2d(%rip), %r13    # 0x30daa0
callq 0x589b0
movl %eax, %ebx
callq 0x589b0
movl %eax, %r14d
callq 0x589b0
cmpl $0x5, %r15d
jne 0x88cff
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %r14d, %xmm1
xorps %xmm2, %xmm2
cvtsi2sd %ebx, %xmm2
movsd 0x9546d(%rip), %xmm3    # 0x11e118
divsd %xmm3, %xmm2
movsd 0x82b61(%rip), %xmm4    # 0x10b818
mulsd %xmm4, %xmm2
movsd 0x82b5d(%rip), %xmm5    # 0x10b820
divsd %xmm5, %xmm2
leaq 0x284302(%rip), %rax    # 0x30cfd0
movsd %xmm2, (%rax)
divsd %xmm3, %xmm1
mulsd %xmm4, %xmm1
divsd %xmm5, %xmm1
leaq 0x2842f3(%rip), %rax    # 0x30cfd8
movsd %xmm1, (%rax)
divsd 0x8036f(%rip), %xmm0    # 0x109060
movsd %xmm0, (%r12)
movl $0x1, (%r13)
decl %r15d
jne 0x88c73
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_rftg_additional_status()
void parse_rftg_additional_status()
{
int fw;

   log_packet_id("Packet 0x27 (additional status)");

   fw = tsip_word();  // fw version

   tsip_byte();  //
   tsip_byte();  //
   tsip_byte();  //
// maybe valid float seen here
   tsip_byte();  //
   tsip_byte();  //
// valid float seen here
   tsip_byte();  //
   tsip_byte();  //
   tsip_byte();  //
   tsip_byte();  //
   tsip_byte();  //

   rftg_sensitivity = (double) tsip_single(); // sensitivity
   rftg_pll_port = tsip_byte();   // pll status port
   rftg_pld_port = tsip_byte();   // pld status port
   tsip_byte();  //

// sprintf(debug_text, "adds:%g  pll:%02x pld:%02x", rftg_sensitivity, rftg_pll_port,rftg_pld_port);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x9a774(%rip), %rdi     # 0x123496
callq 0x58e77
callq 0x588f0
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x88d42
leaq 0x1b6231(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x88d58
leaq 0x1b621b(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x88d6e
leaq 0x1b6205(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x88d84
leaq 0x1b61ef(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x88d9a
leaq 0x1b61d9(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x88db0
leaq 0x1b61c3(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x88dc6
leaq 0x1b61ad(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x88ddc
leaq 0x1b6197(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x88df2
leaq 0x1b6181(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x88e08
leaq 0x1b616b(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x58aae
cvtss2sd %xmm0, %xmm0
leaq 0x284c18(%rip), %rax    # 0x30da30
movsd %xmm0, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x88e32
leaq 0x1b6141(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
leaq 0x284c5c(%rip), %rcx    # 0x30da98
movl %eax, (%rcx)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x88e54
leaq 0x1b611f(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
leaq 0x284c3e(%rip), %rcx    # 0x30da9c
movl %eax, (%rcx)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x88e76
leaq 0x1b60fd(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_rftg_cable()
void parse_rftg_cable()
{
float val;

   // cable delay in feet
   log_packet_id("Packet 0x55 (cable delay)");

   val = tsip_single();
   cable_delay = (double) val;  // cable delay in feet
   cable_delay = cable_delay / 1.0E9;
   cable_delay /= VELOCITY_FACTOR;  // cable delay in nanoseconds
   have_cable_delay = 1;
//sprintf(debug_text3, "rftg55: %f  %f", val, cable_delay);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x9a648(%rip), %rdi     # 0x1234ed
callq 0x58e77
callq 0x58aae
cvtss2sd %xmm0, %xmm0
divsd 0x8016d(%rip), %xmm0    # 0x109028
divsd 0x82aad(%rip), %xmm0    # 0x10b970
leaq 0x284efe(%rip), %rax    # 0x30ddc8
movsd %xmm0, (%rax)
leaq 0x2843df(%rip), %rax    # 0x30d2b4
movl $0x1, (%rax)
popq %rbp
retq