#include <string.h>
#include <stdint.h>
#include <stdio.h>

#define N (64*1048576)

int main(int argc, char *argv[])
{
	unsigned int * xptr = malloc(N * sizeof(*xptr));
	/* Smear xptr origin. */
	__asm__("" : "=m" (xptr) : "m" (xptr));

	unsigned int * restrict b1 = xptr;
	memset(b1, 0xff, N * sizeof(*xptr));
	unsigned int * restrict b2 = malloc(N * sizeof(*b2));

	b2[0] = 1;
	for (int i = 1; i < N; i++) {
		/* bswap - poor man's anti-autovectorization */
		b2[i] = __builtin_bswap32(b1[i - 1]);
		b2[i] |= __builtin_bswap32(b1[i]);
	}

	printf("%d\n", b2[N]);
}
