making ugly print_ir switch a little bit better