#include <time.h>
#include <stdio.h>
#define N 1048576
int arr[N*2];
int arr2[N*2];
int main() {
int i, j, k, s, t;
volatile int w;
for (i=0; i<10; ++i) {
for (j=0; j<N; ++j) {
arr2[j*2]=arr[j]=rand(), arr2[j*2+1]=arr[j+N]=rand();
}
asm("":::"memory");
s=0;
t=clock();
for (j=0; j<N; ++j) {
if (s<arr[j])s+=arr[j+N];
}
w = s;
printf("%12d<%08X>", clock()-t, s);
s=0;
t=clock();
for (j=0; j<N; ++j) {
if (s<arr2[j*2])s+=arr2[j*2+1];
}
w = s;
printf("%12d<%08X>", clock()-t, s);
}
}