What is the origin of tatterdemalion?

Tatterdemalion “unkempt or dilapidated,” first written tatter-de-mallian, is of uncertain origin, but there are some potential leads. The first element is likely tatter “a torn piece hanging loose from a garment,” from Old Norse tǫturr “rag,” but an alternative proposal based on outdated uses of tatterdemalion connects the term to Tatar or Tartar, a member of one of many ethnic Turkic groups of northwestern and central Asia, and both words once meant “wanderer, vagabond.” The second element, de (also ti), appears to be a common element in fanciful, elaborate, and nonsensical terms, from gobbledegook, hobbledehoy, and slubberdegullion to flibbertigibbet and dandiprat. The significance of the final element, malion, is unfortunately lost to history. Tatterdemalion was first recorded in the first decade of the 17th century.