This script has evolved from a fairly simple "push" of the descriptive text into the Synology libraries overriding the default DSM text for the native CPU.
Now the patch script is trying to use hardware information exposed in Linux (/proc/cpuinfo) to update not only the CPU description but the number of cores and hyperthreads. However, this is a flawed approach, because DSM has a thread limit for actual hardware.
DS916+/DS918+/DS3615xs support a maximum of 8 threads of any type. This can be 8 physical cores, or 4 cores and 4 hyperthreads. But /proc/cpuinfo will not enumerate more than 8, regardless of how many cores and threads the CPU has. If you have an 6- or 8- core system, you will get the best performance by DISABLING hyperthreading with these DSM images so that all your actual cores are in play.
DS3617xs supports up to 16 threads of any type. This can be 16 physical cores, or 8 cores and 8 hyperthreads. The same limitations apply, if you had a dual X5660 Xeon system, each CPU with 6 cores and 6 HT's, you would be best served by disabling hyperthreading so all your cores were functional.
And just to confirm, the script itself addresses a purely cosmetic problem. It does not enable the use of CPU hardware. DSM uses the available cores and threads subject to the limitations above, regardless of what Control Panel says.