title: Can the place of function declaration in C affect the branch prediction?
body: <p>Here's a code:</p>
  <pre><code>#include &lt;stdio.h&gt;
  
  /* declaration */
  int square (int num);
  
  int main() {
      int x, result;
    
      x = 5;
      result = square(x);
      printf(&quot;%d squared is %d\n&quot;, x, result);
      
      return 0;
  }
  
  /* definition */
  int square (int num) {
      int y;
  
      y = num * num;
  
      return(y);
  }
  </code></pre>
  <p>And when I change it like this:</p>
  <pre><code>#include &lt;stdio.h&gt;
  /* declaration */
  
  int main() {
      int x, result;
    
      x = 5;
      result = square(x);
      printf(&quot;%d squared is %d\n&quot;, x, result);
      
      return 0;
  }
  
  /* definition */
  int square (int num);
  int square (int num) {
      int y;
  
      y = num * num;
  
      return(y);
  }
  </code></pre>
  <p>I get the warning:</p>
  <pre><code>Implicit declaration of the function 'square'
  </code></pre>
  <p>Does this warning has any relation with the branch prediction things? Does the former code improves branch prediction and hence the performance of the code (as the function call branches/diverts the execution from the normal execution of the code!?)</p>