Lib: printRegister function