LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/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 0x75767
testl %eax, %eax
je 0x7a6ec
leaq 0x1added(%rip), %rax    # 0x228390
movq (%rax), %rdi
testq %rdi, %rdi
je 0x7a5c0
leaq 0x92b7e(%rip), %rsi     # 0x10d130
leaq 0x2ab487(%rip), %rdx    # 0x325a40
xorl %eax, %eax
callq 0x9560
leaq 0x2ab479(%rip), %rdi    # 0x325a40
leaq 0x92b73(%rip), %rsi     # 0x10d141
callq 0x9090
testq %rax, %rax
je 0x7a5de
popq %rbp
jmp 0x7a08e
leaq 0x2ab45b(%rip), %rdi    # 0x325a40
leaq 0x92b59(%rip), %rsi     # 0x10d145
callq 0x9090
testq %rax, %rax
je 0x7a5fc
popq %rbp
jmp 0x7a441
leaq 0x2ab43d(%rip), %rdi    # 0x325a40
leaq 0x92b3f(%rip), %rsi     # 0x10d149
callq 0x9090
testq %rax, %rax
je 0x7a61a
popq %rbp
jmp 0x7a463
leaq 0x2ab41f(%rip), %rdi    # 0x325a40
leaq 0x92b25(%rip), %rsi     # 0x10d14d
callq 0x9090
testq %rax, %rax
je 0x7a638
popq %rbp
jmp 0x79a8a
leaq 0x2ab401(%rip), %rdi    # 0x325a40
leaq 0x92b0b(%rip), %rsi     # 0x10d151
callq 0x9090
testq %rax, %rax
je 0x7a656
popq %rbp
jmp 0x7a474
leaq 0x2ab3e3(%rip), %rdi    # 0x325a40
leaq 0x92af1(%rip), %rsi     # 0x10d155
callq 0x9090
testq %rax, %rax
je 0x7a674
popq %rbp
jmp 0x7a452
leaq 0x2ab3c5(%rip), %rdi    # 0x325a40
leaq 0x901a2(%rip), %rsi     # 0x10a824
callq 0x9090
testq %rax, %rax
je 0x7a692
popq %rbp
jmp 0x7a339
leaq 0x2ab3a7(%rip), %rdi    # 0x325a40
leaq 0x95a74(%rip), %rsi     # 0x110114
callq 0x9090
testq %rax, %rax
je 0x7a6b0
popq %rbp
jmp 0x7a485
leaq 0x2ab389(%rip), %rdi    # 0x325a40
leaq 0x91090(%rip), %rsi     # 0x10b74e
callq 0x9090
testq %rax, %rax
je 0x7a6ce
popq %rbp
jmp 0x7a55d
leaq 0x2ab36b(%rip), %rdi    # 0x325a40
leaq 0x95bfc(%rip), %rsi     # 0x1102d8
callq 0x9090
testq %rax, %rax
je 0x7a6ec
popq %rbp
jmp 0x7a496
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_ss_sats()
void parse_ss_sats()
{
int count;
int prn;
int status;
int i, j;
float el;
float az;
int snr;

   log_packet_id("Satellite info");
   count = tsip_byte() & 0x0F;
   reset_sat_tracking();

   while(count--) {
      status = tsip_byte();
      prn = (status & 0x1F) + 1;
      i = tsip_byte();
      el = (float) (char) i;
      i = tsip_byte();
      j = tsip_byte();
      if(j & 1) i += 128;
      az = (float) i;
      j = (j >> 1) & 0x7F;
      if(j) prn = (87 + j);

      snr = tsip_byte();  // snr

      status = (status >> 5) & 0x03;
      if(status == 3) sat[prn].tracking = 1;
      else if(status == 1) sat[prn].tracking = (-1);

      sat[prn].level_msg = 222;
      set_sat_azel(prn, az,el);
      sat[prn].sig_level = (float) snr;
      have_snr |= rinex_gnss(prn);
      have_sat_azel = 2;

      record_sig_levels(prn);
      level_type = "dBc";
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x91bac(%rip), %rdi     # 0x10d2af
callq 0x520bf
callq 0x51c47
andb $0xf, %al
movzbl %al, %r13d
callq 0x56b1c
subl $0x1, %r13d
jb 0x7b816
callq 0x51c47
movzbl %al, %r14d
movl %r14d, %r12d
andl $0x1f, %r12d
incl %r12d
callq 0x51c47
movb %al, -0x2a(%rbp)
callq 0x51c47
movb %al, -0x29(%rbp)
callq 0x51c47
movzbl %al, %r15d
movl %r15d, %ebx
shrl %ebx
addl $0x57, %ebx
cmpb $0x2, %r15b
cmovbl %r12d, %ebx
callq 0x51c47
movl %eax, %r12d
shrl $0x5, %r14d
andl $0x3, %r14d
pushq $0x1
popq %rax
cmpl $0x3, %r14d
je 0x7b780
cmpl $0x1, %r14d
jne 0x7b795
pushq $-0x1
popq %rax
imulq $0x348, %rbx, %rcx      # imm = 0x348
leaq 0x1ad822(%rip), %rdx    # 0x228fb0
movl %eax, 0x218(%rdx,%rcx)
movsbl -0x2a(%rbp), %eax
cvtsi2ss %eax, %xmm1
movzbl -0x29(%rbp), %eax
shll $0x7, %r15d
movzbl %r15b, %ecx
addl %eax, %ecx
cvtsi2ss %ecx, %xmm0
imulq $0x348, %rbx, %r14      # imm = 0x348
leaq 0x1ad7f3(%rip), %r15    # 0x228fb0
movl $0xde, 0x1c(%r15,%r14)
movl %ebx, %edi
callq 0x53b74
movzbl %r12b, %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x20(%r15,%r14)
movl %ebx, %edi
callq 0xca4da
leaq 0x27bb62(%rip), %rcx    # 0x2f734c
orl %eax, (%rcx)
leaq 0x27baa1(%rip), %rax    # 0x2f7294
movl $0x2, (%rax)
movl %ebx, %edi
callq 0x559ba
leaq 0x9041b(%rip), %rax     # 0x10bc22
leaq 0x1ad6ea(%rip), %rcx    # 0x228ef8
movq %rax, (%rcx)
jmp 0x7b718
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: 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:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
xorl %r15d, %r15d
testl %esi, %esi
cmovlel %r15d, %ebx
cmpq %r15, %rbx
je 0x7b85b
callq 0x51c47
testq %r14, %r14
je 0x7b856
movb %al, (%r14,%r15)
movb $0x0, 0x1(%r14,%r15)
incq %r15
jmp 0x7b83d
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_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 %r14
pushq %rbx
leaq 0x91a4a(%rip), %rdi     # 0x10d2be
callq 0x520bf
leaq 0x2ab890(%rip), %rdi    # 0x327110
pushq $0xe
popq %rbx
movl %ebx, %esi
callq 0x7b825
leaq 0x2ab8af(%rip), %rdi    # 0x327140
movl %ebx, %esi
callq 0x7b825
leaq 0x2ab8d1(%rip), %rdi    # 0x327170
pushq $0x4
popq %r14
movl %r14d, %esi
callq 0x7b825
leaq 0x2ab8ee(%rip), %rdi    # 0x3271a0
movl %ebx, %esi
callq 0x7b825
leaq 0x2ab910(%rip), %rdi    # 0x3271d0
pushq $0x16
popq %rsi
callq 0x7b825
leaq 0x2ab931(%rip), %rdi    # 0x327200
pushq $0xd
popq %rsi
callq 0x7b825
leaq 0x2ab952(%rip), %rdi    # 0x327230
movl %r14d, %esi
callq 0x7b825
callq 0x51c63
movzwl %ax, %eax
leaq 0x2ab95f(%rip), %rcx    # 0x327254
movl %eax, (%rcx)
callq 0x51c63
movzwl %ax, %eax
leaq 0x2ab952(%rip), %rcx    # 0x327258
movl %eax, (%rcx)
callq 0x51c47
movzbl %al, %eax
leaq 0x2ab945(%rip), %rcx    # 0x32725c
movl %eax, (%rcx)
leaq 0x27c054(%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_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 %r14
pushq %rbx
leaq 0x918b8(%rip), %rdi     # 0x10d2db
callq 0x520bf
callq 0x56b4a
movl $0xd20, %ebx            # imm = 0xD20
addq 0xbe50f(%rip), %rbx     # 0x139f48
pushq $0x1
popq %r14
cmpq $0x20, %r14
ja 0x7ba7d
callq 0x51c47
testb $0x3, %al
je 0x7ba53
movb $0x1, -0x9d8(%rbx)
testb $0xc, %al
je 0x7ba5e
movb $0x1, -0x690(%rbx)
testb $0x30, %al
je 0x7ba69
movb $0x1, -0x348(%rbx)
cmpb $0x40, %al
jb 0x7ba70
movb $0x1, (%rbx)
addq $0x4, %r14
addq $0xd20, %rbx            # imm = 0xD20
jmp 0x7ba3d
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_ss_timing()
void parse_ss_timing()
{
int i;

   log_packet_id("Timing status");

   cable_delay = ((double) tsip_dword()) * 1.0E9;
   have_cable_delay = 333;

   pps1_delay = ((double) tsip_dword()) * 1.0E9;
   have_pps_delay |= 0x01;

   ss_pps_width = ((double) tsip_dword()) * 100.0;  // in ns (100 ns granularity)
   have_pps_duty = 1;

   tsip_byte();  // number of observations
   el_mask = ((float) tsip_word()) / 100.0F;

   tsip_byte();  // leap second change (-1, 0, 1)
   i = tsip_byte();
   if(i) {
      if(!user_set_utc_ofs) utc_offset = i;
      check_utc_ofs(33);
   }

   pps_offset = (DATA_SIZE) tsip_double();  // bias
   have_pps_offset = 333;
   osc_offset = (DATA_SIZE) tsip_double();  // drift
   have_osc_offset = 333;

   tsip_byte();    // date of PPS
   tsip_byte();  
   tsip_word();  

   tsip_byte();    // time of PPS
   tsip_byte();
   tsip_double();

   tsip_dword();   // pps residual in ns

   tsip_byte();    // timing operation mode, etc
   tsip_dword();   // TFOM clock bias in ns
   tsip_byte();    // rsvd
   ss_intrinsic_delay = tsip_word();    // intrinsic delay
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x916fb(%rip), %rdi     # 0x10d315
callq 0x520bf
callq 0x51cf3
movl %eax, %eax
cvtsi2sd %rax, %xmm0
mulsd 0x773f5(%rip), %xmm0    # 0xf3028
leaq 0x27c18e(%rip), %rax    # 0x2f7dc8
movsd %xmm0, (%rax)
leaq 0x27b66f(%rip), %rax    # 0x2f72b4
movl $0x14d, (%rax)          # imm = 0x14D
callq 0x51cf3
movl %eax, %eax
cvtsi2sd %rax, %xmm0
mulsd 0x773c9(%rip), %xmm0    # 0xf3028
leaq 0x27c172(%rip), %rax    # 0x2f7dd8
movsd %xmm0, (%rax)
leaq 0x27b647(%rip), %rax    # 0x2f72b8
orb $0x1, (%rax)
callq 0x51cf3
movl %eax, %eax
cvtsi2sd %rax, %xmm0
mulsd 0x773d8(%rip), %xmm0    # 0xf3060
leaq 0x27c119(%rip), %rax    # 0x2f7da8
movsd %xmm0, (%rax)
leaq 0x27c0ca(%rip), %rax    # 0x2f7d64
movl $0x1, (%rax)
callq 0x51c47
callq 0x51c63
movzwl %ax, %eax
cvtsi2ss %eax, %xmm0
divss 0x7b437(%rip), %xmm0    # 0xf70f0
leaq 0x27b3f4(%rip), %rax    # 0x2f70b4
movss %xmm0, (%rax)
callq 0x51c47
callq 0x51c47
testb %al, %al
je 0x7bcf2
leaq 0x27ba5b(%rip), %rcx    # 0x2f7734
cmpl $0x0, (%rcx)
jne 0x7bcea
movzbl %al, %eax
leaq 0x27ba40(%rip), %rcx    # 0x2f7728
movl %eax, (%rcx)
pushq $0x21
popq %rdi
callq 0x51a91
callq 0x51e6f
leaq 0x27aaba(%rip), %rax    # 0x2f67b8
movsd %xmm0, (%rax)
leaq 0x27b52f(%rip), %rax    # 0x2f7238
movl $0x14d, %ebx            # imm = 0x14D
movl %ebx, (%rax)
callq 0x51e6f
leaq 0x27aaa4(%rip), %rax    # 0x2f67c0
movsd %xmm0, (%rax)
leaq 0x27b50d(%rip), %rax    # 0x2f7234
movl %ebx, (%rax)
callq 0x51c47
callq 0x51c47
callq 0x51c63
callq 0x51c47
callq 0x51c47
callq 0x51e6f
callq 0x51cf3
callq 0x51c47
callq 0x51cf3
callq 0x51c47
callq 0x51c63
movzwl %ax, %eax
leaq 0x27c04e(%rip), %rcx    # 0x2f7db8
movl %eax, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x9125f(%rip), %rdi     # 0x10d41c
callq 0x520bf
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c47
popq %rbp
jmp 0x51c47
// File: /workspace/github_cpp_makefile_star2_O2/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 0x91244(%rip), %rdi     # 0x10d432
callq 0x520bf
callq 0x51dc3
cvtss2sd %xmm0, %xmm0
leaq 0x27b7e5(%rip), %rax    # 0x2f79e8
movsd %xmm0, (%rax)
callq 0x51dc3
cvtss2sd %xmm0, %xmm0
leaq 0x27b7d9(%rip), %rax    # 0x2f79f0
movsd %xmm0, (%rax)
callq 0x51dc3
cvtss2sd %xmm0, %xmm0
leaq 0x27b7cd(%rip), %rbx    # 0x2f79f8
movsd %xmm0, (%rbx)
callq 0x51dc3
cvtss2sd %xmm0, %xmm0
leaq 0x27b7d1(%rip), %rax    # 0x2f7a10
movsd %xmm0, (%rax)
movsd (%rbx), %xmm0
mulsd 0x76dd9(%rip), %xmm0    # 0xf3028
leaq 0x27a562(%rip), %rax    # 0x2f67b8
movsd %xmm0, (%rax)
leaq 0x27afd7(%rip), %rax    # 0x2f7238
movl $0x1, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x90fae(%rip), %rdi     # 0x10d463
callq 0x520bf
callq 0x51dc3
cvtss2sd %xmm0, %xmm0
leaq 0x27b57e(%rip), %rax    # 0x2f7a48
movsd %xmm0, (%rax)
callq 0x51cf3
callq 0x51dc3
cvtss2sd %xmm0, %xmm0
leaq 0x27b56d(%rip), %rax    # 0x2f7a50
movsd %xmm0, (%rax)
popq %rbp
jmp 0x51cf3
// File: /workspace/github_cpp_makefile_star2_O2/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 0x90f85(%rip), %rdi     # 0x10d487
callq 0x520bf
callq 0x56b1c
leaq 0x8bb63(%rip), %rax     # 0x108076
leaq 0x1ac9de(%rip), %rcx    # 0x228ef8
movq %rax, (%rcx)
callq 0x51c47
callq 0x51c47
pushq $0x6
popq %r12
leaq 0x1aca7e(%rip), %r13    # 0x228fb0
callq 0x51c47
subl $0x1, %r12d
jb 0x7c5c8
movl %eax, %r14d
callq 0x51c47
movl %eax, %ebx
callq 0x51c47
movl %eax, %r15d
callq 0x51c47
leal -0x1(%r14), %eax
cmpb $0x1f, %al
ja 0x7c532
movzbl %r14b, %r14d
imull $0xa, %r14d, %eax
cvtsi2ss %eax, %xmm0
movl %r14d, %edi
movss 0x8c451(%rip), %xmm1    # 0x1089c8
callq 0x53b74
movzbl %r15b, %eax
cvtsi2ss %eax, %xmm0
imulq $0x348, %r14, %r15      # imm = 0x348
movss %xmm0, 0x20(%r13,%r15)
movl $0x25, 0x1c(%r13,%r15)
movl %r14d, %edi
callq 0xca4da
leaq 0x27ada2(%rip), %rcx    # 0x2f734c
orl %eax, (%rcx)
testb $0x8, %bl
je 0x7c5bb
addq %r13, %r15
movl %r14d, 0x218(%r15)
movl %r14d, %edi
callq 0x559ba
jmp 0x7c532
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_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 0x90ebb(%rip), %rdi     # 0x10d4a7
callq 0x520bf
pushq $0x5
popq %r13
leaq 0x27b4a4(%rip), %r15    # 0x2f7aa0
movl %r13d, %r12d
subl $0x1, %r12d
jb 0x7c69b
callq 0x51cf3
movl %eax, %ebx
callq 0x51cf3
movl %eax, %r14d
callq 0x51cf3
cmpl $0x5, %r13d
movl %r12d, %r13d
jne 0x7c5fc
cvtsi2sd %eax, %xmm0
cvtsi2sd %r14d, %xmm1
cvtsi2sd %ebx, %xmm2
movsd 0x8bbfd(%rip), %xmm3    # 0x108238
divsd %xmm3, %xmm2
movsd 0x79259(%rip), %xmm4    # 0xf58a0
mulsd %xmm4, %xmm2
movsd 0x79255(%rip), %xmm5    # 0xf58a8
divsd %xmm5, %xmm2
leaq 0x27a972(%rip), %rax    # 0x2f6fd0
movsd %xmm2, (%rax)
divsd %xmm3, %xmm1
mulsd %xmm4, %xmm1
divsd %xmm5, %xmm1
leaq 0x27a963(%rip), %rax    # 0x2f6fd8
movsd %xmm1, (%rax)
divsd 0x769df(%rip), %xmm0    # 0xf3060
leaq 0x27a958(%rip), %rax    # 0x2f6fe0
movsd %xmm0, (%rax)
movl $0x1, (%r15)
movl %r12d, %r13d
jmp 0x7c5fc
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_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 0x90e09(%rip), %rdi     # 0x10d4be
callq 0x520bf
callq 0x51c63
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51dc3
cvtss2sd %xmm0, %xmm0
leaq 0x27b32f(%rip), %rax    # 0x2f7a30
movsd %xmm0, (%rax)
callq 0x51c47
movzbl %al, %eax
leaq 0x27b384(%rip), %rcx    # 0x2f7a98
movl %eax, (%rcx)
callq 0x51c47
movzbl %al, %eax
leaq 0x27b377(%rip), %rcx    # 0x2f7a9c
movl %eax, (%rcx)
popq %rbp
jmp 0x51c47
// File: /workspace/github_cpp_makefile_star2_O2/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 0x90dbb(%rip), %rdi     # 0x10d515
callq 0x520bf
callq 0x51dc3
cvtss2sd %xmm0, %xmm0
divsd 0x768b8(%rip), %xmm0    # 0xf3028
divsd 0x79278(%rip), %xmm0    # 0xf59f0
leaq 0x27b649(%rip), %rax    # 0x2f7dc8
movsd %xmm0, (%rax)
leaq 0x27ab2a(%rip), %rax    # 0x2f72b4
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_rftg_traim()
void parse_rftg_traim()
{
   // !!!!! we need to decode this
   log_packet_id("Packet 0x63 (traim status)");

   tsip_byte();  // message rate
   tsip_byte();  // alarm limit us (?)
   tsip_byte();  // status (0x0D)
   tsip_byte();  // 
   tsip_byte();  // 
   tsip_byte();  // 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x90d99(%rip), %rdi     # 0x10d547
callq 0x520bf
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c47
popq %rbp
jmp 0x51c47
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: set_rftg_fix_mode(int)
void set_rftg_fix_mode(int mode)
{
   // (mode == 0) -> fix mode
   if(read_only) return;

   start_rftg_request2(0);

   send_rftg_start(0x31);
   send_byte(mode);
   send_rftg_end();
}

// Assembly:
leaq 0x2a46bf(%rip), %rax    # 0x32101a
cmpb $0x0, (%rax)
je 0x7c961
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
xorl %edi, %edi
callq 0x5d465
pushq $0x31
popq %rdi
callq 0x5707f
movzbl %bl, %edi
callq 0x523f2
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x570f8
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: set_rftg_advance(float)
void set_rftg_advance(float val)
{
   // advance pps (in microseconds)
   if(read_only) return;

   start_rftg_request2(0);

   send_rftg_start(0x30);
   send_byte(1);    // advance
   send_single(val);
   send_rftg_end();
}

// Assembly:
leaq 0x2a4688(%rip), %rax    # 0x32101a
cmpb $0x0, (%rax)
je 0x7c998
retq
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
xorl %edi, %edi
movss %xmm0, -0x4(%rbp)
callq 0x5d465
pushq $0x30
popq %rdi
callq 0x5707f
pushq $0x1
popq %rdi
callq 0x523f2
movss -0x4(%rbp), %xmm0
callq 0x52673
addq $0x10, %rsp
popq %rbp
jmp 0x570f8
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: set_rftg_delay(float)
void set_rftg_delay(float val)
{
   // delay pps (in microseconds)
   if(read_only) return;

   start_rftg_request2(0);

   send_rftg_start(0x30);
   send_byte(2);    // delay
   send_single(val);
   send_rftg_end();
}

// Assembly:
leaq 0x2a4643(%rip), %rax    # 0x32101a
cmpb $0x0, (%rax)
je 0x7c9dd
retq
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
xorl %edi, %edi
movss %xmm0, -0x4(%rbp)
callq 0x5d465
pushq $0x30
popq %rdi
callq 0x5707f
pushq $0x2
popq %rdi
callq 0x523f2
movss -0x4(%rbp), %xmm0
callq 0x52673
addq $0x10, %rsp
popq %rbp
jmp 0x570f8
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: rftg_enable_cpu()
void rftg_enable_cpu()
{
   if(read_only) return;

   start_rftg_request2(0);

   send_rftg_start(0x30);
   send_byte(4); 
   send_dword(0);
   send_rftg_end();

   set_rftg_normal();
}

// Assembly:
leaq 0x2a45fe(%rip), %rax    # 0x32101a
cmpb $0x0, (%rax)
je 0x7ca22
retq
pushq %rbp
movq %rsp, %rbp
xorl %edi, %edi
callq 0x5d465
pushq $0x30
popq %rdi
callq 0x5707f
pushq $0x4
popq %rdi
callq 0x523f2
xorl %edi, %edi
callq 0x525e2
callq 0x570f8
popq %rbp
jmp 0x5d4f6
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: rftg_disable_cpu()
void rftg_disable_cpu()
{
   if(read_only) return;

   start_rftg_request2(0);

   send_rftg_start(0x30);
   send_byte(5); 
   send_dword(0);
   send_rftg_end();

   set_rftg_normal();
}

// Assembly:
leaq 0x2a45c4(%rip), %rax    # 0x32101a
cmpb $0x0, (%rax)
je 0x7ca5c
retq
pushq %rbp
movq %rsp, %rbp
xorl %edi, %edi
callq 0x5d465
pushq $0x30
popq %rdi
callq 0x5707f
pushq $0x5
popq %rdi
callq 0x523f2
xorl %edi, %edi
callq 0x525e2
callq 0x570f8
popq %rbp
jmp 0x5d4f6
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: send_brandy_string(char*, int)
void send_brandy_string(char *s, int comma)
{
int i, j;

   if(s == 0) return;

   j = strlen(s);
   for(i=0; i<j; i++) send_brandy_char((u08) s[i]);

   if(comma) send_brandy_char((u08) ',');
}

// Assembly:
testq %rdi, %rdi
je 0x7d217
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
callq 0x9120
movq %rax, %r15
xorl %r12d, %r12d
testl %r15d, %r15d
cmovlel %r12d, %r15d
cmpq %r12, %r15
je 0x7d203
movzbl (%r14,%r12), %edi
callq 0x64edf
incq %r12
jmp 0x7d1ef
testl %ebx, %ebx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
je 0x7d217
pushq $0x2c
popq %rdi
jmp 0x64edf
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: send_brandy_end(int)
void send_brandy_end(int do_cksum)
{
char cksum[10];

   sprintf(cksum, "%02X", (nmea_tx_cksum & 0xFF));

   if(do_cksum) {
      send_brandy_char('*');
      send_brandy_char(cksum[0]);
      send_brandy_char(cksum[1]);
   }
   send_brandy_char(0x0D);
   send_brandy_char(0x0A);

   if(sim_file == 0) Sleep(50);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
movl %edi, %ebx
movzbl 0x2d988c(%rip), %edx    # 0x356ab6
leaq 0x9778f(%rip), %rsi     # 0x1149c0
leaq -0x12(%rbp), %rdi
xorl %eax, %eax
callq 0x9060
testl %ebx, %ebx
je 0x7d25a
pushq $0x2a
popq %rdi
callq 0x64edf
movzbl -0x12(%rbp), %edi
callq 0x64edf
movzbl -0x11(%rbp), %edi
callq 0x64edf
pushq $0xd
popq %rdi
callq 0x64edf
pushq $0xa
popq %rdi
callq 0x64edf
leaq 0x1ab14f(%rip), %rax    # 0x2283c0
cmpq $0x0, (%rax)
je 0x7d27e
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
pushq $0x32
popq %rdi
addq $0x18, %rsp
popq %rbx
popq %rbp
jmp 0xae83
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: send_brandy_cmd(char*)
void send_brandy_cmd(char *s)
{
   if(s == 0) return;
   if(log_file && (log_stream & LOG_PACKET_START)) {
      fprintf(log_file, "\nSend brandy start: %s\n", s);
   }

   send_brandy_start();
   send_brandy_string(s, 0);
//send_brandy_end(0);
//return;
   if(strchr(s, '*')) send_brandy_end(0);
   else               send_brandy_end(1);
}

// Assembly:
testq %rdi, %rdi
je 0x7d2f4
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1ab0bf(%rip), %rax    # 0x228360
movq (%rax), %rdi
testq %rdi, %rdi
je 0x7d2c6
leaq 0x1ab160(%rip), %rax    # 0x228410
testb $0x4, (%rax)
je 0x7d2c6
leaq 0x903c4(%rip), %rsi     # 0x10d680
movq %rbx, %rdx
xorl %eax, %eax
callq 0x9560
callq 0x7d1b3
movq %rbx, %rdi
xorl %esi, %esi
callq 0x7d1c8
pushq $0x2a
popq %rsi
movq %rbx, %rdi
callq 0x9100
xorl %edi, %edi
testq %rax, %rax
sete %dil
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x7d218
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_brandy_c()
void parse_brandy_c()
{

   // pulse output
   log_packet_id("pulse output");

   if(get_msg_field()) {  // pulse time should be UXXXXXX or P1000 for 1PPS
      strupr(msg_field);
      if(msg_field[0] == 'P') brandy_pps_rate = atoi(&msg_field[1]);
      else if(strstr(msg_field, "UXXXXXX")) brandy_pps_rate = 1000;
      else brandy_pps_rate = 0;
      have_brandy_rate = 1;
   }

   if(get_msg_field()) {  // pulse width in msecs
      brandy_pps_width = atoi(msg_field);
      if(brandy_pps_width < 0) pps_polarity = 1;
      else                     pps_polarity = 0;
      have_pps_polarity = 22;
      have_brandy_width = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x8ff16(%rip), %rdi     # 0x10d6a9
callq 0x520bf
callq 0x75767
testl %eax, %eax
je 0x7d7f8
leaq 0x2a8298(%rip), %rbx    # 0x325a40
movq %rbx, %rdi
callq 0x988f
cmpb $0x50, (%rbx)
jne 0x7d7c2
incq %rbx
movq %rbx, %rdi
callq 0x95e0
jmp 0x7d7e2
leaq 0x2a8277(%rip), %rdi    # 0x325a40
leaq 0x8fee6(%rip), %rsi     # 0x10d6b6
callq 0x9090
xorl %ecx, %ecx
testq %rax, %rax
movl $0x3e8, %eax            # imm = 0x3E8
cmovel %ecx, %eax
leaq 0x2a8667(%rip), %rcx    # 0x325e50
movl %eax, (%rcx)
leaq 0x2a8662(%rip), %rax    # 0x325e54
movl $0x1, (%rax)
callq 0x75767
testl %eax, %eax
je 0x7d83c
leaq 0x2a8238(%rip), %rdi    # 0x325a40
callq 0x95e0
leaq 0x2a8644(%rip), %rcx    # 0x325e58
movl %eax, (%rcx)
shrl $0x1f, %eax
leaq 0x27a4f8(%rip), %rcx    # 0x2f7d18
movl %eax, (%rcx)
leaq 0x279ab7(%rip), %rax    # 0x2f72e0
movl $0x16, (%rax)
leaq 0x2a8626(%rip), %rax    # 0x325e5c
movl $0x1, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_brandy_e()
void parse_brandy_e()
{
   // code output
   log_packet_id("code output");

   if(get_msg_field()) {  // time code 1 type
      brandy_code1 = msg_field[0];
      have_brandy_code |= 0x01;
   }

   if(get_msg_field()) {  // pulse output type
      brandy_code2 = msg_field[0];
      if     (brandy_code2 == '0') { pps_enabled = 0; have_pps_enable = 30; }
      else if(brandy_code2 == '1') { pps_enabled = 0; have_pps_enable = 31; } 
      else if(brandy_code2 == '2') { pps_enabled = 1; have_pps_enable = 31; } 
      else if(brandy_code2 == '3') { pps_enabled = 1; have_pps_enable = 32; } 
      have_brandy_code |= 0x02;
   }

   if(get_msg_field()) {  // TXD1 code type (not used)
      brandy_code3 = msg_field[0];
      have_brandy_code |= 0x04;
   }

   if(get_msg_field()) {  // TXD2 code type (not used)
      brandy_code4 = msg_field[0];
      have_brandy_code |= 0x08;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8fe70(%rip), %rdi     # 0x10d6be
callq 0x520bf
callq 0x75767
testl %eax, %eax
je 0x7d878
leaq 0x2a81dd(%rip), %rax    # 0x325a40
movb (%rax), %al
leaq 0x2a85f4(%rip), %rcx    # 0x325e60
movb %al, (%rcx)
leaq 0x2a85ef(%rip), %rax    # 0x325e64
orb $0x1, (%rax)
callq 0x75767
testl %eax, %eax
je 0x7d8d0
leaq 0x2a81b8(%rip), %rax    # 0x325a40
movb (%rax), %al
leaq 0x2a85d0(%rip), %rcx    # 0x325e61
movb %al, (%rcx)
addb $-0x30, %al
cmpb $0x3, %al
ja 0x7d8c6
leal (,%rax,8), %ecx
movl $0x1010000, %edx        # imm = 0x1010000
shrl %cl, %edx
movzbl %al, %eax
leaq 0x8b1af(%rip), %rcx     # 0x108a60
movl (%rcx,%rax,4), %eax
leaq 0x27a465(%rip), %rcx    # 0x2f7d20
movb %dl, (%rcx)
leaq 0x279a18(%rip), %rcx    # 0x2f72dc
movl %eax, (%rcx)
leaq 0x2a8597(%rip), %rax    # 0x325e64
orb $0x2, (%rax)
callq 0x75767
testl %eax, %eax
je 0x7d8f5
leaq 0x2a8160(%rip), %rax    # 0x325a40
movb (%rax), %al
leaq 0x2a8579(%rip), %rcx    # 0x325e62
movb %al, (%rcx)
leaq 0x2a8572(%rip), %rax    # 0x325e64
orb $0x4, (%rax)
callq 0x75767
testl %eax, %eax
je 0x7d91a
leaq 0x2a813b(%rip), %rax    # 0x325a40
movb (%rax), %al
leaq 0x2a8555(%rip), %rcx    # 0x325e63
movb %al, (%rcx)
leaq 0x2a854d(%rip), %rax    # 0x325e64
orb $0x8, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_brandy_n()
void parse_brandy_n()
{
   // receiver fw version
   log_packet_id("firmware");

   if(get_msg_field()) {
      msg_field[32] = 0;
      strcpy(brandy_fw, msg_field);
   }
   if(get_msg_field()) {
      msg_field[32] = 0;
      strcpy(brandy_engine, msg_field);
   }
   if(get_msg_field()) {
      msg_field[32] = 0;
      strcpy(brandy_test, msg_field);
   }

   have_info |= (VERSION_INFO | PRODN_PARAMS);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8f99c(%rip), %rdi     # 0x10d6ea
callq 0x520bf
callq 0x75767
testl %eax, %eax
je 0x7dd73
leaq 0x2a7cdd(%rip), %rsi    # 0x325a40
movb $0x0, 0x20(%rsi)
leaq 0x2a7ee2(%rip), %rdi    # 0x325c50
callq 0x9330
callq 0x75767
testl %eax, %eax
je 0x7dd93
leaq 0x2a7cbd(%rip), %rsi    # 0x325a40
movb $0x0, 0x20(%rsi)
leaq 0x2a7f42(%rip), %rdi    # 0x325cd0
callq 0x9330
callq 0x75767
testl %eax, %eax
je 0x7ddb3
leaq 0x2a7c9d(%rip), %rsi    # 0x325a40
movb $0x0, 0x20(%rsi)
leaq 0x2a7fa2(%rip), %rdi    # 0x325d50
callq 0x9330
leaq 0x279bba(%rip), %rax    # 0x2f7974
orb $0x6, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_prccg()
void parse_prccg()
{
int cmd;

   // Brandywine query responses
   // queries D, H, L, P, S produce NMEA messages

   if(get_msg_field() == 0) return;

   cmd = toupper(msg_field[0]);

   if     (cmd == 'A') parse_brandy_a();
   else if(cmd == 'C') parse_brandy_c();
   else if(cmd == 'E') parse_brandy_e();
   else if(cmd == 'F') parse_brandy_f();
   else if(cmd == 'J') parse_brandy_j();
   else if(cmd == 'N') parse_brandy_n();
   else if(cmd == 'O') parse_brandy_o();
   else if(cmd == 'Z') parse_brandy_z();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0x75767
testl %eax, %eax
je 0x7de26
leaq 0x2a7c4b(%rip), %rax    # 0x325a40
movsbl (%rax), %edi
callq 0x9700
leal -0x41(%rax), %ecx
cmpl $0xe, %ecx
ja 0x7de1b
leaq 0x8b420(%rip), %rax     # 0x10922c
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
popq %rbp
jmp 0x7d4b1
cmpl $0x5a, %eax
jne 0x7de26
popq %rbp
jmp 0x7ddd0
popq %rbp
retq
popq %rbp
jmp 0x7ddbf
popq %rbp
jmp 0x7d843
popq %rbp
jmp 0x7d91c
popq %rbp
jmp 0x7d786
popq %rbp
jmp 0x7db56
popq %rbp
jmp 0x7dd43
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: send_queued_cmd(int)
int send_queued_cmd(int why)
{
int id;

   // send the next message in the request queue to the receiver

   if(polled_q_in == polled_q_out) return 0;
   id = polled_q[polled_q_out].id;

if(debug_file) fprintf(debug_file, "SEND Q %d: sqe:%d  old_id=%d: %s  why:%d\n", polled_q_out, polled_q_entries, polled_msg_id, polled_q[polled_q_out].msg, why);

   send_polled_cmd(polled_q[polled_q_out].msg, polled_q[polled_q_out].id);


   if(++polled_q_out >= POLLED_Q_SIZE) polled_q_out = 0;
   --polled_q_entries;

   if(rcvr_type == STAR_RCVR) ;
   else if(rcvr_type == BRANDY_RCVR) ;
   else if((id == SCPI_TEST_MSG) && (scpi_type != UCCMP_TYPE)) {
      if(sim_file == 0) Sleep(20000);    // wait for reset to complete

      erase_screen();
      vidstr(0,0, YELLOW, "Re-establishing communications in 30 seconds...");
      refresh_page();

      drain_com_data();      // flush com data
      reset_com_timer(RCVR_PORT);
      polled_q_in = 0;           // reset SCPI message send queue pointers
      polled_q_out = 0;
      polled_q_entries = 0;
      polled_req = 0;
      polled_seq = 0;
      need_redraw = 3487;
   }
   return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movslq 0x2dc019(%rip), %rdx    # 0x359fd4
xorl %ebx, %ebx
cmpl %edx, 0x2dc00d(%rip)    # 0x359fd0
je 0x7e103
imulq $0x84, %rdx, %r9
leaq 0x2d8c69(%rip), %rbx    # 0x356c40
movl 0x80(%r9,%rbx), %r14d
leaq 0x1aa3aa(%rip), %rax    # 0x228390
movq (%rax), %rax
testq %rax, %rax
je 0x7e029
addq %rbx, %r9
movl 0x2dbfe1(%rip), %ecx    # 0x359fd8
movl 0x2d8c02(%rip), %r8d    # 0x356c00
movl %edi, (%rsp)
leaq 0x911b7(%rip), %rsi     # 0x10f1bf
movq %rax, %rdi
xorl %eax, %eax
callq 0x9560
movslq 0x2dbfbb(%rip), %rdx    # 0x359fd4
imulq $0x84, %rdx, %rax
movl 0x80(%rax,%rbx), %esi
jmp 0x7e02c
movl %r14d, %esi
imulq $0x84, %rdx, %rax
addq %rax, %rbx
movq %rbx, %rdi
callq 0x64f01
movl 0x2dbf90(%rip), %eax    # 0x359fd4
leal 0x1(%rax), %ecx
xorl %edx, %edx
cmpl $0x63, %eax
cmovll %ecx, %edx
movl %edx, 0x2dbf7f(%rip)    # 0x359fd4
decl 0x2dbf7d(%rip)          # 0x359fd8
leaq 0x18486e(%rip), %rax    # 0x2028d0
movq (%rax), %rax
pushq $0x1
popq %rbx
cmpq $0x1000, %rax           # imm = 0x1000
je 0x7e103
cmpq $0x40000, %rax          # imm = 0x40000
je 0x7e103
cmpl $0x19, %r14d
jne 0x7e103
leaq 0x186f53(%rip), %rax    # 0x204fe0
cmpl $0x50, (%rax)
je 0x7e103
leaq 0x1aa327(%rip), %rax    # 0x2283c0
cmpq $0x0, (%rax)
jne 0x7e0a9
movl $0x4e20, %edi           # imm = 0x4E20
callq 0xae83
callq 0xe7d9
leaq 0x91134(%rip), %rcx     # 0x10f1e9
pushq $0xe
popq %rdx
xorl %edi, %edi
xorl %esi, %esi
callq 0xe2d2
callq 0xaa05
callq 0x519b1
pushq $0xa
popq %rdi
callq 0x1d93f
andl $0x0, 0x2dbef6(%rip)    # 0x359fd0
andl $0x0, 0x2dbef3(%rip)    # 0x359fd4
andl $0x0, 0x2dbef0(%rip)    # 0x359fd8
andl $0x0, 0x2dbeed(%rip)    # 0x359fdc
andl $0x0, 0x2dbeea(%rip)    # 0x359fe0
leaq 0x184747(%rip), %rax    # 0x202844
movl $0xd9f, (%rax)          # imm = 0xD9F
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_sro_m()
void parse_sro_m()
{
int hh;   // efc input
int gg;   // reserved
int ff;   // Rb signal peak voltage
int ee;   // photocell voltage
int dd;   // varactor voltage
int cc;   // heater current
int bb;   // cell current
int aa;   // not used
int i;

   log_packet_id("readings");
   i = sscanf(nmea_msg, "%x %x %x %x %x %x %x %x", &hh,&gg,&ff,&ee,&dd,&cc,&bb,&aa);
   if(i != 8) {  // expected 8 values.  Loss of message sync?
      restart_prs_polling();
      return;
   }

   sro_hh = ((double) hh) / 255.0 * 5.0;
   sro_gg = (double) gg;
   sro_ff = ((double) ff) / 255.0 * 5.0;
   sro_ee = ((double) (255-ee)) / 255.0 * 5.0;
   sro_dd = ((double) dd) / 255.0 * 5.0;
   sro_cc = ((double) (255-cc)) / 255.0 * 100.0;
   sro_bb = ((double) (255-bb)) / 255.0 * 100.0;
   sro_aa = (double) aa;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
leaq 0x8f261(%rip), %rdi     # 0x10d7a5
callq 0x520bf
leaq -0x14(%rbp), %r10
leaq -0x18(%rbp), %r11
leaq -0x1c(%rbp), %rbx
leaq -0x20(%rbp), %r14
leaq 0x2a72d0(%rip), %rdi    # 0x325830
leaq 0x8f226(%rip), %rsi     # 0x10d78d
leaq -0x30(%rbp), %rdx
leaq -0x2c(%rbp), %rcx
leaq -0x28(%rbp), %r8
leaq -0x24(%rbp), %r9
xorl %eax, %eax
pushq %r10
pushq %r11
pushq %rbx
pushq %r14
callq 0x9350
addq $0x20, %rsp
cmpl $0x8, %eax
jne 0x7e671
cvtsi2sdl -0x30(%rbp), %xmm1
movsd 0x8a119(%rip), %xmm0    # 0x1086b8
divsd %xmm0, %xmm1
movsd 0x74b95(%rip), %xmm2    # 0xf3140
mulsd %xmm2, %xmm1
leaq 0x2795b2(%rip), %rax    # 0x2f7b68
movsd %xmm1, (%rax)
cvtsi2sdl -0x2c(%rbp), %xmm1
leaq 0x2795aa(%rip), %rax    # 0x2f7b70
movsd %xmm1, (%rax)
cvtsi2sdl -0x28(%rbp), %xmm1
divsd %xmm0, %xmm1
mulsd %xmm2, %xmm1
leaq 0x27959a(%rip), %rax    # 0x2f7b78
movl $0xff, %ecx
subl -0x24(%rbp), %ecx
movsd %xmm1, (%rax)
cvtsi2sd %ecx, %xmm1
divsd %xmm0, %xmm1
mulsd %xmm2, %xmm1
leaq 0x279583(%rip), %rax    # 0x2f7b80
cvtsi2sdl -0x20(%rbp), %xmm3
movsd %xmm1, (%rax)
divsd %xmm0, %xmm3
mulsd %xmm2, %xmm3
leaq 0x279573(%rip), %rax    # 0x2f7b88
movsd %xmm3, (%rax)
movl $0xff, %eax
subl -0x1c(%rbp), %eax
movl $0xff, %ecx
cvtsi2sd %eax, %xmm1
divsd %xmm0, %xmm1
movsd 0x74a2a(%rip), %xmm2    # 0xf3060
mulsd %xmm2, %xmm1
leaq 0x27954f(%rip), %rax    # 0x2f7b90
movsd %xmm1, (%rax)
subl -0x18(%rbp), %ecx
cvtsi2sd %ecx, %xmm1
divsd %xmm0, %xmm1
mulsd %xmm2, %xmm1
leaq 0x27953d(%rip), %rax    # 0x2f7b98
movsd %xmm1, (%rax)
cvtsi2sdl -0x14(%rbp), %xmm0
leaq 0x279535(%rip), %rax    # 0x2f7ba0
movsd %xmm0, (%rax)
jmp 0x7e676
callq 0x7e67f
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: restart_prs_polling()
void restart_prs_polling()
{
    polled_req = 0;                  // reset message queues, etc
    drain_port(RCVR_PORT);
    polled_q_in = polled_q_out = 0;
    polled_q_entries = 0;
    polled_msg_id = 0;
    scpi_msg_id = 0;
    prs_msg_id = 0;
    x72_msg_id = 0;
    sa35_msg_id = 0;
    sro_msg_id = 0;
    lpfrs_msg_id = 0;
    rcvr_reset = 0;
    tsip_sync = 0;
    tsip_wptr = 0;
    tsip_rptr = 0;
    did_init1 = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
andl $0x0, 0x2db952(%rip)    # 0x359fdc
pushq $0xa
popq %rdi
callq 0x5142f
andl $0x0, 0x2db93b(%rip)    # 0x359fd4
andl $0x0, 0x2db930(%rip)    # 0x359fd0
andl $0x0, 0x2db931(%rip)    # 0x359fd8
andl $0x0, 0x2d8552(%rip)    # 0x356c00
andl $0x0, 0x2d8557(%rip)    # 0x356c0c
andl $0x0, 0x2d854c(%rip)    # 0x356c08
andl $0x0, 0x2d851d(%rip)    # 0x356be0
andl $0x0, 0x2d8546(%rip)    # 0x356c10
andl $0x0, 0x2d8543(%rip)    # 0x356c14
andl $0x0, 0x2d852c(%rip)    # 0x356c04
leaq 0x186949(%rip), %rax    # 0x205028
andl $0x0, (%rax)
leaq 0x2a3b6d(%rip), %rax    # 0x322256
andw $0x0, (%rax)
leaq 0x2a3b5e(%rip), %rax    # 0x322252
andw $0x0, (%rax)
leaq 0x2a3b55(%rip), %rax    # 0x322254
andw $0x0, (%rax)
leaq 0x2a2906(%rip), %rax    # 0x321010
andl $0x0, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_sro_id()
void parse_sro_id()
{
   log_packet_id("id info");
   if(valid_sro_status()) {
      restart_prs_polling();
      return;
   }
   nmea_msg[21] = 0;
   strcpy(sro_id, nmea_msg);
   if(all_polled) have_info |= (VERSION_INFO | PRODN_PARAMS);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8f094(%rip), %rdi     # 0x10d7ae
callq 0x520bf
callq 0x7e4d4
testl %eax, %eax
je 0x7e72e
popq %rbp
jmp 0x7e67f
leaq 0x2a70fb(%rip), %rsi    # 0x325830
movb $0x0, 0x15(%rsi)
leaq 0x2793d0(%rip), %rdi    # 0x2f7b10
callq 0x9330
cmpl $0x0, 0x2d767c(%rip)    # 0x355dc8
je 0x7e758
leaq 0x27921f(%rip), %rax    # 0x2f7974
orb $0x6, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_sro_sn()
void parse_sro_sn()
{
   log_packet_id("serial number");
   if(valid_sro_status()) {
      restart_prs_polling();
      return;
   }
   nmea_msg[18] = 0;
   strcpy(sro_sn, nmea_msg);
   if(all_polled) have_info |= (MANUF_PARAMS | PRODN_PARAMS);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8f051(%rip), %rdi     # 0x10d7b6
callq 0x520bf
callq 0x7e4d4
testl %eax, %eax
je 0x7e779
popq %rbp
jmp 0x7e67f
leaq 0x2a70b0(%rip), %rsi    # 0x325830
movb $0x0, 0x12(%rsi)
leaq 0x2793b5(%rip), %rdi    # 0x2f7b40
callq 0x9330
cmpl $0x0, 0x2d7631(%rip)    # 0x355dc8
je 0x7e7a3
leaq 0x2791d4(%rip), %rax    # 0x2f7974
orb $0x3, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_sro_st()
void parse_sro_st()
{
   log_packet_id("status");
   if(valid_sro_status()) {
      restart_prs_polling();
      return;
   }
   sro_status= atoi(nmea_msg);
   discipline_mode = DIS_MODE_NORMAL;
   if     (sro_status == 0) discipline_mode = DIS_MODE_WARMUP;
   else if(sro_status == 1) discipline_mode = DIS_MODE_LEARNING;
   else if(sro_status == 9) discipline_mode = DIS_MODE_FAILED;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x912b5(%rip), %rdi     # 0x10fa65
callq 0x520bf
callq 0x7e4d4
testl %eax, %eax
je 0x7e7c4
popq %rbp
jmp 0x7e67f
leaq 0x2a7065(%rip), %rdi    # 0x325830
callq 0x95e0
leaq 0x27938d(%rip), %rcx    # 0x2f7b64
movl %eax, (%rcx)
leaq 0x278cb7(%rip), %rcx    # 0x2f7497
movb $0x0, (%rcx)
cmpl $0x9, %eax
je 0x7e7fb
cmpl $0x1, %eax
je 0x7e7f6
testl %eax, %eax
jne 0x7e7fe
movb $0xa, (%rcx)
jmp 0x7e7fe
movb $0x14, (%rcx)
jmp 0x7e7fe
movb $0x19, (%rcx)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_sro_tr()
void parse_sro_tr()
{
   log_packet_id("tr value");
   if(valid_sro_status()) {
      restart_prs_polling();
      return;
   }
   sro_tr = atoi(nmea_msg);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8efb9(%rip), %rdi     # 0x10d7c4
callq 0x520bf
callq 0x7e4d4
testl %eax, %eax
je 0x7e81f
popq %rbp
jmp 0x7e67f
leaq 0x2a700a(%rip), %rdi    # 0x325830
callq 0x95e0
leaq 0x279376(%rip), %rcx    # 0x2f7ba8
movl %eax, (%rcx)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_sro_sy()
void parse_sro_sy()
{
   log_packet_id("sy value");
   if(valid_sro_status()) {
      restart_prs_polling();
      return;
   }
   sro_sy = atoi(nmea_msg);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8ef8c(%rip), %rdi     # 0x10d7cd
callq 0x520bf
callq 0x7e4d4
testl %eax, %eax
je 0x7e855
popq %rbp
jmp 0x7e67f
leaq 0x2a6fd4(%rip), %rdi    # 0x325830
callq 0x95e0
leaq 0x279344(%rip), %rcx    # 0x2f7bac
movl %eax, (%rcx)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_sro_de()
void parse_sro_de()
{
   log_packet_id("de value");
   if(valid_sro_status()) {
      restart_prs_polling();
      return;
   }
   sro_de = atoi(nmea_msg);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8090d(%rip), %rdi     # 0xff184
callq 0x520bf
callq 0x7e4d4
testl %eax, %eax
je 0x7e88b
popq %rbp
jmp 0x7e67f
leaq 0x2a6f9e(%rip), %rdi    # 0x325830
callq 0x95e0
leaq 0x279312(%rip), %rcx    # 0x2f7bb0
movl %eax, (%rcx)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_sro_pw()
void parse_sro_pw()
{
   log_packet_id("pps enable");
   if(valid_sro_status()) {
      restart_prs_polling();
      return;
   }
   sro_pw = atoi(nmea_msg);
   if(sro_pw) pps_enabled = 1;
   else       pps_enabled = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8ef29(%rip), %rdi     # 0x10d7d6
callq 0x520bf
callq 0x7e4d4
testl %eax, %eax
je 0x7e8c1
popq %rbp
jmp 0x7e67f
leaq 0x2a6f68(%rip), %rdi    # 0x325830
callq 0x95e0
leaq 0x2792e0(%rip), %rcx    # 0x2f7bb4
movl %eax, (%rcx)
testl %eax, %eax
je 0x7e8e6
leaq 0x27943f(%rip), %rax    # 0x2f7d20
movb $0x1, (%rax)
jmp 0x7e8f0
leaq 0x279433(%rip), %rax    # 0x2f7d20
movb $0x0, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_sro_fc()
void parse_sro_fc()
{
   log_packet_id("freq control value");
   if(valid_sro_status()) {
      restart_prs_polling();
      return;
   }
   sro_fc = atoi(nmea_msg);
   osc_offset = ((double)sro_fc)*SRO_DDS_STEP*1.0E12/1000.0;
   have_osc_offset = 77;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8eee4(%rip), %rdi     # 0x10d7e1
callq 0x520bf
callq 0x7e4d4
testl %eax, %eax
je 0x7e911
popq %rbp
jmp 0x7e67f
leaq 0x2a6f18(%rip), %rdi    # 0x325830
callq 0x95e0
leaq 0x279294(%rip), %rcx    # 0x2f7bb8
movl %eax, (%rcx)
cvtsi2sd %eax, %xmm0
mulsd 0x7481e(%rip), %xmm0    # 0xf3150
mulsd 0x7481e(%rip), %xmm0    # 0xf3158
divsd 0x746f6(%rip), %xmm0    # 0xf3038
leaq 0x277e77(%rip), %rax    # 0x2f67c0
movsd %xmm0, (%rax)
leaq 0x2788e0(%rip), %rax    # 0x2f7234
movl $0x4d, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_sro_fs()
void parse_sro_fs()
{
   log_packet_id("fs value");
   if(valid_sro_status()) {
      restart_prs_polling();
      return;
   }
   sro_fs = atoi(nmea_msg);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8ee8d(%rip), %rdi     # 0x10d7f4
callq 0x520bf
callq 0x7e4d4
testl %eax, %eax
je 0x7e97b
popq %rbp
jmp 0x7e67f
leaq 0x2a6eae(%rip), %rdi    # 0x325830
callq 0x95e0
leaq 0x27922e(%rip), %rcx    # 0x2f7bbc
movl %eax, (%rcx)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_sro_tw()
void parse_sro_tw()
{
   log_packet_id("tw value");
   if(valid_sro_status()) {
      restart_prs_polling();
      return;
   }
   sro_tw = atoi(nmea_msg);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8ee60(%rip), %rdi     # 0x10d7fd
callq 0x520bf
callq 0x7e4d4
testl %eax, %eax
je 0x7e9b1
popq %rbp
jmp 0x7e67f
leaq 0x2a6e78(%rip), %rdi    # 0x325830
callq 0x95e0
leaq 0x2791fc(%rip), %rcx    # 0x2f7bc0
movl %eax, (%rcx)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_sro_aw()
void parse_sro_aw()
{
   log_packet_id("aw value");
   if(valid_sro_status()) {
      restart_prs_polling();
      return;
   }
   sro_aw = atoi(nmea_msg);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8ee33(%rip), %rdi     # 0x10d806
callq 0x520bf
callq 0x7e4d4
testl %eax, %eax
je 0x7e9e7
popq %rbp
jmp 0x7e67f
leaq 0x2a6e42(%rip), %rdi    # 0x325830
callq 0x95e0
leaq 0x2791ca(%rip), %rcx    # 0x2f7bc4
movl %eax, (%rcx)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_sro_tc()
void parse_sro_tc()
{
   log_packet_id("time constant");
   if(valid_sro_status()) {
      restart_prs_polling();
      return;
   }
   sro_tc = atoi(nmea_msg);
   time_constant = (DATA_SIZE) sro_tc;
   have_osc_params |= PARAM_TC;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8f19e(%rip), %rdi     # 0x10dba7
callq 0x520bf
callq 0x7e4d4
testl %eax, %eax
je 0x7ea1d
popq %rbp
jmp 0x7e67f
leaq 0x2a6e0c(%rip), %rdi    # 0x325830
callq 0x95e0
leaq 0x279198(%rip), %rcx    # 0x2f7bc8
movl %eax, (%rcx)
cvtsi2sd %eax, %xmm0
leaq 0x2786b3(%rip), %rax    # 0x2f70f0
movsd %xmm0, (%rax)
leaq 0x2793b4(%rip), %rax    # 0x2f7dfc
orb $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_sro_co()
void parse_sro_co()
{
   log_packet_id("co value");
   if(valid_sro_status()) {
      restart_prs_polling();
      return;
   }
   sro_co = atoi(nmea_msg);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8edb7(%rip), %rdi     # 0x10d80f
callq 0x520bf
callq 0x7e4d4
testl %eax, %eax
je 0x7ea6c
popq %rbp
jmp 0x7e67f
leaq 0x2a6dbd(%rip), %rdi    # 0x325830
callq 0x95e0
leaq 0x27914d(%rip), %rcx    # 0x2f7bcc
movl %eax, (%rcx)
popq %rbp
retq