Use cog to generate the switch dispatch