/* The function takes pointer to previous 32 bit value and modifies it to next value.  */
void lfsr32(uint32_t *lfsr_ptr)
/* The function takes pointer to previous 32 bit value and modifies it to next value.  */
void lfsr32(uint32_t *lfsr_ptr)
{
	uint32_t bit;
	uint32_t lfsr;
	int i;
	lfsr = *lfsr_ptr;
	for (i = 0; i < 32; i++) {
		bit = 1 ^ (lfsr & 1);
		bit = bit ^ ((lfsr & 2) >> 1);
		bit = bit ^ ((lfsr & 4) >> 2);
		bit = bit ^ ((lfsr & 0x400000) >> 22);
		lfsr = ((lfsr >> 1) | (bit << 31));
	}
	*lfsr_ptr = lfsr;
}