// File: /workspace/github_cpp_makefile_star2_O1/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 0x30072e(%rip), %eax    # 0x36ffd0
cmpl 0x30072c(%rip), %eax    # 0x36ffd4
jne 0x6f8f2
cmpl $0x0, 0x30072b(%rip)    # 0x36ffdc
jns 0x6f8bd
movl $0x0, 0x30071f(%rip)    # 0x36ffdc
pushq %rbp
movq %rsp, %rbp
movl 0x300715(%rip), %eax    # 0x36ffdc
cmpq $0x1a, %rax
ja 0x6fa9b
leaq 0xaf41c(%rip), %rcx     # 0x11ecf4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xad866(%rip), %rdi     # 0x11d14e
movl $0x320, %esi            # imm = 0x320
jmp 0x6fa96
movl $0x2, %edi
jmp 0x8ab04
leaq 0xb3e37(%rip), %rdi     # 0x12373a
movl $0x331, %esi            # imm = 0x331
jmp 0x6fa96
leaq 0xb3e23(%rip), %rdi     # 0x123737
movl $0x32f, %esi            # imm = 0x32F
jmp 0x6fa96
leaq 0xb3dfc(%rip), %rdi     # 0x123721
movl $0x32c, %esi            # imm = 0x32C
jmp 0x6fa96
leaq 0xb3dbc(%rip), %rdi     # 0x1236f2
movl $0x325, %esi            # imm = 0x325
jmp 0x6fa96
leaq 0xb3de0(%rip), %rdi     # 0x123727
movl $0x32d, %esi            # imm = 0x32D
jmp 0x6fa96
leaq 0xb3dbf(%rip), %rdi     # 0x123717
movl $0x32a, %esi            # imm = 0x32A
jmp 0x6fa96
leaq 0xb1d08(%rip), %rdi     # 0x121671
movl $0x33e, %esi            # imm = 0x33E
jmp 0x6fa96
leaq 0xb3de7(%rip), %rdi     # 0x123761
movl $0x341, %esi            # imm = 0x341
jmp 0x6fa96
leaq 0xae504(%rip), %rdi     # 0x11de8f
movl $0x322, %esi            # imm = 0x322
jmp 0x6fa96
leaq 0xae46d(%rip), %rdi     # 0x11de09
movl $0x330, %esi            # imm = 0x330
jmp 0x6fa96
leaq 0xb46b5(%rip), %rdi     # 0x124062
movl $0x324, %esi            # imm = 0x324
jmp 0x6fa96
leaq 0xb3d46(%rip), %rdi     # 0x123704
movl $0x328, %esi            # imm = 0x328
jmp 0x6fa96
leaq 0xb4a83(%rip), %rdi     # 0x124452
movl $0x321, %esi            # imm = 0x321
jmp 0x6fa96
leaq 0xb3d61(%rip), %rdi     # 0x123741
movl $0x332, %esi            # imm = 0x332
jmp 0x6fa96
leaq 0xb3d60(%rip), %rdi     # 0x123751
movl $0x345, %esi            # imm = 0x345
jmp 0x6fa96
leaq 0xb3cf4(%rip), %rdi     # 0x1236f6
movl $0x326, %esi            # imm = 0x326
jmp 0x6fa96
leaq 0xb3d42(%rip), %rdi     # 0x123755
movl $0x342, %esi            # imm = 0x342
jmp 0x6fa96
leaq 0xb3d0f(%rip), %rdi     # 0x123730
movl $0x32e, %esi            # imm = 0x32E
jmp 0x6fa96
leaq 0xb3ccb(%rip), %rdi     # 0x1236fa
movl $0x327, %esi            # imm = 0x327
jmp 0x6fa96
leaq 0xb3d0c(%rip), %rdi     # 0x123749
movl $0x346, %esi            # imm = 0x346
jmp 0x6fa96
leaq 0xb3cd0(%rip), %rdi     # 0x12371b
movl $0x32b, %esi            # imm = 0x32B
jmp 0x6fa96
leaq 0xb3cb5(%rip), %rdi     # 0x12370e
movl $0x329, %esi            # imm = 0x329
jmp 0x6fa96
leaq 0xb3cf2(%rip), %rdi     # 0x123759
movl $0x343, %esi            # imm = 0x343
jmp 0x6fa96
leaq 0xb3cd8(%rip), %rdi     # 0x12374d
movl $0x344, %esi            # imm = 0x344
jmp 0x6fa96
leaq 0xb3cda(%rip), %rdi     # 0x12375d
movl $0x340, %esi            # imm = 0x340
jmp 0x6fa96
leaq 0xb1be4(%rip), %rdi     # 0x121675
movl $0x33f, %esi            # imm = 0x33F
callq 0x6e3bc
movl 0x30053b(%rip), %eax    # 0x36ffdc
leal 0x1(%rax), %ecx
movl %ecx, 0x300532(%rip)    # 0x36ffdc
cmpl $0x16, %eax
jl 0x6fadb
movl $0x0, 0x300523(%rip)    # 0x36ffdc
movl 0x2fc309(%rip), %eax    # 0x36bdc8
leal 0x1(%rax), %ecx
movl %ecx, 0x2fc300(%rip)    # 0x36bdc8
testl %eax, %eax
jne 0x6fadb
movl $0x7, %edi
movl $0x11f6, %esi           # imm = 0x11F6
callq 0x1120f
incl 0x3004ff(%rip)          # 0x36ffe0
popq %rbp
retq