Making a pure C version wasn't worthwhile. Evil twisted code full of vague implications, lots of undefined stuff. Maybe it isn't very strange that your port didn't work, I have some trouble understanding what the original code does.