LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_x72_response(int)
void parse_x72_response(int id)
{
   // prepare to decode the multi-line query response

   x72_response = id;
// if(debug_file) fprintf(debug_file, "X72 %d start (%s)\n", id, nmea_msg);
   x72_line = 0;
   scpi_col = 0;
   scpi_status_line[0] = 0;

   strcpy(scpi_status_line, nmea_msg);  // record the first line of the response
   parse_x72_val(x72_response);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
movl %edi, 0x2deb1f(%rip)    # 0x36cbcc
xorl %eax, %eax
movl %eax, 0x2deb1b(%rip)    # 0x36cbd0
movl %eax, 0x2deb09(%rip)    # 0x36cbc4
movb $0x0, 0x2dea7e(%rip)    # 0x36cb40
leaq 0x2dea77(%rip), %rdi    # 0x36cb40
leaq 0x2ad760(%rip), %rsi    # 0x33b830
callq 0x9340
movl %ebx, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x8e0e2
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: info_param(char*)
char *info_param(char *param)
{
int len;
char *s;

   if(param == 0) return 0;

   len = strlen(param);
   s = strstr(scpi_status_line, param);
   if(s) {
      return (s+len+1);
   }

   return 0;
}

// Assembly:
testq %rdi, %rdi
je 0x8f486
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x2dd6dc(%rip), %rdi    # 0x36cb40
movq %rbx, %rsi
callq 0x9090
testq %rax, %rax
je 0x8f489
movq %rax, %r14
movq %rbx, %rdi
callq 0x9120
cltq
addq %r14, %rax
incq %rax
jmp 0x8f48b
xorl %eax, %eax
retq
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: decode_x72_creg()
void decode_x72_creg()
{
   // set various flags based upon the control reg value

   if(x72_creg & 0x0008) pps_enabled = 0;
   else                  pps_enabled = 1;

   if(x72_creg & 0x0040) x72_sine_level = 0;
   else {
      x72_sine_level = 40;
      if(x72_creg & 0x0080) x72_sine_level += 30;
      if(x72_creg & 0x0100) x72_sine_level += 20;
      if(x72_creg & 0x0200) x72_sine_level += 10;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x18b5d3(%rip), %rax    # 0x21add8
movl (%rax), %eax
testb $0x8, %al
leaq 0x27e510(%rip), %rcx    # 0x30dd20
sete (%rcx)
xorl %ecx, %ecx
testb $0x40, %al
jne 0x8f844
testb %al, %al
movl $0x28, %ecx
movl $0x46, %edx
cmovnsl %ecx, %edx
leal 0x14(%rdx), %ecx
btl $0x8, %eax
cmovael %edx, %ecx
leaq 0x18b5bf(%rip), %rdx    # 0x21adf8
movl %ecx, (%rdx)
btl $0x9, %eax
jae 0x8f84d
addl $0xa, %ecx
leaq 0x18b5ad(%rip), %rax    # 0x21adf8
movl %ecx, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: x72_sync_fail(int)
int x72_sync_fail(int id)
{
int flag;
   // return true is message response is not valid for the requested message
   // !!!!! this routines needs to be more robust...  we currently only
   //       check for health response to a non-health request

   flag = 0;
   if(strstr(scpi_status_line, "ADATA") && (id != X72_HEALTH_MSG)) {  // health response
      need_x72_resync = id;
      flag = 1;
   }
   else if(strstr(scpi_status_line, "CONTROL REG") && (id != X72_GET_CREG_MSG)) {  // health response
      need_x72_resync = id;
      flag = 1;
   }
   else if(strstr(scpi_status_line, "DELTA REG") && (id != X72_GET_PPS_MSG)) {  // health response
      need_x72_resync = id;
      flag = 1;
   }

   if(flag) {  // unexpected response to a query was seen
      if(debug_file) fprintf(debug_file, "\n###! x72 msg %d sync fail! (%s)\n\n", id, scpi_status_line);
      return 1;
   }

   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
leaq 0x2dd2e1(%rip), %rdi    # 0x36cb40
leaq 0x94573(%rip), %rsi     # 0x123dd9
callq 0x9090
cmpl $0x2c9, %ebx            # imm = 0x2C9
je 0x8f878
testq %rax, %rax
jne 0x8f8bb
leaq 0x2dd2c1(%rip), %rdi    # 0x36cb40
leaq 0x94559(%rip), %rsi     # 0x123ddf
callq 0x9090
cmpl $0x2c5, %ebx            # imm = 0x2C5
je 0x8f898
testq %rax, %rax
jne 0x8f8bb
leaq 0x2dd2a1(%rip), %rdi    # 0x36cb40
leaq 0x94545(%rip), %rsi     # 0x123deb
callq 0x9090
xorl %r14d, %r14d
cmpl $0x2c1, %ebx            # imm = 0x2C1
je 0x8f8ed
testq %rax, %rax
je 0x8f8ed
movl %ebx, 0x2dd317(%rip)    # 0x36cbd8
leaq 0x1aeac8(%rip), %rax    # 0x23e390
movq (%rax), %rdi
movl $0x1, %r14d
testq %rdi, %rdi
je 0x8f8ed
leaq 0x94518(%rip), %rsi     # 0x123df5
leaq 0x2dd25c(%rip), %rcx    # 0x36cb40
movl %ebx, %edx
xorl %eax, %eax
callq 0x9560
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: get_x72_message()
void get_x72_message()
{
u08 c;
static int row=0;

   // This routine buffers up an incoming X72 message.  When the end of the
   // message is seen, the message is parsed and decoded with decode_x72_msg()

   if(SERIAL_DATA_AVAILABLE(RCVR_PORT) == 0) {
      check_com_timer(RCVR_PORT);
      return;
   }
   else {
      reset_com_timer(RCVR_PORT);
   }

   c = get_com_char();
   if(c == 0x0D) return;  // ignore CR,  we end if LF char

   if(x72_response) {     // we are reading multi-line response query results
      get_x72_response(c);
      return;
   }

   if(com[RCVR_PORT].rcv_error) {      // parity/framing/overrun errors
      com[RCVR_PORT].rcv_error = 0;
//!!!!!qqqq    goto rst_msg;
   }

   if(tsip_sync == 0) {    // syncing to start of message
      tsip_sync = 1;
      get_sync_time();

      tsip_wptr = 0;
      tsip_rptr = 0;
      goto get_msg;
   }
   else if(tsip_sync == 1) { // message start has been seen, now build the message
      get_msg:
      if(c == 0x0A) goto x72_end; 
      else if(c == 0x0D) goto x72_end; 

      if(tsip_wptr < (MAX_TSIP-2)) {  // add char to the message buffer
         tsip_buf[tsip_wptr++] = c;
         tsip_buf[tsip_wptr] = 0;
         if((tsip_buf[0] == 'r') && (tsip_buf[1] == '>')) {  // command prompt
            goto x72_end;
         }
      }
      else {  // buffer overlow
         goto rst_msg;
      }
   }
   else {
      x72_end:
      if(tsip_wptr > 0) {
         decode_x72_msg(2);
         packet_end = 1;
      }

      rst_msg:
      tsip_sync = 0;
      tsip_rptr = 0;
      tsip_wptr = 0;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl $0xa, %edi
callq 0xb9ad
movl $0xa, %edi
testl %eax, %eax
je 0x8fa94
callq 0x1ea0b
callq 0x584bd
cmpl $0xd, %eax
je 0x8fb6a
movl %eax, %ebx
cmpl $0x0, 0x2dd146(%rip)    # 0x36cbcc
je 0x8fa9d
movsbl %bl, %edi
popq %rbx
popq %r14
popq %rbp
jmp 0x8f91a
popq %rbx
popq %r14
popq %rbp
jmp 0x1e66a
leaq 0x27e83c(%rip), %rax    # 0x30e2e0
cmpb $0x0, 0x17a12(%rax)
je 0x8fab4
movb $0x0, 0x17a12(%rax)
leaq 0x2a879b(%rip), %r14    # 0x338256
movzwl (%r14), %eax
testw %ax, %ax
je 0x8fae6
cmpw $0x1, %ax
setne %al
cmpl $0xa, %ebx
sete %cl
orb %al, %cl
leaq 0x2a8778(%rip), %rax    # 0x338252
movzwl (%rax), %eax
je 0x8fb06
testw %ax, %ax
jne 0x8fb3c
jmp 0x8fb50
movw $0x1, (%r14)
callq 0x58672
leaq 0x2a875c(%rip), %rax    # 0x338254
movw $0x0, (%rax)
cmpl $0xa, %ebx
je 0x8fb50
xorl %eax, %eax
jmp 0x8fb11
movzwl %ax, %ecx
cmpl $0xffd, %ecx            # imm = 0xFFD
ja 0x8fb50
movzwl %ax, %ecx
leaq 0x1(%rcx), %rax
leaq 0x2a8733(%rip), %rdx    # 0x338252
movw %ax, (%rdx)
leaq 0x2a7727(%rip), %rax    # 0x337250
movb %bl, (%rax,%rcx)
movb $0x0, 0x1(%rax,%rcx)
cmpb $0x72, (%rax)
jne 0x8fb6a
cmpb $0x3e, 0x1(%rax)
jne 0x8fb6a
movl $0x2, %edi
callq 0x8efa9
movl $0x1, 0x2dc144(%rip)    # 0x36bc94
xorl %eax, %eax
movw %ax, (%r14)
leaq 0x2a86f7(%rip), %rcx    # 0x338254
movw %ax, (%rcx)
leaq 0x2a86eb(%rip), %rcx    # 0x338252
movw %ax, (%rcx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: set_x72_efc(int)
void set_x72_efc(int val)
{
   // set the X72 EFC input enabled
   if(read_only) return;

   last_x72_efc = val;
   user_set_x72_efc = 1;
   save_x72_state();

   val &= 1;
   sprintf(out, "a%d", val);
   queue_x72_cmd(out, X72_SET_FC_MSG);
///   queue_x72_cmd("i", X72_INFO_MSG);
}

// Assembly:
leaq 0x2a74a4(%rip), %rax    # 0x33701a
cmpb $0x0, (%rax)
je 0x8fb7c
retq
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
leaq 0x18b344(%rip), %rax    # 0x21aed0
movl %edi, (%rax)
leaq 0x18b32f(%rip), %rax    # 0x21aec4
movl $0x1, (%rax)
callq 0x6be07
andl $0x1, %ebx
leaq 0x2ac676(%rip), %r14    # 0x33c220
leaq 0x9436f(%rip), %rsi     # 0x123f20
movq %r14, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x9060
movq %r14, %rdi
movl $0x2bc, %esi            # imm = 0x2BC
popq %rbx
popq %r14
popq %rbp
jmp 0x5edda
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: set_x72_tic(int)
void set_x72_tic(int val)
{
   // set the X72 PPS TIC offset value
   if(read_only) return;

   if(val < 0) {
      val = IABS(val) % ((int) x72_osc);
      if(val) val = ((int) x72_osc) - val;
   }
   else {
      val = (val % (int) x72_osc);
   }

   last_x72_tic = val;
   user_set_x72_tic = 1;
   save_x72_state();

   sprintf(out, "k%d", val);
   queue_x72_cmd(out, X72_SET_TIC_MSG);
   x72_tic_timer = 6;  // it takes 6 seconds for a TIC change to take effect
   x72_tic_changed = 1;
}

// Assembly:
leaq 0x2a7445(%rip), %rax    # 0x33701a
cmpb $0x0, (%rax)
je 0x8fbdb
retq
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x18b07c(%rip), %rax    # 0x21ac68
cvttsd2si (%rax), %ecx
movl %edi, %eax
cltd
idivl %ecx
movl %edx, %ebx
addl %edx, %ecx
testl %edx, %edx
cmovel %edx, %ecx
testl %edi, %edi
cmovsl %ecx, %ebx
leaq 0x18b2ce(%rip), %rax    # 0x21aed8
movl %ebx, (%rax)
leaq 0x18b2ad(%rip), %rax    # 0x21aec0
movl $0x1, %r15d
movl %r15d, (%rax)
callq 0x6be07
leaq 0x2ac5f8(%rip), %r14    # 0x33c220
leaq 0x942f5(%rip), %rsi     # 0x123f24
movq %r14, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x9060
movq %r14, %rdi
movl $0x2c2, %esi            # imm = 0x2C2
callq 0x5edda
leaq 0x18b2e9(%rip), %rax    # 0x21af38
movl $0x6, (%rax)
movl %r15d, 0x2dcf98(%rip)   # 0x36cbf4
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: set_x72_acmos_freq(int)
void set_x72_acmos_freq(int val)
{
   // set the X72 ACMOS freq
   if(read_only) return;

   last_x72_acmos_freq = val;
   user_set_x72_acmos_freq = 1;
   save_x72_state();

   sprintf(out, "o%d", val);
   queue_x72_cmd(out, X72_SET_FREQ_MSG);
}

// Assembly:
leaq 0x2a73ac(%rip), %rax    # 0x33701a
cmpb $0x0, (%rax)
je 0x8fc74
retq
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
leaq 0x18b248(%rip), %rax    # 0x21aecc
movl %edi, (%rax)
leaq 0x18b22b(%rip), %rax    # 0x21aeb8
movl $0x1, (%rax)
callq 0x6be07
leaq 0x2ac581(%rip), %r14    # 0x33c220
leaq 0x94288(%rip), %rsi     # 0x123f2e
movq %r14, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x9060
movq %r14, %rdi
movl $0x2c4, %esi            # imm = 0x2C4
popq %rbx
popq %r14
popq %rbp
jmp 0x5edda
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: set_x72_srvc(int)
void set_x72_srvc(int val)
{
   // set the X72 service pin polarity
   if(read_only) return;

   last_x72_srvc = val;
   user_set_x72_srvc = 1;
   save_x72_state();

   val &= 1;
   sprintf(out, "l%d", val);
   queue_x72_cmd(out, X72_SET_SRVC_MSG);
///   queue_x72_cmd("i", X72_INFO_MSG);
}

// Assembly:
leaq 0x2a7350(%rip), %rax    # 0x33701a
cmpb $0x0, (%rax)
je 0x8fcd0
retq
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
leaq 0x18b1fc(%rip), %rax    # 0x21aedc
movl %edi, (%rax)
leaq 0x18b1df(%rip), %rax    # 0x21aec8
movl $0x1, (%rax)
callq 0x6be07
andl $0x1, %ebx
leaq 0x2ac522(%rip), %r14    # 0x33c220
leaq 0x94233(%rip), %rsi     # 0x123f38
movq %r14, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x9060
movq %r14, %rdi
movl $0x2c3, %esi            # imm = 0x2C3
popq %rbx
popq %r14
popq %rbp
jmp 0x5edda
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: x72_start_discipline()
void x72_start_discipline()
{
   // enable X72 discipline algorithm... based upon the outline in the
   // X72 manual

   x72_user_dis = 1;  // we are doing software disciplining
   x72_user_state = X72_STATE_START0;
   x72_init_done = 0;
   x72_1pps_present = 0;
   x72_start_timer = 0;

   if(pps_enabled == 0) {  // PPS output must be enabled in order for TIC command to work
      user_pps_enable = 1;
      set_pps(user_pps_enable, pps_polarity,  delay_value, pps1_delay,  pps_threshold, 4);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x18b1c3(%rip), %rax    # 0x21aef0
movl $0x1, (%rax)
xorl %eax, %eax
movl %eax, 0x2dcea9(%rip)    # 0x36cbe4
movl %eax, 0x2e68d7(%rip)    # 0x376618
movl %eax, 0x2e68d5(%rip)    # 0x37661c
movl %eax, 0x2e690b(%rip)    # 0x376658
leaq 0x27dfcc(%rip), %rax    # 0x30dd20
cmpb $0x0, (%rax)
je 0x8fd5b
popq %rbp
retq
leaq 0x27dfbf(%rip), %rax    # 0x30dd21
movb $0x1, (%rax)
leaq 0x27dfac(%rip), %rax    # 0x30dd18
movzbl (%rax), %esi
leaq 0x27e04a(%rip), %rax    # 0x30ddc0
movsd (%rax), %xmm0
leaq 0x27e057(%rip), %rax    # 0x30ddd8
movsd (%rax), %xmm1
leaq 0x27df90(%rip), %rax    # 0x30dd1c
movss (%rax), %xmm2
movl $0x1, %edi
movl $0x4, %edx
popq %rbp
jmp 0x6add8
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: x72_reset_filter()
void x72_reset_filter(void)
{
   x72_dds_count = 0;
   x72_dds_list[0] = 0.0;
   x72_dds_in = x72_dds_out = 0;
   x72_dds_sum = 0.0;
   filtered_dds = 0.0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x18b17d(%rip), %rax    # 0x21af28
xorl %ecx, %ecx
movl %ecx, (%rax)
movq %rcx, 0x2e697a(%rip)    # 0x376730
movl %ecx, 0x2e9f74(%rip)    # 0x379d30
movl %ecx, 0x2e9f72(%rip)    # 0x379d34
movq %rcx, 0x2e9f5f(%rip)    # 0x379d28
movq %rcx, 0x2e9f68(%rip)    # 0x379d38
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: zpad(char*, int)
void zpad(char *s, int n)
{
int i;
int minus;

   // replace blanks in a string with '0'

   if(s == 0) return;

   minus = 0;
   for(i=0; i<n; i++) {
      if(s[i] == 0) return;
      if(s[i] == ' ') s[i] = '0';
      if(s[i] == '-') {
         s[i] = '0';
         minus = 1;
      }
   }
   if(minus && (s[0] == '0')) s[0] = '-';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
sete %al
testl %esi, %esi
setle %cl
orb %al, %cl
jne 0x8fe3b
movl %esi, %eax
negq %rax
movb $0x1, %cl
xorl %edx, %edx
incq %rdx
movzbl -0x1(%rdi,%rdx), %esi
cmpl $0x20, %esi
je 0x8fe06
testl %esi, %esi
je 0x8fe3b
cmpl $0x2d, %esi
jne 0x8fe0b
jmp 0x8fe1d
movb $0x30, -0x1(%rdi,%rdx)
leaq (%rax,%rdx), %rsi
incq %rsi
incq %rdx
cmpq $0x1, %rsi
jne 0x8fdf1
jmp 0x8fe2e
movb $0x30, -0x1(%rdi,%rdx)
xorl %ecx, %ecx
movq %rax, %rsi
addq %rdx, %rsi
jne 0x8fdee
jmp 0x8fe33
testb $0x1, %cl
jne 0x8fe3b
cmpb $0x30, (%rdi)
jne 0x8fe3b
movb $0x2d, (%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_hbsq()
void parse_star_hbsq()  
{
char *s;

   // output squelch control

   log_packet_id("Star HBSQ");
   user_hbsq = current_hbsq = (-1);

   if(get_msg_field()) { 
      user_hbsq = atoi(msg_field);
      have_star_hbsq |= 0x01;
   }

   if(star_type == OSA_TYPE) {
      s = strchr(nmea_msg, '/');
      if(s) {
         s = s + 1;
         zpad(s,4);
         current_hbsq = atoi(s);
         have_star_hbsq |= 0x02;
      }
   }
   else {
      if(get_msg_field()) { 
         current_hbsq = atoi(msg_field);
         have_star_hbsq |= 0x02;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x93bf8(%rip), %rdi     # 0x124175
callq 0x58dc2
leaq 0x2ad7bb(%rip), %r14    # 0x33dd44
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, (%r14)
leaq 0x2ad7a8(%rip), %rbx    # 0x33dd40
movl %eax, (%rbx)
callq 0x810b1
testl %eax, %eax
je 0x905bb
leaq 0x2ab496(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, (%rbx)
leaq 0x2ad790(%rip), %rax    # 0x33dd48
orb $0x1, (%rax)
leaq 0x18aa26(%rip), %rax    # 0x21afe8
cmpl $0x4f, (%rax)
jne 0x905f2
leaq 0x2ab262(%rip), %rdi    # 0x33b830
movl $0x2f, %esi
callq 0x9100
testq %rax, %rax
je 0x90617
movq %rax, %rbx
incq %rbx
movq %rbx, %rdi
movl $0x4, %esi
callq 0x8fdd2
jmp 0x90602
callq 0x810b1
testl %eax, %eax
je 0x90617
leaq 0x2ab43e(%rip), %rbx    # 0x33ba40
movq %rbx, %rdi
callq 0x95e0
movl %eax, (%r14)
leaq 0x2ad734(%rip), %rax    # 0x33dd48
orb $0x2, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: fake_second_check(int)
void fake_second_check(int why)
{
double this_msec;

   // This routine checks to see if we need to fake a time message for receivers
   // that only send time every other second or for SCPI type receivers that
   // take a long time to process the SYST:STAT? message

if((why < 10) && (rcvr_type == UCCM_RCVR)) return;

   if(fake_msec) {                     // fake time stamp enabled
      this_msec = GetMsecs();
if(0 && debug_file) fprintf(debug_file, "fsc %d: this:%f fake:%f  count:%d\n", why, this_msec, fake_msec, fake_count);
      if(this_msec >= (fake_msec)) {  // it's time to fake it
         fake_missing_second(-1.000);  // negative value adds a second
         fake_msec += 1000.0;  // !!!! (1000.0 / nav_rate)?
         if(++fake_count > MAX_FAKE_COUNT) {
if(0 && debug_file) fprintf(debug_file, "fsc reset!  count=%d\n", fake_count);
            fake_count = 0;
            fake_msec = 0.0;  // limit number of consecutive faked seconds
         }
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
cmpl $0xa, %edi
setge %al
leaq 0x187d85(%rip), %rcx    # 0x2188d0
cmpq $0x8, (%rcx)
setne %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x90bbd
leaq 0x27cb98(%rip), %rbx    # 0x30d6f8
movsd (%rbx), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x90b70
jnp 0x90bbd
callq 0xae92
ucomisd (%rbx), %xmm0
jb 0x90bbd
movsd 0x78575(%rip), %xmm0    # 0x1090f8
callq 0x90920
movsd (%rbx), %xmm0
addsd 0x784a4(%rip), %xmm0    # 0x109038
movsd %xmm0, (%rbx)
movl 0x2e12ba(%rip), %eax    # 0x371e58
leal 0x1(%rax), %ecx
movl %ecx, 0x2e12b1(%rip)    # 0x371e58
cmpl $0xa, %eax
jl 0x90bbd
movl $0x0, 0x2e12a2(%rip)    # 0x371e58
movq $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_output()
void parse_star_output()
{
   // !!!! 4531
   log_packet_id("Star output");
   if(get_msg_field()) {
      if(strstr(msg_field, "E1")) {
         osa_output_type = 1;
         have_osa_output = 1;
      }
      else if(strstr(msg_field, "FR")) {
         osa_output_type = 2;
         have_osa_output = 1;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x92b12(%rip), %rdi     # 0x1242c0
callq 0x58dc2
callq 0x810b1
testl %eax, %eax
je 0x9180c
leaq 0x2aa27d(%rip), %rdi    # 0x33ba40
leaq 0x92c17(%rip), %rsi     # 0x1243e1
callq 0x9090
movl $0x1, %ecx
testq %rax, %rax
jne 0x917f6
leaq 0x2aa260(%rip), %rdi    # 0x33ba40
leaq 0x92c09(%rip), %rsi     # 0x1243f0
callq 0x9090
movl $0x2, %ecx
testq %rax, %rax
je 0x9180c
leaq 0x2ac56f(%rip), %rax    # 0x33dd6c
movl %ecx, (%rax)
leaq 0x2ac562(%rip), %rax    # 0x33dd68
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_prior()
void parse_star_prior()
{
   // !!!! 4531
   log_packet_id("Star priority");
   if(get_msg_field()) {
      osa_gps_prior = msg_field[0] - '0';
      osa_aux_prior = msg_field[1] - '0';
      have_osa_prior = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x92ab3(%rip), %rdi     # 0x1242cc
callq 0x58dc2
callq 0x810b1
testl %eax, %eax
je 0x9185a
leaq 0x2aa212(%rip), %rax    # 0x33ba40
movsbl (%rax), %ecx
addl $-0x30, %ecx
leaq 0x2ac525(%rip), %rdx    # 0x33dd60
movl %ecx, (%rdx)
movsbl 0x1(%rax), %eax
addl $-0x30, %eax
leaq 0x2ac519(%rip), %rcx    # 0x33dd64
movl %eax, (%rcx)
leaq 0x2ac508(%rip), %rax    # 0x33dd5c
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_aux_inp()
void parse_star_aux_inp()
{
   // !!!! 4531
   log_packet_id("Star aux time");
   if(get_msg_field()) {
      osa_aux_c = msg_field[0] - '0';
      osa_aux_t = msg_field[1] - '0';
      have_osa_aux = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x92a73(%rip), %rdi     # 0x1242da
callq 0x58dc2
callq 0x810b1
testl %eax, %eax
je 0x918a8
leaq 0x2aa1c4(%rip), %rax    # 0x33ba40
movsbl (%rax), %ecx
addl $-0x30, %ecx
leaq 0x2ac4eb(%rip), %rdx    # 0x33dd74
movl %ecx, (%rdx)
movsbl 0x1(%rax), %eax
addl $-0x30, %eax
leaq 0x2ac4df(%rip), %rcx    # 0x33dd78
movl %eax, (%rcx)
leaq 0x2ac4ce(%rip), %rax    # 0x33dd70
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_adm()
void parse_star_adm()
{
   // !!!! 4531
   log_packet_id("Star adm");
   if(get_msg_field()) {
      osa_gps_adm = msg_field[0] - '0';
      osa_aux_adm = msg_field[1] - '0';
      have_osa_adm = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x92a33(%rip), %rdi     # 0x1242e8
callq 0x58dc2
callq 0x810b1
testl %eax, %eax
je 0x918f6
leaq 0x2aa176(%rip), %rax    # 0x33ba40
movsbl (%rax), %ecx
addl $-0x30, %ecx
leaq 0x2ac4a9(%rip), %rdx    # 0x33dd80
movl %ecx, (%rdx)
movsbl 0x1(%rax), %eax
addl $-0x30, %eax
leaq 0x2ac49d(%rip), %rcx    # 0x33dd84
movl %eax, (%rcx)
leaq 0x2ac48c(%rip), %rax    # 0x33dd7c
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_perf()
void parse_star_perf()
{
   // holdover performance

   log_packet_id("Star perf");
   if(get_msg_field()) {
      star_hold_perf = atoi(msg_field);  // 0=disable  1=enable
      have_star_perf = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x921dd(%rip), %rdi     # 0x1243b2
callq 0x58dc2
callq 0x810b1
testl %eax, %eax
je 0x92202
leaq 0x2a9856(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, 0x2daa27(%rip)    # 0x36cc1c
leaq 0x27b1d8(%rip), %rax    # 0x30d3d4
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_star_wtr()
void parse_star_wtr()
{
char *s;

   // wait to restore
   log_packet_id("Star WTR");

   if(get_msg_field()) {
      star_wtr = atoi(msg_field) * 10;
      have_star_wtr |= 0x01;
   }

   s = strchr(nmea_msg, '/');
   if(s) {
      ++s;
      zpad(s, 4);
      star_wtr_timer = atoi(s);
      have_star_wtr |= 0x02;
   }

   s = strchr(s, '/');
   if(s) { // !!!! 4531 aux timer
      ++s;
      zpad(s, 4);
      star_aux_timer = atoi(s);
      have_star_wtr |= 0x04;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x921aa(%rip), %rdi     # 0x1243bc
callq 0x58dc2
callq 0x810b1
testl %eax, %eax
je 0x92244
leaq 0x2a9819(%rip), %rdi    # 0x33ba40
callq 0x95e0
addl %eax, %eax
leal (%rax,%rax,4), %eax
leaq 0x2abaf8(%rip), %rcx    # 0x33dd30
movl %eax, (%rcx)
leaq 0x27b197(%rip), %rax    # 0x30d3d8
orb $0x1, (%rax)
leaq 0x2a95e5(%rip), %rdi    # 0x33b830
movl $0x2f, %esi
callq 0x9100
leaq 0x1(%rax), %rbx
movq %rbx, %rdi
movl $0x4, %esi
callq 0x8fdd2
movq %rbx, %rdi
callq 0x95e0
leaq 0x2ababf(%rip), %rcx    # 0x33dd34
movl %eax, (%rcx)
leaq 0x27b15a(%rip), %r14    # 0x30d3d8
orb $0x2, (%r14)
movq %rbx, %rdi
movl $0x2f, %esi
callq 0x9100
testq %rax, %rax
je 0x922bc
movq %rax, %rbx
incq %rbx
movq %rbx, %rdi
movl $0x4, %esi
callq 0x8fdd2
movq %rbx, %rdi
callq 0x95e0
leaq 0x2aba82(%rip), %rcx    # 0x33dd38
movl %eax, (%rcx)
orb $0x4, (%r14)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: set_star_hbsq(int)
void set_star_hbsq(int secs)
{
   if(read_only) return;

   sprintf(out, "HBSQ=%d;", secs);
   queue_star_cmd(out, STAR_HBSQ_MSG);

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

// Assembly:
leaq 0x2a4d52(%rip), %rax    # 0x33701a
cmpb $0x0, (%rax)
je 0x922ce
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %edx
leaq 0x2a9f43(%rip), %rbx    # 0x33c220
leaq 0x920e1(%rip), %rsi     # 0x1243c5
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
movl $0xcc, %esi
callq 0x5edda
movw $0x3b, 0x4(%rbx)
movl $0x51534248, (%rbx)     # imm = 0x51534248
movq %rbx, %rdi
movl $0xda, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5edda
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: set_star_wtr(int)
void set_star_wtr(int secs)
{
   if(read_only) return;

   sprintf(out, "WTR=%d", secs/10);
   queue_star_cmd(out, STAR_WTR_MSG);

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

// Assembly:
leaq 0x2a4cf9(%rip), %rax    # 0x33701a
cmpb $0x0, (%rax)
je 0x92327
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movslq %edi, %rax
imulq $0x66666667, %rax, %rdx # imm = 0x66666667
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x22, %rdx
addl %eax, %edx
leaq 0x2a9ed5(%rip), %rbx    # 0x33c220
leaq 0x9207c(%rip), %rsi     # 0x1243ce
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
movl $0xda, %esi
callq 0x5edda
movl $0x525457, (%rbx)       # imm = 0x525457
movq %rbx, %rdi
movl $0xda, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5edda
// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: set_star_output(int)
void set_star_output(int mode)
{
   // !!!! 4531
   if(read_only) return;

   if(mode == 1) sprintf(out, "OUTPUT_TYPE=E1");
   else if(mode == 2) sprintf(out, "OUTPUT_TYPE=FR");
   else return;
   queue_star_cmd(out, STAR_OUTPUT_MSG);
   queue_star_cmd("OUTPUT_TYPE", STAR_OUTPUT_MSG);
}

// Assembly:
leaq 0x2a4c91(%rip), %rax    # 0x33701a
cmpb $0x0, (%rax)
je 0x9238f
retq
cmpl $0x2, %edi
je 0x923ac
cmpl $0x1, %edi
jne 0x9238e
leaq 0x2a9e80(%rip), %rax    # 0x33c220
movabsq $0x31453d45505954, %rcx # imm = 0x31453D45505954
jmp 0x923bd
leaq 0x2a9e6d(%rip), %rax    # 0x33c220
movabsq $0x52463d45505954, %rcx # imm = 0x52463D45505954
movq %rcx, 0x7(%rax)
movabsq $0x545f54555054554f, %rcx # imm = 0x545F54555054554F
movq %rcx, (%rax)
pushq %rbp
movq %rsp, %rbp
leaq 0x2a9e47(%rip), %rdi    # 0x33c220
movl $0xe0, %esi
callq 0x5edda
leaq 0x92009(%rip), %rdi     # 0x1243f3
movl $0xe0, %esi
popq %rbp
jmp 0x5edda
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2a4c1e(%rip), %rax    # 0x33701a
cmpb $0x0, (%rax)
je 0x92402
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %esi, %ecx
movl %edi, %edx
leaq 0x2a9e0d(%rip), %rbx    # 0x33c220
leaq 0x91fe5(%rip), %rsi     # 0x1243ff
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
movl $0xe1, %esi
callq 0x5edda
leaq 0x91fd8(%rip), %rdi     # 0x124410
movl $0xe1, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5edda
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2a4bcb(%rip), %rax    # 0x33701a
cmpb $0x0, (%rax)
je 0x92455
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %esi, %ecx
movl %edi, %edx
leaq 0x2a9dba(%rip), %rbx    # 0x33c220
leaq 0x91faf(%rip), %rsi     # 0x12441c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
movl $0xde, %esi
callq 0x5edda
leaq 0x91fa0(%rip), %rdi     # 0x12442b
movl $0xde, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5edda
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2a4b78(%rip), %rax    # 0x33701a
cmpb $0x0, (%rax)
je 0x924a8
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %esi, %ecx
movl %edi, %edx
leaq 0x2a9d67(%rip), %rbx    # 0x33c220
leaq 0x91f75(%rip), %rsi     # 0x124435
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
movl $0xe2, %esi
callq 0x5edda
leaq 0x91f66(%rip), %rdi     # 0x124444
movl $0xe2, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5edda
// File: /workspace/github_cpp_makefile_star2_O3/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 0x2a4b25(%rip), %rax    # 0x33701a
cmpb $0x0, (%rax)
je 0x924fb
retq
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x2a9d17(%rip), %rbx    # 0x33c220
movabsq $0x5350475f525457, %rax # imm = 0x5350475F525457
movq %rax, 0x6(%rbx)
movabsq $0x54575f5241454c43, %r14 # imm = 0x54575F5241454C43
movq %r14, (%rbx)
movq %rbx, %rdi
movl $0xdb, %esi
callq 0x5edda
leaq 0x188ab4(%rip), %rax    # 0x21afec
cmpl $0x11b2, (%rax)         # imm = 0x11B2
je 0x9255e
movabsq $0x5855415f525457, %rax # imm = 0x5855415F525457
movq %rax, 0x6(%rbx)
movq %r14, (%rbx)
movq %rbx, %rdi
movl $0xdc, %esi
callq 0x5edda
movl $0x525457, (%rbx)       # imm = 0x525457
movq %rbx, %rdi
movl $0xda, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x5edda
// File: /workspace/github_cpp_makefile_star2_O3/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 0x91eea(%rip), %rdi     # 0x12446a
callq 0x58dc2
callq 0x810b1
testl %eax, %eax
je 0x925aa
leaq 0x2a94ab(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, 0x2da680(%rip)    # 0x36cc20
leaq 0x27ae35(%rip), %rax    # 0x30d3dc
orb $0x1, (%rax)
callq 0x810b1
testl %eax, %eax
je 0x925cf
leaq 0x2a9486(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, 0x2da65f(%rip)    # 0x36cc24
leaq 0x27ae10(%rip), %rax    # 0x30d3dc
orb $0x2, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x91e98(%rip), %rdi     # 0x124474
callq 0x58dc2
callq 0x810b1
testl %eax, %eax
je 0x92616
leaq 0x2a944f(%rip), %rdi    # 0x33ba40
callq 0x9470
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x27a413(%rip), %rax    # 0x30ca18
movsd %xmm0, (%rax)
leaq 0x27ac3c(%rip), %rax    # 0x30d24c
movl $0x6a, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x91e60(%rip), %rdi     # 0x124485
callq 0x58dc2
callq 0x810b1
testl %eax, %eax
je 0x926de
leaq 0x2a9402(%rip), %rdi    # 0x33ba40
leaq 0x94fd4(%rip), %rsi     # 0x127619
callq 0x9090
testq %rax, %rax
jne 0x926de
leaq 0x18898e(%rip), %rax    # 0x21afe8
cmpl $0x4f, (%rax)
jne 0x926bf
leaq 0x2a93da(%rip), %rbx    # 0x33ba40
movq %rbx, %rdi
callq 0x9899
movq %rbx, %rdi
movl $0x45, %esi
callq 0x9100
movl $0x1, %ecx
testq %rax, %rax
jne 0x926a0
leaq 0x2a93b4(%rip), %rdi    # 0x33ba40
movl $0x44, %esi
callq 0x9100
xorl %ecx, %ecx
testq %rax, %rax
sete %cl
addl %ecx, %ecx
movl %ecx, 0x2da572(%rip)    # 0x36cc18
leaq 0x27ac23(%rip), %rax    # 0x30d2d0
movl $0x59, (%rax)
leaq 0x27b666(%rip), %rax    # 0x30dd20
movb $0x1, (%rax)
jmp 0x926de
leaq 0x2a937a(%rip), %rdi    # 0x33ba40
callq 0x95e0
movl %eax, 0x2da547(%rip)    # 0x36cc18
leaq 0x27abf8(%rip), %rax    # 0x30d2d0
movl $0x58, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x91d9e(%rip), %rdi     # 0x12448e
callq 0x58dc2
leaq 0x2ab623(%rip), %rax    # 0x33dd1f
xorl %ecx, %ecx
movb %cl, (%rax)
leaq 0x2ab60b(%rip), %rax    # 0x33dd12
movb %cl, (%rax)
callq 0x810b1
testl %eax, %eax
je 0x92729
leaq 0x2a9327(%rip), %rsi    # 0x33ba40
movb $0x0, 0xc(%rsi)
leaq 0x2ab5ee(%rip), %rdi    # 0x33dd12
callq 0x9340
callq 0x810b1
testl %eax, %eax
je 0x9274a
leaq 0x2a9307(%rip), %rsi    # 0x33ba40
movb $0x0, 0xc(%rsi)
leaq 0x2ab5db(%rip), %rdi    # 0x33dd1f
popq %rbp
jmp 0x9340
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x91a26(%rip), %rdi     # 0x1244d2
callq 0x58dc2
callq 0x810b1
testl %eax, %eax
je 0x92af7
leaq 0x2a8f7f(%rip), %rdi    # 0x33ba40
callq 0x9470
cvtsd2ss %xmm0, %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0x92af7
movss 0x7a5aa(%rip), %xmm1    # 0x10d084
ucomiss %xmm0, %xmm1
jb 0x92af7
leaq 0x27a5ce(%rip), %rax    # 0x30d0b4
movss %xmm0, (%rax)
leaq 0x27a90b(%rip), %rax    # 0x30d3fc
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x919da(%rip), %rdi     # 0x1244de
callq 0x58dc2
callq 0x810b1
testl %eax, %eax
je 0x92b5f
leaq 0x2a8f27(%rip), %rdi    # 0x33ba40
leaq 0xa0dd1(%rip), %rsi     # 0x1338f1
callq 0x9090
xorl %ecx, %ecx
testq %rax, %rax
jne 0x92b49
leaq 0x2a8f0d(%rip), %rdi    # 0x33ba40
leaq 0x950ce(%rip), %rsi     # 0x127c08
callq 0x9090
movl $0x1, %ecx
testq %rax, %rax
je 0x92b5f
leaq 0x27a130(%rip), %rax    # 0x30cc80
movl %ecx, (%rax)
leaq 0x27a12b(%rip), %rax    # 0x30cc84
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x9117d(%rip), %rdi     # 0x124655
callq 0x58dc2
callq 0x58964
callq 0x58964
cvtsi2sd %eax, %xmm0
leaq 0x279ae6(%rip), %rbx    # 0x30cfd8
movsd %xmm0, (%rbx)
callq 0x58964
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
leaq 0x279ac7(%rip), %r14    # 0x30cfd0
movsd %xmm0, (%r14)
callq 0x58964
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
leaq 0x279abf(%rip), %r15    # 0x30cfe0
movsd %xmm0, (%r15)
callq 0x58964
callq 0x58964
callq 0x58964
movsd (%r14), %xmm0
movsd 0x78396(%rip), %xmm1    # 0x10b8d8
divsd %xmm1, %xmm0
movsd (%rbx), %xmm2
divsd %xmm1, %xmm2
movsd (%r15), %xmm1
divsd 0x75add(%rip), %xmm1    # 0x109038
movsd %xmm1, (%r15)
movsd 0x782c0(%rip), %xmm1    # 0x10b828
mulsd %xmm1, %xmm0
movsd 0x782bc(%rip), %xmm3    # 0x10b830
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_O3/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 0x910bc(%rip), %rdi     # 0x12465d
callq 0x58dc2
callq 0x58964
callq 0x587be
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0x935c3
leaq 0x1ab9b0(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x935d9
leaq 0x1ab99a(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x935ef
leaq 0x1ab984(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x93605
leaq 0x1ab96e(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x58b08
leaq 0x1aad7f(%rip), %rax    # 0x23e390
movq (%rax), %rdi
testq %rdi, %rdi
je 0x9362a
movzbl %bl, %edx
leaq 0x91045(%rip), %rsi     # 0x124668
xorl %eax, %eax
callq 0x9560
movl %ebx, %ecx
shll $0x3, %ecx
movabsq $0x70404036309, %rax    # imm = 0x70404036309
shrq %cl, %rax
cmpb $0x6, %bl
movl $0x63, %ecx
cmovbl %eax, %ecx
leaq 0x279a82(%rip), %rax    # 0x30d0d0
movb %cl, (%rax)
leaq 0x279db6(%rip), %rax    # 0x30d40d
movb $0x3, (%rax)
leaq 0x279c2f(%rip), %rax    # 0x30d290
movl $0x1, (%rax)
leaq 0x279b6a(%rip), %rax    # 0x30d1d8
andb $-0x9, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x90fd1(%rip), %rdi     # 0x124680
callq 0x58dc2
callq 0x58964
leaq 0x18fe24(%rip), %rbx    # 0x2234e4
movl $0x0, (%rbx)
callq 0x588d2
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
divsd 0x75986(%rip), %xmm0    # 0x109060
leaq 0x18fe1f(%rip), %rax    # 0x223500
movsd %xmm0, (%rax)
callq 0x588d2
movzwl %ax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x75964(%rip), %xmm0    # 0x109060
leaq 0x18fde5(%rip), %rax    # 0x2234e8
movsd %xmm0, (%rax)
callq 0x588d2
movzwl %ax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x75942(%rip), %xmm0    # 0x109060
leaq 0x18fde3(%rip), %rax    # 0x223508
movsd %xmm0, (%rax)
callq 0x588d2
movzwl %ax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x75920(%rip), %xmm0    # 0x109060
leaq 0x18fdb1(%rip), %rax    # 0x2234f8
movsd %xmm0, (%rax)
callq 0x588d2
movzwl %ax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x758fe(%rip), %xmm0    # 0x109060
leaq 0x18fd87(%rip), %rax    # 0x2234f0
movsd %xmm0, (%rax)
callq 0x588d2
movzwl %ax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x758dc(%rip), %xmm0    # 0x109060
leaq 0x18fd85(%rip), %rax    # 0x223510
movsd %xmm0, (%rax)
callq 0x588d2
movzwl %ax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x758ba(%rip), %xmm0    # 0x109060
leaq 0x18fd6b(%rip), %rax    # 0x223518
movsd %xmm0, (%rax)
orb $0x7d, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x90ec6(%rip), %rdi     # 0x12468c
callq 0x58dc2
callq 0x58964
callq 0x58964
callq 0x58964
callq 0x58964
callq 0x58964
movl %eax, %eax
cvtsi2sd %rax, %xmm0
divsd 0x7586d(%rip), %xmm0    # 0x109060
leaq 0x279826(%rip), %rax    # 0x30d020
movsd %xmm0, (%rax)
callq 0x58964
callq 0x58964
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x758b1(%rip), %xmm0    # 0x1090c8
movsd 0x8a919(%rip), %xmm1    # 0x11e138
addsd %xmm0, %xmm1
xorpd %xmm2, %xmm2
movapd %xmm0, %xmm3
cmpltsd %xmm2, %xmm3
andpd %xmm3, %xmm1
andnpd %xmm0, %xmm3
orpd %xmm1, %xmm3
leaq 0x2797e5(%rip), %rax    # 0x30d028
movlpd %xmm3, (%rax)
callq 0x58964
callq 0x58964
leaq 0x279ae0(%rip), %rax    # 0x30d338
movl $0xf, %ecx
movl %ecx, (%rax)
leaq 0x279ace(%rip), %rax    # 0x30d334
movl %ecx, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x90bca(%rip), %rdi     # 0x12469e
callq 0x58dc2
callq 0x58964
callq 0x58964
callq 0x588d2
leaq 0x279c49(%rip), %rcx    # 0x30d738
movw %ax, (%rcx)
leaq 0x279c4f(%rip), %rax    # 0x30d748
movl $0x0, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x93b15
leaq 0x1ab45e(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
leaq 0x279c18(%rip), %rcx    # 0x30d734
cmpl $0x0, (%rcx)
jne 0x93b2d
movsbl %al, %eax
leaq 0x279bfd(%rip), %rcx    # 0x30d728
movl %eax, (%rcx)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x93b43
leaq 0x1ab430(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x588d2
leaq 0x2797cd(%rip), %rax    # 0x30d31c
cmpl $0x0, (%rax)
jne 0x93b95
leaq 0x2799b9(%rip), %rcx    # 0x30d514
cmpl $0x7e1, (%rcx)          # imm = 0x7E1
setge %cl
leaq 0x279bbd(%rip), %rdx    # 0x30d728
movl (%rdx), %edx
cmpl $0x12, %edx
setl %sil
andb %cl, %sil
cmpl $0x11, %edx
setl %cl
orb %sil, %cl
jne 0x93b95
leaq 0x184cbb(%rip), %rcx    # 0x218844
movl $0x7d3, (%rcx)          # imm = 0x7D3
movl $0x3, (%rax)
leaq 0x279790(%rip), %rax    # 0x30d32c
cmpl $0x0, (%rax)
jne 0x93bae
leaq 0x184c9c(%rip), %rcx    # 0x218844
movl $0x7e0, (%rcx)          # imm = 0x7E0
movl $0x2, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x90ae3(%rip), %rdi     # 0x1246aa
callq 0x58dc2
callq 0x58964
callq 0x58b08
callq 0x58b08
callq 0x58964
callq 0x588d2
callq 0x588d2
movl %eax, %ebx
callq 0x588d2
movl %eax, %r14d
callq 0x588d2
movl %eax, %r15d
callq 0x588d2
xorl %ecx, %ecx
cmpw %ax, %bx
setne %cl
leaq 0x2795c8(%rip), %rax    # 0x30d1d8
movl $0xffffff7f, %edx       # imm = 0xFFFFFF7F
andl (%rax), %edx
shll $0x7, %ecx
orl %edx, %ecx
movl %ecx, (%rax)
leaq 0x279673(%rip), %rax    # 0x30d298
movl $0x2, (%rax)
movzwl %r14w, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movzwl %r15w, %edi
callq 0x5cbb3
movl $0x26, %ebx
leaq 0x1ab325(%rip), %r14    # 0x23ef70
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x93c5b
orb $0x8, (%r14)
decl %ebx
jne 0x93c4b
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq