[arm64] Used casting to avoid pointer arythmetic errors