17.2.16 Naked Function Attribute

The naked attribute instructs the compiler to generate no prologue or epilogue code for the function. This attribute is intended for functions that exclusively contain extended inline assembly code. Using C code within such an attributed function might not work properly. Since the compiler will not generate prologue or epilogue code for functions using this attribute, the application code within is responsible for managing the stack and additionally handling formal parameters, return values, and the function return. For example:
void __attribute__ ((naked)) foo(void);