g++ -mrtm
#include <immintrin.h> retry: int st = _xbegin(); if (st == _XBEGIN_STARTED) { sum += s; _xend(); } else { goto retry; }