The gcc convention to return a value is that it is stored in eax. Let us consider the following (rather useless) C function:
This can implemented as the following assembly language subroutine:
One can easily argue that since we don’t have any local variables or parameters, the prologue and epilogue are not needed. That is true. However, they don’t hurt, either.