// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: decode_tsip_message()
void decode_tsip_message()
{
   flush_debug();

   msg_fault = 0x00;
   tsip_rptr = 0;
   msg_id = get_next_tsip();

   subcode = 0x00;
   first_msg = 0;
   last_msg = msg_id;
   ++wakeup_tsip_msg; // we have seen a TSIP message
   tsip_error = 0;    // this flag gets set if we see something wrong in a message
   early_end = 0;
   new_packet(0);

   ++tsip_packets;
   if(tsip_packets == 100) {
      if((have_temperature == 0) && (user_set_temp_plot == 0)) {  // no temperature readings to plot
         plot[TEMP].show_plot = 0;
      }
   }

   msg_id &= 0xFF;
   if     (msg_id == 0x13) get_unknown_msg(0x13);
   else if(msg_id == 0x1C) get_ebolt_version();
   else if(msg_id == 0x40) get_almanac_data();     // almanac data page
   else if(msg_id == 0x41) get_gps_time();         // ntpx, RES 360. SV6 family
   else if(msg_id == 0x42) get_single_ecef_fix();
   else if(msg_id == 0x43) get_velocity_fix();
   else if(msg_id == 0x44) get_sv6_sat_list();
   else if(msg_id == 0x45) get_version_info();
   else if(msg_id == 0x46) get_ebolt_health1();
   else if(msg_id == 0x47) get_sig_levels();
   else if(msg_id == 0x48) get_system_msg();       // GPS system message (get with packet 0x28)
   else if(msg_id == 0x49) get_alm_health();
   else if(msg_id == 0x4A) get_single_lla_fix(); 
   else if(msg_id == 0x4B) get_ebolt_health2();
   else if(msg_id == 0x4C) get_sv6_config(); 
   else if(msg_id == 0x4D) get_sv6_osc_offset(); 
   else if(msg_id == 0x4E) get_set_time_response(); //response to set GPS time (packet 0x2E)
   else if(msg_id == 0x4F) get_sv6_utc_info(); 
   else if(msg_id == 0x54) get_clock_bias();
   else if(msg_id == 0x55) get_io_options();
   else if(msg_id == 0x56) get_enu_velocity_fix();
   else if(msg_id == 0x57) get_last_fix_info();
   else if(msg_id == 0x58) get_packet_58();
   else if(msg_id == 0x59) get_sat_health();
   else if(msg_id == 0x5A) get_raw_data();
   else if(msg_id == 0x5B) get_eph_status();
   else if(msg_id == 0x5C) get_sat_tracking(0x5C);
   else if(msg_id == 0x5D) get_sat_tracking(0x5D); // res 360 receiver
   else if(msg_id == 0x5E) get_fix_status();       // additional fix status
   else if(msg_id == 0x5F) get_eeprom_status();
   else if(msg_id == 0x6C) get_sat_list(1);        // res 360 receiver
   else if(msg_id == 0x6D) get_sat_list(0);
   else if(msg_id == 0x70) get_filter_config();
   else if(msg_id == 0x72) get_posn_filter();
   else if(msg_id == 0x74) get_alt_filter();
   else if(msg_id == 0x75) get_high8_mode();
   else if(msg_id == 0x76) get_high6_mode();
   else if(msg_id == 0x78) get_diff_age();
   else if(msg_id == 0x82) get_diff_mode();
   else if(msg_id == 0x83) get_ecef_fix();
   else if(msg_id == 0x84) get_lla_fix();
   else if(msg_id == 0x8F) get_timing_msg();
   else if(msg_id == 0xBB) get_tsip_config();
   else if(msg_id == LUXOR_ID) get_luxor_packet();
   else                        get_unknown_msg(msg_id);

   if(com[RCVR_PORT].com_error) {    // we had a com timeout so were skipping serial reads
      com[RCVR_PORT].com_error = 0;  // we can stop searching since data is now comming in
   }

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x1bf044(%rip), %rax    # 0x23e390
movq (%rax), %rdi
testq %rdi, %rdi
je 0x7f365
leaq 0x1bf0cd(%rip), %rax    # 0x23e428
cmpl $0x0, (%rax)
je 0x7f365
callq 0x9420
leaq 0x1bfc00(%rip), %rax    # 0x23ef6c
movl $0x0, (%rax)
leaq 0x2b8edb(%rip), %rax    # 0x338254
movw $0x0, (%rax)
leaq 0x2b8ecd(%rip), %rcx    # 0x338252
cmpw $0x0, (%rcx)
je 0x7f39c
movw $0x1, (%rax)
leaq 0x2b7eb9(%rip), %rax    # 0x337250
movzbl (%rax), %eax
jmp 0x7f3a1
movl $0x2000, %eax           # imm = 0x2000
leaq 0x1bfbb4(%rip), %rbx    # 0x23ef5c
movw %ax, (%rbx)
leaq 0x1bfbac(%rip), %rcx    # 0x23ef5e
xorl %edx, %edx
movb %dl, (%rcx)
leaq 0x2b7c6c(%rip), %rcx    # 0x337029
movb %dl, (%rcx)
leaq 0x1bfbd2(%rip), %rcx    # 0x23ef98
incq (%rcx)
movl %eax, 0x2ec9f5(%rip)    # 0x36bdc4
leaq 0x1bfb9a(%rip), %rax    # 0x23ef70
movl $0x0, (%rax)
movw $0x0, 0x2ec9db(%rip)    # 0x36bdc0
xorl %edi, %edi
callq 0x7f20c
movl 0x2f1a0a(%rip), %eax    # 0x370dfc
incl %eax
movl %eax, 0x2f1a02(%rip)    # 0x370dfc
cmpl $0x64, %eax
jne 0x7f428
leaq 0x28de46(%rip), %rax    # 0x30d24c
cmpl $0x0, (%rax)
jne 0x7f428
leaq 0x28ea50(%rip), %rax    # 0x30de62
cmpb $0x0, (%rax)
jne 0x7f428
leaq 0xde912(%rip), %rax     # 0x15dd30
movl $0x0, 0x2d0(%rax)
movzwl (%rbx), %eax
movzbl %al, %eax
movw %ax, (%rbx)
leal -0x40(%rax), %ecx
cmpl $0x2d, %ecx
ja 0x7f453
leaq 0x9fba0(%rip), %rdx     # 0x11efe0
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
callq 0x71f7b
jmp 0x7f59e
cmpl $0x1c, %eax
je 0x7f599
cmpl $0x13, %eax
jne 0x7f470
movl $0x13, %edi
callq 0x7ef36
jmp 0x7f59e
cmpl $0x8e, %eax
jg 0x7f5f3
movl %eax, %ecx
addl $-0x70, %ecx
cmpl $0x14, %ecx
ja 0x7f66d
leaq 0x9fc08(%rip), %rdx     # 0x11f098
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
callq 0x74a24
jmp 0x7f59e
callq 0x743c6
jmp 0x7f59e
movl $0x5d, %edi
jmp 0x7f57f
callq 0x74210
jmp 0x7f59e
callq 0x73284
jmp 0x7f59e
callq 0x72d2e
jmp 0x7f59e
callq 0x73336
jmp 0x7f59e
callq 0x740d5
jmp 0x7f59e
callq 0x721dc
jmp 0x7f59e
callq 0x723b3
jmp 0x7f59e
callq 0x72925
jmp 0x7f59e
callq 0x7220d
jmp 0x7f59e
callq 0x72e23
jmp 0x7f59e
callq 0x71fdb
jmp 0x7f59e
callq 0x74770
jmp 0x7f59e
callq 0x72cfd
jmp 0x7f59e
callq 0x721b0
jmp 0x7f59e
callq 0x734a6
jmp 0x7f59e
callq 0x72a17
jmp 0x7f59e
callq 0x72c1b
jmp 0x7f59e
callq 0x734d7
jmp 0x7f59e
xorl %edi, %edi
jmp 0x7f592
callq 0x72c9c
jmp 0x7f59e
callq 0x72f22
jmp 0x7f59e
callq 0x72f7f
jmp 0x7f59e
callq 0x7472c
jmp 0x7f59e
callq 0x72fad
jmp 0x7f59e
movl $0x5c, %edi
callq 0x744e5
jmp 0x7f59e
callq 0x74020
jmp 0x7f59e
movl $0x1, %edi
callq 0x747a7
jmp 0x7f59e
callq 0x71a9f
leaq 0x28ed3b(%rip), %rax    # 0x30e2e0
cmpb $0x0, 0x17a11(%rax)
je 0x7f5b5
movb $0x0, 0x17a11(%rax)
leaq 0x1bee04(%rip), %rax    # 0x23e3c0
cmpq $0x0, (%rax)
setne %al
leaq 0x1a4036(%rip), %rcx    # 0x223600
movq (%rcx), %rdi
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x7f5df
callq 0xafe8
leaq 0x1bf9ba(%rip), %rax    # 0x23efa0
movl $0x1, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
cmpl $0x8f, %eax
je 0x7f659
cmpl $0xbb, %eax
je 0x7f663
cmpl $0xdc, %eax
jne 0x7f66d
callq 0x7c8ca
jmp 0x7f59e
callq 0x74c52
jmp 0x7f59e
callq 0x74afa
jmp 0x7f59e
callq 0x74be4
jmp 0x7f59e
callq 0x74cce
jmp 0x7f59e
callq 0x74b8d
jmp 0x7f59e
callq 0x74c6f
jmp 0x7f59e
callq 0x74c9d
jmp 0x7f59e
callq 0x74c1b
jmp 0x7f59e
callq 0x7edfd
jmp 0x7f59e
callq 0x79d66
jmp 0x7f59e
movzwl %ax, %edi
jmp 0x7f466