// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_gpsd_sky(char*)
void parse_gpsd_sky(char *s)
{
int saw_sats;
int prn;
float az, el;

   // decode the SKY message - used to display satellite position and signal
   // level data

   have_dops = 0;
   prn = 0;
   saw_sats = 0;
   level_type = "SNR";

   az = el = (999.0F);
   while(s) {
      s = get_json_field(s);
      strcpy(gpsd_cmd, msg_field);
      if(gpsd_cmd[0] == 0) continue; 

      s = get_json_field(s);
log_gpsd_cmd();

      if(!strcmp(gpsd_cmd, "\"GDOP\"")) {
         gdop = (float) atof(msg_field);
         have_dops |= GDOP;
      }
      else if(!strcmp(gpsd_cmd, "\"HDOP\"")) {
         hdop = (float) atof(msg_field);
         have_dops |= HDOP;
      }
      else if(!strcmp(gpsd_cmd, "\"PDOP\"")) {
         pdop = (float) atof(msg_field);
         have_dops |= PDOP;
      }
      else if(!strcmp(gpsd_cmd, "\"TDOP\"")) {
         tdop = (float) atof(msg_field);
         have_dops |= TDOP;
      }
      else if(!strcmp(gpsd_cmd, "\"VDOP\"")) {
         vdop = (float) atof(msg_field);
         have_dops |= VDOP;
      }
      else if(!strcmp(gpsd_cmd, "\"XDOP\"")) {
         xdop = (float) atof(msg_field);
         have_dops |= XDOP;
      }
      else if(!strcmp(gpsd_cmd, "\"YDOP\"")) {
         ydop = (float) atof(msg_field);
         have_dops |= YDOP;
      }
      else if(!strcmp(gpsd_cmd, "\"SATELLITES\"")) {
         saw_sats = 0;
         reset_sat_tracking();
      }
      else if(!strcmp(gpsd_cmd, "\"PRN\"")) {
         prn = atoi(msg_field);
         if(prn <= 0) prn = 0;
         else if(prn > MAX_PRN) prn = 0; 
         else ++saw_sats;
      }
      else if(!strcmp(gpsd_cmd, "\"EL\"")) {   
         el = (float) atof(msg_field);
         have_sat_azel = 21;
      }
      else if(!strcmp(gpsd_cmd, "\"AZ\"")) {
         az = (float) atoi(msg_field);
         have_sat_azel = 20;
      }
      else if(!strcmp(gpsd_cmd, "\"SS\"")) {
         sat[prn].sig_level = (float) atof(msg_field);
         sat[prn].level_msg = 55;
         have_snr |= rinex_gnss(prn);
         record_sig_levels(prn);
      }
      else if(!strcmp(gpsd_cmd, "\"USED\"")) {
         if(!strcmp(msg_field, "TRUE")) sat[prn].tracking = 1;
         else                            sat[prn].tracking = (-1);
      }

   }

   if((az < 999.0F) && (el < 999.0F)) {
      set_sat_azel(prn, (float) az, (float) el);
   }

   sat_count = saw_sats;
   have_count = 7;
if(debug_file) fprintf(debug_file, "sat count:%d\n", sat_count);
   config_sat_count(saw_sats);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x1a01f1(%rip), %rax    # 0x2826c4
movl $0x0, (%rax)
movl $0x0, -0x10(%rbp)
movl $0x0, -0xc(%rbp)
leaq 0x1bbbea(%rip), %rax    # 0x29e0d8
leaq 0xa0521(%rip), %rcx     # 0x182a16
movq %rcx, (%rax)
movss 0x8f434(%rip), %xmm0    # 0x171934
movss %xmm0, -0x18(%rbp)
movss 0x8f427(%rip), %xmm0    # 0x171934
movss %xmm0, -0x14(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0xe29ac
movq -0x8(%rbp), %rdi
callq 0xe1c20
movq %rax, -0x8(%rbp)
leaq 0x2eecdf(%rip), %rdi    # 0x3d1210
leaq 0x2b86e8(%rip), %rsi    # 0x39ac20
callq 0x9350
movsbl 0x2eeccc(%rip), %eax    # 0x3d1210
cmpl $0x0, %eax
jne 0xe254b
jmp 0xe2512
movq -0x8(%rbp), %rdi
callq 0xe1c20
movq %rax, -0x8(%rbp)
callq 0xe1e70
leaq 0x2eecac(%rip), %rdi    # 0x3d1210
leaq 0xa6b92(%rip), %rsi     # 0x1890fd
callq 0x9510
cmpl $0x0, %eax
jne 0xe25ae
leaq 0x2b86a4(%rip), %rdi    # 0x39ac20
callq 0x9480
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x1a0150(%rip), %rax    # 0x2826e0
movsd %xmm0, (%rax)
leaq 0x1a0129(%rip), %rax    # 0x2826c4
movl (%rax), %ecx
orl $0x8, %ecx
leaq 0x1a011d(%rip), %rax    # 0x2826c4
movl %ecx, (%rax)
jmp 0xe29a7
leaq 0x2eec5b(%rip), %rdi    # 0x3d1210
leaq 0xa6b48(%rip), %rsi     # 0x189104
callq 0x9510
cmpl $0x0, %eax
jne 0xe25ff
leaq 0x2b8653(%rip), %rdi    # 0x39ac20
callq 0x9480
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x1a00ef(%rip), %rax    # 0x2826d0
movsd %xmm0, (%rax)
leaq 0x1a00d8(%rip), %rax    # 0x2826c4
movl (%rax), %ecx
orl $0x2, %ecx
leaq 0x1a00cc(%rip), %rax    # 0x2826c4
movl %ecx, (%rax)
jmp 0xe29a5
leaq 0x2eec0a(%rip), %rdi    # 0x3d1210
leaq 0xa6afe(%rip), %rsi     # 0x18910b
callq 0x9510
cmpl $0x0, %eax
jne 0xe2650
leaq 0x2b8602(%rip), %rdi    # 0x39ac20
callq 0x9480
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x1a0096(%rip), %rax    # 0x2826c8
movsd %xmm0, (%rax)
leaq 0x1a0087(%rip), %rax    # 0x2826c4
movl (%rax), %ecx
orl $0x1, %ecx
leaq 0x1a007b(%rip), %rax    # 0x2826c4
movl %ecx, (%rax)
jmp 0xe29a3
leaq 0x2eebb9(%rip), %rdi    # 0x3d1210
leaq 0xa6ab4(%rip), %rsi     # 0x189112
callq 0x9510
cmpl $0x0, %eax
jne 0xe26a1
leaq 0x2b85b1(%rip), %rdi    # 0x39ac20
callq 0x9480
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x1a0065(%rip), %rax    # 0x2826e8
movsd %xmm0, (%rax)
leaq 0x1a0036(%rip), %rax    # 0x2826c4
movl (%rax), %ecx
orl $0x10, %ecx
leaq 0x1a002a(%rip), %rax    # 0x2826c4
movl %ecx, (%rax)
jmp 0xe29a1
leaq 0x2eeb68(%rip), %rdi    # 0x3d1210
leaq 0xa6a6a(%rip), %rsi     # 0x189119
callq 0x9510
cmpl $0x0, %eax
jne 0xe26f2
leaq 0x2b8560(%rip), %rdi    # 0x39ac20
callq 0x9480
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x1a0004(%rip), %rax    # 0x2826d8
movsd %xmm0, (%rax)
leaq 0x19ffe5(%rip), %rax    # 0x2826c4
movl (%rax), %ecx
orl $0x4, %ecx
leaq 0x19ffd9(%rip), %rax    # 0x2826c4
movl %ecx, (%rax)
jmp 0xe299f
leaq 0x2eeb17(%rip), %rdi    # 0x3d1210
leaq 0xa6a20(%rip), %rsi     # 0x189120
callq 0x9510
cmpl $0x0, %eax
jne 0xe2746
leaq 0x2b850f(%rip), %rdi    # 0x39ac20
callq 0x9480
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x19ffdb(%rip), %rax    # 0x282700
movsd %xmm0, (%rax)
leaq 0x19ff94(%rip), %rax    # 0x2826c4
movl (%rax), %ecx
orl $0x80, %ecx
leaq 0x19ff85(%rip), %rax    # 0x2826c4
movl %ecx, (%rax)
jmp 0xe299d
leaq 0x2eeac3(%rip), %rdi    # 0x3d1210
leaq 0xa69d3(%rip), %rsi     # 0x189127
callq 0x9510
cmpl $0x0, %eax
jne 0xe279a
leaq 0x2b84bb(%rip), %rdi    # 0x39ac20
callq 0x9480
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x19ff8f(%rip), %rax    # 0x282708
movsd %xmm0, (%rax)
leaq 0x19ff40(%rip), %rax    # 0x2826c4
movl (%rax), %ecx
orl $0x100, %ecx            # imm = 0x100
leaq 0x19ff31(%rip), %rax    # 0x2826c4
movl %ecx, (%rax)
jmp 0xe299b
leaq 0x2eea6f(%rip), %rdi    # 0x3d1210
leaq 0xa6986(%rip), %rsi     # 0x18912e
callq 0x9510
cmpl $0x0, %eax
jne 0xe27c3
movl $0x0, -0xc(%rbp)
callq 0x81c10
jmp 0xe2999
leaq 0x2eea46(%rip), %rdi    # 0x3d1210
leaq 0xa696a(%rip), %rsi     # 0x18913b
callq 0x9510
cmpl $0x0, %eax
jne 0xe281b
leaq 0x2b843e(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
jg 0xe27f9
movl $0x0, -0x10(%rbp)
jmp 0xe2816
cmpl $0x3e7, -0x10(%rbp)     # imm = 0x3E7
jle 0xe280b
movl $0x0, -0x10(%rbp)
jmp 0xe2814
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xe2816
jmp 0xe2997
leaq 0x2ee9ee(%rip), %rdi    # 0x3d1210
leaq 0xa6918(%rip), %rsi     # 0x189141
callq 0x9510
cmpl $0x0, %eax
jne 0xe285a
leaq 0x2b83e6(%rip), %rdi    # 0x39ac20
callq 0x9480
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x18(%rbp)
leaq 0x289c25(%rip), %rax    # 0x36c474
movl $0x15, (%rax)
jmp 0xe2995
leaq 0x2ee9af(%rip), %rdi    # 0x3d1210
leaq 0xa68de(%rip), %rsi     # 0x189146
callq 0x9510
cmpl $0x0, %eax
jne 0xe2899
leaq 0x2b83a7(%rip), %rdi    # 0x39ac20
callq 0x95c0
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x14(%rbp)
leaq 0x289be6(%rip), %rax    # 0x36c474
movl $0x14, (%rax)
jmp 0xe2993
leaq 0x2ee970(%rip), %rdi    # 0x3d1210
leaq 0xa68a4(%rip), %rsi     # 0x18914b
callq 0x9510
cmpl $0x0, %eax
jne 0xe291d
leaq 0x2b8368(%rip), %rdi    # 0x39ac20
callq 0x9480
cvtsd2ss %xmm0, %xmm0
movslq -0x10(%rbp), %rcx
leaq 0x1bb8c4(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movss %xmm0, 0x20(%rax)
movslq -0x10(%rbp), %rcx
leaq 0x1bb8aa(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movl $0x37, 0x1c(%rax)
movl -0x10(%rbp), %edi
callq 0x12d280
movl %eax, %ecx
leaq 0x289c24(%rip), %rax    # 0x36c52c
orl (%rax), %ecx
leaq 0x289c1b(%rip), %rax    # 0x36c52c
movl %ecx, (%rax)
movl -0x10(%rbp), %edi
callq 0x80340
jmp 0xe2991
leaq 0x2ee8ec(%rip), %rdi    # 0x3d1210
leaq 0xa6825(%rip), %rsi     # 0x189150
callq 0x9510
cmpl $0x0, %eax
jne 0xe298f
leaq 0x2b82e4(%rip), %rdi    # 0x39ac20
leaq 0xa6814(%rip), %rsi     # 0x189157
callq 0x9510
cmpl $0x0, %eax
jne 0xe296e
movslq -0x10(%rbp), %rcx
leaq 0x1bb838(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movl $0x1, 0x218(%rax)
jmp 0xe298d
movslq -0x10(%rbp), %rcx
leaq 0x1bb817(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movl $0xffffffff, 0x218(%rax) # imm = 0xFFFFFFFF
jmp 0xe298f
jmp 0xe2991
jmp 0xe2993
jmp 0xe2995
jmp 0xe2997
jmp 0xe2999
jmp 0xe299b
jmp 0xe299d
jmp 0xe299f
jmp 0xe29a1
jmp 0xe29a3
jmp 0xe29a5
jmp 0xe29a7
jmp 0xe2512
movss 0x8ef80(%rip), %xmm0    # 0x171934
ucomiss -0x14(%rbp), %xmm0
jbe 0xe29da
movss 0x8ef72(%rip), %xmm0    # 0x171934
ucomiss -0x18(%rbp), %xmm0
jbe 0xe29da
movl -0x10(%rbp), %edi
movss -0x14(%rbp), %xmm0
movss -0x18(%rbp), %xmm1
callq 0x7d450
movl -0xc(%rbp), %ecx
leaq 0x1bb708(%rip), %rax    # 0x29e0ec
movl %ecx, (%rax)
leaq 0x289b0b(%rip), %rax    # 0x36c4f8
movl $0x7, (%rax)
leaq 0x1bab76(%rip), %rax    # 0x29d570
cmpq $0x0, (%rax)
je 0xe2a21
leaq 0x1bab69(%rip), %rax    # 0x29d570
movq (%rax), %rdi
leaq 0x1bb6db(%rip), %rax    # 0x29e0ec
movl (%rax), %edx
leaq 0xa6742(%rip), %rsi     # 0x18915c
movb $0x0, %al
callq 0x9550
movl -0xc(%rbp), %edi
callq 0x82080
addq $0x20, %rsp
popq %rbp
retq
nop