// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_sirf_track()
void parse_sirf_track()
{
int chans;
int prn;
float az,el;
float cno;
u16 state;

   log_packet_id("sirf_track");

   gps_week = tsip_word();
   faked_tow = 0;
   pri_tow = this_tow = tsip_dword() / 100; 
   chans = tsip_byte();

   reset_sat_tracking();

   sat_count = 0;
   while(chans--) {
      prn = tsip_byte();
      az = ((float) tsip_byte() * 3.0F / 2.0F);
      el = ((float) tsip_byte() / 2.0F);
      state = tsip_word();
      cno  = ((float) tsip_byte());  // cno1
      cno += ((float) tsip_byte());  // cno2
      cno += ((float) tsip_byte());  // cno3
      cno += ((float) tsip_byte());  // cno4
      cno += ((float) tsip_byte());  // cno5
      cno += ((float) tsip_byte());  // cno6
      cno += ((float) tsip_byte());  // cno7
      cno += ((float) tsip_byte());  // cno8
      cno += ((float) tsip_byte());  // cno9
      cno += ((float) tsip_byte());  // cno10
      cno /= 10.0F;

      if((prn >= 1) && (prn <= MAX_PRN)) {
         set_sat_azel(prn, (float) az, (float) el);
         sat[prn].sig_level = cno;
         sat[prn].level_msg = 24;

         have_sat_azel = 4;

         if(state & 0x0001) sat[prn].tracking = prn;
         else               sat[prn].tracking = (-1);

         have_snr |= rinex_gnss(prn);

         sat[prn].state = state;
         if(have_state == 0) need_redraw = 2022;
         have_state = SIRF_STATE;  // STATE

         record_sig_levels(prn);
         ++sat_count;
         have_count = 21;
      }
   }
config_sat_count(sat_count);


   if(have_week == 0) need_redraw = 2023;
   have_week = 3;

   if(have_tow == 0) need_redraw = 2024;
   have_tow = 3;

   level_type = "dBc";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x86148(%rip), %rdi     # 0x10e7bc
callq 0x520bf
callq 0x51c63
leaq 0x26f0b3(%rip), %rcx    # 0x2f7738
movw %ax, (%rcx)
leaq 0x26f0b9(%rip), %rax    # 0x2f7748
andl $0x0, (%rax)
callq 0x51cf3
pushq $0x64
popq %rcx
xorl %edx, %edx
divl %ecx
leaq 0x26f09b(%rip), %rcx    # 0x2f7740
movl %eax, (%rcx)
leaq 0x26f096(%rip), %rcx    # 0x2f7744
movl %eax, (%rcx)
callq 0x51c47
movzbl %al, %ebx
callq 0x56b1c
leaq 0x1a0848(%rip), %rax    # 0x228f0c
andl $0x0, (%rax)
subl $0x1, %ebx
jb 0x888a2
callq 0x51c47
movl %eax, %r14d
callq 0x51c47
movb %al, -0x34(%rbp)
callq 0x51c47
movb %al, -0x2f(%rbp)
callq 0x51c63
movw %ax, -0x36(%rbp)
callq 0x51c47
movb %al, -0x2e(%rbp)
callq 0x51c47
movl %eax, %r12d
callq 0x51c47
movb %al, -0x2a(%rbp)
callq 0x51c47
movb %al, -0x29(%rbp)
callq 0x51c47
movl %eax, %r15d
callq 0x51c47
movl %eax, %r13d
callq 0x51c47
movb %al, -0x2d(%rbp)
callq 0x51c47
movb %al, -0x2c(%rbp)
callq 0x51c47
movb %al, -0x2b(%rbp)
callq 0x51c47
testb %r14b, %r14b
je 0x886c7
movzbl -0x2e(%rbp), %ecx
cvtsi2ss %ecx, %xmm0
movzbl %r12b, %ecx
cvtsi2ss %ecx, %xmm1
addss %xmm0, %xmm1
movzbl -0x2a(%rbp), %ecx
cvtsi2ss %ecx, %xmm0
addss %xmm1, %xmm0
movzbl -0x29(%rbp), %ecx
cvtsi2ss %ecx, %xmm1
movzbl %r15b, %ecx
cvtsi2ss %ecx, %xmm2
movzbl %r13b, %ecx
cvtsi2ss %ecx, %xmm3
addss %xmm0, %xmm1
addss %xmm1, %xmm2
addss %xmm2, %xmm3
movzbl -0x2d(%rbp), %ecx
cvtsi2ss %ecx, %xmm0
addss %xmm3, %xmm0
movzbl -0x2c(%rbp), %ecx
cvtsi2ss %ecx, %xmm1
movzbl -0x2b(%rbp), %ecx
cvtsi2ss %ecx, %xmm2
movzbl %r14b, %r12d
addss %xmm0, %xmm1
addss %xmm1, %xmm2
movzbl %al, %eax
cvtsi2ss %eax, %xmm3
addss %xmm2, %xmm3
movzbl -0x2f(%rbp), %eax
cvtsi2ss %eax, %xmm1
movzbl -0x34(%rbp), %eax
cvtsi2ss %eax, %xmm0
divss 0x6e8fe(%rip), %xmm3    # 0xf70d0
movss %xmm3, -0x34(%rbp)
movss 0x6e919(%rip), %xmm2    # 0xf70f8
mulss %xmm2, %xmm1
mulss 0x6e8f1(%rip), %xmm0    # 0xf70dc
mulss %xmm2, %xmm0
movl %r12d, %edi
callq 0x53b74
movl %r12d, %eax
imulq $0x348, %rax, %r14      # imm = 0x348
leaq 0x1a07a8(%rip), %r13    # 0x228fb0
movss -0x34(%rbp), %xmm0
movss %xmm0, 0x20(%r13,%r14)
movl $0x18, 0x1c(%r13,%r14)
leaq 0x26ea70(%rip), %rax    # 0x2f7294
movl $0x4, (%rax)
movzwl -0x36(%rbp), %r15d
movl %r15d, %eax
andl $0x1, %eax
cmpl $0x1, %eax
movl $0x0, %eax
sbbl %eax, %eax
orl %r12d, %eax
movl %eax, 0x218(%r13,%r14)
movl %r12d, %edi
callq 0xca4da
leaq 0x26eaf3(%rip), %rcx    # 0x2f734c
orl %eax, (%rcx)
movl %r15d, 0x18(%r13,%r14)
leaq 0x26ead5(%rip), %rcx    # 0x2f733c
cmpl $0x0, (%rcx)
jne 0x88879
leaq 0x179fd1(%rip), %rax    # 0x202844
movl $0x7e6, (%rax)          # imm = 0x7E6
movl $0x4, (%rcx)
movl %r12d, %edi
callq 0x559ba
leaq 0x1a067e(%rip), %rax    # 0x228f0c
incl (%rax)
leaq 0x26ea81(%rip), %rax    # 0x2f7318
movl $0x15, (%rax)
jmp 0x886c7
leaq 0x1a0663(%rip), %rax    # 0x228f0c
movl (%rax), %edi
callq 0x56d93
leaq 0x26ea75(%rip), %rax    # 0x2f732c
cmpl $0x0, (%rax)
jne 0x888c9
leaq 0x179f81(%rip), %rcx    # 0x202844
movl $0x7e7, (%rcx)          # imm = 0x7E7
movl $0x3, (%rax)
leaq 0x26ea52(%rip), %rax    # 0x2f7328
cmpl $0x0, (%rax)
jne 0x888e8
leaq 0x179f62(%rip), %rcx    # 0x202844
movl $0x7e8, (%rcx)          # imm = 0x7E8
movl $0x3, (%rax)
leaq 0x8332d(%rip), %rax     # 0x10bc22
leaq 0x1a05fc(%rip), %rcx    # 0x228ef8
movq %rax, (%rcx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq