// File: /workspace/github_cpp_makefile_star2_O3/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 0x7f2b8
leaq 0x29615e(%rip), %rbx    # 0x33b830
movb $0x0, (%rbx)
xorl %r14d, %r14d
leaq 0x292b73(%rip), %r15    # 0x338252
leaq 0x19988a(%rip), %r12    # 0x23ef70
movzwl (%r15), %eax
cmpq %rax, %r14
jae 0xa5716
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0xa5700
orb $0x8, (%r12)
movb %al, (%r14,%rbx)
movb $0x0, 0x1(%r14,%rbx)
incq %r14
cmpq $0x1f6, %r14            # imm = 0x1F6
jne 0xa56e6
leaq 0x296527(%rip), %rax    # 0x33bc44
movl $0x0, (%rax)
callq 0x810b1
leaq 0x296311(%rip), %rdi    # 0x33ba40
leaq 0x6ffb1(%rip), %rsi     # 0x1156e7
callq 0x9090
testq %rax, %rax
je 0xa5751
leaq 0x7f173(%rip), %rdi     # 0x1248ba
callq 0x58dc2
jmp 0xa59cd
leaq 0x2962e8(%rip), %rdi    # 0x33ba40
leaq 0x804be(%rip), %rsi     # 0x125c1d
callq 0x9090
testq %rax, %rax
je 0xa5773
callq 0xa47a5
jmp 0xa59cd
leaq 0x2962c6(%rip), %rdi    # 0x33ba40
leaq 0x8049f(%rip), %rsi     # 0x125c20
callq 0x9090
testq %rax, %rax
je 0xa5797
xorl %edi, %edi
callq 0xa486d
jmp 0xa59cd
leaq 0x2962a2(%rip), %rdi    # 0x33ba40
leaq 0x8047e(%rip), %rsi     # 0x125c23
callq 0x9090
testq %rax, %rax
je 0xa57b9
callq 0xa4ada
jmp 0xa59cd
leaq 0x296280(%rip), %rdi    # 0x33ba40
leaq 0x6476b(%rip), %rsi     # 0x109f32
callq 0x9090
testq %rax, %rax
je 0xa57db
callq 0xa4b1e
jmp 0xa59cd
leaq 0x29625e(%rip), %rdi    # 0x33ba40
leaq 0x7b5fa(%rip), %rsi     # 0x120de3
callq 0x9090
testq %rax, %rax
je 0xa57fd
callq 0xa4b86
jmp 0xa59cd
leaq 0x29623c(%rip), %rdi    # 0x33ba40
leaq 0x7b5db(%rip), %rsi     # 0x120de6
callq 0x9090
testq %rax, %rax
je 0xa581f
callq 0xa4bcd
jmp 0xa59cd
leaq 0x29621a(%rip), %rdi    # 0x33ba40
leaq 0x7f7e5(%rip), %rsi     # 0x125012
callq 0x9090
testq %rax, %rax
je 0xa5841
callq 0xa4c5a
jmp 0xa59cd
leaq 0x2961f8(%rip), %rdi    # 0x33ba40
leaq 0x89529(%rip), %rsi     # 0x12ed78
callq 0x9090
testq %rax, %rax
je 0xa5863
callq 0xa4ce7
jmp 0xa59cd
leaq 0x2961d6(%rip), %rdi    # 0x33ba40
leaq 0x704c6(%rip), %rsi     # 0x115d37
callq 0x9090
testq %rax, %rax
je 0xa5885
callq 0xa4d58
jmp 0xa59cd
leaq 0x2961b4(%rip), %rdi    # 0x33ba40
leaq 0x80393(%rip), %rsi     # 0x125c26
callq 0x9090
testq %rax, %rax
je 0xa58a7
callq 0xa4dab
jmp 0xa59cd
leaq 0x296192(%rip), %rdi    # 0x33ba40
leaq 0x80374(%rip), %rsi     # 0x125c29
callq 0x9090
testq %rax, %rax
je 0xa58ce
movl $0x3f, %edi
callq 0xa52c2
jmp 0xa59cd
leaq 0x29616b(%rip), %rdi    # 0x33ba40
leaq 0x80350(%rip), %rsi     # 0x125c2c
callq 0x9090
testq %rax, %rax
je 0xa58f0
callq 0xa4e8e
jmp 0xa59cd
leaq 0x296149(%rip), %rdi    # 0x33ba40
leaq 0x80331(%rip), %rsi     # 0x125c2f
callq 0x9090
testq %rax, %rax
je 0xa5912
callq 0xa4edd
jmp 0xa59cd
leaq 0x296127(%rip), %rdi    # 0x33ba40
leaq 0x80312(%rip), %rsi     # 0x125c32
callq 0x9090
testq %rax, %rax
je 0xa5934
callq 0xa4f6c
jmp 0xa59cd
leaq 0x296105(%rip), %rdi    # 0x33ba40
leaq 0x6fe1f(%rip), %rsi     # 0x115761
callq 0x9090
testq %rax, %rax
je 0xa5953
callq 0xa5008
jmp 0xa59cd
leaq 0x2960e6(%rip), %rdi    # 0x33ba40
leaq 0x802d4(%rip), %rsi     # 0x125c35
callq 0x9090
testq %rax, %rax
je 0xa5972
callq 0xa5042
jmp 0xa59cd
leaq 0x2960c7(%rip), %rdi    # 0x33ba40
leaq 0x802b8(%rip), %rsi     # 0x125c38
callq 0x9090
testq %rax, %rax
je 0xa5991
callq 0xa516a
jmp 0xa59cd
leaq 0x2960a8(%rip), %rdi    # 0x33ba40
leaq 0x7f66d(%rip), %rsi     # 0x12500c
callq 0x9090
testq %rax, %rax
je 0xa59b0
callq 0xa51a7
jmp 0xa59cd
leaq 0x296089(%rip), %rdi    # 0x33ba40
leaq 0x8027d(%rip), %rsi     # 0x125c3b
callq 0x9090
testq %rax, %rax
je 0xa5a0d
callq 0xa51e4
leaq 0x1989ec(%rip), %rax    # 0x23e3c0
cmpq $0x0, (%rax)
setne %al
leaq 0x17dc1e(%rip), %rcx    # 0x223600
movq (%rcx), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xa59f7
callq 0xafe8
leaq 0x1995a2(%rip), %rax    # 0x23efa0
movl $0x1, (%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x29602c(%rip), %rdi    # 0x33ba40
leaq 0x80223(%rip), %rsi     # 0x125c3e
callq 0x9090
testq %rax, %rax
je 0xa5a2f
movl $0x4a, %edi
jmp 0xa58c4
leaq 0x29600a(%rip), %rdi    # 0x33ba40
leaq 0x808d9(%rip), %rsi     # 0x126316
callq 0x9090
testq %rax, %rax
je 0xa5a51
callq 0xa524a
jmp 0xa59cd
leaq 0x295fe8(%rip), %rdi    # 0x33ba40
leaq 0x801e2(%rip), %rsi     # 0x125c41
callq 0x9090
testq %rax, %rax
je 0xa5a73
movl $0x1, %edi
jmp 0xa578d
leaq 0x295fc6(%rip), %rdi    # 0x33ba40
leaq 0x801c3(%rip), %rsi     # 0x125c44
callq 0x9090
testq %rax, %rax
je 0xa5a9a
movl $0x4d, %edi
callq 0xa5585
jmp 0xa59cd
leaq 0x295f9f(%rip), %rdi    # 0x33ba40
leaq 0x8019f(%rip), %rsi     # 0x125c47
callq 0x9090
testq %rax, %rax
je 0xa5abc
callq 0xa55f6
jmp 0xa59cd
leaq 0x295f7d(%rip), %rdi    # 0x33ba40
leaq 0x80180(%rip), %rsi     # 0x125c4a
callq 0x9090
testq %rax, %rax
je 0xa5ade
callq 0xa54f7
jmp 0xa59cd
leaq 0x295f5b(%rip), %rdi    # 0x33ba40
leaq 0x6fc0f(%rip), %rsi     # 0x1156fb
callq 0x9090
testq %rax, %rax
je 0xa5afd
movl $0x50, %edi
jmp 0xa5a90
leaq 0x295f3c(%rip), %rdi    # 0x33ba40
leaq 0x80142(%rip), %rsi     # 0x125c4d
callq 0x9090
testq %rax, %rax
je 0xa5b1f
callq 0xa545a
jmp 0xa59cd
leaq 0x295f1a(%rip), %rdi    # 0x33ba40
callq 0xa5671
jmp 0xa59cd