use uint32_t for instruction storage. This fixes operation on big endian 64bit MIPS
What does this have to do with big endianess? You're basically moving 8 bytes forward and then 4 bytes backwards. What system is this on?
it is MIPS64EB. Unsigned long is 8 bytes, instruction is 4 bytes, so it copies wrong data (it copies zeroes)