// File: jkingan[P]ladyheather/heathgps.cpp
// Function: rt17_concise(int)
void rt17_concise(int rif)
{
int prn;
int flags1, flags2;
int az, el;
double snr;
double l2_snr;
double prange;
double phase;
double doppler;
int lli;

   // parse concise format realtime observation info

   prn = tsip_byte();
   flags1 = tsip_byte();
   flags2 = tsip_byte();
   el = (int) (s08) tsip_byte();
   az = (int) (s16) tsip_word();

   snr = 0.0;
   prange = 0.0;
   phase = 0.0;
   doppler = 0.0;
   lli = 0;

   if(flags1 & 0x40) {  // L1 data
      snr = (double) (u08) tsip_byte();      // snr
      snr /= 4.0;
      prange = tsip_double();   // pseudorange
      phase = tsip_double();    // phase
      doppler = (double) tsip_single();  // doppler

      if((prn >= 1) && (prn <= 32)) {
         sat[prn].level_msg = 1;
         sat[prn].sig_level = (float) snr;
         have_snr |= rinex_gnss(prn);
         record_sig_levels(prn);

         phase = 0.0-phase;
         sat[prn].code_phase = phase;
         if(phase) {
            have_phase |= rinex_gnss(prn);
         }

         sat[prn].range = prange;
         if(prange) {
            have_range |= rinex_gnss(prn);
         }

         sat[prn].doppler = doppler;
         if(doppler) {
            have_doppler |= rinex_gnss(prn);
         }

         lli = 0;
         if(prange && (flags1 & 0x02)) lli |= CYCLE_SLIP;
         sat[prn].ca_lli = lli;
      }
sprintf(out, " -prn:%02d l1: snr:%f  phase:%f  range:%f  doppler:%f  flags1:%02X  flags2:%02X  lli:%02X", prn, snr, phase, prange, doppler, flags1,flags2, lli);
if(debug_file) fprintf(debug_file, "%s\n", out);
   }

   l2_snr = 0.0;
   prange = 0.0;
   phase = 0.0;
   doppler = 0.0;

   if(flags1 & 0x01) {  // L2 data
      l2_snr = (double) (u08) tsip_byte();      // snr
      l2_snr /= 4.0;
      phase = tsip_double();    // phase
      prange = (double) tsip_single();   // pseudorange

      if((prn >= 1) && (prn <= 32)) {
         sat[prn].l2_sig_level = (float) l2_snr;
         sat[prn].l2_level_msg = 17;
         have_l2_snr |= rinex_gnss(prn);

         if(flags1 & 0x10) phase = 0.0-phase;
         else phase = 0.0;

         if(flags1 & 0x20) prange = sat[prn].range + prange;
         else {
            prange = 0.0;
            phase = 0.0-sqrt(fabs(phase));
         }

         sat[prn].l2_code_phase = phase;
         if(phase) {
            have_l2_phase |= rinex_gnss(prn);
         }

         sat[prn].l2_range = prange;
         if(prange) {
            have_l2_range |= rinex_gnss(prn);
         }

         lli = 0;
         if(prange && (flags1 & 0x04)) lli |= CYCLE_SLIP;
         if(prange && (flags2 & 0x04)) lli |= P_TRACK;  // tracking encrypted code
         sat[prn].l2_lli = lli;
      }
sprintf(out, " -prn:%02d l2: snr:%f  phase:%f  range:%f  doppler:%f  flags1:%02X  flags2:%02X  lli:%02X", prn, l2_snr, phase, prange, doppler, flags1,flags2, lli);
if(debug_file) fprintf(debug_file, "%s\n", out);
   }

   if(rif & 0x02) {  // expanded format
      tsip_byte();    // iode
      tsip_byte();    // L1 slip counter
      tsip_byte();    // L2 slip counter
   }

   if((prn >= 1) && (prn <= 32)) {
      set_sat_azel(prn, (float) az, (float) el);
      if(snr > 0) sat[prn].tracking = prn;
      else        sat[prn].tracking = (-1);
      have_sat_azel = 17;
   }

   return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %edi, -0x4(%rbp)
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x8(%rbp)
callq 0x7a510
movzbl %al, %eax
movl %eax, -0xc(%rbp)
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x10(%rbp)
callq 0x7a510
movsbl %al, %eax
movl %eax, -0x18(%rbp)
callq 0x7a560
cwtl
movl %eax, -0x14(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x20(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movl -0xc(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0xaf317
callq 0x7a510
movzbl %al, %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
movsd 0xc25fc(%rip), %xmm1    # 0x1716d0
divsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
callq 0x7a9d0
movsd %xmm0, -0x30(%rbp)
callq 0x7a9d0
movsd %xmm0, -0x38(%rbp)
callq 0x7a860
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x40(%rbp)
cmpl $0x1, -0x8(%rbp)
jl 0xaf2b2
cmpl $0x20, -0x8(%rbp)
jg 0xaf2b2
movslq -0x8(%rbp), %rcx
leaq 0x1ef072(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movl $0x1, 0x1c(%rax)
movsd -0x20(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
movslq -0x8(%rbp), %rcx
leaq 0x1ef04d(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movss %xmm0, 0x20(%rax)
movl -0x8(%rbp), %edi
callq 0x12d280
movl %eax, %ecx
leaq 0x2bd3c9(%rip), %rax    # 0x36c52c
orl (%rax), %ecx
leaq 0x2bd3c0(%rip), %rax    # 0x36c52c
movl %ecx, (%rax)
movl -0x8(%rbp), %edi
callq 0x80340
xorps %xmm0, %xmm0
subsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x38(%rbp), %xmm0
movslq -0x8(%rbp), %rcx
leaq 0x1eeffd(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movsd %xmm0, 0x28(%rax)
movsd -0x38(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xaf1b4
jp 0xaf1b4
jmp 0xaf1d0
movl -0x8(%rbp), %edi
callq 0x12d280
movl %eax, %ecx
leaq 0x2bd35f(%rip), %rax    # 0x36c524
orl (%rax), %ecx
leaq 0x2bd356(%rip), %rax    # 0x36c524
movl %ecx, (%rax)
movsd -0x30(%rbp), %xmm0
movslq -0x8(%rbp), %rcx
leaq 0x1eefb0(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movsd %xmm0, 0x38(%rax)
movsd -0x30(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xaf201
jp 0xaf201
jmp 0xaf21d
movl -0x8(%rbp), %edi
callq 0x12d280
movl %eax, %ecx
leaq 0x2bd316(%rip), %rax    # 0x36c528
orl (%rax), %ecx
leaq 0x2bd30d(%rip), %rax    # 0x36c528
movl %ecx, (%rax)
movsd -0x40(%rbp), %xmm0
movslq -0x8(%rbp), %rcx
leaq 0x1eef63(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movsd %xmm0, 0x30(%rax)
movsd -0x40(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xaf24e
jp 0xaf24e
jmp 0xaf26a
movl -0x8(%rbp), %edi
callq 0x12d280
movl %eax, %ecx
leaq 0x2bd2c1(%rip), %rax    # 0x36c520
orl (%rax), %ecx
leaq 0x2bd2b8(%rip), %rax    # 0x36c520
movl %ecx, (%rax)
movl $0x0, -0x44(%rbp)
movsd -0x30(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xaf283
jp 0xaf283
jmp 0xaf297
movl -0xc(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0xaf297
movl -0x44(%rbp), %eax
orl $0x40, %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %ecx
movslq -0x8(%rbp), %rdx
leaq 0x1eeeeb(%rip), %rax    # 0x29e190
imulq $0x348, %rdx, %rdx      # imm = 0x348
addq %rdx, %rax
movl %ecx, 0x68(%rax)
movl -0x8(%rbp), %edx
movsd -0x20(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
movsd -0x30(%rbp), %xmm2
movsd -0x40(%rbp), %xmm3
movl -0xc(%rbp), %ecx
movl -0x10(%rbp), %r8d
movl -0x44(%rbp), %r9d
leaq 0x2ec125(%rip), %rdi    # 0x39b400
leaq 0xd6b45(%rip), %rsi     # 0x185e27
movb $0x4, %al
callq 0x9060
leaq 0x1ee280(%rip), %rax    # 0x29d570
cmpq $0x0, (%rax)
je 0xaf315
leaq 0x1ee273(%rip), %rax    # 0x29d570
movq (%rax), %rdi
leaq 0xd9af8(%rip), %rsi     # 0x188dff
leaq 0x2ec0f2(%rip), %rdx    # 0x39b400
movb $0x0, %al
callq 0x9550
jmp 0xaf317
xorps %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x40(%rbp)
movl -0xc(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xaf5ef
callq 0x7a510
movzbl %al, %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
movsd 0xc236c(%rip), %xmm1    # 0x1716d0
divsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
callq 0x7a9d0
movsd %xmm0, -0x38(%rbp)
callq 0x7a860
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
cmpl $0x1, -0x8(%rbp)
jl 0xaf58a
cmpl $0x20, -0x8(%rbp)
jg 0xaf58a
movsd -0x28(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
movslq -0x8(%rbp), %rcx
leaq 0x1eede3(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movss %xmm0, 0xb0(%rax)
movslq -0x8(%rbp), %rcx
leaq 0x1eedc6(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movl $0x11, 0xac(%rax)
movl -0x8(%rbp), %edi
callq 0x12d280
movl %eax, %ecx
leaq 0x2bd15d(%rip), %rax    # 0x36c54c
orl (%rax), %ecx
leaq 0x2bd154(%rip), %rax    # 0x36c54c
movl %ecx, (%rax)
movl -0xc(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0xaf414
xorps %xmm0, %xmm0
subsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
jmp 0xaf41c
xorps %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
movl -0xc(%rbp), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0xaf44d
movslq -0x8(%rbp), %rcx
leaq 0x1eed5e(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movsd 0x38(%rax), %xmm0
addsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
jmp 0xaf479
xorps %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x38(%rbp), %xmm0
movaps 0xbfe2f(%rip), %xmm1    # 0x16f290
pand %xmm1, %xmm0
callq 0x9280
movaps %xmm0, %xmm1
xorps %xmm0, %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x38(%rbp), %xmm0
movslq -0x8(%rbp), %rcx
leaq 0x1eed07(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movsd %xmm0, 0xb8(%rax)
movsd -0x38(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xaf4ad
jp 0xaf4ad
jmp 0xaf4c9
movl -0x8(%rbp), %edi
callq 0x12d280
movl %eax, %ecx
leaq 0x2bd086(%rip), %rax    # 0x36c544
orl (%rax), %ecx
leaq 0x2bd07d(%rip), %rax    # 0x36c544
movl %ecx, (%rax)
movsd -0x30(%rbp), %xmm0
movslq -0x8(%rbp), %rcx
leaq 0x1eecb7(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movsd %xmm0, 0xc8(%rax)
movsd -0x30(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xaf4fd
jp 0xaf4fd
jmp 0xaf519
movl -0x8(%rbp), %edi
callq 0x12d280
movl %eax, %ecx
leaq 0x2bd03a(%rip), %rax    # 0x36c548
orl (%rax), %ecx
leaq 0x2bd031(%rip), %rax    # 0x36c548
movl %ecx, (%rax)
movl $0x0, -0x44(%rbp)
movsd -0x30(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xaf532
jp 0xaf532
jmp 0xaf546
movl -0xc(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0xaf546
movl -0x44(%rbp), %eax
orl $0x40, %eax
movl %eax, -0x44(%rbp)
movsd -0x30(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xaf558
jp 0xaf558
jmp 0xaf56c
movl -0x10(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0xaf56c
movl -0x44(%rbp), %eax
orl $0x10, %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %ecx
movslq -0x8(%rbp), %rdx
leaq 0x1eec16(%rip), %rax    # 0x29e190
imulq $0x348, %rdx, %rdx      # imm = 0x348
addq %rdx, %rax
movl %ecx, 0xe8(%rax)
movl -0x8(%rbp), %edx
movsd -0x28(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
movsd -0x30(%rbp), %xmm2
movsd -0x40(%rbp), %xmm3
movl -0xc(%rbp), %ecx
movl -0x10(%rbp), %r8d
movl -0x44(%rbp), %r9d
leaq 0x2ebe4d(%rip), %rdi    # 0x39b400
leaq 0xd68c7(%rip), %rsi     # 0x185e81
movb $0x4, %al
callq 0x9060
leaq 0x1edfa8(%rip), %rax    # 0x29d570
cmpq $0x0, (%rax)
je 0xaf5ed
leaq 0x1edf9b(%rip), %rax    # 0x29d570
movq (%rax), %rdi
leaq 0xd9820(%rip), %rsi     # 0x188dff
leaq 0x2ebe1a(%rip), %rdx    # 0x39b400
movb $0x0, %al
callq 0x9550
jmp 0xaf5ef
movl -0x4(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0xaf609
callq 0x7a510
callq 0x7a510
callq 0x7a510
cmpl $0x1, -0x8(%rbp)
jl 0xaf681
cmpl $0x20, -0x8(%rbp)
jg 0xaf681
movl -0x8(%rbp), %edi
cvtsi2ssl -0x14(%rbp), %xmm0
cvtsi2ssl -0x18(%rbp), %xmm1
callq 0x7d450
movsd -0x20(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0xaf655
movl -0x8(%rbp), %ecx
movslq -0x8(%rbp), %rdx
leaq 0x1eeb4d(%rip), %rax    # 0x29e190
imulq $0x348, %rdx, %rdx      # imm = 0x348
addq %rdx, %rax
movl %ecx, 0x218(%rax)
jmp 0xaf674
movslq -0x8(%rbp), %rcx
leaq 0x1eeb30(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movl $0xffffffff, 0x218(%rax) # imm = 0xFFFFFFFF
leaq 0x2bcdf9(%rip), %rax    # 0x36c474
movl $0x11, (%rax)
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)