// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r14
pushq %rbx
pushq $0x1
popq %rdi
callq 0x73dcb
leaq 0x288e3e(%rip), %rdi    # 0x321250
leaq 0x77a29(%rip), %rsi     # 0x10fe42
callq 0x9090
testq %rax, %rax
je 0x985a7
movq %rax, %rdi
callq 0x96fd1
cmpb $0x3a, 0x2c3bca(%rip)   # 0x35c000
jne 0x985a7
movq %rax, %rdi
callq 0x96fd1
movq %rax, %rbx
leaq 0x28d5f2(%rip), %rdi    # 0x325a40
callq 0x988f
leaq 0x18ff36(%rip), %rax    # 0x228390
movq (%rax), %rdi
testq %rdi, %rdi
je 0x9847e
movsbl 0x2c3b97(%rip), %ecx    # 0x35c000
leaq 0x779db(%rip), %rsi     # 0x10fe4b
leaq 0x28d5c9(%rip), %rdx    # 0x325a40
xorl %eax, %eax
callq 0x9560
leaq 0x28d5bb(%rip), %rdi    # 0x325a40
leaq 0x779d4(%rip), %rsi     # 0x10fe60
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x9854d
leaq 0x28d59d(%rip), %rdi    # 0x325a40
leaq 0x779bc(%rip), %rsi     # 0x10fe66
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x98557
leaq 0x28d57f(%rip), %rdi    # 0x325a40
leaq 0x779a4(%rip), %rsi     # 0x10fe6c
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x98561
leaq 0x28d561(%rip), %rdi    # 0x325a40
leaq 0x7798c(%rip), %rsi     # 0x10fe72
pushq $0x7
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x98565
leaq 0x28d547(%rip), %rdi    # 0x325a40
leaq 0x77979(%rip), %rsi     # 0x10fe79
pushq $0x6
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x985ac
leaq 0x28d529(%rip), %r14    # 0x325a40
leaq 0x77961(%rip), %rsi     # 0x10fe7f
pushq $0x6
popq %rdx
movq %r14, %rdi
callq 0x9380
testl %eax, %eax
je 0x985b6
movq (%r14), %r14
movabsq $0x22324d43545222, %rax # imm = 0x22324D43545222
cmpq %rax, %r14
jne 0x985c0
movq %rbx, %rdi
callq 0x9829f
jmp 0x98570
movq %rbx, %rdi
callq 0x97157
jmp 0x98570
movq %rbx, %rdi
callq 0x97661
jmp 0x98570
pushq $0x1
jmp 0x98567
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x97b73
leaq 0x18fe49(%rip), %rax    # 0x2283c0
cmpq $0x0, (%rax)
setne %al
leaq 0x17507b(%rip), %rcx    # 0x20d600
movq (%rcx), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x9859a
callq 0xae83
leaq 0x1909ff(%rip), %rax    # 0x228fa0
movl $0x1, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
movq %rbx, %rdi
callq 0x97d82
jmp 0x98570
movq %rbx, %rdi
callq 0x981f6
jmp 0x98570
leaq 0x28d479(%rip), %rdi    # 0x325a40
leaq 0x778b7(%rip), %rsi     # 0x10fe85
pushq $0xa
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x98637
leaq 0x28d45f(%rip), %rdi    # 0x325a40
leaq 0x778a7(%rip), %rsi     # 0x10fe8f
pushq $0xa
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x9862a
leaq 0x28d445(%rip), %rdi    # 0x325a40
leaq 0x77897(%rip), %rsi     # 0x10fe99
pushq $0x9
popq %rdx
callq 0x9380
testl %eax, %eax
je 0x9862a
movabsq $0x22484354415722, %rax # imm = 0x22484354415722
movq %rbx, %rdi
cmpq %rax, %r14
jne 0x98644
callq 0x983a0
jmp 0x98570
movq %rbx, %rdi
callq 0x98091
jmp 0x98570
movq %rbx, %rdi
callq 0x97f50
jmp 0x98570
callq 0x97b17
jmp 0x98570