// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: decode_tm4_msg()
void decode_tm4_msg()
{
int i;
u08 c;

   start_msg_decode(1);

   nmea_msg[0] = 0;
   for(i=0; i<tsip_wptr; i++) {  // copy message from tsip buffer to nmea buffer
      c = tsip_byte();
      nmea_msg[i] = c;
      nmea_msg[i+1] = 0;
      if(i >= ((int)sizeof(nmea_msg)-12)) break;
   }

   msg_col = 0;      // index of next char to get from nmea buffer
   get_msg_field();  // get the TM4 message type 

   if     (strstr(msg_field, "50")) parse_tm4_ack();           // ack
   else if(strstr(msg_field, "51")) parse_tm4_time();          // date and time
   else if(strstr(msg_field, "52")) parse_tm4_lla(0);          // position
   else if(strstr(msg_field, "53")) parse_tm4_alt();           // altitude
   else if(strstr(msg_field, "55")) parse_tm4_elmask();        // mask angle and datum
   else if(strstr(msg_field, "56")) parse_tm4_cable();         // cable delay
   else if(strstr(msg_field, "57")) parse_tm4_tmode();         // timing mode
   else if(strstr(msg_field, "59")) parse_tm4_dop();           // DOP and almanac status
   else if(strstr(msg_field, "60")) parse_tm4_mux1();          // mux1 status
   else if(strstr(msg_field, "61")) parse_tm4_validity();      // time validity
   else if(strstr(msg_field, "62")) parse_tm4_ett();           // event time tag
   else if(strstr(msg_field, "63")) parse_tm4_pop(63);         // POP/ETT status
   else if(strstr(msg_field, "64")) parse_tm4_dmode();         // discipline mode
   else if(strstr(msg_field, "65")) parse_tm4_alarm();         // alarm status
   else if(strstr(msg_field, "66")) parse_tm4_id();            // * id info
   else if(strstr(msg_field, "68")) parse_tm4_mux2();          // mux2 status
   else if(strstr(msg_field, "69")) parse_tm4_sats();          // sat status
   else if(strstr(msg_field, "70")) parse_tm4_time_format();   // serial time format
   else if(strstr(msg_field, "71")) parse_tm4_code_format();   // time code format
   else if(strstr(msg_field, "73")) parse_tm4_ett_enable();    // ETT params
   else if(strstr(msg_field, "74")) parse_tm4_pop(74);         // POP params
   else if(strstr(msg_field, "75")) parse_tm4_speed();         // speed/heading
   else if(strstr(msg_field, "76")) parse_tm4_lla(1);          // enhanced NMEA info
   else if(strstr(msg_field, "77")) parse_tm4_lock(77);        // phase loc status (early units)
   else if(strstr(msg_field, "78")) parse_tm4_options();       // option values
   else if(strstr(msg_field, "79")) parse_tm4_coast();         // coast time
   else if(strstr(msg_field, "80")) parse_tm4_lock(80);        // phase lock status
   else if(strstr(msg_field, "81")) parse_tm4_utc();           // UTC info
   else if(strstr(msg_field, "82")) parse_tm4_unkn(msg_field); // * unknown message (6 vals)
   else                             parse_tm4_unkn(msg_field); // unknown message

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
pushq $0x1
popq %rdi
callq 0x73dcb
leaq 0x28f685(%rip), %rbx    # 0x325830
movb $0x0, (%rbx)
xorl %r14d, %r14d
leaq 0x28c09a(%rip), %r15    # 0x322252
movzwl (%r15), %eax
cmpq %rax, %r14
jae 0x961dc
callq 0x51c47
movb %al, (%r14,%rbx)
movb $0x0, 0x1(%r14,%rbx)
incq %r14
cmpq $0x1f6, %r14            # imm = 0x1F6
jne 0x961b8
leaq 0x28fa61(%rip), %rax    # 0x325c44
andl $0x0, (%rax)
callq 0x75767
leaq 0x28f84e(%rip), %rdi    # 0x325a40
leaq 0x6956e(%rip), %rsi     # 0xff767
callq 0x9090
testq %rax, %rax
je 0x9620d
callq 0x952fd
jmp 0x96487
leaq 0x28f82c(%rip), %rdi    # 0x325a40
leaq 0x7994a(%rip), %rsi     # 0x10fb65
callq 0x9090
testq %rax, %rax
je 0x9622f
callq 0x9530e
jmp 0x96487
leaq 0x28f80a(%rip), %rdi    # 0x325a40
leaq 0x7992b(%rip), %rsi     # 0x10fb68
callq 0x9090
testq %rax, %rax
je 0x96253
xorl %edi, %edi
callq 0x953b0
jmp 0x96487
leaq 0x28f7e6(%rip), %rdi    # 0x325a40
leaq 0x6197e(%rip), %rsi     # 0xf7bdf
callq 0x9090
testq %rax, %rax
je 0x96275
callq 0x9561d
jmp 0x96487
leaq 0x28f7c4(%rip), %rdi    # 0x325a40
leaq 0x5dcff(%rip), %rsi     # 0xf3f82
callq 0x9090
testq %rax, %rax
je 0x96297
callq 0x95661
jmp 0x96487
leaq 0x28f7a2(%rip), %rdi    # 0x325a40
leaq 0x74a86(%rip), %rsi     # 0x10ad2b
callq 0x9090
testq %rax, %rax
je 0x962b9
callq 0x956c9
jmp 0x96487
leaq 0x28f780(%rip), %rdi    # 0x325a40
leaq 0x74a67(%rip), %rsi     # 0x10ad2e
callq 0x9090
testq %rax, %rax
je 0x962db
callq 0x95710
jmp 0x96487
leaq 0x28f75e(%rip), %rdi    # 0x325a40
leaq 0x78c71(%rip), %rsi     # 0x10ef5a
callq 0x9090
testq %rax, %rax
je 0x962fd
callq 0x9579d
jmp 0x96487
leaq 0x28f73c(%rip), %rdi    # 0x325a40
leaq 0x8298d(%rip), %rsi     # 0x118c98
callq 0x9090
testq %rax, %rax
je 0x9631f
callq 0x9582a
jmp 0x96487
leaq 0x28f71a(%rip), %rdi    # 0x325a40
leaq 0x69a8a(%rip), %rsi     # 0xffdb7
callq 0x9090
testq %rax, %rax
je 0x96341
callq 0x9589b
jmp 0x96487
leaq 0x28f6f8(%rip), %rdi    # 0x325a40
leaq 0x7981c(%rip), %rsi     # 0x10fb6b
callq 0x9090
testq %rax, %rax
je 0x96363
callq 0x958ee
jmp 0x96487
leaq 0x28f6d6(%rip), %rdi    # 0x325a40
leaq 0x797fd(%rip), %rsi     # 0x10fb6e
callq 0x9090
testq %rax, %rax
je 0x96388
pushq $0x3f
popq %rdi
callq 0x95dde
jmp 0x96487
leaq 0x28f6b1(%rip), %rdi    # 0x325a40
leaq 0x797db(%rip), %rsi     # 0x10fb71
callq 0x9090
testq %rax, %rax
je 0x963aa
callq 0x959ce
jmp 0x96487
leaq 0x28f68f(%rip), %rdi    # 0x325a40
leaq 0x797bc(%rip), %rsi     # 0x10fb74
callq 0x9090
testq %rax, %rax
je 0x963cc
callq 0x95a1d
jmp 0x96487
leaq 0x28f66d(%rip), %rdi    # 0x325a40
leaq 0x7979d(%rip), %rsi     # 0x10fb77
callq 0x9090
testq %rax, %rax
je 0x963ee
callq 0x95aaa
jmp 0x96487
leaq 0x28f64b(%rip), %rdi    # 0x325a40
leaq 0x693e5(%rip), %rsi     # 0xff7e1
callq 0x9090
testq %rax, %rax
je 0x9640d
callq 0x95b46
jmp 0x96487
leaq 0x28f62c(%rip), %rdi    # 0x325a40
leaq 0x7975f(%rip), %rsi     # 0x10fb7a
callq 0x9090
testq %rax, %rax
je 0x9642c
callq 0x95b80
jmp 0x96487
leaq 0x28f60d(%rip), %rdi    # 0x325a40
leaq 0x79743(%rip), %rsi     # 0x10fb7d
callq 0x9090
testq %rax, %rax
je 0x9644b
callq 0x95c86
jmp 0x96487
leaq 0x28f5ee(%rip), %rdi    # 0x325a40
leaq 0x78afb(%rip), %rsi     # 0x10ef54
callq 0x9090
testq %rax, %rax
je 0x9646a
callq 0x95cc3
jmp 0x96487
leaq 0x28f5cf(%rip), %rdi    # 0x325a40
leaq 0x79708(%rip), %rsi     # 0x10fb80
callq 0x9090
testq %rax, %rax
je 0x964c9
callq 0x95d00
leaq 0x191f32(%rip), %rax    # 0x2283c0
cmpq $0x0, (%rax)
setne %al
leaq 0x177164(%rip), %rcx    # 0x20d600
movq (%rcx), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x964b1
callq 0xae83
leaq 0x192ae8(%rip), %rax    # 0x228fa0
movl $0x1, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x28f570(%rip), %rdi    # 0x325a40
leaq 0x796ac(%rip), %rsi     # 0x10fb83
callq 0x9090
testq %rax, %rax
je 0x964e8
pushq $0x4a
jmp 0x9637d
leaq 0x28f551(%rip), %rdi    # 0x325a40
leaq 0x79d65(%rip), %rsi     # 0x11025b
callq 0x9090
testq %rax, %rax
je 0x96507
callq 0x95d66
jmp 0x96487
leaq 0x28f532(%rip), %rdi    # 0x325a40
leaq 0x79671(%rip), %rsi     # 0x10fb86
callq 0x9090
testq %rax, %rax
je 0x96527
pushq $0x1
popq %rdi
jmp 0x96249
leaq 0x28f512(%rip), %rdi    # 0x325a40
leaq 0x79654(%rip), %rsi     # 0x10fb89
callq 0x9090
testq %rax, %rax
je 0x9654c
pushq $0x4d
popq %rdi
callq 0x96064
jmp 0x96487
leaq 0x28f4ed(%rip), %rdi    # 0x325a40
leaq 0x79632(%rip), %rsi     # 0x10fb8c
callq 0x9090
testq %rax, %rax
je 0x9656e
callq 0x960d2
jmp 0x96487
leaq 0x28f4cb(%rip), %rdi    # 0x325a40
leaq 0x79613(%rip), %rsi     # 0x10fb8f
callq 0x9090
testq %rax, %rax
je 0x96590
callq 0x95fd5
jmp 0x96487
leaq 0x28f4a9(%rip), %rdi    # 0x325a40
leaq 0x691dd(%rip), %rsi     # 0xff77b
callq 0x9090
testq %rax, %rax
je 0x965ac
pushq $0x50
jmp 0x96541
leaq 0x28f48d(%rip), %rdi    # 0x325a40
leaq 0x795d8(%rip), %rsi     # 0x10fb92
callq 0x9090
testq %rax, %rax
je 0x965ce
callq 0x95f73
jmp 0x96487
leaq 0x28f46b(%rip), %rdi    # 0x325a40
callq 0x9614d
jmp 0x96487