r300/compiler: Refactor rewrite_depth_out to use rc_program