#include int foo(int x){ printf("Foo was called with paramter %d\n", x); return x*12; } // Clang likes prototypes here // gcc doesn't care // Both will build just fine without the next two lines int bar(); int add_3(int); asm("bar: " "mov $3, %rax; " "ret;"); asm("add_3: add $3, %rdi; mov %rdi, %rax; ret;"); int main(){ asm("mov $92, %rdi; call foo; mov %rax, %rdi; call foo;"); printf("Bar returned %d\n", bar()); printf("add_3 returned %d\n", add_3(80)); sleep(120); return 0; }