// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
movl $0x1, %edi
callq 0x7f47d
leaq 0x296348(%rip), %rbx    # 0x33b830
movb $0x0, (%rbx)
xorl %r14d, %r14d
leaq 0x292d5d(%rip), %r15    # 0x338252
leaq 0x199a74(%rip), %r12    # 0x23ef70
movzwl (%r15), %eax
cmpq %rax, %r14
jae 0xa552c
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0xa5516
orb $0x8, (%r12)
movb %al, (%r14,%rbx)
movb $0x0, 0x1(%r14,%rbx)
incq %r14
cmpq $0x1f6, %r14            # imm = 0x1F6
jne 0xa54fc
leaq 0x296711(%rip), %rax    # 0x33bc44
movl $0x0, (%rax)
callq 0x811da
leaq 0x2964fb(%rip), %rdi    # 0x33ba40
leaq 0x70107(%rip), %rsi     # 0x115653
callq 0x9090
testq %rax, %rax
je 0xa5567
leaq 0x7f27d(%rip), %rdi     # 0x1247da
callq 0x58e77
jmp 0xa57e3
leaq 0x2964d2(%rip), %rdi    # 0x33ba40
leaq 0x805c8(%rip), %rsi     # 0x125b3d
callq 0x9090
testq %rax, %rax
je 0xa5589
callq 0xa4590
jmp 0xa57e3
leaq 0x2964b0(%rip), %rdi    # 0x33ba40
leaq 0x805a9(%rip), %rsi     # 0x125b40
callq 0x9090
testq %rax, %rax
je 0xa55ad
xorl %edi, %edi
callq 0xa4658
jmp 0xa57e3
leaq 0x29648c(%rip), %rdi    # 0x33ba40
leaq 0x80588(%rip), %rsi     # 0x125b43
callq 0x9090
testq %rax, %rax
je 0xa55cf
callq 0xa48c5
jmp 0xa57e3
leaq 0x29646a(%rip), %rdi    # 0x33ba40
leaq 0x64945(%rip), %rsi     # 0x109f22
callq 0x9090
testq %rax, %rax
je 0xa55f1
callq 0xa4909
jmp 0xa57e3
leaq 0x296448(%rip), %rdi    # 0x33ba40
leaq 0x7b704(%rip), %rsi     # 0x120d03
callq 0x9090
testq %rax, %rax
je 0xa5613
callq 0xa4995
jmp 0xa57e3
leaq 0x296426(%rip), %rdi    # 0x33ba40
leaq 0x7b6e5(%rip), %rsi     # 0x120d06
callq 0x9090
testq %rax, %rax
je 0xa5635
callq 0xa49dc
jmp 0xa57e3
leaq 0x296404(%rip), %rdi    # 0x33ba40
leaq 0x7f8ef(%rip), %rsi     # 0x124f32
callq 0x9090
testq %rax, %rax
je 0xa5657
callq 0xa4a69
jmp 0xa57e3
leaq 0x2963e2(%rip), %rdi    # 0x33ba40
leaq 0x89623(%rip), %rsi     # 0x12ec88
callq 0x9090
testq %rax, %rax
je 0xa5679
callq 0xa4af6
jmp 0xa57e3
leaq 0x2963c0(%rip), %rdi    # 0x33ba40
leaq 0x7061c(%rip), %rsi     # 0x115ca3
callq 0x9090
testq %rax, %rax
je 0xa569b
callq 0xa4b67
jmp 0xa57e3
leaq 0x29639e(%rip), %rdi    # 0x33ba40
leaq 0x8049d(%rip), %rsi     # 0x125b46
callq 0x9090
testq %rax, %rax
je 0xa56bd
callq 0xa4bba
jmp 0xa57e3
leaq 0x29637c(%rip), %rdi    # 0x33ba40
leaq 0x8047e(%rip), %rsi     # 0x125b49
callq 0x9090
testq %rax, %rax
je 0xa56e4
movl $0x3f, %edi
callq 0xa50d1
jmp 0xa57e3
leaq 0x296355(%rip), %rdi    # 0x33ba40
leaq 0x8045a(%rip), %rsi     # 0x125b4c
callq 0x9090
testq %rax, %rax
je 0xa5706
callq 0xa4c9d
jmp 0xa57e3
leaq 0x296333(%rip), %rdi    # 0x33ba40
leaq 0x8043b(%rip), %rsi     # 0x125b4f
callq 0x9090
testq %rax, %rax
je 0xa5728
callq 0xa4cec
jmp 0xa57e3
leaq 0x296311(%rip), %rdi    # 0x33ba40
leaq 0x8041c(%rip), %rsi     # 0x125b52
callq 0x9090
testq %rax, %rax
je 0xa574a
callq 0xa4d7b
jmp 0xa57e3
leaq 0x2962ef(%rip), %rdi    # 0x33ba40
leaq 0x6ff75(%rip), %rsi     # 0x1156cd
callq 0x9090
testq %rax, %rax
je 0xa5769
callq 0xa4e17
jmp 0xa57e3
leaq 0x2962d0(%rip), %rdi    # 0x33ba40
leaq 0x803de(%rip), %rsi     # 0x125b55
callq 0x9090
testq %rax, %rax
je 0xa5788
callq 0xa4e51
jmp 0xa57e3
leaq 0x2962b1(%rip), %rdi    # 0x33ba40
leaq 0x803c2(%rip), %rsi     # 0x125b58
callq 0x9090
testq %rax, %rax
je 0xa57a7
callq 0xa4f79
jmp 0xa57e3
leaq 0x296292(%rip), %rdi    # 0x33ba40
leaq 0x7f777(%rip), %rsi     # 0x124f2c
callq 0x9090
testq %rax, %rax
je 0xa57c6
callq 0xa4fb6
jmp 0xa57e3
leaq 0x296273(%rip), %rdi    # 0x33ba40
leaq 0x80387(%rip), %rsi     # 0x125b5b
callq 0x9090
testq %rax, %rax
je 0xa5823
callq 0xa4ff3
leaq 0x198bd6(%rip), %rax    # 0x23e3c0
cmpq $0x0, (%rax)
setne %al
leaq 0x17de08(%rip), %rcx    # 0x223600
movq (%rcx), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xa580d
callq 0xaff7
leaq 0x19978c(%rip), %rax    # 0x23efa0
movl $0x1, (%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x296216(%rip), %rdi    # 0x33ba40
leaq 0x8032d(%rip), %rsi     # 0x125b5e
callq 0x9090
testq %rax, %rax
je 0xa5845
movl $0x4a, %edi
jmp 0xa56da
leaq 0x2961f4(%rip), %rdi    # 0x33ba40
leaq 0x809e3(%rip), %rsi     # 0x126236
callq 0x9090
testq %rax, %rax
je 0xa5867
callq 0xa5059
jmp 0xa57e3
leaq 0x2961d2(%rip), %rdi    # 0x33ba40
leaq 0x802ec(%rip), %rsi     # 0x125b61
callq 0x9090
testq %rax, %rax
je 0xa5889
movl $0x1, %edi
jmp 0xa55a3
leaq 0x2961b0(%rip), %rdi    # 0x33ba40
leaq 0x802cd(%rip), %rsi     # 0x125b64
callq 0x9090
testq %rax, %rax
je 0xa58b0
movl $0x4d, %edi
callq 0xa539b
jmp 0xa57e3
leaq 0x296189(%rip), %rdi    # 0x33ba40
leaq 0x802a9(%rip), %rsi     # 0x125b67
callq 0x9090
testq %rax, %rax
je 0xa58d2
callq 0xa540c
jmp 0xa57e3
leaq 0x296167(%rip), %rdi    # 0x33ba40
leaq 0x8028a(%rip), %rsi     # 0x125b6a
callq 0x9090
testq %rax, %rax
je 0xa58f4
callq 0xa530d
jmp 0xa57e3
leaq 0x296145(%rip), %rdi    # 0x33ba40
leaq 0x6fd65(%rip), %rsi     # 0x115667
callq 0x9090
testq %rax, %rax
je 0xa5913
movl $0x50, %edi
jmp 0xa58a6
leaq 0x296126(%rip), %rdi    # 0x33ba40
leaq 0x8024c(%rip), %rsi     # 0x125b6d
callq 0x9090
testq %rax, %rax
je 0xa5935
callq 0xa5269
jmp 0xa57e3
leaq 0x296104(%rip), %rdi    # 0x33ba40
callq 0xa5487
jmp 0xa57e3