unsigned int convert_order32(unsigned int before) { int i; unsigned int r = 0; for(i = 0; i < 32; ++i) { if(before&1<<i) { r=r|1<<(31-i)/4*4+i%4; } } return r; }
0x12345678 -> 0x21436587
r=r|1<<(i/4%2?(i/4-1)*4+i%4:(i/4+1)*4+i%4);
0x12345678 -> 0x78563412
r=r|1<<(i/4%2?(7-(i/4-1))*4+i%4:(7-(i/4+1))*4+i%4);