title: Why is 0x20 subtracted from the stack pointer in the prologue of this function's code?
body: <pre><code>void main(){
      int c;
      c = function(1, 2);
  }
  
  int function(int a, int b){
        char buf[10];
        a = a+b;
        return a;
  }
  </code></pre>
  
  <p>Assembly code:</p>
  
  <pre><code>          main:
  08048394:   push %ebp
  08048395:   mov %esp,%ebp
  08048397:   and $0xfffffff0,%esp
  **0804839a:   sub $0x20,%esp   &lt;-----------------------???????**
  0804839d:   movl $0x2,0x4(%esp)
  080483a5:   movl $0x1,(%esp)
  080483ac:   call 0x80483b7 &lt;function&gt;
  080483b1:   mov %eax,0x1c(%esp)
  080483b5:   leave 
  080483b6:   ret 
            function:
  080483b7:   push %ebp
  080483b8:   mov %esp,%ebp
  080483ba:   sub $0x10,%esp
  080483bd:   mov 0xc(%ebp),%eax
  080483c0:   add %eax,0x8(%ebp)
  080483c3:   mov 0x8(%ebp),%eax
  080483c6:   leave 
  080483c7:   ret 
  </code></pre>
  
  <p>i know aligned by 16-byte,<br>
  but, in main(), <code>int c(=4 byte) + 1(4byte) + 2(4byte) in function(1 ,2)</code> call statement.</p>
  
  <p>so sum of this is 12byte. but by memory aligned, i espect 16byte. </p>
  
  <pre><code>(sub 0x10, %esp)
  </code></pre>
  
  <p>why sub <code>0x20, %esp</code>?</p>