if (%a == foo) return 1
else if (%a == bar) return 2
else return Unknown

That would be a better way to do it than a goto. More easily readable, you can follow what is going on much more clearly.