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

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


   test = 1;
   if(test && (polled_q_in != polled_q_out)) {  // we have a special message request queued
      send_queued_cmd(1);
   }
   else if(polled_msg_id == BRANDY_TIME_MSG) { // 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);
      }
      if(polled_req < 0) polled_req = 0;

      if(0 && ((polled_seq % 3) == 0)) ;
      else if(1 && (polled_seq % 20)) {  // rate limit messages due to low baud rate
        if(use_a_time)  send_polled_cmd("a", BRANDY_TIME_MSG);  // request "a" time
        else            send_polled_cmd("t", BRANDY_TIME_MSG);  // request "t" time
      }
      else {
         if     (polled_req == 0)  send_polled_cmd("a", BRANDY_VERSION_MSG);
         else if(polled_req == 1)  send_polled_cmd("c", BRANDY_PULSE_MSG);
         else if(polled_req == 2)  send_polled_cmd("e", BRANDY_CODE_MSG);
         else if(polled_req == 3)  send_polled_cmd("h", BRANDY_HEALTH_MSG);   //long
         else if(polled_req == 4)  send_polled_cmd("j", BRANDY_LEAP_MSG);
         else if(polled_req == 5)  send_polled_cmd("p", BRANDY_POSN_MSG);     //long
         else if(polled_req == 6)  send_polled_cmd("n", BRANDY_FW_MSG);
         else if(polled_req == 7)  send_polled_cmd("d", BRANDY_DOP_MSG);      //long
         else if(polled_req == 8)  send_polled_cmd("s", BRANDY_INFO_MSG);
//       else if(polled_req == 9)  send_polled_cmd("f", BRANDY_FREQ_MSG);     //long
//       else if(polled_req == 10) send_polled_cmd("o", BRANDY_ZONE_MSG);

         ++polled_req;
         if(polled_req > 8)  {
            polled_req = 0;
            ++all_polled;
         }
      }

      ++polled_seq;
   }
   else {
      if(use_a_time)  send_polled_cmd("a", BRANDY_TIME_MSG);  // request "a" time
      else            send_polled_cmd("t", BRANDY_TIME_MSG);  // request "t" time
   }
}

// Assembly:
movl 0x2dc17e(%rip), %eax    # 0x359fd0
cmpl 0x2dc17c(%rip), %eax    # 0x359fd4
jne 0x7dea0
cmpl $0x19b, 0x2d8d9c(%rip)  # imm = 0x19B
jne 0x7dea8
movl 0x2dc170(%rip), %ecx    # 0x359fdc
testl %ecx, %ecx
jns 0x7de79
andl $0x0, 0x2dc165(%rip)    # 0x359fdc
xorl %ecx, %ecx
pushq %rbp
movq %rsp, %rbp
movl 0x2dc15d(%rip), %eax    # 0x359fe0
pushq $0x14
popq %rsi
xorl %edx, %edx
divl %esi
testl %edx, %edx
je 0x7deba
cmpl $0x0, 0x2d8d67(%rip)    # 0x356bfc
je 0x7def7
leaq 0xa1c81(%rip), %rdi     # 0x11fb1f
jmp 0x7defe
pushq $0x1
popq %rdi
jmp 0x7dfa9
cmpl $0x0, 0x2d8d4d(%rip)    # 0x356bfc
je 0x7dee6
leaq 0xa1c67(%rip), %rdi     # 0x11fb1f
jmp 0x7deed
cmpl $0x8, %ecx
ja 0x7df94
movl %ecx, %eax
leaq 0x8b39c(%rip), %rcx     # 0x109268
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xa1c43(%rip), %rdi     # 0x11fb1f
movl $0x190, %esi            # imm = 0x190
jmp 0x7df7b
leaq 0x7f9a7(%rip), %rdi     # 0xfd894
movl $0x19b, %esi            # imm = 0x19B
jmp 0x64f01
leaq 0x7f996(%rip), %rdi     # 0xfd894
movl $0x19b, %esi            # imm = 0x19B
callq 0x64f01
jmp 0x7dfa1
leaq 0x90c13(%rip), %rdi     # 0x10eb27
movl $0x195, %esi            # imm = 0x195
jmp 0x7df7b
leaq 0x7cdb3(%rip), %rdi     # 0xfacd5
movl $0x192, %esi            # imm = 0x192
jmp 0x7df7b
leaq 0x836df(%rip), %rdi     # 0x10160f
movl $0x194, %esi            # imm = 0x194
jmp 0x7df7b
leaq 0x836cb(%rip), %rdi     # 0x101609
movl $0x19c, %esi            # imm = 0x19C
jmp 0x7df7b
leaq 0x99adb(%rip), %rdi     # 0x117a27
movl $0x191, %esi            # imm = 0x191
jmp 0x7df7b
leaq 0x79bd0(%rip), %rdi     # 0xf7b2a
movl $0x199, %esi            # imm = 0x199
jmp 0x7df7b
leaq 0x79bf2(%rip), %rdi     # 0xf7b5a
movl $0x197, %esi            # imm = 0x197
jmp 0x7df7b
leaq 0x836a5(%rip), %rdi     # 0x10161b
movl $0x19a, %esi            # imm = 0x19A
callq 0x64f01
movl 0x2dc056(%rip), %eax    # 0x359fdc
leal 0x1(%rax), %ecx
movl %ecx, 0x2dc04d(%rip)    # 0x359fdc
cmpl $0x8, %eax
jl 0x7dfa1
andl $0x0, 0x2dc041(%rip)    # 0x359fdc
incl 0x2d7e27(%rip)          # 0x355dc8
incl 0x2dc039(%rip)          # 0x359fe0
popq %rbp
retq