// File: /workspace/github_cpp_makefile_star2_O1/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 0x30016b(%rip), %eax    # 0x36ffd0
cmpl 0x300169(%rip), %eax    # 0x36ffd4
jne 0x6fec8
cmpl $0x0, 0x300168(%rip)    # 0x36ffdc
jns 0x6fe80
movl $0x0, 0x30015c(%rip)    # 0x36ffdc
pushq %rbp
movq %rsp, %rbp
imull $0xcccccccd, 0x300152(%rip), %eax # imm = 0xCCCCCCCD
rorl %eax
cmpl $0x19999999, %eax       # imm = 0x19999999
jbe 0x6fed2
movl 0x30013f(%rip), %eax    # 0x36ffdc
cmpq $0xc, %rax
ja 0x6ff99
leaq 0xaef16(%rip), %rcx     # 0x11edc4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xb5636(%rip), %rdi     # 0x1254f4
movl $0xb, %esi
jmp 0x6ff94
movl $0x1, %edi
jmp 0x8ab04
leaq 0xb5610(%rip), %rdi     # 0x1254e9
movl $0x66, %esi
callq 0x6e3bc
jmp 0x7001b
leaq 0xb5618(%rip), %rdi     # 0x125507
movl $0x6e, %esi
jmp 0x6ff94
leaq 0xb0ca2(%rip), %rdi     # 0x120ba2
movl $0x1e, %esi
jmp 0x6ff94
leaq 0xb5602(%rip), %rdi     # 0x125513
movl $0x6f, %esi
jmp 0x6ff94
leaq 0xb182c(%rip), %rdi     # 0x12174b
movl $0x69, %esi
jmp 0x6ff94
leaq 0xb53dc(%rip), %rdi     # 0x125309
movl $0x15, %esi
jmp 0x6ff94
leaq 0xb16ac(%rip), %rdi     # 0x1215e7
movl $0x1c, %esi
jmp 0x6ff94
leaq 0xb1293(%rip), %rdi     # 0x1211dc
movl $0x64, %esi
jmp 0x6ff94
leaq 0xb1345(%rip), %rdi     # 0x12129c
movl $0x67, %esi
jmp 0x6ff94
leaq 0xb0f31(%rip), %rdi     # 0x120e96
movl $0xa, %esi
jmp 0x6ff94
leaq 0xb1107(%rip), %rdi     # 0x12107a
movl $0xe, %esi
jmp 0x6ff94
leaq 0xb0dbe(%rip), %rdi     # 0x120d3f
movl $0x6d, %esi
jmp 0x6ff94
leaq 0xb0da5(%rip), %rdi     # 0x120d34
movl $0x6b, %esi
callq 0x6e3bc
leaq 0x1ab040(%rip), %rax    # 0x21afe0
cmpl $0x50, (%rax)
movl 0x300033(%rip), %eax    # 0x36ffdc
jne 0x6ffc8
cmpl $0xf, %eax
je 0x6ffe6
cmpl $0xe, %eax
je 0x6ffd8
cmpl $0xd, %eax
jne 0x6fff7
leaq 0xb144c(%rip), %rdi     # 0x12140d
movl $0x16, %esi
jmp 0x6fff2
leal 0x1(%rax), %ecx
movl %ecx, 0x30000b(%rip)    # 0x36ffdc
cmpl $0xc, %eax
jge 0x7000b
jmp 0x7001b
leaq 0xb1666(%rip), %rdi     # 0x121645
movl $0x13, %esi
jmp 0x6fff2
leaq 0xb539b(%rip), %rdi     # 0x125388
movl $0x12, %esi
callq 0x6e3bc
movl 0x2fffdf(%rip), %eax    # 0x36ffdc
leal 0x1(%rax), %ecx
movl %ecx, 0x2fffd6(%rip)    # 0x36ffdc
cmpl $0xf, %eax
jl 0x7001b
movl $0x0, 0x2fffc7(%rip)    # 0x36ffdc
incl 0x2fbdad(%rip)          # 0x36bdc8
incl 0x2fffbf(%rip)          # 0x36ffe0
popq %rbp
retq