convert subroutine 6C9627 to C

Ok, trying this again. The addresses 0x00F44A06, etc are used all over the place so I figured trying to move a subroutine into C would give me a better idea what they actually do. Now that I've done that I'm not sure that I have a better grasp on it. However I would appreciate if you could review the code to see if I actually decompiled it properly.