The compiler partitions the AVR general purpose registers into three sets.
The registers in the first set, R20 through R27, are used for parameter passing and returning function results and are not preserved across functions calls.
The registers in the second set, R0-R1 and R30-R31, are used for temporary results and are not preserved across functions calls.
The registers in the third set, R2 through R19, are used for registerized variables, working storage, and temporary results and must be preserved across function calls.