// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: poll_next_lpfrs()
void poll_next_lpfrs()
{
int test;

   // request an item from a LPFRS rubidium.  Requests are alternated between
   // a time message and some device parameter.  The parameter requests are 
   // alternated between one of three important parameters and then the lesser
   // important ones.

   test = 0;
   if(test && (polled_q_in != polled_q_out)) {  // we have a special message request queued
      send_queued_cmd(1);
      if(no_response_msg) {  // last message sends no response
         no_response_msg = 0;
         send_polled_cmd("M", LPFRS_M_MSG); 
      }
   }
   else if(1) { // request next misc message every time
      if((test == 0) && (polled_q_in != polled_q_out)) {  // we have a special message request queued
         send_queued_cmd(2);
         if(no_response_msg) {  // last message sends no response
            no_response_msg = 0;
            send_polled_cmd("M", LPFRS_M_MSG); 
         }
      }
      else {  // poll standard messages 
      if(polled_req < 0) polled_req = 0;
         if     (polled_req == 0) send_polled_cmd("M",   LPFRS_M_MSG); 
         else if(polled_req == 1) send_polled_cmd("L06", LPFRS_C_READ_MSG); 
         else if(polled_req == 2) send_polled_cmd("L0A", LPFRS_F_READ_MSG); 
//       else if(polled_req == 3) send_polled_cmd("V",   LPFRS_ID_MSG);  // takes too long a time to send

         if(++polled_req > 2) {
            polled_req = 0;
            ++all_polled;
            if(all_polled == 1) {  // reset the queues the first time through
               new_queue(RESET_ALL_QUEUES, 4598);
            }
         }

         if(no_response_msg) {  // last message sends no response
            no_response_msg = 0;
            send_polled_cmd("M", LPFRS_M_MSG); 
         }
         ++polled_seq;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x301273(%rip), %eax    # 0x36ffd0
cmpl 0x301271(%rip), %eax    # 0x36ffd4
jne 0x6ed9a
cmpl $0x0, 0x301270(%rip)    # 0x36ffdc
jns 0x6ed78
movl $0x0, 0x301264(%rip)    # 0x36ffdc
movl 0x30125e(%rip), %eax    # 0x36ffdc
cmpl $0x2, %eax
je 0x6eddb
cmpl $0x1, %eax
je 0x6edcd
testl %eax, %eax
jne 0x6edec
leaq 0xae3bb(%rip), %rdi     # 0x11d14e
movl $0x384, %esi            # imm = 0x384
jmp 0x6ede7
movl $0x2, %edi
callq 0x8ab04
cmpl $0x0, 0x2fd025(%rip)    # 0x36bdd0
je 0x6ee56
movl $0x0, 0x2fd015(%rip)    # 0x36bdd0
leaq 0xae38c(%rip), %rdi     # 0x11d14e
movl $0x384, %esi            # imm = 0x384
popq %rbp
jmp 0x6e3bc
leaq 0xb28a1(%rip), %rdi     # 0x121675
movl $0x387, %esi            # imm = 0x387
jmp 0x6ede7
leaq 0xb4bd2(%rip), %rdi     # 0x1239b4
movl $0x388, %esi            # imm = 0x388
callq 0x6e3bc
movl 0x3011ea(%rip), %eax    # 0x36ffdc
leal 0x1(%rax), %ecx
movl %ecx, 0x3011e1(%rip)    # 0x36ffdc
cmpl $0x2, %eax
jl 0x6ee2c
movl $0x0, 0x3011d2(%rip)    # 0x36ffdc
movl 0x2fcfb8(%rip), %eax    # 0x36bdc8
leal 0x1(%rax), %ecx
movl %ecx, 0x2fcfaf(%rip)    # 0x36bdc8
testl %eax, %eax
jne 0x6ee2c
movl $0x7, %edi
movl $0x11f6, %esi           # imm = 0x11F6
callq 0x1120f
cmpl $0x0, 0x2fcf9d(%rip)    # 0x36bdd0
je 0x6ee50
movl $0x0, 0x2fcf91(%rip)    # 0x36bdd0
leaq 0xae308(%rip), %rdi     # 0x11d14e
movl $0x384, %esi            # imm = 0x384
callq 0x6e3bc
incl 0x30118a(%rip)          # 0x36ffe0
popq %rbp
retq