Why is Marshal.WriteInt64 method's code so complex?
===

The code below is been reflected form .Net Framework:

    [SecurityCritical]
    public static unsafe void WriteInt64(IntPtr ptr, int ofs, long val){
        try{
            byte* numPtr = (byte*) (((void*) ptr) + ofs);
            if ((((int) numPtr) & 7) == 0){
                *((long*) numPtr) = val;
            }
            else{
                byte* numPtr2 = (byte*) &val;
                numPtr[0] = numPtr2[0];
                numPtr[1] = numPtr2[1];
                numPtr[2] = numPtr2[2];
                numPtr[3] = numPtr2[3];
                numPtr[4] = numPtr2[4];
                numPtr[6] = numPtr2[6];
                numPtr[7] = numPtr2[7];
            }
        }
        catch (NullReferenceException){
            throw new AccessViolationException();
        }
    }

In my opinion, `*((long*) numPtr) = val` is enough, and very efficient.

Why so complex?