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

   // request an item from a UCCM receiver.  Requests are alternated between
   // a time message and some receiver parameter.  The parameter requests are 
   // alternated between one of three important parameters and then the lesser
   // important ones.

   test = 0;
   if((test == 0) && (polled_q_in != polled_q_out)) {  // we have a special message request queued
      send_queued_cmd(1);
   }
   else {
      if(polled_req < 0) polled_req = 0;

      if(     (polled_seq % 10) == 0) send_polled_cmd("DIAG:LOOP?",       UCCM_LOOP_MSG);
///   if(     (polled_seq % 10) == 0) send_polled_cmd("SYNC:TINT?",       SCPI_TINT_MSG);
//    else if((polled_seq % 10) == 1) send_polled_cmd("DIAG:LOOP?",       UCCM_LOOP_MSG); // ggggggg
      else {
         if     (polled_req == 0)  send_polled_cmd("DIAG:ROSC:EFC:REL?",  SCPI_EFC_MSG);
         else if(polled_req == 1)  send_polled_cmd("DIAG:ROSC:EFC:DATA?", UCCM_EFC_MSG);
         else if(polled_req == 2)  send_polled_cmd("GPS:POS?",            SCPI_POSN_MSG);
         else if(polled_req == 3)  send_polled_cmd("*IDN?",               SCPI_ID_MSG);
         else if(polled_req == 4)  send_polled_cmd("GPS:SAT:TRAC:IGN?",   SCPI_IGNORE_MSG);
         else if(polled_req == 5)  send_polled_cmd("GPS:SAT:TRAC:EMAN?",  SCPI_ELEV_MSG);
         else if(polled_req == 6)  send_polled_cmd("GPS:REF:ADEL?",       SCPI_GET_CABLE_MSG);
         else if(polled_req == 7)  send_polled_cmd("OUTP:TP:SEL?",        UCCM_RATE_MSG);
         else if(polled_req == 8)  send_polled_cmd("OUTP:STAT?",          UCCM_STATE_MSG);
         else if(polled_req == 9)  send_polled_cmd("LED:GPSL?",           UCCM_LED_MSG);
         else if(polled_req == 10) send_polled_cmd("PULLINRANGE?",        UCCM_GET_PULLIN_MSG);
         else if(polled_req == 11) send_polled_cmd("ALARM:HARD?",         UCCM_GET_HW_ALARM);
         else if(polled_req == 12) send_polled_cmd("ALARM:OPER?",         UCCM_GET_OPER_ALARM);

         if(scpi_type != UCCMP_TYPE) {
            if(++polled_req > 12) {
               polled_req = 0;
               ++all_polled;
            }
         }
         else {
            if     (polled_req == 13) send_polled_cmd(":ROSC:HOLD:DUR?",     SCPI_HOLDOVER_MSG); //kkkkkk
            else if(polled_req == 14) send_polled_cmd(":GPS:POS:SURV:STAT?", SCPI_SURVEY_MSG);   //kkkkkk
            else if(polled_req == 15) send_polled_cmd(":GPS:POS:SURV:PROG?", SCPI_PROGRESS_MSG); //kkkkkk
            if(++polled_req > 15) {
               polled_req = 0;
               ++all_polled;
            }
         }

      }
      ++polled_seq;
   }
}

// Assembly:
movl 0x30018d(%rip), %eax    # 0x36ffd0
cmpl 0x30018b(%rip), %eax    # 0x36ffd4
jne 0x6fea5
movl 0x30018b(%rip), %eax    # 0x36ffdc
testl %eax, %eax
jns 0x6fe61
movl $0x0, 0x30017d(%rip)    # 0x36ffdc
xorl %eax, %eax
pushq %rbp
movq %rsp, %rbp
imull $0xcccccccd, 0x300171(%rip), %ecx # imm = 0xCCCCCCCD
rorl %ecx
cmpl $0x19999999, %ecx       # imm = 0x19999999
jbe 0x6feaf
cmpl $0xc, %eax
ja 0x6ff76
movl %eax, %eax
leaq 0xaeff9(%rip), %rcx     # 0x11ee84
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xb5739(%rip), %rdi     # 0x1255d4
movl $0xb, %esi
jmp 0x6ff71
movl $0x1, %edi
jmp 0x8aadd
leaq 0xb5713(%rip), %rdi     # 0x1255c9
movl $0x66, %esi
callq 0x6e2d1
jmp 0x6fff8
leaq 0xb571b(%rip), %rdi     # 0x1255e7
movl $0x6e, %esi
jmp 0x6ff71
leaq 0xb0da5(%rip), %rdi     # 0x120c82
movl $0x1e, %esi
jmp 0x6ff71
leaq 0xb5705(%rip), %rdi     # 0x1255f3
movl $0x6f, %esi
jmp 0x6ff71
leaq 0xb192f(%rip), %rdi     # 0x12182b
movl $0x69, %esi
jmp 0x6ff71
leaq 0xb54df(%rip), %rdi     # 0x1253e9
movl $0x15, %esi
jmp 0x6ff71
leaq 0xb17af(%rip), %rdi     # 0x1216c7
movl $0x1c, %esi
jmp 0x6ff71
leaq 0xb1396(%rip), %rdi     # 0x1212bc
movl $0x64, %esi
jmp 0x6ff71
leaq 0xb1448(%rip), %rdi     # 0x12137c
movl $0x67, %esi
jmp 0x6ff71
leaq 0xb1034(%rip), %rdi     # 0x120f76
movl $0xa, %esi
jmp 0x6ff71
leaq 0xb120a(%rip), %rdi     # 0x12115a
movl $0xe, %esi
jmp 0x6ff71
leaq 0xb0ec1(%rip), %rdi     # 0x120e1f
movl $0x6d, %esi
jmp 0x6ff71
leaq 0xb0ea8(%rip), %rdi     # 0x120e14
movl $0x6b, %esi
callq 0x6e2d1
leaq 0x1ab063(%rip), %rax    # 0x21afe0
cmpl $0x50, (%rax)
movl 0x300056(%rip), %eax    # 0x36ffdc
jne 0x6ffa5
cmpl $0xf, %eax
je 0x6ffc3
cmpl $0xe, %eax
je 0x6ffb5
cmpl $0xd, %eax
jne 0x6ffda
leaq 0xb154f(%rip), %rdi     # 0x1214ed
movl $0x16, %esi
jmp 0x6ffcf
leal 0x1(%rax), %ecx
movl %ecx, 0x30002e(%rip)    # 0x36ffdc
cmpl $0xc, %eax
jge 0x6ffe8
jmp 0x6fff8
leaq 0xb1769(%rip), %rdi     # 0x121725
movl $0x13, %esi
jmp 0x6ffcf
leaq 0xb549e(%rip), %rdi     # 0x125468
movl $0x12, %esi
callq 0x6e2d1
movl 0x300002(%rip), %eax    # 0x36ffdc
leal 0x1(%rax), %ecx
movl %ecx, 0x2ffff9(%rip)    # 0x36ffdc
cmpl $0xf, %eax
jl 0x6fff8
movl $0x0, 0x2fffea(%rip)    # 0x36ffdc
incl 0x2fbdd0(%rip)          # 0x36bdc8
incl 0x2fffe2(%rip)          # 0x36ffe0
popq %rbp
retq