Apologies, you are correct re this code: the data is in host-endianness but still packed for wire-alignment... despite having added that comment, I had forgotten just how baroque this code is!  So _test/sam.c_ does indeed need fixing, though the right fix is to check `p[2..5]` as a host int (module alignment concerns) rather than a string.