There are some things wrong with the code. The most important one: You are never calling the random number generator. This line here:
printf("random: %lu\n", WELLRNG512);
Prints the address of the WELLRNG512 function. It doesn't call it. To fix this try:
printf("random: %lu\n", WELLRNG512());
Second: The state array have to be filled with random data. Just for testing I threw something together based on the rand() function. That may or may not be a clever way to seed the state array, but it is good enough to get some random data out of your function.
/* seed the state array */
for (i = 0; i < 16; i++)
state[i] = rand()^(rand()<<16)^(rand()<<31);
Last thing: The function WELLRNG512 increments the index variable itself. There is no need to do this in the test loop found in main.
My complete main function looks like this:
int main (void) {
int i;
/* seed */
for (i = 0; i < 16; i++)
state[i] = rand()^(rand()<<16)^(rand()<<31);
for (i = 0; i < 16; i++) {
printf("random: %lu\n", WELLRNG512());
}
return 0;
}
That should fix your problems.