From a purely academic argument, sure it's possible, except you would be comparing machine-readable assembly code, and not human-readable source code.
But in practice it's not that simple, I don't know much about reverse engineering, but from a developer standpoint, code doesn't always do what...