// File: /workspace/github_cpp_makefile_star2_O2/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 0x2f37bc(%rip), %eax    # 0x359fd0
cmpl 0x2f37ba(%rip), %eax    # 0x359fd4
jne 0x6686d
movl 0x2f37ba(%rip), %ecx    # 0x359fdc
testl %ecx, %ecx
jns 0x6682f
andl $0x0, 0x2f37af(%rip)    # 0x359fdc
xorl %ecx, %ecx
pushq %rbp
movq %rsp, %rbp
movl 0x2f37a7(%rip), %eax    # 0x359fe0
pushq $0xa
popq %rsi
xorl %edx, %edx
divl %esi
testl %edx, %edx
je 0x66875
cmpl $0xc, %ecx
ja 0x6690f
movl %ecx, %eax
leaq 0xa256e(%rip), %rcx     # 0x108dc4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xa8cb6(%rip), %rdi     # 0x10f51c
pushq $0xb
jmp 0x66909
pushq $0x1
popq %rdi
jmp 0x7dfa9
leaq 0xa8c95(%rip), %rdi     # 0x10f511
pushq $0x66
popq %rsi
callq 0x64f01
jmp 0x66986
leaq 0xa8c9f(%rip), %rdi     # 0x10f52f
pushq $0x6e
jmp 0x66909
leaq 0xa432f(%rip), %rdi     # 0x10abca
pushq $0x1e
jmp 0x66909
leaq 0xa8c95(%rip), %rdi     # 0x10f53b
pushq $0x6f
jmp 0x66909
leaq 0xa4ec2(%rip), %rdi     # 0x10b773
pushq $0x69
jmp 0x66909
leaq 0xa8a75(%rip), %rdi     # 0x10f331
pushq $0x15
jmp 0x66909
leaq 0xa4d48(%rip), %rdi     # 0x10b60f
pushq $0x1c
jmp 0x66909
leaq 0xa4932(%rip), %rdi     # 0x10b204
pushq $0x64
jmp 0x66909
leaq 0xa49e7(%rip), %rdi     # 0x10b2c4
pushq $0x67
jmp 0x66909
leaq 0xa45d6(%rip), %rdi     # 0x10aebe
jmp 0x6690a
leaq 0xa47b1(%rip), %rdi     # 0x10b0a2
pushq $0xe
jmp 0x66909
leaq 0xa446b(%rip), %rdi     # 0x10ad67
pushq $0x6d
jmp 0x66909
leaq 0xa4455(%rip), %rdi     # 0x10ad5c
pushq $0x6b
popq %rsi
callq 0x64f01
leaq 0x19e6ca(%rip), %rax    # 0x204fe0
cmpl $0x50, (%rax)
movl 0x2f36bd(%rip), %eax    # 0x359fdc
jne 0x6693b
cmpl $0xf, %eax
je 0x66956
cmpl $0xe, %eax
je 0x6694b
cmpl $0xd, %eax
jne 0x6696b
leaq 0xa4afe(%rip), %rdi     # 0x10b435
pushq $0x16
jmp 0x6695f
leal 0x1(%rax), %ecx
movl %ecx, 0x2f3698(%rip)    # 0x359fdc
cmpl $0xc, %eax
jge 0x66979
jmp 0x66986
leaq 0xa4d1b(%rip), %rdi     # 0x10b66d
pushq $0x13
jmp 0x6695f
leaq 0xa8a53(%rip), %rdi     # 0x10f3b0
pushq $0x12
popq %rsi
callq 0x64f01
movl 0x2f3671(%rip), %eax    # 0x359fdc
leal 0x1(%rax), %ecx
movl %ecx, 0x2f3668(%rip)    # 0x359fdc
cmpl $0xf, %eax
jl 0x66986
andl $0x0, 0x2f365c(%rip)    # 0x359fdc
incl 0x2ef442(%rip)          # 0x355dc8
incl 0x2f3654(%rip)          # 0x359fe0
popq %rbp
retq