fix IR for 'if' statement