LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_venus_pps()
void parse_venus_pps()
{
u08 sub_code;
u32 freq;
u32 width;

pps_enabled = pps_mode = 1; // zzzzz
   have_pps_enable = 4;
   have_pps_mode = 4;
   sub_code = tsip_byte();
   freq = width = 0;

   if(sub_code == 0x80) {   // width (us) 1..100000us
      log_packet_id("pps width");
      width = tsip_dword();
      if(saw_timing_msg & 0x08) {
         pps2_duty = 0.50;
         have_pps_duty |= 0x02;
      }
      else {
         if(pps1_freq) {
            pps1_duty = (((double) (width)) / 1.0E6) /  (1.0 / pps1_freq);
            have_pps_duty |= 0x01;
         }
      }
   }
   else if(sub_code == 0x81) {  // freq (not all firmware does this)
      log_packet_id("pps freq");
      freq = tsip_dword();
      if(saw_timing_msg & 0x08) {
         pps2_freq = (double) freq;
         have_pps_freq |= 0x02;
      }
      else {
//!!!!   pps1_freq = (double) freq;
         pps1_freq = 1.0;        // only does 1PPS, can't set the freq
         have_pps_freq |= 0x01;
      }
   }
   else {
      log_packet_id("unsupported pps subcode");
   }
//sprintf(debug_text, "freq %d:%d  width %d:%d  duty:%f", have_pps_freq,freq,  have_pps_duty,width,pps1_duty); // qqqqqqqq
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x26e6c5(%rip), %rax    # 0x2f7d22
movb $0x1, %cl
movb %cl, (%rax)
leaq 0x26e6b8(%rip), %rax    # 0x2f7d20
movb %cl, (%rax)
leaq 0x26dc6b(%rip), %rax    # 0x2f72dc
pushq $0x4
popq %rcx
movl %ecx, (%rax)
leaq 0x26dc6f(%rip), %rax    # 0x2f72ec
movl %ecx, (%rax)
callq 0x51c47
cmpb $-0x7f, %al
je 0x89705
movzbl %al, %eax
cmpl $0x80, %eax
jne 0x89742
leaq 0x85200(%rip), %rdi     # 0x10e89d
callq 0x520bf
callq 0x51cf3
leaq 0x26dd7a(%rip), %rcx    # 0x2f7428
testb $0x8, (%rcx)
jne 0x8974f
leaq 0x26e66a(%rip), %rcx    # 0x2f7d28
movsd (%rcx), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x896d2
jnp 0x89788
movl %eax, %eax
cvtsi2sd %rax, %xmm1
divsd 0x6996f(%rip), %xmm1    # 0xf3050
movsd 0x69987(%rip), %xmm2    # 0xf3070
divsd %xmm0, %xmm2
divsd %xmm2, %xmm1
leaq 0x26e638(%rip), %rax    # 0x2f7d30
movsd %xmm1, (%rax)
leaq 0x26e661(%rip), %rax    # 0x2f7d64
jmp 0x8973d
leaq 0x8519b(%rip), %rdi     # 0x10e8a7
callq 0x520bf
callq 0x51cf3
leaq 0x26dd0b(%rip), %rcx    # 0x2f7428
testb $0x8, (%rcx)
jne 0x8976c
leaq 0x26e5ff(%rip), %rax    # 0x2f7d28
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, (%rax)
leaq 0x26e623(%rip), %rax    # 0x2f7d60
orb $0x1, (%rax)
jmp 0x89788
leaq 0x85167(%rip), %rdi     # 0x10e8b0
popq %rbp
jmp 0x520bf
leaq 0x26e5f2(%rip), %rax    # 0x2f7d48
movabsq $0x3fe0000000000000, %rcx # imm = 0x3FE0000000000000
movq %rcx, (%rax)
leaq 0x26e5fa(%rip), %rax    # 0x2f7d64
jmp 0x89785
movl %eax, %eax
cvtsi2sd %rax, %xmm0
leaq 0x26e5c6(%rip), %rax    # 0x2f7d40
movsd %xmm0, (%rax)
leaq 0x26e5db(%rip), %rax    # 0x2f7d60
orb $0x2, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_venus_rtk()
void parse_venus_rtk()
{
int sub_code;

   sub_code = tsip_byte();
   if(sub_code == 0x80) {
      log_packet_id("venus rtk");
      rtk_mode = tsip_byte();
      have_rtk_mode = 1;
   }
   else {
      log_packet_id("unsupported rtk subcode");
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0x51c47
cmpb $-0x80, %al
jne 0x897c3
leaq 0x8512a(%rip), %rdi     # 0x10e8c8
callq 0x520bf
callq 0x51c47
movzbl %al, %eax
leaq 0x29e64a(%rip), %rcx    # 0x327dfc
movl %eax, (%rcx)
leaq 0x29e645(%rip), %rax    # 0x327e00
movl $0x1, (%rax)
popq %rbp
retq
leaq 0x85108(%rip), %rdi     # 0x10e8d2
popq %rbp
jmp 0x520bf
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_venus_sbas()
void parse_venus_sbas()
{
u08 sub_code;
u08 flag;
u08 qzss_chans;
u08 sbas_mode;
u08 sbas_ura;
u08 sbas_correct;
u08 sbas_chans;
u08 sbas_mask;

   // message type 0x62 responses

   sub_code = tsip_byte();
   flag = tsip_byte();
   if(sub_code == 0x80) {  // SBAS status
      log_packet_id("venus sbas status");
      if(flag) gnss_mask |= SBAS;
      else     gnss_mask &= (~SBAS);
      sbas_mode = tsip_byte();
      sbas_ura = tsip_byte();
      sbas_correct = tsip_byte();
      sbas_chans = tsip_byte();
      sbas_mask = tsip_byte();
//sprintf(plot_title, "sbas flag:%02X mode:%02X ura:%02X correct:%02X chans:%d mask:%d",
//flag, sbas_mode, sbas_ura, sbas_correct, sbas_chans, sbas_mask);
   }
   else if(sub_code == 0x81) {  // QZSS status
      log_packet_id("venus qzss status");
      if(flag) gnss_mask |= QZSS;
      else     gnss_mask &= (~QZSS);

      qzss_chans = tsip_byte();
//sprintf(debug_text, "qzss flag:%02X chans:%d", flag,qzss_chans);
   }
   else {
      log_packet_id("unsupported sbas subcode");
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
callq 0x51c47
movl %eax, %r14d
callq 0x51c47
movl %eax, %ebx
cmpb $-0x7f, %r14b
je 0x89835
movzbl %r14b, %eax
cmpl $0x80, %eax
jne 0x89866
leaq 0x850ec(%rip), %rdi     # 0x10e8ea
callq 0x520bf
xorl %eax, %eax
testb %bl, %bl
setne %al
leaq 0xd1463(%rip), %rcx     # 0x15ac74
movl $0xffff7fff, %edx       # imm = 0xFFFF7FFF
andl (%rcx), %edx
shll $0xf, %eax
orl %edx, %eax
movl %eax, (%rcx)
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c47
jmp 0x8985d
leaq 0x850c0(%rip), %rdi     # 0x10e8fc
callq 0x520bf
xorl %eax, %eax
testb %bl, %bl
setne %al
leaq 0xd1425(%rip), %rcx     # 0x15ac74
movl $0xffffbfff, %edx       # imm = 0xFFFFBFFF
andl (%rcx), %edx
shll $0xe, %eax
orl %edx, %eax
movl %eax, (%rcx)
popq %rbx
popq %r14
popq %rbp
jmp 0x51c47
leaq 0x850a1(%rip), %rdi     # 0x10e90e
popq %rbx
popq %r14
popq %rbp
jmp 0x520bf
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_venus_status()
void parse_venus_status()
{
u08 sub_code;
int def_ofs;
int cur_ofs;
int flags;
u08 jam_status;
u32 tow;
u08 flash_status;
u08 flash_type;

   // message type 0x64 responses

   sub_code = tsip_byte();
   if(sub_code == 0x80) {  // boot status
      log_packet_id("venus boot status");
      flash_status = tsip_byte();
      flash_type = tsip_byte();
      if(flash_status != 0) {
         critical_alarms |= CRIT_ROM;
      }
      else { 
         critical_alarms &= (~CRIT_ROM);
      }
      if(!have_critical_alarms) need_redraw = 7702;
      have_critical_alarms = 2;
   }
   else if(sub_code == 0x83) {  // jamming mode
      log_packet_id("venus jamming mode");
      foliage_mode = tsip_byte();
      jam_status = tsip_byte();
   }
   else if(sub_code == 0x8C) {  // GNSS system selection mask
      log_packet_id("venus gnss selection");
      gnss_mask = tsip_word();
      have_gnss_mask = 1;
//sprintf(plot_title, "gnss mask:%04X", gnss_mask); // ggggg
   }
   else if(sub_code == 0x8E) {  // utc offset
      log_packet_id("venus utc offset status");
      tow = tsip_dword(); // tow in msecs
      tsip_dword();       // tow fraction
      tsip_word();        // week
      def_ofs = (int) (s08) tsip_byte();  // gps offset default
      cur_ofs = (int) (s08) tsip_byte();  // gps offset current
      flags = tsip_byte();

      if(!user_set_utc_ofs && (flags & 0x04)) {
         utc_offset = cur_ofs;
         check_utc_ofs(6);
      }
   }
   else {
      log_packet_id("unsupported status subcode");
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
callq 0x51c47
cmpb $-0x72, %al
je 0x8994f
movzbl %al, %eax
cmpl $0x83, %eax
je 0x898f9
cmpl $0x8c, %eax
je 0x8991e
cmpl $0x80, %eax
jne 0x899a5
leaq 0x85077(%rip), %rdi     # 0x10e927
callq 0x520bf
callq 0x51c47
movl %eax, %ebx
callq 0x51c47
xorl %eax, %eax
testb %bl, %bl
setne %al
leaq 0x26d901(%rip), %rcx    # 0x2f71d0
movl (%rcx), %edx
andl $-0x2, %edx
orl %edx, %eax
movl %eax, (%rcx)
leaq 0x26d9c9(%rip), %rax    # 0x2f72a8
cmpl $0x0, (%rax)
jne 0x898f1
leaq 0x178f59(%rip), %rcx    # 0x202844
movl $0x1e16, (%rcx)         # imm = 0x1E16
movl $0x2, (%rax)
jmp 0x89948
leaq 0x85039(%rip), %rdi     # 0x10e939
callq 0x520bf
callq 0x51c47
leaq 0x26d7b3(%rip), %rcx    # 0x2f70c4
movb %al, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x51c47
leaq 0x85027(%rip), %rdi     # 0x10e94c
callq 0x520bf
callq 0x51c63
movzwl %ax, %eax
leaq 0xd133b(%rip), %rcx     # 0x15ac74
movl %eax, (%rcx)
leaq 0xd1336(%rip), %rax     # 0x15ac78
movl $0x1, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x8500b(%rip), %rdi     # 0x10e961
callq 0x520bf
callq 0x51cf3
callq 0x51cf3
callq 0x51c63
callq 0x51c47
callq 0x51c47
movl %eax, %ebx
callq 0x51c47
leaq 0x26ddb2(%rip), %rcx    # 0x2f7734
cmpl $0x0, (%rcx)
jne 0x89948
andb $0x4, %al
je 0x89948
movsbl %bl, %eax
leaq 0x26dd93(%rip), %rcx    # 0x2f7728
movl %eax, (%rcx)
pushq $0x6
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x51a91
leaq 0x84fcd(%rip), %rdi     # 0x10e979
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x520bf
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_venus_version()
void parse_venus_version()
{
u08 sw_type;
u32 kernel;
u32 odm;
u32 rev;

   log_packet_id("venus_version");
   sw_type = tsip_byte();
   kernel = tsip_dword();
   odm = tsip_dword();
   rev = tsip_dword();

   sprintf(venus_kern, "%04d.%02d.%02d", (kernel>>16), (kernel>>8)&0xFF, kernel&0xFF);
   sprintf(venus_odm,  "Ver:  %04d.%02d.%02d", (odm>>16), (odm>>8)&0xFF, odm&0xFF);
   sprintf(venus_rev,  "Rev:  %04d.%02d.%02d", (rev>>16), (rev>>8)&0xFF, rev&0xFF);

   have_info |= ALL_ID_INFO;
//sprintf(plot_title, "k:%08X  odm:%08X  rev:%08X", kernel,odm,rev);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x84fcb(%rip), %rdi     # 0x10e994
callq 0x520bf
callq 0x51c47
callq 0x51cf3
movl %eax, %r15d
callq 0x51cf3
movl %eax, %r14d
callq 0x51cf3
movl %eax, %ebx
movl %r15d, %edx
shrl $0x10, %edx
movl %r15d, %ecx
shrl $0x8, %ecx
movl $0xff, %r12d
andl %r12d, %ecx
andl %r12d, %r15d
leaq 0x29e387(%rip), %rdi    # 0x327d90
leaq 0x84f98(%rip), %rsi     # 0x10e9a8
movl %r15d, %r8d
xorl %eax, %eax
callq 0x9060
movl %r14d, %edx
shrl $0x10, %edx
movl %r14d, %ecx
shrl $0x8, %ecx
andl %r12d, %ecx
andl %r12d, %r14d
leaq 0x29e37d(%rip), %rdi    # 0x327db0
leaq 0x84f68(%rip), %rsi     # 0x10e9a2
movl %r14d, %r8d
xorl %eax, %eax
callq 0x9060
movl %ebx, %edx
shrl $0x10, %edx
movl %ebx, %ecx
shrl $0x8, %ecx
andl %r12d, %ecx
andl %r12d, %ebx
leaq 0x29e375(%rip), %rdi    # 0x327dd0
leaq 0x84f55(%rip), %rsi     # 0x10e9b7
movl %ebx, %r8d
xorl %eax, %eax
callq 0x9060
leaq 0x26df01(%rip), %rax    # 0x2f7974
orb $0xf, (%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_venus_rate()
void parse_venus_rate()
{
float rate;

   log_packet_id("venus_rate");
   rate = (float) tsip_byte();
   if(!pause_data) {
      nav_rate = rate;
      have_nav_rate = 2;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x84f2a(%rip), %rdi     # 0x10e9e0
callq 0x520bf
callq 0x51c47
leaq 0x17b76d(%rip), %rcx    # 0x205234
cmpb $0x0, (%rcx)
jne 0x89aeb
movzbl %al, %eax
cvtsi2sd %eax, %xmm0
leaq 0x17b87e(%rip), %rax    # 0x205358
movsd %xmm0, (%rax)
leaq 0x26d7e7(%rip), %rax    # 0x2f72cc
movl $0x2, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_venus_sv()
void parse_venus_sv()
{
int count;
int i;
int prn;
int state1;
int ura;
int snr;
int az,el;
int state2;

   // sky view
   log_packet_id("venus_sv");

   saw_venus_raw |= 0x01;
   minor_alarms &= (~MINOR_NO_TRACK);
   tsip_byte();  // iod
   count = tsip_byte();

   reset_sat_tracking();
   for(i=0; i<count; i++) {
      tsip_byte(); // channel
      prn = tsip_byte();
      state1 = tsip_byte();
      ura = tsip_byte();
      snr = tsip_byte();
      el = (int) tsip_word();
      az = (int) tsip_word();
      state2 = tsip_byte();

      if((prn >= 1) && (prn <= MAX_PRN)) {
         sat[prn].sv_accuracy = ura_to_dist(prn, ura); // convert to distance

         have_accu = 1;

         if(state1 & 0x04) {  // healthy
            sat[prn].health_flag = 0;
            sat[prn].tracking = 1;
         }
         else {
            sat[prn].health_flag = 1;  // docs say health flag... usage seems more like tracking flag
            sat[prn].tracking = (-1);
         }
         if((state2 & 0x30) == 0) sat[prn].tracking = (-1);
//if(log_file) fprintf(log_file, "prn:%02d  state1:%02X  state2:%02X\n", prn,state1,state2);  // rnx3

         sat[prn].sig_level = (float) snr;
         set_sat_azel(prn, (float) az, (float) el);
         have_sat_azel = 42;

         sat[prn].level_msg = 1;
         level_type = "SNR";
         record_sig_levels(prn);
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x84ee9(%rip), %rdi     # 0x10e9eb
callq 0x520bf
leaq 0x29e2e6(%rip), %rax    # 0x327df4
orb $0x1, (%rax)
leaq 0x26d6c0(%rip), %rax    # 0x2f71d8
andb $-0x9, (%rax)
callq 0x51c47
callq 0x51c47
movzbl %al, %r13d
callq 0x56b1c
subl $0x1, %r13d
jb 0x89c38
callq 0x51c47
callq 0x51c47
movl %eax, %r15d
callq 0x51c47
movl %eax, %r12d
callq 0x51c47
movl %eax, %r14d
callq 0x51c47
movb %al, -0x29(%rbp)
callq 0x51c63
movw %ax, -0x2e(%rbp)
callq 0x51c63
movw %ax, -0x2c(%rbp)
callq 0x51c47
testb %r15b, %r15b
je 0x89b2e
movl %eax, %ebx
movzbl %r15b, %r15d
movzbl %r14b, %esi
movl %r15d, %edi
callq 0x771c5
imulq $0x348, %r15, %r14      # imm = 0x348
leaq 0x19f417(%rip), %rdx    # 0x228fb0
movss %xmm0, 0x1fc(%rdx,%r14)
leaq 0x26d816(%rip), %rax    # 0x2f73c0
pushq $0x1
popq %rcx
movl %ecx, (%rax)
movl %ecx, %esi
andb $0x4, %r12b
sete %al
shrb $0x2, %r12b
xorb $0x1, %r12b
movb %r12b, (%rdx,%r14)
testb $0x30, %bl
sete %cl
orb %al, %cl
movzbl %cl, %eax
negl %eax
movl %esi, %r12d
orl %esi, %eax
movl %eax, 0x218(%rdx,%r14)
movzbl -0x29(%rbp), %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x20(%rdx,%r14)
movq %rdx, %rbx
movzwl -0x2c(%rbp), %eax
cvtsi2ss %eax, %xmm0
movzwl -0x2e(%rbp), %eax
cvtsi2ss %eax, %xmm1
movl %r15d, %edi
callq 0x53b74
leaq 0x26d685(%rip), %rax    # 0x2f7294
movl $0x2a, (%rax)
movl %r12d, 0x1c(%rbx,%r14)
leaq 0x7e455(%rip), %rax     # 0x108076
leaq 0x19f2d0(%rip), %rcx    # 0x228ef8
movq %rax, (%rcx)
movl %r15d, %edi
callq 0x559ba
jmp 0x89b2e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_venus_mtime()
void parse_venus_mtime()
{
int tow;
int week;
double meas_tow;
int xtow;

   // raw measurement epoch
   log_packet_id("venus_mtime");
if(saw_venus_raw & 0x10) return;  // use extended raw data

   saw_venus_raw |= 0x04;
   minor_alarms &= (~MINOR_NO_TRACK);
   tsip_byte();  // iod
   week = tsip_word();
   tow = tsip_dword();
   tsip_word();  // measurement period
   if(raw_msg_rate == 0) return;

   meas_tow = ((double) tow) / 1000.0; // measurement tow
   xtow = (int) (meas_tow*nav_rate);   // raw Hz

   if(1) {  // this might cause time stamp faults in CSRS-PPP  rnx3
      if(xtow % (int) ((double)raw_msg_rate*nav_rate)) return;

      obs_tow = meas_tow;
      jd_obs = GPS_EPOCH + ((double) week * 7.0) + jtime(0,0,0,meas_tow);
   }
   else {  // Only 1Hz nav rate
      if(((int) meas_tow % raw_msg_rate) != 0) return;  // drop unwanted messages

      obs_tow = meas_tow;
      jd_obs = GPS_EPOCH + ((double) week * 7.0) + jtime(0,0,0,meas_tow);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0x84a31(%rip), %rdi     # 0x10ea05
callq 0x520bf
leaq 0x29de14(%rip), %rax    # 0x327df4
movl (%rax), %ecx
testb $0x10, %cl
jne 0x8a099
orl $0x4, %ecx
movl %ecx, (%rax)
leaq 0x26d1e1(%rip), %rax    # 0x2f71d8
andb $-0x9, (%rax)
callq 0x51c47
callq 0x51c63
movl %eax, %ebx
callq 0x51cf3
movl %eax, %r14d
callq 0x51c63
leaq 0x17b35e(%rip), %rax    # 0x205378
movl (%rax), %ecx
testl %ecx, %ecx
je 0x8a099
cvtsi2sd %r14d, %xmm0
divsd 0x6900b(%rip), %xmm0    # 0xf3038
leaq 0x17b324(%rip), %rax    # 0x205358
movsd (%rax), %xmm1
movapd %xmm0, %xmm2
mulsd %xmm1, %xmm2
cvttsd2si %xmm2, %eax
cvtsi2sd %ecx, %xmm2
mulsd %xmm1, %xmm2
cvttsd2si %xmm2, %ecx
cltd
idivl %ecx
testl %edx, %edx
jne 0x8a099
leaq 0x26d51a(%rip), %rax    # 0x2f7578
movsd %xmm0, (%rax)
movzwl %bx, %eax
cvtsi2sd %eax, %xmm1
mulsd 0x6b90f(%rip), %xmm1    # 0xf5980
addsd 0x6b897(%rip), %xmm1    # 0xf5910
movsd %xmm1, -0x18(%rbp)
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0xc2faf
addsd -0x18(%rbp), %xmm0
leaq 0x26d4db(%rip), %rax    # 0x2f7570
movsd %xmm0, (%rax)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: get_zod_seq(int)
void get_zod_seq(int sat_meas)
{
int ts;
int seq;
int sat_seq;

   ts = tsip_dword();  // timestamp
   seq = tsip_word();  // seq
   if(sat_meas) {      // satellite measurement sequence number
      sat_seq = tsip_word();
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
callq 0x51cf3
callq 0x51c63
addq $0x8, %rsp
testl %ebx, %ebx
je 0x8ab48
popq %rbx
popq %rbp
jmp 0x51c63
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zod_temp()
void parse_zod_temp()
{
u16 t0;
s16 tref;
s16 tfilt;
s16 s0;
float dt;

   log_packet_id("temperature");
   tfilt = 0;     // !!!! current temp sensor reading - but no messages
                  //      return it... thus, this code is USELESS !!!!

   get_zod_seq(0);

   tsip_word();

   tsip_word();
   tsip_word();
   tsip_word();
   tsip_word();
   tsip_word();

   tsip_word();
   tsip_word();

   tref = tsip_word();
   t0 = tsip_word();
   s0 = tsip_word();

   tsip_word();
   tsip_word();

   dt = ((float) s0) / (65536.0F*100.0F); // s0 = deg/count
   dt *= ((float) (tfilt-t0));             // t0 = counts, tfilt=current sensor reading

   temperature = (DATA_SIZE) ((((float) tref) * 0.01F) - dt);  // !!!! but no way to get tfilt !!!!
   have_temperature = 107;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x83865(%rip), %rdi     # 0x10e3c1
callq 0x520bf
xorl %edi, %edi
callq 0x8ab27
callq 0x51c63
callq 0x51c63
callq 0x51c63
callq 0x51c63
callq 0x51c63
callq 0x51c63
callq 0x51c63
callq 0x51c63
callq 0x51c63
movl %eax, %ebx
callq 0x51c63
movl %eax, %r14d
callq 0x51c63
movl %eax, %r15d
callq 0x51c63
callq 0x51c63
movswl %r15w, %eax
cvtsi2ss %eax, %xmm0
movzwl %r14w, %eax
negl %eax
cvtsi2ss %eax, %xmm1
movswl %bx, %eax
cvtsi2ss %eax, %xmm2
divss 0x7de06(%rip), %xmm0    # 0x1089d8
mulss %xmm1, %xmm0
mulss 0x7ddfe(%rip), %xmm2    # 0x1089dc
addss %xmm0, %xmm2
cvtss2sd %xmm2, %xmm0
leaq 0x26be2b(%rip), %rax    # 0x2f6a18
movsd %xmm0, (%rax)
leaq 0x26c654(%rip), %rax    # 0x2f724c
movl $0x6b, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zod_snr()
void parse_zod_snr()
{
int i;
int flags;
int prn;
int snr;

   log_packet_id("sig levels");

   get_zod_seq(1);
   
   gps_week = tsip_word();
   faked_tow = 0;
   if(have_week == 0) need_redraw = 2033;
   have_week = 6;

   pri_tow = tow = this_tow = tsip_dword();
   if(have_tow == 0) need_redraw = 2034;
   have_tow = 6;
   survey_tow = tow;

   tsip_dword(); // epoch nanoseconds

   reset_sat_tracking();

   for(i=0; i<12; i++) {
      flags = tsip_word();
      prn = tsip_word();
      snr = tsip_word();
      if((prn >= 1) && (prn <= MAX_PRN)) { 
         sat[prn].sig_level = (float) snr;
         sat[prn].level_msg = 9;
         have_snr |= rinex_gnss(prn);
         if(flags & 0x0001) sat[prn].tracking = 1;
         else               sat[prn].tracking = (-1);
         record_sig_levels(prn);
      }
   }

   level_type = "SNR";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x83e6a(%rip), %rdi     # 0x10ea88
callq 0x520bf
pushq $0x1
popq %rdi
callq 0x8ab27
callq 0x51c63
leaq 0x26cb01(%rip), %rcx    # 0x2f7738
leaq 0x26cb0a(%rip), %rdx    # 0x2f7748
andl $0x0, (%rdx)
movw %ax, (%rcx)
leaq 0x26c6e1(%rip), %rax    # 0x2f732c
cmpl $0x0, (%rax)
jne 0x8ac5d
leaq 0x177bed(%rip), %rcx    # 0x202844
movl $0x7f1, (%rcx)          # imm = 0x7F1
movl $0x6, (%rax)
callq 0x51cf3
leaq 0x26cad1(%rip), %rcx    # 0x2f7740
movl %eax, (%rcx)
leaq 0x26cac4(%rip), %rcx    # 0x2f773c
movl %eax, (%rcx)
leaq 0x26cac3(%rip), %rcx    # 0x2f7744
movl %eax, (%rcx)
leaq 0x26c69e(%rip), %rcx    # 0x2f7328
cmpl $0x0, (%rcx)
jne 0x8ac9c
leaq 0x177bae(%rip), %rdx    # 0x202844
movl $0x7f2, (%rdx)          # imm = 0x7F2
movl $0x6, (%rcx)
movl %eax, %eax
leaq 0x26caa5(%rip), %rcx    # 0x2f7750
movq %rax, (%rcx)
callq 0x51cf3
callq 0x56b1c
pushq $0xc
popq %r15
leaq 0x19e2ed(%rip), %r12    # 0x228fb0
subl $0x1, %r15d
jb 0x8ad3e
callq 0x51c63
movl %eax, %ebx
callq 0x51c63
movl %eax, %r14d
callq 0x51c63
leal -0x1(%r14), %ecx
cmpw $0x3e6, %cx             # imm = 0x3E6
ja 0x8acc3
movzwl %ax, %eax
cvtsi2ss %eax, %xmm0
movzwl %r14w, %r14d
imulq $0x348, %r14, %r13      # imm = 0x348
movss %xmm0, 0x20(%r12,%r13)
movl $0x9, 0x1c(%r12,%r13)
movl %r14d, %edi
callq 0xca4da
leaq 0x26c633(%rip), %rcx    # 0x2f734c
orl %eax, (%rcx)
andl $0x1, %ebx
cmpw $0x1, %bx
movl $0x0, %eax
sbbl %eax, %eax
orl $0x1, %eax
movl %eax, 0x218(%r12,%r13)
movl %r14d, %edi
callq 0x559ba
jmp 0x8acc3
leaq 0x7d331(%rip), %rax     # 0x108076
leaq 0x19e1ac(%rip), %rcx    # 0x228ef8
movq %rax, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zod_vis()
void parse_zod_vis()
{
int i;
int prn;
double a, e;

   log_packet_id("sat visibility");

   get_zod_seq(0);

   gdop = ((float) tsip_word()) / 100.0F;
   pdop = ((float) tsip_word()) / 100.0F;
   hdop = ((float) tsip_word()) / 100.0F;
   vdop = ((float) tsip_word()) / 100.0F;
   tdop = ((float) tsip_word()) / 100.0F;
   have_dops = (GDOP | PDOP | HDOP | VDOP | TDOP);

   i = tsip_word();
   sat_count = i;
   have_count = 4;
   config_sat_count(i);

   if(i > 12) i = 12;
   else if(i < 0) i = 0;
   while(i--) {
      prn = tsip_word();
      a = (((double) (s16) tsip_word()) * 1.0E-4 * 180.0 / PI);
      if(a < 0.0) a += 360.0;
      e = (((double) (s16) tsip_word()) * 1.0E-4 * 180.0 / PI);

      if((prn >= 1) && (prn <= MAX_PRN)) { 
         set_sat_azel(prn, (float) a, (float) e);
         have_sat_azel = 6;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x83d23(%rip), %rdi     # 0x10ea93
callq 0x520bf
xorl %edi, %edi
callq 0x8ab27
callq 0x51c63
movzwl %ax, %eax
cvtsi2ss %eax, %xmm0
divss 0x6c360(%rip), %xmm0    # 0xf70f0
cvtss2sd %xmm0, %xmm0
leaq 0x182765(%rip), %rax    # 0x20d500
movsd %xmm0, (%rax)
callq 0x51c63
movzwl %ax, %eax
cvtsi2ss %eax, %xmm0
divss 0x6c33d(%rip), %xmm0    # 0xf70f0
cvtss2sd %xmm0, %xmm0
leaq 0x18272a(%rip), %rax    # 0x20d4e8
movsd %xmm0, (%rax)
callq 0x51c63
movzwl %ax, %eax
cvtsi2ss %eax, %xmm0
divss 0x6c31a(%rip), %xmm0    # 0xf70f0
cvtss2sd %xmm0, %xmm0
leaq 0x18270f(%rip), %rax    # 0x20d4f0
movsd %xmm0, (%rax)
callq 0x51c63
movzwl %ax, %eax
cvtsi2ss %eax, %xmm0
divss 0x6c2f7(%rip), %xmm0    # 0xf70f0
cvtss2sd %xmm0, %xmm0
leaq 0x1826f4(%rip), %rax    # 0x20d4f8
movsd %xmm0, (%rax)
callq 0x51c63
movzwl %ax, %eax
cvtsi2ss %eax, %xmm0
divss 0x6c2d4(%rip), %xmm0    # 0xf70f0
cvtss2sd %xmm0, %xmm0
leaq 0x1826e1(%rip), %rax    # 0x20d508
movsd %xmm0, (%rax)
leaq 0x1826b2(%rip), %rax    # 0x20d4e4
movl $0x1f, (%rax)
callq 0x51c63
movzwl %ax, %ebx
leaq 0x19e0c5(%rip), %rax    # 0x228f0c
movl %ebx, (%rax)
leaq 0x26c4c8(%rip), %rax    # 0x2f7318
movl $0x4, (%rax)
movl %ebx, %edi
callq 0x56d93
cmpw $0xc, %bx
pushq $0xc
popq %rax
cmovbl %ebx, %eax
movzwl %ax, %r15d
leaq 0x26c422(%rip), %r12    # 0x2f7294
subl $0x1, %r15d
jb 0x8af19
callq 0x51c63
movl %eax, %ebx
callq 0x51c63
movl %eax, %r14d
callq 0x51c63
leal -0x1(%rbx), %ecx
cmpw $0x3e6, %cx             # imm = 0x3E6
ja 0x8ae72
movswl %r14w, %ecx
cvtsi2sd %ecx, %xmm0
movsd 0x7d85e(%rip), %xmm3    # 0x108708
mulsd %xmm3, %xmm0
movsd 0x6a9f2(%rip), %xmm4    # 0xf58a8
mulsd %xmm4, %xmm0
movsd 0x6a9de(%rip), %xmm5    # 0xf58a0
divsd %xmm5, %xmm0
movapd %xmm0, %xmm1
addsd 0x7d2de(%rip), %xmm1    # 0x1081b0
movapd %xmm0, %xmm2
cmpltsd 0x68239(%rip), %xmm2    # 0xf3118
andpd %xmm2, %xmm1
andnpd %xmm0, %xmm2
orpd %xmm1, %xmm2
cwtl
cvtsi2sd %eax, %xmm1
movzwl %bx, %edi
mulsd %xmm3, %xmm1
mulsd %xmm4, %xmm1
divsd %xmm5, %xmm1
cvtsd2ss %xmm2, %xmm0
cvtsd2ss %xmm1, %xmm1
callq 0x53b74
movl $0x6, (%r12)
jmp 0x8ae72
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zod_mark()
void parse_zod_mark()
{
double secs;
int flags;

   log_packet_id("tow / utc offset");

   get_zod_seq(0);
   tsip_word();  // rsvd
   tsip_word(); 
   tsip_word(); 
   tsip_word(); 
   tsip_word(); 

   pri_tow = tow = this_tow = tsip_dword();
   if(have_tow == 0) need_redraw = 2035;
   have_tow = 7;
   survey_tow = tow;

   secs  = (double) tsip_word();
   secs += ((double) tsip_dword()) / 1.0E9;
   if(!user_set_utc_ofs) {
      utc_offset = (int) (secs + 0.50);
      check_utc_ofs(7);
   }

   flags = tsip_word();

   minor_alarms &= (~MINOR_PPS_SKIPPED);
//sprintf(debug_text2, "mark flags:%04X", flags);
   if((flags & 0x0001) == 0) minor_alarms |= MINOR_PPS_SKIPPED;  // time mark invalid
   if(flags & 0x0008) minor_alarms |= MINOR_PPS_SKIPPED;  // traim alarm

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x83b73(%rip), %rdi     # 0x10eaa2
callq 0x520bf
xorl %edi, %edi
callq 0x8ab27
callq 0x51c63
callq 0x51c63
callq 0x51c63
callq 0x51c63
callq 0x51c63
callq 0x51cf3
leaq 0x26c7e0(%rip), %rcx    # 0x2f7740
movl %eax, (%rcx)
leaq 0x26c7d3(%rip), %rcx    # 0x2f773c
movl %eax, (%rcx)
leaq 0x26c7d2(%rip), %rcx    # 0x2f7744
movl %eax, (%rcx)
leaq 0x26c3ad(%rip), %rcx    # 0x2f7328
cmpl $0x0, (%rcx)
jne 0x8af8d
leaq 0x1778bd(%rip), %rdx    # 0x202844
movl $0x7f3, (%rdx)          # imm = 0x7F3
movl $0x7, (%rcx)
movl %eax, %eax
leaq 0x26c7b4(%rip), %rcx    # 0x2f7750
movq %rax, (%rcx)
callq 0x51c63
movl %eax, %ebx
callq 0x51cf3
leaq 0x26c782(%rip), %rcx    # 0x2f7734
cmpl $0x0, (%rcx)
jne 0x8afee
movzwl %bx, %ecx
cvtsi2sd %ecx, %xmm0
movl %eax, %eax
cvtsi2sd %rax, %xmm1
divsd 0x6805b(%rip), %xmm1    # 0xf3028
addsd %xmm0, %xmm1
addsd 0x6808f(%rip), %xmm1    # 0xf3068
cvttsd2si %xmm1, %eax
leaq 0x26c744(%rip), %rcx    # 0x2f7728
movl %eax, (%rcx)
pushq $0x7
popq %rdi
callq 0x51a91
callq 0x51c63
movzwl %ax, %eax
leaq 0x26c1db(%rip), %rcx    # 0x2f71d8
movl (%rcx), %edx
movl %edx, %esi
andl $0xffffefff, %esi       # imm = 0xFFFFEFFF
movl %eax, %edi
andl $0x1, %edi
shll $0xc, %edi
orl %esi, %edi
movl $0x1000, %esi           # imm = 0x1000
xorl %esi, %edi
orl %esi, %edx
testb $0x8, %al
cmovel %edi, %edx
movl %edx, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zod_ee_written()
void parse_zod_ee_written()
{
u16 flags;

   log_packet_id("eeprom write");

   get_zod_seq(0);
   flags = tsip_word();
   BEEP(508); // gggg
   ++ee_write_count;
//sprintf(debug_text, "ee_write:%04X  count:%d", flags,ee_write_count); 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x83521(%rip), %rdi     # 0x10eadd
callq 0x520bf
xorl %edi, %edi
callq 0x8ab27
callq 0x51c63
movl $0x1fc, %edi            # imm = 0x1FC
callq 0x9d23
leaq 0x179c5a(%rip), %rax    # 0x205238
incl (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zod_ee_status()
void parse_zod_ee_status()
{
u16 flags;
u32 alm_fail;
u32 fail;
u32 alm_status;
u32 status;

   log_packet_id("eeprom status");

   get_zod_seq(0);
   flags = tsip_word();
   alm_fail = tsip_dword();
   fail = tsip_dword();
   alm_status = tsip_dword();
   status = tsip_dword();

   if(flags & 0x01) have_eeprom = 0;
   else             have_eeprom = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x834fb(%rip), %rdi     # 0x10eaea
callq 0x520bf
xorl %edi, %edi
callq 0x8ab27
callq 0x51c63
movl %eax, %ebx
notl %ebx
callq 0x51cf3
callq 0x51cf3
callq 0x51cf3
callq 0x51cf3
andl $0x1, %ebx
leaq 0x26bc8a(%rip), %rax    # 0x2f72ac
movl %ebx, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zod_id()
void parse_zod_id()
{
int i;

   log_packet_id("receiver id");

   get_zod_seq(0);

   for(i=0; i<20; i++) {
      zod_chans[i] = tsip_byte();
      zod_chans[i+1] = 0;
   }

   for(i=0; i<20; i++) {
      zod_sw[i] = tsip_byte();
      zod_sw[i+1] = 0;
   }

   for(i=0; i<20; i++) {
      zod_date[i] = tsip_byte();
      zod_date[i+1] = 0;
   }

   for(i=0; i<20; i++) {
      zod_opt[i] = tsip_byte();
      zod_opt[i+1] = 0;

   }

   for(i=0; i<20; i++) {
      zod_rsvd[i] = tsip_byte();
      zod_rsvd[i+1] = 0;
   }

   have_info |= ALL_ID_INFO;

// show_version_info();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x834a2(%rip), %rdi     # 0x10eaf8
callq 0x520bf
xorl %edi, %edi
callq 0x8ab27
pushq $0x1
popq %rbx
leaq 0x29c7a4(%rip), %r14    # 0x327e10
cmpq $0x15, %rbx
je 0x8b686
callq 0x51c47
movb %al, -0x1(%r14,%rbx)
movb $0x0, (%r14,%rbx)
incq %rbx
jmp 0x8b66c
pushq $0x1
popq %rbx
leaq 0x29c7a0(%rip), %r14    # 0x327e30
cmpq $0x15, %rbx
je 0x8b6aa
callq 0x51c47
movb %al, -0x1(%r14,%rbx)
movb $0x0, (%r14,%rbx)
incq %rbx
jmp 0x8b690
pushq $0x1
popq %rbx
leaq 0x29c79c(%rip), %r14    # 0x327e50
cmpq $0x15, %rbx
je 0x8b6ce
callq 0x51c47
movb %al, -0x1(%r14,%rbx)
movb $0x0, (%r14,%rbx)
incq %rbx
jmp 0x8b6b4
pushq $0x1
popq %rbx
leaq 0x29c798(%rip), %r14    # 0x327e70
cmpq $0x15, %rbx
je 0x8b6f2
callq 0x51c47
movb %al, -0x1(%r14,%rbx)
movb $0x0, (%r14,%rbx)
incq %rbx
jmp 0x8b6d8
pushq $0x1
popq %rbx
leaq 0x29c794(%rip), %r14    # 0x327e90
cmpq $0x15, %rbx
je 0x8b716
callq 0x51c47
movb %al, -0x1(%r14,%rbx)
movb $0x0, (%r14,%rbx)
incq %rbx
jmp 0x8b6fc
leaq 0x26c257(%rip), %rax    # 0x2f7974
orb $0xf, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zod_settings()
void parse_zod_settings()
{
u16 snr_threshold;
u16 elev;
u16 platform;

   log_packet_id("setttings");

   get_zod_seq(0);

   zod_nav_flags = tsip_word();
   snr_threshold = ((zod_nav_flags >> 9) & 0x7F);

   tsip_word();        // col start timeout
   tsip_word();        // dgps timeout

   elev = tsip_word();
   el_mask = (float) elev;
   el_mask += 0.005F;
   el_mask = el_mask * (float) ((180.0/PI) / 1000.0);
   have_el_mask = 1;

   sats_enabled = tsip_dword();  // selected sats bit mask
   tsip_word();        // solution flags
   tsip_word();        // required sat count
   tsip_dword();       // required horiz err
   tsip_dword();       // required vert err
   platform = tsip_word();

   update_disable_list(sats_enabled);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x833d2(%rip), %rdi     # 0x10eb04
callq 0x520bf
xorl %edi, %edi
callq 0x8ab27
callq 0x51c63
movw %ax, 0x2cb3e8(%rip)     # 0x356b32
callq 0x51c63
callq 0x51c63
callq 0x51c63
movzwl %ax, %eax
cvtsi2ss %eax, %xmm0
addss 0x7d278(%rip), %xmm0    # 0x1089e0
mulss 0x7d274(%rip), %xmm0    # 0x1089e4
leaq 0x26b93d(%rip), %rax    # 0x2f70b4
movss %xmm0, (%rax)
leaq 0x26bc7a(%rip), %rax    # 0x2f73fc
movl $0x1, (%rax)
callq 0x51cf3
leaq 0x26b950(%rip), %rbx    # 0x2f70e4
movl %eax, (%rbx)
callq 0x51c63
callq 0x51c63
callq 0x51cf3
callq 0x51cf3
callq 0x51c63
movl (%rbx), %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x56b6d
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zod_diags()
void parse_zod_diags()
{
int ram;
int rom;
int ee;
int dp_ram;
int dsp;
int rtc;

   log_packet_id("diagnostics");

   get_zod_seq(0);
   rom = tsip_word();
   ram = tsip_word();
   ee  = tsip_word();
   dp_ram = tsip_word();
   dsp = tsip_word();
   rtc = tsip_word();

   tsip_word();   // serial port stats
   tsip_word();
   tsip_word();
   tsip_word();

   critical_alarms = 0;
   if(have_eeprom == 0) ee = 0;
   minor_alarms &= (~MINOR_EEPROM);

   if(rom) critical_alarms |= CRIT_ROM;   // ROM
   if(rtc) critical_alarms |= CRIT_OCXO;  // 1KHz / DCXO
   if(dsp) critical_alarms |= CRIT_FPGA;  // FPGA
   if(ram | dp_ram) critical_alarms |= CRIT_RAM;  // RAM
   if(ee) {
      minor_alarms |= MINOR_EEPROM;      // EEPROM
      have_eeprom = 1;
   }
   if(!have_critical_alarms) need_redraw = 7703;
   have_critical_alarms = 3;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x6ca33(%rip), %rdi     # 0xf8204
callq 0x520bf
xorl %edi, %edi
callq 0x8ab27
callq 0x51c63
movl %eax, %r15d
callq 0x51c63
movl %eax, %r12d
callq 0x51c63
movw %ax, -0x2a(%rbp)
callq 0x51c63
movl %eax, %r14d
orl %r12d, %r14d
callq 0x51c63
movl %eax, %r12d
callq 0x51c63
movl %eax, %ebx
movl %ebx, %r13d
orl %r15d, %r13d
orl %r12d, %r13d
callq 0x51c63
callq 0x51c63
callq 0x51c63
callq 0x51c63
leaq 0x26b99c(%rip), %rdi    # 0x2f71d0
andl $0x0, (%rdi)
leaq 0x26ba6e(%rip), %rax    # 0x2f72ac
movl (%rax), %esi
leaq 0x26b991(%rip), %rcx    # 0x2f71d8
movl (%rcx), %edx
movl %edx, %r8d
andl $0xfffffbff, %r8d       # imm = 0xFFFFFBFF
movl %r8d, (%rcx)
orw %r14w, %r13w
je 0x8b88d
xorl %r8d, %r8d
testw %r15w, %r15w
setne %r8b
leal 0x10(%r8), %r9d
testw %bx, %bx
cmovel %r8d, %r9d
leal 0x8(%r9), %r8d
testw %r12w, %r12w
cmovel %r9d, %r8d
leal 0x2(%r8), %r9d
testw %r14w, %r14w
cmovel %r8d, %r9d
movl %r9d, (%rdi)
cmpw $0x0, -0x2a(%rbp)
je 0x8b8a6
testl %esi, %esi
je 0x8b8a6
orl $0x400, %edx            # imm = 0x400
movl %edx, (%rcx)
movl $0x1, (%rax)
leaq 0x26b9fb(%rip), %rax    # 0x2f72a8
cmpl $0x0, (%rax)
jne 0x8b8bf
leaq 0x176f8b(%rip), %rcx    # 0x202844
movl $0x1e17, (%rcx)         # imm = 0x1E17
movl $0x3, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: set_zod_protocol(int)
void set_zod_protocol(int prot)
{
   if(read_only) return;

   if(prot < 0) return;
   if(prot > 1) return;

   send_zod_start(ZOD_SET_PROTOCOL, 9, 0);
   send_zod_seq();
   send_word(0);
   send_word(prot);
   send_zod_end();

   Sleep(250);
   if     (prot == 0) rcvr_type = ZODIAC_RCVR;
   else if(prot == 1) rcvr_type = NMEA_RCVR;
   config_rcvr_type(0);
   need_msg_init = 2006;
   init_messages(60, 1);
}

// Assembly:
cmpl $0x1, %edi
ja 0x8b960
leaq 0x295736(%rip), %rax    # 0x32101a
cmpb $0x0, (%rax)
jne 0x8b960
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
pushq $0x9
popq %rsi
movl $0x533, %edi            # imm = 0x533
xorl %edx, %edx
callq 0x5c619
callq 0x5c6ed
xorl %edi, %edi
callq 0x52599
movzwl %bx, %edi
callq 0x52599
callq 0x5c6fe
movl $0xfa, %edi
callq 0xae83
testl %ebx, %ebx
movl $0x100, %eax            # imm = 0x100
pushq $0x2
popq %rcx
cmoveq %rax, %rcx
leaq 0x176f98(%rip), %rax    # 0x2028d0
movq %rcx, (%rax)
xorl %edi, %edi
callq 0x473fa
leaq 0x1796e7(%rip), %rax    # 0x205030
movl $0x7d6, (%rax)          # imm = 0x7D6
pushq $0x3c
popq %rdi
pushq $0x1
popq %rsi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x59afe
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: set_zod_power(int)
void set_zod_power(int power)
{
   if(read_only) return;

   send_zod_start(ZOD_SET_POWER, 8, 0);
   send_zod_seq();
   send_word(power);
   send_zod_end();
   Sleep(100);

   query_zod_msg(ZOD_POWER_MSG);
}

// Assembly:
leaq 0x2956b2(%rip), %rax    # 0x32101a
cmpb $0x0, (%rax)
je 0x8b96e
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
pushq $0x8
popq %rsi
movl $0x525, %edi            # imm = 0x525
xorl %edx, %edx
callq 0x5c619
callq 0x5c6ed
movzwl %bx, %edi
callq 0x52599
callq 0x5c6fe
pushq $0x64
popq %rdi
callq 0xae83
movl $0x45d, %edi            # imm = 0x45D
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5dabd
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: set_zod_platform(int)
void set_zod_platform(int platform)
{
   if(read_only) return;

   send_zod_start(ZOD_SET_PLATFORM, 8, 0);
   send_zod_seq();
   send_word(platform);
   send_zod_end();
   Sleep(100);

   query_zod_msg(ZOD_SETTINGS_MSG);
}

// Assembly:
leaq 0x295664(%rip), %rax    # 0x32101a
cmpb $0x0, (%rax)
je 0x8b9bc
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
pushq $0x8
popq %rsi
movl $0x4c4, %edi            # imm = 0x4C4
xorl %edx, %edx
callq 0x5c619
callq 0x5c6ed
movzwl %bx, %edi
callq 0x52599
callq 0x5c6fe
pushq $0x64
popq %rdi
callq 0xae83
movl $0x3f4, %edi            # imm = 0x3F4
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5dabd
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: decode_zod_message()
void decode_zod_message()
{
u16 id;

   start_msg_decode(1);

   id = zodiac_hdr[0];

   if     (id == ZOD_POSN_MSG)         parse_zod_posn();
   else if(id == ZOD_SNR_MSG)          parse_zod_snr();
   else if(id == ZOD_VIS_MSG)          parse_zod_vis();
   else if(id == ZOD_TRAIM_STATUS_MSG) parse_zod_traim_status();
   else if(id == ZOD_TRAIM_CONFIG_MSG) parse_zod_traim_config();
   else if(id == ZOD_DIAG_MSG)         parse_zod_diags();
   else if(id == ZOD_MARK_MSG)         parse_zod_mark();
   else if(id == ZOD_TEMP_MSG)         parse_zod_temp();
   else if(id == ZOD_EE_WRITE_MSG)     parse_zod_ee_written();
   else if(id == ZOD_EE_STATUS_MSG)    parse_zod_ee_status();
   else if(id == ZOD_POWER_MSG)        parse_zod_power();
   else if(id == ZOD_SETTINGS_MSG)     parse_zod_settings();
   else if(id == ZOD_ID_MSG)           parse_zod_id();
// else sprintf(debug_text, "unk zod msg:%d", id);

   if(sim_file && sim_delay) {  // throttle sim file messages
      Sleep(sim_delay);
   }
   saw_rcvr_msg = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq $0x1
popq %rdi
callq 0x73dcb
movzwl 0x2cb118(%rip), %eax    # 0x356b28
cmpl $0x470, %eax            # imm = 0x470
je 0x8bab6
cmpl $0x3ea, %eax            # imm = 0x3EA
je 0x8ba8c
cmpl $0x3eb, %eax            # imm = 0x3EB
je 0x8ba7e
cmpl $0x3f3, %eax            # imm = 0x3F3
je 0x8bac4
cmpl $0x3f4, %eax            # imm = 0x3F4
je 0x8ba93
cmpl $0x41f, %eax            # imm = 0x41F
je 0x8bacb
cmpl $0x420, %eax            # imm = 0x420
je 0x8baa8
cmpl $0x44c, %eax            # imm = 0x44C
je 0x8babd
cmpl $0x454, %eax            # imm = 0x454
je 0x8baaf
cmpl $0x456, %eax            # imm = 0x456
je 0x8ba85
cmpl $0x45d, %eax            # imm = 0x45D
je 0x8baa1
cmpl $0x46f, %eax            # imm = 0x46F
je 0x8ba9a
cmpl $0x3e8, %eax            # imm = 0x3E8
jne 0x8bad0
callq 0x8b29b
jmp 0x8bad0
callq 0x8ad5e
jmp 0x8bad0
callq 0x8ab4b
jmp 0x8bad0
callq 0x8ac09
jmp 0x8bad0
callq 0x8b725
jmp 0x8bad0
callq 0x8b5b1
jmp 0x8bad0
callq 0x8b62b
jmp 0x8bad0
callq 0x8b176
jmp 0x8bad0
callq 0x8af22
jmp 0x8bad0
callq 0x8b5e2
jmp 0x8bad0
callq 0x8b7bc
jmp 0x8bad0
callq 0x8b648
jmp 0x8bad0
callq 0x8b028
leaq 0x19c8e9(%rip), %rax    # 0x2283c0
cmpq $0x0, (%rax)
setne %al
leaq 0x181b1b(%rip), %rcx    # 0x20d600
movq (%rcx), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x8bafa
callq 0xae83
leaq 0x19d49f(%rip), %rax    # 0x228fa0
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: get_moto_lla()
void get_moto_lla()
{
   // get lat/lon/alt fields from a motorola binary message

   lat = ((double) (S32) tsip_dword());  // filtered or unfiltered posn
   lon = ((double) (S32) tsip_dword());
   alt = ((double) (S32) tsip_dword());  // gps altitude

   lat = (lat / 3600000.0) * PI / 180.0; // milliarcseconds to radians
   lon = (lon / 3600000.0) * PI / 180.0;
   alt /= 100.0;  // convert cm to meters
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
callq 0x51cf3
cvtsi2sd %eax, %xmm0
leaq 0x26b257(%rip), %rbx    # 0x2f6fd0
movsd %xmm0, (%rbx)
callq 0x51cf3
cvtsi2sd %eax, %xmm0
leaq 0x26b24b(%rip), %r14    # 0x2f6fd8
movsd %xmm0, (%r14)
callq 0x51cf3
cvtsi2sd %eax, %xmm0
movsd (%rbx), %xmm1
movsd 0x7c491(%rip), %xmm2    # 0x108238
divsd %xmm2, %xmm1
movsd 0x69aed(%rip), %xmm3    # 0xf58a0
mulsd %xmm3, %xmm1
movsd 0x69ae9(%rip), %xmm4    # 0xf58a8
divsd %xmm4, %xmm1
movsd %xmm1, (%rbx)
movsd (%r14), %xmm1
divsd %xmm2, %xmm1
mulsd %xmm3, %xmm1
divsd %xmm4, %xmm1
movsd %xmm1, (%r14)
divsd 0x6727b(%rip), %xmm0    # 0xf3060
leaq 0x26b1f4(%rip), %rax    # 0x2f6fe0
movsd %xmm0, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: get_moto_time(int)
void get_moto_time(int set_time)
{
   if(set_time) {
      pri_month = month = tsip_byte();
      pri_day = day = tsip_byte();
      pri_year = year = tsip_word();
      pri_hours = hours = tsip_byte();
      pri_minutes = minutes = tsip_byte();
      pri_seconds = seconds = tsip_byte();
      pri_frac = raw_frac = 0.0;
   }
   else {
      tsip_byte();
      tsip_byte();
      tsip_word();
      tsip_byte();
      tsip_byte();
      tsip_byte();
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
callq 0x51c47
testl %ebx, %ebx
je 0x8bebe
movzbl %al, %eax
leaq 0x26b6c4(%rip), %rcx    # 0x2f74d8
movl %eax, (%rcx)
leaq 0x26b6f3(%rip), %rcx    # 0x2f7510
movl %eax, (%rcx)
callq 0x51c47
movzbl %al, %eax
leaq 0x26b6a6(%rip), %rcx    # 0x2f74d4
movl %eax, (%rcx)
leaq 0x26b6d5(%rip), %rcx    # 0x2f750c
movl %eax, (%rcx)
callq 0x51c63
movzwl %ax, %eax
leaq 0x26b694(%rip), %rcx    # 0x2f74dc
movl %eax, (%rcx)
leaq 0x26b6c3(%rip), %rcx    # 0x2f7514
movl %eax, (%rcx)
callq 0x51c47
movzbl %al, %eax
leaq 0x26b66e(%rip), %rcx    # 0x2f74d0
movl %eax, (%rcx)
leaq 0x26b69d(%rip), %rcx    # 0x2f7508
movl %eax, (%rcx)
callq 0x51c47
movzbl %al, %eax
leaq 0x26b650(%rip), %rcx    # 0x2f74cc
movl %eax, (%rcx)
leaq 0x26b67f(%rip), %rcx    # 0x2f7504
movl %eax, (%rcx)
callq 0x51c47
movzbl %al, %eax
leaq 0x26b632(%rip), %rcx    # 0x2f74c8
movl %eax, (%rcx)
leaq 0x26b661(%rip), %rcx    # 0x2f7500
movl %eax, (%rcx)
leaq 0x26b638(%rip), %rax    # 0x2f74e0
andq $0x0, (%rax)
leaq 0x26b665(%rip), %rax    # 0x2f7518
andq $0x0, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
callq 0x51c47
callq 0x51c63
callq 0x51c47
callq 0x51c47
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x51c47
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: decode_posn_mode()
void decode_posn_mode()
{
   // convert position mode word into tbolt equivalents

   set_survey_status(0);

   if     (posn_mode == 0) rcvr_mode = RCVR_MODE_3D;
   else if(posn_mode == 1) rcvr_mode = RCVR_MODE_HOLD;
   else if(posn_mode == 2) rcvr_mode = RCVR_MODE_2D;
   else if(posn_mode == 3) set_survey_status(1);
   have_rcvr_mode = 4;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x26b2bc(%rip), %rax    # 0x2f71d8
movl (%rax), %ecx
movl %ecx, %edx
andl $-0x21, %edx
movl %edx, (%rax)
leaq 0x1791c0(%rip), %rdx    # 0x2050ec
movl (%rdx), %edx
cmpq $0x3, %rdx
ja 0x8bf6d
leaq 0x7d8fd(%rip), %rsi     # 0x109838
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
leaq 0x26b185(%rip), %rax    # 0x2f70d0
movb $0x4, (%rax)
jmp 0x8bf6d
leaq 0x26b179(%rip), %rax    # 0x2f70d0
movb $0x3, (%rax)
jmp 0x8bf6d
orl $0x20, %ecx
movl %ecx, (%rax)
jmp 0x8bf6d
leaq 0x26b166(%rip), %rax    # 0x2f70d0
movb $0x7, (%rax)
leaq 0x26b499(%rip), %rax    # 0x2f740d
movb $0x4, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: get_moto_tag()
void get_moto_tag()
{
   id_tag[0] = tsip_byte();  // id string
   id_tag[1] = tsip_byte();
   id_tag[2] = tsip_byte();
   id_tag[3] = tsip_byte();
   id_tag[4] = tsip_byte();
   id_tag[5] = tsip_byte();
   id_tag[6] = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0x51c47
movb %al, 0x2caa3b(%rip)     # 0x356acc
callq 0x51c47
movb %al, 0x2caa31(%rip)     # 0x356acd
callq 0x51c47
movb %al, 0x2caa27(%rip)     # 0x356ace
callq 0x51c47
movb %al, 0x2caa1d(%rip)     # 0x356acf
callq 0x51c47
movb %al, 0x2caa13(%rip)     # 0x356ad0
callq 0x51c47
movb %al, 0x2caa09(%rip)     # 0x356ad1
movb $0x0, 0x2caa03(%rip)    # 0x356ad2
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_moto_Af()
void parse_moto_Af()
{
   log_packet_id("altitude");
   alt = ((double) (S32) tsip_dword());  // GPS height in cm
   tsip_dword();                         // MSL height in cm
   alt = (alt / 100.0); // cm to meters
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x829e2(%rip), %rdi     # 0x10eb3c
callq 0x520bf
callq 0x51cf3
cvtsi2sd %eax, %xmm0
leaq 0x26ae71(%rip), %rbx    # 0x2f6fe0
movsd %xmm0, (%rbx)
callq 0x51cf3
movsd (%rbx), %xmm0
divsd 0x66edc(%rip), %xmm0    # 0xf3060
movsd %xmm0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_moto_Am()
void parse_moto_Am()
{
u32 val;

   log_packet_id("ignore sats");
   tsip_byte();
   val = tsip_dword();  // sat ignore bitmask

   val = (~val);
   sats_enabled = val;
   update_disable_list(sats_enabled);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x82975(%rip), %rdi     # 0x10eb45
callq 0x520bf
callq 0x51c47
callq 0x51cf3
notl %eax
leaq 0x26aefc(%rip), %rcx    # 0x2f70e4
movl %eax, (%rcx)
movl %eax, %edi
popq %rbp
jmp 0x56b6d
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_moto_AN()
void parse_moto_AN()
{
u08 v_filter;

   // marine velocity filter
   log_packet_id("marine filter");
   v_filter = tsip_byte();
   marine_filter = v_filter;
   if((v_filter >= 10) && (v_filter <= 100)) have_filter |= MARINE_FILTER;
   else                                      have_filter &= (~MARINE_FILTER);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x82954(%rip), %rdi     # 0x10eb51
callq 0x520bf
callq 0x51c47
leaq 0x26ae91(%rip), %rcx    # 0x2f709f
movb %al, (%rcx)
addb $-0xa, %al
xorl %ecx, %ecx
cmpb $0x5b, %al
setb %cl
leaq 0x26ae70(%rip), %rax    # 0x2f7090
movl $0xfffffeff, %edx       # imm = 0xFFFFFEFF
andl (%rax), %edx
shll $0x8, %ecx
orl %edx, %ecx
movl %ecx, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_moto_Aq()
void parse_moto_Aq()
{
u08 iono;

   // ionosphere corrections
   log_packet_id("iono/tropo filters");
   iono = tsip_byte();  // 0x01=iono, 0x02:tropo
   if(iono & 0x01) static_filter = 1;
   else            static_filter = 0;
   have_filter |= STATIC_FILTER;

   // troposphere corrections
   if(iono & 0x02) alt_filter = 1;
   else            alt_filter = 0;
   have_filter |= ALT_FILTER;
//sprintf(plot_title, "iono:%02x", iono);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x828fa(%rip), %rdi     # 0x10eb73
callq 0x520bf
callq 0x51c47
movl %eax, %ecx
andb $0x1, %cl
leaq 0x26ae0a(%rip), %rdx    # 0x2f7099
movb %cl, (%rdx)
leaq 0x26adf8(%rip), %rcx    # 0x2f7090
shrb %al
andb $0x1, %al
leaq 0x26adf7(%rip), %rdx    # 0x2f709a
movb %al, (%rdx)
orb $0x6, (%rcx)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_moto_AQ()
void parse_moto_AQ()
{
u08 v_filter;

   // position filter
   log_packet_id("pv filter");
   v_filter = tsip_byte();
   pv_filter = v_filter;
   have_filter |= PV_FILTER;
//sprintf(debug_text, "Pfilter:%02x", pv_filter);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x828d1(%rip), %rdi     # 0x10eb86
callq 0x520bf
callq 0x51c47
leaq 0x26add2(%rip), %rcx    # 0x2f7098
movb %al, (%rcx)
leaq 0x26adc1(%rip), %rax    # 0x2f7090
orb $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_moto_Ay()
void parse_moto_Ay()
{
   // pps delay
   log_packet_id("pps delay");
   pps1_delay = (double) (S32) tsip_dword();
   have_pps_delay |= 0x01;
   show_cable_delay();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8288e(%rip), %rdi     # 0x10ebaa
callq 0x520bf
callq 0x51cf3
cvtsi2sd %eax, %xmm0
leaq 0x26baa7(%rip), %rax    # 0x2f7dd8
movsd %xmm0, (%rax)
leaq 0x26af7c(%rip), %rax    # 0x2f72b8
orb $0x1, (%rax)
popq %rbp
jmp 0x6b202