I inherited a PCI enumeration function that was nearly 6000 lines long.
I broke it down into a lot of smaller, well defined functions with proper error checking, minimal parameter passing rather than whole structures (yes I know that it makes for longer assembler code, but it cuts down on data exposure), no globals (except for a table containing the pointer entry for each PCI root), fully commented, etc.
Nearly 2 decades later, at another company, I had to work on certifying a PCI software component. To my shock/surprise, it was my old code, complete with my name still at the head of the code change history! I was dreading such old code being pulled apart for very detailed testing of the requirements, but pleasantly surprised that no errors were shown up by that testing. And nobody commented on my name being at the top of the file history.
I had to think carefully if my 20+ year old code and me being part of the certification team would cause "independence problems", but the DER was happy that I pointed it out, and happy enough that I was a different person to the one who wrote it.