Here is my version of the X86 ABI. It makes different assumptions than is usual about what the reader already knows. I do not assume stack lore.
As the first instruction of a subroutine is about to be executed register RSP holds a value sp. sp = 8 mod 16. The space beginning much less than sp and ending at sp is unallocated and the subroutine may use it as it wishes. The subroutine should not depend on its initial contents.
When the subroutine is done it should restore registers RBP, RBX, R12 thru R15 to hold the same values as upon entry. RSP should hold sp−8. It should return to the address initially found at location sp−8.
There are further conventions on which registers hold arguments to the subroutine and how the answer comes back.
More oral tradition: