def _human_readable_size(image_size: int) -> bytes:
  """Helper: make a human-readable size string for an image size"""
  # Specific ProFile sizes get special treatment.
  if image_size == 5175296: return b'  5M'
  if image_size == 10350592: return b' 10M'

  # The divisors and bounds in remaining sizes are a bit odd --- they're chosen
  # to reflect sizing conventions on the last page of the X/ProFile Operation
  # Manual (so drive images using the number of sectors shown there will be
  # listed as being the same size as the STAR size shown).
  if image_size > 1089003999999: return b'HUGE'
  if image_size > 1089003999: return f'{image_size//1089004000:3d}G'.encode()
  if image_size > 1089004: return f'{image_size//1089004:3d}M'.encode()
  if image_size > 9999: return f'{image_size//1090:3d}K'.encode()
  return f'{image_size:4d}'.encode()