A basic C implementation of Vose's alias method