LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: set_star_prior(int, int)
void set_star_prior(int p1, int p2)
{
   // !!!! 4531
   if(read_only) return;

   sprintf(out, "PRIOR_TABLE=%d%d", p1, p2);
   queue_star_cmd(out, STAR_PRIOR_MSG);
   queue_star_cmd("PRIOR_TABLE", STAR_PRIOR_MSG);
}

// Assembly:
leaq 0x29bb47(%rip), %rax    # 0x32101a
cmpb $0x0, (%rax)
je 0x854d9
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %esi, %ecx
movl %edi, %edx
leaq 0x2a0d36(%rip), %rbx    # 0x326220
leaq 0x88e56(%rip), %rsi     # 0x10e347
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
movl $0xe1, %esi
callq 0x576d4
leaq 0x88e49(%rip), %rdi     # 0x10e358
movl $0xe1, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x576d4
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: set_star_aux_inp(int, int)
void set_star_aux_inp(int c, int t)
{
   // !!!! 4531
   if(read_only) return;

   sprintf(out, "AUX_INPUT=%d%d", c, t);
   queue_star_cmd(out, STAR_AUX_MSG);
   queue_star_cmd("AUX_INPUT", STAR_AUX_MSG);
}

// Assembly:
leaq 0x29baf4(%rip), %rax    # 0x32101a
cmpb $0x0, (%rax)
je 0x8552c
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %esi, %ecx
movl %edi, %edx
leaq 0x2a0ce3(%rip), %rbx    # 0x326220
leaq 0x88e20(%rip), %rsi     # 0x10e364
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
movl $0xde, %esi
callq 0x576d4
leaq 0x88e11(%rip), %rdi     # 0x10e373
movl $0xde, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x576d4
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: set_star_adm(int, int)
void set_star_adm(int gps, int aux)
{
   // !!!! 4531
   if(read_only) return;

   sprintf(out, "ADM_STATE=%d%d", gps, aux);
   queue_star_cmd(out, STAR_ADM_MSG);
   queue_star_cmd("ADM_STATE", STAR_ADM_MSG);
}

// Assembly:
leaq 0x29baa1(%rip), %rax    # 0x32101a
cmpb $0x0, (%rax)
je 0x8557f
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %esi, %ecx
movl %edi, %edx
leaq 0x2a0c90(%rip), %rbx    # 0x326220
leaq 0x88de6(%rip), %rsi     # 0x10e37d
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
movl $0xe2, %esi
callq 0x576d4
leaq 0x88dd7(%rip), %rdi     # 0x10e38c
movl $0xe2, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x576d4
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: clear_star_wtr()
void clear_star_wtr()
{
   // clear wait to restore timer
   if(read_only) return;

   sprintf(out, "CLEAR_WTR_GPS");
   queue_star_cmd(out, STAR_CLEAR_GPS_MSG);
   if(osa_model != 4530) {
      sprintf(out, "CLEAR_WTR_AUX");
      queue_star_cmd(out, STAR_CLEAR_AUX_MSG);  // !!!! 4531
   }

   sprintf(out, "WTR");
   queue_star_cmd(out, STAR_WTR_MSG);
}

// Assembly:
leaq 0x29ba4e(%rip), %rax    # 0x32101a
cmpb $0x0, (%rax)
je 0x855d2
retq
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x2a0c40(%rip), %rbx    # 0x326220
movabsq $0x5350475f525457, %rax # imm = 0x5350475F525457
movq %rax, 0x6(%rbx)
movabsq $0x54575f5241454c43, %r14 # imm = 0x54575F5241454C43
movq %r14, (%rbx)
movq %rbx, %rdi
movl $0xdb, %esi
callq 0x576d4
leaq 0x17f9dd(%rip), %rax    # 0x204fec
cmpl $0x11b2, (%rax)         # imm = 0x11B2
je 0x85635
movabsq $0x5855415f525457, %rax # imm = 0x5855415F525457
movq %rax, 0x6(%rbx)
movq %r14, (%rbx)
movq %rbx, %rdi
movl $0xdc, %esi
callq 0x576d4
movl $0x525457, (%rbx)       # imm = 0x525457
movq %rbx, %rdi
movl $0xda, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x576d4
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_atdc()
void parse_star_atdc()
{
   // atdc (automatic temperature and drift compensation) status
   log_packet_id("Star ATDC");

   if(get_msg_field()) {
      star_atdc_on = atoi(msg_field);  // 0=atdc active  1=atdc in progress
      have_star_atdc |= 0x01;
   }
   if(get_msg_field()) {
      star_atdc_time = atoi(msg_field); 
      have_star_atdc |= 0x02;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x88d5b(%rip), %rdi     # 0x10e3b2
callq 0x520bf
callq 0x75767
testl %eax, %eax
je 0x85681
leaq 0x2a03d4(%rip), %rdi    # 0x325a40
callq 0x95e0
movl %eax, 0x2d15a9(%rip)    # 0x356c20
leaq 0x271d5e(%rip), %rax    # 0x2f73dc
orb $0x1, (%rax)
callq 0x75767
testl %eax, %eax
je 0x856a6
leaq 0x2a03af(%rip), %rdi    # 0x325a40
callq 0x95e0
movl %eax, 0x2d1588(%rip)    # 0x356c24
leaq 0x271d39(%rip), %rax    # 0x2f73dc
orb $0x2, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_temp()
void parse_star_temp()   
{
   // device temperature
   log_packet_id("Star temperature");

   if(get_msg_field()) {
      temperature = (float) atof(msg_field);
      have_temperature = 106;
   } 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x88d09(%rip), %rdi     # 0x10e3bc
callq 0x520bf
callq 0x75767
testl %eax, %eax
je 0x856ed
leaq 0x2a0378(%rip), %rdi    # 0x325a40
callq 0x9470
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x27133c(%rip), %rax    # 0x2f6a18
movsd %xmm0, (%rax)
leaq 0x271b65(%rip), %rax    # 0x2f724c
movl $0x6a, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_tod()
void parse_star_tod()    
{
   // time-of-day output enable/disable (not on NEC GPSDO)
   log_packet_id("Star TOD");

   if(get_msg_field()) {
      if(strstr(msg_field, "OK")) ;
      else if(star_type == OSA_TYPE) {
         strupr(msg_field);
         if(strstr(msg_field, "E")) star_tod = 1;
         else if(strstr(msg_field, "D")) star_tod = 0;
         else star_tod = 2;
         have_pps_rate = 89;
         pps_enabled = 1;
      }
      else {
         star_tod = atoi(msg_field);  // 0=disable  1=enabke
         have_pps_rate = 88;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x88cd1(%rip), %rdi     # 0x10e3cd
callq 0x520bf
callq 0x75767
testl %eax, %eax
je 0x857b1
leaq 0x2a032b(%rip), %rdi    # 0x325a40
leaq 0x8be42(%rip), %rsi     # 0x11155e
callq 0x9090
testq %rax, %rax
jne 0x857b1
leaq 0x17f8b7(%rip), %rax    # 0x204fe8
cmpl $0x4f, (%rax)
jne 0x8575a
leaq 0x2a0303(%rip), %rbx    # 0x325a40
movq %rbx, %rdi
callq 0x988f
pushq $0x45
popq %rsi
movq %rbx, %rdi
callq 0x9100
testq %rax, %rax
je 0x8577b
pushq $0x1
popq %rcx
jmp 0x85794
leaq 0x2a02df(%rip), %rdi    # 0x325a40
callq 0x95e0
movl %eax, 0x2d14ac(%rip)    # 0x356c18
leaq 0x271b5d(%rip), %rax    # 0x2f72d0
movl $0x58, (%rax)
jmp 0x857b1
leaq 0x2a02be(%rip), %rdi    # 0x325a40
pushq $0x44
popq %rsi
callq 0x9100
xorl %ecx, %ecx
testq %rax, %rax
sete %cl
addl %ecx, %ecx
movl %ecx, 0x2d147e(%rip)    # 0x356c18
leaq 0x271b2f(%rip), %rax    # 0x2f72d0
movl $0x59, (%rax)
leaq 0x272572(%rip), %rax    # 0x2f7d20
movb $0x1, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_type()
void parse_star_type()   
{
   // module type info
   log_packet_id("Star type");

   star_family[0] = star_variant[0] = 0;

   if(get_msg_field()) {
      msg_field[12] = 0;
      strcpy(star_family, msg_field);
   }

   if(get_msg_field()) {
      msg_field[12] = 0;
      strcpy(star_variant, msg_field);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x88c13(%rip), %rdi     # 0x10e3d6
callq 0x520bf
leaq 0x2a2550(%rip), %rax    # 0x327d1f
xorl %ecx, %ecx
movb %cl, (%rax)
leaq 0x2a2538(%rip), %rax    # 0x327d12
movb %cl, (%rax)
callq 0x75767
testl %eax, %eax
je 0x857fc
leaq 0x2a0254(%rip), %rsi    # 0x325a40
movb $0x0, 0xc(%rsi)
leaq 0x2a251b(%rip), %rdi    # 0x327d12
callq 0x9330
callq 0x75767
testl %eax, %eax
je 0x8581d
leaq 0x2a0234(%rip), %rsi    # 0x325a40
movb $0x0, 0xc(%rsi)
leaq 0x2a2508(%rip), %rdi    # 0x327d1f
popq %rbp
jmp 0x9330
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_elmask()
void parse_star_elmask()
{
float el_val;

   // antenna elevation mask
   log_packet_id("Star elmask");

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x888b6(%rip), %rdi     # 0x10e41a
callq 0x520bf
callq 0x75767
testl %eax, %eax
je 0x85baf
leaq 0x29fec7(%rip), %rdi    # 0x325a40
callq 0x9470
cvtsd2ss %xmm0, %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0x85baf
movss 0x71572(%rip), %xmm1    # 0xf7104
ucomiss %xmm0, %xmm1
jb 0x85baf
leaq 0x271516(%rip), %rax    # 0x2f70b4
movss %xmm0, (%rax)
leaq 0x271853(%rip), %rax    # 0x2f73fc
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_inp_type()
void parse_star_inp_type() 
{
   // input ref type: GPS or PPS (not on Star-4 ATDC devices)
   log_packet_id("Star input");

   if(get_msg_field()) {
      if(strstr(msg_field, "GPS")) {
         gpsdo_ref = 0;
         have_gpsdo_ref = 1;
      }
      else if(strstr(msg_field, "AUX")) {
         gpsdo_ref = 1;
         have_gpsdo_ref = 1;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8886a(%rip), %rdi     # 0x10e426
callq 0x520bf
callq 0x75767
testl %eax, %eax
je 0x85c15
leaq 0x29fe6f(%rip), %rdi    # 0x325a40
leaq 0x97c39(%rip), %rsi     # 0x11d811
callq 0x9090
xorl %ecx, %ecx
testq %rax, %rax
jne 0x85bff
leaq 0x29fe55(%rip), %rdi    # 0x325a40
leaq 0x8bf5b(%rip), %rsi     # 0x111b4d
callq 0x9090
testq %rax, %rax
je 0x85c15
pushq $0x1
popq %rcx
leaq 0x27107a(%rip), %rax    # 0x2f6c80
movl %ecx, (%rax)
leaq 0x271075(%rip), %rax    # 0x2f6c84
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_ubx_nav()
void parse_ubx_nav()
{
S32 msec;

   // get lat/lon/alt
   log_packet_id("UBX_NAV");

   msec = tsip_dword();
   lon = (double) (S32) tsip_dword();
   lat = (double) (S32) tsip_dword();
   alt = (double) (S32) tsip_dword();
   tsip_dword();
   tsip_dword();
   tsip_dword();

   lat = (lat / 1.0E7);
   lon = (lon / 1.0E7);
   alt = alt / 1000.0;

   lat = lat * PI / 180.0;
   lon = lon * PI / 180.0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x88064(%rip), %rdi     # 0x10e59d
callq 0x520bf
callq 0x51cf3
callq 0x51cf3
cvtsi2sd %eax, %xmm0
leaq 0x270a85(%rip), %rbx    # 0x2f6fd8
movsd %xmm0, (%rbx)
callq 0x51cf3
cvtsi2sd %eax, %xmm0
leaq 0x270a69(%rip), %r14    # 0x2f6fd0
movsd %xmm0, (%r14)
callq 0x51cf3
cvtsi2sd %eax, %xmm0
leaq 0x270a64(%rip), %r15    # 0x2f6fe0
movsd %xmm0, (%r15)
callq 0x51cf3
callq 0x51cf3
callq 0x51cf3
movsd (%r14), %xmm0
movsd 0x6f3b3(%rip), %xmm1    # 0xf5950
divsd %xmm1, %xmm0
movsd (%rbx), %xmm2
divsd %xmm1, %xmm2
movsd (%r15), %xmm1
divsd 0x6ca82(%rip), %xmm1    # 0xf3038
movsd %xmm1, (%r15)
movsd 0x6f2dd(%rip), %xmm1    # 0xf58a0
mulsd %xmm1, %xmm0
movsd 0x6f2d9(%rip), %xmm3    # 0xf58a8
divsd %xmm3, %xmm0
movsd %xmm0, (%r14)
mulsd %xmm1, %xmm2
divsd %xmm3, %xmm2
movsd %xmm2, (%rbx)
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_ubx_status()
void parse_ubx_status()
{
int mode;

   // get receiver operating mode
   log_packet_id("UBX_STATUS");

   tsip_dword();  // tow
   mode = tsip_byte();
   tsip_byte();
   tsip_byte();
   tsip_byte();
   tsip_double();

if(debug_file) fprintf(debug_file, "rcvr mode:%d\n", mode);

   if     (mode == 0) rcvr_mode = RCVR_MODE_ACQUIRE;
   else if(mode == 1) rcvr_mode = RCVR_MODE_UNKNOWN;  // dead reckoning
   else if(mode == 2) rcvr_mode = RCVR_MODE_2D;
   else if(mode == 3) rcvr_mode = RCVR_MODE_3D;
   else if(mode == 4) rcvr_mode = RCVR_MODE_3D;       // gps+dead reckonong
   else if(mode == 5) rcvr_mode = RCVR_MODE_HOLD;     // (time only fix)
   else               rcvr_mode = RCVR_MODE_UNKNOWN;
   have_rcvr_mode = 3;

   have_tracking = 1;
   if     (rcvr_mode == RCVR_MODE_NO_SATS) minor_alarms |= MINOR_NO_TRACK;
   else if(rcvr_mode == RCVR_MODE_2D_3D)   minor_alarms |= MINOR_NO_TRACK;
   else                                    minor_alarms &= (~MINOR_NO_TRACK);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x87fa9(%rip), %rdi     # 0x10e5a5
callq 0x520bf
callq 0x51cf3
callq 0x51c47
movl %eax, %ebx
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51e6f
leaq 0x1a1d68(%rip), %rax    # 0x228390
movq (%rax), %rdi
movzbl %bl, %ebx
testq %rdi, %rdi
je 0x86643
leaq 0x87f76(%rip), %rsi     # 0x10e5b0
movl %ebx, %edx
xorl %eax, %eax
callq 0x9560
leal (,%rbx,8), %ecx
movabsq $0x70404036309, %rax    # imm = 0x70404036309
shrq %cl, %rax
cmpb $0x6, %bl
pushq $0x63
popq %rcx
cmovbl %eax, %ecx
leaq 0x270a69(%rip), %rax    # 0x2f70d0
movb %cl, (%rax)
leaq 0x270d9d(%rip), %rax    # 0x2f740d
movb $0x3, (%rax)
leaq 0x270c16(%rip), %rax    # 0x2f7290
movl $0x1, (%rax)
leaq 0x270b51(%rip), %rax    # 0x2f71d8
andb $-0x9, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %rbx
pushq %rax
leaq 0x87f00(%rip), %rdi     # 0x10e5c8
callq 0x520bf
callq 0x51cf3
leaq 0x186e0b(%rip), %rbx    # 0x20d4e4
andl $0x0, (%rbx)
callq 0x51c63
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
divsd 0x6c970(%rip), %xmm0    # 0xf3060
leaq 0x186e09(%rip), %rax    # 0x20d500
movsd %xmm0, (%rax)
callq 0x51c63
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
divsd 0x6c951(%rip), %xmm0    # 0xf3060
leaq 0x186dd2(%rip), %rax    # 0x20d4e8
movsd %xmm0, (%rax)
callq 0x51c63
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
divsd 0x6c932(%rip), %xmm0    # 0xf3060
leaq 0x186dd3(%rip), %rax    # 0x20d508
movsd %xmm0, (%rax)
callq 0x51c63
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
divsd 0x6c913(%rip), %xmm0    # 0xf3060
leaq 0x186da4(%rip), %rax    # 0x20d4f8
movsd %xmm0, (%rax)
callq 0x51c63
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
divsd 0x6c8f4(%rip), %xmm0    # 0xf3060
leaq 0x186d7d(%rip), %rax    # 0x20d4f0
movsd %xmm0, (%rax)
callq 0x51c63
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
divsd 0x6c8d5(%rip), %xmm0    # 0xf3060
leaq 0x186d7e(%rip), %rax    # 0x20d510
movsd %xmm0, (%rax)
callq 0x51c63
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
divsd 0x6c8b6(%rip), %xmm0    # 0xf3060
leaq 0x186d67(%rip), %rax    # 0x20d518
movsd %xmm0, (%rax)
orb $0x7d, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x87e0a(%rip), %rdi     # 0x10e5d4
callq 0x520bf
callq 0x51cf3
callq 0x51cf3
callq 0x51cf3
callq 0x51cf3
callq 0x51cf3
movl %eax, %eax
cvtsi2sd %rax, %xmm0
divsd 0x6c869(%rip), %xmm0    # 0xf3060
leaq 0x270822(%rip), %rax    # 0x2f7020
movsd %xmm0, (%rax)
callq 0x51cf3
callq 0x51cf3
cvtsi2sd %eax, %xmm0
divsd 0x6c8b0(%rip), %xmm0    # 0xf30c8
movsd 0x81990(%rip), %xmm1    # 0x1081b0
addsd %xmm0, %xmm1
xorpd %xmm2, %xmm2
movapd %xmm0, %xmm3
cmpltsd %xmm2, %xmm3
andpd %xmm3, %xmm1
andnpd %xmm0, %xmm3
orpd %xmm1, %xmm3
leaq 0x2707e4(%rip), %rax    # 0x2f7028
movlpd %xmm3, (%rax)
callq 0x51cf3
callq 0x51cf3
leaq 0x270adf(%rip), %rax    # 0x2f7338
pushq $0xf
popq %rcx
movl %ecx, (%rax)
leaq 0x270acf(%rip), %rax    # 0x2f7334
movl %ecx, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
leaq 0x87b9d(%rip), %rdi     # 0x10e5e6
callq 0x520bf
callq 0x51cf3
callq 0x51cf3
callq 0x51c63
leaq 0x270cd4(%rip), %rcx    # 0x2f7738
movw %ax, (%rcx)
leaq 0x270cda(%rip), %rax    # 0x2f7748
andl $0x0, (%rax)
callq 0x51c47
leaq 0x270cb7(%rip), %rcx    # 0x2f7734
cmpl $0x0, (%rcx)
jne 0x86a8e
movsbl %al, %eax
leaq 0x270c9c(%rip), %rcx    # 0x2f7728
movl %eax, (%rcx)
callq 0x51c47
callq 0x51c63
pushq $0x3
popq %rdi
callq 0x51a91
leaq 0x270885(%rip), %rax    # 0x2f732c
cmpl $0x0, (%rax)
jne 0x86ab9
leaq 0x17bd91(%rip), %rcx    # 0x202844
movl $0x7e0, (%rcx)          # imm = 0x7E0
movl $0x2, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x87b20(%rip), %rdi     # 0x10e5f2
callq 0x520bf
callq 0x51cf3
callq 0x51e6f
callq 0x51e6f
callq 0x51cf3
callq 0x51c63
callq 0x51c63
movl %eax, %ebx
callq 0x51c63
movl %eax, %r14d
callq 0x51c63
movl %eax, %r15d
callq 0x51c63
xorl %ecx, %ecx
cmpw %ax, %bx
setne %cl
leaq 0x2706bd(%rip), %rax    # 0x2f71d8
movl $0xffffff7f, %edx       # imm = 0xFFFFFF7F
andl (%rax), %edx
shll $0x7, %ecx
orl %edx, %ecx
movl %ecx, (%rax)
leaq 0x270768(%rip), %rax    # 0x2f7298
movl $0x2, (%rax)
movzwl %r14w, %eax
cvtsi2sd %eax, %xmm0
movzwl %r15w, %edi
callq 0x55822
pushq $0x26
popq %rbx
subl $0x1, %ebx
jb 0x86b56
callq 0x51c47
jmp 0x86b4a
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_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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x873fa(%rip), %rdi     # 0x10e69f
callq 0x520bf
pushq $0x15
popq %r14
callq 0x51c47
decl %r14d
jne 0x872ae
movl %eax, %ebx
pushq $0x26
popq %r15
callq 0x51c47
movl %eax, %r14d
subl $0x1, %r15d
jb 0x872d3
callq 0x51c47
jmp 0x872c6
leaq 0x26fefe(%rip), %rax    # 0x2f71d8
movl (%rax), %edx
movl %edx, %ecx
andl $-0x7, %ecx
movl %ecx, (%rax)
cmpb $0x2, %bl
je 0x8730b
movzbl %bl, %esi
cmpl $0x4, %esi
je 0x872fa
cmpl $0x3, %esi
jne 0x872ff
orl $0x4, %ecx
jmp 0x87309
orl $0x2, %ecx
jmp 0x87309
testb %r14b, %r14b
jne 0x8730b
orl $0x6, %edx
movl %edx, %ecx
movl %ecx, (%rax)
leaq 0x26ff1a(%rip), %rax    # 0x2f722c
movl $0x1, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_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
pushq %r14
pushq %rbx
movl %edi, %ebx
leaq 0x87361(%rip), %rdi     # 0x10e6af
callq 0x520bf
leaq 0x2700ce(%rip), %rax    # 0x2f7428
orb $0x2, (%rax)
leaq 0x270050(%rip), %rax    # 0x2f73b4
movl %ebx, (%rax)
callq 0x51cf3
movl %eax, %r14d
callq 0x51cf3
callq 0x51cf3
callq 0x51cf3
callq 0x51cf3
callq 0x51cf3
movl %eax, %ebx
callq 0x51cf3
leaq 0x26fe43(%rip), %rax    # 0x2f71d8
movl (%rax), %ecx
cmpl $0x1, %r14d
jne 0x873a9
orl $0x20, %ecx
movl %ecx, (%rax)
movl %ebx, %ecx
pushq $0xa
popq %rax
jmp 0x873bf
andl $-0x21, %ecx
movl %ecx, (%rax)
leaq 0x270ae3(%rip), %rax    # 0x2f7e98
cmpb $0x0, (%rax)
jne 0x873d2
pushq $-0xa
popq %rax
xorl %ecx, %ecx
leaq 0x270ab2(%rip), %rdx    # 0x2f7e78
movq %rcx, (%rdx)
leaq 0x270ab8(%rip), %rcx    # 0x2f7e88
movl %eax, (%rcx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %rbx
pushq %rax
leaq 0x87217(%rip), %rdi     # 0x10e5fb
callq 0x520bf
leaq 0x270038(%rip), %rax    # 0x2f7428
orb $0x1, (%rax)
callq 0x51cf3
movl %eax, %ebx
callq 0x51cf3
callq 0x51cf3
callq 0x51cf3
callq 0x51cf3
movl %eax, 0x2cf69c(%rip)    # 0x356ab0
callq 0x51cf3
callq 0x51c47
callq 0x51c47
callq 0x51c63
leaq 0x270a49(%rip), %rax    # 0x2f7e78
movq (%rax), %rcx
testq %rcx, %rcx
je 0x87441
imull $0x64, %ebx, %eax
xorl %edx, %edx
idivq %rcx
jmp 0x87443
xorl %eax, %eax
leaq 0x270a42(%rip), %rcx    # 0x2f7e8c
movl %eax, (%rcx)
leaq 0x270a3d(%rip), %rax    # 0x2f7e90
movl $0x3, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x8724e(%rip), %rdi     # 0x10e6b9
callq 0x520bf
leaq 0x26ff81(%rip), %rax    # 0x2f73f8
movl $0x1, (%rax)
callq 0x51c63
callq 0x51c63
callq 0x51cf3
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c47
movzbl %al, %eax
cvtsi2ss %eax, %xmm0
leaq 0x26fc05(%rip), %rax    # 0x2f70b8
movss %xmm0, (%rax)
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c63
callq 0x51cf3
callq 0x51cf3
callq 0x51cf3
callq 0x51cf3
popq %rbp
jmp 0x51cf3
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_ubx_ver()
void parse_ubx_ver()
{
int i;
int line;

   // note: docs say the message is 70+ bytes long, we only see 40 bytes
   // on a NEO-6M
   log_packet_id("UBX_VER");

   saw_version |= 0x100;

   for(i=0; i<30; i++) {  // sw version
      ubx_sw[i] = tsip_byte();
   }
ubx_sw[21] = 0;  // trim it so info fits on screen
   if(ubx_sw[0]) ubx_fw_ver = (float) atof(ubx_sw);
   else          ubx_fw_ver = (float) atof(ubx_sw);

   for(i=0; i<10; i++) {  // hw vers
      ubx_hw[i] = tsip_byte();
   }
   ubx_hw[9] = 0;

   for(line=0; line<UBX_ROM_INFO; line++) {  // clear rom version info
      ubx_rom[line][0] = 0;
   }

   for(line=0; line<UBX_ROM_INFO; line++) {  // get rom version info
      if(tsip_error) {  // past end of message
         break;
      }

      for(i=0; i<30; i++) {   // rom version (not on NEO-6M)
         ubx_rom[line][i] = tsip_byte();
         if(tsip_error) {
            ubx_rom[line][0] = 0;
            break;
         }
      }
      ubx_rom[line][30] = 0;
   }

   have_info |= ALL_ID_INFO;

// show_version_info();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x871bf(%rip), %rdi     # 0x10e6c3
callq 0x520bf
leaq 0x26fef8(%rip), %rax    # 0x2f7408
orb $0x1, 0x1(%rax)
xorl %r14d, %r14d
leaq 0x2a01a2(%rip), %rbx    # 0x3276c0
cmpq $0x1e, %r14
je 0x87532
callq 0x51c47
movb %al, (%rbx,%r14)
incq %r14
jmp 0x8751e
movb $0x0, 0x15(%rbx)
movq %rbx, %rdi
callq 0x9470
cvtsd2ss %xmm0, %xmm0
leaq 0x2a0433(%rip), %rax    # 0x32797c
movss %xmm0, (%rax)
xorl %ebx, %ebx
leaq 0x2a0188(%rip), %r14    # 0x3276de
cmpq $0xa, %rbx
je 0x8756a
callq 0x51c47
movb %al, (%r14,%rbx)
incq %rbx
jmp 0x87556
movb $0x0, 0x9(%r14)
xorl %eax, %eax
leaq 0x2a0178(%rip), %rbx    # 0x3276f0
cmpq $0x26c, %rax            # imm = 0x26C
je 0x8758a
movb $0x0, (%rbx,%rax)
addq $0x1f, %rax
jmp 0x87578
leaq 0x1a19df(%rip), %r14    # 0x228f70
movl (%r14), %eax
xorl %r15d, %r15d
movq %rbx, %r12
cmpq $0x13, %r15
ja 0x875de
testl %eax, %eax
jne 0x875de
xorl %r13d, %r13d
cmpq $0x1e, %r13
je 0x875ca
callq 0x51c47
movb %al, (%r12,%r13)
movl (%r14), %eax
incq %r13
testl %eax, %eax
je 0x875a7
imulq $0x1f, %r15, %rcx
movb $0x0, (%rbx,%rcx)
jmp 0x875cc
xorl %eax, %eax
imulq $0x1f, %r15, %rcx
movb $0x0, 0x1e(%rbx,%rcx)
incq %r15
addq $0x1f, %r12
jmp 0x8759a
leaq 0x27038f(%rip), %rax    # 0x2f7974
orb $0xf, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: 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
pushq %rbx
pushq %rax
leaq 0x870a1(%rip), %rdi     # 0x10e6d5
callq 0x520bf
callq 0x51c63
callq 0x51c47
callq 0x51c47
pushq $0x9
popq %rbx
callq 0x51c47
decl %ebx
jne 0x8764b
movzbl %al, %eax
cvtsi2ss %eax, %xmm0
leaq 0x26fa52(%rip), %rax    # 0x2f70b4
movss %xmm0, (%rax)
leaq 0x26fd8f(%rip), %rax    # 0x2f73fc
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_ubx_pps()
void parse_ubx_pps()
{
u08 status;
u08 flags;
u08 rsvd;
u32 rate;
u32 width;

   // get timepulse1 info
   log_packet_id("UBX_TP1");
   saw_ubx_tp = 1;

   rate = tsip_dword();  // interval in usec
   if     (rate == 1000000) pps_rate = RATE_1PPS;    // 1pps
   else if(rate == 10000)   pps_rate = RATE_100PPS;  // 100 pps
   else if(rate == 1000)    pps_rate = RATE_1000PPS; // 1000 pps
   else                     pps_rate = RATE_USER;    // user defined rate
   have_pps_rate = 3;
//sprintf(debug_text, "ubxpps: rate:%d", rate);

   width = tsip_dword();  // width in us

   status = tsip_byte();
   if(status == 0) pps_enabled = 0;
   else {
      pps_enabled = 1;
      if(status & 0x80) pps_polarity = 1; // falling
      else              pps_polarity = 0; // rising
      have_pps_polarity = 2;
   }
   have_pps_enable = 2;

   tsip_byte();   // align 0=UTC 1=GPS 2=LOCAL
   flags = tsip_byte();  // 1=always on, 0=when tracking
   rsvd = tsip_byte();   // rsvd

   cable_delay = (double) (s16) tsip_word();
   cable_delay /= 1.0E9;
// if(have_cable_delay == 0) need_redraw = 2020;
   have_cable_delay = 1;

   tsip_word();   // rf group delay
   pps1_delay = (double) (S32) tsip_dword();
   have_pps_delay |= 0x01;

   show_cable_delay();
// sprintf(debug_text2, "UBXPPS: rate:%d  width:%d  ofs:%f  mode:%d flags:%d rcvd:%02X", rate,width, pps1_delay, status,flags,rsvd);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x87058(%rip), %rdi     # 0x10e6dd
callq 0x520bf
leaq 0x26fd9f(%rip), %rax    # 0x2f7430
movl $0x1, (%rax)
callq 0x51cf3
cmpl $0x3e8, %eax            # imm = 0x3E8
je 0x876b9
cmpl $0xf4240, %eax          # imm = 0xF4240
je 0x876b5
cmpl $0x2710, %eax           # imm = 0x2710
jne 0x876bd
movb $-0x7e, %al
jmp 0x876bf
movb $0x2, %al
jmp 0x876bf
movb $-0x7d, %al
jmp 0x876bf
xorl %eax, %eax
leaq 0x27065d(%rip), %rcx    # 0x2f7d23
movb %al, (%rcx)
leaq 0x26fc01(%rip), %rax    # 0x2f72d0
movl $0x3, (%rax)
callq 0x51cf3
callq 0x51c47
testb %al, %al
je 0x87703
shrb $0x7, %al
movzbl %al, %eax
leaq 0x270628(%rip), %rcx    # 0x2f7d18
movl %eax, (%rcx)
leaq 0x26fbe7(%rip), %rax    # 0x2f72e0
movl $0x2, (%rax)
movb $0x1, %al
jmp 0x87705
xorl %eax, %eax
leaq 0x270614(%rip), %rcx    # 0x2f7d20
movb %al, (%rcx)
leaq 0x26fbc7(%rip), %rax    # 0x2f72dc
movl $0x2, (%rax)
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c63
cwtl
cvtsi2sd %eax, %xmm0
divsd 0x6b8ec(%rip), %xmm0    # 0xf3028
leaq 0x270685(%rip), %rax    # 0x2f7dc8
movsd %xmm0, (%rax)
leaq 0x26fb66(%rip), %rax    # 0x2f72b4
movl $0x1, (%rax)
callq 0x51c63
callq 0x51cf3
cvtsi2sd %eax, %xmm0
leaq 0x27066f(%rip), %rax    # 0x2f7dd8
movsd %xmm0, (%rax)
leaq 0x26fb44(%rip), %rax    # 0x2f72b8
orb $0x1, (%rax)
popq %rbp
jmp 0x6b202
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %rbx
pushq %rax
leaq 0x86894(%rip), %rdi     # 0x10e732
callq 0x520bf
callq 0x51cf3
callq 0x51cf3
callq 0x51cf3
movl %eax, %ebx
callq 0x51c63
callq 0x51c47
callq 0x51c47
cvtsi2ss %ebx, %xmm0
leaq 0x26f4f6(%rip), %rax    # 0x2f73c4
divss 0x80ad2(%rip), %xmm0    # 0x1089a8
movl $0x1, (%rax)
cvtss2sd %xmm0, %xmm0
leaq 0x26eb19(%rip), %rax    # 0x2f6a00
movsd %xmm0, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %rbx
pushq %rax
leaq 0x8683a(%rip), %rdi     # 0x10e739
callq 0x520bf
callq 0x51c63
movl %eax, %ebx
callq 0x51c63
callq 0x51c63
testw %bx, %bx
je 0x87f55
leaq 0x17d313(%rip), %rax    # 0x205234
cmpb $0x0, (%rax)
jne 0x87f55
movzwl %bx, %eax
cvtsi2ss %eax, %xmm0
movss 0x80a73(%rip), %xmm1    # 0x1089a8
divss %xmm0, %xmm1
cvtss2sd %xmm1, %xmm0
leaq 0x17d414(%rip), %rax    # 0x205358
movsd %xmm0, (%rax)
leaq 0x26f37d(%rip), %rax    # 0x2f72cc
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_ubx_gnss()
void parse_ubx_gnss()
{
int hw_chans;
int use_chans;
int blocks;
int id;
int min_chans;
int max_chans;
u32 flags;

   log_packet_id("UBX_GNSS");

   tsip_byte();  // msg version
   hw_chans = tsip_byte();
   use_chans = tsip_byte();
   blocks = tsip_byte();
//sprintf(debug_text2, "GNSS info hw_chans:%d  use:%d  blocks:%d", hw_chans,use_chans,blocks);

   if(blocks == 0) return;

   gnss_mask = 0x0000;
   have_gnss_mask = 1;
   while(blocks--) {
      id = tsip_byte();
      min_chans = tsip_byte();
      max_chans = tsip_byte();
      tsip_byte();  // reserved
      flags = tsip_dword();

      if(id == 0) {       // GPS
         if(flags & 0x0001) gnss_mask |= GPS;
      }
      else if(id == 1) {  // SBAS
         if(flags & 0x0001) gnss_mask |= SBAS;
      }
      else if(id == 2) {  // GALILEO
         if(flags & 0x0001) gnss_mask |= GALILEO;
      }
      else if(id == 3) {  // Beidou
         if(flags & 0x0001) gnss_mask |= BEIDOU;
      }
      else if(id == 4) {  // IMES
         if(flags & 0x0001) gnss_mask |= IMES;
      }
      else if(id == 5) {  // QZSS
         if(flags & 0x0001) gnss_mask |= QZSS;
      }
      else if(id == 6) {  // GLONASS
         if(flags & 0x0001) gnss_mask |= GLONASS;
      }

if(0 && debug_file) {
   fprintf(debug_file, "gnss blk:%d  hw:%d use:%d  id:%d min:%d max:%d flags:%08X  mask:%04X\n", 
   blocks, hw_chans, use_chans, id,min_chans,max_chans,flags, gnss_mask);
}
   }
// sprintf(debug_text2, "GNSS got mask:%04X", gnss_mask);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x867d1(%rip), %rdi     # 0x10e742
callq 0x520bf
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c47
testb %al, %al
je 0x88019
leaq 0xd2cdb(%rip), %r14     # 0x15ac74
andl $0x0, (%r14)
movzbl %al, %r15d
leaq 0xd2cd0(%rip), %rax     # 0x15ac78
movl $0x1, (%rax)
leaq 0x816df(%rip), %r12     # 0x109694
pushq $0x2
popq %r13
subl $0x1, %r15d
jb 0x88019
callq 0x51c47
movl %eax, %ebx
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51cf3
cmpb $0x6, %bl
ja 0x87fb9
movzbl %bl, %ecx
movslq (%r12,%rcx,4), %rcx
addq %r12, %rcx
jmpq *%rcx
pushq $0x1
jmp 0x87ffc
movl $0x2000, %ecx           # imm = 0x2000
jmp 0x88010
pushq $0x4
jmp 0x87ffc
pushq $0x8
popq %rcx
jmp 0x88010
movl $0x8000, %ecx           # imm = 0x8000
jmp 0x88010
movl $0x4000, %ecx           # imm = 0x4000
jmp 0x88010
movl %r13d, %ecx
testb $0x1, %al
je 0x87fb9
orl %ecx, (%r14)
jmp 0x87fb9
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_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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x861b1(%rip), %rdi     # 0x10e7b0
callq 0x520bf
leaq 0x29f375(%rip), %rbx    # 0x327980
movb $0x0, (%rbx)
movl 0x2ce4e8(%rip), %eax    # 0x356afc
cmpl $0x3, %eax
pushq $0x2
popq %rcx
cmovgel %eax, %ecx
addl $-0x2, %ecx
cmpl $0x51, %eax
pushq $0x4e
popq %r14
cmovbl %ecx, %r14d
xorl %r15d, %r15d
cmpq %r15, %r14
je 0x88647
callq 0x51c47
movb %al, (%r15,%rbx)
movb $0x0, 0x1(%r15,%rbx)
incq %r15
jmp 0x8862e
leaq 0x26f326(%rip), %rax    # 0x2f7974
orb $0xf, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_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
pushq %rbx
pushq %rax
leaq 0x85b22(%rip), %rdi     # 0x10e7d9
callq 0x520bf
leaq 0x26e661(%rip), %rax    # 0x2f7324
movl $0x1, (%rax)
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c63
callq 0x51c63
movl %eax, %ebx
callq 0x51cf3
callq 0x51c47
leaq 0x26ea35(%rip), %rcx    # 0x2f7734
cmpl $0x0, (%rcx)
jne 0x88d22
andb $0x4, %al
je 0x88d22
movswl %bx, %eax
leaq 0x26ea16(%rip), %rcx    # 0x2f7728
movl %eax, (%rcx)
pushq $0x5
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x51a91
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r14
pushq %rbx
leaq 0x85aab(%rip), %rdi     # 0x10e7e2
callq 0x520bf
callq 0x51c63
callq 0x51cf3
callq 0x51c47
callq 0x51cf3
movl %eax, %r14d
callq 0x51cf3
movl %eax, %ebx
callq 0x51cf3
leaq 0x26e4d2(%rip), %rcx    # 0x2f7238
pushq $0x14
popq %rax
movl %eax, (%rcx)
leaq 0x26e4d2(%rip), %rcx    # 0x2f7244
movl %eax, (%rcx)
xorpd %xmm0, %xmm0
testl %r14d, %r14d
je 0x88d99
movl %r14d, %ecx
cvtsi2sd %rcx, %xmm1
movsd 0x6a2e3(%rip), %xmm0    # 0xf3070
divsd %xmm1, %xmm0
mulsd 0x6a28f(%rip), %xmm0    # 0xf3028
leaq 0x26da18(%rip), %rcx    # 0x2f67b8
movsd %xmm0, (%rcx)
movl %ebx, %ecx
cvtsi2sd %rcx, %xmm0
divsd 0x6a29d(%rip), %xmm0    # 0xf3050
leaq 0x26da06(%rip), %rcx    # 0x2f67c0
movsd %xmm0, (%rcx)
leaq 0x26e46f(%rip), %rcx    # 0x2f7234
movl %eax, (%rcx)
leaq 0x26e47a(%rip), %rcx    # 0x2f7248
movl %eax, (%rcx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %rbx
pushq %rax
leaq 0x85a0b(%rip), %rdi     # 0x10e7ed
callq 0x520bf
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c63
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51cf3
callq 0x51c47
callq 0x51c63
cwtl
cvtsi2ss %eax, %xmm0
divss 0x6e28c(%rip), %xmm0    # 0xf70d0
leaq 0x26e269(%rip), %rax    # 0x2f70b4
movss %xmm0, (%rax)
leaq 0x26e5a6(%rip), %rax    # 0x2f73fc
pushq $0x1
popq %rbx
movl %ebx, (%rax)
callq 0x51c47
movzbl %al, %eax
cvtsi2ss %eax, %xmm0
leaq 0x26e24a(%rip), %rax    # 0x2f70b8
movss %xmm0, (%rax)
leaq 0x26e57f(%rip), %rax    # 0x2f73f8
movl %ebx, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x51cf3
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq $0x1
popq %rdi
callq 0x73dcb
callq 0x51c47
movzbl %al, %edi
leal -0x2(%rdi), %eax
cmpl $0x11, %eax
ja 0x88f3c
leaq 0x807d4(%rip), %rcx     # 0x109700
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x88ea8
jmp 0x88f9d
cmpl $0x1b, %edi
je 0x88f91
cmpl $0x29, %edi
je 0x88f98
cmpl $0x34, %edi
jne 0x88f52
callq 0x88caa
jmp 0x88f9d
callq 0x88edb
jmp 0x88f9d
callq 0x88e86
jmp 0x88f9d
callq 0x88dd5
jmp 0x88f9d
callq 0x88eca
jmp 0x88f9d
callq 0x8865c
jmp 0x88f9d
callq 0x8890e
jmp 0x88f9d
callq 0x885ee
jmp 0x88f9d
callq 0x88d29
jmp 0x88f9d
callq 0x88e97
jmp 0x88f9d
callq 0x88eb9
jmp 0x88f9d
callq 0x8891f
leaq 0x19f41c(%rip), %rax    # 0x2283c0
cmpq $0x0, (%rax)
setne %al
leaq 0x18464e(%rip), %rcx    # 0x20d600
movq (%rcx), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x88fc7
callq 0xae83
leaq 0x19ffd2(%rip), %rax    # 0x228fa0
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r14
pushq %rbx
leaq 0x853b8(%rip), %rdi     # 0x10e878
callq 0x520bf
callq 0x51c47
movl %eax, %ebx
callq 0x51c47
movl %eax, %r14d
callq 0x51c47
leal -0x1(%rbx), %ecx
cmpb $0x1, %cl
ja 0x89501
movzbl %r14b, %ecx
cvtsi2ss %ecx, %xmm0
leaq 0x26dbc4(%rip), %rcx    # 0x2f70b4
movss %xmm0, (%rcx)
leaq 0x26df01(%rip), %rcx    # 0x2f73fc
movl $0x1, (%rcx)
andb $-0x3, %bl
cmpb $0x1, %bl
jne 0x89528
movzbl %al, %eax
cvtsi2ss %eax, %xmm0
leaq 0x26dba1(%rip), %rax    # 0x2f70b8
movss %xmm0, (%rax)
leaq 0x26ded6(%rip), %rax    # 0x2f73f8
movl $0x1, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x8534c(%rip), %rdi     # 0x10e884
callq 0x520bf
callq 0x51cf3
cvtsi2ss %eax, %xmm0
cvtss2sd %xmm0, %xmm0
mulsd 0x7f186(%rip), %xmm0    # 0x1086d8
leaq 0x26e86f(%rip), %rax    # 0x2f7dc8
movsd %xmm0, (%rax)
leaq 0x26dd50(%rip), %rax    # 0x2f72b4
movl $0x1, (%rax)
popq %rbp
jmp 0x6b202
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_venus_survey(int)
void parse_venus_survey(int msg)
{
u08 mode;
u32 len;
u32 sdev;
double slat,slon,salt;
u08 rtime;
u32 rlen;

   log_packet_id("venus_survey");

   if(saw_venus_raw == 0) config_venus_timing();
   saw_timing_msg |= 0x04;
   
   mode = tsip_byte();   // timing mode
   len = tsip_dword();   // survey length
   sdev = tsip_dword();  // std dev
   slat = tsip_double(); // saved lat
   slon = tsip_double(); // saved lon
   salt = (double) tsip_single(); // saved alt
   rtime = tsip_byte();  // run-time timing mode
   rlen = tsip_dword();  // run-time survey length

   if(do_survey > 0) survey_progress = 100 - ((100 * rlen) / do_survey);
   else              survey_progress = (-1);
   have_progress = 4;
//sprintf(debug_text, "mode:%d msg:%04X  len:%d  sdev:%d  lla:%f %f %f   rtime:%d  rlen:%d  prog:%d",
//mode, msg, len, sdev, slat,slon,salt, rtime, rlen, survey_progress);

   minor_alarms &= (~MINOR_SURVEY);
   venus_hold_mode = 0;
   if((rlen == 0) && (saw_venus_raw == 0)) ;  // survey completed
   else if(rtime == 0) { // PVT mode
      rcvr_mode = RCVR_MODE_3D;
   }
   else if(rtime == 1) {  // surveying
      minor_alarms |= (MINOR_SURVEY);
      rcvr_mode = RCVR_MODE_SURVEY;
   }
   else if(rtime == 2) {  // position hold
      venus_hold_mode = 1;
      rcvr_mode = RCVR_MODE_HOLD;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x85312(%rip), %rdi     # 0x10e890
callq 0x520bf
leaq 0x29e86a(%rip), %r14    # 0x327df4
cmpl $0x0, (%r14)
jne 0x89595
callq 0x7700f
leaq 0x26de8c(%rip), %rax    # 0x2f7428
orb $0x4, (%rax)
callq 0x51c47
callq 0x51cf3
callq 0x51cf3
callq 0x51e6f
callq 0x51e6f
callq 0x51dc3
callq 0x51c47
movl %eax, %ebx
callq 0x51cf3
movl %eax, %ecx
leaq 0x26e8a6(%rip), %rax    # 0x2f7e78
movq (%rax), %rsi
testq %rsi, %rsi
jle 0x895e9
imull $0x64, %ecx, %eax
xorl %edx, %edx
divq %rsi
pushq $0x64
popq %rdx
subl %eax, %edx
jmp 0x895ec
pushq $-0x1
popq %rdx
leaq 0x26e899(%rip), %rax    # 0x2f7e8c
movl %edx, (%rax)
leaq 0x26e894(%rip), %rax    # 0x2f7e90
movl $0x4, (%rax)
leaq 0x26dbcf(%rip), %rax    # 0x2f71d8
movl (%rax), %edx
movl %edx, %esi
andl $-0x21, %esi
movl %esi, (%rax)
leaq 0x26daba(%rip), %rsi    # 0x2f70d3
movb $0x0, (%rsi)
orl (%r14), %ecx
je 0x8964d
testb %bl, %bl
je 0x89642
movzbl %bl, %ecx
cmpl $0x2, %ecx
je 0x8963b
cmpl $0x1, %ecx
jne 0x8964d
orl $0x20, %edx
movl %edx, (%rax)
movb $0xb, %al
jmp 0x89644
movb $0x1, (%rsi)
movb $0x7, %al
jmp 0x89644
movb $0x4, %al
leaq 0x26da85(%rip), %rcx    # 0x2f70d0
movb %al, (%rcx)
popq %rbx
popq %r14
popq %rbp
retq