In a C-style calling convention, each function creates its own frame on the stack. This might look something like as follows.
push %rbp
mov %rsp, %rbp
Here the base pointer %rbp is pushed onto the stack for it to be restored later. The current stack pointer %rsp is then moved into the base pointer %rbp. From this point on, %rbp will point to the start of this function’s stack frame, where local variables may be stored.
Before exiting the function, the previous base pointer should be restored. The stack pointer should also align with it’s previous value before the call.
pop %rbp
ret