/* 
 * Command line: opannotate --source ./branch-prediction 
 * 
 * Interpretation of command line:
 * Output annotated source file with samples
 * Output all files
 * 
 * CPU: P4 / Xeon, speed 2593.62 MHz (estimated)
 * Counted MISPRED_BRANCH_RETIRED events (retired mispredicted branches) with a unit mask of 0x01 (retired instruction is non-bogus) count 3000
 */
/* 
 * Total samples for file : "/root/programy/branch-prediction.cpp"
 * 
 * 166906 100.000
 */


               :#include <stdio.h>
               :#include <stdlib.h>
               :
               :int main(int argc, char **argv) /* main total: 166906 100.000 */
               :{
               :  int count = 1000000000;
               :  int i;
               :  
               :  int s = 7;
               :  int c1 = 0;
               :  int c2 = 0;
               :  
 83184 49.8388 :  for (i=1; i < count; ++i)
               :  {
               :    //s = (s + 7) % 10;
     1 6.0e-04 :    if (rand() % 2 == 0)
               :    {
 83721 50.1606 :      ++c1;
               :    }
               :    else
               :    {
               :      ++c2;
               :    }
               :    
               :  }
               :  
               :  printf("c1=%d c2=%d\n", c1, c2);
               :  
               :  return 0;
               :}
