It has to call(a) twice.
There may be something else being done in call(), globals read/altered, files used, hardware accessed etc. VAX Pascal has a directive, called something like 'deterministic', which means that a routine, when called with the same parameters, will return the same result and not affect anything else. The alternatives are a scheme like this, or the compiler analyzes the routine and determines whether it is deterministic or has any side effects. I'm sure our compiler writing friends would be happy to spend a very large amount of time writing this. This is related to the reason why short-circuit evaluation should not be done unless requested. Some other bit of program may rely on all the components being evaluated if they are functions.
Regards. Richard.