title: Is it possible to call a built in function from assembly in C++
body: <p>Considering the following assembly code loop:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  #define ADD_LOOP(i, n, v)       \
  asm volatile (                  \
      "movw %1, %%cx      ;"      \
      "movq %2, %%rax     ;"      \
      "movq $0, %%rbx     ;"      \
      "for:               ;"      \
      "addq %%rax, %%rbx  ;"      \
      "decw %%cx          ;"      \
      "jnz for            ;"      \
      "movq %%rbx, %0     ;"      \
      : "=x"(v)                   \
      : "n"(i), "x"(n)            \
      : "%cx", "%rax", "%rbx"     \
  );
  
  int main() {
      uint16_t iter(10000);
      uint64_t num(5);
      uint64_t val;
  
      ADD_LOOP(iter, num, val)
  
      std::cout &lt;&lt; val &lt;&lt; std::endl;
  
      return 0;
  }
  </code></pre>
  
  <p>Is possible to call a C function (or it's machine code output) from within a loop as specified above?</p>
  
  <p>for example:</p>
  
  <pre><code>#include &lt;wmmintrin.h&gt;
  
  int main() {
      __m128i x, y;
  
      for(int i = 0; i &lt; 10; i++) {
          x = __builtin_ia32_aesenc128(x, y);
      }
  
      return 0;
  }
  </code></pre>
  
  <p>Thanks</p>