SMS: Software Verification for Weak Memory via Program Transformation