Removed local variables top, cs, and user and access directly member variables top_, cs_, and user_.
The local variable trail is preserved to suppourt register optimization.
Other variables don't contribute increasing speed even though they are on registers.
Replaced NULL with nullptr.
Removed C-style casts.
Added comments that how to compile and run it.