// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: show_com_state()
void show_com_state()
{
   if(com[RCVR_PORT].process_com) {       // we are using the serial port
      if((com[RCVR_PORT].com_port == 0) && (com[RCVR_PORT].usb_port == 0) && com[RCVR_PORT].IP_addr[0]) {   // TCP
         sprintf(out, "WAITING FOR CONNECTION TO:%s", com[RCVR_PORT].IP_addr);
      }
      else if(nortel && com[RCVR_PORT].com_port)   sprintf(out, "Waking up Nortel receiver on COM%d", com[RCVR_PORT].com_port);
      else if(nortel && com[RCVR_PORT].usb_port)   sprintf(out, "Waking up Nortel receiver on USB%d", com[RCVR_PORT].usb_port);
      else if(com[RCVR_PORT].com_port) sprintf(out, "NO COM%d SERIAL PORT DATA SEEN", com[RCVR_PORT].com_port);
      else if(com[RCVR_PORT].usb_port) {
         if(com[RCVR_PORT].usb_port == USE_IDEV_NAME) {
            sprintf(out, "NO %s SERIAL PORT DATA SEEN", com[RCVR_PORT].com_dev);
         }
         else if(com[RCVR_PORT].usb_port == USE_DEV_NAME) {
            sprintf(out, "NO %s SERIAL PORT DATA SEEN", com[RCVR_PORT].com_dev);
         }
         else {
            sprintf(out, "NO USB%d SERIAL PORT DATA SEEN", com[RCVR_PORT].usb_port);
         }
      }
      else                             sprintf(out, "NO INPUT DEVICE FOUND");
      vidstr(0,0, RED, out);
      refresh_page();
if(first_key == 0) Sleep(1000);

//    set_single_sat(0x00);
      if(!did_init1) init_messages(3, 1);     // send init messages and request various data

#ifdef USE_X11
      while(0 && !SERIAL_DATA_AVAILABLE(RCVR_PORT)) {  // !!!!
         if(IDLE_SLEEP) Sleep(IDLE_SLEEP);
         check_com_timer(RCVR_PORT);
         get_x11_event();
         if(display) XFlush(display);
         if(KBHIT()) {
            break;
         }
      }
#endif
#ifdef USE_SDL
      while(0 && !SERIAL_DATA_AVAILABLE(RCVR_PORT)) {  // !!!!
         if(IDLE_SLEEP) Sleep(IDLE_SLEEP);
         check_com_timer(RCVR_PORT);
         get_sdl_event();
         if(KBHIT()) {
            break;
         }
      }
#endif
      if(SERIAL_DATA_AVAILABLE(RCVR_PORT)) {
         reset_com_timer(RCVR_PORT);
         find_msg_end();  // skip data till we see an end of message code
      }
   }
   else if(sim_file) {
      vidstr(0,0, YELLOW, "SIMULATION FILE IN USE         ");
   }
   else {                  // user has disabled the serial port
      vidstr(0,0, YELLOW, "SERIAL PORT PROCESSING DISABLED");
      refresh_page();
if(first_key == 0) Sleep(1000);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x0, 0x2f2348(%rip)    # 0x30fcd4
je 0x1d9cc
movl 0x2f010c(%rip), %eax    # 0x30daa0
movl 0x2f010a(%rip), %edx    # 0x30daa4
testl %eax, %eax
jne 0x1d9ea
testl %edx, %edx
jne 0x1d9ea
cmpb $0x0, 0x2f0204(%rip)    # 0x30dbad
je 0x1d9ea
leaq 0x30886e(%rip), %rdi    # 0x326220
leaq 0xd754a(%rip), %rsi     # 0xf4f03
leaq 0x2f01ed(%rip), %rdx    # 0x30dbad
xorl %eax, %eax
callq 0x9060
jmp 0x1da80
cmpq $0x0, 0x20a9ec(%rip)    # 0x2283c0
je 0x1da35
leaq 0xd75f9(%rip), %rcx     # 0xf4fd6
pushq $0xe
popq %rdx
xorl %edi, %edi
xorl %esi, %esi
popq %rbp
jmp 0xe2d2
movb 0x20b549(%rip), %cl     # 0x228f39
testb %cl, %cl
sete %sil
testl %eax, %eax
sete %dil
orb %sil, %dil
jne 0x1da11
leaq 0x308818(%rip), %rdi    # 0x326220
leaq 0xd7511(%rip), %rsi     # 0xf4f20
jmp 0x1da77
testb %cl, %cl
setne %cl
testl %edx, %edx
setne %sil
andb %cl, %sil
cmpb $0x1, %sil
jne 0x1da65
leaq 0x3087f4(%rip), %rdi    # 0x326220
leaq 0xd7510(%rip), %rsi     # 0xf4f43
jmp 0x1da79
leaq 0xd75ba(%rip), %rcx     # 0xf4ff6
pushq $0xe
popq %rdx
xorl %edi, %edi
xorl %esi, %esi
callq 0xe2d2
callq 0xaa05
cmpl $0x0, 0x20b504(%rip)    # 0x228f58
jne 0x1dadb
movl $0x3e8, %edi            # imm = 0x3E8
popq %rbp
jmp 0xae83
testl %eax, %eax
je 0x1dadd
leaq 0x3087b0(%rip), %rdi    # 0x326220
leaq 0xd74ef(%rip), %rsi     # 0xf4f66
movl %eax, %edx
xorl %eax, %eax
callq 0x9060
leaq 0x308799(%rip), %rcx    # 0x326220
pushq $0xc
popq %rdx
xorl %edi, %edi
xorl %esi, %esi
callq 0xe2d2
callq 0xaa05
cmpl $0x0, 0x20b4b9(%rip)    # 0x228f58
jne 0x1daab
movl $0x3e8, %edi            # imm = 0x3E8
callq 0xae83
cmpl $0x0, 0x30355e(%rip)    # 0x321010
jne 0x1dabf
pushq $0x3
popq %rdi
pushq $0x1
popq %rsi
callq 0x59afe
pushq $0xa
popq %rdi
callq 0xb771
testl %eax, %eax
je 0x1dadb
pushq $0xa
popq %rdi
callq 0x1d93f
xorl %edi, %edi
popq %rbp
jmp 0x52194
popq %rbp
retq
testl %edx, %edx
je 0x1db0b
cmpl $0x3e7, %edx            # imm = 0x3E7
je 0x1daf1
cmpl $0x270f, %edx           # imm = 0x270F
jne 0x1db2f
leaq 0x308728(%rip), %rdi    # 0x326220
leaq 0xd7486(%rip), %rsi     # 0xf4f85
leaq 0x2effa6(%rip), %rdx    # 0x30daac
jmp 0x1d9c0
movups 0xd74ae(%rip), %xmm0    # 0xf4fc0
movaps %xmm0, 0x308707(%rip)   # 0x326220
movabsq $0x444e554f462045, %rax # imm = 0x444E554F462045
movq %rax, 0x308704(%rip)    # 0x32622e
jmp 0x1da80
leaq 0x3086ea(%rip), %rdi    # 0x326220
leaq 0xd7464(%rip), %rsi     # 0xf4fa1
jmp 0x1da79