inline decode() function