#include <stdio.h>
#include <stdint.h>
void atomic_set_bit(uint32_t *address, int bit)
{
__sync_fetch_and_or(address, 1 << bit);
}
int main(){
uint32_t bob = 0;
for (int i = 0; i < 32; ++i) {
atomic_set_bit(&bob, i);
bob = 0;
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRpbnQuaD4KCnZvaWQgYXRvbWljX3NldF9iaXQodWludDMyX3QgKmFkZHJlc3MsIGludCBiaXQpCnsKCV9fc3luY19mZXRjaF9hbmRfb3IoYWRkcmVzcywgMSA8PCBiaXQpOwp9CgppbnQgbWFpbigpewoJdWludDMyX3QgYm9iID0gMDsKCQoJcHJpbnRmKCJCb2I6ICV6dVxuIiwgYm9iKTsKCQoJZm9yIChpbnQgaSA9IDA7IGkgPCAzMjsgKytpKSB7CgkJYXRvbWljX3NldF9iaXQoJmJvYiwgaSk7CgkJcHJpbnRmKCJCb2I6ICV6dVxuIiwgYm9iKTsKCQlib2IgPSAwOwoJfQoJCglyZXR1cm4gMDsKfQo=