/ =&gt; 30 instructions w/ div/mul
  // char *buf;
  // buf -= ((i &lt;&lt; 0x3) + 0xf) / 0x10 * 0x10
}
</code></pre>
<p>In terms of security, 
such a code pattern makes it hard 
to estimate the stack usage, 
otherwise incurring a stack clash in the kernel space.
Also, although often not emphasized enough,
this pattern 
makes it easier to exploit the uninitialized-use vulnerability: 
e.g., placing arbitrary data to the proper offset
of the kernel stack.
In terms of performance,
this benign looking code 
is 