Port thunk16 code from MSFT to GCC assembly.