Python
def r64(addr):

    # this will fail if addr - 0x50 is null, but we can detect that and return False

    storage_type1 = ctypes.c_uint64(0)

    storage_type2 = ctypes.c_uint64(0)

    mx.base._LIB.MXNDArrayGetStorageType(ctypes.c_void_p(addr-0x50), ctypes.byref(storage_type1))

    mx.base._LIB.MXNDArrayGetStorageType(ctypes.c_void_p(addr-0x50+4), ctypes.byref(storage_type2))

    if storage_type1.value == 0xffffffff or storage_type2.value == 0xffffffff:

        return False

    ret = (storage_type2.value << 32) | storage_type1.value

    return ret