Comment
Comment by Turskarama
There's a lot that can be, take this for instance (line 3336):
This could be turned into a pure function that takes c and print_state as input, and returns a new print_state which the outer function assigns. That's 12 lines turned into 1.
(I am not a C developer so the sytax could be wrong).
Just because the outer function is impure doesn't mean it can't in turn call pure functions.