I went to the dark side in the last few days to meet the milestones. The C code is just simply a FORTRAN translation regardless the coding style. The messy code really annoys me when I decided to debug it. So I stepped aside to find a pain relief first.
Here is the light of the dark side, GNU indent, it does not refine your algorithm or logic, but polish your code to make it more readable. The indent has 3 built-in styles: K&R, GNU and BSD/KNF. None of them is my cup of tea, then I decided to hack a BSD/Allman from BSD/KNF style, like this:
-nbad -bap -bbo -nbc -bli0 -c33 -cd33 -ncdb -nce -nlp -ci3 -cli0 -cp33 -cs -d0 -di1 -nfc1 -nfca -hnl -ts4 -i4 -ip0 -l75 -npcs -nprs -npsl -saf -sai -saw -nsc -nsob -nss
You can use the long argument above in indent, or copy it to $HOME/.indent.pro as the default indent style.