pointer wrestling in C is bad enough, translating such code is one of worst tasks you can get, good luck :/