Like someone else who replied, I shortcircuited the whole thing & counted the delimiters (well, more specifically the spaces between the delimiters), assuming it was an obfuscation question not a "Haha! Tricked you!" question.
Took one skim of the code under the Tally CTE and my brain went "bleh". Seen much cleaner string-splitters.
An exercise in picking through nested functions & conditional statements if nothing else.
MARCUS. Why dost thou laugh? It fits not with this hour.
TITUS. Why, I have not another tear to shed;
--Titus Andronicus, William Shakespeare