// File: /workspace/github_cpp_makefile_star2_O1/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 $0x28, %rsp
leaq 0x8ea1c(%rip), %rdi     # 0x124794
callq 0x58e77
callq 0x588f0
leaq 0x2779af(%rip), %rcx    # 0x30d738
movw %ax, (%rcx)
leaq 0x2779b5(%rip), %rax    # 0x30d748
movl $0x0, (%rax)
callq 0x589b0
movl %eax, %eax
imulq $0x51eb851f, %rax, %rax # imm = 0x51EB851F
shrq $0x25, %rax
leaq 0x27798e(%rip), %rcx    # 0x30d740
movl %eax, (%rcx)
leaq 0x277989(%rip), %rcx    # 0x30d744
movl %eax, (%rcx)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x95dd3
leaq 0x1a91a0(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movl $0x218, %edx            # imm = 0x218
leaq 0x1a91d1(%rip), %rsi    # 0x23efb0
xorl %ecx, %ecx
movl %ecx, (%rsi,%rdx)
movl %ecx, -0x1fc(%rsi,%rdx)
addq $0x348, %rdx            # imm = 0x348
cmpq $0xcd358, %rdx          # imm = 0xCD358
jne 0x95de1
leaq 0x1a910a(%rip), %rcx    # 0x23ef0c
movl $0x0, (%rcx)
andl $0xff, %eax
je 0x9609b
leaq 0x1a9156(%rip), %rbx    # 0x23ef70
movl %eax, -0x4c(%rbp)
callq 0x587d1
movl %eax, %r14d
cmpl $0x100, %eax            # imm = 0x100
jb 0x95e2f
orb $0x8, (%rbx)
callq 0x587d1
movl %eax, -0x2c(%rbp)
cmpl $0x100, %eax            # imm = 0x100
jb 0x95e41
orb $0x8, (%rbx)
callq 0x587d1
movl %eax, -0x48(%rbp)
cmpl $0x100, %eax            # imm = 0x100
jb 0x95e53
orb $0x8, (%rbx)
callq 0x588f0
movw %ax, -0x2e(%rbp)
callq 0x587d1
movl %eax, -0x44(%rbp)
cmpl $0x100, %eax            # imm = 0x100
jb 0x95e6e
orb $0x8, (%rbx)
callq 0x587d1
movl %eax, -0x40(%rbp)
cmpl $0x100, %eax            # imm = 0x100
jb 0x95e80
orb $0x8, (%rbx)
callq 0x587d1
movl %eax, -0x3c(%rbp)
cmpl $0x100, %eax            # imm = 0x100
jb 0x95e92
orb $0x8, (%rbx)
callq 0x587d1
movl %eax, -0x38(%rbp)
cmpl $0x100, %eax            # imm = 0x100
jb 0x95ea4
orb $0x8, (%rbx)
callq 0x587d1
movl %eax, -0x34(%rbp)
cmpl $0x100, %eax            # imm = 0x100
jb 0x95eb6
orb $0x8, (%rbx)
callq 0x587d1
movl %eax, %r12d
cmpl $0x100, %eax            # imm = 0x100
jb 0x95ec8
orb $0x8, (%rbx)
callq 0x587d1
movl %eax, %r13d
cmpl $0x100, %eax            # imm = 0x100
jb 0x95eda
orb $0x8, (%rbx)
callq 0x587d1
movl %eax, %r15d
cmpl $0x100, %eax            # imm = 0x100
jb 0x95eec
orb $0x8, (%rbx)
callq 0x587d1
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0x95f04
leaq 0x1a906f(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x95f1a
leaq 0x1a9059(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
testb %r14b, %r14b
je 0x96089
movzbl -0x44(%rbp), %ecx
cvtsi2ss %ecx, %xmm0
movzbl -0x40(%rbp), %ecx
cvtsi2ss %ecx, %xmm2
movzbl -0x3c(%rbp), %ecx
cvtsi2ss %ecx, %xmm3
movzbl -0x38(%rbp), %ecx
cvtsi2ss %ecx, %xmm4
movzbl -0x34(%rbp), %ecx
cvtsi2ss %ecx, %xmm5
movzbl %r12b, %ecx
cvtsi2ss %ecx, %xmm6
movzbl %r13b, %ecx
cvtsi2ss %ecx, %xmm7
movzbl %r15b, %ecx
cvtsi2ss %ecx, %xmm8
movzbl %bl, %ecx
cvtsi2ss %ecx, %xmm9
movl $0xff, %r15d
andl %r15d, %eax
cvtsi2ss %eax, %xmm10
movzbl -0x48(%rbp), %eax
cvtsi2ss %eax, %xmm1
addss %xmm0, %xmm2
addss %xmm2, %xmm3
addss %xmm3, %xmm4
addss %xmm4, %xmm5
addss %xmm5, %xmm6
addss %xmm6, %xmm7
addss %xmm7, %xmm8
addss %xmm8, %xmm9
addss %xmm9, %xmm10
movzbl -0x2c(%rbp), %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movzbl %r14b, %ebx
divss 0x7701f(%rip), %xmm10   # 0x10cfe0
movss %xmm10, -0x2c(%rbp)
movss 0x77015(%rip), %xmm2    # 0x10cfe4
mulss %xmm2, %xmm1
mulss 0x76fe9(%rip), %xmm0    # 0x10cfc4
mulss %xmm2, %xmm0
movl %ebx, %edi
callq 0x5ad98
andl %r15d, %r14d
imulq $0x348, %r14, %r14      # imm = 0x348
leaq 0x1a8fb9(%rip), %r12    # 0x23efb0
movss -0x2c(%rbp), %xmm0
movss %xmm0, 0x20(%r12,%r14)
movl $0x18, 0x1c(%r12,%r14)
leaq 0x277281(%rip), %rax    # 0x30d294
movl $0x4, (%rax)
movzwl -0x2e(%rbp), %r15d
movl %r15d, %eax
andl $0x1, %eax
cmpl $0x1, %eax
movl $0x0, %eax
sbbl %eax, %eax
orl %ebx, %eax
movl %eax, 0x218(%r12,%r14)
movl %ebx, %edi
callq 0xdbb74
leaq 0x277306(%rip), %rcx    # 0x30d34c
orl %eax, (%rcx)
movl %r15d, 0x18(%r12,%r14)
leaq 0x2772e8(%rip), %rax    # 0x30d33c
cmpl $0x0, (%rax)
jne 0x96066
leaq 0x1827e4(%rip), %rcx    # 0x218844
movl $0x7e6, (%rcx)          # imm = 0x7E6
movl $0x4, (%rax)
movl %ebx, %edi
callq 0x5ced3
leaq 0x1a8e92(%rip), %rax    # 0x23ef0c
incl (%rax)
leaq 0x277295(%rip), %rax    # 0x30d318
movl $0x15, (%rax)
movl -0x4c(%rbp), %eax
decl %eax
leaq 0x1a8edb(%rip), %rbx    # 0x23ef70
jne 0x95e1a
leaq 0x1a8e6a(%rip), %rax    # 0x23ef0c
movl (%rax), %edi
callq 0x5e411
leaq 0x27727c(%rip), %rax    # 0x30d32c
cmpl $0x0, (%rax)
jne 0x960c2
leaq 0x182788(%rip), %rcx    # 0x218844
movl $0x7e7, (%rcx)          # imm = 0x7E7
movl $0x3, (%rax)
leaq 0x277259(%rip), %rax    # 0x30d328
cmpl $0x0, (%rax)
jne 0x960e1
leaq 0x182769(%rip), %rcx    # 0x218844
movl $0x7e8, (%rcx)          # imm = 0x7E8
movl $0x3, (%rax)
leaq 0x8bb0c(%rip), %rax     # 0x121bfa
leaq 0x1a8e03(%rip), %rcx    # 0x23eef8
movq %rax, (%rcx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq