if(a=x) is equivalent to if(x) in addition to a assigned with x. So if the expression x evaluates to a non-zero value, then if(x) simply becomes if(true). Otherwise, it becomes if(false).
In your case, since x = 5, that means f(a=5) is equivalent to if(true) in addition to a assigned with 5.