static int sum(int a, int b)
{
+#if defined(__i386__) || defined(__x86_64__)
+ int ret;
+ __asm__("addl %2, %1\n\t"
+ : "=a"(ret) /* %0 bound to %eax */
+ : "a"(a), "r"(b) /* %1 is 'a' bound to %eax, %2 is 'b' */
+ );
+ return ret;
+#else
return a + b;
+#endif
}
int main(void)