// File: jkingan[P]ladyheather/heathgps.cpp
// Function: show_serial_info()
void show_serial_info()
{
char *on;
char *c, *d, *t, *u;

   if(zoom_screen) return;
   if(text_mode && first_key) return;

   if((com[RCVR_PORT].process_com == 0) || (com[RCVR_PORT].user_disabled_com)) {
      on = "(OFF)";
      c = "com:";
      d = "dev:";
      u = "usb:";
      t = "tty:";
   }
   else {
      on = "     ";
      c = "COM:";
      d = "DEV:";
      u = "USB:";
      t = "TTY:";
   }

   if(luxor) {
      if(com[RCVR_PORT].usb_port == USE_IDEV_NAME)     sprintf(out, "DEV: %s", com[RCVR_PORT].com_dev); 
      else if(com[RCVR_PORT].usb_port == USE_DEV_NAME) sprintf(out, "DEV: %s", com[RCVR_PORT].com_dev); 
      else if(com[RCVR_PORT].usb_port)        sprintf(out, "USB: %d", com[RCVR_PORT].usb_port-1);
#ifdef WINDOWS
      else if(com[RCVR_PORT].com_port)        sprintf(out, "COM: %d", com[RCVR_PORT].com_port);
#else   // __linux__  __MACH__  __FreeBSD__
      else if(com[RCVR_PORT].com_port)        sprintf(out, "TTY: %d", com[RCVR_PORT].com_port-1);
#endif
#ifdef TCP_IP 
      else if(com[RCVR_PORT].IP_addr[0]) {
         sprintf(out," IP: %-17.17s", com[RCVR_PORT].IP_addr); // TCP, no room for sernum
      }
#endif
      else sprintf(out," COM: none");
      if(strlen(out) > 16) strcpy(&out[16-3],"...");   // don't hit 'Power' label
      vidstr(VER_ROW+5, VER_COL, WHITE, out);

      sprintf(out, "SER: %u.%04lu  ", sn_prefix, (unsigned long) serial_num);
   }
   else if(sn_prefix && serial_num) {
      if(com[RCVR_PORT].usb_port == USE_IDEV_NAME)     sprintf(out, "DEV: %-17.17s", com[RCVR_PORT].com_dev); // user specified device
      else if(com[RCVR_PORT].usb_port == USE_DEV_NAME) sprintf(out, "DEV: %-17.17s", com[RCVR_PORT].com_dev); // symlink to /dev/heather
      else if(com[RCVR_PORT].usb_port >= 10)           sprintf(out, "Ser: %2u.%-8lu USB:%d",  sn_prefix, (unsigned long) serial_num, com[RCVR_PORT].usb_port-1);
      else if(com[RCVR_PORT].usb_port)                 sprintf(out, "Ser: %2u.%-8lu  USB:%d", sn_prefix, (unsigned long) serial_num, com[RCVR_PORT].usb_port-1);
#ifdef WINDOWS
      else if(com[RCVR_PORT].com_port >= 10) sprintf(out, "Ser: %2u.%-8lu COM:%d",  sn_prefix, (unsigned long) serial_num, com[RCVR_PORT].com_port);
      else if(com[RCVR_PORT].com_port)       sprintf(out, "Ser: %2u.%-8lu  COM:%d", sn_prefix, (unsigned long) serial_num, com[RCVR_PORT].com_port);
#else   // __linux__  __MACH__  __FreeBSD__
      else if(com[RCVR_PORT].com_port >= 10) sprintf(out, "Ser: %2u.%-8lu TTY:%d",  sn_prefix, (unsigned long) serial_num, com[RCVR_PORT].com_port-1);
      else if(com[RCVR_PORT].com_port)       sprintf(out, "Ser: %2u.%-8lu  TTY:%d", sn_prefix, (unsigned long) serial_num, com[RCVR_PORT].com_port-1);
#endif
#ifdef TCP_IP 
      else if(com[RCVR_PORT].IP_addr[0]) {
         sprintf(out," IP: %-18.18s", com[RCVR_PORT].IP_addr); // TCP, no room for sernum
      }
#endif
      else sprintf(out, "Ser: %2u.%-8lu  COM:none", sn_prefix, (unsigned long) serial_num);
      if(strlen(out) > 27) strcpy(&out[27-3],"...");   // don't hit 'Power' label
   }
   else if(rcvr_type == NO_RCVR) {
      sprintf(out, "COM: None");
   }
   else {
      if(com[RCVR_PORT].usb_port == USE_IDEV_NAME)     sprintf(out, "DEV: %-17.17s", com[RCVR_PORT].com_dev); // user specified device
      else if(com[RCVR_PORT].usb_port == USE_DEV_NAME) sprintf(out, "DEV: %-17.17s", com[RCVR_PORT].com_dev); // symlink to /dev/heather
      else if(com[RCVR_PORT].usb_port >= 10)           sprintf(out, "USB: %-2d %s         ", com[RCVR_PORT].usb_port-1, on);
      else if(com[RCVR_PORT].usb_port)                 sprintf(out, "USB: %-2d %s         ", com[RCVR_PORT].usb_port-1, on);
#ifdef WINDOWS
      else if(com[RCVR_PORT].com_port >= 10) sprintf(out, "COM: %-2d %s       ", com[RCVR_PORT].com_port, on);
      else if(com[RCVR_PORT].com_port)       sprintf(out, "COM: %-2d %s       ", com[RCVR_PORT].com_port, on);
#else   // __linux__  __MACH__  __FreeBSD__
      else if(com[RCVR_PORT].com_port >= 10) sprintf(out, "TTY: %-2d %s       ", com[RCVR_PORT].com_port-1, on);
      else if(com[RCVR_PORT].com_port)       sprintf(out, "TTY: %-2d %s       ", com[RCVR_PORT].com_port-1, on);
#endif
#ifdef TCP_IP 
      else if(com[RCVR_PORT].IP_addr[0]) {
         sprintf(out," IP: %-17.17s", com[RCVR_PORT].IP_addr); // TCP, no room for sernum
      }
#endif
      else sprintf(out, "COM: none             ");
      if(strlen(out) > 25) strcpy(&out[25-3],"...");   // don't hit 'Power' label
   }
   vidstr(VER_ROW+4, VER_COL, WHITE, out);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
leaq 0x26d1e9(%rip), %rax    # 0x36b988
cmpb $0x0, (%rax)
je 0xfe7a9
jmp 0xfeefb
leaq 0x179208(%rip), %rax    # 0x2779b8
cmpl $0x0, (%rax)
je 0xfe7c6
leaq 0x19f97c(%rip), %rax    # 0x29e138
cmpl $0x0, (%rax)
je 0xfe7c6
jmp 0xfeefb
leaq 0x26ecf3(%rip), %rax    # 0x36d4c0
cmpl $0x0, 0x179f4(%rax)
je 0xfe7e6
leaq 0x26ece3(%rip), %rax    # 0x36d4c0
cmpl $0x0, 0x179e8(%rax)
je 0xfe81f
leaq 0x8d006(%rip), %rax     # 0x18b7f3
movq %rax, -0x8(%rbp)
leaq 0x8d001(%rip), %rax     # 0x18b7f9
movq %rax, -0x10(%rbp)
leaq 0x8cffb(%rip), %rax     # 0x18b7fe
movq %rax, -0x18(%rbp)
leaq 0x8cff5(%rip), %rax     # 0x18b803
movq %rax, -0x28(%rbp)
leaq 0x8cfef(%rip), %rax     # 0x18b808
movq %rax, -0x20(%rbp)
jmp 0xfe856
leaq 0x875ba(%rip), %rax     # 0x185de0
movq %rax, -0x8(%rbp)
leaq 0x8cfdc(%rip), %rax     # 0x18b80d
movq %rax, -0x10(%rbp)
leaq 0x8cfd6(%rip), %rax     # 0x18b812
movq %rax, -0x18(%rbp)
leaq 0x8cfd0(%rip), %rax     # 0x18b817
movq %rax, -0x28(%rbp)
leaq 0x8cfca(%rip), %rax     # 0x18b81c
movq %rax, -0x20(%rbp)
leaq 0x19f8c1(%rip), %rax    # 0x29e11e
cmpb $0x0, (%rax)
je 0xfea2c
leaq 0x26ec53(%rip), %rax    # 0x36d4c0
cmpl $0x270f, 0x157c4(%rax)  # imm = 0x270F
jne 0xfe8a5
leaq 0x29cb80(%rip), %rdi    # 0x39b400
leaq 0x8cf9a(%rip), %rsi     # 0x18b821
leaq 0x26ec32(%rip), %rdx    # 0x36d4c0
addq $0x157c0, %rdx          # imm = 0x157C0
addq $0xc, %rdx
movb $0x0, %al
callq 0x9060
jmp 0xfe9ae
leaq 0x26ec14(%rip), %rax    # 0x36d4c0
cmpl $0x3e7, 0x157c4(%rax)   # imm = 0x3E7
jne 0xfe8e4
leaq 0x29cb41(%rip), %rdi    # 0x39b400
leaq 0x8cf5b(%rip), %rsi     # 0x18b821
leaq 0x26ebf3(%rip), %rdx    # 0x36d4c0
addq $0x157c0, %rdx          # imm = 0x157C0
addq $0xc, %rdx
movb $0x0, %al
callq 0x9060
jmp 0xfe9ac
leaq 0x26ebd5(%rip), %rax    # 0x36d4c0
cmpl $0x0, 0x157c4(%rax)
je 0xfe91e
leaq 0x26ebc5(%rip), %rax    # 0x36d4c0
movl 0x157c4(%rax), %edx
subl $0x1, %edx
leaq 0x29caf5(%rip), %rdi    # 0x39b400
leaq 0x8cf17(%rip), %rsi     # 0x18b829
movb $0x0, %al
callq 0x9060
jmp 0xfe9aa
leaq 0x26eb9b(%rip), %rax    # 0x36d4c0
cmpl $0x0, 0x157c0(%rax)
je 0xfe955
leaq 0x26eb8b(%rip), %rax    # 0x36d4c0
movl 0x157c0(%rax), %edx
subl $0x1, %edx
leaq 0x29cabb(%rip), %rdi    # 0x39b400
leaq 0x8cee5(%rip), %rsi     # 0x18b831
movb $0x0, %al
callq 0x9060
jmp 0xfe9a8
leaq 0x26eb64(%rip), %rax    # 0x36d4c0
cmpb $0x0, 0x158cd(%rax)
je 0xfe991
leaq 0x29ca94(%rip), %rdi    # 0x39b400
leaq 0x8cec6(%rip), %rsi     # 0x18b839
leaq 0x26eb46(%rip), %rdx    # 0x36d4c0
addq $0x157c0, %rdx          # imm = 0x157C0
addq $0x10d, %rdx            # imm = 0x10D
movb $0x0, %al
callq 0x9060
jmp 0xfe9a6
leaq 0x29ca68(%rip), %rdi    # 0x39b400
leaq 0x8cac7(%rip), %rsi     # 0x18b466
movb $0x0, %al
callq 0x9060
jmp 0xfe9a8
jmp 0xfe9aa
jmp 0xfe9ac
jmp 0xfe9ae
leaq 0x29ca4b(%rip), %rdi    # 0x39b400
callq 0x9120
cmpq $0x10, %rax
jbe 0xfe9d7
leaq 0x29ca39(%rip), %rdi    # 0x39b400
addq $0xd, %rdi
leaq 0x8f474(%rip), %rsi     # 0x18de46
callq 0x9350
leaq 0x178f96(%rip), %rax    # 0x277974
movl (%rax), %edi
addl $0x5, %edi
leaq 0x178f8e(%rip), %rax    # 0x277978
movl (%rax), %esi
movl $0xf, %edx
leaq 0x29ca08(%rip), %rcx    # 0x39b400
callq 0x10ee0
leaq 0x26e15c(%rip), %rax    # 0x36cb60
movzwl (%rax), %edx
leaq 0x26e156(%rip), %rax    # 0x36cb64
movl (%rax), %eax
movl %eax, %ecx
leaq 0x29c9e7(%rip), %rdi    # 0x39b400
leaq 0x8ce27(%rip), %rsi     # 0x18b847
movb $0x0, %al
callq 0x9060
jmp 0xfeed5
leaq 0x26e12d(%rip), %rax    # 0x36cb60
cmpw $0x0, (%rax)
je 0xfecac
leaq 0x26e120(%rip), %rax    # 0x36cb64
cmpl $0x0, (%rax)
je 0xfecac
leaq 0x26ea6c(%rip), %rax    # 0x36d4c0
cmpl $0x270f, 0x157c4(%rax)  # imm = 0x270F
jne 0xfea8c
leaq 0x29c999(%rip), %rdi    # 0x39b400
leaq 0x8cde9(%rip), %rsi     # 0x18b857
leaq 0x26ea4b(%rip), %rdx    # 0x36d4c0
addq $0x157c0, %rdx          # imm = 0x157C0
addq $0xc, %rdx
movb $0x0, %al
callq 0x9060
jmp 0xfec7e
leaq 0x26ea2d(%rip), %rax    # 0x36d4c0
cmpl $0x3e7, 0x157c4(%rax)   # imm = 0x3E7
jne 0xfeacb
leaq 0x29c95a(%rip), %rdi    # 0x39b400
leaq 0x8cdaa(%rip), %rsi     # 0x18b857
leaq 0x26ea0c(%rip), %rdx    # 0x36d4c0
addq $0x157c0, %rdx          # imm = 0x157C0
addq $0xc, %rdx
movb $0x0, %al
callq 0x9060
jmp 0xfec7c
leaq 0x26e9ee(%rip), %rax    # 0x36d4c0
cmpl $0xa, 0x157c4(%rax)
jl 0xfeb1c
leaq 0x26e07e(%rip), %rax    # 0x36cb60
movzwl (%rax), %edx
leaq 0x26e078(%rip), %rax    # 0x36cb64
movl (%rax), %eax
movl %eax, %ecx
leaq 0x26e9c9(%rip), %rax    # 0x36d4c0
movl 0x157c4(%rax), %r8d
subl $0x1, %r8d
leaq 0x29c8f7(%rip), %rdi    # 0x39b400
leaq 0x8c91a(%rip), %rsi     # 0x18b42a
movb $0x0, %al
callq 0x9060
jmp 0xfec7a
leaq 0x26e99d(%rip), %rax    # 0x36d4c0
cmpl $0x0, 0x157c4(%rax)
je 0xfeb6d
leaq 0x26e02d(%rip), %rax    # 0x36cb60
movzwl (%rax), %edx
leaq 0x26e027(%rip), %rax    # 0x36cb64
movl (%rax), %eax
movl %eax, %ecx
leaq 0x26e978(%rip), %rax    # 0x36d4c0
movl 0x157c4(%rax), %r8d
subl $0x1, %r8d
leaq 0x29c8a6(%rip), %rdi    # 0x39b400
leaq 0x8c8df(%rip), %rsi     # 0x18b440
movb $0x0, %al
callq 0x9060
jmp 0xfec78
leaq 0x26e94c(%rip), %rax    # 0x36d4c0
cmpl $0xa, 0x157c0(%rax)
jl 0xfebbe
leaq 0x26dfdc(%rip), %rax    # 0x36cb60
movzwl (%rax), %edx
leaq 0x26dfd6(%rip), %rax    # 0x36cb64
movl (%rax), %eax
movl %eax, %ecx
leaq 0x26e927(%rip), %rax    # 0x36d4c0
movl 0x157c0(%rax), %r8d
subl $0x1, %r8d
leaq 0x29c855(%rip), %rdi    # 0x39b400
leaq 0x8c84b(%rip), %rsi     # 0x18b3fd
movb $0x0, %al
callq 0x9060
jmp 0xfec76
leaq 0x26e8fb(%rip), %rax    # 0x36d4c0
cmpl $0x0, 0x157c0(%rax)
je 0xfec0c
leaq 0x26df8b(%rip), %rax    # 0x36cb60
movzwl (%rax), %edx
leaq 0x26df85(%rip), %rax    # 0x36cb64
movl (%rax), %eax
movl %eax, %ecx
leaq 0x26e8d6(%rip), %rax    # 0x36d4c0
movl 0x157c0(%rax), %r8d
subl $0x1, %r8d
leaq 0x29c804(%rip), %rdi    # 0x39b400
leaq 0x8c810(%rip), %rsi     # 0x18b413
movb $0x0, %al
callq 0x9060
jmp 0xfec74
leaq 0x26e8ad(%rip), %rax    # 0x36d4c0
cmpb $0x0, 0x158cd(%rax)
je 0xfec48
leaq 0x29c7dd(%rip), %rdi    # 0x39b400
leaq 0x8cc3b(%rip), %rsi     # 0x18b865
leaq 0x26e88f(%rip), %rdx    # 0x36d4c0
addq $0x157c0, %rdx          # imm = 0x157C0
addq $0x10d, %rdx            # imm = 0x10D
movb $0x0, %al
callq 0x9060
jmp 0xfec72
leaq 0x26df11(%rip), %rax    # 0x36cb60
movzwl (%rax), %edx
leaq 0x26df0b(%rip), %rax    # 0x36cb64
movl (%rax), %eax
movl %eax, %ecx
leaq 0x29c79c(%rip), %rdi    # 0x39b400
leaq 0x8cc08(%rip), %rsi     # 0x18b873
movb $0x0, %al
callq 0x9060
jmp 0xfec74
jmp 0xfec76
jmp 0xfec78
jmp 0xfec7a
jmp 0xfec7c
jmp 0xfec7e
leaq 0x29c77b(%rip), %rdi    # 0x39b400
callq 0x9120
cmpq $0x1b, %rax
jbe 0xfeca7
leaq 0x29c769(%rip), %rdi    # 0x39b400
addq $0x18, %rdi
leaq 0x8f1a4(%rip), %rsi     # 0x18de46
callq 0x9350
jmp 0xfeed3
leaq 0x178dfd(%rip), %rax    # 0x277ab0
cmpq $0x400, (%rax)          # imm = 0x400
jne 0xfecd6
leaq 0x29c73d(%rip), %rdi    # 0x39b400
leaq 0x8cbc2(%rip), %rsi     # 0x18b88c
movb $0x0, %al
callq 0x9060
jmp 0xfeed1
leaq 0x26e7e3(%rip), %rax    # 0x36d4c0
cmpl $0x270f, 0x157c4(%rax)  # imm = 0x270F
jne 0xfed15
leaq 0x29c710(%rip), %rdi    # 0x39b400
leaq 0x8cb60(%rip), %rsi     # 0x18b857
leaq 0x26e7c2(%rip), %rdx    # 0x36d4c0
addq $0x157c0, %rdx          # imm = 0x157C0
addq $0xc, %rdx
movb $0x0, %al
callq 0x9060
jmp 0xfeea6
leaq 0x26e7a4(%rip), %rax    # 0x36d4c0
cmpl $0x3e7, 0x157c4(%rax)   # imm = 0x3E7
jne 0xfed54
leaq 0x29c6d1(%rip), %rdi    # 0x39b400
leaq 0x8cb21(%rip), %rsi     # 0x18b857
leaq 0x26e783(%rip), %rdx    # 0x36d4c0
addq $0x157c0, %rdx          # imm = 0x157C0
addq $0xc, %rdx
movb $0x0, %al
callq 0x9060
jmp 0xfeea4
leaq 0x26e765(%rip), %rax    # 0x36d4c0
cmpl $0xa, 0x157c4(%rax)
jl 0xfed92
leaq 0x26e755(%rip), %rax    # 0x36d4c0
movl 0x157c4(%rax), %edx
subl $0x1, %edx
movq -0x8(%rbp), %rcx
leaq 0x29c681(%rip), %rdi    # 0x39b400
leaq 0x8cb10(%rip), %rsi     # 0x18b896
movb $0x0, %al
callq 0x9060
jmp 0xfeea2
leaq 0x26e727(%rip), %rax    # 0x36d4c0
cmpl $0x0, 0x157c4(%rax)
je 0xfedd0
leaq 0x26e717(%rip), %rax    # 0x36d4c0
movl 0x157c4(%rax), %edx
subl $0x1, %edx
movq -0x8(%rbp), %rcx
leaq 0x29c643(%rip), %rdi    # 0x39b400
leaq 0x8cad2(%rip), %rsi     # 0x18b896
movb $0x0, %al
callq 0x9060
jmp 0xfeea0
leaq 0x26e6e9(%rip), %rax    # 0x36d4c0
cmpl $0xa, 0x157c0(%rax)
jl 0xfee0e
leaq 0x26e6d9(%rip), %rax    # 0x36d4c0
movl 0x157c0(%rax), %edx
subl $0x1, %edx
movq -0x8(%rbp), %rcx
leaq 0x29c605(%rip), %rdi    # 0x39b400
leaq 0x8caaa(%rip), %rsi     # 0x18b8ac
movb $0x0, %al
callq 0x9060
jmp 0xfee9e
leaq 0x26e6ab(%rip), %rax    # 0x36d4c0
cmpl $0x0, 0x157c0(%rax)
je 0xfee49
leaq 0x26e69b(%rip), %rax    # 0x36d4c0
movl 0x157c0(%rax), %edx
subl $0x1, %edx
movq -0x8(%rbp), %rcx
leaq 0x29c5c7(%rip), %rdi    # 0x39b400
leaq 0x8ca6c(%rip), %rsi     # 0x18b8ac
movb $0x0, %al
callq 0x9060
jmp 0xfee9c
leaq 0x26e670(%rip), %rax    # 0x36d4c0
cmpb $0x0, 0x158cd(%rax)
je 0xfee85
leaq 0x29c5a0(%rip), %rdi    # 0x39b400
leaq 0x8c9d2(%rip), %rsi     # 0x18b839
leaq 0x26e652(%rip), %rdx    # 0x36d4c0
addq $0x157c0, %rdx          # imm = 0x157C0
addq $0x10d, %rdx            # imm = 0x10D
movb $0x0, %al
callq 0x9060
jmp 0xfee9a
leaq 0x29c574(%rip), %rdi    # 0x39b400
leaq 0x8ca2d(%rip), %rsi     # 0x18b8c0
movb $0x0, %al
callq 0x9060
jmp 0xfee9c
jmp 0xfee9e
jmp 0xfeea0
jmp 0xfeea2
jmp 0xfeea4
jmp 0xfeea6
leaq 0x29c553(%rip), %rdi    # 0x39b400
callq 0x9120
cmpq $0x19, %rax
jbe 0xfeecf
leaq 0x29c541(%rip), %rdi    # 0x39b400
addq $0x16, %rdi
leaq 0x8ef7c(%rip), %rsi     # 0x18de46
callq 0x9350
jmp 0xfeed1
jmp 0xfeed3
jmp 0xfeed5
leaq 0x178a98(%rip), %rax    # 0x277974
movl (%rax), %edi
addl $0x4, %edi
leaq 0x178a90(%rip), %rax    # 0x277978
movl (%rax), %esi
movl $0xf, %edx
leaq 0x29c50a(%rip), %rcx    # 0x39b400
callq 0x10ee0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)