// File: /workspace/github_cpp_makefile_star2_O1/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 0x7f47d
leaq 0x28f7d8(%rip), %rdi    # 0x337250
leaq 0x7e39e(%rip), %rsi     # 0x125e1d
callq 0x9090
testq %rax, %rax
je 0xa7bf2
movq %rax, %rdi
callq 0xa637e
cmpb $0x3a, 0x2ca564(%rip)   # 0x372000
jne 0xa7bf2
movq %rax, %rdi
callq 0xa637e
movq %rax, %rbx
leaq 0x293f8c(%rip), %r14    # 0x33ba40
movq %r14, %rdi
callq 0x9899
leaq 0x1968cd(%rip), %rax    # 0x23e390
movq (%rax), %rdi
testq %rdi, %rdi
je 0xa7ae7
movsbl 0x2ca52e(%rip), %ecx    # 0x372000
leaq 0x7e34d(%rip), %rsi     # 0x125e26
leaq 0x293f60(%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 0xa7b90
movl $0x594b5322, %eax       # imm = 0x594B5322
xorl (%r14), %eax
movzwl 0x4(%r14), %ecx
xorl $0x22, %ecx
orl %eax, %ecx
je 0xa7b9a
movl $0x53505022, %eax       # imm = 0x53505022
xorl (%r14), %eax
movzwl 0x4(%r14), %ecx
xorl $0x22, %ecx
orl %eax, %ecx
je 0xa7ba4
movl $0x464f5422, %eax       # imm = 0x464F5422
xorl (%r14), %eax
movl $0x224646, %ecx         # imm = 0x224646
xorl 0x3(%r14), %ecx
orl %eax, %ecx
je 0xa7bae
movl $0x43534f22, %eax       # imm = 0x43534F22
xorl (%r14), %eax
movzwl 0x4(%r14), %ecx
xorl $0x22, %ecx
orl %eax, %ecx
je 0xa7bf7
movl $0x54544122, %eax       # imm = 0x54544122
xorl (%r14), %eax
movzwl 0x4(%r14), %ecx
xorl $0x22, %ecx
orl %eax, %ecx
je 0xa7c01
movq (%r14), %rax
movabsq $0x22324d43545222, %rcx # imm = 0x22324D43545222
cmpq %rcx, %rax
jne 0xa7c0b
movq %rbx, %rdi
callq 0xa7894
jmp 0xa7bbb
movq %rbx, %rdi
callq 0xa64fa
jmp 0xa7bbb
movq %rbx, %rdi
callq 0xa6b12
jmp 0xa7bbb
movq %rbx, %rdi
movl $0x1, %esi
jmp 0xa7bb6
movq %rbx, %rdi
movl $0x2, %esi
callq 0xa7073
leaq 0x1967fe(%rip), %rax    # 0x23e3c0
cmpq $0x0, (%rax)
setne %al
leaq 0x17ba30(%rip), %rcx    # 0x223600
movq (%rcx), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xa7be5
callq 0xaff7
leaq 0x1973b4(%rip), %rax    # 0x23efa0
movl $0x1, (%rax)
popq %rbx
popq %r14
popq %rbp
retq
movq %rbx, %rdi
callq 0xa72d8
jmp 0xa7bbb
movq %rbx, %rdi
callq 0xa77d4
jmp 0xa7bbb
movabsq $0x4e4f495352455622, %rcx # imm = 0x4E4F495352455622
xorq (%r14), %rcx
movzwl 0x8(%r14), %edx
xorq $0x22, %rdx
orq %rcx, %rdx
je 0xa7c81
movabsq $0x5345434956454422, %rcx # imm = 0x5345434956454422
xorq (%r14), %rcx
movzwl 0x8(%r14), %edx
xorq $0x22, %rdx
orq %rcx, %rdx
je 0xa7c74
movabsq $0x2245434956454422, %rcx # imm = 0x2245434956454422
xorq (%r14), %rcx
movzbl 0x8(%r14), %edx
orq %rcx, %rdx
je 0xa7c74
movabsq $0x22484354415722, %rcx # imm = 0x22484354415722
movq %rbx, %rdi
cmpq %rcx, %rax
jne 0xa7c8e
callq 0xa7a01
jmp 0xa7bbb
movq %rbx, %rdi
callq 0xa766b
jmp 0xa7bbb
movq %rbx, %rdi
callq 0xa74da
jmp 0xa7bbb
callq 0xa7014
jmp 0xa7bbb