Your task, if you accept it, is to write a program/function that outputs/returns its input/args. The tricky part is that if I make your source code palindrome via duplicating reversed source code after the original code, the output must be returned "palindromize".
The source code will be only duplicated once.
Let's say your source code is
ABC and the input is
xyz. If i run
ABC the output must be
xyz. But if i run
ABCCBA instead, the output must be
Put it in a table:
Input: "xyz" code ABC => "xyz" code ABCCBA => "xyzzyx" (aware that it isn't "xyzyx")
Your code before processing should return the input.
Your code after processing should return the input with reversed input following no matter what input is.
Your code, no matter what, will be followed with a reversed code after it. Even if it's already palindrome by itself.
Multiline code will be treated as single line code but with
- Input can be taken in any convenient format.
- Output can be in any convenient format as well. As long as it follow the input-reversed input order.
- Standard Loopholes are forbidden.
This is code-golf so the answer with the fewest amount of bytes wins.