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

   // request an item from a SRO100 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);
   }
   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);
      }
      else {  // poll standard messages 
      if(polled_req < 0) polled_req = 0;

         if(0 && prs_poll_tick) {
            if(prs_poll_tick == 1) {       // get FC value every two seconds
               send_polled_cmd("FC?", PRS_FC_MSG);
               ++prs_poll_tick;
            }
            else if(prs_poll_tick == 2) {  // get TT value every two seconds
               send_polled_cmd("TT?", PRS_TT_MSG);
               ++prs_poll_tick;
            }
            else {  // get case temperature value every two seconds
               send_polled_cmd("AD10?", PRS_AD10_MSG);
               prs_poll_tick = 0;
            }
         }
         else {
            if     (polled_req == 0)   send_polled_cmd("M",         SRO_M_MSG); 
            else if(polled_req == 1)   send_polled_cmd("ID",        SRO_ID_MSG); 
            else if(polled_req == 2)   send_polled_cmd("SN",        SRO_SN_MSG); 
            else if(polled_req == 3)   send_polled_cmd("ST",        SRO_ST_MSG); 
            else if(polled_req == 4)   send_polled_cmd("TR?",       SRO_TR_MSG); 
            else if(polled_req == 5)   send_polled_cmd("SY?",       SRO_SY_MSG); 
            else if(polled_req == 6)   send_polled_cmd("DE???????", SRO_DE_MSG); 
            else if(polled_req == 7)   send_polled_cmd("PW???????", SRO_PW_MSG); 
            else if(polled_req == 8)   send_polled_cmd("FC??????",  SRO_FC_MSG); 
            else if(polled_req == 9)   send_polled_cmd("FS?",       SRO_FS_MSG); 
            else if(polled_req == 10)  send_polled_cmd("TW???",     SRO_TW_MSG); 
            else if(polled_req == 11)  send_polled_cmd("AW???",     SRO_AW_MSG); 
            else if(polled_req == 12)  send_polled_cmd("TC??????",  SRO_TC_MSG); 
            else if(polled_req == 13)  send_polled_cmd("CO????",    SRO_CO_MSG); 
            else if(polled_req == 14)  send_polled_cmd("VS",        SRO_VS_MSG); 
            else if(polled_req == 15)  send_polled_cmd("VT",        SRO_VT_MSG); 
            else if(polled_req == 16)  send_polled_cmd("RA????",    SRO_RA_MSG); 
            else if(polled_req == 17)  send_polled_cmd("GF?????",   SRO_GF_MSG); 
            else if(polled_req == 18)  send_polled_cmd("R4F",       SRO_R4F_MSG); 
            else if(polled_req == 19)  send_polled_cmd("R48",       SRO_R48_MSG); 
            else if(polled_req == 20)  send_polled_cmd("R49",       SRO_R49_MSG); 

            else if(polled_req == 21)  send_polled_cmd("R14",       SRO_R14_MSG); 
            else if(polled_req == 22)  send_polled_cmd("R15",       SRO_R15_MSG); 
            else if(polled_req == 23)  send_polled_cmd("R05",       SRO_R05_MSG); 
            else if(polled_req == 24)  send_polled_cmd("R06",       SRO_R06_MSG); 
            else if(polled_req == 25)  send_polled_cmd("L05",       SRO_L05_MSG); 
            else if(polled_req == 26)  send_polled_cmd("L06",       SRO_L06_MSG); 

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

// Assembly:
movl 0x2f3d7b(%rip), %eax    # 0x359fd0
cmpl 0x2f3d79(%rip), %eax    # 0x359fd4
jne 0x66290
pushq %rbp
movq %rsp, %rbp
movl 0x2f3d75(%rip), %eax    # 0x359fdc
testl %eax, %eax
js 0x66298
cmpl $0x1a, %eax
ja 0x662c4
movl %eax, %eax
leaq 0xa2a7b(%rip), %rcx     # 0x108cf4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xa81f1(%rip), %rdi     # 0x10e47a
movl $0x321, %esi            # imm = 0x321
jmp 0x662ab
pushq $0x2
popq %rdi
jmp 0x7dfa9
andl $0x0, 0x2f3d3d(%rip)    # 0x359fdc
leaq 0xa0fbc(%rip), %rdi     # 0x107262
movl $0x320, %esi            # imm = 0x320
callq 0x64f01
movl 0x2f3d26(%rip), %eax    # 0x359fdc
leal 0x1(%rax), %ecx
movl %ecx, 0x2f3d1d(%rip)    # 0x359fdc
cmpl $0x16, %eax
jl 0x662eb
andl $0x0, 0x2f3d11(%rip)    # 0x359fdc
movl 0x2efaf7(%rip), %eax    # 0x355dc8
leal 0x1(%rax), %ecx
movl %ecx, 0x2efaee(%rip)    # 0x355dc8
testl %eax, %eax
jne 0x662eb
pushq $0x7
popq %rdi
movl $0x11f6, %esi           # imm = 0x11F6
callq 0x10a99
incl 0x2f3cef(%rip)          # 0x359fe0
popq %rbp
retq
leaq 0xa7468(%rip), %rdi     # 0x10d762
movl $0x331, %esi            # imm = 0x331
jmp 0x662ab
leaq 0xa7457(%rip), %rdi     # 0x10d75f
movl $0x32f, %esi            # imm = 0x32F
jmp 0x662ab
leaq 0xa7433(%rip), %rdi     # 0x10d749
movl $0x32c, %esi            # imm = 0x32C
jmp 0x662ab
leaq 0xa73f6(%rip), %rdi     # 0x10d71a
movl $0x325, %esi            # imm = 0x325
jmp 0x662ab
leaq 0xa741d(%rip), %rdi     # 0x10d74f
movl $0x32d, %esi            # imm = 0x32D
jmp 0x662ab
leaq 0xa73fc(%rip), %rdi     # 0x10d73f
movl $0x32a, %esi            # imm = 0x32A
jmp 0x662ab
leaq 0xa5345(%rip), %rdi     # 0x10b699
movl $0x33e, %esi            # imm = 0x33E
jmp 0x662ab
leaq 0xa7424(%rip), %rdi     # 0x10d789
movl $0x341, %esi            # imm = 0x341
jmp 0x662ab
leaq 0xa1c28(%rip), %rdi     # 0x107f9e
movl $0x322, %esi            # imm = 0x322
jmp 0x662ab
leaq 0xa1b96(%rip), %rdi     # 0x107f1d
movl $0x330, %esi            # imm = 0x330
jmp 0x662ab
leaq 0xa7cf2(%rip), %rdi     # 0x10e08a
movl $0x324, %esi            # imm = 0x324
jmp 0x662ab
leaq 0xa7383(%rip), %rdi     # 0x10d72c
movl $0x328, %esi            # imm = 0x328
jmp 0x662ab
leaq 0xa73af(%rip), %rdi     # 0x10d769
movl $0x332, %esi            # imm = 0x332
jmp 0x662ab
leaq 0xa73ae(%rip), %rdi     # 0x10d779
movl $0x345, %esi            # imm = 0x345
jmp 0x662ab
leaq 0xa7342(%rip), %rdi     # 0x10d71e
movl $0x326, %esi            # imm = 0x326
jmp 0x662ab
leaq 0xa7390(%rip), %rdi     # 0x10d77d
movl $0x342, %esi            # imm = 0x342
jmp 0x662ab
leaq 0xa735a(%rip), %rdi     # 0x10d758
movl $0x32e, %esi            # imm = 0x32E
jmp 0x662ab
leaq 0xa7313(%rip), %rdi     # 0x10d722
movl $0x327, %esi            # imm = 0x327
jmp 0x662ab
leaq 0xa7351(%rip), %rdi     # 0x10d771
movl $0x346, %esi            # imm = 0x346
jmp 0x662ab
leaq 0xa7312(%rip), %rdi     # 0x10d743
movl $0x32b, %esi            # imm = 0x32B
jmp 0x662ab
leaq 0xa72f4(%rip), %rdi     # 0x10d736
movl $0x329, %esi            # imm = 0x329
jmp 0x662ab
leaq 0xa732e(%rip), %rdi     # 0x10d781
movl $0x343, %esi            # imm = 0x343
jmp 0x662ab
leaq 0xa7311(%rip), %rdi     # 0x10d775
movl $0x344, %esi            # imm = 0x344
jmp 0x662ab
leaq 0xa7310(%rip), %rdi     # 0x10d785
movl $0x340, %esi            # imm = 0x340
jmp 0x662ab
leaq 0xa5217(%rip), %rdi     # 0x10b69d
movl $0x33f, %esi            # imm = 0x33F
jmp 0x662ab