god I hate reading C code. dude passes `&foo` to a function - is it reading from it? is it writing to it? who knows.