Simplified code and fixed comments.
Added some missing cases to ir_is_optimizable_mux.
irio: avoid writing out the types pointing to internal modes