I had never linearized SM5 code before, so I got the LSFR code out of increment_pc(). I guess I did it wrong, but I'm confused that my mistake resulted in shifting the wrong half of the file....
I'm not sure what went wrong with the SVG. I used Inkscape under Windows, and didn't hand-edit the file. I did paste in the titles from a spreadsheet that I had made with the segment info, so maybe that added in extra linefeeds.