If I had to make a wild guess I would say they are back feeding the sub-panel and the MLO lugs are being used to feed something else. Where does that wire go?
To start with the rag wire is only 3 conductor with no insulated neutral. I imagine we can go from there to fill out a page of violations