Efficient and correct transactional memory programs combining snapshot isolation and static analysis