/* Load the whole word from unaligned buffer Keep in your mind that it is byte loading on little-endian system  */
static u32 load_word(const void *buf, u32 swap)
/* Load the whole word from unaligned buffer Keep in your mind that it is byte loading on little-endian system  */
static u32 load_word(const void *buf, u32 swap)
{
	u32 word = 0;
	u8 *bitc = (u8 *)buf;
	int p;
	if (swap == SWAP_NO) {
		for (p = 0; p < 4; p++) {
			word <<= 8;
			word |= bitc[p];
		}
	} else {
		for (p = 3; p >= 0; p--) {
			word <<= 8;
			word |= bitc[p];
		}
	}
	return word;
}