Like Adak said, split each of the cases into a separate function instead. Edit: Exactly as Matticus showed.

For example, assume you use this function to calculate a perfect hash of the four...