NEEDSWAP
if (!newinofmt && NEEDSWAP)
if (!newinofmt && !doinglevel2 && NEEDSWAP)
if (!newinofmt && NEEDSWAP) {
if (oldlen != 0 && !newinofmt && !doinglevel2 && NEEDSWAP)