renamed read_ir to print_ir_loop