LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_moto_Aw()
void parse_moto_Aw()
{
u08 x;

   // GPS (0) UTC (1) select
   log_packet_id("timing mode");
   x = tsip_byte();  
   if(x == 0) {
      time_flags &= (~TFLAGS_UTC);
      timing_mode = TMODE_GPS;
      have_timing_mode = 1;
   }
   else {
      time_flags |= (TFLAGS_UTC);
      timing_mode = TMODE_UTC;
      have_timing_mode = 1;
   }
   have_rcvr_tmode = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x82864(%rip), %rdi     # 0x10ebb4
callq 0x520bf
callq 0x51c47
xorl %ecx, %ecx
testb %al, %al
setne %cl
leaq 0x26b13c(%rip), %rax    # 0x2f74a4
movl (%rax), %edx
andl $-0x2, %edx
orl %ecx, %edx
leal (%rcx,%rcx,2), %ecx
movl %edx, (%rax)
leaq 0x26b142(%rip), %rax    # 0x2f74bd
movb %cl, (%rax)
leaq 0x26b048(%rip), %rax    # 0x2f73cc
pushq $0x1
popq %rcx
movl %ecx, (%rax)
leaq 0x26b040(%rip), %rax    # 0x2f73d0
movl %ecx, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_moto_Az()
void parse_moto_Az()
{
S32 val;

   // cable delay
   log_packet_id("cable delay");
   val = tsip_dword();
   cable_delay = ((double) val) / 1.0E9;
// if(have_cable_delay == 0) need_redraw = 2040;
   have_cable_delay = 1;
   show_cable_delay();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x82821(%rip), %rdi     # 0x10ebc0
callq 0x520bf
callq 0x51cf3
cvtsi2sd %eax, %xmm0
divsd 0x66c73(%rip), %xmm0    # 0xf3028
leaq 0x26ba0c(%rip), %rax    # 0x2f7dc8
movsd %xmm0, (%rax)
leaq 0x26aeed(%rip), %rax    # 0x2f72b4
movl $0x1, (%rax)
popq %rbp
jmp 0x6b202
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_moto_Bb()
void parse_moto_Bb()
{
int i;
int nsats;
int prn;
s16 doppler;
int el;
int az;
int health;

   log_packet_id("sat visibility");
   nsats = tsip_byte();
   for(i=0; i<12; i++) {
      prn     = tsip_byte();
      doppler = tsip_word();
      el      = tsip_byte();
      az      = tsip_word();
      health  = tsip_byte();

      if((prn >= 1) && (prn <= MAX_PRN)) { 
         set_sat_azel(prn, (float) az, (float) el);
         sat[prn].doppler = (float) doppler;
         sat[prn].health_flag = health;  // 0=healthy  1=unhealthy
         have_sat_azel = 7;
         if(sat[prn].doppler != 0.0F) {
            if(have_doppler == 0) need_redraw = 2041;
            have_doppler |= rinex_gnss(prn);
         }
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x8269a(%rip), %rdi     # 0x10ea93
callq 0x520bf
callq 0x51c47
pushq $0xc
popq %r14
subl $0x1, %r14d
jb 0x8c4b8
callq 0x51c47
movl %eax, %ebx
callq 0x51c63
movw %ax, -0x2a(%rbp)
callq 0x51c47
movl %eax, %r12d
callq 0x51c63
movl %eax, %r13d
callq 0x51c47
testb %bl, %bl
je 0x8c407
movl %eax, %r15d
movzbl %bl, %ebx
movzwl %r13w, %eax
cvtsi2ss %eax, %xmm0
movzbl %r12b, %eax
cvtsi2ss %eax, %xmm1
movl %ebx, %edi
callq 0x53b74
movswl -0x2a(%rbp), %eax
cvtsi2sd %eax, %xmm0
movl %ebx, %ecx
imulq $0x348, %rcx, %rcx      # imm = 0x348
leaq 0x19cb41(%rip), %rdx    # 0x228fb0
movsd %xmm0, 0x30(%rdx,%rcx)
movb %r15b, (%rdx,%rcx)
leaq 0x26ae14(%rip), %rcx    # 0x2f7294
movl $0x7, (%rcx)
testw %ax, %ax
je 0x8c407
leaq 0x26aeaa(%rip), %r15    # 0x2f7340
cmpl $0x0, (%r15)
jne 0x8c4a9
leaq 0x1763a1(%rip), %rax    # 0x202844
movl $0x7f9, (%rax)          # imm = 0x7F9
movl %ebx, %edi
callq 0xca4da
orl %eax, (%r15)
jmp 0x8c407
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_moto_Bd()
void parse_moto_Bd()
{
u08 valid;
u08 week;
u08 time;
u08 sv_count;
u32 sv_mask;

   // almanac status
   log_packet_id("almanac status");

   valid = tsip_byte();
   week = tsip_byte();
   time = tsip_byte();
   sv_count = tsip_byte();
   sv_mask = tsip_dword();

   tsip_byte();  // reserved bytes
   tsip_byte();
   tsip_byte();
   tsip_byte();
   tsip_byte();
   tsip_byte();
   tsip_byte();
   tsip_byte();

   if(valid) minor_alarms &= (~MINOR_ALMANAC);
   else      minor_alarms |= MINOR_ALMANAC;
   have_almanac = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x82706(%rip), %rdi     # 0x10ebda
callq 0x520bf
callq 0x51c47
movl %eax, %ebx
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51cf3
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c47
callq 0x51c47
xorl %eax, %eax
testb %bl, %bl
sete %al
leaq 0x26acae(%rip), %rcx    # 0x2f71d8
movl $0xfffff7ff, %edx       # imm = 0xFFFFF7FF
andl (%rcx), %edx
shll $0xb, %eax
orl %edx, %eax
movl %eax, (%rcx)
leaq 0x26ad65(%rip), %rax    # 0x2f72a4
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_moto_Bj()
void parse_moto_Bj()
{
int leap;

   // get leapscond pending info
   log_packet_id("leapsecond info");
   if(have_moto_Gj) return;  // M12 messes this up, always reports no leap

   leap = tsip_byte();
   if(leap) {
      minor_alarms |= MINOR_LEAP_PEND;
   }
   else { 
      minor_alarms &= (~MINOR_LEAP_PEND);
   }
   have_leap_info = 3;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x81183(%rip), %rdi     # 0x10d6da
callq 0x520bf
leaq 0x26acb5(%rip), %rax    # 0x2f7218
cmpl $0x0, (%rax)
jne 0x8c596
callq 0x51c47
xorl %ecx, %ecx
testb %al, %al
setne %cl
leaq 0x26ac5d(%rip), %rax    # 0x2f71d8
movl $0xffffff7f, %edx       # imm = 0xFFFFFF7F
andl (%rax), %edx
shll $0x7, %ecx
orl %edx, %ecx
movl %ecx, (%rax)
leaq 0x26ad08(%rip), %rax    # 0x2f7298
movl $0x3, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_moto_Bo()
void parse_moto_Bo()
{
int i;

   // gps/utc time offset
   log_packet_id("utc offset");
   i = (int) (s08) tsip_byte(); 

   if(!user_set_utc_ofs) {
      utc_offset = i;
      check_utc_ofs(8);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x82505(%rip), %rdi     # 0x10eaa8
callq 0x520bf
callq 0x51c47
leaq 0x26b180(%rip), %rcx    # 0x2f7734
cmpl $0x0, (%rcx)
je 0x8c5bb
popq %rbp
retq
movsbl %al, %eax
leaq 0x26b163(%rip), %rcx    # 0x2f7728
movl %eax, (%rcx)
pushq $0x8
popq %rdi
popq %rbp
jmp 0x51a91
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_moto_Ca()
void parse_moto_Ca()
{
u16 status;

   log_packet_id("self test results");
   status = tsip_word();     // 6 channel self test

   critical_alarms = 0;
   minor_alarms &= (~MINOR_EEPROM);

   if(status & 0x0280) critical_alarms |= CRIT_ROM;   // ROM
   if(status & 0x0500) critical_alarms |= CRIT_RAM;   // RAM
   if(status & 0x1040) critical_alarms |= CRIT_OCXO;  // 1KHz / DCXO
   if(status & 0xE03F) critical_alarms |= CRIT_FPGA;  // FPGA

   if(status & 0x0800) minor_alarms |= MINOR_EEPROM;  // EEPROM
   have_eeprom = 1;
   if(!have_critical_alarms) need_redraw = 7704;
   have_critical_alarms = 4;

   init_messages(24, 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8260e(%rip), %rdi     # 0x10ebe9
callq 0x520bf
callq 0x51c63
leaq 0x26abe4(%rip), %rsi    # 0x2f71d0
andl $0x0, (%rsi)
leaq 0x26abe2(%rip), %rcx    # 0x2f71d8
movl (%rcx), %edx
movl %edx, %edi
andl $0xfffffbff, %edi       # imm = 0xFFFFFBFF
movl %edi, (%rcx)
movzwl %ax, %edi
testw $0xf7ff, %di            # imm = 0xF7FF
je 0x8c63e
xorl %r8d, %r8d
testw $0x280, %ax             # imm = 0x280
setne %r8b
leal 0x2(%r8), %r9d
testw $0x500, %ax             # imm = 0x500
cmovel %r8d, %r9d
leal 0x10(%r9), %r8d
testw $0x1040, %ax            # imm = 0x1040
cmovel %r9d, %r8d
leal 0x8(%r8), %r9d
testw $0xe03f, %ax            # imm = 0xE03F
cmovel %r8d, %r9d
movl %r9d, (%rsi)
btl $0xb, %edi
jae 0x8c64c
orl $0x400, %edx            # imm = 0x400
movl %edx, (%rcx)
leaq 0x26ac59(%rip), %rax    # 0x2f72ac
movl $0x1, (%rax)
leaq 0x26ac48(%rip), %rax    # 0x2f72a8
cmpl $0x0, (%rax)
jne 0x8c672
leaq 0x1761d8(%rip), %rcx    # 0x202844
movl $0x1e18, (%rcx)         # imm = 0x1E18
movl $0x4, (%rax)
pushq $0x18
popq %rdi
pushq $0x1
popq %rsi
popq %rbp
jmp 0x59afe
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_moto_Cj()
void parse_moto_Cj()
{
int c;
int i;

   // Motorola receiver id message:

   // <cr><lf>
   // COPYRIGHT 1991-199X MOTOROLA INC.<cr><lf> 
   // SFTW P/N # XXXXXXXXXXXXXXX<cr><lf> 
   // SOFTWARE VER # XXXXXXXXXXX<cr><lf> 
   // SOFTWARE REV # XXXXXXXXXXX<cr><lf> 
   // SOFTWARE DATE  XXXXXXXXXXX<cr><lf> 
   // MODEL #    XXXXXXXXXXXXXXX<cr><lf> 
   // HDWR P/N # XXXXXXXXXXXXXXX<cr><lf> 
   // SERIAL #   XXXXXXXXXXXXXXX<cr><lf> 
   // MANUFACTUR DATE XXXXXXXXXX<cr><lf> 
   // OPTIONS LIST    XXXXXXXXXX<cr><lf> 

   log_packet_id("receiver id");
   i = 0;
   moto_id_lines = 0;
   moto_id[moto_id_lines][0] = 0;

   while(moto_msg_len > 0) {  // get the lines from the device id message
      c = tsip_byte();

      if(c == 0x00) ;
      else if(c == 0x0D) ;
      else if(c == 0x0A) {
         ++moto_id_lines;
         if(moto_id_lines >= MAX_ID_LINES) break;
         i = 0;
         moto_id[moto_id_lines][0] = 0;
      }
      else if(i <= 128) {
         moto_id[moto_id_lines][i++] = c;
         moto_id[moto_id_lines][i] = 0;
      }
      --moto_msg_len;
   }
   if(1 || moto_id_lines) saw_version |= 0x1000;

   have_info |= ALL_ID_INFO;
   furuno_moto = 0;
   if(moto_id[1][0]) {
      if(strstr(moto_id[1], "Furuno")) furuno_moto = 1;
   }

// show_version_info();

if(debug_file) {
   for(i=0; i<moto_id_lines; i++) fprintf(debug_file, "[%s]\n", &moto_id[i][0]);
}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x8243c(%rip), %rdi     # 0x10eaf8
callq 0x520bf
leaq 0x176874(%rip), %r15    # 0x202f3c
andl $0x0, (%r15)
leaq 0x17625d(%rip), %rbx    # 0x202930
movb $0x0, (%rbx)
xorl %r14d, %r14d
movl 0x2ca3e9(%rip), %eax    # 0x356ac8
testl %eax, %eax
jle 0x8c750
callq 0x51c47
testb %al, %al
je 0x8c740
movzbl %al, %ecx
cmpl $0xd, %ecx
je 0x8c740
cmpl $0xa, %ecx
jne 0x8c718
movslq (%r15), %rcx
leaq 0x1(%rcx), %rax
movl %eax, (%r15)
cmpq $0xa, %rcx
jg 0x8c750
imulq $0x81, %rax, %rcx
addq %rbx, %rcx
xorl %r14d, %r14d
jmp 0x8c73d
cmpl $0x80, %r14d
jg 0x8c740
movslq (%r15), %rcx
movslq %r14d, %rdx
incl %r14d
imulq $0x81, %rcx, %rcx
addq %rbx, %rcx
addq %rdx, %rcx
incq %rcx
movb %al, -0x1(%rcx)
movb $0x0, (%rcx)
movl 0x2ca382(%rip), %eax    # 0x356ac8
decl %eax
movl %eax, 0x2ca37a(%rip)    # 0x356ac8
jmp 0x8c6df
leaq 0x26acb1(%rip), %rax    # 0x2f7408
orb $0x10, 0x1(%rax)
leaq 0x26b212(%rip), %rax    # 0x2f7974
orb $0xf, (%rax)
leaq 0x1767d4(%rip), %r14    # 0x202f40
andl $0x0, (%r14)
cmpb $0x0, 0x81(%rbx)
je 0x8c79d
movl $0x81, %edi
addq 0xad833(%rip), %rdi     # 0x139fb8
leaq 0x8247d(%rip), %rsi     # 0x10ec09
callq 0x9090
testq %rax, %rax
je 0x8c79d
movl $0x1, (%r14)
leaq 0x19bbec(%rip), %r12    # 0x228390
cmpq $0x0, (%r12)
je 0x8c7da
leaq 0x82dc1(%rip), %r14     # 0x10f573
xorl %r13d, %r13d
movslq (%r15), %rax
cmpq %rax, %r13
jge 0x8c7da
movq (%r12), %rdi
movq %r14, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x9560
incq %r13
addq $0x81, %rbx
jmp 0x8c7b5
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_moto_Fa()
void parse_moto_Fa()
{
u16 status;

   log_packet_id("self test results");
   status = tsip_word();     // 8 channel self test

   critical_alarms = 0;
   minor_alarms &= (~MINOR_EEPROM);

   if(status & 0x0600) critical_alarms |= CRIT_ROM;   // ROM
   if(status & 0x1800) critical_alarms |= CRIT_RAM;   // RAM
   if(status & 0x4100) critical_alarms |= CRIT_OCXO;  // 1KHz / DCXO
   if(status & 0x80FF) critical_alarms |= CRIT_FPGA;  // FPGA

   if(status & 0x2000) minor_alarms |= MINOR_EEPROM;  // EEPROM
   have_eeprom = 1;
   if(!have_critical_alarms) need_redraw = 7705;
   have_critical_alarms = 5;

   init_messages(25, 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x81b3d(%rip), %rdi     # 0x10ebe9
callq 0x520bf
callq 0x51c63
leaq 0x26a113(%rip), %rsi    # 0x2f71d0
andl $0x0, (%rsi)
leaq 0x26a111(%rip), %rcx    # 0x2f71d8
movl (%rcx), %edx
movl %edx, %edi
andl $0xfffffbff, %edi       # imm = 0xFFFFFBFF
movl %edi, (%rcx)
movzwl %ax, %edi
testw $0xdfff, %di            # imm = 0xDFFF
je 0x8d10f
xorl %r8d, %r8d
testw $0x600, %ax             # imm = 0x600
setne %r8b
leal 0x2(%r8), %r9d
testw $0x1800, %ax            # imm = 0x1800
cmovel %r8d, %r9d
leal 0x10(%r9), %r8d
testw $0x4100, %ax            # imm = 0x4100
cmovel %r9d, %r8d
leal 0x8(%r8), %r9d
testw $0x80ff, %ax            # imm = 0x80FF
cmovel %r8d, %r9d
movl %r9d, (%rsi)
btl $0xd, %edi
jae 0x8d11d
orl $0x400, %edx            # imm = 0x400
movl %edx, (%rcx)
leaq 0x26a188(%rip), %rax    # 0x2f72ac
movl $0x1, (%rax)
leaq 0x26a177(%rip), %rax    # 0x2f72a8
cmpl $0x0, (%rax)
jne 0x8d143
leaq 0x175707(%rip), %rcx    # 0x202844
movl $0x1e19, (%rcx)         # imm = 0x1E19
movl $0x5, (%rax)
pushq $0x19
popq %rdi
pushq $0x1
popq %rsi
popq %rbp
jmp 0x59afe
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_moto_Gc()
void parse_moto_Gc()
{
   log_packet_id("pps state");
   pps_enabled = pps_mode = tsip_byte();  // 0=off, 1=always on,  2=on when tracking, 3=on when traim met
   have_pps_enable = 7;
   have_pps_mode = 7;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x81bd4(%rip), %rdi     # 0x10ed6d
callq 0x520bf
callq 0x51c47
leaq 0x26ab78(%rip), %rcx    # 0x2f7d22
movb %al, (%rcx)
leaq 0x26ab6d(%rip), %rcx    # 0x2f7d20
movb %al, (%rcx)
leaq 0x26a120(%rip), %rax    # 0x2f72dc
pushq $0x7
popq %rcx
movl %ecx, (%rax)
leaq 0x26a124(%rip), %rax    # 0x2f72ec
movl %ecx, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_moto_Gj()
void parse_moto_Gj()
{
u08 present, future;
u16 leap_year;
u08 leap_month;
u16 leap_day;
u08 leap_hour;
u08 leap_min;
u08 leap_sec;
double jd;

   // leapsecond info
   log_packet_id("leapsecond info");
   present = tsip_byte();
   future = tsip_byte();
   leap_year = tsip_word();
   leap_month = tsip_byte();
   leap_day = tsip_byte();

   tsip_byte();
   tsip_dword();

   leap_hour = tsip_byte();
   leap_min = tsip_byte();
   leap_sec = tsip_byte(); 

   if(present != future) {    // leapsecond pending
      minor_alarms |= (MINOR_LEAP_PEND);
      jd = jdate(leap_year, leap_month, leap_day) - 1.0;  // -1 since moto says 2017/1/1
      jd_leap = jd + jtime(23,59,59,0.0);
      have_jd_leap = 3;
      calc_jd_leap(3);

//      jd -= jdate(year, month, day);  // days until leap occurs
//      leap_days = ((int) jd);
//      have_leap_days = 0;
//      if(leap_days >= LEAP_THRESH) leap_days = (-1);
//      else have_leap_days = 2;
//sprintf(plot_title, "pres:%d fut:%d %04d/%02d/%02d   days:%d", present,future,leap_year,leap_month,leap_day, leap_days);
   }
   else {
      minor_alarms &= (~MINOR_LEAP_PEND);
   }

   have_moto_Gj = 1;
   have_leap_info = 4;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x8048c(%rip), %rdi     # 0x10d6da
callq 0x520bf
callq 0x51c47
movl %eax, %ebx
callq 0x51c47
movl %eax, %r15d
callq 0x51c63
movl %eax, %r14d
callq 0x51c47
movl %eax, %r12d
callq 0x51c47
movl %eax, %r13d
callq 0x51c47
callq 0x51cf3
callq 0x51c47
callq 0x51c47
callq 0x51c47
leaq 0x269f3e(%rip), %rax    # 0x2f71d8
movl (%rax), %ecx
cmpb %r15b, %bl
jne 0x8d2ab
andl $0xffffff7f, %ecx       # imm = 0xFFFFFF7F
movl %ecx, (%rax)
jmp 0x8d307
orl $0x80, %ecx
movl %ecx, (%rax)
movzwl %r14w, %edi
movzbl %r12b, %esi
movzbl %r13b, %edx
callq 0xc2f07
addsd 0x65e2c(%rip), %xmm0    # 0xf30f8
movsd %xmm0, -0x30(%rbp)
pushq $0x17
popq %rdi
pushq $0x3b
popq %rdx
xorpd %xmm0, %xmm0
movl %edx, %esi
callq 0xc2faf
addsd -0x30(%rbp), %xmm0
leaq 0x26a272(%rip), %rax    # 0x2f7560
movsd %xmm0, (%rax)
leaq 0x26a26f(%rip), %rax    # 0x2f7568
movl $0x3, (%rax)
pushq $0x3
popq %rdi
callq 0x557cf
leaq 0x269f0a(%rip), %rax    # 0x2f7218
movl $0x1, (%rax)
leaq 0x269f7d(%rip), %rax    # 0x2f7298
movl $0x4, (%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_moto_Hn()
void parse_moto_Hn()
{
int i;
S32 sawtooth;
s16 accu;
int traim_flag;
int prn;
u32 frac;

   log_packet_id("traim info");
   if(moto_chans != 12) {
      moto_chans = 12;
      config_msg_ofs();
   }

   tsip_byte();   // pulse
   tsip_byte();   // synced to
   traim_status = tsip_byte();  // timing solution
   traim_flag = tsip_byte();    // traim status
   have_traim = 1;
//sprintf(debug_text2, "traim status:%d", traim_status);
   tsip_dword();  // Traim removed sats vector

   accu = tsip_word();     // time accuracy
   sawtooth = tsip_byte(); // sawtooth
   if(sawtooth & 0x80) sawtooth |= (~(S32)0xFF);
   have_sawtooth = 1;

   dac_voltage = (float) sawtooth;
   pps_offset = (double) accu;
   have_pps_offset = 6;
   have_rcvr_pps = 6;
//adadad   if(jitter_adev == 0) do_pps_adev(pps_offset);

   for(i=0; i<12; i++) {
      prn = tsip_byte();  // prn
      frac = tsip_dword(); // time fraction
      if(frac >= 1000000000) frac = 0;

      if(0 && (prn >= 1) && (prn <= MAX_PRN)) { 
         sat[prn].sat_bias = (float) (((double) frac) * 1.0E-9);
         sat[prn].last_bias_msg = 2;

         if(frac > 0) {
            if(have_bias == 0) need_redraw = 2047;
            have_bias = 2;
         }
      }
   }
//sprintf(debug_text2, "Hn: thresh:%d tmode:%d tstat:%d flag:%d   pps:%d  saw:%d  rate:%d  accu:%d ", 
//traim_threshold,traim_mode,traim_status,traim_flag,   pps_mode,sawtooth,pps_rate,accu);
//sprintf(debug_text, "baud:%d db:%d par:%d stop:%d", baud_rate,com[RCVR_PORT].data_bits,com[RCVR_PORT].parity,com[RCVR_PORT].stop_bits);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x815de(%rip), %rdi     # 0x10ed2b
callq 0x520bf
leaq 0x1778cb(%rip), %rax    # 0x205024
cmpl $0xc, (%rax)
je 0x8d769
movl $0xc, (%rax)
callq 0x43898
callq 0x51c47
callq 0x51c47
callq 0x51c47
movzbl %al, %eax
leaq 0x177946(%rip), %rcx    # 0x2050c8
movl %eax, (%rcx)
callq 0x51c47
leaq 0x269c38(%rip), %rax    # 0x2f73c8
pushq $0x1
popq %r14
movl %r14d, (%rax)
callq 0x51cf3
callq 0x51c63
movl %eax, %ebx
callq 0x51c47
movzbl %al, %eax
leal -0x100(%rax), %ecx
testb %al, %al
cmovnsl %eax, %ecx
cvtsi2ss %ecx, %xmm0
leaq 0x269c03(%rip), %rax    # 0x2f73c4
movl %r14d, (%rax)
cvtss2sd %xmm0, %xmm0
leaq 0x269231(%rip), %rax    # 0x2f6a00
movsd %xmm0, (%rax)
movswl %bx, %eax
cvtsi2sd %eax, %xmm0
leaq 0x268fd7(%rip), %rax    # 0x2f67b8
movsd %xmm0, (%rax)
leaq 0x269a4c(%rip), %rax    # 0x2f7238
pushq $0x6
popq %rcx
movl %ecx, (%rax)
leaq 0x269a4c(%rip), %rax    # 0x2f7244
movl %ecx, (%rax)
pushq $0xc
popq %rbx
subl $0x1, %ebx
jb 0x8d80e
callq 0x51c47
callq 0x51cf3
jmp 0x8d7fd
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_moto_Ia()
void parse_moto_Ia()
{
u08 stat1;
u16 stat2;
u32 status;

   log_packet_id("alarms");

   stat1 = tsip_byte();
   stat2 = tsip_word();

   status = stat1;
   status <<= 16;
   status |= stat2; 

   critical_alarms = 0;
   minor_alarms &= (~MINOR_EEPROM);

   if(status & 0x020000) critical_alarms |= CRIT_ROM;  // ROM
   if(status & 0x040000) critical_alarms |= CRIT_RAM;  // RAM
   if(status & 0x012000) critical_alarms |= CRIT_OCXO; // 1KHz / DCXO
   if(status & 0x000FFF) critical_alarms |= CRIT_FPGA; // FPGA
   if(status & 0x305000) critical_alarms |= CRIT_FPGA; // FPGA

   if(status & 0x000000) minor_alarms |= MINOR_EEPROM; // EEPROM
   have_eeprom = 1;
   if(!have_critical_alarms) need_redraw = 7706;
   have_critical_alarms = 6;

   init_messages(26, 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x8139a(%rip), %rdi     # 0x10edcc
callq 0x520bf
callq 0x51c47
movl %eax, %ebx
callq 0x51c63
movzbl %bl, %esi
movl %esi, %ecx
shll $0x10, %ecx
movzwl %ax, %edx
orl %edx, %ecx
leaq 0x269779(%rip), %rax    # 0x2f71d0
andl $0x0, (%rax)
leaq 0x269777(%rip), %rdi    # 0x2f71d8
andb $-0x5, 0x1(%rdi)
movl %esi, %r8d
andl $0x6, %r8d
movl %ecx, %edi
andl $0x12000, %edi          # imm = 0x12000
orl %edi, %r8d
andl $0xfff, %edx            # imm = 0xFFF
orl %edx, %r8d
andl $0x305000, %ecx         # imm = 0x305000
orl %ecx, %r8d
je 0x8dab0
shrl %esi
andl $0x3, %esi
leal 0x10(%rsi), %r8d
testl %edi, %edi
cmovel %esi, %r8d
leal 0x8(%r8), %esi
testl %edx, %edx
cmovel %r8d, %esi
movl %esi, %edx
orl $0x8, %edx
testl %ecx, %ecx
cmovel %esi, %edx
movl %edx, (%rax)
leaq 0x2697f5(%rip), %rax    # 0x2f72ac
movl $0x1, (%rax)
leaq 0x2697e4(%rip), %rax    # 0x2f72a8
cmpl $0x0, (%rax)
jne 0x8dad6
leaq 0x174d74(%rip), %rcx    # 0x202844
movl $0x1e1a, (%rcx)         # imm = 0x1E1A
movl $0x6, (%rax)
pushq $0x1a
popq %rdi
pushq $0x1
popq %rsi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x59afe
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_moto_Sz()
void parse_moto_Sz()
{
   // power up self test failed
   log_packet_id("power-up test results");

   tsip_byte();

   critical_alarms = CRIT_ALL;  // 0x1F;
   if(!have_critical_alarms) need_redraw = 7707;
   have_critical_alarms = 7;
   minor_alarms = MINOR_ALL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x812db(%rip), %rdi     # 0x10edd3
callq 0x520bf
callq 0x51c47
leaq 0x2696c7(%rip), %rax    # 0x2f71d0
movl $0xffff, (%rax)         # imm = 0xFFFF
leaq 0x269792(%rip), %rax    # 0x2f72a8
cmpl $0x0, (%rax)
jne 0x8db28
leaq 0x174d22(%rip), %rcx    # 0x202844
movl $0x1e1b, (%rcx)         # imm = 0x1E1B
movl $0x7, (%rax)
leaq 0x2696a3(%rip), %rax    # 0x2f71d8
movl $0xffff, (%rax)         # imm = 0xFFFF
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: skip_moto_msg()
void skip_moto_msg()
{
   log_packet_id("ignored message");
   while(moto_msg_len > 0) {
      tsip_byte();
      --moto_msg_len;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x812a1(%rip), %rdi     # 0x10ede9
callq 0x520bf
movl 0x2c8f75(%rip), %eax    # 0x356ac8
testl %eax, %eax
jle 0x8db6c
callq 0x51c47
movl 0x2c8f66(%rip), %eax    # 0x356ac8
decl %eax
movl %eax, 0x2c8f5e(%rip)    # 0x356ac8
jmp 0x8db53
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: get_scpi_delim(char)
int get_scpi_delim(char delim)
{
char c;
int i;

   msg_field[0] = 0;
   if(nmea_msg[msg_col] == 0) return 0;  // at end-of-message

   i = 0;
   while(1) {   // get next field from the nmea message
      c = nmea_msg[msg_col];
      if(c == 0) {  // reached end-of-message
         break;
      }
      if(c == delim) {  // reached end-of-field
         ++msg_col;
         break;
      }

      if(i < ((int)sizeof(msg_field)-2)) {
         msg_field[i++] = c;
         msg_field[i] = 0;
         ++msg_col;
      }
   }

   return msg_field[0];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x297067(%rip), %rax    # 0x325a40
movb $0x0, (%rax)
leaq 0x297261(%rip), %rcx    # 0x325c44
movslq (%rcx), %rdx
leaq 0x296e43(%rip), %rsi    # 0x325830
movb (%rsi,%rdx), %r8b
testb %r8b, %r8b
je 0x8ea2d
xorl %r9d, %r9d
testb %r8b, %r8b
je 0x8ea35
cmpb %dil, %r8b
je 0x8ea31
cmpl $0x1fe, %r9d            # imm = 0x1FE
ja 0x8e9f9
movl %r9d, %r10d
leaq 0x1(%r10), %r9
movb %r8b, (%rax,%r10)
movb $0x0, 0x1(%rax,%r10)
movslq %edx, %r8
leaq 0x1(%r8), %rdx
movl %edx, (%rcx)
movb 0x1(%rsi,%r8), %r8b
jmp 0x8e9f9
xorl %eax, %eax
jmp 0x8ea38
incl %edx
movl %edx, (%rcx)
movsbl (%rax), %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_scpi_vis()
void parse_scpi_vis()
{
int prn;
int sat_count;

   log_packet_id("scpi vis");

   sat_count = 0;
   for(prn=0; prn<=MAX_PRN; prn++) {
      sat[prn].visible = 0;
   }

   msg_col = 0;
   while(get_msg_field()) {
      prn = atoi(msg_field);
      if((prn >= 1) && (prn <= MAX_PRN)) { 
         sat[prn].visible = (-1);
         ++sat_count;
         have_count = 40;
      }
   }

   config_sat_count(sat_count);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x7ffa9(%rip), %rdi     # 0x10ee6d
callq 0x520bf
movl $0x21c, %eax            # imm = 0x21C
leaq 0x19a0db(%rip), %r15    # 0x228fb0
cmpq $0xcd35c, %rax          # imm = 0xCD35C
je 0x8eeea
andl $0x0, (%r15,%rax)
addq $0x348, %rax            # imm = 0x348
jmp 0x8eed5
leaq 0x296d53(%rip), %rax    # 0x325c44
andl $0x0, (%rax)
xorl %ebx, %ebx
leaq 0x296b43(%rip), %r14    # 0x325a40
leaq 0x268414(%rip), %r12    # 0x2f7318
callq 0x75767
testl %eax, %eax
je 0x8ef3e
movq %r14, %rdi
callq 0x95e0
leal -0x1(%rax), %ecx
cmpl $0x3e6, %ecx            # imm = 0x3E6
ja 0x8ef04
movl %eax, %eax
imulq $0x348, %rax, %rax      # imm = 0x348
orl $-0x1, 0x21c(%r15,%rax)
incl %ebx
movl $0x28, (%r12)
jmp 0x8ef04
movl %ebx, %edi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x56d93
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_scpi_track()
void parse_scpi_track()
{
int prn;

   log_packet_id("scpi track");

   for(prn=0; prn<=MAX_PRN; prn++) { 
      sat[prn].tracking = sat[prn].visible;
      if(sat[prn].visible) sat[prn].level_msg = 14;
      else                 sat[prn].level_msg = 0;
      have_snr |= rinex_gnss(prn);
   }

   msg_col = 0;
   while(get_msg_field()) {
      prn = atoi(msg_field);
      if((prn >= 1) && (prn <= MAX_PRN)) { 
         sat[prn].tracking = (1);
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x7ff17(%rip), %rdi     # 0x10ee76
callq 0x520bf
movl $0x21c, %r14d           # imm = 0x21C
addq 0xaafd7(%rip), %r14     # 0x139f48
xorl %ebx, %ebx
pushq $0xe
popq %r15
leaq 0x2683ce(%rip), %r12    # 0x2f734c
cmpq $0x3e8, %rbx            # imm = 0x3E8
je 0x8efb2
movl (%r14), %eax
movl %eax, -0x4(%r14)
testl %eax, %eax
cmovnel %r15d, %eax
movl %eax, -0x200(%r14)
movl %ebx, %edi
callq 0xca4da
orl %eax, (%r12)
incq %rbx
addq $0x348, %r14            # imm = 0x348
jmp 0x8ef7e
leaq 0x296c8b(%rip), %rax    # 0x325c44
andl $0x0, (%rax)
leaq 0x296a7d(%rip), %rbx    # 0x325a40
leaq 0x199fe6(%rip), %r14    # 0x228fb0
callq 0x75767
testl %eax, %eax
je 0x8effd
movq %rbx, %rdi
callq 0x95e0
leal -0x1(%rax), %ecx
cmpl $0x3e6, %ecx            # imm = 0x3E6
ja 0x8efca
movl %eax, %eax
imulq $0x348, %rax, %rax      # imm = 0x348
movl $0x1, 0x218(%r14,%rax)
jmp 0x8efca
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_scpi_efc()
void parse_scpi_efc()
{
   log_packet_id("scpi efc");

   msg_col = 0;
   if(get_msg_field()) {
      dac_voltage = (float) atof(msg_field);
      if(rcvr_type == CS_RCVR) dac_voltage *= 100.0;
      have_dac = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7fe70(%rip), %rdi     # 0x10ee81
callq 0x520bf
leaq 0x296c27(%rip), %rax    # 0x325c44
andl $0x0, (%rax)
callq 0x75767
testl %eax, %eax
je 0x8f071
leaq 0x296a10(%rip), %rdi    # 0x325a40
callq 0x9470
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x2679bc(%rip), %rax    # 0x2f6a00
movsd %xmm0, (%rax)
leaq 0x173881(%rip), %rcx    # 0x2028d0
cmpq $0x20000, (%rcx)        # imm = 0x20000
jne 0x8f064
mulsd 0x64000(%rip), %xmm0    # 0xf3060
movsd %xmm0, (%rax)
leaq 0x268291(%rip), %rax    # 0x2f72fc
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_uccm_efc()
void parse_uccm_efc()
{
u32 val;

//kkkkkkuuuuuu
   log_packet_id("uccm efc");

   msg_col = 0;
   if(strstr(nmea_msg, "TO GPS")) {  // recovering from manual mode
      discipline_mode = DIS_MODE_RECOVERY;  // recovery
   }
   else if(strstr(nmea_msg, "RANGE")) {  // out of range
   }
   else if(get_msg_field() > 2) {
      if(discipline_mode == DIS_MODE_RECOVERY) discipline_mode = DIS_MODE_NORMAL;
      val = atohex(&msg_field[2]);
      uccm_voltage = (float) val;
   }
// sprintf(debug_text, "uccm voltage:%f  msg:%s", uccm_voltage, nmea_msg); 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7fe0c(%rip), %rdi     # 0x10ee8a
callq 0x520bf
leaq 0x296bba(%rip), %rax    # 0x325c44
andl $0x0, (%rax)
leaq 0x29679c(%rip), %rdi    # 0x325830
leaq 0x7fdf8(%rip), %rsi     # 0x10ee93
callq 0x9090
testq %rax, %rax
je 0x8f0b1
leaq 0x2683eb(%rip), %rax    # 0x2f7497
movb $0x4, (%rax)
jmp 0x8f108
leaq 0x296778(%rip), %rdi    # 0x325830
leaq 0x8053d(%rip), %rsi     # 0x10f5fc
callq 0x9090
testq %rax, %rax
jne 0x8f108
callq 0x75767
cmpl $0x3, %eax
jl 0x8f108
leaq 0x2683bd(%rip), %rax    # 0x2f7497
cmpb $0x4, (%rax)
jne 0x8f0e2
movb $0x0, (%rax)
leaq 0x296957(%rip), %rdi    # 0x325a40
addq $0x2, %rdi
callq 0x98b2
movl %eax, %eax
cvtsi2ss %rax, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x267904(%rip), %rax    # 0x2f6a08
movsd %xmm0, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_uccm_led()
void parse_uccm_led()
{
int i;

   log_packet_id("uccm led");

   if(scpi_type == UCCMP_TYPE) { 
      if     (strstr(nmea_msg, "0")) strcpy(uccm_led_msg, "Initializing   ");
      else if(strstr(nmea_msg, "1")) strcpy(uccm_led_msg, "Normal         ");
      else goto uccm_style;
   }
   else {
      uccm_style:
      nmea_msg[16] = 0;
      strcpy(uccm_led_msg, nmea_msg);
      for(i=strlen(uccm_led_msg); i<16; i++) uccm_led_msg[i] = ' ';
      uccm_led_msg[16] = 0;
      strupr(uccm_led_msg);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x7fd83(%rip), %rdi     # 0x10ee9a
callq 0x520bf
leaq 0x175ebd(%rip), %rax    # 0x204fe0
cmpl $0x50, (%rax)
jne 0x8f171
leaq 0x296701(%rip), %rdi    # 0x325830
pushq $0x30
popq %rsi
callq 0x9100
testq %rax, %rax
je 0x8f145
movups 0x7fd60(%rip), %xmm0    # 0x10eea3
jmp 0x8f160
leaq 0x2966e4(%rip), %rdi    # 0x325830
pushq $0x31
popq %rsi
callq 0x9100
testq %rax, %rax
je 0x8f171
movups 0x7fd53(%rip), %xmm0    # 0x10eeb3
leaq 0x267af9(%rip), %rax    # 0x2f6c60
movaps %xmm0, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x2966b8(%rip), %rsi    # 0x325830
movb $0x0, 0x10(%rsi)
leaq 0x267add(%rip), %rbx    # 0x2f6c60
movq %rbx, %rdi
callq 0x9330
movq %rbx, %rdi
callq 0x9120
cltq
cmpq $0xf, %rax
jg 0x8f1a4
movb $0x20, (%rbx,%rax)
incq %rax
jmp 0x8f195
movb $0x0, 0x10(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x988f
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_scpi_cable()
void parse_scpi_cable()
{
   log_packet_id("scpi cable");

   msg_col = 0;
   if(get_msg_field()) {
      cable_delay = atof(msg_field);
      if(cable_delay >= 1.0) {  // cable delay is probably in nanoseconds (early firmware?)
         cable_delay *= 1.0E-9;
         cable_nsecs = 1;
      }
      else cable_nsecs = 0;  // standard is in seconds

      have_cable_delay = 1;
      show_cable_delay();
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7fd02(%rip), %rdi     # 0x10eec3
callq 0x520bf
leaq 0x296a77(%rip), %rax    # 0x325c44
andl $0x0, (%rax)
callq 0x75767
testl %eax, %eax
je 0x8f225
leaq 0x296860(%rip), %rdi    # 0x325a40
callq 0x9470
xorl %eax, %eax
ucomisd 0x63e81(%rip), %xmm0    # 0xf3070
setae %cl
jb 0x8f1fc
mulsd 0x63f4c(%rip), %xmm0    # 0xf3148
movb %cl, %al
leaq 0x268bc3(%rip), %rcx    # 0x2f7dc8
movsd %xmm0, (%rcx)
leaq 0x268bd8(%rip), %rcx    # 0x2f7de8
movl %eax, (%rcx)
leaq 0x26809b(%rip), %rax    # 0x2f72b4
movl $0x1, (%rax)
popq %rbp
jmp 0x6b202
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_scpi_elev()
void parse_scpi_elev()
{
   log_packet_id("scpi elev");

   msg_col = 0;
   if(get_msg_field()) {
      el_mask = (float) atof(msg_field);
      have_el_mask = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7fc9c(%rip), %rdi     # 0x10eece
callq 0x520bf
leaq 0x296a06(%rip), %rax    # 0x325c44
andl $0x0, (%rax)
callq 0x75767
testl %eax, %eax
je 0x8f272
leaq 0x2967ef(%rip), %rdi    # 0x325a40
callq 0x9470
cvtsd2ss %xmm0, %xmm0
leaq 0x267e53(%rip), %rax    # 0x2f70b4
movss %xmm0, (%rax)
leaq 0x268190(%rip), %rax    # 0x2f73fc
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_scpi_utc_ofs()
void parse_scpi_utc_ofs()
{
   log_packet_id("scpi utc ofs");

   msg_col = 0;
   if(!user_set_utc_ofs && get_msg_field()) {
      utc_offset = (int) atof(msg_field);
      check_utc_ofs(10);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7fc59(%rip), %rdi     # 0x10eed8
callq 0x520bf
leaq 0x2969b9(%rip), %rax    # 0x325c44
andl $0x0, (%rax)
leaq 0x26849f(%rip), %rax    # 0x2f7734
cmpl $0x0, (%rax)
je 0x8f29c
popq %rbp
retq
callq 0x75767
testl %eax, %eax
je 0x8f29a
leaq 0x296794(%rip), %rdi    # 0x325a40
callq 0x9470
cvttsd2si %xmm0, %eax
leaq 0x26846c(%rip), %rcx    # 0x2f7728
movl %eax, (%rcx)
pushq $0xa
popq %rdi
popq %rbp
jmp 0x51a91
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_scpi_tint()
void parse_scpi_tint()
{
   log_packet_id("scpi tint");

   msg_col = 0;
   if(get_msg_field()) {
      if(scpi_type == NORTEL_TYPE) pps_offset = (float) atof(msg_field)*1.0;
      else                         pps_offset = (float) atof(msg_field)*1.0E9;
      // doing adves of TINT handled in secondary_timing()
      have_pps_offset = 7;
      have_rcvr_pps = 7;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x7f543(%rip), %rdi     # 0x10efb5
callq 0x520bf
leaq 0x2961c6(%rip), %rax    # 0x325c44
andl $0x0, (%rax)
callq 0x75767
testl %eax, %eax
je 0x8fad4
leaq 0x17554f(%rip), %rax    # 0x204fe0
movl (%rax), %ebx
leaq 0x295fa6(%rip), %rdi    # 0x325a40
callq 0x9470
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
cmpl $0x4e, %ebx
je 0x8fab4
mulsd 0x63574(%rip), %xmm0    # 0xf3028
leaq 0x266cfd(%rip), %rax    # 0x2f67b8
movsd %xmm0, (%rax)
leaq 0x267772(%rip), %rax    # 0x2f7238
pushq $0x7
popq %rcx
movl %ecx, (%rax)
leaq 0x267772(%rip), %rax    # 0x2f7244
movl %ecx, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_scpi_progress()
void parse_scpi_progress()
{
   log_packet_id("scpi progress");

   msg_col = 0;
   if(get_msg_field()) {
      survey_progress = (int) atof(msg_field);
      have_progress = 5;
      if(scpi_type == NORTEL_TYPE) {
         if(survey_progress != 100) minor_alarms |= MINOR_SURVEY;
         else                       minor_alarms &= (~MINOR_SURVEY);
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7f4d9(%rip), %rdi     # 0x10efbf
callq 0x520bf
leaq 0x296152(%rip), %rax    # 0x325c44
andl $0x0, (%rax)
callq 0x75767
testl %eax, %eax
je 0x8fb4b
leaq 0x295f3b(%rip), %rdi    # 0x325a40
callq 0x9470
cvttsd2si %xmm0, %eax
leaq 0x268377(%rip), %rcx    # 0x2f7e8c
movl %eax, (%rcx)
leaq 0x268372(%rip), %rcx    # 0x2f7e90
movl $0x5, (%rcx)
leaq 0x1754b5(%rip), %rcx    # 0x204fe0
cmpl $0x4e, (%rcx)
jne 0x8fb4b
xorl %ecx, %ecx
cmpl $0x64, %eax
setne %cl
leaq 0x267699(%rip), %rax    # 0x2f71d8
movl (%rax), %edx
andl $-0x21, %edx
shll $0x5, %ecx
orl %edx, %ecx
movl %ecx, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_scpi_survey()
void parse_scpi_survey()
{
   log_packet_id("scpi survey");

   msg_col = 0;
// !!! should restore com_timeout
   if(get_msg_field()) {
      strupr(msg_field);
      if(strstr(msg_field, "ONCE"))   minor_alarms |= MINOR_SURVEY;
      else if(strstr(msg_field, "1")) minor_alarms |= MINOR_SURVEY;
      else                            minor_alarms &= (~MINOR_SURVEY);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x7f473(%rip), %rdi     # 0x10efcd
callq 0x520bf
leaq 0x2960de(%rip), %rax    # 0x325c44
andl $0x0, (%rax)
callq 0x75767
testl %eax, %eax
je 0x8fbc9
leaq 0x295ec7(%rip), %rbx    # 0x325a40
movq %rbx, %rdi
callq 0x988f
leaq 0x7bd92(%rip), %rsi     # 0x10b91a
movq %rbx, %rdi
callq 0x9090
testq %rax, %rax
je 0x8fba0
leaq 0x26763c(%rip), %rax    # 0x2f71d8
movl (%rax), %ecx
jmp 0x8fbbd
leaq 0x295e99(%rip), %rdi    # 0x325a40
pushq $0x31
popq %rsi
callq 0x9100
leaq 0x267622(%rip), %rcx    # 0x2f71d8
movl (%rcx), %ecx
testq %rax, %rax
je 0x8fbd0
orl $0x20, %ecx
leaq 0x267611(%rip), %rax    # 0x2f71d8
movl %ecx, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
andl $-0x21, %ecx
jmp 0x8fbc0
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_scpi_holdover()
void parse_scpi_holdover()
{
int state;

   log_packet_id("scpi holdover");

   msg_col = 0;
   if(get_msg_field()) {
      holdover = (int) atof(msg_field);
   }

   if(get_msg_field()) {
      state = atoi(msg_field);
      if(state) {  // in holdover mode
         discipline_mode = DIS_MODE_MANUAL_HOLD;
         if(!have_scpi_hold) user_holdover = 1;
if(scpi_type != UCCMP_TYPE) {  // kkkkkk
   rcvr_mode = RCVR_MODE_PROP;
   have_rcvr_mode = 10;
}
      }
      else {   // not in holdover
         discipline_mode = DIS_MODE_NORMAL;
         if(!have_scpi_hold) user_holdover = 0;
if(scpi_type != UCCMP_TYPE) {  // kkkkkk
   rcvr_mode = RCVR_MODE_HOLD;
   have_rcvr_mode = 10;
}
      }
      have_scpi_hold = 1;
   }
// !!! should restore com_timeout
if(debug_file) fprintf(debug_file, "### holdover:%d  dmode:%d  user:%d\n", holdover, discipline_mode, user_holdover);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7f3f9(%rip), %rdi     # 0x10efd9
callq 0x520bf
leaq 0x296058(%rip), %rax    # 0x325c44
andl $0x0, (%rax)
callq 0x75767
testl %eax, %eax
je 0x8fc11
leaq 0x295e41(%rip), %rdi    # 0x325a40
callq 0x9470
cvttsd2si %xmm0, %eax
leaq 0x267849(%rip), %rcx    # 0x2f7458
movl %eax, (%rcx)
callq 0x75767
testl %eax, %eax
je 0x8fca7
leaq 0x295e1b(%rip), %rdi    # 0x325a40
callq 0x95e0
testl %eax, %eax
je 0x8fc59
leaq 0x267862(%rip), %rax    # 0x2f7497
movb $0x3, (%rax)
leaq 0x267821(%rip), %rax    # 0x2f7460
cmpl $0x0, (%rax)
jne 0x8fc4e
leaq 0x267809(%rip), %rax    # 0x2f7454
movb $0x1, (%rax)
leaq 0x17538b(%rip), %rcx    # 0x204fe0
movb $0x8, %al
jmp 0x8fc82
leaq 0x267837(%rip), %rax    # 0x2f7497
movb $0x0, (%rax)
leaq 0x2677f6(%rip), %rax    # 0x2f7460
cmpl $0x0, (%rax)
jne 0x8fc79
leaq 0x2677de(%rip), %rax    # 0x2f7454
movb $0x0, (%rax)
leaq 0x175360(%rip), %rcx    # 0x204fe0
movb $0x7, %al
cmpl $0x50, (%rcx)
je 0x8fc9a
leaq 0x267442(%rip), %rcx    # 0x2f70d0
movb %al, (%rcx)
leaq 0x267776(%rip), %rax    # 0x2f740d
movb $0xa, (%rax)
leaq 0x2677bf(%rip), %rax    # 0x2f7460
movl $0x1, (%rax)
leaq 0x1986e2(%rip), %rax    # 0x228390
movq (%rax), %rdi
testq %rdi, %rdi
je 0x8fce3
leaq 0x26779b(%rip), %rax    # 0x2f7458
movl (%rax), %edx
leaq 0x2677d1(%rip), %rax    # 0x2f7497
movzbl (%rax), %ecx
leaq 0x267784(%rip), %rax    # 0x2f7454
movzbl (%rax), %r8d
leaq 0x7f30c(%rip), %rsi     # 0x10efe7
xorl %eax, %eax
popq %rbp
jmp 0x9560
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_scpi_utc()
void parse_scpi_utc()
{
int state;

   log_packet_id("scpi utc");

   msg_col = 0;
   if(get_msg_field()) {
      state = (int) atof(msg_field);
      if(state == 0) {  // GPS time
         time_flags &= (~TFLAGS_UTC);
         timing_mode = TMODE_GPS;
         have_timing_mode = 1;
      }
      else {  // utc time
         time_flags |= (TFLAGS_UTC);
         timing_mode = TMODE_UTC;
         have_timing_mode = 1;
      }
      have_rcvr_tmode = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7f317(%rip), %rdi     # 0x10f018
callq 0x520bf
leaq 0x295f37(%rip), %rax    # 0x325c44
andl $0x0, (%rax)
callq 0x75767
testl %eax, %eax
je 0x8fd61
leaq 0x295d20(%rip), %rdi    # 0x325a40
callq 0x9470
cvttsd2si %xmm0, %eax
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
leaq 0x26776d(%rip), %rax    # 0x2f74a4
movl (%rax), %edx
andl $-0x2, %edx
orl %ecx, %edx
leal (%rcx,%rcx,2), %ecx
movl %edx, (%rax)
leaq 0x267773(%rip), %rax    # 0x2f74bd
movb %cl, (%rax)
leaq 0x267679(%rip), %rax    # 0x2f73cc
pushq $0x1
popq %rcx
movl %ecx, (%rax)
leaq 0x267671(%rip), %rax    # 0x2f73d0
movl %ecx, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_scpi_tunc()
void parse_scpi_tunc()
{
   log_packet_id("scpi tunc");

   msg_col = 0;
   if(get_msg_field()) {
      osc_offset = (float) atof(nmea_msg);
      have_osc_offset = 7;
      have_rcvr_osc = 7;
osc_offset *= 1000.0;
//    if(jitter_adev == 0) do_osc_adev(osc_offset);  // makes no sense to ADEV
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7f2b3(%rip), %rdi     # 0x10f021
callq 0x520bf
leaq 0x295eca(%rip), %rax    # 0x325c44
andl $0x0, (%rax)
callq 0x75767
testl %eax, %eax
je 0x8fdc2
leaq 0x295aa3(%rip), %rdi    # 0x325830
callq 0x9470
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x267493(%rip), %rax    # 0x2f7234
pushq $0x7
popq %rcx
movl %ecx, (%rax)
leaq 0x26749b(%rip), %rax    # 0x2f7248
movl %ecx, (%rax)
mulsd 0x63281(%rip), %xmm0    # 0xf3038
leaq 0x266a02(%rip), %rax    # 0x2f67c0
movsd %xmm0, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_scpi_edge()
void parse_scpi_edge()
{
   log_packet_id("scpi edge");

   msg_col = 0;
   if(get_msg_field()) {
      strupr(msg_field);
      if     (strstr(msg_field, "RIS")) {
         pps_polarity = 0;
         have_pps_polarity = 12;
      }
      else if(strstr(msg_field, "FAL")) {
         pps_polarity = 1;
         have_pps_polarity = 12;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x7f25a(%rip), %rdi     # 0x10f02b
callq 0x520bf
leaq 0x295e67(%rip), %rax    # 0x325c44
andl $0x0, (%rax)
callq 0x75767
testl %eax, %eax
je 0x8fe3f
leaq 0x295c50(%rip), %rbx    # 0x325a40
movq %rbx, %rdi
callq 0x988f
leaq 0x7b21b(%rip), %rsi     # 0x10b01a
movq %rbx, %rdi
callq 0x9090
xorl %ecx, %ecx
testq %rax, %rax
jne 0x8fe29
leaq 0x295c2b(%rip), %rdi    # 0x325a40
leaq 0x7f219(%rip), %rsi     # 0x10f035
callq 0x9090
testq %rax, %rax
je 0x8fe3f
pushq $0x1
popq %rcx
leaq 0x267ee8(%rip), %rax    # 0x2f7d18
movl %ecx, (%rax)
leaq 0x2674a7(%rip), %rax    # 0x2f72e0
movl $0xc, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_scpi_life()
void parse_scpi_life()
{
   log_packet_id("scpi life");

   msg_col = 0;
   if(get_msg_field()) {
      scpi_life = atoi(msg_field) * 3;
      have_lifetime = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7f1e8(%rip), %rdi     # 0x10f039
callq 0x520bf
leaq 0x295de7(%rip), %rax    # 0x325c44
andl $0x0, (%rax)
callq 0x75767
testl %eax, %eax
je 0x8fe8e
leaq 0x295bd0(%rip), %rdi    # 0x325a40
callq 0x95e0
leal (%rax,%rax,2), %eax
leaq 0x2675dd(%rip), %rcx    # 0x2f745c
movl %eax, (%rcx)
leaq 0x267440(%rip), %rax    # 0x2f72c8
movl $0x1, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_scpi_test()
void parse_scpi_test()
{
// !!! should restore com_timeout
   log_packet_id("scpi test");

   msg_col = 0;
   if(get_msg_field()) {
      scpi_test = atoi(nmea_msg);
      have_scpi_test = 1;
if(debug_file) fprintf(debug_file, "### self test:%04X\n", scpi_test);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x7f1cc(%rip), %rdi     # 0x10f067
callq 0x520bf
leaq 0x295d9d(%rip), %rax    # 0x325c44
andl $0x0, (%rax)
callq 0x75767
testl %eax, %eax
je 0x8fef5
leaq 0x295976(%rip), %rdi    # 0x325830
callq 0x95e0
leaq 0x267572(%rip), %rcx    # 0x2f7438
movl %eax, (%rcx)
leaq 0x267531(%rip), %rcx    # 0x2f7400
movl $0x1, (%rcx)
leaq 0x1984b4(%rip), %rcx    # 0x228390
movq (%rcx), %rdi
testq %rdi, %rdi
je 0x8fef5
leaq 0x7f186(%rip), %rsi     # 0x10f071
movl %eax, %edx
xorl %eax, %eax
popq %rbp
jmp 0x9560
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_scpi_operation()
void parse_scpi_operation()
{
int status;

   log_packet_id("scpi operation");

   if(scpi_type != NORTEL_TYPE) return;

   // 0x0002 - locked
   // 0x0004 - holdover/unlocked modes
   // 0x0008 - position hold
   // 0x0010 - sats tracked
   // 0x0020 - hardware status reg set
   // 0x0040 - diagnostic log almost full
   // 0x0080 - over temp
   // 0x0100 - under temp
   // 0x0200 - antenna fault

   msg_col = 0;
   if(get_msg_field()) {
      status = atoi(nmea_msg);
if(debug_file) fprintf(debug_file, "### operation status:%04X\n", status);
      if(status & 0x0080) {       // over temperature alarm
         temperature = 71.0F;
         have_temperature = 109;
      }
      else if(status & 0x0100) {  // under temperature alarm
         temperature = (-1.0F);
         have_temperature = 110;
      }
      else {
         temperature = 30.0F;     // normal temperature
         have_temperature = 111;
      }

      if(status & 0x0010) minor_alarms &= (~MINOR_NO_TRACK);  // sat tracking OK
      else                minor_alarms |= MINOR_NO_TRACK;
      have_tracking = 1;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x7f033(%rip), %rdi     # 0x10f0ad
callq 0x520bf
leaq 0x174f5a(%rip), %rax    # 0x204fe0
cmpl $0x4e, (%rax)
jne 0x90135
leaq 0x295bae(%rip), %rax    # 0x325c44
andl $0x0, (%rax)
callq 0x75767
testl %eax, %eax
je 0x90135
leaq 0x295783(%rip), %rdi    # 0x325830
callq 0x95e0
movl %eax, %ebx
leaq 0x1982d5(%rip), %rax    # 0x228390
movq (%rax), %rdi
testq %rdi, %rdi
je 0x900d3
leaq 0x7eff2(%rip), %rsi     # 0x10f0bc
movl %ebx, %edx
xorl %eax, %eax
callq 0x9560
testb %bl, %bl
js 0x900f1
xorl %eax, %eax
btl $0x8, %ebx
setae %al
leaq 0x78949(%rip), %rcx     # 0x108a30
movsd (%rcx,%rax,8), %xmm0
orl $0x6e, %eax
jmp 0x900fc
pushq $0x6d
popq %rax
movsd 0x78634(%rip), %xmm0    # 0x108730
leaq 0x266915(%rip), %rcx    # 0x2f6a18
movsd %xmm0, (%rcx)
leaq 0x26713e(%rip), %rcx    # 0x2f724c
movl %eax, (%rcx)
leaq 0x2670c1(%rip), %rax    # 0x2f71d8
movl (%rax), %ecx
andl $-0x9, %ecx
shrl %ebx
andl $0x8, %ebx
orl %ecx, %ebx
xorl $0x8, %ebx
movl %ebx, (%rax)
leaq 0x267161(%rip), %rax    # 0x2f7290
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_scpi_ignore()
void parse_scpi_ignore()
{
u32 val;
int count;
int prn;
int flag;

   log_packet_id("scpi ignore");

   count = 0;
   val = 0;

   msg_col = 0;
   while(get_msg_field()) {
      prn = atoi(msg_field);
      if((prn >= 1) && (prn <= 32)) { 
         val |= (1 << (prn-1));
         ++count;
      }
   }

   single_sat_prn = 0;
   have_single_prn = 1;
   if(count == 31) {  // all but 1 sat excluded
      for(prn=1; prn <= 32; prn++) {
         flag = (val & (1 << (prn-1)));
         if(flag == 0) {
            single_sat_prn = prn; 
            have_single_prn = 1;
            break;
         }
      }
   }

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x7ef7e(%rip), %rdi     # 0x10f0e0
callq 0x520bf
leaq 0x295ad6(%rip), %rax    # 0x325c44
andl $0x0, (%rax)
xorl %r12d, %r12d
leaq 0x2958c5(%rip), %r14    # 0x325a40
pushq $0x1
popq %r13
xorl %r15d, %r15d
xorl %ebx, %ebx
callq 0x75767
testl %eax, %eax
je 0x901b0
movq %r14, %rdi
callq 0x95e0
decl %eax
movl %r13d, %edx
movl %eax, %ecx
shll %cl, %edx
cmpl $0x20, %eax
adcl $0x0, %r15d
cmpl $0x20, %eax
cmovael %r12d, %edx
orl %edx, %ebx
jmp 0x90184
leaq 0x266f25(%rip), %rax    # 0x2f70dc
andl $0x0, (%rax)
leaq 0x266f1f(%rip), %rcx    # 0x2f70e0
movl $0x1, (%rcx)
cmpl $0x1f, %r15d
jne 0x901e1
xorl %ecx, %ecx
cmpl $0x20, %ecx
je 0x901e1
btl %ecx, %ebx
jae 0x901dd
incl %ecx
jmp 0x901cf
incl %ecx
movl %ecx, (%rax)
notl %ebx
leaq 0x266efa(%rip), %rax    # 0x2f70e4
movl %ebx, (%rax)
movl %ebx, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x56b6d