#include <stdio.h>

unsigned compress_maskA9_reversed1(unsigned x)
{
    // result: he00 | 00ca;
    return (((x & 0x09)*0x88000000 >> 28) & 0x0C) | (((x & 0xA0)*0x04800000) >> 30);
}

unsigned compress_maskA9_reversed2(unsigned x)
{
    return ((x & 0xA8)*0x12400000 >> 29) | (x & 0x01) << 3; // result: 0eca | h000
}

int main(void) {
	// your code goes here
	unsigned i;
	printf("Start\n");
	for (i = 0; i < 256; ++i)
	{
		// abcdefgh -> 0000heca
		unsigned r = (i & 0x01) << 3 | (i & 0x08) >> 1 | (i & 0x20) >> 4 | (i >> 7);
		if (compress_maskA9_reversed1(i) != r)
		{
			printf("(1) Error at %u\n", i);
		}
		if (compress_maskA9_reversed2(i) != r)
		{
			printf("(2) Error at %u\n", i);
		}
	}
	printf("Finished\n");
	
	return 0;
}
