// File: /workspace/github_cpp_makefile_star2_O2/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 0x2f47f1(%rip), %eax    # 0x359fd0
cmpl 0x2f47ef(%rip), %eax    # 0x359fd4
jne 0x65801
movl 0x2f47ef(%rip), %eax    # 0x359fdc
testl %eax, %eax
js 0x6582f
cmpl $0x2, %eax
je 0x65852
cmpl $0x1, %eax
je 0x65844
testl %eax, %eax
je 0x65836
jmp 0x65877
pushq $0x2
popq %rdi
callq 0x7dfa9
cmpl $0x0, 0x2f05c0(%rip)    # 0x355dd0
je 0x658c5
andl $0x0, 0x2f05b3(%rip)    # 0x355dd0
leaq 0xa1a3e(%rip), %rdi     # 0x107262
movl $0x384, %esi            # imm = 0x384
popq %rbp
jmp 0x64f01
andl $0x0, 0x2f47a6(%rip)    # 0x359fdc
leaq 0xa1a25(%rip), %rdi     # 0x107262
movl $0x384, %esi            # imm = 0x384
jmp 0x6585e
leaq 0xa5e52(%rip), %rdi     # 0x10b69d
movl $0x387, %esi            # imm = 0x387
jmp 0x6585e
leaq 0xa8183(%rip), %rdi     # 0x10d9dc
movl $0x388, %esi            # imm = 0x388
callq 0x64f01
movl 0x2f4773(%rip), %eax    # 0x359fdc
leal 0x1(%rax), %ecx
movl %ecx, 0x2f476a(%rip)    # 0x359fdc
cmpl $0x2, %eax
jl 0x6589e
andl $0x0, 0x2f475e(%rip)    # 0x359fdc
movl 0x2f0544(%rip), %eax    # 0x355dc8
leal 0x1(%rax), %ecx
movl %ecx, 0x2f053b(%rip)    # 0x355dc8
testl %eax, %eax
jne 0x6589e
pushq $0x7
popq %rdi
movl $0x11f6, %esi           # imm = 0x11F6
callq 0x10a99
cmpl $0x0, 0x2f052b(%rip)    # 0x355dd0
je 0x658bf
andl $0x0, 0x2f0522(%rip)    # 0x355dd0
leaq 0xa19ad(%rip), %rdi     # 0x107262
movl $0x384, %esi            # imm = 0x384
callq 0x64f01
incl 0x2f471b(%rip)          # 0x359fe0
popq %rbp
retq