// File: 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
subq $0x20, %rsp
leaq 0xbb341(%rip), %rdi     # 0x187b60
callq 0x7add0
callq 0x7a560
movw %ax, %cx
leaq 0x2a00e5(%rip), %rax    # 0x36c918
movw %cx, (%rax)
leaq 0x2a00eb(%rip), %rax    # 0x36c928
movl $0x0, (%rax)
callq 0x7a680
movl $0x64, %ecx
xorl %edx, %edx
divl %ecx
movl %eax, %ecx
leaq 0x2a00c6(%rip), %rax    # 0x36c920
movl %ecx, (%rax)
leaq 0x2a00c1(%rip), %rax    # 0x36c924
movl %ecx, (%rax)
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x4(%rbp)
callq 0x81c10
leaq 0x1d1870(%rip), %rax    # 0x29e0ec
movl $0x0, (%rax)
movl -0x4(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x4(%rbp)
cmpl $0x0, %eax
je 0xccb48
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x8(%rbp)
callq 0x7a510
movzbl %al, %eax
cvtsi2ss %eax, %xmm0
movss 0xb6a63(%rip), %xmm1    # 0x183318
mulss %xmm1, %xmm0
movss 0xa507f(%rip), %xmm1    # 0x171940
movss %xmm1, -0x1c(%rbp)
mulss %xmm1, %xmm0
movss %xmm0, -0xc(%rbp)
callq 0x7a510
movss -0x1c(%rbp), %xmm1
movzbl %al, %eax
cvtsi2ss %eax, %xmm0
mulss %xmm1, %xmm0
movss %xmm0, -0x10(%rbp)
callq 0x7a560
movw %ax, -0x16(%rbp)
callq 0x7a510
movzbl %al, %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x14(%rbp)
callq 0x7a510
movzbl %al, %eax
cvtsi2ss %eax, %xmm1
movss -0x14(%rbp), %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x14(%rbp)
callq 0x7a510
movzbl %al, %eax
cvtsi2ss %eax, %xmm1
movss -0x14(%rbp), %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x14(%rbp)
callq 0x7a510
movzbl %al, %eax
cvtsi2ss %eax, %xmm1
movss -0x14(%rbp), %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x14(%rbp)
callq 0x7a510
movzbl %al, %eax
cvtsi2ss %eax, %xmm1
movss -0x14(%rbp), %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x14(%rbp)
callq 0x7a510
movzbl %al, %eax
cvtsi2ss %eax, %xmm1
movss -0x14(%rbp), %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x14(%rbp)
callq 0x7a510
movzbl %al, %eax
cvtsi2ss %eax, %xmm1
movss -0x14(%rbp), %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x14(%rbp)
callq 0x7a510
movzbl %al, %eax
cvtsi2ss %eax, %xmm1
movss -0x14(%rbp), %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x14(%rbp)
callq 0x7a510
movzbl %al, %eax
cvtsi2ss %eax, %xmm1
movss -0x14(%rbp), %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x14(%rbp)
callq 0x7a510
movzbl %al, %eax
cvtsi2ss %eax, %xmm0
addss -0x14(%rbp), %xmm0
movss %xmm0, -0x14(%rbp)
movss -0x14(%rbp), %xmm0
movss 0xb692a(%rip), %xmm1    # 0x183320
divss %xmm1, %xmm0
movss %xmm0, -0x14(%rbp)
cmpl $0x1, -0x8(%rbp)
jl 0xccb43
cmpl $0x3e7, -0x8(%rbp)      # imm = 0x3E7
jg 0xccb43
movl -0x8(%rbp), %edi
movss -0xc(%rbp), %xmm0
movss -0x10(%rbp), %xmm1
callq 0x7d450
movss -0x14(%rbp), %xmm0
movslq -0x8(%rbp), %rcx
leaq 0x1d1758(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movss %xmm0, 0x20(%rax)
movslq -0x8(%rbp), %rcx
leaq 0x1d173e(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movl $0x18, 0x1c(%rax)
leaq 0x29fa0a(%rip), %rax    # 0x36c474
movl $0x4, (%rax)
movzwl -0x16(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xcca9c
movl -0x8(%rbp), %ecx
movslq -0x8(%rbp), %rdx
leaq 0x1d1706(%rip), %rax    # 0x29e190
imulq $0x348, %rdx, %rdx      # imm = 0x348
addq %rdx, %rax
movl %ecx, 0x218(%rax)
jmp 0xccabb
movslq -0x8(%rbp), %rcx
leaq 0x1d16e9(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movl $0xffffffff, 0x218(%rax) # imm = 0xFFFFFFFF
movl -0x8(%rbp), %edi
callq 0x12d280
movl %eax, %ecx
leaq 0x29fa60(%rip), %rax    # 0x36c52c
orl (%rax), %ecx
leaq 0x29fa57(%rip), %rax    # 0x36c52c
movl %ecx, (%rax)
movzwl -0x16(%rbp), %ecx
movslq -0x8(%rbp), %rdx
leaq 0x1d16aa(%rip), %rax    # 0x29e190
imulq $0x348, %rdx, %rdx      # imm = 0x348
addq %rdx, %rax
movl %ecx, 0x18(%rax)
leaq 0x29fa22(%rip), %rax    # 0x36c51c
cmpl $0x0, (%rax)
jne 0xccb0c
leaq 0x1aaf1e(%rip), %rax    # 0x277a24
movl $0x7e6, (%rax)          # imm = 0x7E6
leaq 0x29fa09(%rip), %rax    # 0x36c51c
movl $0x4, (%rax)
movl -0x8(%rbp), %edi
callq 0x80340
leaq 0x1d15c4(%rip), %rax    # 0x29e0ec
movl (%rax), %ecx
addl $0x1, %ecx
leaq 0x1d15b8(%rip), %rax    # 0x29e0ec
movl %ecx, (%rax)
leaq 0x29f9bb(%rip), %rax    # 0x36c4f8
movl $0x15, (%rax)
jmp 0xcc882
leaq 0x1d159d(%rip), %rax    # 0x29e0ec
movl (%rax), %edi
callq 0x82080
leaq 0x29f9af(%rip), %rax    # 0x36c50c
cmpl $0x0, (%rax)
jne 0xccb6f
leaq 0x1aaebb(%rip), %rax    # 0x277a24
movl $0x7e7, (%rax)          # imm = 0x7E7
leaq 0x29f996(%rip), %rax    # 0x36c50c
movl $0x3, (%rax)
leaq 0x29f985(%rip), %rax    # 0x36c508
cmpl $0x0, (%rax)
jne 0xccb95
leaq 0x1aae95(%rip), %rax    # 0x277a24
movl $0x7e8, (%rax)          # imm = 0x7E8
leaq 0x29f96c(%rip), %rax    # 0x36c508
movl $0x3, (%rax)
leaq 0x1d152f(%rip), %rax    # 0x29e0d8
leaq 0xb83ba(%rip), %rcx     # 0x184f6a
movq %rcx, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)