// File: /workspace/github_cpp_makefile_star2_O3/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 0x2967db(%rip), %rax    # 0x30d420
cmpl $0x0, (%rax)
je 0x76c60
xorl %ecx, %ecx
movl %ecx, (%rax)
leaq 0x2967b3(%rip), %rax    # 0x30d408
movl %ecx, (%rax)
leaq 0x1c828a(%rip), %rax    # 0x23eee8
movl %ecx, (%rax)
leaq 0x1a1c69(%rip), %rax    # 0x2188d0
movq (%rax), %rcx
movabsq $0x101b0e5018, %rax     # imm = 0x101B0E5018
testq %rax, %rcx
je 0x76c7a
retq
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x1c8260(%rip), %rbx    # 0x23eee8
movl (%rbx), %eax
leal 0x1(%rax), %edx
movl %edx, (%rbx)
cmpq $0xb, %rax
ja 0x76d1d
leaq 0xa8244(%rip), %rcx     # 0x11eee4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x65c0d
jmp 0x76d5d
callq 0x69c96
jmp 0x76d5d
callq 0x6ab01
jmp 0x76d5d
callq 0x6a96b
jmp 0x76d5d
callq 0x6d209
jmp 0x76d5d
callq 0x6c169
jmp 0x76d5d
leaq 0x1c772c(%rip), %rax    # 0x23e415
cmpb $0x0, (%rax)
jne 0x76d5d
callq 0x66646
jmp 0x76d5d
movl $0x2, %edi
callq 0x667f2
jmp 0x76d5d
callq 0x7135e
jmp 0x76d5d
callq 0x6649d
jmp 0x76d5d
callq 0x611cf
jmp 0x76d5d
callq 0x689df
jmp 0x76d5d
cmpq $0x1, %rcx
jne 0x76d57
leaq 0x1a42aa(%rip), %rcx    # 0x21afd4
movl (%rcx), %ecx
leal -0x33(%rcx), %edx
cmpl $0x1d, %edx
ja 0x76d7f
movl $0x20004009, %esi       # imm = 0x20004009
btl %edx, %esi
jae 0x76d7f
cmpl $0x41, %ecx
jne 0x76d4f
leaq 0x1a1bae(%rip), %rdx    # 0x2188f8
cmpl $0x47, (%rdx)
je 0x76d7f
cmpl $0x41, %ecx
je 0x76d7f
cmpl $0x50, %ecx
movl $0x0, (%rbx)
leaq 0x1c8188(%rip), %rax    # 0x23eeec
movl (%rax), %ecx
leal 0x1(%rcx), %edx
cmpl $0x20, %ecx
movl $0x1, %edi
cmovll %edx, %edi
movl %edi, (%rax)
popq %rbx
popq %r14
popq %rbp
jmp 0x699e2
addl $-0xc, %eax
cmpl $0x7, %eax
ja 0x76dd1
leaq 0xa8186(%rip), %rcx     # 0x11ef14
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x7097b
jmp 0x76d5d
callq 0x666c6
jmp 0x76d5d
callq 0x6cdf3
jmp 0x76d5d
xorl %edi, %edi
callq 0x699e2
jmp 0x76d5d
callq 0x68857
jmp 0x76d5d
callq 0x69a2d
jmp 0x76d5d
callq 0x687a7
jmp 0x76d5d
callq 0x6dcbf
jmp 0x76d5d
leaq 0x1a41f0(%rip), %rax    # 0x21afc8
cmpl $0x0, (%rax)
je 0x76d57
leaq 0x2974f8(%rip), %r14    # 0x30e2e0
cmpl $0x0, 0x17a18(%r14)
jne 0x76d57
leaq 0x29660b(%rip), %rax    # 0x30d408
movl (%rax), %eax
cmpl $0xc, %eax
je 0x76e0c
testl %eax, %eax
jne 0x76d57
movl $0x1f7, %edi            # imm = 0x1F7
callq 0x9d78
movl 0x159dc(%r14), %eax
movl %eax, %ecx
incl %ecx
movslq %ecx, %rcx
imulq $0x55555556, %rcx, %rcx # imm = 0x55555556
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x20, %rcx
addl %edx, %ecx
leal (%rcx,%rcx,2), %ecx
negl %ecx
addl %ecx, %eax
incl %eax
movl %eax, 0x159dc(%r14)
movl $0xa, %edi
movl $0x6a, %esi
callq 0xb49e
leaq 0x1a19e6(%rip), %rax    # 0x218844
movl $0x7dd, (%rax)          # imm = 0x7DD
jmp 0x76d57