title: Loop vs branching effeciency
body: <p>Which is more efficient --</p>
  
  <pre><code>foo-&gt;bar |= x;
  for(i=0; i&lt;n; i++)
  {  
      if (foo-&gt;bar &amp; SOMETHING)
          doOnething(i);
      else if (foo-&gt;bar &amp; SOMETHINGELSE)
          doSecondthing(i);
      else
          doAnotherThing(i);
  }
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>foo-&gt;bar |= x;
  if (foo-&gt;bar &amp; SOMETHING) {
      for(i=0; i&lt;n; i++) {
          doOneThing(i);
      }
  }
  else if (foo-&gt;bar &amp; SOMETHINGELSE) {
      for(i=0; i&lt;n; i++) {
          doSecondThing(i);
      }
  }
  else {
      for(i=0; i&lt;n; i++) {
          doAnotherThing(i);
      }
  }
  </code></pre>
  
  <p>I know there is an overhead cost associated with declaring loops but effectively it is being executed only once in both cases. Even though the work is the same during run time, there is more to do during compile time? Do we also have take into account where the pointer is being dereferenced?</p>
  
  <p>Thanks.</p>