LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/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 0x90e6a(%rip), %rdi     # 0x1245ac
callq 0x58e77
callq 0x589b0
callq 0x589b0
callq 0x589b0
callq 0x589b0
callq 0x589b0
movl %eax, %eax
cvtsi2sd %rax, %xmm0
divsd 0x758f1(%rip), %xmm0    # 0x109060
leaq 0x2798aa(%rip), %rax    # 0x30d020
movsd %xmm0, (%rax)
callq 0x589b0
callq 0x589b0
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x75935(%rip), %xmm0    # 0x1090c8
movsd 0x8a8f5(%rip), %xmm1    # 0x11e090
addsd %xmm0, %xmm1
xorpd %xmm2, %xmm2
movapd %xmm0, %xmm3
cmpltsd %xmm2, %xmm3
andpd %xmm3, %xmm1
andnpd %xmm0, %xmm3
orpd %xmm1, %xmm3
leaq 0x279869(%rip), %rax    # 0x30d028
movlpd %xmm3, (%rax)
callq 0x589b0
callq 0x589b0
leaq 0x279b64(%rip), %rax    # 0x30d338
movl $0xf, %ecx
movl %ecx, (%rax)
leaq 0x279b52(%rip), %rax    # 0x30d334
movl %ecx, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x90b6e(%rip), %rdi     # 0x1245be
callq 0x58e77
callq 0x589b0
callq 0x589b0
callq 0x588f0
leaq 0x279ccd(%rip), %rcx    # 0x30d738
movw %ax, (%rcx)
leaq 0x279cd3(%rip), %rax    # 0x30d748
movl $0x0, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x93a91
leaq 0x1ab4e2(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
leaq 0x279c9c(%rip), %rcx    # 0x30d734
cmpl $0x0, (%rcx)
jne 0x93aa9
movsbl %al, %eax
leaq 0x279c81(%rip), %rcx    # 0x30d728
movl %eax, (%rcx)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x93abf
leaq 0x1ab4b4(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x588f0
leaq 0x279851(%rip), %rax    # 0x30d31c
cmpl $0x0, (%rax)
jne 0x93b11
leaq 0x279a3d(%rip), %rcx    # 0x30d514
cmpl $0x7e1, (%rcx)          # imm = 0x7E1
setge %cl
leaq 0x279c41(%rip), %rdx    # 0x30d728
movl (%rdx), %edx
cmpl $0x12, %edx
setl %sil
andb %cl, %sil
cmpl $0x11, %edx
setl %cl
orb %sil, %cl
jne 0x93b11
leaq 0x184d3f(%rip), %rcx    # 0x218844
movl $0x7d3, (%rcx)          # imm = 0x7D3
movl $0x3, (%rax)
leaq 0x279814(%rip), %rax    # 0x30d32c
cmpl $0x0, (%rax)
jne 0x93b2a
leaq 0x184d20(%rip), %rcx    # 0x218844
movl $0x7e0, (%rcx)          # imm = 0x7E0
movl $0x2, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x90a87(%rip), %rdi     # 0x1245ca
callq 0x58e77
callq 0x589b0
callq 0x58b86
callq 0x58b86
callq 0x589b0
callq 0x588f0
callq 0x588f0
movl %eax, %ebx
callq 0x588f0
movl %eax, %r14d
callq 0x588f0
movl %eax, %r15d
callq 0x588f0
xorl %ecx, %ecx
cmpw %ax, %bx
setne %cl
leaq 0x27964c(%rip), %rax    # 0x30d1d8
movl $0xffffff7f, %edx       # imm = 0xFFFFFF7F
andl (%rax), %edx
shll $0x7, %ecx
orl %edx, %ecx
movl %ecx, (%rax)
leaq 0x2796f7(%rip), %rax    # 0x30d298
movl $0x2, (%rax)
movzwl %r14w, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movzwl %r15w, %edi
callq 0x5ccdb
movl $0x26, %ebx
leaq 0x1ab3a9(%rip), %r14    # 0x23ef70
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x93bd7
orb $0x8, (%r14)
decl %ebx
jne 0x93bc7
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_ubx_mon()
void parse_ubx_mon()
{
int i;
u08 ant;
u08 ant_pwr;

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

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

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x9012b(%rip), %rdi     # 0x124677
callq 0x58e77
movl $0x14, %ebx
leaq 0x1aaa13(%rip), %r15    # 0x23ef70
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x9456d
orb $0x8, (%r15)
decl %ebx
jne 0x9455d
callq 0x587d1
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0x94583
orb $0x8, (%r15)
callq 0x587d1
movl %eax, %r14d
cmpl $0x100, %eax            # imm = 0x100
jb 0x94596
orb $0x8, (%r15)
movl $0x26, %r12d
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x945ac
orb $0x8, (%r15)
decl %r12d
jne 0x9459c
leaq 0x278c20(%rip), %rax    # 0x30d1d8
movl (%rax), %edx
movl %edx, %ecx
andl $-0x7, %ecx
movl %ecx, (%rax)
cmpb $0x2, %bl
je 0x945e9
movzbl %bl, %esi
cmpl $0x4, %esi
je 0x945d8
cmpl $0x3, %esi
jne 0x945dd
orl $0x4, %ecx
jmp 0x945e7
orl $0x2, %ecx
jmp 0x945e7
testb %r14b, %r14b
jne 0x945e9
orl $0x6, %edx
movl %edx, %ecx
movl %ecx, (%rax)
leaq 0x278c3c(%rip), %rax    # 0x30d22c
movl $0x1, (%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_ubx_tmode(int)
void parse_ubx_tmode(int tmode)
{
u32 mode;
u32 slen;

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

   saw_timing_msg |= 0x02;
   have_ubx_tmode = tmode;

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

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
leaq 0x9005d(%rip), %rdi     # 0x124687
callq 0x58e77
leaq 0x278df2(%rip), %rax    # 0x30d428
orb $0x2, (%rax)
leaq 0x278d74(%rip), %rax    # 0x30d3b4
movl %ebx, (%rax)
callq 0x589b0
movl %eax, %r14d
callq 0x589b0
callq 0x589b0
callq 0x589b0
callq 0x589b0
callq 0x589b0
movl %eax, %ebx
callq 0x589b0
leaq 0x278b67(%rip), %rax    # 0x30d1d8
movl (%rax), %ecx
cmpl $0x1, %r14d
jne 0x94687
orl $0x20, %ecx
movl %ecx, (%rax)
movl %ebx, %ecx
movl $0xa, %eax
jmp 0x9469f
andl $-0x21, %ecx
movl %ecx, (%rax)
leaq 0x279805(%rip), %rax    # 0x30de98
cmpb $0x0, (%rax)
jne 0x946b2
movl $0xfffffff6, %eax       # imm = 0xFFFFFFF6
xorl %ecx, %ecx
leaq 0x2797d2(%rip), %rdx    # 0x30de78
movq %rcx, (%rdx)
leaq 0x2797d8(%rip), %rcx    # 0x30de88
movl %eax, (%rcx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_ubx_svin()
void parse_ubx_svin()
{
u32 dur;        // current duration of survey
double ecef_x;
double ecef_y;
double ecef_z;
u32 obs;        // number of observations used
u08 valid;
u08 active;
u32 rsvd;

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

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

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x8ff0f(%rip), %rdi     # 0x1245d3
callq 0x58e77
leaq 0x278d58(%rip), %rax    # 0x30d428
orb $0x1, (%rax)
callq 0x589b0
movl %eax, %ebx
callq 0x589b0
callq 0x589b0
callq 0x589b0
callq 0x589b0
movl %eax, 0x2d83bc(%rip)    # 0x36cab0
callq 0x589b0
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x9470f
leaq 0x1aa864(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x94725
leaq 0x1aa84e(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x588f0
leaq 0x279747(%rip), %rax    # 0x30de78
movq (%rax), %rcx
testq %rcx, %rcx
je 0x94743
imull $0x64, %ebx, %eax
xorl %edx, %edx
idivq %rcx
jmp 0x94745
xorl %eax, %eax
leaq 0x279740(%rip), %rcx    # 0x30de8c
movl %eax, (%rcx)
leaq 0x27973b(%rip), %rax    # 0x30de90
movl $0x3, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_ubx_navx5()
void parse_ubx_navx5()
{
   log_packet_id("UBX_NAVX5");
   have_amu = 1;

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8ff24(%rip), %rdi     # 0x124691
callq 0x58e77
leaq 0x278c7f(%rip), %rax    # 0x30d3f8
movl $0x1, (%rax)
callq 0x588f0
callq 0x588f0
callq 0x589b0
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x947a4
leaq 0x1aa7cf(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x947ba
leaq 0x1aa7b9(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x947d0
leaq 0x1aa7a3(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x947e6
leaq 0x1aa78d(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x947fc
leaq 0x1aa777(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
cvtsi2ss %eax, %xmm0
leaq 0x2788ae(%rip), %rax    # 0x30d0b8
movss %xmm0, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x94824
leaq 0x1aa74f(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x9483a
leaq 0x1aa739(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x94850
leaq 0x1aa723(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x94866
leaq 0x1aa70d(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x9487c
leaq 0x1aa6f7(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x588f0
callq 0x589b0
callq 0x589b0
callq 0x589b0
callq 0x589b0
popq %rbp
jmp 0x589b0
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_ubx_ver()
void parse_ubx_ver()
{
int i;
int line;

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

   saw_version |= 0x100;

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

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

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

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

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

   have_info |= ALL_ID_INFO;

// show_version_info();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x8fdeb(%rip), %rdi     # 0x12469b
callq 0x58e77
leaq 0x278b4c(%rip), %rax    # 0x30d408
orb $0x1, 0x1(%rax)
xorl %r15d, %r15d
leaq 0x2a8df6(%rip), %rbx    # 0x33d6c0
leaq 0x1aa69f(%rip), %r14    # 0x23ef70
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x948e1
orb $0x8, (%r14)
movb %al, (%rbx,%r15)
incq %r15
cmpq $0x1e, %r15
jne 0x948d1
movb $0x0, 0x15(%rbx)
movq %rbx, %rdi
callq 0x9470
cvtsd2ss %xmm0, %xmm0
leaq 0x2a9077(%rip), %rax    # 0x33d97c
movss %xmm0, (%rax)
xorl %ebx, %ebx
leaq 0x2a8dcc(%rip), %r15    # 0x33d6de
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x94922
orb $0x8, (%r14)
movb %al, (%r15,%rbx)
incq %rbx
cmpq $0xa, %rbx
jne 0x94912
movb $0x0, 0x9(%r15)
xorl %eax, %eax
leaq 0x2a8db3(%rip), %rbx    # 0x33d6f0
movb $0x0, (%rbx,%rax)
addq $0x1f, %rax
cmpq $0x26c, %rax            # imm = 0x26C
jne 0x9493d
cmpl $0x0, (%r14)
jne 0x949b2
xorl %r15d, %r15d
movq %rbx, %r12
movq $-0x1e, %r13
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x94970
orb $0x8, (%r14)
movb %al, 0x1e(%r12,%r13)
cmpl $0x0, (%r14)
jne 0x94982
incq %r13
jne 0x94960
jmp 0x94990
movq %r15, %rax
shlq $0x5, %rax
subq %r15, %rax
movb $0x0, (%rbx,%rax)
movq %r15, %rax
shlq $0x5, %rax
subq %r15, %rax
movb $0x0, 0x1e(%rbx,%rax)
cmpq $0x12, %r15
ja 0x949b2
incq %r15
addq $0x1f, %r12
cmpl $0x0, (%r14)
je 0x94959
leaq 0x278fbb(%rip), %rax    # 0x30d974
orb $0xf, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_ubx_cfg()
void parse_ubx_cfg()
{
int fix;  // 1=2D  2=3D  3=2D/3D
int el;
int i;

   log_packet_id("UBX_CFG");

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

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x8fca4(%rip), %rdi     # 0x1246ad
callq 0x58e77
callq 0x588f0
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x94a29
leaq 0x1aa54a(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x94a3f
leaq 0x1aa534(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
movl $0x8, %r14d
leaq 0x1aa524(%rip), %rbx    # 0x23ef70
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x94a5b
orb $0x8, (%rbx)
decl %r14d
jne 0x94a4c
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x94a6f
orb $0x8, (%rbx)
movzbl %al, %eax
cvtsi2ss %eax, %xmm0
leaq 0x278637(%rip), %rax    # 0x30d0b4
movss %xmm0, (%rax)
leaq 0x278974(%rip), %rax    # 0x30d3fc
movl $0x1, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: set_cs_freq(int, double)
void set_cs_freq(int chan, double freq)
{
   if(read_only) return;

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

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

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
leaq 0x2a1d7e(%rip), %rax    # 0x33701a
cmpb $0x0, (%rax)
jne 0x95304
leaq 0x183628(%rip), %rax    # 0x2188d0
cmpq $0x20000, (%rax)        # imm = 0x20000
jne 0x95304
movl %edi, %ebx
cmpl $0x2, %edi
je 0x95311
cmpl $0x1, %ebx
jne 0x95304
movl $0x1, %r14d
movl $0x1, %edi
movsd %xmm0, -0x28(%rbp)
callq 0x63db5
leaq 0x2a6f47(%rip), %r12    # 0x33c220
leaq 0x90640(%rip), %rsi     # 0x125920
movq %r12, %rdi
movl $0x1, %edx
movsd -0x28(%rbp), %xmm0
movb $0x1, %al
callq 0x9060
movl $0x13f, %r15d           # imm = 0x13F
movq %r12, %rdi
movl $0x13f, %esi            # imm = 0x13F
jmp 0x95356
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %edi
movsd %xmm0, -0x28(%rbp)
callq 0x63db5
leaq 0x2a6ef9(%rip), %r12    # 0x33c220
leaq 0x905f2(%rip), %rsi     # 0x125920
movl $0x2, %r14d
movq %r12, %rdi
movl $0x2, %edx
movsd -0x28(%rbp), %xmm0
movb $0x1, %al
callq 0x9060
movl $0x140, %r15d           # imm = 0x140
movq %r12, %rdi
movl $0x140, %esi            # imm = 0x140
callq 0x5ee52
leaq 0x18568a(%rip), %rax    # 0x21a9ec
cmpl $0x0, (%rax)
jne 0x95371
xorl %edi, %edi
callq 0x63db5
movl %ebx, %r14d
leaq 0x2a6ea8(%rip), %rbx    # 0x33c220
leaq 0x905b1(%rip), %rsi     # 0x125930
movq %rbx, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
movl %r15d, %esi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x5ee52
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_ubx_tp()
void parse_ubx_tp()
{
u32 tow;
u32 subms;
S32 quant;
u16 week;
u08 flags;
u08 rsvd;

   log_packet_id("UBX_TP");

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

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x8f35a(%rip), %rdi     # 0x12470a
callq 0x58e77
callq 0x589b0
callq 0x589b0
callq 0x589b0
movl %eax, %ebx
callq 0x588f0
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x953e1
leaq 0x1a9b92(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x953f7
leaq 0x1a9b7c(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
cvtsi2ss %ebx, %xmm0
leaq 0x277fc2(%rip), %rax    # 0x30d3c4
divss 0x89576(%rip), %xmm0    # 0x11e980
movl $0x1, (%rax)
cvtss2sd %xmm0, %xmm0
leaq 0x2775e5(%rip), %rax    # 0x30ca00
movsd %xmm0, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_ubx_rate()
void parse_ubx_rate()
{
int rate;

   log_packet_id("UBX_RATE");

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

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x8f2de(%rip), %rdi     # 0x124711
callq 0x58e77
callq 0x588f0
movl %eax, %ebx
callq 0x588f0
callq 0x588f0
testw %bx, %bx
je 0x9548c
leaq 0x185ddf(%rip), %rax    # 0x21b234
cmpb $0x0, (%rax)
jne 0x9548c
movzwl %bx, %eax
cvtsi2ss %eax, %xmm0
movss 0x89517(%rip), %xmm1    # 0x11e980
divss %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
leaq 0x185edd(%rip), %rax    # 0x21b358
movsd %xmm0, (%rax)
leaq 0x277e46(%rip), %rax    # 0x30d2cc
movl $0x1, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_sirf_sw_ver()
void parse_sirf_sw_ver()
{
int i;
int len;

   log_packet_id("sirf_sw_ver");

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

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

   have_info |= ALL_ID_INFO;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x8ea92(%rip), %rdi     # 0x124788
callq 0x58e77
leaq 0x2a7c7e(%rip), %rbx    # 0x33d980
movb $0x0, (%rbx)
movl 0x2d6df1(%rip), %eax    # 0x36cafc
leal -0x2(%rax), %ecx
cmpl $0x51, %eax
movl $0x4e, %eax
cmovbl %ecx, %eax
testl %eax, %eax
jle 0x95d4d
movl %eax, %r14d
xorl %r15d, %r15d
leaq 0x1a9246(%rip), %r12    # 0x23ef70
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x95d3b
orb $0x8, (%r12)
movb %al, (%r15,%rbx)
movb $0x0, 0x1(%r15,%rbx)
incq %r15
cmpq %r15, %r14
jne 0x95d2a
leaq 0x277c20(%rip), %rax    # 0x30d974
orb $0xf, (%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_sirf_pps()
void parse_sirf_pps()
{
double utc_frac;
u08 status;
int i;

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

   have_sirf_pps = 1;

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

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

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

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x8e1c4(%rip), %rdi     # 0x1247b1
callq 0x58e77
leaq 0x276d2b(%rip), %rax    # 0x30d324
movl $0x1, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x96615
leaq 0x1a895e(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x9662b
leaq 0x1a8948(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x96641
leaq 0x1a8932(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x96657
leaq 0x1a891c(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x9666d
leaq 0x1a8906(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x588f0
callq 0x588f0
movl %eax, %ebx
callq 0x589b0
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x96694
leaq 0x1a88df(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
testb $0x4, %al
je 0x966f0
leaq 0x277095(%rip), %rax    # 0x30d734
cmpl $0x0, (%rax)
jne 0x966f0
movswl %bx, %eax
leaq 0x27707a(%rip), %rcx    # 0x30d728
movl %eax, (%rcx)
leaq 0x276c65(%rip), %rax    # 0x30d31c
cmpl $0x0, (%rax)
jne 0x966f0
leaq 0x276e51(%rip), %rcx    # 0x30d514
cmpl $0x7e1, (%rcx)          # imm = 0x7E1
setge %cl
cmpw $0x12, %bx
setl %dl
cmpw $0x11, %bx
jl 0x966f0
andb %cl, %dl
jne 0x966f0
leaq 0x182160(%rip), %rcx    # 0x218844
movl $0x7d5, (%rcx)          # imm = 0x7D5
movl $0x5, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_sirf_clock()
void parse_sirf_clock()
{
u32 drift;
u32 bias;
u32 time;

   log_packet_id("sirf_clock");

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

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

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x8e0b5(%rip), %rdi     # 0x1247ba
callq 0x58e77
callq 0x588f0
callq 0x589b0
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x9672a
leaq 0x1a8849(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x589b0
movl %eax, %r14d
callq 0x589b0
movl %eax, %ebx
callq 0x589b0
leaq 0x276af3(%rip), %rcx    # 0x30d238
movl $0x14, %eax
movl %eax, (%rcx)
leaq 0x276af1(%rip), %rcx    # 0x30d244
movl %eax, (%rcx)
xorpd %xmm0, %xmm0
testl %r14d, %r14d
je 0x9677a
movl %r14d, %ecx
cvtsi2sd %rcx, %xmm1
movsd 0x72902(%rip), %xmm0    # 0x109070
divsd %xmm1, %xmm0
mulsd 0x728ae(%rip), %xmm0    # 0x109028
leaq 0x276037(%rip), %rcx    # 0x30c7b8
movsd %xmm0, (%rcx)
movl %ebx, %ecx
xorps %xmm0, %xmm0
cvtsi2sd %rcx, %xmm0
divsd 0x728b9(%rip), %xmm0    # 0x109050
leaq 0x276022(%rip), %rcx    # 0x30c7c0
movsd %xmm0, (%rcx)
leaq 0x276a8b(%rip), %rcx    # 0x30d234
movl %eax, (%rcx)
leaq 0x276a96(%rip), %rcx    # 0x30d248
movl %eax, (%rcx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: decode_sirf_msg()
void decode_sirf_msg()
{
u08 id;

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

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

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

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl $0x1, %edi
callq 0x7f47d
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x96a02
leaq 0x1a8571(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %ecx
cmpl $0x1a, %ecx
jg 0x96a32
addl $-0x2, %ecx
cmpl $0x11, %ecx
ja 0x96a98
leaq 0x88cc7(%rip), %rdx     # 0x11f6e4
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
leaq 0x8ddba(%rip), %rdi     # 0x1247e7
jmp 0x96ab6
cmpl $0x1b, %ecx
je 0x96a88
cmpl $0x29, %ecx
je 0x96a91
cmpl $0x34, %ecx
jne 0x96a98
callq 0x965e0
jmp 0x96abb
leaq 0x8dd86(%rip), %rdi     # 0x1247d5
jmp 0x96ab6
callq 0x95d60
jmp 0x96abb
callq 0x966f7
jmp 0x96abb
callq 0x967b9
jmp 0x96abb
callq 0x95ce4
jmp 0x96abb
leaq 0x8dd6a(%rip), %rdi     # 0x1247de
jmp 0x96ab6
leaq 0x8dd22(%rip), %rdi     # 0x12479f
jmp 0x96ab6
leaq 0x8dd78(%rip), %rdi     # 0x1247fe
jmp 0x96ab6
leaq 0x8dd65(%rip), %rdi     # 0x1247f4
jmp 0x96ab6
callq 0x96118
jmp 0x96abb
movzbl %al, %edx
leaq 0x2a577e(%rip), %rbx    # 0x33c220
leaq 0x8dd65(%rip), %rsi     # 0x12480e
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
callq 0x58e77
leaq 0x1a78fe(%rip), %rax    # 0x23e3c0
cmpq $0x0, (%rax)
setne %al
leaq 0x18cb30(%rip), %rcx    # 0x223600
movq (%rcx), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x96ae5
callq 0xaff7
leaq 0x1a84b4(%rip), %rax    # 0x23efa0
movl $0x1, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_venus_masks()
void parse_venus_masks()
{
u08 flags;
u08 el;
u08 cnr;

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

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

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x8d7ea(%rip), %rdi     # 0x124850
callq 0x58e77
callq 0x587d1
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0x97083
leaq 0x1a7ef0(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
movl %eax, %r14d
cmpl $0x100, %eax            # imm = 0x100
jb 0x9709c
leaq 0x1a7ed7(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x970b2
leaq 0x1a7ec1(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
leal -0x1(%rbx), %ecx
cmpb $0x1, %cl
ja 0x970da
movzbl %r14b, %ecx
cvtsi2ss %ecx, %xmm0
leaq 0x275feb(%rip), %rcx    # 0x30d0b4
movss %xmm0, (%rcx)
leaq 0x276328(%rip), %rcx    # 0x30d3fc
movl $0x1, (%rcx)
andb $-0x3, %bl
cmpb $0x1, %bl
jne 0x97104
movzbl %al, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
leaq 0x275fc5(%rip), %rax    # 0x30d0b8
movss %xmm0, (%rax)
leaq 0x2762fa(%rip), %rax    # 0x30d3f8
movl $0x1, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_venus_cable()
void parse_venus_cable()
{
   log_packet_id("venus_cable");
   cable_delay = (float) (S32) tsip_dword();
   cable_delay *= 1.0E-11;

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

   show_cable_delay();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8d748(%rip), %rdi     # 0x12485c
callq 0x58e77
callq 0x589b0
cvtsi2ss %eax, %xmm0
cvtss2sd %xmm0, %xmm0
mulsd 0x87582(%rip), %xmm0    # 0x11e6b0
leaq 0x276c93(%rip), %rax    # 0x30ddc8
movsd %xmm0, (%rax)
leaq 0x276174(%rip), %rax    # 0x30d2b4
movl $0x1, (%rax)
popq %rbp
jmp 0x754c4
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_venus_survey(int)
void parse_venus_survey(int msg)
{
u08 mode;
u32 len;
u32 sdev;
double slat,slon,salt;
u08 rtime;
u32 rlen;

   log_packet_id("venus_survey");

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

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

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x8d70e(%rip), %rdi     # 0x124868
callq 0x58e77
leaq 0x2a6c8e(%rip), %r14    # 0x33ddf4
cmpl $0x0, (%r14)
jne 0x97171
callq 0x82b7c
leaq 0x2762b0(%rip), %rax    # 0x30d428
orb $0x4, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x97191
leaq 0x1a7de2(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x589b0
callq 0x589b0
callq 0x58b86
callq 0x58b86
callq 0x58aae
callq 0x587d1
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0x971c2
leaq 0x1a7db1(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x589b0
movl %eax, %ecx
leaq 0x276ca8(%rip), %rax    # 0x30de78
movq (%rax), %rsi
testq %rsi, %rsi
jle 0x971e9
imull $0x64, %ecx, %eax
xorl %edx, %edx
divq %rsi
movl $0x64, %edx
subl %eax, %edx
jmp 0x971ee
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
leaq 0x276c97(%rip), %rax    # 0x30de8c
movl %edx, (%rax)
leaq 0x276c92(%rip), %rax    # 0x30de90
movl $0x4, (%rax)
leaq 0x275fcd(%rip), %rax    # 0x30d1d8
movl (%rax), %edx
movl %edx, %esi
andl $-0x21, %esi
movl %esi, (%rax)
leaq 0x275eb8(%rip), %rsi    # 0x30d0d3
movb $0x0, (%rsi)
orl (%r14), %ecx
je 0x9724f
testb %bl, %bl
je 0x97244
movzbl %bl, %ecx
cmpl $0x2, %ecx
je 0x9723d
cmpl $0x1, %ecx
jne 0x9724f
orl $0x20, %edx
movl %edx, (%rax)
movb $0xb, %al
jmp 0x97246
movb $0x1, (%rsi)
movb $0x7, %al
jmp 0x97246
movb $0x4, %al
leaq 0x275e83(%rip), %rcx    # 0x30d0d0
movb %al, (%rcx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_venus_pps()
void parse_venus_pps()
{
u08 sub_code;
u32 freq;
u32 width;

pps_enabled = pps_mode = 1; // zzzzz
   have_pps_enable = 4;
   have_pps_mode = 4;
   sub_code = tsip_byte();
   freq = width = 0;

   if(sub_code == 0x80) {   // width (us) 1..100000us
      log_packet_id("pps width");
      width = tsip_dword();
      if(saw_timing_msg & 0x08) {
         pps2_duty = 0.50;
         have_pps_duty |= 0x02;
      }
      else {
         if(pps1_freq) {
            pps1_duty = (((double) (width)) / 1.0E6) /  (1.0 / pps1_freq);
            have_pps_duty |= 0x01;
         }
      }
   }
   else if(sub_code == 0x81) {  // freq (not all firmware does this)
      log_packet_id("pps freq");
      freq = tsip_dword();
      if(saw_timing_msg & 0x08) {
         pps2_freq = (double) freq;
         have_pps_freq |= 0x02;
      }
      else {
//!!!!   pps1_freq = (double) freq;
         pps1_freq = 1.0;        // only does 1PPS, can't set the freq
         have_pps_freq |= 0x01;
      }
   }
   else {
      log_packet_id("unsupported pps subcode");
   }
//sprintf(debug_text, "freq %d:%d  width %d:%d  duty:%f", have_pps_freq,freq,  have_pps_duty,width,pps1_duty); // qqqqqqqq
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x276ac3(%rip), %rax    # 0x30dd22
movb $0x1, %cl
movb %cl, (%rax)
leaq 0x276ab6(%rip), %rax    # 0x30dd20
movb %cl, (%rax)
leaq 0x276069(%rip), %rax    # 0x30d2dc
movl $0x4, %ecx
movl %ecx, (%rax)
leaq 0x27606b(%rip), %rax    # 0x30d2ec
movl %ecx, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x97299
leaq 0x1a7cda(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
cmpb $-0x7f, %al
je 0x97321
movzbl %al, %eax
cmpl $0x80, %eax
jne 0x9735e
leaq 0x8d5bf(%rip), %rdi     # 0x124875
callq 0x58e77
callq 0x589b0
leaq 0x276161(%rip), %rcx    # 0x30d428
testb $0x8, (%rcx)
jne 0x9736b
leaq 0x276a51(%rip), %rcx    # 0x30dd28
movsd (%rcx), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x972eb
jnp 0x973a4
movl %eax, %eax
xorps %xmm1, %xmm1
cvtsi2sd %rax, %xmm1
divsd 0x71d53(%rip), %xmm1    # 0x109050
movsd 0x71d6b(%rip), %xmm2    # 0x109070
divsd %xmm0, %xmm2
divsd %xmm2, %xmm1
leaq 0x276a1c(%rip), %rax    # 0x30dd30
movsd %xmm1, (%rax)
leaq 0x276a45(%rip), %rax    # 0x30dd64
jmp 0x97359
leaq 0x8d557(%rip), %rdi     # 0x12487f
callq 0x58e77
callq 0x589b0
leaq 0x2760ef(%rip), %rcx    # 0x30d428
testb $0x8, (%rcx)
jne 0x97388
leaq 0x2769e3(%rip), %rax    # 0x30dd28
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, (%rax)
leaq 0x276a07(%rip), %rax    # 0x30dd60
orb $0x1, (%rax)
jmp 0x973a4
leaq 0x8d523(%rip), %rdi     # 0x124888
popq %rbp
jmp 0x58e77
leaq 0x2769d6(%rip), %rax    # 0x30dd48
movabsq $0x3fe0000000000000, %rcx # imm = 0x3FE0000000000000
movq %rcx, (%rax)
leaq 0x2769de(%rip), %rax    # 0x30dd64
jmp 0x973a1
movl %eax, %eax
cvtsi2sd %rax, %xmm0
leaq 0x2769aa(%rip), %rax    # 0x30dd40
movsd %xmm0, (%rax)
leaq 0x2769bf(%rip), %rax    # 0x30dd60
orb $0x2, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_venus_rtk()
void parse_venus_rtk()
{
int sub_code;

   sub_code = tsip_byte();
   if(sub_code == 0x80) {
      log_packet_id("venus rtk");
      rtk_mode = tsip_byte();
      have_rtk_mode = 1;
   }
   else {
      log_packet_id("unsupported rtk subcode");
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x973c0
leaq 0x1a7bb3(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
negb %al
jno 0x97401
leaq 0x8d4d5(%rip), %rdi     # 0x1248a0
callq 0x58e77
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x973e6
leaq 0x1a7b8d(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
leaq 0x2a6a0c(%rip), %rcx    # 0x33ddfc
movl %eax, (%rcx)
leaq 0x2a6a07(%rip), %rax    # 0x33de00
movl $0x1, (%rax)
popq %rbp
retq
leaq 0x8d4a2(%rip), %rdi     # 0x1248aa
popq %rbp
jmp 0x58e77
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_venus_sbas()
void parse_venus_sbas()
{
u08 sub_code;
u08 flag;
u08 qzss_chans;
u08 sbas_mode;
u08 sbas_ura;
u08 sbas_correct;
u08 sbas_chans;
u08 sbas_mask;

   // message type 0x62 responses

   sub_code = tsip_byte();
   flag = tsip_byte();
   if(sub_code == 0x80) {  // SBAS status
      log_packet_id("venus sbas status");
      if(flag) gnss_mask |= SBAS;
      else     gnss_mask &= (~SBAS);
      sbas_mode = tsip_byte();
      sbas_ura = tsip_byte();
      sbas_correct = tsip_byte();
      sbas_chans = tsip_byte();
      sbas_mask = tsip_byte();
//sprintf(plot_title, "sbas flag:%02X mode:%02X ura:%02X correct:%02X chans:%d mask:%d",
//flag, sbas_mode, sbas_ura, sbas_correct, sbas_chans, sbas_mask);
   }
   else if(sub_code == 0x81) {  // QZSS status
      log_packet_id("venus qzss status");
      if(flag) gnss_mask |= QZSS;
      else     gnss_mask &= (~QZSS);

      qzss_chans = tsip_byte();
//sprintf(debug_text, "qzss flag:%02X chans:%d", flag,qzss_chans);
   }
   else {
      log_packet_id("unsupported sbas subcode");
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
callq 0x587d1
movl %eax, %r14d
cmpl $0x100, %eax            # imm = 0x100
jb 0x9742e
leaq 0x1a7b45(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0x97446
leaq 0x1a7b2d(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
cmpb $-0x7f, %r14b
je 0x974e1
movzbl %r14b, %eax
cmpl $0x80, %eax
jne 0x97524
leaq 0x8d45c(%rip), %rdi     # 0x1248c2
callq 0x58e77
xorl %eax, %eax
testb %bl, %bl
setne %al
leaq 0xd97fb(%rip), %rcx     # 0x170c74
movl $0xffff7fff, %edx       # imm = 0xFFFF7FFF
andl (%rcx), %edx
shll $0xf, %eax
orl %edx, %eax
movl %eax, (%rcx)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x9749d
leaq 0x1a7ad6(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x974b3
leaq 0x1a7ac0(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x974c9
leaq 0x1a7aaa(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x97509
leaq 0x1a7a94(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
jmp 0x97509
leaq 0x8d3ec(%rip), %rdi     # 0x1248d4
callq 0x58e77
xorl %eax, %eax
testb %bl, %bl
setne %al
leaq 0xd9779(%rip), %rcx     # 0x170c74
movl $0xffffbfff, %edx       # imm = 0xFFFFBFFF
andl (%rcx), %edx
shll $0xe, %eax
orl %edx, %eax
movl %eax, (%rcx)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x9751f
leaq 0x1a7a54(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x8d3bb(%rip), %rdi     # 0x1248e6
popq %rbx
popq %r14
popq %rbp
jmp 0x58e77
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_venus_version()
void parse_venus_version()
{
u08 sw_type;
u32 kernel;
u32 odm;
u32 rev;

   log_packet_id("venus_version");
   sw_type = tsip_byte();
   kernel = tsip_dword();
   odm = tsip_dword();
   rev = tsip_dword();

   sprintf(venus_kern, "%04d.%02d.%02d", (kernel>>16), (kernel>>8)&0xFF, kernel&0xFF);
   sprintf(venus_odm,  "Ver:  %04d.%02d.%02d", (odm>>16), (odm>>8)&0xFF, odm&0xFF);
   sprintf(venus_rev,  "Rev:  %04d.%02d.%02d", (rev>>16), (rev>>8)&0xFF, rev&0xFF);

   have_info |= ALL_ID_INFO;
//sprintf(plot_title, "k:%08X  odm:%08X  rev:%08X", kernel,odm,rev);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x8d201(%rip), %rdi     # 0x12496c
callq 0x58e77
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x97786
leaq 0x1a77ed(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x589b0
movl %eax, %r15d
callq 0x589b0
movl %eax, %r14d
callq 0x589b0
movl %eax, %ebx
movl %r15d, %edx
shrl $0x10, %edx
movl %r15d, %ecx
shrl $0x8, %ecx
movl $0xff, %r12d
andl %r12d, %ecx
andl %r12d, %r15d
leaq 0x2a65d4(%rip), %rdi    # 0x33dd90
leaq 0x8d1bd(%rip), %rsi     # 0x124980
movl %r15d, %r8d
xorl %eax, %eax
callq 0x9060
movl %r14d, %edx
shrl $0x10, %edx
movl %r14d, %ecx
shrl $0x8, %ecx
andl %r12d, %ecx
andl %r12d, %r14d
leaq 0x2a65ca(%rip), %rdi    # 0x33ddb0
leaq 0x8d18d(%rip), %rsi     # 0x12497a
movl %r14d, %r8d
xorl %eax, %eax
callq 0x9060
movl %ebx, %edx
shrl $0x10, %edx
movl %ebx, %ecx
shrl $0x8, %ecx
andl %r12d, %ecx
andl %r12d, %ebx
leaq 0x2a65c2(%rip), %rdi    # 0x33ddd0
leaq 0x8d17a(%rip), %rsi     # 0x12498f
movl %ebx, %r8d
xorl %eax, %eax
callq 0x9060
leaq 0x27614e(%rip), %rax    # 0x30d974
orb $0xf, (%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_venus_rate()
void parse_venus_rate()
{
float rate;

   log_packet_id("venus_rate");
   rate = (float) tsip_byte();
   if(!pause_data) {
      nav_rate = rate;
      have_nav_rate = 2;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x8d12b(%rip), %rdi     # 0x1249b8
callq 0x58e77
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x978a8
leaq 0x1a76cb(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
leaq 0x183985(%rip), %rcx    # 0x21b234
cmpb $0x0, (%rcx)
jne 0x978d3
movzbl %al, %eax
cvtsi2sd %eax, %xmm0
leaq 0x183a96(%rip), %rax    # 0x21b358
movsd %xmm0, (%rax)
leaq 0x2759ff(%rip), %rax    # 0x30d2cc
movl $0x2, (%rax)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_venus_mtime()
void parse_venus_mtime()
{
int tow;
int week;
double meas_tow;
int xtow;

   // raw measurement epoch
   log_packet_id("venus_mtime");
if(saw_venus_raw & 0x10) return;  // use extended raw data

   saw_venus_raw |= 0x04;
   minor_alarms &= (~MINOR_NO_TRACK);
   tsip_byte();  // iod
   week = tsip_word();
   tow = tsip_dword();
   tsip_word();  // measurement period
   if(raw_msg_rate == 0) return;

   meas_tow = ((double) tow) / 1000.0; // measurement tow
   xtow = (int) (meas_tow*nav_rate);   // raw Hz

   if(1) {  // this might cause time stamp faults in CSRS-PPP  rnx3
      if(xtow % (int) ((double)raw_msg_rate*nav_rate)) return;

      obs_tow = meas_tow;
      jd_obs = GPS_EPOCH + ((double) week * 7.0) + jtime(0,0,0,meas_tow);
   }
   else {  // Only 1Hz nav rate
      if(((int) meas_tow % raw_msg_rate) != 0) return;  // drop unwanted messages

      obs_tow = meas_tow;
      jd_obs = GPS_EPOCH + ((double) week * 7.0) + jtime(0,0,0,meas_tow);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0x8cae8(%rip), %rdi     # 0x1249dd
callq 0x58e77
leaq 0x2a5ef3(%rip), %rax    # 0x33ddf4
movl (%rax), %ecx
testb $0x10, %cl
jne 0x97fd1
orl $0x4, %ecx
movl %ecx, (%rax)
leaq 0x2752c0(%rip), %rax    # 0x30d1d8
andb $-0x9, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x97f31
leaq 0x1a7042(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x588f0
movl %eax, %ebx
callq 0x589b0
movl %eax, %r14d
callq 0x588f0
leaq 0x18342c(%rip), %rax    # 0x21b378
movl (%rax), %ecx
testl %ecx, %ecx
je 0x97fd1
cvtsi2sd %r14d, %xmm0
divsd 0x710d9(%rip), %xmm0    # 0x109038
leaq 0x1833f2(%rip), %rax    # 0x21b358
movsd (%rax), %xmm1
movapd %xmm0, %xmm2
mulsd %xmm1, %xmm2
cvttsd2si %xmm2, %eax
xorps %xmm2, %xmm2
cvtsi2sd %ecx, %xmm2
mulsd %xmm1, %xmm2
cvttsd2si %xmm2, %ecx
cltd
idivl %ecx
testl %edx, %edx
jne 0x97fd1
leaq 0x2755e5(%rip), %rax    # 0x30d578
movsd %xmm0, (%rax)
movzwl %bx, %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
mulsd 0x73957(%rip), %xmm1    # 0x10b900
addsd 0x738d7(%rip), %xmm1    # 0x10b888
movsd %xmm1, -0x18(%rbp)
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0xd41e0
addsd -0x18(%rbp), %xmm0
leaq 0x2755a3(%rip), %rax    # 0x30d570
movsd %xmm0, (%rax)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: get_zod_seq(int)
void get_zod_seq(int sat_meas)
{
int ts;
int seq;
int sat_seq;

   ts = tsip_dword();  // timestamp
   seq = tsip_word();  // seq
   if(sat_meas) {      // satellite measurement sequence number
      sat_seq = tsip_word();
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
callq 0x589b0
callq 0x588f0
addq $0x8, %rsp
testl %ebx, %ebx
je 0x98bf8
popq %rbx
popq %rbp
jmp 0x588f0
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_zod_temp()
void parse_zod_temp()
{
u16 t0;
s16 tref;
s16 tfilt;
s16 s0;
float dt;

   log_packet_id("temperature");
   tfilt = 0;     // !!!! current temp sensor reading - but no messages
                  //      return it... thus, this code is USELESS !!!!

   get_zod_seq(0);

   tsip_word();

   tsip_word();
   tsip_word();
   tsip_word();
   tsip_word();
   tsip_word();

   tsip_word();
   tsip_word();

   tref = tsip_word();
   t0 = tsip_word();
   s0 = tsip_word();

   tsip_word();
   tsip_word();

   dt = ((float) s0) / (65536.0F*100.0F); // s0 = deg/count
   dt *= ((float) (tfilt-t0));             // t0 = counts, tfilt=current sensor reading

   temperature = (DATA_SIZE) ((((float) tref) * 0.01F) - dt);  // !!!! but no way to get tfilt !!!!
   have_temperature = 107;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x8b78d(%rip), %rdi     # 0x124399
callq 0x58e77
callq 0x589b0
callq 0x588f0
callq 0x588f0
callq 0x588f0
callq 0x588f0
callq 0x588f0
callq 0x588f0
callq 0x588f0
callq 0x588f0
callq 0x588f0
callq 0x588f0
movl %eax, %ebx
callq 0x588f0
movl %eax, %r14d
callq 0x588f0
movl %eax, %r15d
callq 0x588f0
callq 0x588f0
movswl %r15w, %eax
cvtsi2ss %eax, %xmm0
movzwl %r14w, %eax
negl %eax
cvtsi2ss %eax, %xmm1
movswl %bx, %eax
cvtsi2ss %eax, %xmm2
divss 0x85d2b(%rip), %xmm0    # 0x11e9b0
mulss %xmm1, %xmm0
mulss 0x85d23(%rip), %xmm2    # 0x11e9b4
addss %xmm0, %xmm2
xorps %xmm0, %xmm0
cvtss2sd %xmm2, %xmm0
leaq 0x273d75(%rip), %rax    # 0x30ca18
movsd %xmm0, (%rax)
leaq 0x27459e(%rip), %rax    # 0x30d24c
movl $0x6b, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq