Name of a particular type of verbal riposte

In this type of riposte, you use your opponent's words, but rearrange them to be in your favor. For example, the story about Diogenes eating lentils:

Aristippus: "If you would learn to be subservient to the king, you wouldn't have to live off of lentils."
Diogenes: "If you would learn to live off of lentils, you wouldn't have to be subservient to the king."

I think the name has something to do with "Pyrrhic", but I'm not sure.


How about antistrophon or antimetabole?

Antistrophon

From The Phrontistery:

antistrophon: turning of opponent's own argument against them.

From The Free Dictionary:

antistrophon: an argument that is retorted against an opponent

Antimetabole

From yourdictionary.com, examples of rhetorical devices:

antimetabole: repeats words or phrases in reverse order. Example: “Ask not what your country can do for you — ask what you can do for your country.” (J. F. Kennedy)

From Wikipedia:

In rhetoric, antimetabole (/æntᵻməˈtæbəliː/ an-ti-mə-tab-ə-lee) is the repetition of words in successive clauses, but in transposed order (e.g., "I know what I like, and I like what I know"). It is identical to the modern sense of chiasmus, although the classical chiasmus did not necessarily use repetition, but only in some cases. An easier way of understanding what an antimetabole means is comparing it to the commutative property of addition and multiplication. This means that for example, a + b = b + a. In terms of applying this property to language, an example would be, dance to live, not live to dance. Also an antimetabole does not just have to be simple words switched around, they can also be clauses placed in the middle of sentences that are reversed. For example, “Some people say I am bad at mathematics because it is not my favorite subject, but in reality, mathematics is not my favorite subject because I am bad at it.” An antimetabole is also said to be a little too predictive because it is easy to reverse the key term, but they pose questions that one usually would not think of if the phrase was just asked or said the initial way. [emphasis added]