// File: /workspace/github_cpp_makefile_star2_O3/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
movl $0x1, %edi
callq 0x7f2b8
leaq 0x28f5aa(%rip), %rdi    # 0x337250
leaq 0x7e250(%rip), %rsi     # 0x125efd
callq 0x9090
testq %rax, %rax
je 0xa7e20
movq %rax, %rdi
callq 0xa6568
cmpb $0x3a, 0x2ca336(%rip)   # 0x372000
jne 0xa7e20
movq %rax, %rdi
callq 0xa6568
movq %rax, %rbx
leaq 0x293d5e(%rip), %r14    # 0x33ba40
movq %r14, %rdi
callq 0x9899
leaq 0x19669f(%rip), %rax    # 0x23e390
movq (%rax), %rdi
testq %rdi, %rdi
je 0xa7d15
movsbl 0x2ca300(%rip), %ecx    # 0x372000
leaq 0x7e1ff(%rip), %rsi     # 0x125f06
leaq 0x293d32(%rip), %rdx    # 0x33ba40
xorl %eax, %eax
callq 0x9560
movl $0x56505422, %eax       # imm = 0x56505422
xorl (%r14), %eax
movzwl 0x4(%r14), %ecx
xorl $0x22, %ecx
orl %eax, %ecx
je 0xa7dbe
movl $0x594b5322, %eax       # imm = 0x594B5322
xorl (%r14), %eax
movzwl 0x4(%r14), %ecx
xorl $0x22, %ecx
orl %eax, %ecx
je 0xa7dc8
movl $0x53505022, %eax       # imm = 0x53505022
xorl (%r14), %eax
movzwl 0x4(%r14), %ecx
xorl $0x22, %ecx
orl %eax, %ecx
je 0xa7dd2
movl $0x464f5422, %eax       # imm = 0x464F5422
xorl (%r14), %eax
movl $0x224646, %ecx         # imm = 0x224646
xorl 0x3(%r14), %ecx
orl %eax, %ecx
je 0xa7ddc
movl $0x43534f22, %eax       # imm = 0x43534F22
xorl (%r14), %eax
movzwl 0x4(%r14), %ecx
xorl $0x22, %ecx
orl %eax, %ecx
je 0xa7e25
movl $0x54544122, %eax       # imm = 0x54544122
xorl (%r14), %eax
movzwl 0x4(%r14), %ecx
xorl $0x22, %ecx
orl %eax, %ecx
je 0xa7e2f
movq (%r14), %rax
movabsq $0x22324d43545222, %rcx # imm = 0x22324D43545222
cmpq %rcx, %rax
jne 0xa7e39
movq %rbx, %rdi
callq 0xa7ac2
jmp 0xa7de9
movq %rbx, %rdi
callq 0xa66f3
jmp 0xa7de9
movq %rbx, %rdi
callq 0xa6d23
jmp 0xa7de9
movq %rbx, %rdi
movl $0x1, %esi
jmp 0xa7de4
movq %rbx, %rdi
movl $0x2, %esi
callq 0xa7284
leaq 0x1965d0(%rip), %rax    # 0x23e3c0
cmpq $0x0, (%rax)
setne %al
leaq 0x17b802(%rip), %rcx    # 0x223600
movq (%rcx), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xa7e13
callq 0xafe8
leaq 0x197186(%rip), %rax    # 0x23efa0
movl $0x1, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
movq %rbx, %rdi
callq 0xa7506
jmp 0xa7de9
movq %rbx, %rdi
callq 0xa7a02
jmp 0xa7de9
movabsq $0x4e4f495352455622, %rcx # imm = 0x4E4F495352455622
xorq (%r14), %rcx
movzwl 0x8(%r14), %edx
xorq $0x22, %rdx
orq %rcx, %rdx
je 0xa7eaf
movabsq $0x5345434956454422, %rcx # imm = 0x5345434956454422
xorq (%r14), %rcx
movzwl 0x8(%r14), %edx
xorq $0x22, %rdx
orq %rcx, %rdx
je 0xa7ea2
movabsq $0x2245434956454422, %rcx # imm = 0x2245434956454422
xorq (%r14), %rcx
movzbl 0x8(%r14), %edx
orq %rcx, %rdx
je 0xa7ea2
movabsq $0x22484354415722, %rcx # imm = 0x22484354415722
movq %rbx, %rdi
cmpq %rcx, %rax
jne 0xa7ebc
callq 0xa7c2f
jmp 0xa7de9
movq %rbx, %rdi
callq 0xa7899
jmp 0xa7de9
movq %rbx, %rdi
callq 0xa7708
jmp 0xa7de9
callq 0xa7225
jmp 0xa7de9