Confusion with a simple assembly code for AVR
First of all what is R1 which is not declared? 


r0 ... r31 are the AVR's general purpose registers. r1 is set to 0x00 by the start up code gcc implicitly generates and is then assumed by the compiler to contain 0x00 forever. Hence, wherever 0x00 is needed but a literal cannot be used, gcc simply uses r1. (Similarily, r0 is reserved as temporary storage register and may be used for any purpose in any piece of code because gcc will never use it to store anything across a function call or an inline assembly section.)

See also https://gcc.gnu.org/wiki/avr-gcc#Register_Layout.


  And my code has nothing to do with PINB register but how come the PINB's PINB0, PINB1 and PINB2 becomes 1 here? 


PINx represents the value (high/low) as seen on the pin. When you output a value via PORTx, that value also is reflected in the PINx (delayed by 1 clock cycle, IIRC). That's also explicitly mentioned in the datasheets.