// File: /workspace/github_cpp_makefile_star2_O1/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 0x2526e4(%rip), %rax    # 0x30c7a8
cmpb $0x0, (%rax)
jne 0xba0e1
leaq 0x15e708(%rip), %rax    # 0x2187d8
cmpl $0x0, (%rax)
je 0xba0e2
leaq 0x184e7c(%rip), %rax    # 0x23ef58
cmpl $0x0, (%rax)
je 0xba0e2
retq
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x2541f1(%rip), %rax    # 0x30e2e0
cmpl $0x0, 0x179e8(%rax)
leaq 0x6e267(%rip), %rdx     # 0x128364
leaq 0x6896c(%rip), %rcx     # 0x122a70
cmovneq %rdx, %rcx
cmpl $0x0, 0x179f4(%rax)
cmoveq %rdx, %rcx
leaq 0x184e24(%rip), %rdx    # 0x23ef3e
cmpb $0x0, (%rdx)
je 0xba167
movl 0x157c4(%rax), %edx
testl %edx, %edx
je 0xba205
cmpl $0x3e7, %edx            # imm = 0x3E7
je 0xba141
cmpl $0x270f, %edx           # imm = 0x270F
jne 0xba225
movl $0x157cc, %edx          # imm = 0x157CC
addq 0x95e93(%rip), %rdx     # 0x14ffe0
leaq 0x2820cc(%rip), %rdi    # 0x33c220
leaq 0x6e20f(%rip), %rsi     # 0x12836a
xorl %eax, %eax
callq 0x9060
jmp 0xba23c
leaq 0x253812(%rip), %rdx    # 0x30d980
movzwl (%rdx), %edx
testl %edx, %edx
setne %dil
leaq 0x253806(%rip), %rsi    # 0x30d984
movl (%rsi), %esi
testl %esi, %esi
setne %r8b
andb %dil, %r8b
cmpb $0x1, %r8b
jne 0xba1d2
movl 0x157c4(%rax), %r8d
cmpl $0x3e7, %r8d            # imm = 0x3E7
je 0xba1ac
cmpl $0x270f, %r8d           # imm = 0x270F
jne 0xba30a
movl $0x157cc, %edx          # imm = 0x157CC
addq 0x95e28(%rip), %rdx     # 0x14ffe0
leaq 0x282061(%rip), %rdi    # 0x33c220
leaq 0x6e1da(%rip), %rsi     # 0x1283a0
xorl %eax, %eax
callq 0x9060
jmp 0xba43a
leaq 0x15e6f7(%rip), %rdx    # 0x2188d0
cmpq $0x400, (%rdx)          # imm = 0x400
jne 0xba2d1
leaq 0x282033(%rip), %rax    # 0x33c220
movabsq $0x6e6f4e203a4d4f43, %rcx # imm = 0x6E6F4E203A4D4F43
movq %rcx, (%rax)
movw $0x65, 0x8(%rax)
jmp 0xba2a5
movl 0x157c0(%rax), %edx
testl %edx, %edx
je 0xba32c
decl %edx
leaq 0x282004(%rip), %rdi    # 0x33c220
leaq 0x6e157(%rip), %rsi     # 0x12837a
jmp 0xba235
decl %edx
leaq 0x281ff2(%rip), %rdi    # 0x33c220
leaq 0x6e13d(%rip), %rsi     # 0x128372
xorl %eax, %eax
callq 0x9060
leaq 0x281fdd(%rip), %rbx    # 0x33c220
movq %rbx, %rdi
callq 0x9120
cmpq $0x11, %rax
jb 0xba258
movl $0x2e2e2e, 0xd(%rbx)    # imm = 0x2E2E2E
leaq 0x15e535(%rip), %rax    # 0x218794
movl (%rax), %edi
addl $0x5, %edi
leaq 0x15e52d(%rip), %rax    # 0x218798
movl (%rax), %esi
leaq 0x281fac(%rip), %rbx    # 0x33c220
movl $0xf, %edx
movq %rbx, %rcx
callq 0xe7d0
leaq 0x2536f8(%rip), %rax    # 0x30d980
movzwl (%rax), %edx
leaq 0x2536f2(%rip), %rax    # 0x30d984
movl (%rax), %ecx
leaq 0x6e0f5(%rip), %rsi     # 0x128390
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
leaq 0x15e4e8(%rip), %rax    # 0x218794
movl (%rax), %edi
addl $0x4, %edi
leaq 0x15e4e0(%rip), %rax    # 0x218798
movl (%rax), %esi
leaq 0x281f5f(%rip), %rcx    # 0x33c220
movl $0xf, %edx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xe7d0
movl 0x157c4(%rax), %edx
cmpl $0x3e7, %edx            # imm = 0x3E7
je 0xba2e7
cmpl $0x270f, %edx           # imm = 0x270F
jne 0xba358
movl $0x157cc, %edx          # imm = 0x157CC
addq 0x95ced(%rip), %rdx     # 0x14ffe0
leaq 0x281f26(%rip), %rdi    # 0x33c220
leaq 0x6e09f(%rip), %rsi     # 0x1283a0
xorl %eax, %eax
callq 0x9060
jmp 0xba37c
movl %esi, %ecx
cmpl $0xa, %r8d
jl 0xba3a1
decl %r8d
leaq 0x281f00(%rip), %rdi    # 0x33c220
leaq 0x6dc74(%rip), %rsi     # 0x127f9b
jmp 0xba433
cmpb $0x0, 0x158cd(%rax)
je 0xba3b9
movl $0x158cd, %edx          # imm = 0x158CD
addq 0x95c9b(%rip), %rdx     # 0x14ffe0
leaq 0x281ed4(%rip), %rdi    # 0x33c220
leaq 0x6e02f(%rip), %rsi     # 0x128382
jmp 0xba15b
cmpl $0xa, %edx
jge 0xba365
testl %edx, %edx
je 0xba3f9
decl %edx
leaq 0x281eb2(%rip), %rdi    # 0x33c220
leaq 0x6e06a(%rip), %rsi     # 0x1283df
xorl %eax, %eax
callq 0x9060
leaq 0x281e9d(%rip), %rbx    # 0x33c220
movq %rbx, %rdi
callq 0x9120
cmpq $0x1a, %rax
jb 0xba2a5
movl $0x2e2e2e, 0x16(%rbx)   # imm = 0x2E2E2E
jmp 0xba2a5
testl %r8d, %r8d
je 0xba3d9
decl %r8d
leaq 0x281e70(%rip), %rdi    # 0x33c220
leaq 0x6dbfa(%rip), %rsi     # 0x127fb1
jmp 0xba433
leaq 0x281e60(%rip), %rax    # 0x33c220
movabsq $0x6f6e203a4d4f4320, %rcx # imm = 0x6F6E203A4D4F4320
movq %rcx, (%rax)
movl $0x656e6f, 0x7(%rax)    # imm = 0x656E6F
jmp 0xba23c
movl 0x157c0(%rax), %r8d
cmpl $0xa, %r8d
jl 0xba41d
decl %r8d
leaq 0x281e30(%rip), %rdi    # 0x33c220
leaq 0x6db77(%rip), %rsi     # 0x127f6e
jmp 0xba433
movl 0x157c0(%rax), %edx
cmpl $0xa, %edx
jge 0xba408
testl %edx, %edx
je 0xba487
decl %edx
leaq 0x281e0f(%rip), %rdi    # 0x33c220
leaq 0x6dfdd(%rip), %rsi     # 0x1283f5
jmp 0xba375
testl %r8d, %r8d
je 0xba45f
decl %r8d
leaq 0x281df4(%rip), %rdi    # 0x33c220
leaq 0x6db51(%rip), %rsi     # 0x127f84
xorl %eax, %eax
callq 0x9060
leaq 0x281ddf(%rip), %rbx    # 0x33c220
movq %rbx, %rdi
callq 0x9120
cmpq $0x1c, %rax
jb 0xba2a5
movl $0x2e2e2e, 0x18(%rbx)   # imm = 0x2E2E2E
jmp 0xba2a5
cmpb $0x0, 0x158cd(%rax)
je 0xba4af
movl $0x158cd, %edx          # imm = 0x158CD
addq 0x95b6c(%rip), %rdx     # 0x14ffe0
leaq 0x281da5(%rip), %rdi    # 0x33c220
leaq 0x6df2c(%rip), %rsi     # 0x1283ae
jmp 0xba1c6
cmpb $0x0, 0x158cd(%rax)
je 0xba4c9
movl $0x158cd, %edx          # imm = 0x158CD
addq 0x95b44(%rip), %rdx     # 0x14ffe0
leaq 0x281d7d(%rip), %rdi    # 0x33c220
leaq 0x6ded8(%rip), %rsi     # 0x128382
jmp 0xba301
leaq 0x281d6a(%rip), %rdi    # 0x33c220
leaq 0x6deff(%rip), %rsi     # 0x1283bc
xorl %eax, %eax
callq 0x9060
jmp 0xba43a
movups 0x6df39(%rip), %xmm0    # 0x128409
leaq 0x281d49(%rip), %rax    # 0x33c220
movaps %xmm0, (%rax)
movabsq $0x20202020202020, %rcx # imm = 0x20202020202020
movq %rcx, 0xf(%rax)
jmp 0xba37c