The variable Proto is moved at the beginning of the codegen() function.
According to the comment above, the pointed object should be used due the reference P.
Note: This bug was found by the MisusedMovedObject checker, part of the Clang Static Analyzer.