// File: /workspace/github_cpp_makefile_star2_O3/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 0x3007bf(%rip), %eax    # 0x36ffd0
cmpl 0x3007bd(%rip), %eax    # 0x36ffd4
jne 0x6f84c
pushq %rbp
movq %rsp, %rbp
movl 0x3007b9(%rip), %eax    # 0x36ffdc
testl %eax, %eax
js 0x6f856
cmpl $0x1a, %eax
ja 0x6f885
movl %eax, %eax
leaq 0xaf57f(%rip), %rcx     # 0x11edb4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xb4ced(%rip), %rdi     # 0x124532
movl $0x321, %esi            # imm = 0x321
jmp 0x6f86c
movl $0x2, %edi
jmp 0x8aadd
movl $0x0, 0x30077c(%rip)    # 0x36ffdc
leaq 0xad97b(%rip), %rdi     # 0x11d1e2
movl $0x320, %esi            # imm = 0x320
callq 0x6e2d1
movl 0x300765(%rip), %eax    # 0x36ffdc
leal 0x1(%rax), %ecx
movl %ecx, 0x30075c(%rip)    # 0x36ffdc
cmpl $0x16, %eax
jl 0x6f8b1
movl $0x0, 0x30074d(%rip)    # 0x36ffdc
movl 0x2fc533(%rip), %eax    # 0x36bdc8
leal 0x1(%rax), %ecx
movl %ecx, 0x2fc52a(%rip)    # 0x36bdc8
testl %eax, %eax
jne 0x6f8b1
movl $0x7, %edi
movl $0x11f6, %esi           # imm = 0x11F6
callq 0x1118c
incl 0x300729(%rip)          # 0x36ffe0
popq %rbp
retq
leaq 0xb3f5a(%rip), %rdi     # 0x12381a
movl $0x331, %esi            # imm = 0x331
jmp 0x6f86c
leaq 0xb3f49(%rip), %rdi     # 0x123817
movl $0x32f, %esi            # imm = 0x32F
jmp 0x6f86c
leaq 0xb3f25(%rip), %rdi     # 0x123801
movl $0x32c, %esi            # imm = 0x32C
jmp 0x6f86c
leaq 0xb3ee8(%rip), %rdi     # 0x1237d2
movl $0x325, %esi            # imm = 0x325
jmp 0x6f86c
leaq 0xb3f0c(%rip), %rdi     # 0x123807
movl $0x32d, %esi            # imm = 0x32D
jmp 0x6f86c
leaq 0xb3eeb(%rip), %rdi     # 0x1237f7
movl $0x32a, %esi            # imm = 0x32A
jmp 0x6f86c
leaq 0xb1e34(%rip), %rdi     # 0x121751
movl $0x33e, %esi            # imm = 0x33E
jmp 0x6f86c
leaq 0xb3f13(%rip), %rdi     # 0x123841
movl $0x341, %esi            # imm = 0x341
jmp 0x6f86c
leaq 0xae5e4(%rip), %rdi     # 0x11df23
movl $0x322, %esi            # imm = 0x322
jmp 0x6f86c
leaq 0xae54d(%rip), %rdi     # 0x11de9d
movl $0x330, %esi            # imm = 0x330
jmp 0x6f86c
leaq 0xb47e1(%rip), %rdi     # 0x124142
movl $0x324, %esi            # imm = 0x324
jmp 0x6f86c
leaq 0xb3e72(%rip), %rdi     # 0x1237e4
movl $0x328, %esi            # imm = 0x328
jmp 0x6f86c
leaq 0xb3e9e(%rip), %rdi     # 0x123821
movl $0x332, %esi            # imm = 0x332
jmp 0x6f86c
leaq 0xb3e9d(%rip), %rdi     # 0x123831
movl $0x345, %esi            # imm = 0x345
jmp 0x6f86c
leaq 0xb3e31(%rip), %rdi     # 0x1237d6
movl $0x326, %esi            # imm = 0x326
jmp 0x6f86c
leaq 0xb3e7f(%rip), %rdi     # 0x123835
movl $0x342, %esi            # imm = 0x342
jmp 0x6f86c
leaq 0xb3e49(%rip), %rdi     # 0x123810
movl $0x32e, %esi            # imm = 0x32E
jmp 0x6f86c
leaq 0xb3e02(%rip), %rdi     # 0x1237da
movl $0x327, %esi            # imm = 0x327
jmp 0x6f86c
leaq 0xb3e40(%rip), %rdi     # 0x123829
movl $0x346, %esi            # imm = 0x346
jmp 0x6f86c
leaq 0xb3e01(%rip), %rdi     # 0x1237fb
movl $0x32b, %esi            # imm = 0x32B
jmp 0x6f86c
leaq 0xb3de3(%rip), %rdi     # 0x1237ee
movl $0x329, %esi            # imm = 0x329
jmp 0x6f86c
leaq 0xb3e1d(%rip), %rdi     # 0x123839
movl $0x343, %esi            # imm = 0x343
jmp 0x6f86c
leaq 0xb3e00(%rip), %rdi     # 0x12382d
movl $0x344, %esi            # imm = 0x344
jmp 0x6f86c
leaq 0xb3dff(%rip), %rdi     # 0x12383d
movl $0x340, %esi            # imm = 0x340
jmp 0x6f86c
leaq 0xb1d06(%rip), %rdi     # 0x121755
movl $0x33f, %esi            # imm = 0x33F
jmp 0x6f86c