Rewrite the hexdump_region again to simplify the logic.