// File: 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, 0x359109(%rip)    # 0x384eb4
je 0x2bfe9
cmpl $0x0, 0x356ec8(%rip)    # 0x382c80
jne 0x2bdfb
cmpl $0x0, 0x356ec3(%rip)    # 0x382c84
jne 0x2bdfb
cmpb $0x0, 0x356fc3(%rip)    # 0x382d8d
je 0x2bdfb
leaq 0x36f62d(%rip), %rdi    # 0x39b400
leaq 0x14509b(%rip), %rsi    # 0x170e75
leaq 0x3416df(%rip), %rdx    # 0x36d4c0
addq $0x157c0, %rdx          # imm = 0x157C0
addq $0x10d, %rdx            # imm = 0x10D
movb $0x0, %al
callq 0x9060
jmp 0x2bf3b
cmpb $0x0, 0x272317(%rip)    # 0x29e119
je 0x2be2d
cmpl $0x0, 0x356e75(%rip)    # 0x382c80
je 0x2be2d
movl 0x356e6d(%rip), %edx    # 0x382c80
leaq 0x36f5e6(%rip), %rdi    # 0x39b400
leaq 0x145071(%rip), %rsi    # 0x170e92
movb $0x0, %al
callq 0x9060
jmp 0x2bf39
cmpb $0x0, 0x2722e5(%rip)    # 0x29e119
je 0x2be5f
cmpl $0x0, 0x356e47(%rip)    # 0x382c84
je 0x2be5f
movl 0x356e3f(%rip), %edx    # 0x382c84
leaq 0x36f5b4(%rip), %rdi    # 0x39b400
leaq 0x145062(%rip), %rsi    # 0x170eb5
movb $0x0, %al
callq 0x9060
jmp 0x2bf37
cmpl $0x0, 0x356e1a(%rip)    # 0x382c80
je 0x2be88
movl 0x356e12(%rip), %edx    # 0x382c80
leaq 0x36f58b(%rip), %rdi    # 0x39b400
leaq 0x14505c(%rip), %rsi    # 0x170ed8
movb $0x0, %al
callq 0x9060
jmp 0x2bf35
cmpl $0x0, 0x356df5(%rip)    # 0x382c84
je 0x2bf1e
cmpl $0x270f, 0x356de5(%rip) # imm = 0x270F
jne 0x2beca
leaq 0x36f558(%rip), %rdi    # 0x39b400
leaq 0x145048(%rip), %rsi    # 0x170ef7
leaq 0x34160a(%rip), %rdx    # 0x36d4c0
addq $0x157c0, %rdx          # imm = 0x157C0
addq $0xc, %rdx
movb $0x0, %al
callq 0x9060
jmp 0x2bf1c
cmpl $0x3e7, 0x356db0(%rip)  # imm = 0x3E7
jne 0x2beff
leaq 0x36f523(%rip), %rdi    # 0x39b400
leaq 0x145013(%rip), %rsi    # 0x170ef7
leaq 0x3415d5(%rip), %rdx    # 0x36d4c0
addq $0x157c0, %rdx          # imm = 0x157C0
addq $0xc, %rdx
movb $0x0, %al
callq 0x9060
jmp 0x2bf1a
movl 0x356d7f(%rip), %edx    # 0x382c84
leaq 0x36f4f4(%rip), %rdi    # 0x39b400
leaq 0x145000(%rip), %rsi    # 0x170f13
movb $0x0, %al
callq 0x9060
jmp 0x2bf1c
jmp 0x2bf33
leaq 0x36f4db(%rip), %rdi    # 0x39b400
leaq 0x145006(%rip), %rsi    # 0x170f32
movb $0x0, %al
callq 0x9060
jmp 0x2bf35
jmp 0x2bf37
jmp 0x2bf39
jmp 0x2bf3b
xorl %esi, %esi
movl $0xc, %edx
leaq 0x36f4b7(%rip), %rcx    # 0x39b400
movl %esi, %edi
callq 0x10ee0
callq 0xb0d0
cmpl $0x0, 0x2721dc(%rip)    # 0x29e138
jne 0x2bf68
movl $0x3e8, %edi            # imm = 0x3E8
callq 0xb8b0
cmpl $0x0, 0x36a281(%rip)    # 0x3961f0
jne 0x2bf80
movl $0x3, %edi
movl $0x1, %esi
callq 0x86290
jmp 0x2bf82
xorl %eax, %eax
testb $0x1, %al
jne 0x2bf8a
jmp 0x2bfc7
movl $0x19, %edi
callq 0xb8b0
movl $0xa, %edi
callq 0x2b610
callq 0xf450
cmpq $0x0, 0x1a40f5(%rip)    # 0x1d00a0
je 0x2bfb9
movq 0x1a40ec(%rip), %rdi    # 0x1d00a0
callq 0x95b0
callq 0xf3d0
cmpl $0x0, %eax
je 0x2bfc5
jmp 0x2bfc7
jmp 0x2bf82
movl $0xa, %edi
callq 0xcad0
cmpl $0x0, %eax
je 0x2bfe7
movl $0xa, %edi
callq 0x2bd30
xorl %edi, %edi
callq 0x7aee0
jmp 0x2c03b
cmpq $0x0, 0x2715af(%rip)    # 0x29d5a0
je 0x2c00a
xorl %esi, %esi
movl $0xe, %edx
leaq 0x144f47(%rip), %rcx    # 0x170f48
movl %esi, %edi
callq 0x10ee0
jmp 0x2c039
xorl %esi, %esi
movl $0xe, %edx
leaq 0x144f50(%rip), %rcx    # 0x170f68
movl %esi, %edi
callq 0x10ee0
callq 0xb0d0
cmpl $0x0, 0x27210d(%rip)    # 0x29e138
jne 0x2c037
movl $0x3e8, %edi            # imm = 0x3E8
callq 0xb8b0
jmp 0x2c039
jmp 0x2c03b
popq %rbp
retq
nopl (%rax)