Prototype
int __compare_and_swap (volatile int* addr, int* old_val_addr, int
new_val);
int __compare_and_swaplp (volatile long* addr, long* old_val_addr, long
new_val);
Refer to
https://www.ibm.com/docs/en/xl-c-and-cpp-aix/16.1?topic=functions-compare-swap-compare-swaplp
i dont think we need to check for the extractvalue instructions, they can be optimized away in theory.