// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: request_misc_msg()
void request_misc_msg()
{
   // This routine requests various minor status messages
   // It requests a different message each time it is called.

   if(first_request) {
////  request_rcvr_info(200);
      first_request = 0;
      saw_version = 0;
      req_num = 0;
   }

   if(POLLED_RCVR) { // these receivers have their own message polling routines
      return;
   }

   ++req_num;
   if     (req_num ==  1) request_version();
   else if(req_num ==  2) request_rcvr_config(2); 
   else if(req_num ==  3) request_timing_mode();
   else if(req_num ==  4) request_pps_mode();
   else if(req_num ==  5) request_pps_info();
   else if(req_num ==  6) request_survey_params();
   else if(req_num ==  7) request_sat_list();
   else if(req_num ==  8) {
      if(log_db == 0) request_sig_levels();
   }
   else if(req_num ==  9) request_sat_health(); 
   else if(req_num == 10) request_datum(); 
   else if(req_num == 11) request_utc_info();  // this message can hose up some res_t receivers
   else if(req_num == 12) request_filter_config();    // tsip only
else if(SV6_FAMILY && !ACU_GG && !ACU_360 && !ACUTIME && !PALISADE) req_num = 0;
else if(ACE3) req_num = 0;
else if(PALISADE) req_num = 0;
//   else if((rcvr_type == TSIP_RCVR) && !SV6 && !ACE3 && !PALISADE) {
   else if(rcvr_type == TSIP_RCVR) {
      if     (req_num == 13) request_all_dis_params();   // tsip only
      else if(req_num == 14) request_eeprom_status();    // tsip only
      else if(req_num == 15) request_dac_voltage();      // tsip only
      else if(req_num == 16) request_sat_status(0x00);   // tsip only
      else if(req_num == 17) request_alm_health();       // tsip only
      else if(req_num == 18) request_io_options();       // tsip only
      else if(req_num == 19) request_packet_mask();      // tsip only
      else if(req_num == 20) request_last_posn();        // tsip only
//    else if(saw_version == 0) {   // no response to version message requests
//    else if((com[RCVR_PORT].user_set_baud == 0) && ((have_info & VERSION_INFO) == 0) || ((have_info & PRODN_PARAMS) == 0) && ((have_info & MANUF_PARAMS) == 0)) {   // no response to version message requests
      else if(detect_rcvr_type && (com[RCVR_PORT].user_set_baud == 0) && ((saw_version == 0) || (saw_version == 0x0C))) {   // no response to version message requests
//sprintf(plot_title, "rnum:%d  saw_v:%d  new parity:%d", req_num, saw_version, com[RCVR_PORT].parity);
BEEP(503);
         com[RCVR_PORT].parity = (com[RCVR_PORT].parity+1) % 3;   // try different parity
         init_com(RCVR_PORT, 106);
         need_redraw = 2013; // ggggg
         req_num = 0;
      }
      else req_num = 0;
   }
   else req_num = 0;

   #ifdef SAT_TRAILS
      // here we try to get position info for untracked sats,  but tbolts
      // don't seem to want to give up the goods on untracked sats... but
      // we ask anyway
      if(++status_prn > 32) status_prn = 1; // !!!! max_sat_check
      request_sat_status(status_prn);
   #endif
}

// Assembly:
leaq 0x28ab72(%rip), %rax    # 0x2f7420
cmpl $0x0, (%rax)
je 0x6c8ca
andl $0x0, (%rax)
leaq 0x28ab4b(%rip), %rax    # 0x2f7408
andl $0x0, (%rax)
leaq 0x1bc621(%rip), %rax    # 0x228ee8
andl $0x0, (%rax)
leaq 0x195fff(%rip), %rax    # 0x2028d0
movq (%rax), %rcx
movabsq $0x101b0e5018, %rax     # imm = 0x101B0E5018
testq %rax, %rcx
je 0x6c8e4
retq
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x1bc5f6(%rip), %rbx    # 0x228ee8
movl (%rbx), %eax
leal 0x1(%rax), %edx
movl %edx, (%rbx)
cmpq $0xb, %rax
ja 0x6c97e
leaq 0x9c522(%rip), %rcx     # 0x108e28
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x5d7c2
jmp 0x6c9bb
callq 0x60f41
jmp 0x6c9bb
callq 0x61bf1
jmp 0x6c9bb
callq 0x61a66
jmp 0x6c9bb
callq 0x63fdb
jmp 0x6c9bb
callq 0x63061
jmp 0x6c9bb
leaq 0x1bbac9(%rip), %rax    # 0x228415
cmpb $0x0, (%rax)
jne 0x6c9bb
callq 0x5dffd
jmp 0x6c9bb
pushq $0x2
popq %rdi
callq 0x5e18e
jmp 0x6c9bb
callq 0x67b43
jmp 0x6c9bb
callq 0x5de9d
jmp 0x6c9bb
callq 0x5960c
jmp 0x6c9bb
callq 0x5fe46
jmp 0x6c9bb
cmpq $0x1, %rcx
jne 0x6c9b8
leaq 0x198649(%rip), %rcx    # 0x204fd4
movl (%rcx), %ecx
leal -0x33(%rcx), %edx
cmpl $0x1d, %edx
ja 0x6c9db
movl $0x20004009, %esi       # imm = 0x20004009
btl %edx, %esi
jae 0x6c9db
cmpl $0x41, %ecx
jne 0x6c9b0
leaq 0x195f4d(%rip), %rdx    # 0x2028f8
cmpl $0x47, (%rdx)
je 0x6c9db
cmpl $0x41, %ecx
je 0x6c9db
cmpl $0x50, %ecx
andl $0x0, (%rbx)
leaq 0x1bc52a(%rip), %rax    # 0x228eec
movl (%rax), %ecx
leal 0x1(%rcx), %edx
cmpl $0x20, %ecx
pushq $0x1
popq %rdi
cmovll %edx, %edi
movl %edi, (%rax)
popq %rbx
popq %r14
popq %rbp
jmp 0x60ca1
addl $-0xc, %eax
cmpl $0x7, %eax
ja 0x6ca2d
leaq 0x9c46e(%rip), %rcx     # 0x108e58
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x671af
jmp 0x6c9bb
callq 0x5e066
jmp 0x6c9bb
callq 0x63c2c
jmp 0x6c9bb
xorl %edi, %edi
callq 0x60ca1
jmp 0x6c9bb
callq 0x5fcca
jmp 0x6c9bb
callq 0x60cea
jmp 0x6c9bb
callq 0x5fc1e
jmp 0x6c9bb
callq 0x64991
jmp 0x6c9bb
leaq 0x198594(%rip), %rax    # 0x204fc8
cmpl $0x0, (%rax)
je 0x6c9b8
leaq 0x28b89c(%rip), %r14    # 0x2f82e0
cmpl $0x0, 0x17a18(%r14)
jne 0x6c9b8
leaq 0x28a9af(%rip), %rax    # 0x2f7408
movl (%rax), %eax
cmpl $0xc, %eax
je 0x6ca68
testl %eax, %eax
jne 0x6c9b8
movl $0x1f7, %edi            # imm = 0x1F7
callq 0x9d23
movl 0x159dc(%r14), %eax
incl %eax
pushq $0x3
popq %rcx
cltd
idivl %ecx
movl %edx, 0x159dc(%r14)
pushq $0xa
popq %rdi
pushq $0x6a
popq %rsi
callq 0xb30a
leaq 0x195daa(%rip), %rax    # 0x202844
movl $0x7dd, (%rax)          # imm = 0x7DD
jmp 0x6c9b8