The most unmaintainable code I ever saw was in the mid 1990s, when I had a job as a maintenance programmer for some accounting software which was specialized towards bakeries.
After some searching it appears that, to my astonishment, this program is still around.
http://www.compubake.com
The version which I maintained at that time was a DOS program, written in (I think) an early version of Microsoft BASIC. The system had been originally developed in the late 1980s, or very early 1990s, and I was told that the sole developer had since died, so he couldn't be consulted. Before that unfortunate event though the code had been compressed, to remove any non-functional spaces or tabs (including indentation), to make all variables into two or three character mnemonics and to concatenate lines of code together, such that the program was as small as possible. This meant that it was practically impossible to read.
If anything went wrong there were a couple of separate utility programs which could be used to repair the database, but failing that the unfortunate baker just had to start again from scratch.
Amongst the couple of other software engineers that I worked with at that time, the name of this program became synonymous with bad coding.