// File: /workspace/github_cpp_makefile_star2_O3/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 0x251ff2(%rip), %rax    # 0x30c7a8
cmpb $0x0, (%rax)
jne 0xba7d3
leaq 0x15e016(%rip), %rax    # 0x2187d8
cmpl $0x0, (%rax)
je 0xba7d4
leaq 0x18478a(%rip), %rax    # 0x23ef58
cmpl $0x0, (%rax)
je 0xba7d4
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x253aff(%rip), %rax    # 0x30e2e0
cmpl $0x0, 0x179e8(%rax)
leaq 0x6dc40(%rip), %rdx     # 0x12842f
leaq 0x6835a(%rip), %rcx     # 0x122b50
cmovneq %rdx, %rcx
cmpl $0x0, 0x179f4(%rax)
cmoveq %rdx, %rcx
leaq 0x184732(%rip), %rdx    # 0x23ef3e
cmpb $0x0, (%rdx)
je 0xba859
movl 0x157c4(%rax), %edx
testl %edx, %edx
je 0xba8f7
cmpl $0x3e7, %edx            # imm = 0x3E7
je 0xba833
cmpl $0x270f, %edx           # imm = 0x270F
jne 0xba917
movl $0x157cc, %edx          # imm = 0x157CC
addq 0x957a1(%rip), %rdx     # 0x14ffe0
leaq 0x2819da(%rip), %rdi    # 0x33c220
leaq 0x6dbe8(%rip), %rsi     # 0x128435
xorl %eax, %eax
callq 0x9060
jmp 0xba92e
leaq 0x253120(%rip), %rdx    # 0x30d980
movzwl (%rdx), %edx
testl %edx, %edx
setne %dil
leaq 0x253114(%rip), %rsi    # 0x30d984
movl (%rsi), %esi
testl %esi, %esi
setne %r8b
andb %dil, %r8b
cmpb $0x1, %r8b
jne 0xba8c4
movl 0x157c4(%rax), %r8d
cmpl $0x3e7, %r8d            # imm = 0x3E7
je 0xba89e
cmpl $0x270f, %r8d           # imm = 0x270F
jne 0xba9fc
movl $0x157cc, %edx          # imm = 0x157CC
addq 0x95736(%rip), %rdx     # 0x14ffe0
leaq 0x28196f(%rip), %rdi    # 0x33c220
leaq 0x6dbb3(%rip), %rsi     # 0x12846b
xorl %eax, %eax
callq 0x9060
jmp 0xbab2c
leaq 0x15e005(%rip), %rdx    # 0x2188d0
cmpq $0x400, (%rdx)          # imm = 0x400
jne 0xba9c3
leaq 0x281941(%rip), %rax    # 0x33c220
movabsq $0x6e6f4e203a4d4f43, %rcx # imm = 0x6E6F4E203A4D4F43
movq %rcx, (%rax)
movw $0x65, 0x8(%rax)
jmp 0xba997
movl 0x157c0(%rax), %edx
testl %edx, %edx
je 0xbaa1e
decl %edx
leaq 0x281912(%rip), %rdi    # 0x33c220
leaq 0x6db30(%rip), %rsi     # 0x128445
jmp 0xba927
decl %edx
leaq 0x281900(%rip), %rdi    # 0x33c220
leaq 0x6db16(%rip), %rsi     # 0x12843d
xorl %eax, %eax
callq 0x9060
leaq 0x2818eb(%rip), %rbx    # 0x33c220
movq %rbx, %rdi
callq 0x9120
cmpq $0x11, %rax
jb 0xba94a
movl $0x2e2e2e, 0xd(%rbx)    # imm = 0x2E2E2E
leaq 0x15de43(%rip), %rax    # 0x218794
movl (%rax), %edi
addl $0x5, %edi
leaq 0x15de3b(%rip), %rax    # 0x218798
movl (%rax), %esi
leaq 0x2818ba(%rip), %rbx    # 0x33c220
movl $0xf, %edx
movq %rbx, %rcx
callq 0xe787
leaq 0x253006(%rip), %rax    # 0x30d980
movzwl (%rax), %edx
leaq 0x253000(%rip), %rax    # 0x30d984
movl (%rax), %ecx
leaq 0x6dace(%rip), %rsi     # 0x12845b
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
leaq 0x15ddf6(%rip), %rax    # 0x218794
movl (%rax), %edi
addl $0x4, %edi
leaq 0x15ddee(%rip), %rax    # 0x218798
movl (%rax), %esi
leaq 0x28186d(%rip), %rcx    # 0x33c220
movl $0xf, %edx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xe787
movl 0x157c4(%rax), %edx
cmpl $0x3e7, %edx            # imm = 0x3E7
je 0xba9d9
cmpl $0x270f, %edx           # imm = 0x270F
jne 0xbaa4a
movl $0x157cc, %edx          # imm = 0x157CC
addq 0x955fb(%rip), %rdx     # 0x14ffe0
leaq 0x281834(%rip), %rdi    # 0x33c220
leaq 0x6da78(%rip), %rsi     # 0x12846b
xorl %eax, %eax
callq 0x9060
jmp 0xbaa6e
movl %esi, %ecx
cmpl $0xa, %r8d
jl 0xbaa93
decl %r8d
leaq 0x28180e(%rip), %rdi    # 0x33c220
leaq 0x6d64d(%rip), %rsi     # 0x128066
jmp 0xbab25
cmpb $0x0, 0x158cd(%rax)
je 0xbaaab
movl $0x158cd, %edx          # imm = 0x158CD
addq 0x955a9(%rip), %rdx     # 0x14ffe0
leaq 0x2817e2(%rip), %rdi    # 0x33c220
leaq 0x6da08(%rip), %rsi     # 0x12844d
jmp 0xba84d
cmpl $0xa, %edx
jge 0xbaa57
testl %edx, %edx
je 0xbaaeb
decl %edx
leaq 0x2817c0(%rip), %rdi    # 0x33c220
leaq 0x6da43(%rip), %rsi     # 0x1284aa
xorl %eax, %eax
callq 0x9060
leaq 0x2817ab(%rip), %rbx    # 0x33c220
movq %rbx, %rdi
callq 0x9120
cmpq $0x1a, %rax
jb 0xba997
movl $0x2e2e2e, 0x16(%rbx)   # imm = 0x2E2E2E
jmp 0xba997
testl %r8d, %r8d
je 0xbaacb
decl %r8d
leaq 0x28177e(%rip), %rdi    # 0x33c220
leaq 0x6d5d3(%rip), %rsi     # 0x12807c
jmp 0xbab25
leaq 0x28176e(%rip), %rax    # 0x33c220
movabsq $0x6f6e203a4d4f4320, %rcx # imm = 0x6F6E203A4D4F4320
movq %rcx, (%rax)
movl $0x656e6f, 0x7(%rax)    # imm = 0x656E6F
jmp 0xba92e
movl 0x157c0(%rax), %r8d
cmpl $0xa, %r8d
jl 0xbab0f
decl %r8d
leaq 0x28173e(%rip), %rdi    # 0x33c220
leaq 0x6d550(%rip), %rsi     # 0x128039
jmp 0xbab25
movl 0x157c0(%rax), %edx
cmpl $0xa, %edx
jge 0xbaafa
testl %edx, %edx
je 0xbab79
decl %edx
leaq 0x28171d(%rip), %rdi    # 0x33c220
leaq 0x6d9b6(%rip), %rsi     # 0x1284c0
jmp 0xbaa67
testl %r8d, %r8d
je 0xbab51
decl %r8d
leaq 0x281702(%rip), %rdi    # 0x33c220
leaq 0x6d52a(%rip), %rsi     # 0x12804f
xorl %eax, %eax
callq 0x9060
leaq 0x2816ed(%rip), %rbx    # 0x33c220
movq %rbx, %rdi
callq 0x9120
cmpq $0x1c, %rax
jb 0xba997
movl $0x2e2e2e, 0x18(%rbx)   # imm = 0x2E2E2E
jmp 0xba997
cmpb $0x0, 0x158cd(%rax)
je 0xbaba1
movl $0x158cd, %edx          # imm = 0x158CD
addq 0x9547a(%rip), %rdx     # 0x14ffe0
leaq 0x2816b3(%rip), %rdi    # 0x33c220
leaq 0x6d905(%rip), %rsi     # 0x128479
jmp 0xba8b8
cmpb $0x0, 0x158cd(%rax)
je 0xbabbb
movl $0x158cd, %edx          # imm = 0x158CD
addq 0x95452(%rip), %rdx     # 0x14ffe0
leaq 0x28168b(%rip), %rdi    # 0x33c220
leaq 0x6d8b1(%rip), %rsi     # 0x12844d
jmp 0xba9f3
leaq 0x281678(%rip), %rdi    # 0x33c220
leaq 0x6d8d8(%rip), %rsi     # 0x128487
xorl %eax, %eax
callq 0x9060
jmp 0xbab2c
movups 0x6d912(%rip), %xmm0    # 0x1284d4
leaq 0x281657(%rip), %rax    # 0x33c220
movaps %xmm0, (%rax)
movabsq $0x20202020202020, %rcx # imm = 0x20202020202020
movq %rcx, 0xf(%rax)
jmp 0xbaa6e