You can study the code and experiment with it. No guarantees, you know. Code is free only for educational purposes.
The code was created as part of solving test problems on one of the sites for programmers, so you may not be interested in this.
You need at least Intel Pentium D, or comment popcnt instruction in assembly source.
make [debug | clean]
./main
Have a fun.