// File: /workspace/github_cpp_makefile_star2_O3/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 0x8e9ff(%rip), %rdi     # 0x124874
callq 0x58dc2
callq 0x588d2
leaq 0x2778b2(%rip), %rcx    # 0x30d738
movw %ax, (%rcx)
leaq 0x2778b8(%rip), %rax    # 0x30d748
movl $0x0, (%rax)
callq 0x58964
movl %eax, %eax
imulq $0x51eb851f, %rax, %rax # imm = 0x51EB851F
shrq $0x25, %rax
leaq 0x277891(%rip), %rcx    # 0x30d740
movl %eax, (%rcx)
leaq 0x27788c(%rip), %rcx    # 0x30d744
movl %eax, (%rcx)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x95ed0
leaq 0x1a90a3(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movl $0x218, %edx            # imm = 0x218
leaq 0x1a90d4(%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 0x95ede
leaq 0x1a900d(%rip), %rcx    # 0x23ef0c
movl $0x0, (%rcx)
andl $0xff, %eax
je 0x961b9
leaq 0x1a9059(%rip), %r14    # 0x23ef70
movl %eax, -0x4c(%rbp)
callq 0x587be
movl %eax, %r13d
cmpl $0x100, %eax            # imm = 0x100
jb 0x95f2d
orb $0x8, (%r14)
callq 0x587be
movl %eax, -0x2c(%rbp)
cmpl $0x100, %eax            # imm = 0x100
jb 0x95f40
orb $0x8, (%r14)
callq 0x587be
movl %eax, -0x48(%rbp)
cmpl $0x100, %eax            # imm = 0x100
jb 0x95f53
orb $0x8, (%r14)
callq 0x588d2
movw %ax, -0x2e(%rbp)
callq 0x587be
movl %eax, -0x44(%rbp)
cmpl $0x100, %eax            # imm = 0x100
jb 0x95f6f
orb $0x8, (%r14)
callq 0x587be
movl %eax, -0x40(%rbp)
cmpl $0x100, %eax            # imm = 0x100
jb 0x95f82
orb $0x8, (%r14)
callq 0x587be
movl %eax, -0x3c(%rbp)
cmpl $0x100, %eax            # imm = 0x100
jb 0x95f95
orb $0x8, (%r14)
callq 0x587be
movl %eax, -0x38(%rbp)
cmpl $0x100, %eax            # imm = 0x100
jb 0x95fa8
orb $0x8, (%r14)
callq 0x587be
movl %eax, -0x34(%rbp)
cmpl $0x100, %eax            # imm = 0x100
jb 0x95fbb
orb $0x8, (%r14)
callq 0x587be
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0x95fcd
orb $0x8, (%r14)
callq 0x587be
movl %eax, %r12d
cmpl $0x100, %eax            # imm = 0x100
jb 0x95fe0
orb $0x8, (%r14)
callq 0x587be
movl %eax, %r15d
cmpl $0x100, %eax            # imm = 0x100
jb 0x95ff3
orb $0x8, (%r14)
callq 0x587be
movl %eax, %r14d
cmpl $0x100, %eax            # imm = 0x100
jb 0x9600c
leaq 0x1a8f67(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x96022
leaq 0x1a8f51(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %r13b, %r13d
testl %r13d, %r13d
je 0x9619c
movzbl -0x44(%rbp), %ecx
cvtsi2ss %ecx, %xmm0
movzbl -0x40(%rbp), %ecx
cvtsi2ss %ecx, %xmm1
addss %xmm0, %xmm1
movzbl -0x3c(%rbp), %ecx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
movzbl -0x38(%rbp), %ecx
cvtsi2ss %ecx, %xmm2
movzbl -0x34(%rbp), %ecx
cvtsi2ss %ecx, %xmm3
addss %xmm1, %xmm0
addss %xmm0, %xmm2
addss %xmm2, %xmm3
movzbl %bl, %ecx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
addss %xmm3, %xmm0
movzbl %r12b, %ecx
xorps %xmm1, %xmm1
cvtsi2ss %ecx, %xmm1
movzbl %r15b, %ecx
xorps %xmm2, %xmm2
cvtsi2ss %ecx, %xmm2
movzbl %r14b, %ecx
xorps %xmm3, %xmm3
cvtsi2ss %ecx, %xmm3
addss %xmm0, %xmm1
addss %xmm1, %xmm2
addss %xmm2, %xmm3
movzbl %al, %eax
xorps %xmm2, %xmm2
cvtsi2ss %eax, %xmm2
addss %xmm3, %xmm2
movzbl -0x48(%rbp), %eax
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
movzbl -0x2c(%rbp), %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x76f7f(%rip), %xmm2    # 0x10d050
movss %xmm2, -0x2c(%rbp)
movss 0x76f9a(%rip), %xmm2    # 0x10d078
mulss %xmm2, %xmm1
mulss 0x76f72(%rip), %xmm0    # 0x10d05c
mulss %xmm2, %xmm0
movl %r13d, %edi
callq 0x5ace1
movl %r13d, %eax
imulq $0x348, %rax, %rbx      # imm = 0x348
leaq 0x1a8ea9(%rip), %r15    # 0x23efb0
movss -0x2c(%rbp), %xmm0
movss %xmm0, 0x20(%r15,%rbx)
movl $0x18, 0x1c(%r15,%rbx)
leaq 0x277171(%rip), %rax    # 0x30d294
movl $0x4, (%rax)
movzwl -0x2e(%rbp), %r14d
movl %r14d, %eax
andl $0x1, %eax
cmpl $0x1, %eax
movl $0x0, %eax
sbbl %eax, %eax
orl %r13d, %eax
movl %eax, 0x218(%r15,%rbx)
movl %r13d, %edi
callq 0xdc1dd
leaq 0x2771f4(%rip), %rcx    # 0x30d34c
orl %eax, (%rcx)
movl %r14d, 0x18(%r15,%rbx)
leaq 0x2771d6(%rip), %rax    # 0x30d33c
cmpl $0x0, (%rax)
jne 0x96178
leaq 0x1826d2(%rip), %rcx    # 0x218844
movl $0x7e6, (%rcx)          # imm = 0x7E6
movl $0x4, (%rax)
movl %r13d, %edi
callq 0x5cdab
leaq 0x1a8d7f(%rip), %rax    # 0x23ef0c
incl (%rax)
leaq 0x277182(%rip), %rax    # 0x30d318
movl $0x15, (%rax)
movl -0x4c(%rbp), %eax
decl %eax
leaq 0x1a8dc8(%rip), %r14    # 0x23ef70
jne 0x95f17
leaq 0x1a8d57(%rip), %rax    # 0x23ef0c
movl (%rax), %edi
jmp 0x961bb
xorl %edi, %edi
callq 0x5e390
leaq 0x277165(%rip), %rax    # 0x30d32c
cmpl $0x0, (%rax)
jne 0x961d9
leaq 0x182671(%rip), %rcx    # 0x218844
movl $0x7e7, (%rcx)          # imm = 0x7E7
movl $0x3, (%rax)
leaq 0x277142(%rip), %rax    # 0x30d328
cmpl $0x0, (%rax)
jne 0x961f8
leaq 0x182652(%rip), %rcx    # 0x218844
movl $0x7e8, (%rcx)          # imm = 0x7E8
movl $0x3, (%rax)
leaq 0x8bad5(%rip), %rax     # 0x121cda
leaq 0x1a8cec(%rip), %rcx    # 0x23eef8
movq %rax, (%rcx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq