// File: 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
callq 0x798d0
leaq 0x1efbfc(%rip), %rax    # 0x29e14c
movl $0x0, (%rax)
leaq 0x2e8ed7(%rip), %rax    # 0x397434
movw $0x0, (%rax)
callq 0x7a380
movw %ax, %cx
leaq 0x1efbcb(%rip), %rax    # 0x29e13c
movw %cx, (%rax)
leaq 0x1efbc3(%rip), %rax    # 0x29e13e
movb $0x0, (%rax)
leaq 0x2e7c84(%rip), %rax    # 0x396209
movb $0x0, (%rax)
leaq 0x1efbad(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
movl %eax, 0x31ca0c(%rip)    # 0x3cafa4
leaq 0x1efbd9(%rip), %rax    # 0x29e178
movq (%rax), %rcx
addq $0x1, %rcx
leaq 0x1efbcb(%rip), %rax    # 0x29e178
movq %rcx, (%rax)
leaq 0x1efb99(%rip), %rax    # 0x29e150
movl $0x0, (%rax)
movw $0x0, 0x31c9da(%rip)    # 0x3cafa0
xorl %edi, %edi
callq 0xae3c0
movl 0x3219f9(%rip), %eax    # 0x3cffcc
addl $0x1, %eax
movl %eax, 0x3219f0(%rip)    # 0x3cffcc
cmpl $0x64, 0x3219e9(%rip)   # 0x3cffcc
jne 0xae613
leaq 0x2bde40(%rip), %rax    # 0x36c42c
cmpl $0x0, (%rax)
jne 0xae611
leaq 0x2bea4a(%rip), %rax    # 0x36d042
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0xae611
leaq 0x10e719(%rip), %rax    # 0x1bcd20
movl $0x0, 0x2d0(%rax)
jmp 0xae613
leaq 0x1efb22(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
andl $0xff, %eax
movw %ax, %cx
leaq 0x1efb10(%rip), %rax    # 0x29e13c
movw %cx, (%rax)
leaq 0x1efb06(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x13, %eax
jne 0xae64d
movl $0x13, %edi
callq 0xae060
jmp 0xaeaf3
leaq 0x1efae8(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x1c, %eax
jne 0xae666
callq 0x9b6d0
jmp 0xaeaf1
leaq 0x1efacf(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x40, %eax
jne 0xae67f
callq 0x9bd40
jmp 0xaeaef
leaq 0x1efab6(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x41, %eax
jne 0xae698
callq 0x9bdb0
jmp 0xaeaed
leaq 0x1efa9d(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x42, %eax
jne 0xae6b1
callq 0x9bf90
jmp 0xaeaeb
leaq 0x1efa84(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x43, %eax
jne 0xae6ca
callq 0x9bff0
jmp 0xaeae9
leaq 0x1efa6b(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x44, %eax
jne 0xae6e3
callq 0x9c060
jmp 0xaeae7
leaq 0x1efa52(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x45, %eax
jne 0xae6fc
callq 0x9c310
jmp 0xaeae5
leaq 0x1efa39(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x46, %eax
jne 0xae715
callq 0x9ca90
jmp 0xaeae3
leaq 0x1efa20(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x47, %eax
jne 0xae72e
callq 0x9cc50
jmp 0xaeae1
leaq 0x1efa07(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x48, %eax
jne 0xae747
callq 0x9cff0
jmp 0xaeadf
leaq 0x1ef9ee(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x49, %eax
jne 0xae760
callq 0x9d070
jmp 0xaeadd
leaq 0x1ef9d5(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x4a, %eax
jne 0xae779
callq 0x9d100
jmp 0xaeadb
leaq 0x1ef9bc(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x4b, %eax
jne 0xae792
callq 0x9d170
jmp 0xaead9
leaq 0x1ef9a3(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x4c, %eax
jne 0xae7ab
callq 0x9d2c0
jmp 0xaead7
leaq 0x1ef98a(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x4d, %eax
jne 0xae7c4
callq 0x9d420
jmp 0xaead5
leaq 0x1ef971(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x4e, %eax
jne 0xae7dd
callq 0x9d490
jmp 0xaead3
leaq 0x1ef958(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x4f, %eax
jne 0xae7f6
callq 0x9d4c0
jmp 0xaead1
leaq 0x1ef93f(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x54, %eax
jne 0xae80f
callq 0x9d9c0
jmp 0xaeacf
leaq 0x1ef926(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x55, %eax
jne 0xae828
callq 0x9dab0
jmp 0xaeacd
leaq 0x1ef90d(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x56, %eax
jne 0xae841
callq 0x9dcf0
jmp 0xaeacb
leaq 0x1ef8f4(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x57, %eax
jne 0xae85a
callq 0x9dd60
jmp 0xaeac9
leaq 0x1ef8db(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x58, %eax
jne 0xae873
callq 0x9f590
jmp 0xaeac7
leaq 0x1ef8c2(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x59, %eax
jne 0xae88c
callq 0x9f640
jmp 0xaeac5
leaq 0x1ef8a9(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x5a, %eax
jne 0xae8a5
callq 0x9f7c0
jmp 0xaeac3
leaq 0x1ef890(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x5b, %eax
jne 0xae8be
callq 0x9faa0
jmp 0xaeac1
leaq 0x1ef877(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x5c, %eax
jne 0xae8dc
movl $0x5c, %edi
callq 0x9fc20
jmp 0xaeabf
leaq 0x1ef859(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x5d, %eax
jne 0xae8fa
movl $0x5d, %edi
callq 0x9fc20
jmp 0xaeabd
leaq 0x1ef83b(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x5e, %eax
jne 0xae913
callq 0x9ff60
jmp 0xaeabb
leaq 0x1ef822(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x5f, %eax
jne 0xae92c
callq 0x9ffb0
jmp 0xaeab9
leaq 0x1ef809(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x6c, %eax
jne 0xae94a
movl $0x1, %edi
callq 0xa0000
jmp 0xaeab7
leaq 0x1ef7eb(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x6d, %eax
jne 0xae965
xorl %edi, %edi
callq 0xa0000
jmp 0xaeab5
leaq 0x1ef7d0(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x70, %eax
jne 0xae97e
callq 0xa0440
jmp 0xaeab3
leaq 0x1ef7b7(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x72, %eax
jne 0xae997
callq 0xa0500
jmp 0xaeab1
leaq 0x1ef79e(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x74, %eax
jne 0xae9b0
callq 0xa0610
jmp 0xaeaaf
leaq 0x1ef785(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x75, %eax
jne 0xae9c9
callq 0xa0690
jmp 0xaeaad
leaq 0x1ef76c(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x76, %eax
jne 0xae9e2
callq 0xa06c0
jmp 0xaeaab
leaq 0x1ef753(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x78, %eax
jne 0xae9fb
callq 0xa06f0
jmp 0xaeaa9
leaq 0x1ef73a(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x82, %eax
jne 0xaea16
callq 0xa0720
jmp 0xaeaa7
leaq 0x1ef71f(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x83, %eax
jne 0xaea2e
callq 0xa0750
jmp 0xaeaa5
leaq 0x1ef707(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x84, %eax
jne 0xaea46
callq 0xa07c0
jmp 0xaeaa3
leaq 0x1ef6ef(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0x8f, %eax
jne 0xaea5e
callq 0xadd50
jmp 0xaeaa1
leaq 0x1ef6d7(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0xbb, %eax
jne 0xaea76
callq 0xa79e0
jmp 0xaea9f
leaq 0x1ef6bf(%rip), %rax    # 0x29e13c
movzwl (%rax), %eax
cmpl $0xdc, %eax
jne 0xaea8e
callq 0xaae70
jmp 0xaea9d
leaq 0x1ef6a7(%rip), %rax    # 0x29e13c
movzwl (%rax), %edi
callq 0xae060
jmp 0xaea9f
jmp 0xaeaa1
jmp 0xaeaa3
jmp 0xaeaa5
jmp 0xaeaa7
jmp 0xaeaa9
jmp 0xaeaab
jmp 0xaeaad
jmp 0xaeaaf
jmp 0xaeab1
jmp 0xaeab3
jmp 0xaeab5
jmp 0xaeab7
jmp 0xaeab9
jmp 0xaeabb
jmp 0xaeabd
jmp 0xaeabf
jmp 0xaeac1
jmp 0xaeac3
jmp 0xaeac5
jmp 0xaeac7
jmp 0xaeac9
jmp 0xaeacb
jmp 0xaeacd
jmp 0xaeacf
jmp 0xaead1
jmp 0xaead3
jmp 0xaead5
jmp 0xaead7
jmp 0xaead9
jmp 0xaeadb
jmp 0xaeadd
jmp 0xaeadf
jmp 0xaeae1
jmp 0xaeae3
jmp 0xaeae5
jmp 0xaeae7
jmp 0xaeae9
jmp 0xaeaeb
jmp 0xaeaed
jmp 0xaeaef
jmp 0xaeaf1
jmp 0xaeaf3
leaq 0x2be9c6(%rip), %rax    # 0x36d4c0
cmpb $0x0, 0x17a11(%rax)
je 0xaeb11
leaq 0x2be9b6(%rip), %rax    # 0x36d4c0
movb $0x0, 0x17a11(%rax)
leaq 0x1eea88(%rip), %rax    # 0x29d5a0
cmpq $0x0, (%rax)
je 0xaeb3c
leaq 0x1d3cbb(%rip), %rax    # 0x2827e0
cmpq $0x0, (%rax)
je 0xaeb3c
leaq 0x1d3cae(%rip), %rax    # 0x2827e0
movq (%rax), %rax
movl %eax, %edi
callq 0xb8b0
leaq 0x1ef63d(%rip), %rax    # 0x29e180
movl $0x1, (%rax)
popq %rbp
retq
nopl (%rax,%rax)