Port of cc code for `if`