Do we know what this function is used for yet? Without that its going to be hard to guess what the variables are doing. I do the same approach for when I reverse, make a rubbish c version, clean it up, play with it until I can work out what each variable does, rewrite the function with correct names.