C Code implementation of ARemSP and it's parallel version