// File: /workspace/github_cpp_makefile_star2_O1/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 0x29665c(%rip), %rax    # 0x30d420
cmpl $0x0, (%rax)
je 0x76ddf
xorl %ecx, %ecx
movl %ecx, (%rax)
leaq 0x296634(%rip), %rax    # 0x30d408
movl %ecx, (%rax)
leaq 0x1c810b(%rip), %rax    # 0x23eee8
movl %ecx, (%rax)
leaq 0x1a1aea(%rip), %rax    # 0x2188d0
movq (%rax), %rcx
movabsq $0x101b0e5018, %rax     # imm = 0x101B0E5018
testq %rax, %rcx
je 0x76df9
retq
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x1c80e1(%rip), %rbx    # 0x23eee8
movl (%rbx), %eax
leal 0x1(%rax), %edx
movl %edx, (%rbx)
cmpq $0xb, %rax
ja 0x76eb5
leaq 0xa8005(%rip), %rcx     # 0x11ee24
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x659e2
jmp 0x76f6f
callq 0x69afd
jmp 0x76f6f
callq 0x6a9e7
jmp 0x76f6f
callq 0x6a80b
jmp 0x76f6f
callq 0x6d32a
jmp 0x76f6f
callq 0x6c01e
jmp 0x76f6f
leaq 0x1c75aa(%rip), %rax    # 0x23e415
cmpb $0x0, (%rax)
jne 0x76f6f
callq 0x66423
jmp 0x76f6f
movl $0x2, %edi
callq 0x66617
jmp 0x76f6f
callq 0x712d5
jmp 0x76f6f
callq 0x6627a
jmp 0x76f6f
callq 0x61223
jmp 0x76f6f
callq 0x6879a
jmp 0x76f6f
cmpq $0x1, %rcx
jne 0x76ef0
leaq 0x1a4112(%rip), %rdx    # 0x21afd4
movl (%rdx), %edx
leal -0x33(%rdx), %esi
cmpl $0x1d, %esi
ja 0x76ef0
movl $0x20004009, %edi       # imm = 0x20004009
btl %esi, %edi
jae 0x76ef0
movl %edx, %edi
xorl $0x41, %edi
leaq 0x1a1a16(%rip), %rsi    # 0x2188f8
movl (%rsi), %esi
movl %esi, %r8d
xorl $0x47, %r8d
orl %edi, %r8d
jne 0x76f50
cmpq $0x1, %rcx
sete %sil
leaq 0x1a40d5(%rip), %rdx    # 0x21afd4
movl (%rdx), %edx
cmpl $0x33, %edx
sete %dil
andb %sil, %dil
cmpb $0x1, %dil
je 0x76f69
cmpq $0x1, %rcx
sete %sil
cmpl $0x50, %edx
sete %dl
andb %sil, %dl
cmpb $0x1, %dl
je 0x76f69
cmpq $0x1, %rcx
jne 0x76f69
addl $-0xc, %eax
cmpl $0x7, %eax
ja 0x76fc4
leaq 0xa7f14(%rip), %rcx     # 0x11ee54
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x708b3
jmp 0x76f6f
cmpl $0x41, %edx
jne 0x76f5f
cmpl $0x33, %esi
je 0x76ef0
cmpl $0x47, %esi
je 0x76ef0
cmpl $0x41, %edx
je 0x76ef0
cmpl $0x50, %edx
je 0x76ef0
movl $0x0, (%rbx)
leaq 0x1c7f76(%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 0x69815
callq 0x664a3
jmp 0x76f6f
callq 0x6ce25
jmp 0x76f6f
xorl %edi, %edi
callq 0x69815
jmp 0x76f6f
callq 0x685ca
jmp 0x76f6f
callq 0x69860
jmp 0x76f6f
callq 0x6851a
jmp 0x76f6f
callq 0x6ddc2
jmp 0x76f6f
leaq 0x1a3ffd(%rip), %rax    # 0x21afc8
cmpl $0x0, (%rax)
je 0x76f69
leaq 0x297309(%rip), %r14    # 0x30e2e0
cmpl $0x0, 0x17a18(%r14)
jne 0x76f69
leaq 0x296420(%rip), %rax    # 0x30d408
movl (%rax), %eax
cmpl $0xc, %eax
je 0x76ff7
testl %eax, %eax
jne 0x76f69
movl $0x1f7, %edi            # imm = 0x1F7
callq 0x9d80
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 0xb49f
leaq 0x1a17fb(%rip), %rax    # 0x218844
movl $0x7dd, (%rax)          # imm = 0x7DD
jmp 0x76f69