title: Why does issuing empty asm commands swap variables?
body: <p>So I was messing around with inline assembly and compiled this using <strong>GCC 9</strong>.
  The result was that the two variables a and b were swapped without actually issuing any direct commands.</p>
  
  <pre><code>#include&lt;cstdio&gt;
  int main(){
      int a(1),b(2),c(3);
      asm ("": "=r"(c):"r"(a));
      asm ("": "=r"(a):"r"(b));
      asm ("": "=r"(b):"r"(c));
      printf("%d %d %d", a,b,c);
  }
  </code></pre>
  
  <p>Can somebody explain what is going on here?</p>