LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_ubx_dop()
void parse_ubx_dop()
{
   // get DOP info
   log_packet_id("UBX_DOPPLER");

   tsip_dword();  // tow
   have_dops = 0;
   gdop = ((DATA_SIZE) tsip_word()) / (DATA_SIZE) 100.0;   // pdop
   pdop = ((DATA_SIZE) tsip_word()) / (DATA_SIZE) 100.0;   // pdop
   tdop = ((DATA_SIZE) tsip_word()) / (DATA_SIZE) 100.0;   // tdop
   vdop = ((DATA_SIZE) tsip_word()) / (DATA_SIZE) 100.0;   // tdop
   hdop = ((DATA_SIZE) tsip_word()) / (DATA_SIZE) 100.0;   // tdop
   ndop = ((DATA_SIZE) tsip_word()) / (DATA_SIZE) 100.0;   // tdop
   edop = ((DATA_SIZE) tsip_word()) / (DATA_SIZE) 100.0;   // tdop
   have_dops |= (GDOP | PDOP | TDOP | VDOP | NDOP | EDOP);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xbe03d(%rip), %rdi     # 0x18796c
callq 0x7add0
callq 0x7a680
leaq 0x1b8d84(%rip), %rax    # 0x2826c4
movl $0x0, (%rax)
callq 0x7a560
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
movsd 0xa56f6(%rip), %xmm1    # 0x16f050
movsd %xmm1, -0x8(%rbp)
divsd %xmm1, %xmm0
leaq 0x1b8d76(%rip), %rax    # 0x2826e0
movsd %xmm0, (%rax)
callq 0x7a560
movsd -0x8(%rbp), %xmm1
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
divsd %xmm1, %xmm0
leaq 0x1b8d3e(%rip), %rax    # 0x2826c8
movsd %xmm0, (%rax)
callq 0x7a560
movsd -0x8(%rbp), %xmm1
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
divsd %xmm1, %xmm0
leaq 0x1b8d3e(%rip), %rax    # 0x2826e8
movsd %xmm0, (%rax)
callq 0x7a560
movsd -0x8(%rbp), %xmm1
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
divsd %xmm1, %xmm0
leaq 0x1b8d0e(%rip), %rax    # 0x2826d8
movsd %xmm0, (%rax)
callq 0x7a560
movsd -0x8(%rbp), %xmm1
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
divsd %xmm1, %xmm0
leaq 0x1b8ce6(%rip), %rax    # 0x2826d0
movsd %xmm0, (%rax)
callq 0x7a560
movsd -0x8(%rbp), %xmm1
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
divsd %xmm1, %xmm0
leaq 0x1b8ce6(%rip), %rax    # 0x2826f0
movsd %xmm0, (%rax)
callq 0x7a560
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
movsd 0xa562e(%rip), %xmm1    # 0x16f050
divsd %xmm1, %xmm0
leaq 0x1b8ccb(%rip), %rax    # 0x2826f8
movsd %xmm0, (%rax)
leaq 0x1b8c8c(%rip), %rax    # 0x2826c4
movl (%rax), %ecx
orl $0x7d, %ecx
leaq 0x1b8c80(%rip), %rax    # 0x2826c4
movl %ecx, (%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_ubx_speed()
void parse_ubx_speed()
{
   // get course/speed info
   log_packet_id("UBX_SPEED");

   tsip_dword();  // tow
   tsip_dword();  
   tsip_dword();  
   tsip_dword();  
   speed = ((double) tsip_dword()) / 100.0;  // 3d speed
   tsip_dword();   // 2D speed
   heading = ((double) (S32) tsip_dword()) / 1.0E5;
   if(heading < 0.0) heading += 360.0;
   tsip_dword();  // speed accuracy
   tsip_dword();  // course accu

   have_speed = 15;
   have_heading = 15;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0xbdf1d(%rip), %rdi     # 0x187978
callq 0x7add0
callq 0x7a680
callq 0x7a680
callq 0x7a680
callq 0x7a680
callq 0x7a680
movl %eax, %eax
cvtsi2sd %rax, %xmm0
movsd 0xa55c8(%rip), %xmm1    # 0x16f050
divsd %xmm1, %xmm0
leaq 0x2a276d(%rip), %rax    # 0x36c200
movsd %xmm0, (%rax)
callq 0x7a680
callq 0x7a680
cvtsi2sd %eax, %xmm0
movsd 0xa563b(%rip), %xmm1    # 0x16f0e8
divsd %xmm1, %xmm0
leaq 0x2a2750(%rip), %rax    # 0x36c208
movsd %xmm0, (%rax)
xorps %xmm0, %xmm0
leaq 0x2a2742(%rip), %rax    # 0x36c208
ucomisd (%rax), %xmm0
jbe 0xc9aea
movsd 0xb905c(%rip), %xmm0    # 0x182b30
leaq 0x2a272d(%rip), %rax    # 0x36c208
addsd (%rax), %xmm0
leaq 0x2a2722(%rip), %rax    # 0x36c208
movsd %xmm0, (%rax)
callq 0x7a680
callq 0x7a680
leaq 0x2a2a1d(%rip), %rax    # 0x36c518
movl $0xf, (%rax)
leaq 0x2a2a0c(%rip), %rax    # 0x36c514
movl $0xf, (%rax)
popq %rbp
retq
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_ubx_gps()
void parse_ubx_gps()
{
int i;

   // get gps-utc offset info
   log_packet_id("UBX_GPS-UTC");

   tsip_dword();
   tsip_dword();
   gps_week = tsip_word();
   faked_tow = 0;
   i = (int) (s08) tsip_byte();
   if(!user_set_utc_ofs) utc_offset = i;
   tsip_byte();
   tsip_word();

   check_utc_ofs(3);

   if(have_week == 0) need_redraw = 2016;
   have_week = 2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xbdc0b(%rip), %rdi     # 0x18798a
callq 0x7add0
callq 0x7a680
callq 0x7a680
callq 0x7a560
movw %ax, %cx
leaq 0x2a2b7b(%rip), %rax    # 0x36c918
movw %cx, (%rax)
leaq 0x2a2b81(%rip), %rax    # 0x36c928
movl $0x0, (%rax)
callq 0x7a510
movsbl %al, %eax
movl %eax, -0x4(%rbp)
leaq 0x2a2b55(%rip), %rax    # 0x36c914
cmpl $0x0, (%rax)
jne 0xc9dd0
movl -0x4(%rbp), %ecx
leaq 0x2a2b3a(%rip), %rax    # 0x36c908
movl %ecx, (%rax)
callq 0x7a510
callq 0x7a560
movl $0x3, %edi
callq 0x7a270
leaq 0x2a2721(%rip), %rax    # 0x36c50c
cmpl $0x0, (%rax)
jne 0xc9dfd
leaq 0x1adc2d(%rip), %rax    # 0x277a24
movl $0x7e0, (%rax)          # imm = 0x7E0
leaq 0x2a2708(%rip), %rax    # 0x36c50c
movl $0x2, (%rax)
addq $0x10, %rsp
popq %rbp
retq
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_ubx_leap()
void parse_ubx_leap()
{
int i;
double a0, a1;
int tow;
int wnt;
int ls;
int wnf;
int dn;
int lsf;

   // calculate pending leapsecond info
   log_packet_id("UBX_LEAP");

   tsip_dword();
   a0 = tsip_double();
   a1 = tsip_double();
   tow = tsip_dword();
// pri_tow = this_tow = tow;
// if(have_tow == 0) need_redraw = 2017;
// have_tow = 3;
// survey_tow = tow;

   wnt = tsip_word();
   ls = tsip_word();
   wnf = tsip_word();
   dn = tsip_word();
   lsf = tsip_word();

   minor_alarms &= (~MINOR_LEAP_PEND);
   if(ls != lsf) {
      minor_alarms |= MINOR_LEAP_PEND;
   }
   have_leap_info = 2;
   calc_leap_days((double) wnf, dn, 11);

//sprintf(debug_text2, "ls:%d lsf:%d  dn:%d wnf:%d wnt:%d  ldays:%d", ls,lsf, dn,wnf,wnt, leap_days);

   for(i=34; i<72; i++) tsip_byte();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
leaq 0xbdb77(%rip), %rdi     # 0x187996
callq 0x7add0
callq 0x7a680
callq 0x7a9d0
movsd %xmm0, -0x10(%rbp)
callq 0x7a9d0
movsd %xmm0, -0x18(%rbp)
callq 0x7a680
movl %eax, -0x1c(%rbp)
callq 0x7a560
movzwl %ax, %eax
movl %eax, -0x20(%rbp)
callq 0x7a560
movzwl %ax, %eax
movl %eax, -0x24(%rbp)
callq 0x7a560
movzwl %ax, %eax
movl %eax, -0x28(%rbp)
callq 0x7a560
movzwl %ax, %eax
movl %eax, -0x2c(%rbp)
callq 0x7a560
movzwl %ax, %eax
movl %eax, -0x30(%rbp)
leaq 0x2a2535(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
andl $0xffffff7f, %ecx       # imm = 0xFFFFFF7F
leaq 0x2a2526(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
movl -0x24(%rbp), %eax
cmpl -0x30(%rbp), %eax
je 0xc9eb4
leaq 0x2a2515(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
orl $0x80, %ecx
leaq 0x2a2506(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
leaq 0x2a25bd(%rip), %rax    # 0x36c478
movl $0x2, (%rax)
cvtsi2sdl -0x28(%rbp), %xmm0
movl -0x2c(%rbp), %eax
movl $0xb, %esi
movzwl %ax, %edi
callq 0x80110
movl $0x22, -0x4(%rbp)
cmpl $0x48, -0x4(%rbp)
jge 0xc9ef3
callq 0x7a510
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xc9edd
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_ubx_mon()
void parse_ubx_mon()
{
int i;
u08 ant;
u08 ant_pwr;

   // used to get antenna power monitor info
   log_packet_id("UBX_MON");

   for(i=0; i<20; i++) tsip_byte();
   ant = tsip_byte();
   ant_pwr = tsip_byte();
   for(i=22; i<=59; i++) tsip_byte(); 

   minor_alarms &= (~MINOR_ANT_NO_PWR);
   if     (ant == 2);                             // ok
   else if(ant == 3)     minor_alarms |= MINOR_ANT_SHORT;  // short
   else if(ant == 4)     minor_alarms |= MINOR_ANT_OPEN;   // open
   else if(ant_pwr == 0) minor_alarms |= MINOR_ANT_NO_PWR; // no power
   have_antenna = 1;
//sprintf(plot_title, "ant state:%02X  pwr:%02X", ant, ant_pwr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xbd044(%rip), %rdi     # 0x187a43
callq 0x7add0
movl $0x0, -0x4(%rbp)
cmpl $0x14, -0x4(%rbp)
jge 0xcaa21
callq 0x7a510
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xcaa0b
callq 0x7a510
movb %al, -0x5(%rbp)
callq 0x7a510
movb %al, -0x6(%rbp)
movl $0x16, -0x4(%rbp)
cmpl $0x3b, -0x4(%rbp)
jg 0xcaa4e
callq 0x7a510
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xcaa38
leaq 0x2a1963(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
andl $-0x7, %ecx
leaq 0x2a1957(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
movzbl -0x5(%rbp), %eax
cmpl $0x2, %eax
jne 0xcaa6e
jmp 0xcaad2
movzbl -0x5(%rbp), %eax
cmpl $0x3, %eax
jne 0xcaa8e
leaq 0x2a193a(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
orl $0x4, %ecx
leaq 0x2a192e(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
jmp 0xcaad0
movzbl -0x5(%rbp), %eax
cmpl $0x4, %eax
jne 0xcaaae
leaq 0x2a191a(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
orl $0x2, %ecx
leaq 0x2a190e(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
jmp 0xcaace
movzbl -0x6(%rbp), %eax
cmpl $0x0, %eax
jne 0xcaacc
leaq 0x2a18fa(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
orl $0x6, %ecx
leaq 0x2a18ee(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
jmp 0xcaace
jmp 0xcaad0
jmp 0xcaad2
leaq 0x2a1933(%rip), %rax    # 0x36c40c
movl $0x1, (%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_ubx_tmode(int)
void parse_ubx_tmode(int tmode)
{
u32 mode;
u32 slen;

   // also UBX_TMODE2 for M8T
   log_packet_id("UBX_TMODE");

   saw_timing_msg |= 0x02;
   have_ubx_tmode = tmode;

   mode = tsip_dword();
   tsip_dword();
   tsip_dword();
   tsip_dword();
   tsip_dword();   // fixed posn variance
   slen = tsip_dword();   // min survey time
   tsip_dword();   // survey stop required variance (mm^2)

   if(mode == 1) {
      minor_alarms |= MINOR_SURVEY;
      do_survey = (long) slen;
      survey_why = 10;
   }
   else {
      minor_alarms &= (~MINOR_SURVEY);
      if(precision_survey == 0) {
         do_survey = 0;
         survey_why = (-10);
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
leaq 0xbcf21(%rip), %rdi     # 0x187a53
callq 0x7add0
leaq 0x2a1aca(%rip), %rax    # 0x36c608
movl (%rax), %ecx
orl $0x2, %ecx
leaq 0x2a1abe(%rip), %rax    # 0x36c608
movl %ecx, (%rax)
movl -0x4(%rbp), %ecx
leaq 0x2a1a3e(%rip), %rax    # 0x36c594
movl %ecx, (%rax)
callq 0x7a680
movl %eax, -0x8(%rbp)
callq 0x7a680
callq 0x7a680
callq 0x7a680
callq 0x7a680
callq 0x7a680
movl %eax, -0xc(%rbp)
callq 0x7a680
cmpl $0x1, -0x8(%rbp)
jne 0xcabba
leaq 0x2a182a(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
orl $0x20, %ecx
leaq 0x2a181e(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
movl -0xc(%rbp), %eax
movl %eax, %ecx
leaq 0x2a24b0(%rip), %rax    # 0x36d058
movq %rcx, (%rax)
leaq 0x2a24b6(%rip), %rax    # 0x36d068
movl $0xa, (%rax)
jmp 0xcabfb
leaq 0x2a17f7(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
andl $-0x21, %ecx
leaq 0x2a17eb(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
leaq 0x2a24a2(%rip), %rax    # 0x36d078
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0xcabf9
leaq 0x2a2473(%rip), %rax    # 0x36d058
movq $0x0, (%rax)
leaq 0x2a2475(%rip), %rax    # 0x36d068
movl $0xfffffff6, (%rax)     # imm = 0xFFFFFFF6
jmp 0xcabfb
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_ubx_svin()
void parse_ubx_svin()
{
u32 dur;        // current duration of survey
double ecef_x;
double ecef_y;
double ecef_z;
u32 obs;        // number of observations used
u08 valid;
u08 active;
u32 rsvd;

   log_packet_id("UBX_SVIN");
   saw_timing_msg |= 0x01;

   dur = tsip_dword();  // dur
   ecef_x = (double) (S32) tsip_dword();
   ecef_y = (double) (S32) tsip_dword();
   ecef_z = (double) (S32) tsip_dword();
   ubx_svar = tsip_dword();  // var
   obs = tsip_dword();   // observation count
   valid = tsip_byte();
   active = tsip_byte(); 
   rsvd  = tsip_word();

   if(do_survey) survey_progress = (int) ((100 * dur) / do_survey);  // !!!! use obs instead of dur?
   else          survey_progress = 0;
   have_progress = 3;
//sprintf(plot_title, "obs:%d  dur:%d  svar:%d  progress:%d  act:%d  valid:%d", 
//obs,dur,ubx_svar,survey_progress, active,valid);  // zorky
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
leaq 0xbcd80(%rip), %rdi     # 0x18799f
callq 0x7add0
leaq 0x2a19dd(%rip), %rax    # 0x36c608
movl (%rax), %ecx
orl $0x1, %ecx
leaq 0x2a19d1(%rip), %rax    # 0x36c608
movl %ecx, (%rax)
callq 0x7a680
movl %eax, -0x4(%rbp)
callq 0x7a680
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x10(%rbp)
callq 0x7a680
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x18(%rbp)
callq 0x7a680
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x20(%rbp)
callq 0x7a680
movl %eax, 0x30101a(%rip)    # 0x3cbc90
callq 0x7a680
movl %eax, -0x24(%rbp)
callq 0x7a510
movb %al, -0x25(%rbp)
callq 0x7a510
movb %al, -0x26(%rbp)
callq 0x7a560
movzwl %ax, %eax
movl %eax, -0x2c(%rbp)
leaq 0x2a23b8(%rip), %rax    # 0x36d058
cmpq $0x0, (%rax)
je 0xcacc5
imull $0x64, -0x4(%rbp), %eax
movl %eax, %eax
leaq 0x2a23a5(%rip), %rcx    # 0x36d058
cqto
idivq (%rcx)
movl %eax, %ecx
leaq 0x2a23ab(%rip), %rax    # 0x36d06c
movl %ecx, (%rax)
jmp 0xcacd2
leaq 0x2a23a0(%rip), %rax    # 0x36d06c
movl $0x0, (%rax)
leaq 0x2a2397(%rip), %rax    # 0x36d070
movl $0x3, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_ubx_navx5()
void parse_ubx_navx5()
{
   log_packet_id("UBX_NAVX5");
   have_amu = 1;

   tsip_word();      // msg version
   tsip_word(); // update amu mask 
   tsip_dword();
   tsip_byte();      // rsvd
   tsip_byte();      // rsvd
   tsip_byte();      // min sv's
   tsip_byte();      // max sv'ss
   amu_mask = (float) tsip_byte();
   tsip_byte();      // rsvd
   tsip_byte();      // initial fix
   tsip_byte();      // rsvd
   tsip_byte();      // rsvd
   tsip_byte();      // rsvd
   tsip_word();      // rollover week
   tsip_dword();     // rsvd
   tsip_dword();     // rsvd
   tsip_dword();     // rsvd
   tsip_dword();     // rsvd
   tsip_dword();     // rsvd
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0xbcd62(%rip), %rdi     # 0x187a5d
callq 0x7add0
leaq 0x2a18d1(%rip), %rax    # 0x36c5d8
movl $0x1, (%rax)
callq 0x7a560
callq 0x7a560
callq 0x7a680
callq 0x7a510
callq 0x7a510
callq 0x7a510
callq 0x7a510
callq 0x7a510
movzbl %al, %eax
cvtsi2ss %eax, %xmm0
leaq 0x2a1555(%rip), %rax    # 0x36c298
movss %xmm0, (%rax)
callq 0x7a510
callq 0x7a510
callq 0x7a510
callq 0x7a510
callq 0x7a510
callq 0x7a560
callq 0x7a680
callq 0x7a680
callq 0x7a680
callq 0x7a680
callq 0x7a680
popq %rbp
retq
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_ubx_cfg()
void parse_ubx_cfg()
{
int fix;  // 1=2D  2=3D  3=2D/3D
int el;
int i;

   log_packet_id("UBX_CFG");

   tsip_word();
   tsip_byte();
   fix = tsip_byte();
   for(i=4; i<12; i++) tsip_byte();
   el = tsip_byte();
   // ignore bytes 13..35

   el_mask = (float) el;
   have_el_mask = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xbcaea(%rip), %rdi     # 0x187a79
callq 0x7add0
callq 0x7a560
callq 0x7a510
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x4(%rbp)
movl $0x4, -0xc(%rbp)
cmpl $0xc, -0xc(%rbp)
jge 0xcafc6
callq 0x7a510
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xcafb0
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x8(%rbp)
cvtsi2ssl -0x8(%rbp), %xmm0
leaq 0x2a12b7(%rip), %rax    # 0x36c294
movss %xmm0, (%rax)
leaq 0x2a15f4(%rip), %rax    # 0x36c5dc
movl $0x1, (%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: set_cs_freq(int, double)
void set_cs_freq(int chan, double freq)
{
   if(read_only) return;

   if(rcvr_type == CS_RCVR) {
      if(chan == 1) {
         set_cs_remote(1);
         sprintf(out, ":ROSC:FREQ%d %g", chan, freq);
         queue_cs_cmd(out, CS_FREQ1_MSG);
         restore_cs_remote();

         sprintf(out, ":ROSC:FREQ%d?", chan);
         queue_cs_cmd(out, CS_FREQ1_MSG);
      }
      else if(chan == 2) {
         set_cs_remote(1);
         sprintf(out, ":ROSC:FREQ%d %g", chan, freq);
         queue_cs_cmd(out, CS_FREQ2_MSG);
         restore_cs_remote();

         sprintf(out, ":ROSC:FREQ%d?", chan);
         queue_cs_cmd(out, CS_FREQ2_MSG);
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movsd %xmm0, -0x10(%rbp)
leaq 0x2ca7e3(%rip), %rax    # 0x3961fa
cmpb $0x0, (%rax)
je 0xcba21
jmp 0xcbb13
leaq 0x1ac088(%rip), %rax    # 0x277ab0
cmpq $0x20000, (%rax)        # imm = 0x20000
jne 0xcbb13
cmpl $0x1, -0x4(%rbp)
jne 0xcbaa3
movl $0x1, %edi
callq 0x89280
movl -0x4(%rbp), %edx
movsd -0x10(%rbp), %xmm0
leaq 0x2cf9ac(%rip), %rdi    # 0x39b400
leaq 0xbd299(%rip), %rsi     # 0x188cf4
movb $0x1, %al
callq 0x9060
leaq 0x2cf997(%rip), %rdi    # 0x39b400
movl $0x13f, %esi            # imm = 0x13F
callq 0x82fd0
callq 0x89260
movl -0x4(%rbp), %edx
leaq 0x2cf97e(%rip), %rdi    # 0x39b400
leaq 0xbd27b(%rip), %rsi     # 0x188d04
movb $0x0, %al
callq 0x9060
leaq 0x2cf969(%rip), %rdi    # 0x39b400
movl $0x13f, %esi            # imm = 0x13F
callq 0x82fd0
jmp 0xcbb11
cmpl $0x2, -0x4(%rbp)
jne 0xcbb0f
movl $0x1, %edi
callq 0x89280
movl -0x4(%rbp), %edx
movsd -0x10(%rbp), %xmm0
leaq 0x2cf93e(%rip), %rdi    # 0x39b400
leaq 0xbd22b(%rip), %rsi     # 0x188cf4
movb $0x1, %al
callq 0x9060
leaq 0x2cf929(%rip), %rdi    # 0x39b400
movl $0x140, %esi            # imm = 0x140
callq 0x82fd0
callq 0x89260
movl -0x4(%rbp), %edx
leaq 0x2cf910(%rip), %rdi    # 0x39b400
leaq 0xbd20d(%rip), %rsi     # 0x188d04
movb $0x0, %al
callq 0x9060
leaq 0x2cf8fb(%rip), %rdi    # 0x39b400
movl $0x140, %esi            # imm = 0x140
callq 0x82fd0
jmp 0xcbb11
jmp 0xcbb13
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_ubx_tp()
void parse_ubx_tp()
{
u32 tow;
u32 subms;
S32 quant;
u16 week;
u08 flags;
u08 rsvd;

   log_packet_id("UBX_TP");

   tow = tsip_dword();
   subms = tsip_dword();
   quant = (S32) tsip_dword();
   week = tsip_word();
   flags = tsip_byte();
   rsvd = tsip_byte();

   have_sawtooth = 1;
   dac_voltage = ((float) quant) / 1000.0F;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xbbfa7(%rip), %rdi     # 0x187ad6
callq 0x7add0
callq 0x7a680
movl %eax, -0x4(%rbp)
callq 0x7a680
movl %eax, -0x8(%rbp)
callq 0x7a680
movl %eax, -0xc(%rbp)
callq 0x7a560
movw %ax, -0xe(%rbp)
callq 0x7a510
movb %al, -0xf(%rbp)
callq 0x7a510
movb %al, -0x10(%rbp)
leaq 0x2a0a38(%rip), %rax    # 0x36c5a4
movl $0x1, (%rax)
cvtsi2ssl -0xc(%rbp), %xmm0
movss 0xb7789(%rip), %xmm1    # 0x183308
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x2a0052(%rip), %rax    # 0x36bbe0
movsd %xmm0, (%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_ubx_rate()
void parse_ubx_rate()
{
int rate;

   log_packet_id("UBX_RATE");

   rate = tsip_word();
   tsip_word();
   tsip_word();

   if(rate > 0) {
      if(!pause_data) {
         nav_rate = 1000.0F / (float) rate;
         have_nav_rate = 1;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xbbf2e(%rip), %rdi     # 0x187add
callq 0x7add0
callq 0x7a560
movzwl %ax, %eax
movl %eax, -0x4(%rbp)
callq 0x7a560
callq 0x7a560
cmpl $0x0, -0x4(%rbp)
jle 0xcbc0a
leaq 0x1ae83e(%rip), %rax    # 0x27a414
cmpb $0x0, (%rax)
jne 0xcbc08
cvtsi2ssl -0x4(%rbp), %xmm1
movss 0xb7720(%rip), %xmm0    # 0x183308
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x1ae941(%rip), %rax    # 0x27a538
movsd %xmm0, (%rax)
leaq 0x2a08aa(%rip), %rax    # 0x36c4ac
movl $0x1, (%rax)
jmp 0xcbc0a
addq $0x10, %rsp
popq %rbp
retq
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_sirf_sw_ver()
void parse_sirf_sw_ver()
{
int i;
int len;

   log_packet_id("sirf_sw_ver");

   sirf_sw_id[0] = 0;
   if(sirf_msg_len > 80) len = 80-2;
   else len = sirf_msg_len-2;

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

   have_info |= ALL_ID_INFO;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xbb3d5(%rip), %rdi     # 0x187b54
callq 0x7add0
leaq 0x2d03d5(%rip), %rax    # 0x39cb60
movb $0x0, (%rax)
cmpl $0x50, 0x2ff547(%rip)   # 0x3cbcdc
jbe 0xcc7a0
movl $0x4e, -0x8(%rbp)
jmp 0xcc7ac
movl 0x2ff536(%rip), %eax    # 0x3cbcdc
subl $0x2, %eax
movl %eax, -0x8(%rbp)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0xcc7ef
callq 0x7a510
movb %al, %dl
movslq -0x4(%rbp), %rcx
leaq 0x2d0393(%rip), %rax    # 0x39cb60
movb %dl, (%rax,%rcx)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x2d0380(%rip), %rax    # 0x39cb60
movb $0x0, (%rax,%rcx)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xcc7b3
leaq 0x2a035e(%rip), %rax    # 0x36cb54
movl (%rax), %ecx
orl $0xf, %ecx
leaq 0x2a0352(%rip), %rax    # 0x36cb54
movl %ecx, (%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_sirf_pps()
void parse_sirf_pps()
{
double utc_frac;
u08 status;
int i;

   // WARNING: not all receivers output this message
   log_packet_id("sirf_pps");

   have_sirf_pps = 1;

   tsip_byte();  // hh
   tsip_byte();  // mm
   tsip_byte();  // ss
   tsip_byte();  // day
   tsip_byte();  // month
   tsip_word();  // year
   i = (int) (s16) tsip_word();  // utc offset
   utc_frac = ((double) (S32) tsip_dword()) * 1.0E-9;
   status = tsip_byte();  // bit0:valid time  bit1:utc time  bit2:utc offset info valid

   if(!user_set_utc_ofs) {
      if(status & 0x04) {    // UTC offset valid
         utc_offset = i;
         check_utc_ofs(5);
      }
   }

   if(status & 0x01) {  // time is valid
   }

   if(status & 0x02) {  // UTC time 
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xbaade(%rip), %rdi     # 0x187b7d
callq 0x7add0
leaq 0x29f459(%rip), %rax    # 0x36c504
movl $0x1, (%rax)
callq 0x7a510
callq 0x7a510
callq 0x7a510
callq 0x7a510
callq 0x7a510
callq 0x7a560
callq 0x7a560
cwtl
movl %eax, -0x10(%rbp)
callq 0x7a680
cvtsi2sd %eax, %xmm0
movsd 0xa207f(%rip), %xmm1    # 0x16f168
mulsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rbp)
callq 0x7a510
movb %al, -0x9(%rbp)
leaq 0x29f813(%rip), %rax    # 0x36c914
cmpl $0x0, (%rax)
jne 0xcd12a
movzbl -0x9(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0xcd128
movl -0x10(%rbp), %ecx
leaq 0x29f7ec(%rip), %rax    # 0x36c908
movl %ecx, (%rax)
movl $0x5, %edi
callq 0x7a270
jmp 0xcd12a
movzbl -0x9(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xcd138
jmp 0xcd138
movzbl -0x9(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0xcd146
jmp 0xcd146
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_sirf_clock()
void parse_sirf_clock()
{
u32 drift;
u32 bias;
u32 time;

   log_packet_id("sirf_clock");

   tsip_word();  // gps week
   tsip_dword(); // tow
   tsip_byte();  // sats
   drift = tsip_dword(); // clock drift in Hz
   bias = tsip_dword();  // clock bias in nanosecs
   time = tsip_dword();  // GPS time in msecs

   have_pps_offset = 20;
   have_rcvr_pps = 20;
   if(drift) {
      pps_offset = 1.0 / (double) drift;  // convert Hz to nanoseconds
//adadad      if(jitter_adev == 0) do_pps_adev(pps_offset);
   }
   else pps_offset = 0.0;
   pps_offset *= 1.0E9;

   osc_offset = ((double) bias) / 1.0E6;
   have_osc_offset = 20;
   have_rcvr_osc = 20;
//adadad   if(jitter_adev == 0) do_osc_adev(osc_offset);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xbaa27(%rip), %rdi     # 0x187b86
callq 0x7add0
callq 0x7a560
callq 0x7a680
callq 0x7a510
callq 0x7a680
movl %eax, -0x4(%rbp)
callq 0x7a680
movl %eax, -0x8(%rbp)
callq 0x7a680
movl %eax, -0xc(%rbp)
leaq 0x29f286(%rip), %rax    # 0x36c418
movl $0x14, (%rax)
leaq 0x29f285(%rip), %rax    # 0x36c424
movl $0x14, (%rax)
cmpl $0x0, -0x4(%rbp)
je 0xcd1cc
movl -0x4(%rbp), %eax
cvtsi2sd %rax, %xmm1
movsd 0xa1ead(%rip), %xmm0    # 0x16f068
divsd %xmm1, %xmm0
leaq 0x29e7d2(%rip), %rax    # 0x36b998
movsd %xmm0, (%rax)
jmp 0xcd1da
leaq 0x29e7c5(%rip), %rax    # 0x36b998
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
leaq 0x29e7b7(%rip), %rax    # 0x36b998
movsd (%rax), %xmm0
movsd 0xa1e3b(%rip), %xmm1    # 0x16f028
mulsd %xmm1, %xmm0
movsd %xmm0, (%rax)
movl -0x8(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd 0xa1e3b(%rip), %xmm1    # 0x16f040
divsd %xmm1, %xmm0
leaq 0x29e790(%rip), %rax    # 0x36b9a0
movsd %xmm0, (%rax)
leaq 0x29f1f9(%rip), %rax    # 0x36c414
movl $0x14, (%rax)
leaq 0x29f200(%rip), %rax    # 0x36c428
movl $0x14, (%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_sirf_nav_params()
void parse_sirf_nav_params()
{
int sub_id;
u08 tsm;
u08 snm;

   log_packet_id("sirf_nav_params");

   sub_id = tsip_byte();

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

   tsip_byte();  // alt hold mode
   tsip_byte();  // alt hold source
   tsip_word();  // alt source input

   tsip_byte();  // degraded mode
   tsip_byte();  // degraded timeout
   tsip_byte();  // DR timeout
   tsm = tsip_byte();  // track smooth mode
   snm = tsip_byte();  // static navigation
   tsip_byte();  // 3SV least squares
   tsip_dword(); // rsvd
   tsip_byte();  // DOP mask mode

   el_mask = ((float) (s16) tsip_word()) / 10.0F;
   have_el_mask = 1;

   amu_mask = (float) tsip_byte();  // power mask
   have_amu = 1;

   tsip_dword(); // rsvd
   // ... gggg lots more info follows

//sprintf(debug_text2, "tsm:%02X  snm:%02X", tsm,snm);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xba942(%rip), %rdi     # 0x187b91
callq 0x7add0
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x4(%rbp)
callq 0x7a510
callq 0x7a510
callq 0x7a510
callq 0x7a510
callq 0x7a510
callq 0x7a560
callq 0x7a510
callq 0x7a510
callq 0x7a510
callq 0x7a510
movb %al, -0x5(%rbp)
callq 0x7a510
movb %al, -0x6(%rbp)
callq 0x7a510
callq 0x7a680
callq 0x7a510
callq 0x7a560
cwtl
cvtsi2ss %eax, %xmm0
movss 0xb6063(%rip), %xmm1    # 0x183320
divss %xmm1, %xmm0
leaq 0x29efcc(%rip), %rax    # 0x36c294
movss %xmm0, (%rax)
leaq 0x29f309(%rip), %rax    # 0x36c5dc
movl $0x1, (%rax)
callq 0x7a510
movzbl %al, %eax
cvtsi2ss %eax, %xmm0
leaq 0x29efac(%rip), %rax    # 0x36c298
movss %xmm0, (%rax)
leaq 0x29f2e1(%rip), %rax    # 0x36c5d8
movl $0x1, (%rax)
callq 0x7a680
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: decode_sirf_msg()
void decode_sirf_msg()
{
u08 id;

   // process the received Sirf message
   start_msg_decode(1);

   id = tsip_byte();
// if(debug_file) fprintf(debug_file, "decode sirf:%02X (%d)  len:%d\n", id,id, sirf_msg_len);

   if     (id == SIRF_TRACK_MSG)      parse_sirf_track();
   else if(id == SIRF_SW_VER_MSG)     parse_sirf_sw_ver();
   else if(id == SIRF_CLOCK_MSG)      parse_sirf_clock();
   else if(id == SIRF_VIS_MSG)        parse_sirf_vis();
   else if(id == SIRF_NAV_PARAM_MSG)  parse_sirf_nav_params();
   else if(id == SIRF_NAV_MSG)        parse_sirf_nav();
   else if(id == SIRF_PPS_MSG)        parse_sirf_pps();
   else if(id == SIRF_ACK_MSG)        parse_sirf_ack();
   else if(id == SIRF_NAK_MSG)        parse_sirf_nak();
   else if(id == SIRF_NAV2_MSG)       parse_sirf_nav2();
   else if(id == SIRF_DGPS_MSG)       parse_sirf_dgps();
   else if(id == SIRF_THROUGHPUT_MSG) parse_sirf_throughput();
   else                               parse_sirf_unkn(id);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x1, %edi
callq 0xae4a0
callq 0x7a510
movb %al, -0x1(%rbp)
movzbl -0x1(%rbp), %eax
cmpl $0x4, %eax
jne 0xcd41d
callq 0xcc810
jmp 0xcd4f8
movzbl -0x1(%rbp), %eax
cmpl $0x6, %eax
jne 0xcd430
callq 0xcc770
jmp 0xcd4f6
movzbl -0x1(%rbp), %eax
cmpl $0x7, %eax
jne 0xcd443
callq 0xcd150
jmp 0xcd4f4
movzbl -0x1(%rbp), %eax
cmpl $0xd, %eax
jne 0xcd456
callq 0xccbc0
jmp 0xcd4f2
movzbl -0x1(%rbp), %eax
cmpl $0x13, %eax
jne 0xcd469
callq 0xcd240
jmp 0xcd4f0
movzbl -0x1(%rbp), %eax
cmpl $0x29, %eax
jne 0xcd479
callq 0xccbe0
jmp 0xcd4ee
movzbl -0x1(%rbp), %eax
cmpl $0x34, %eax
jne 0xcd489
callq 0xcd090
jmp 0xcd4ec
movzbl -0x1(%rbp), %eax
cmpl $0xb, %eax
jne 0xcd499
callq 0xcd310
jmp 0xcd4ea
movzbl -0x1(%rbp), %eax
cmpl $0xc, %eax
jne 0xcd4a9
callq 0xcd330
jmp 0xcd4e8
movzbl -0x1(%rbp), %eax
cmpl $0x2, %eax
jne 0xcd4b9
callq 0xcd350
jmp 0xcd4e6
movzbl -0x1(%rbp), %eax
cmpl $0x1b, %eax
jne 0xcd4c9
callq 0xcd370
jmp 0xcd4e4
movzbl -0x1(%rbp), %eax
cmpl $0x9, %eax
jne 0xcd4d9
callq 0xcd390
jmp 0xcd4e2
movzbl -0x1(%rbp), %edi
callq 0xcd3b0
jmp 0xcd4e4
jmp 0xcd4e6
jmp 0xcd4e8
jmp 0xcd4ea
jmp 0xcd4ec
jmp 0xcd4ee
jmp 0xcd4f0
jmp 0xcd4f2
jmp 0xcd4f4
jmp 0xcd4f6
jmp 0xcd4f8
leaq 0x1d00a1(%rip), %rax    # 0x29d5a0
cmpq $0x0, (%rax)
je 0xcd523
leaq 0x1b52d4(%rip), %rax    # 0x2827e0
cmpq $0x0, (%rax)
je 0xcd523
leaq 0x1b52c7(%rip), %rax    # 0x2827e0
movq (%rax), %rax
movl %eax, %edi
callq 0xb8b0
leaq 0x1d0c56(%rip), %rax    # 0x29e180
movl $0x1, (%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_venus_masks()
void parse_venus_masks()
{
u08 flags;
u08 el;
u08 cnr;

   log_packet_id("venus_masks");
   flags = tsip_byte();
   el = tsip_byte();
   cnr = tsip_byte();

   if((flags == 1) || (flags == 2)) {
      el_mask = (float) el;
      have_el_mask = 1;
   }

   if((flags == 1) || (flags == 3)) {
      amu_mask = (float) cnr;
      have_amu = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xb9ead(%rip), %rdi     # 0x187c1c
callq 0x7add0
callq 0x7a510
movb %al, -0x1(%rbp)
callq 0x7a510
movb %al, -0x2(%rbp)
callq 0x7a510
movb %al, -0x3(%rbp)
movzbl -0x1(%rbp), %eax
cmpl $0x1, %eax
je 0xcdd9e
movzbl -0x1(%rbp), %eax
cmpl $0x2, %eax
jne 0xcddbe
movzbl -0x2(%rbp), %eax
cvtsi2ss %eax, %xmm0
leaq 0x29e4e7(%rip), %rax    # 0x36c294
movss %xmm0, (%rax)
leaq 0x29e824(%rip), %rax    # 0x36c5dc
movl $0x1, (%rax)
movzbl -0x1(%rbp), %eax
cmpl $0x1, %eax
je 0xcddd0
movzbl -0x1(%rbp), %eax
cmpl $0x3, %eax
jne 0xcddf0
movzbl -0x3(%rbp), %eax
cvtsi2ss %eax, %xmm0
leaq 0x29e4b9(%rip), %rax    # 0x36c298
movss %xmm0, (%rax)
leaq 0x29e7ee(%rip), %rax    # 0x36c5d8
movl $0x1, (%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_venus_cable()
void parse_venus_cable()
{
   log_packet_id("venus_cable");
   cable_delay = (float) (S32) tsip_dword();
   cable_delay *= 1.0E-11;

// if(have_cable_delay == 0) need_redraw = 2031;
   have_cable_delay = 1;

   show_cable_delay();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0xb9e1d(%rip), %rdi     # 0x187c28
callq 0x7add0
callq 0x7a680
cvtsi2ss %eax, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x29f184(%rip), %rax    # 0x36cfa8
movsd %xmm0, (%rax)
movsd 0xb5200(%rip), %xmm0    # 0x183030
leaq 0x29f171(%rip), %rax    # 0x36cfa8
mulsd (%rax), %xmm0
leaq 0x29f166(%rip), %rax    # 0x36cfa8
movsd %xmm0, (%rax)
leaq 0x29e647(%rip), %rax    # 0x36c494
movl $0x1, (%rax)
callq 0xa0f60
popq %rbp
retq
nopw (%rax,%rax)
// File: 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
subq $0x10, %rsp
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x4(%rbp)
cmpl $0x80, -0x4(%rbp)
jne 0xce1d8
leaq 0xb9ab9(%rip), %rdi     # 0x187c6c
callq 0x7add0
callq 0x7a510
movzbl %al, %ecx
leaq 0x2cee15(%rip), %rax    # 0x39cfdc
movl %ecx, (%rax)
leaq 0x2cee10(%rip), %rax    # 0x39cfe0
movl $0x1, (%rax)
jmp 0xce1e4
leaq 0xb9a97(%rip), %rdi     # 0x187c76
callq 0x7add0
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: 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
subq $0x10, %rsp
callq 0x7a510
movb %al, -0x1(%rbp)
callq 0x7a510
movb %al, -0x2(%rbp)
movzbl -0x1(%rbp), %eax
cmpl $0x80, %eax
jne 0xce281
leaq 0xb9a74(%rip), %rdi     # 0x187c8e
callq 0x7add0
cmpb $0x0, -0x2(%rbp)
je 0xce23f
leaq 0x101c28(%rip), %rax    # 0x1cfe54
movl (%rax), %ecx
orl $0x8000, %ecx           # imm = 0x8000
leaq 0x101c19(%rip), %rax    # 0x1cfe54
movl %ecx, (%rax)
jmp 0xce257
leaq 0x101c0e(%rip), %rax    # 0x1cfe54
movl (%rax), %ecx
andl $0xffff7fff, %ecx       # imm = 0xFFFF7FFF
leaq 0x101bff(%rip), %rax    # 0x1cfe54
movl %ecx, (%rax)
callq 0x7a510
movb %al, -0x4(%rbp)
callq 0x7a510
movb %al, -0x5(%rbp)
callq 0x7a510
movb %al, -0x6(%rbp)
callq 0x7a510
movb %al, -0x7(%rbp)
callq 0x7a510
movb %al, -0x8(%rbp)
jmp 0xce2e8
movzbl -0x1(%rbp), %eax
cmpl $0x81, %eax
jne 0xce2da
leaq 0xb9a0d(%rip), %rdi     # 0x187ca0
callq 0x7add0
cmpb $0x0, -0x2(%rbp)
je 0xce2b8
leaq 0x101baf(%rip), %rax    # 0x1cfe54
movl (%rax), %ecx
orl $0x4000, %ecx           # imm = 0x4000
leaq 0x101ba0(%rip), %rax    # 0x1cfe54
movl %ecx, (%rax)
jmp 0xce2d0
leaq 0x101b95(%rip), %rax    # 0x1cfe54
movl (%rax), %ecx
andl $0xffffbfff, %ecx       # imm = 0xFFFFBFFF
leaq 0x101b86(%rip), %rax    # 0x1cfe54
movl %ecx, (%rax)
callq 0x7a510
movb %al, -0x3(%rbp)
jmp 0xce2e6
leaq 0xb99d1(%rip), %rdi     # 0x187cb2
callq 0x7add0
jmp 0xce2e8
addq $0x10, %rsp
popq %rbp
retq
nop
// File: 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
subq $0x10, %rsp
leaq 0xb9899(%rip), %rdi     # 0x187d38
callq 0x7add0
callq 0x7a510
movb %al, -0x1(%rbp)
callq 0x7a680
movl %eax, -0x8(%rbp)
callq 0x7a680
movl %eax, -0xc(%rbp)
callq 0x7a680
movl %eax, -0x10(%rbp)
movl -0x8(%rbp), %edx
shrl $0x10, %edx
movl -0x8(%rbp), %ecx
shrl $0x8, %ecx
andl $0xff, %ecx
movl -0x8(%rbp), %r8d
andl $0xff, %r8d
leaq 0x2cea88(%rip), %rdi    # 0x39cf70
leaq 0xb985d(%rip), %rsi     # 0x187d4c
movb $0x0, %al
callq 0x9060
movl -0xc(%rbp), %edx
shrl $0x10, %edx
movl -0xc(%rbp), %ecx
shrl $0x8, %ecx
andl $0xff, %ecx
movl -0xc(%rbp), %r8d
andl $0xff, %r8d
leaq 0x2cea76(%rip), %rdi    # 0x39cf90
leaq 0xb9825(%rip), %rsi     # 0x187d46
movb $0x0, %al
callq 0x9060
movl -0x10(%rbp), %edx
shrl $0x10, %edx
movl -0x10(%rbp), %ecx
shrl $0x8, %ecx
andl $0xff, %ecx
movl -0x10(%rbp), %r8d
andl $0xff, %r8d
leaq 0x2cea64(%rip), %rdi    # 0x39cfb0
leaq 0xb9808(%rip), %rsi     # 0x187d5b
movb $0x0, %al
callq 0x9060
leaq 0x29e5f3(%rip), %rax    # 0x36cb54
movl (%rax), %ecx
orl $0xf, %ecx
leaq 0x29e5e7(%rip), %rax    # 0x36cb54
movl %ecx, (%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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
subq $0x10, %rsp
leaq 0xb9795(%rip), %rdi     # 0x187d84
callq 0x7add0
callq 0x7a510
movzbl %al, %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x4(%rbp)
leaq 0x1abe08(%rip), %rax    # 0x27a414
cmpb $0x0, (%rax)
jne 0xce632
movss -0x4(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x1abf17(%rip), %rax    # 0x27a538
movsd %xmm0, (%rax)
leaq 0x29de80(%rip), %rax    # 0x36c4ac
movl $0x2, (%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: 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
subq $0x20, %rsp
leaq 0xb906a(%rip), %rdi     # 0x187da9
callq 0x7add0
leaq 0x2ce289(%rip), %rax    # 0x39cfd4
movl (%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0xced5a
jmp 0xcee5f
leaq 0x2ce273(%rip), %rax    # 0x39cfd4
movl (%rax), %ecx
orl $0x4, %ecx
leaq 0x2ce267(%rip), %rax    # 0x39cfd4
movl %ecx, (%rax)
leaq 0x29d642(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
andl $-0x9, %ecx
leaq 0x29d636(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
callq 0x7a510
callq 0x7a560
movzwl %ax, %eax
movl %eax, -0x8(%rbp)
callq 0x7a680
movl %eax, -0x4(%rbp)
callq 0x7a560
leaq 0x1ab7b0(%rip), %rax    # 0x27a558
cmpl $0x0, (%rax)
jne 0xcedb2
jmp 0xcee5f
cvtsi2sdl -0x4(%rbp), %xmm0
movsd 0xa0271(%rip), %xmm1    # 0x16f030
divsd %xmm1, %xmm0
movsd %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
leaq 0x1ab764(%rip), %rax    # 0x27a538
mulsd (%rax), %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
leaq 0x1ab76f(%rip), %rcx    # 0x27a558
cvtsi2sdl (%rcx), %xmm0
leaq 0x1ab744(%rip), %rcx    # 0x27a538
mulsd (%rcx), %xmm0
cvttsd2si %xmm0, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0xcee06
jmp 0xcee5f
movsd -0x10(%rbp), %xmm0
leaq 0x29d946(%rip), %rax    # 0x36c758
movsd %xmm0, (%rax)
cvtsi2sdl -0x8(%rbp), %xmm0
movsd 0xa2865(%rip), %xmm1    # 0x171688
mulsd %xmm1, %xmm0
movsd 0xa27e9(%rip), %xmm1    # 0x171618
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x10(%rbp), %xmm0
xorl %edx, %edx
movl %edx, %edi
movl %edx, %esi
callq 0x122210
movaps %xmm0, %xmm1
movsd -0x20(%rbp), %xmm0
addsd %xmm1, %xmm0
leaq 0x29d8f5(%rip), %rax    # 0x36c750
movsd %xmm0, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
callq 0x7a680
movl %eax, -0x8(%rbp)
callq 0x7a560
movzwl %ax, %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, -0x4(%rbp)
je 0xd006f
callq 0x7a560
movzwl %ax, %eax
movl %eax, -0x10(%rbp)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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
subq $0x10, %rsp
leaq 0xb76d2(%rip), %rdi     # 0x187761
callq 0x7add0
movw $0x0, -0x6(%rbp)
xorl %edi, %edi
callq 0xd0040
callq 0x7a560
callq 0x7a560
callq 0x7a560
callq 0x7a560
callq 0x7a560
callq 0x7a560
callq 0x7a560
callq 0x7a560
callq 0x7a560
movw %ax, -0x4(%rbp)
callq 0x7a560
movw %ax, -0x2(%rbp)
callq 0x7a560
movw %ax, -0x8(%rbp)
callq 0x7a560
callq 0x7a560
movswl -0x8(%rbp), %eax
cvtsi2ss %eax, %xmm0
movss 0xb32a6(%rip), %xmm1    # 0x1833a4
divss %xmm1, %xmm0
movss %xmm0, -0xc(%rbp)
movswl -0x6(%rbp), %eax
movzwl -0x2(%rbp), %ecx
subl %ecx, %eax
cvtsi2ss %eax, %xmm1
movss -0xc(%rbp), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, -0xc(%rbp)
movswl -0x4(%rbp), %eax
cvtsi2ss %eax, %xmm0
movss -0xc(%rbp), %xmm1
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
movss 0xb325b(%rip), %xmm2    # 0x1833a0
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x29baa0(%rip), %rax    # 0x36bbf8
movsd %xmm0, (%rax)
leaq 0x29c2c9(%rip), %rax    # 0x36c42c
movl $0x6b, (%rax)
addq $0x10, %rsp
popq %rbp
retq
nop
// File: 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
subq $0x10, %rsp
leaq 0xb78b7(%rip), %rdi     # 0x187e46
callq 0x7add0
xorl %edi, %edi
callq 0xd0040
callq 0x7a560
callq 0x7a560
callq 0x7a560
callq 0x7a560
callq 0x7a560
callq 0x7a680
movl %eax, %ecx
leaq 0x29c35e(%rip), %rax    # 0x36c920
movl %ecx, (%rax)
leaq 0x29c351(%rip), %rax    # 0x36c91c
movl %ecx, (%rax)
leaq 0x29c350(%rip), %rax    # 0x36c924
movl %ecx, (%rax)
leaq 0x29bf2b(%rip), %rax    # 0x36c508
cmpl $0x0, (%rax)
jne 0xd05ef
leaq 0x1a743b(%rip), %rax    # 0x277a24
movl $0x7f3, (%rax)          # imm = 0x7F3
leaq 0x29bf12(%rip), %rax    # 0x36c508
movl $0x7, (%rax)
leaq 0x29c319(%rip), %rax    # 0x36c91c
movl (%rax), %eax
movl %eax, %ecx
leaq 0x29c322(%rip), %rax    # 0x36c930
movq %rcx, (%rax)
callq 0x7a560
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x8(%rbp)
callq 0x7a680
movl %eax, %eax
cvtsi2sd %rax, %xmm0
movsd 0x9e9f2(%rip), %xmm1    # 0x16f028
divsd %xmm1, %xmm0
addsd -0x8(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
leaq 0x29c2c9(%rip), %rax    # 0x36c914
cmpl $0x0, (%rax)
jne 0xd0674
movsd 0x9ea38(%rip), %xmm0    # 0x16f090
addsd -0x8(%rbp), %xmm0
cvttsd2si %xmm0, %ecx
leaq 0x29c2a0(%rip), %rax    # 0x36c908
movl %ecx, (%rax)
movl $0x7, %edi
callq 0x7a270
callq 0x7a560
movzwl %ax, %eax
movl %eax, -0xc(%rbp)
leaq 0x29bd32(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
andl $0xffffefff, %ecx       # imm = 0xFFFFEFFF
leaq 0x29bd23(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
movl -0xc(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0xd06ba
leaq 0x29bd0f(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
orl $0x1000, %ecx           # imm = 0x1000
leaq 0x29bd00(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
movl -0xc(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0xd06dd
leaq 0x29bcec(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
orl $0x1000, %ecx           # imm = 0x1000
leaq 0x29bcdd(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: 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
subq $0x10, %rsp
leaq 0xb7042(%rip), %rdi     # 0x187e81
callq 0x7add0
xorl %edi, %edi
callq 0xd0040
callq 0x7a560
movw %ax, -0x2(%rbp)
movl $0x1fc, %edi            # imm = 0x1FC
callq 0x9ec0
leaq 0x1a95b3(%rip), %rax    # 0x27a418
movl (%rax), %ecx
addl $0x1, %ecx
leaq 0x1a95a7(%rip), %rax    # 0x27a418
movl %ecx, (%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: 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
subq $0x20, %rsp
leaq 0xb6fff(%rip), %rdi     # 0x187e8e
callq 0x7add0
xorl %edi, %edi
callq 0xd0040
callq 0x7a560
movw %ax, -0x2(%rbp)
callq 0x7a680
movl %eax, -0x8(%rbp)
callq 0x7a680
movl %eax, -0xc(%rbp)
callq 0x7a680
movl %eax, -0x10(%rbp)
callq 0x7a680
movl %eax, -0x14(%rbp)
movzwl -0x2(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xd0edf
leaq 0x29b5b5(%rip), %rax    # 0x36c48c
movl $0x0, (%rax)
jmp 0xd0eec
leaq 0x29b5a6(%rip), %rax    # 0x36c48c
movl $0x1, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)