// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: get_sat_tracking(int)
void get_sat_tracking(int msg_fmt)
{
int prn;
float az, el;
float sig_level;

   log_packet_id("Packet 0x5C (Sat tracking)");
// also packet 5d

   have_sat_azel = 1;
   prn = tsip_byte();
   if(prn > MAX_PRN) prn = 0; // !!!! max_sat_check -  put any bogus data in unused entry in array
   else if(prn < 1) prn = 0;  // !!!! max_sat_check -  put any bogus data in unused entry in array

   sat[prn].chan = tsip_byte();
   sat[prn].chan >>= 3;
   sat[prn].acq_flag = tsip_byte();
   sat[prn].eph_flag = tsip_byte();
   if(1 || (log_db == 0)) {
      sig_level = tsip_single();
      sat[prn].sig_level = sig_level;
      have_snr |= rinex_gnss(prn);
      sat[prn].level_msg = 0x5C;
      if(SV6_FAMILY) {
         if(amu_mode == 0) {
            sat[prn].sig_level = amu_to_dbc(sat[prn].sig_level);
         }
      }
   }
   else tsip_single();

   sat[prn].time_of_week = tsip_single();

   el = tsip_single() * (float) RAD_TO_DEG;
   az = tsip_single() * (float) RAD_TO_DEG;
   set_sat_azel(prn, az,el);

//sprintf(plot_title, "trk msg %02X prn:%02d  az:%p el:%p", msg_fmt, prn, sat[prn].azimuth,sat[prn].elevation);
   sat[prn].age = tsip_byte();
   sat[prn].msec = tsip_byte();
   sat[prn].bad_flag = tsip_byte();
   sat[prn].collecting = tsip_byte();
   if(msg_fmt == 0x5D) {  // RES 360 message 0x5D
      sat[prn].how_used = tsip_byte();
      // sv_type for icm receivers:
      //   0=GPS
      //   1=Glonass
      //   2=Beidou?
      //   3=Galileo?
      //   4=SBAS
      //   5=QZSS
      sat[prn].sv_type = tsip_byte();
   }

   check_tsip_end(1);
   if(tsip_error) {
      sat[prn].level_msg = 0x00;
      return;
   }

   record_sig_levels(prn);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %r14d
leaq 0xad8a5(%rip), %rdi     # 0x121d9e
callq 0x58dc2
leaq 0x298d8f(%rip), %rax    # 0x30d294
movl $0x1, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x74521
leaq 0x1caa52(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %ebx
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x7453a
leaq 0x1caa39(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movl %ebx, %ecx
imulq $0x348, %rcx, %rcx      # imm = 0x348
leaq 0x1caa66(%rip), %rdx    # 0x23efb0
leaq (%rdx,%rcx), %r15
shrb $0x3, %al
movb %al, 0x200(%rdx,%rcx)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x7456e
leaq 0x1caa05(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movb %al, 0x201(%r15)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x7458b
leaq 0x1ca9e8(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movb %al, 0x202(%r15)
callq 0x58a30
movss %xmm0, 0x20(%r15)
movl %ebx, %edi
callq 0xdc1dd
leaq 0x298da1(%rip), %rcx    # 0x30d34c
orl %eax, (%rcx)
movl $0x5c, 0x1c(%r15)
leaq 0x1a4314(%rip), %rax    # 0x2188d0
cmpq $0x1, (%rax)
jne 0x74608
leaq 0x1a6a0b(%rip), %rax    # 0x21afd4
movl (%rax), %eax
cmpl $0x36, %eax
setne %cl
cmpl $0x33, %eax
setne %dl
andb %cl, %dl
cmpl $0x50, %eax
setne %cl
andb %dl, %cl
cmpl $0x41, %eax
setne %al
testb %cl, %al
jne 0x74608
leaq 0x1ca8fe(%rip), %rax    # 0x23eef0
cmpb $0x0, (%rax)
jne 0x74608
movss 0x20(%r15), %xmm0
callq 0xf7984
movss %xmm0, 0x20(%r15)
callq 0x58a30
movss %xmm0, 0x204(%r15)
callq 0x58a30
mulss 0x98a65(%rip), %xmm0    # 0x10d088
movss %xmm0, -0x1c(%rbp)
callq 0x58a30
mulss 0x98a53(%rip), %xmm0    # 0x10d088
movl %ebx, %edi
movss -0x1c(%rbp), %xmm1
callq 0x5ace1
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x74657
leaq 0x1ca91c(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movb %al, 0x212(%r15)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x74674
leaq 0x1ca8ff(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movb %al, 0x213(%r15)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x74691
leaq 0x1ca8e2(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movb %al, 0x214(%r15)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x746ae
leaq 0x1ca8c5(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movb %al, 0x215(%r15)
cmpl $0x5d, %r14d
jne 0x746f5
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x746d1
leaq 0x1ca8a2(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movb %al, 0x216(%r15)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x746ee
leaq 0x1ca885(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movb %al, 0x217(%r15)
xorl %edi, %edi
callq 0x58e9b
leaq 0x1ca86d(%rip), %rax    # 0x23ef70
cmpl $0x0, (%rax)
je 0x7471b
movl $0x0, 0x1c(%r15)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %ebx, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5cdab