You took the examples where the number of parentheses is the same. Here is a more honest example:
if (a && !b) {expr} => (if (and (a) (not b)) (expr))
That's a simple expression and I'm not even sure I managed to match the () correctly