// File: jkingan[P]ladyheather/heathgps.cpp
// Function: decode_gpsd_msg()
void decode_gpsd_msg()
{
char *s;

   // this routine looks at the GPSD message header and dispatches a call to
   // decode the data in the message and act on it.
   start_msg_decode(1); // gggggg
   
   s = strstr((char *) tsip_buf, "\"class\":");
   if(s == 0) return;

   s = get_json_field(s);     // get the class keyword
   if(json_delim != ':') return;  // no class
   s = get_json_field(s);     // get the message type

   strupr(msg_field);
if(debug_file) fprintf(debug_file, "\n\nMessage: %s (%c)\n\n", msg_field, json_delim);
   if     (!strcmp(msg_field, "\"TPV\""))     parse_gpsd_tpv(s);
   else if(!strcmp(msg_field, "\"SKY\""))     parse_gpsd_sky(s);
   else if(!strcmp(msg_field, "\"PPS\""))     parse_gpsd_pps(s, 0x01);
   else if(!strcmp(msg_field, "\"TOFF\""))    parse_gpsd_pps(s, 0x02);
   else if(!strcmp(msg_field, "\"OSC\""))     parse_gpsd_osc(s);
   else if(!strcmp(msg_field, "\"ATT\""))     parse_gpsd_att(s);
   else if(!strcmp(msg_field, "\"RTCM2\""))   parse_gpsd_rtcm2(s);
   else if(!strcmp(msg_field, "\"VERSION\"")) parse_gpsd_version(s);
   else if(!strcmp(msg_field, "\"DEVICES\"")) parse_gpsd_devices(s);
   else if(!strcmp(msg_field, "\"DEVICE\""))  parse_gpsd_devices(s);
   else if(!strcmp(msg_field, "\"WATCH\""))   parse_gpsd_watch(s);
   else                                       show_gpsd_msg(s);

   if(sim_file && sim_delay) {  // throttle sim file messages
      Sleep(sim_delay);
   }
   saw_rcvr_msg = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x1, %edi
callq 0xae4a0
leaq 0x2b2f47(%rip), %rdi    # 0x396430
leaq 0xa5d50(%rip), %rsi     # 0x189240
callq 0x9090
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0xe3505
jmp 0xe3764
movq -0x8(%rbp), %rdi
callq 0xe1c20
movq %rax, -0x8(%rbp)
movsbl 0x2edcef(%rip), %eax    # 0x3d1208
cmpl $0x3a, %eax
je 0xe3523
jmp 0xe3764
movq -0x8(%rbp), %rdi
callq 0xe1c20
movq %rax, -0x8(%rbp)
leaq 0x2b76e9(%rip), %rdi    # 0x39ac20
callq 0x9890
leaq 0x1ba02d(%rip), %rax    # 0x29d570
cmpq $0x0, (%rax)
je 0xe356f
leaq 0x1ba020(%rip), %rax    # 0x29d570
movq (%rax), %rdi
movsbl 0x2edcae(%rip), %ecx    # 0x3d1208
leaq 0xa5ce8(%rip), %rsi     # 0x189249
leaq 0x2b76b8(%rip), %rdx    # 0x39ac20
movb $0x0, %al
callq 0x9550
leaq 0x2b76aa(%rip), %rdi    # 0x39ac20
leaq 0xa5ce1(%rip), %rsi     # 0x18925e
callq 0x9510
cmpl $0x0, %eax
jne 0xe3595
movq -0x8(%rbp), %rdi
callq 0xe1f40
jmp 0xe372c
leaq 0x2b7684(%rip), %rdi    # 0x39ac20
leaq 0xa5cc1(%rip), %rsi     # 0x189264
callq 0x9510
cmpl $0x0, %eax
jne 0xe35bb
movq -0x8(%rbp), %rdi
callq 0xe24c0
jmp 0xe372a
leaq 0x2b765e(%rip), %rdi    # 0x39ac20
leaq 0xa5ca1(%rip), %rsi     # 0x18926a
callq 0x9510
cmpl $0x0, %eax
jne 0xe35e6
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0xe2a90
jmp 0xe3728
leaq 0x2b7633(%rip), %rdi    # 0x39ac20
leaq 0xa5c7c(%rip), %rsi     # 0x189270
callq 0x9510
cmpl $0x0, %eax
jne 0xe3611
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0xe2a90
jmp 0xe3726
leaq 0x2b7608(%rip), %rdi    # 0x39ac20
leaq 0xa5c58(%rip), %rsi     # 0x189277
callq 0x9510
cmpl $0x0, %eax
jne 0xe3637
movq -0x8(%rbp), %rdi
callq 0xe2d30
jmp 0xe3724
leaq 0x2b75e2(%rip), %rdi    # 0x39ac20
leaq 0xa5c38(%rip), %rsi     # 0x18927d
callq 0x9510
cmpl $0x0, %eax
jne 0xe365d
movq -0x8(%rbp), %rdi
callq 0xe32b0
jmp 0xe3722
leaq 0x2b75bc(%rip), %rdi    # 0x39ac20
leaq 0xa5c18(%rip), %rsi     # 0x189283
callq 0x9510
cmpl $0x0, %eax
jne 0xe3683
movq -0x8(%rbp), %rdi
callq 0xe3360
jmp 0xe3720
leaq 0x2b7596(%rip), %rdi    # 0x39ac20
leaq 0xa5bfa(%rip), %rsi     # 0x18928b
callq 0x9510
cmpl $0x0, %eax
jne 0xe36a6
movq -0x8(%rbp), %rdi
callq 0xe2f70
jmp 0xe371e
leaq 0x2b7573(%rip), %rdi    # 0x39ac20
leaq 0xa5be1(%rip), %rsi     # 0x189295
callq 0x9510
cmpl $0x0, %eax
jne 0xe36c9
movq -0x8(%rbp), %rdi
callq 0xe3100
jmp 0xe371c
leaq 0x2b7550(%rip), %rdi    # 0x39ac20
leaq 0xa5bc8(%rip), %rsi     # 0x18929f
callq 0x9510
cmpl $0x0, %eax
jne 0xe36ec
movq -0x8(%rbp), %rdi
callq 0xe3100
jmp 0xe371a
leaq 0x2b752d(%rip), %rdi    # 0x39ac20
leaq 0xa5bae(%rip), %rsi     # 0x1892a8
callq 0x9510
cmpl $0x0, %eax
jne 0xe370f
movq -0x8(%rbp), %rdi
callq 0xe3470
jmp 0xe3718
movq -0x8(%rbp), %rdi
callq 0xe2a30
jmp 0xe371a
jmp 0xe371c
jmp 0xe371e
jmp 0xe3720
jmp 0xe3722
jmp 0xe3724
jmp 0xe3726
jmp 0xe3728
jmp 0xe372a
jmp 0xe372c
leaq 0x1b9e6d(%rip), %rax    # 0x29d5a0
cmpq $0x0, (%rax)
je 0xe3757
leaq 0x19f0a0(%rip), %rax    # 0x2827e0
cmpq $0x0, (%rax)
je 0xe3757
leaq 0x19f093(%rip), %rax    # 0x2827e0
movq (%rax), %rax
movl %eax, %edi
callq 0xb8b0
leaq 0x1baa22(%rip), %rax    # 0x29e180
movl $0x1, (%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)