#if TARGET_CPU_X86
Were not being evaluated by the compiler as true when the arch was x86_64.
Most of those sections were dealing with endianess so on the x86_64 arch the mac utils were converting numbers using big-endian
strategies.
I don't see TARGET_CPU_X86_64 documented clearly but when debugging code running as an x86_64 arch execution clearly skips
blocks that check for TARGET_CPU_X86
replacing those line with:
#if TARGET_RT_LITTLE_ENDIAN
made those routines work.
I changed a few other places which weren't dealing with endianess to:
#if TARGET_CPU_X86 || TARGET_CPU_X86_64
need to confirm that TARGET_CPU_X86_64 is actually set when compiling on a mac in x86_64 arch.