// File: /workspace/github_cpp_makefile_star2_O3/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 0x3012f5(%rip), %eax    # 0x36ffd0
cmpl 0x3012f3(%rip), %eax    # 0x36ffd4
jne 0x6ecfd
movl 0x3012f3(%rip), %eax    # 0x36ffdc
testl %eax, %eax
js 0x6ed30
cmpl $0x2, %eax
je 0x6ed56
cmpl $0x1, %eax
je 0x6ed48
testl %eax, %eax
je 0x6ed3a
jmp 0x6ed7b
movl $0x2, %edi
callq 0x8aadd
cmpl $0x0, 0x2fd0c2(%rip)    # 0x36bdd0
je 0x6edd1
movl $0x0, 0x2fd0b2(%rip)    # 0x36bdd0
leaq 0xae4bd(%rip), %rdi     # 0x11d1e2
movl $0x384, %esi            # imm = 0x384
popq %rbp
jmp 0x6e2d1
movl $0x0, 0x3012a2(%rip)    # 0x36ffdc
leaq 0xae4a1(%rip), %rdi     # 0x11d1e2
movl $0x384, %esi            # imm = 0x384
jmp 0x6ed62
leaq 0xb2a06(%rip), %rdi     # 0x121755
movl $0x387, %esi            # imm = 0x387
jmp 0x6ed62
leaq 0xb4d37(%rip), %rdi     # 0x123a94
movl $0x388, %esi            # imm = 0x388
callq 0x6e2d1
movl 0x30126f(%rip), %eax    # 0x36ffdc
leal 0x1(%rax), %ecx
movl %ecx, 0x301266(%rip)    # 0x36ffdc
cmpl $0x2, %eax
jl 0x6eda7
movl $0x0, 0x301257(%rip)    # 0x36ffdc
movl 0x2fd03d(%rip), %eax    # 0x36bdc8
leal 0x1(%rax), %ecx
movl %ecx, 0x2fd034(%rip)    # 0x36bdc8
testl %eax, %eax
jne 0x6eda7
movl $0x7, %edi
movl $0x11f6, %esi           # imm = 0x11F6
callq 0x1118c
cmpl $0x0, 0x2fd022(%rip)    # 0x36bdd0
je 0x6edcb
movl $0x0, 0x2fd016(%rip)    # 0x36bdd0
leaq 0xae421(%rip), %rdi     # 0x11d1e2
movl $0x384, %esi            # imm = 0x384
callq 0x6e2d1
incl 0x30120f(%rip)          # 0x36ffe0
popq %rbp
retq