Analyzing Concurrent Algorithms under Weak Memory Orderings