#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;
	
	printf("Bob: %zu\n", bob);
	
	for (int i = 0; i < 32; ++i) {
		atomic_set_bit(&bob, i);
		printf("Bob: %zu\n", bob);
		bob = 0;
	}
	
	return 0;
}
