title: Understanding the simplest LLVM IR
body: <p>I transform the simplest C code</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main()
  {
    return 0;
  }
  </code></pre>
  
  <p>to its LLVM IR, using </p>
  
  <pre><code>clang -emit-llvm -S hello.c 
  </code></pre>
  
  <p>The generated IR is:</p>
  
  <pre><code>define i32 @main() #0 {
    %1 = alloca i32, align 4
    store i32 0, i32* %1
    ret i32 0
  }
  </code></pre>
  
  <p>However, I do not understand this IR. (LLVM doc helps but not that much for beginners)</p>
  
  <ol>
  <li>Why do we have <code>%1 = alloca i32, align 4</code> ? What does it correspond to in the original code? </li>
  <li>Same question for <code>store i32 0, i32* %1</code></li>
  <li>Does alloca mean allocation on the stack (instead of the dynamic allocation)?</li>
  <li>What do 'align 4' mean?</li>
  </ol>