auto generate decode code