code simplification
When compiling with sanitizers, GCC outputs warnings about functions which are "too complicated" for accurate variable tracking. Since even the compiler ends up getting confused, the code probably warrants a second look to try and simplify these functions.
This is phase 1 of the fixes; more notes on where to fix things are sitting in a local branch.
Edited by Ben Boeckel