// File: /workspace/github_cpp_makefile_star2_O2/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:
leaq 0x24c98b(%rip), %rax    # 0x2f67a8
cmpb $0x0, (%rax)
jne 0xa9e3a
leaq 0x1589af(%rip), %rax    # 0x2027d8
cmpl $0x0, (%rax)
je 0xa9e3b
leaq 0x17f123(%rip), %rax    # 0x228f58
cmpl $0x0, (%rax)
je 0xa9e3b
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x24e498(%rip), %rax    # 0x2f82e0
cmpl $0x0, 0x179e8(%rax)
leaq 0x6851e(%rip), %rdx     # 0x112374
leaq 0x62c3b(%rip), %rcx     # 0x10ca98
cmovneq %rdx, %rcx
cmpl $0x0, 0x179f4(%rax)
cmoveq %rdx, %rcx
leaq 0x17f0cb(%rip), %rdx    # 0x228f3e
cmpb $0x0, (%rdx)
je 0xa9ec0
movl 0x157c4(%rax), %edx
testl %edx, %edx
je 0xa9f5e
cmpl $0x3e7, %edx            # imm = 0x3E7
je 0xa9e9a
cmpl $0x270f, %edx           # imm = 0x270F
jne 0xa9f7e
movl $0x157cc, %edx          # imm = 0x157CC
addq 0x9013a(%rip), %rdx     # 0x139fe0
leaq 0x27c373(%rip), %rdi    # 0x326220
leaq 0x684c6(%rip), %rsi     # 0x11237a
xorl %eax, %eax
callq 0x9060
jmp 0xa9f95
leaq 0x24dab9(%rip), %rdx    # 0x2f7980
movzwl (%rdx), %edx
testl %edx, %edx
setne %dil
leaq 0x24daad(%rip), %rsi    # 0x2f7984
movl (%rsi), %esi
testl %esi, %esi
setne %r8b
andb %dil, %r8b
cmpb $0x1, %r8b
jne 0xa9f2b
movl 0x157c4(%rax), %r8d
cmpl $0x3e7, %r8d            # imm = 0x3E7
je 0xa9f05
cmpl $0x270f, %r8d           # imm = 0x270F
jne 0xaa05f
movl $0x157cc, %edx          # imm = 0x157CC
addq 0x900cf(%rip), %rdx     # 0x139fe0
leaq 0x27c308(%rip), %rdi    # 0x326220
leaq 0x68491(%rip), %rsi     # 0x1123b0
xorl %eax, %eax
callq 0x9060
jmp 0xaa18f
leaq 0x15899e(%rip), %rdx    # 0x2028d0
cmpq $0x400, (%rdx)          # imm = 0x400
jne 0xaa026
leaq 0x27c2da(%rip), %rax    # 0x326220
movabsq $0x6e6f4e203a4d4f43, %rcx # imm = 0x6E6F4E203A4D4F43
movq %rcx, (%rax)
movw $0x65, 0x8(%rax)
jmp 0xa9ffc
movl 0x157c0(%rax), %edx
testl %edx, %edx
je 0xaa081
decl %edx
leaq 0x27c2ab(%rip), %rdi    # 0x326220
leaq 0x6840e(%rip), %rsi     # 0x11238a
jmp 0xa9f8e
decl %edx
leaq 0x27c299(%rip), %rdi    # 0x326220
leaq 0x683f4(%rip), %rsi     # 0x112382
xorl %eax, %eax
callq 0x9060
leaq 0x27c284(%rip), %rbx    # 0x326220
movq %rbx, %rdi
callq 0x9120
cmpq $0x11, %rax
jb 0xa9fb1
movl $0x2e2e2e, 0xd(%rbx)    # imm = 0x2E2E2E
leaq 0x1587dc(%rip), %rax    # 0x202794
movl (%rax), %edi
addl $0x5, %edi
leaq 0x1587d4(%rip), %rax    # 0x202798
movl (%rax), %esi
leaq 0x27c253(%rip), %rbx    # 0x326220
pushq $0xf
popq %rdx
movq %rbx, %rcx
callq 0xe2d2
leaq 0x24d9a1(%rip), %rax    # 0x2f7980
movzwl (%rax), %edx
leaq 0x24d99b(%rip), %rax    # 0x2f7984
movl (%rax), %ecx
leaq 0x683ae(%rip), %rsi     # 0x1123a0
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
leaq 0x158791(%rip), %rax    # 0x202794
movl (%rax), %edi
addl $0x4, %edi
leaq 0x158789(%rip), %rax    # 0x202798
movl (%rax), %esi
leaq 0x27c208(%rip), %rcx    # 0x326220
pushq $0xf
popq %rdx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xe2d2
movl 0x157c4(%rax), %edx
cmpl $0x3e7, %edx            # imm = 0x3E7
je 0xaa03c
cmpl $0x270f, %edx           # imm = 0x270F
jne 0xaa0ad
movl $0x157cc, %edx          # imm = 0x157CC
addq 0x8ff98(%rip), %rdx     # 0x139fe0
leaq 0x27c1d1(%rip), %rdi    # 0x326220
leaq 0x6835a(%rip), %rsi     # 0x1123b0
xorl %eax, %eax
callq 0x9060
jmp 0xaa0d1
movl %esi, %ecx
cmpl $0xa, %r8d
jl 0xaa0f6
decl %r8d
leaq 0x27c1ab(%rip), %rdi    # 0x326220
leaq 0x67f2f(%rip), %rsi     # 0x111fab
jmp 0xaa188
cmpb $0x0, 0x158cd(%rax)
je 0xaa10e
movl $0x158cd, %edx          # imm = 0x158CD
addq 0x8ff46(%rip), %rdx     # 0x139fe0
leaq 0x27c17f(%rip), %rdi    # 0x326220
leaq 0x682ea(%rip), %rsi     # 0x112392
jmp 0xa9eb4
cmpl $0xa, %edx
jge 0xaa0ba
testl %edx, %edx
je 0xaa14e
decl %edx
leaq 0x27c15d(%rip), %rdi    # 0x326220
leaq 0x68325(%rip), %rsi     # 0x1123ef
xorl %eax, %eax
callq 0x9060
leaq 0x27c148(%rip), %rbx    # 0x326220
movq %rbx, %rdi
callq 0x9120
cmpq $0x1a, %rax
jb 0xa9ffc
movl $0x2e2e2e, 0x16(%rbx)   # imm = 0x2E2E2E
jmp 0xa9ffc
testl %r8d, %r8d
je 0xaa12e
decl %r8d
leaq 0x27c11b(%rip), %rdi    # 0x326220
leaq 0x67eb5(%rip), %rsi     # 0x111fc1
jmp 0xaa188
leaq 0x27c10b(%rip), %rax    # 0x326220
movabsq $0x6f6e203a4d4f4320, %rcx # imm = 0x6F6E203A4D4F4320
movq %rcx, (%rax)
movl $0x656e6f, 0x7(%rax)    # imm = 0x656E6F
jmp 0xa9f95
movl 0x157c0(%rax), %r8d
cmpl $0xa, %r8d
jl 0xaa172
decl %r8d
leaq 0x27c0db(%rip), %rdi    # 0x326220
leaq 0x67e32(%rip), %rsi     # 0x111f7e
jmp 0xaa188
movl 0x157c0(%rax), %edx
cmpl $0xa, %edx
jge 0xaa15d
testl %edx, %edx
je 0xaa1dc
decl %edx
leaq 0x27c0ba(%rip), %rdi    # 0x326220
leaq 0x68298(%rip), %rsi     # 0x112405
jmp 0xaa0ca
testl %r8d, %r8d
je 0xaa1b4
decl %r8d
leaq 0x27c09f(%rip), %rdi    # 0x326220
leaq 0x67e0c(%rip), %rsi     # 0x111f94
xorl %eax, %eax
callq 0x9060
leaq 0x27c08a(%rip), %rbx    # 0x326220
movq %rbx, %rdi
callq 0x9120
cmpq $0x1c, %rax
jb 0xa9ffc
movl $0x2e2e2e, 0x18(%rbx)   # imm = 0x2E2E2E
jmp 0xa9ffc
cmpb $0x0, 0x158cd(%rax)
je 0xaa204
movl $0x158cd, %edx          # imm = 0x158CD
addq 0x8fe17(%rip), %rdx     # 0x139fe0
leaq 0x27c050(%rip), %rdi    # 0x326220
leaq 0x681e7(%rip), %rsi     # 0x1123be
jmp 0xa9f1f
cmpb $0x0, 0x158cd(%rax)
je 0xaa21e
movl $0x158cd, %edx          # imm = 0x158CD
addq 0x8fdef(%rip), %rdx     # 0x139fe0
leaq 0x27c028(%rip), %rdi    # 0x326220
leaq 0x68193(%rip), %rsi     # 0x112392
jmp 0xaa056
leaq 0x27c015(%rip), %rdi    # 0x326220
leaq 0x681ba(%rip), %rsi     # 0x1123cc
xorl %eax, %eax
callq 0x9060
jmp 0xaa18f
movups 0x681f4(%rip), %xmm0    # 0x112419
leaq 0x27bff4(%rip), %rax    # 0x326220
movaps %xmm0, (%rax)
movabsq $0x20202020202020, %rcx # imm = 0x20202020202020
movq %rcx, 0xf(%rax)
jmp 0xaa0d1